From 7b4641038bd3b01356a76ecc281373456f62ec61 Mon Sep 17 00:00:00 2001 From: public govdpub Date: Fri, 30 Dec 2022 11:40:00 +0800 Subject: [PATCH 001/296] Add README.md --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 -- Gitee From 6ba728cbb31d141d69104a8ae0ce57d2c1f6c6fd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 21 May 2020 20:14:05 +0800 Subject: [PATCH 002/296] Match-id-ce3da6e26aa2a28829a6ff0395470d6f43a9796a --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e69de29..21aabf8 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,2 @@ +# ascend-docker-plugin + -- Gitee From 45a23dceae43fc5807905620e39e26c9460b9d1f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 27 May 2020 16:42:58 +0800 Subject: [PATCH 003/296] Match-id-515db564370c501883bd877581f460290f764189 --- cli/.gitignore | 3 + cli/README.txt | 1 + cli/src/CMakeLists.txt | 5 + cli/src/main.c | 666 + cli/test/CMakeLists.txt | 157 + cli/test/include/gtest/UdpSocket.h | 220 + cli/test/include/gtest/gtest-death-test.h | 283 + cli/test/include/gtest/gtest-message.h | 230 + cli/test/include/gtest/gtest-param-test.h | 1421 + cli/test/include/gtest/gtest-printers.h | 796 + cli/test/include/gtest/gtest-spi.h | 232 + cli/test/include/gtest/gtest-test-part.h | 180 + cli/test/include/gtest/gtest-typed-test.h | 259 + cli/test/include/gtest/gtest.h | 2552 ++ cli/test/include/gtest/gtest_pred_impl.h | 371 + cli/test/include/gtest/gtest_prod.h | 58 + .../internal/gtest-death-test-internal.h | 308 + .../include/gtest/internal/gtest-filepath.h | 210 + .../include/gtest/internal/gtest-internal.h | 1280 + .../include/gtest/internal/gtest-linked_ptr.h | 233 + .../internal/gtest-param-util-generated.h | 4822 +++ .../gtest-param-util-generated.h.pump | 301 + .../include/gtest/internal/gtest-param-util.h | 628 + cli/test/include/gtest/internal/gtest-port.h | 1782 + .../include/gtest/internal/gtest-string.h | 350 + cli/test/include/gtest/internal/gtest-tuple.h | 968 + .../include/gtest/internal/gtest-tuple.h.pump | 336 + .../include/gtest/internal/gtest-type-util.h | 3330 ++ .../gtest/internal/gtest-type-util.h.pump | 296 + cli/test/include/gtest/msxml6.h | 27093 ++++++++++++++++ cli/test/include/gtest/msxml6.idl | 3934 +++ cli/test/include/gtest/msxml6did.h | 660 + cli/test/include/gtest/tinystr.h | 294 + cli/test/include/gtest/tinyxml.h | 1511 + cli/test/include/mockcpp/AfterMatchBuilder.h | 58 + .../include/mockcpp/AfterMatchBuilder.tcc | 58 + cli/test/include/mockcpp/AfterMatcher.h | 56 + cli/test/include/mockcpp/ApiHook.h | 24 + cli/test/include/mockcpp/ApiHookFunctor.h | 167 + cli/test/include/mockcpp/ApiHookGenerator.h | 75 + cli/test/include/mockcpp/ApiHookHolder.h | 19 + .../include/mockcpp/ApiHookHolderFactory.h | 23 + cli/test/include/mockcpp/ApiHookKey.h | 50 + cli/test/include/mockcpp/ApiHookMocker.h | 125 + cli/test/include/mockcpp/ArgumentsList.h | 43 + cli/test/include/mockcpp/ArgumentsListDef.h | 13 + .../include/mockcpp/ArgumentsListDef.h.rule | 1 + .../include/mockcpp/ArgumentsMacroHelpers.h | 67 + .../include/mockcpp/ArgumentsMatchBuilder.h | 77 + .../include/mockcpp/ArgumentsMatchBuilder.tcc | 87 + cli/test/include/mockcpp/Asserter.h | 61 + .../include/mockcpp/AssertionFailedError.h | 45 + cli/test/include/mockcpp/BeforeMatchBuilder.h | 59 + .../include/mockcpp/BeforeMatchBuilder.tcc | 59 + cli/test/include/mockcpp/BeforeMatcher.h | 56 + cli/test/include/mockcpp/CallerMatchBuilder.h | 48 + .../include/mockcpp/CallerMatchBuilder.tcc | 37 + cli/test/include/mockcpp/CallerMatcher.h | 45 + .../include/mockcpp/ChainableMockMethod.h | 133 + .../mockcpp/ChainableMockMethodContainer.h | 54 + .../include/mockcpp/ChainableMockMethodCore.h | 89 + .../mockcpp/ChainableMockMethodIndexKey.h | 46 + .../include/mockcpp/ChainableMockMethodKey.h | 36 + .../mockcpp/ChainableMockMethodNameKey.h | 46 + .../include/mockcpp/ChainableMockObject.h | 69 + .../include/mockcpp/ChainableMockObjectBase.h | 75 + cli/test/include/mockcpp/ChainingMockHelper.h | 254 + cli/test/include/mockcpp/CheckWith.h | 56 + cli/test/include/mockcpp/CodeModifier.h | 35 + cli/test/include/mockcpp/Constraint.h | 40 + cli/test/include/mockcpp/ConstraintSet.h | 64 + .../include/mockcpp/DecoratedConstraint.h | 57 + cli/test/include/mockcpp/DefaultBuilder.h | 47 + cli/test/include/mockcpp/DefaultMatcher.h | 40 + .../mockcpp/DefaultMethodAddrGetterDef.h | 500 + .../mockcpp/DefaultMethodAddrGetterDef.h.rule | 1 + cli/test/include/mockcpp/DefaultStub.h | 48 + cli/test/include/mockcpp/DelegatedMethod.h | 76 + cli/test/include/mockcpp/DelegatedMethodDef.h | 26 + .../include/mockcpp/DelegatedMethodDef.h.rule | 1 + .../mockcpp/DelegatedMethodGetByVptrDef.h | 5 + .../DelegatedMethodGetByVptrDef.h.rule | 1 + .../include/mockcpp/DelegatedMethodGetDef.h | 100 + .../mockcpp/DelegatedMethodGetDef.h.rule | 1 + .../include/mockcpp/DelegatedMethodGetter.h | 84 + .../include/mockcpp/DestructorAddrGetterDef.h | 5 + .../mockcpp/DestructorAddrGetterDef.h.rule | 1 + cli/test/include/mockcpp/DestructorChecker.h | 58 + cli/test/include/mockcpp/DieStub.h | 47 + cli/test/include/mockcpp/DummyBuilder.h | 31 + cli/test/include/mockcpp/EqualityUtil.h | 43 + cli/test/include/mockcpp/Exception.h | 56 + cli/test/include/mockcpp/ExpectsMatcher.h | 48 + cli/test/include/mockcpp/Formatter.h | 92 + cli/test/include/mockcpp/Functor.h | 124 + .../mockcpp/GenericMethodIndicesChecker.h | 65 + cli/test/include/mockcpp/GlobalMockObject.h | 65 + .../include/mockcpp/GnuMethodIndicesChecker.h | 40 + .../include/mockcpp/GnuMethodInfoReader.h | 105 + cli/test/include/mockcpp/HookMockObject.h | 64 + cli/test/include/mockcpp/IdentityBuilder.h | 42 + cli/test/include/mockcpp/Ignore.h | 46 + cli/test/include/mockcpp/IgnoreHandler.h | 46 + .../include/mockcpp/IgnoreResultHandler.h | 39 + .../mockcpp/IgnoreResultHandlerFactory.h | 43 + cli/test/include/mockcpp/IgnoreReturnStub.h | 44 + cli/test/include/mockcpp/IncrementStub.h | 110 + .../include/mockcpp/IndexInvokableGetter.h | 39 + cli/test/include/mockcpp/InterfaceInfo.h | 39 + cli/test/include/mockcpp/Invocation.h | 73 + cli/test/include/mockcpp/InvocationId.h | 41 + .../include/mockcpp/InvocationMockBuilder.h | 47 + .../include/mockcpp/InvocationMockBuilder.tcc | 39 + .../mockcpp/InvocationMockBuilderGetter.h | 59 + cli/test/include/mockcpp/InvocationMocker.h | 63 + .../mockcpp/InvocationMockerContainer.h | 44 + .../mockcpp/InvocationMockerNamespace.h | 41 + .../include/mockcpp/InvocationMockerSet.h | 61 + .../include/mockcpp/InvocationTimesMatcher.h | 51 + .../mockcpp/InvocationWithReturnType.h | 52 + cli/test/include/mockcpp/Invokable.h | 65 + cli/test/include/mockcpp/InvokedAtLeast.h | 45 + cli/test/include/mockcpp/InvokedAtMost.h | 47 + cli/test/include/mockcpp/InvokedExactly.h | 45 + cli/test/include/mockcpp/InvokedOnce.h | 42 + .../include/mockcpp/InvokedTimesMatcher.h | 52 + cli/test/include/mockcpp/InvokedTimesReader.h | 36 + .../include/mockcpp/InvokedTimesRecorder.h | 36 + cli/test/include/mockcpp/IsAnything.h | 42 + cli/test/include/mockcpp/IsAnythingHelper.h | 37 + cli/test/include/mockcpp/IsConst.h | 49 + cli/test/include/mockcpp/IsEqual.h | 58 + cli/test/include/mockcpp/IsGreaterThan.h | 59 + cli/test/include/mockcpp/IsLessThan.h | 58 + cli/test/include/mockcpp/IsMirror.h | 181 + cli/test/include/mockcpp/IsNotEqual.h | 58 + cli/test/include/mockcpp/IsRef.h | 56 + cli/test/include/mockcpp/IsStringContains.h | 37 + cli/test/include/mockcpp/IsStringEndWith.h | 37 + cli/test/include/mockcpp/IsStringStartWith.h | 37 + cli/test/include/mockcpp/JmpCode.h | 45 + cli/test/include/mockcpp/Matcher.h | 42 + cli/test/include/mockcpp/Method.h | 47 + .../include/mockcpp/MethodIndiceChecker.h | 48 + .../include/mockcpp/MethodIndiceCheckerDef.h | 500 + .../mockcpp/MethodIndiceCheckerDef.h.rule | 1 + cli/test/include/mockcpp/MethodInfoReader.h | 35 + cli/test/include/mockcpp/MethodTypeTraits.h | 56 + .../include/mockcpp/MethodTypeTraitsDef.h | 26 + .../mockcpp/MethodTypeTraitsDef.h.rule | 1 + .../include/mockcpp/MismatchResultHandler.h | 51 + .../mockcpp/MismatchResultHandlerFactory.h | 43 + cli/test/include/mockcpp/MockBuilder.h | 56 + cli/test/include/mockcpp/MockObject.h | 181 + cli/test/include/mockcpp/MockObjectBase.h | 72 + cli/test/include/mockcpp/MockObjectHelper.h | 46 + cli/test/include/mockcpp/MoreStubBuilder.h | 47 + cli/test/include/mockcpp/MoreStubBuilder.tcc | 33 + .../include/mockcpp/MsvcMethodInfoReader.h | 85 + cli/test/include/mockcpp/MsvcRtti.h | 76 + .../include/mockcpp/NormalResultHandler.h | 46 + .../mockcpp/NormalResultHandlerFactory.h | 43 + cli/test/include/mockcpp/ObjNameGetter.h | 38 + cli/test/include/mockcpp/OrderingMatcher.h | 39 + cli/test/include/mockcpp/OutBound.h | 60 + cli/test/include/mockcpp/OutBoundPointer.h | 129 + cli/test/include/mockcpp/OutputStringStream.h | 25 + .../mockcpp/ParameterizedApiHookHolder.h | 38 + cli/test/include/mockcpp/PendingMatcher.h | 66 + cli/test/include/mockcpp/ProcStub.h | 196 + cli/test/include/mockcpp/ProcessWith.h | 58 + cli/test/include/mockcpp/RepeatMacros.h | 70 + cli/test/include/mockcpp/RepeatStub.h | 49 + cli/test/include/mockcpp/ReportFailure.h | 51 + cli/test/include/mockcpp/Result.h | 50 + cli/test/include/mockcpp/ResultHandler.h | 40 + .../include/mockcpp/ResultHandlerFactory.h | 46 + cli/test/include/mockcpp/ReturnObjectList.h | 64 + cli/test/include/mockcpp/ReturnStub.h | 48 + cli/test/include/mockcpp/SelfDescribe.h | 36 + .../mockcpp/SimpleInvocationRecorder.h | 44 + cli/test/include/mockcpp/Spy.h | 55 + cli/test/include/mockcpp/StatelessMatcher.h | 39 + cli/test/include/mockcpp/StringConstraint.h | 47 + cli/test/include/mockcpp/StringPredict.h | 39 + cli/test/include/mockcpp/Stub.h | 41 + cli/test/include/mockcpp/StubBuilder.h | 47 + cli/test/include/mockcpp/StubBuilder.tcc | 33 + cli/test/include/mockcpp/StubContainer.h | 52 + cli/test/include/mockcpp/StubsBuilder.h | 44 + cli/test/include/mockcpp/StubsMatcher.h | 40 + cli/test/include/mockcpp/TestFailureMatcher.h | 45 + cli/test/include/mockcpp/ThenStub.h | 49 + cli/test/include/mockcpp/ThrowExceptionStub.h | 74 + cli/test/include/mockcpp/TypeString.h | 53 + cli/test/include/mockcpp/TypeTraits.h | 108 + cli/test/include/mockcpp/TypelessConstraint.h | 37 + .../mockcpp/TypelessConstraintAdapter.h | 48 + cli/test/include/mockcpp/TypelessStub.h | 42 + .../include/mockcpp/TypelessStubAdapter.h | 50 + cli/test/include/mockcpp/VirtualTable.h | 61 + cli/test/include/mockcpp/VirtualTableUtils.h | 34 + cli/test/include/mockcpp/Void.h | 31 + cli/test/include/mockcpp/VoidResultHandler.h | 56 + .../mockcpp/VoidResultHandlerFactory.h | 46 + cli/test/include/mockcpp/WillStub.h | 49 + cli/test/include/mockcpp/WinCodeModifier.h | 35 + cli/test/include/mockcpp/mockable.h | 33 + cli/test/include/mockcpp/mockcpp.h | 92 + cli/test/include/mockcpp/mockcpp.hpp | 29 + cli/test/include/mockcpp/mokc.h | 52 + cli/test/include/mockcpp/types/Any.h | 75 + cli/test/include/mockcpp/types/AnyBase.h | 71 + cli/test/include/mockcpp/types/AnyCast.h | 166 + cli/test/include/mockcpp/types/Holder.h | 65 + cli/test/include/mockcpp/types/PlaceHolder.h | 48 + cli/test/include/mockcpp/types/RefAny.h | 81 + cli/test/include/mockcpp/types/RefHolder.h | 58 + cli/test/include/mockcpp/types/ValueHolder.h | 298 + cli/test/include/mockcpp/utils.h | 59 + cli/test/testcase/CMakeCache.txt | 304 + cli/test/testcase/Makefile | 208 + cli/test/testcase/gtest_mytestcase.cpp | 70 + cli/test/testcase/main.cpp | 40 + 224 files changed, 67778 insertions(+) create mode 100644 cli/.gitignore create mode 100644 cli/README.txt create mode 100644 cli/src/CMakeLists.txt create mode 100644 cli/src/main.c create mode 100644 cli/test/CMakeLists.txt create mode 100644 cli/test/include/gtest/UdpSocket.h create mode 100644 cli/test/include/gtest/gtest-death-test.h create mode 100644 cli/test/include/gtest/gtest-message.h create mode 100644 cli/test/include/gtest/gtest-param-test.h create mode 100644 cli/test/include/gtest/gtest-printers.h create mode 100644 cli/test/include/gtest/gtest-spi.h create mode 100644 cli/test/include/gtest/gtest-test-part.h create mode 100644 cli/test/include/gtest/gtest-typed-test.h create mode 100644 cli/test/include/gtest/gtest.h create mode 100644 cli/test/include/gtest/gtest_pred_impl.h create mode 100644 cli/test/include/gtest/gtest_prod.h create mode 100644 cli/test/include/gtest/internal/gtest-death-test-internal.h create mode 100644 cli/test/include/gtest/internal/gtest-filepath.h create mode 100644 cli/test/include/gtest/internal/gtest-internal.h create mode 100644 cli/test/include/gtest/internal/gtest-linked_ptr.h create mode 100644 cli/test/include/gtest/internal/gtest-param-util-generated.h create mode 100644 cli/test/include/gtest/internal/gtest-param-util-generated.h.pump create mode 100644 cli/test/include/gtest/internal/gtest-param-util.h create mode 100644 cli/test/include/gtest/internal/gtest-port.h create mode 100644 cli/test/include/gtest/internal/gtest-string.h create mode 100644 cli/test/include/gtest/internal/gtest-tuple.h create mode 100644 cli/test/include/gtest/internal/gtest-tuple.h.pump create mode 100644 cli/test/include/gtest/internal/gtest-type-util.h create mode 100644 cli/test/include/gtest/internal/gtest-type-util.h.pump create mode 100644 cli/test/include/gtest/msxml6.h create mode 100644 cli/test/include/gtest/msxml6.idl create mode 100644 cli/test/include/gtest/msxml6did.h create mode 100644 cli/test/include/gtest/tinystr.h create mode 100644 cli/test/include/gtest/tinyxml.h create mode 100644 cli/test/include/mockcpp/AfterMatchBuilder.h create mode 100644 cli/test/include/mockcpp/AfterMatchBuilder.tcc create mode 100644 cli/test/include/mockcpp/AfterMatcher.h create mode 100644 cli/test/include/mockcpp/ApiHook.h create mode 100644 cli/test/include/mockcpp/ApiHookFunctor.h create mode 100644 cli/test/include/mockcpp/ApiHookGenerator.h create mode 100644 cli/test/include/mockcpp/ApiHookHolder.h create mode 100644 cli/test/include/mockcpp/ApiHookHolderFactory.h create mode 100644 cli/test/include/mockcpp/ApiHookKey.h create mode 100644 cli/test/include/mockcpp/ApiHookMocker.h create mode 100644 cli/test/include/mockcpp/ArgumentsList.h create mode 100644 cli/test/include/mockcpp/ArgumentsListDef.h create mode 100644 cli/test/include/mockcpp/ArgumentsListDef.h.rule create mode 100644 cli/test/include/mockcpp/ArgumentsMacroHelpers.h create mode 100644 cli/test/include/mockcpp/ArgumentsMatchBuilder.h create mode 100644 cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc create mode 100644 cli/test/include/mockcpp/Asserter.h create mode 100644 cli/test/include/mockcpp/AssertionFailedError.h create mode 100644 cli/test/include/mockcpp/BeforeMatchBuilder.h create mode 100644 cli/test/include/mockcpp/BeforeMatchBuilder.tcc create mode 100644 cli/test/include/mockcpp/BeforeMatcher.h create mode 100644 cli/test/include/mockcpp/CallerMatchBuilder.h create mode 100644 cli/test/include/mockcpp/CallerMatchBuilder.tcc create mode 100644 cli/test/include/mockcpp/CallerMatcher.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethod.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethodContainer.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethodCore.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethodIndexKey.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethodKey.h create mode 100644 cli/test/include/mockcpp/ChainableMockMethodNameKey.h create mode 100644 cli/test/include/mockcpp/ChainableMockObject.h create mode 100644 cli/test/include/mockcpp/ChainableMockObjectBase.h create mode 100644 cli/test/include/mockcpp/ChainingMockHelper.h create mode 100644 cli/test/include/mockcpp/CheckWith.h create mode 100644 cli/test/include/mockcpp/CodeModifier.h create mode 100644 cli/test/include/mockcpp/Constraint.h create mode 100644 cli/test/include/mockcpp/ConstraintSet.h create mode 100644 cli/test/include/mockcpp/DecoratedConstraint.h create mode 100644 cli/test/include/mockcpp/DefaultBuilder.h create mode 100644 cli/test/include/mockcpp/DefaultMatcher.h create mode 100644 cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h create mode 100644 cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule create mode 100644 cli/test/include/mockcpp/DefaultStub.h create mode 100644 cli/test/include/mockcpp/DelegatedMethod.h create mode 100644 cli/test/include/mockcpp/DelegatedMethodDef.h create mode 100644 cli/test/include/mockcpp/DelegatedMethodDef.h.rule create mode 100644 cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h create mode 100644 cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule create mode 100644 cli/test/include/mockcpp/DelegatedMethodGetDef.h create mode 100644 cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule create mode 100644 cli/test/include/mockcpp/DelegatedMethodGetter.h create mode 100644 cli/test/include/mockcpp/DestructorAddrGetterDef.h create mode 100644 cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule create mode 100644 cli/test/include/mockcpp/DestructorChecker.h create mode 100644 cli/test/include/mockcpp/DieStub.h create mode 100644 cli/test/include/mockcpp/DummyBuilder.h create mode 100644 cli/test/include/mockcpp/EqualityUtil.h create mode 100644 cli/test/include/mockcpp/Exception.h create mode 100644 cli/test/include/mockcpp/ExpectsMatcher.h create mode 100644 cli/test/include/mockcpp/Formatter.h create mode 100644 cli/test/include/mockcpp/Functor.h create mode 100644 cli/test/include/mockcpp/GenericMethodIndicesChecker.h create mode 100644 cli/test/include/mockcpp/GlobalMockObject.h create mode 100644 cli/test/include/mockcpp/GnuMethodIndicesChecker.h create mode 100644 cli/test/include/mockcpp/GnuMethodInfoReader.h create mode 100644 cli/test/include/mockcpp/HookMockObject.h create mode 100644 cli/test/include/mockcpp/IdentityBuilder.h create mode 100644 cli/test/include/mockcpp/Ignore.h create mode 100644 cli/test/include/mockcpp/IgnoreHandler.h create mode 100644 cli/test/include/mockcpp/IgnoreResultHandler.h create mode 100644 cli/test/include/mockcpp/IgnoreResultHandlerFactory.h create mode 100644 cli/test/include/mockcpp/IgnoreReturnStub.h create mode 100644 cli/test/include/mockcpp/IncrementStub.h create mode 100644 cli/test/include/mockcpp/IndexInvokableGetter.h create mode 100644 cli/test/include/mockcpp/InterfaceInfo.h create mode 100644 cli/test/include/mockcpp/Invocation.h create mode 100644 cli/test/include/mockcpp/InvocationId.h create mode 100644 cli/test/include/mockcpp/InvocationMockBuilder.h create mode 100644 cli/test/include/mockcpp/InvocationMockBuilder.tcc create mode 100644 cli/test/include/mockcpp/InvocationMockBuilderGetter.h create mode 100644 cli/test/include/mockcpp/InvocationMocker.h create mode 100644 cli/test/include/mockcpp/InvocationMockerContainer.h create mode 100644 cli/test/include/mockcpp/InvocationMockerNamespace.h create mode 100644 cli/test/include/mockcpp/InvocationMockerSet.h create mode 100644 cli/test/include/mockcpp/InvocationTimesMatcher.h create mode 100644 cli/test/include/mockcpp/InvocationWithReturnType.h create mode 100644 cli/test/include/mockcpp/Invokable.h create mode 100644 cli/test/include/mockcpp/InvokedAtLeast.h create mode 100644 cli/test/include/mockcpp/InvokedAtMost.h create mode 100644 cli/test/include/mockcpp/InvokedExactly.h create mode 100644 cli/test/include/mockcpp/InvokedOnce.h create mode 100644 cli/test/include/mockcpp/InvokedTimesMatcher.h create mode 100644 cli/test/include/mockcpp/InvokedTimesReader.h create mode 100644 cli/test/include/mockcpp/InvokedTimesRecorder.h create mode 100644 cli/test/include/mockcpp/IsAnything.h create mode 100644 cli/test/include/mockcpp/IsAnythingHelper.h create mode 100644 cli/test/include/mockcpp/IsConst.h create mode 100644 cli/test/include/mockcpp/IsEqual.h create mode 100644 cli/test/include/mockcpp/IsGreaterThan.h create mode 100644 cli/test/include/mockcpp/IsLessThan.h create mode 100644 cli/test/include/mockcpp/IsMirror.h create mode 100644 cli/test/include/mockcpp/IsNotEqual.h create mode 100644 cli/test/include/mockcpp/IsRef.h create mode 100644 cli/test/include/mockcpp/IsStringContains.h create mode 100644 cli/test/include/mockcpp/IsStringEndWith.h create mode 100644 cli/test/include/mockcpp/IsStringStartWith.h create mode 100644 cli/test/include/mockcpp/JmpCode.h create mode 100644 cli/test/include/mockcpp/Matcher.h create mode 100644 cli/test/include/mockcpp/Method.h create mode 100644 cli/test/include/mockcpp/MethodIndiceChecker.h create mode 100644 cli/test/include/mockcpp/MethodIndiceCheckerDef.h create mode 100644 cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule create mode 100644 cli/test/include/mockcpp/MethodInfoReader.h create mode 100644 cli/test/include/mockcpp/MethodTypeTraits.h create mode 100644 cli/test/include/mockcpp/MethodTypeTraitsDef.h create mode 100644 cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule create mode 100644 cli/test/include/mockcpp/MismatchResultHandler.h create mode 100644 cli/test/include/mockcpp/MismatchResultHandlerFactory.h create mode 100644 cli/test/include/mockcpp/MockBuilder.h create mode 100644 cli/test/include/mockcpp/MockObject.h create mode 100644 cli/test/include/mockcpp/MockObjectBase.h create mode 100644 cli/test/include/mockcpp/MockObjectHelper.h create mode 100644 cli/test/include/mockcpp/MoreStubBuilder.h create mode 100644 cli/test/include/mockcpp/MoreStubBuilder.tcc create mode 100644 cli/test/include/mockcpp/MsvcMethodInfoReader.h create mode 100644 cli/test/include/mockcpp/MsvcRtti.h create mode 100644 cli/test/include/mockcpp/NormalResultHandler.h create mode 100644 cli/test/include/mockcpp/NormalResultHandlerFactory.h create mode 100644 cli/test/include/mockcpp/ObjNameGetter.h create mode 100644 cli/test/include/mockcpp/OrderingMatcher.h create mode 100644 cli/test/include/mockcpp/OutBound.h create mode 100644 cli/test/include/mockcpp/OutBoundPointer.h create mode 100644 cli/test/include/mockcpp/OutputStringStream.h create mode 100644 cli/test/include/mockcpp/ParameterizedApiHookHolder.h create mode 100644 cli/test/include/mockcpp/PendingMatcher.h create mode 100644 cli/test/include/mockcpp/ProcStub.h create mode 100644 cli/test/include/mockcpp/ProcessWith.h create mode 100644 cli/test/include/mockcpp/RepeatMacros.h create mode 100644 cli/test/include/mockcpp/RepeatStub.h create mode 100644 cli/test/include/mockcpp/ReportFailure.h create mode 100644 cli/test/include/mockcpp/Result.h create mode 100644 cli/test/include/mockcpp/ResultHandler.h create mode 100644 cli/test/include/mockcpp/ResultHandlerFactory.h create mode 100644 cli/test/include/mockcpp/ReturnObjectList.h create mode 100644 cli/test/include/mockcpp/ReturnStub.h create mode 100644 cli/test/include/mockcpp/SelfDescribe.h create mode 100644 cli/test/include/mockcpp/SimpleInvocationRecorder.h create mode 100644 cli/test/include/mockcpp/Spy.h create mode 100644 cli/test/include/mockcpp/StatelessMatcher.h create mode 100644 cli/test/include/mockcpp/StringConstraint.h create mode 100644 cli/test/include/mockcpp/StringPredict.h create mode 100644 cli/test/include/mockcpp/Stub.h create mode 100644 cli/test/include/mockcpp/StubBuilder.h create mode 100644 cli/test/include/mockcpp/StubBuilder.tcc create mode 100644 cli/test/include/mockcpp/StubContainer.h create mode 100644 cli/test/include/mockcpp/StubsBuilder.h create mode 100644 cli/test/include/mockcpp/StubsMatcher.h create mode 100644 cli/test/include/mockcpp/TestFailureMatcher.h create mode 100644 cli/test/include/mockcpp/ThenStub.h create mode 100644 cli/test/include/mockcpp/ThrowExceptionStub.h create mode 100644 cli/test/include/mockcpp/TypeString.h create mode 100644 cli/test/include/mockcpp/TypeTraits.h create mode 100644 cli/test/include/mockcpp/TypelessConstraint.h create mode 100644 cli/test/include/mockcpp/TypelessConstraintAdapter.h create mode 100644 cli/test/include/mockcpp/TypelessStub.h create mode 100644 cli/test/include/mockcpp/TypelessStubAdapter.h create mode 100644 cli/test/include/mockcpp/VirtualTable.h create mode 100644 cli/test/include/mockcpp/VirtualTableUtils.h create mode 100644 cli/test/include/mockcpp/Void.h create mode 100644 cli/test/include/mockcpp/VoidResultHandler.h create mode 100644 cli/test/include/mockcpp/VoidResultHandlerFactory.h create mode 100644 cli/test/include/mockcpp/WillStub.h create mode 100644 cli/test/include/mockcpp/WinCodeModifier.h create mode 100644 cli/test/include/mockcpp/mockable.h create mode 100644 cli/test/include/mockcpp/mockcpp.h create mode 100644 cli/test/include/mockcpp/mockcpp.hpp create mode 100644 cli/test/include/mockcpp/mokc.h create mode 100644 cli/test/include/mockcpp/types/Any.h create mode 100644 cli/test/include/mockcpp/types/AnyBase.h create mode 100644 cli/test/include/mockcpp/types/AnyCast.h create mode 100644 cli/test/include/mockcpp/types/Holder.h create mode 100644 cli/test/include/mockcpp/types/PlaceHolder.h create mode 100644 cli/test/include/mockcpp/types/RefAny.h create mode 100644 cli/test/include/mockcpp/types/RefHolder.h create mode 100644 cli/test/include/mockcpp/types/ValueHolder.h create mode 100644 cli/test/include/mockcpp/utils.h create mode 100644 cli/test/testcase/CMakeCache.txt create mode 100644 cli/test/testcase/Makefile create mode 100644 cli/test/testcase/gtest_mytestcase.cpp create mode 100644 cli/test/testcase/main.cpp diff --git a/cli/.gitignore b/cli/.gitignore new file mode 100644 index 0000000..bfd6f79 --- /dev/null +++ b/cli/.gitignore @@ -0,0 +1,3 @@ +.idea +cmake-build-debug +.vscode \ No newline at end of file diff --git a/cli/README.txt b/cli/README.txt new file mode 100644 index 0000000..e5a077c --- /dev/null +++ b/cli/README.txt @@ -0,0 +1 @@ +ascend-docker-cli \ No newline at end of file diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt new file mode 100644 index 0000000..49d4d07 --- /dev/null +++ b/cli/src/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.26) +project(ascend_docker_cli C) +set(CMAKE_C_STANDARD 11) +aux_source_directory(. SRC) +add_executable(ascend_docker_cli ${SRC}) diff --git a/cli/src/main.c b/cli/src/main.c new file mode 100644 index 0000000..686cb2f --- /dev/null +++ b/cli/src/main.c @@ -0,0 +1,666 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具,配置容器挂载Ascend NPU设备 +*/ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEVICE_NAME "davinci" +#define DAVINCI_MANAGER_PATH "/dev/davinci_manager" +#define DEVMM_SVM_PATH "/dev/devmm_svm" +#define HISI_HDC_PATH "/dev/hisi_hdc" +#define DEFAULT_DIR_MODE 0755 +#define BUF_SIZE 1024 +#define ALLOW_PATH "/devices.allow" +#define ROOT_GAP 4 +#define FSTYPE_GAP 2 +#define MOUNT_SUBSTR_GAP 2 +#define ROOT_SUBSTR_GAP 2 + +static const struct option g_opts[] = { + {"devices", required_argument, 0, 'd'}, + {"pid", required_argument, 0, 'p'}, + {"rootfs", required_argument, 0, 'r'}, + {0, 0, 0, 0} +}; + +struct CmdArgs { + char *devices; + char *rootfs; + int pid; +}; + +static inline bool IsCmdArgsValid(struct CmdArgs *args) +{ + return (args->devices != NULL) && (args->rootfs != NULL) && (args->pid > 0); +} + +static void FreeCmdArgs(struct CmdArgs *args) +{ + if (args->devices != NULL) { + free(args->devices); + args->devices = NULL; + } + + if (args->rootfs != NULL) { + free(args->rootfs); + args->rootfs = NULL; + } + + args->pid = -1; +} + +static int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) +{ + static const char *fmtStr = "/proc/%d/ns/%s"; + return snprintf(buf, bufSize, fmtStr, pid, nsType); +} + +static int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) +{ + static const char *fmtStr = "/proc/self/ns/%s"; + return snprintf(buf, bufSize, fmtStr, nsType); +} + +static int EnterNsByFd(int fd, int nsType) +{ + int ret = setns(fd, nsType); + if (ret < 0) { + fprintf(stderr, "error: failed to set ns: fd(%d)\n", fd); + return -1; + } + + return 0; +} + +static int EnterNsByPath(const char *path, int nsType) +{ + int fd; + int ret; + + fd = open(path, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "error: failed to open ns path: %s\n", path); + return -1; + } + + ret = EnterNsByFd(fd, nsType); + if (ret < 0) { + fprintf(stderr, "error: failed to set ns: %s\n", path); + return -1; + } + + close(fd); + return 0; +} + +static unsigned int GetNextSerialNum() +{ + static unsigned int index = 0; + + return index++; +} + +static int MountDevice(const char *rootfs, const int serialNumber) +{ + int ret; + char src[BUF_SIZE] = {0}; + char dst[BUF_SIZE] = {0}; + char tmp[BUF_SIZE] = {0}; + + snprintf(src, BUF_SIZE, "/dev/" DEVICE_NAME "%d", serialNumber); + unsigned int targetSerialDevId = GetNextSerialNum(); + snprintf(tmp, BUF_SIZE, "/dev/" DEVICE_NAME "%d", targetSerialDevId); + snprintf(dst, BUF_SIZE, "%s%s", rootfs, (const char *)tmp); + + struct stat srcStat; + ret = stat((const char *)src, &srcStat); + if (ret < 0) { + fprintf(stderr, "error: failed to stat src: %s\n", src); + return -1; + } + + close(open(dst, O_NOFOLLOW | O_CREAT, srcStat.st_mode)); + + ret = mount(src, dst, NULL, MS_BIND, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to mount dev\n"); + return -1; + } + + ret = mount(NULL, dst, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to re-mount dev\n"); + return -1; + } + + return 0; +} + +static int DoMount(const char *rootfs, const char *devicesList) +{ + static const char *sep = ","; + char list[BUF_SIZE] = {0}; + strcpy(list, devicesList); + char *token = NULL; + + token = strtok(list, sep); + while (token != NULL) { + int ret = MountDevice(rootfs, atoi((const char *) token)); + if (ret < 0) { + fprintf(stderr, "error: failed to mount device no. %s\n", token); + return -1; + } + + token = strtok(NULL, sep); + } + + return 0; +} + +static int CheckDirExists(char *dir, int len) +{ + if (len < 0) { + fprintf(stderr, "length of path is %d\n", len); + return -1; + } + DIR *ptr = opendir(dir); + if (NULL == ptr) { + fprintf(stderr, "path %s not exist\n", dir); + return -1; + } else { + fprintf(stdout, "path %s exist\n", dir); + closedir(ptr); + return 0; + } +} + +static int GetParentPathStr(const char *path, int lenOfPath, char *parent) +{ + if (lenOfPath < 0) { + return -1; + } + char *ptr = strrchr(path, '/'); + if (ptr == NULL) { + return 0; + } + int len = strlen(path) - strlen(ptr); + if (len < 1) { + return 0; + } + strncpy(parent, path, len); + return 0; +} + +static int MakeParentDir(char *path, mode_t mode) +{ + if (*path == '\0' || *path == '.') { + return 0; + } + if (CheckDirExists(path, strlen(path)) == 0) { + return 0; + } + char parentPath[BUF_SIZE] = {0}; + GetParentPathStr(path, strlen(path), parentPath); + if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + return -1; + } + struct stat s; + int ret = stat(path, &s); + if (ret < 0) { + fprintf(stderr, "error: failed to stat path: %s\n", path); + return (mkdir(path, mode)); + } + if (S_ISDIR(s.st_mode)) { + return 0; + } +} + +static int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag) +{ + char src[BUF_SIZE] = {0}; + char dst[BUF_SIZE] = {0}; + snprintf(src, BUF_SIZE, "%s", file); + snprintf(dst, BUF_SIZE, "%s%s", rootfs, file); + + struct stat srcStat; + int ret = stat((const char *) src, &srcStat); + if (ret < 0) { + fprintf(stderr, "error: failed to stat src: %s\n", src); + return -1; + } + + if (S_ISDIR(srcStat.st_mode)) { + /* directory */ + char parentDir[BUF_SIZE] = {0}; + GetParentPathStr(dst, strlen(dst), parentDir); + if (CheckDirExists(parentDir, strlen(parentDir)) < 0) { + mode_t parentMode = DEFAULT_DIR_MODE; + ret = MakeParentDir(parentDir, parentMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", parentDir); + return -1; + } + } + if (CheckDirExists(dst, strlen(dst)) < 0) { + const mode_t curMode = srcStat.st_mode; + ret = mkdir(dst, curMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", dst); + return -1; + } + } + } else { + /* device */ + close(open(dst, O_NOFOLLOW | O_CREAT, srcStat.st_mode)); + } + + ret = mount(src, dst, NULL, MS_BIND, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to mount dev\n"); + return -1; + } + + ret = mount(NULL, dst, NULL, reMountRwFlag, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to re-mount dev\n"); + return -1; + } + + return 0; +} + +static int DoMountFiles(const char *rootfs) +{ + /* device */ + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", DAVINCI_MANAGER_PATH); + return -1; + } + ret = MountFiles(rootfs, DEVMM_SVM_PATH, reMountRwFlag); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", DEVMM_SVM_PATH); + return -1; + } + ret = MountFiles(rootfs, HISI_HDC_PATH, reMountRwFlag); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", HISI_HDC_PATH); + return -1; + } + return 0; +} + +typedef char *(*ParseFileLine)(char *, const char *); + +int IsStrEqual(const char *s1, const char *s2) +{ + return (!strcmp(s1, s2)); +} + +int StrHasPrefix(const char *str, const char *prefix) +{ + return (!strncmp(str, prefix, strlen(prefix))); +} + +char *GetCgroupMount(char *line, const char *subsys) +{ + int i; + char *rootDir = NULL; + + for (i = 0; i < ROOT_GAP; ++i) { + /* root is substr before gap, line is substr after gap */ + rootDir = strsep(&line, " "); + } + + char *mountPoint = NULL; + mountPoint = strsep(&line, " "); + line = strchr(line, '-'); + char* fsType = NULL; + for (i = 0; i < FSTYPE_GAP; ++i) { + fsType = strsep(&line, " "); + } + + char* substr = NULL; + for (i = 0; i < MOUNT_SUBSTR_GAP; ++i) { + substr = strsep(&line, " "); + } + + if (rootDir == NULL || mountPoint == NULL || fsType == NULL || substr == NULL) { + return (NULL); + } + + if (*rootDir == '\0' || *mountPoint == '\0' || *fsType == '\0' || *substr == '\0') { + return (NULL); + } + + if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { + return (NULL); + } + + if (strstr(substr, subsys) == NULL) { + return (NULL); + } + + if (!IsStrEqual(fsType, "cgroup")) { + return (NULL); + } + + return (mountPoint); +} + +char *GetCgroupRoot(char *line, const char *subSystem) +{ + char *token = NULL; + int i; + for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { + token = strsep(&line, ":"); + } + char *rootDir = strsep(&line, ":"); + if (rootDir == NULL || token == NULL) { + return (NULL); + } + if (*rootDir == '\0' || *token == '\0') { + return (NULL); + } + if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { + return (NULL); + } + if (strstr(token, subSystem) == NULL) { + return (NULL); + } + return (rootDir); +} + +static int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +{ + FILE *fp; + char *line = NULL; + size_t len = 0; + + fp = fopen(filepath, "r"); + if (fp == NULL) { + fprintf(stderr, "cannot open file.\n"); + return -1; + } + + while (getline(&line, &len, fp) != -1) { + char* result = fn(line, "devices"); + if (result != NULL && strlen(result) < bufferSize) { + strncpy(buffer, result, strlen(result)); + break; + } + } + + if (line != NULL) { + free(line); + } + + fclose(fp); + return 0; +} + +static int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath) +{ + int ret; + struct stat devStat; + ret = stat(devPath, &devStat); + if (ret < 0) { + fprintf(stderr, "error: failed to get stat of %s\n", devPath); + return -1; + } + + bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || + fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; + if (isFailed) { + fprintf(stderr, "error: write devices failed\n"); + return -1; + } + + return 0; +} + +static int SetupDriverCgroup(FILE *cgroupAllow) +{ + int ret; + + ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER_PATH); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER_PATH); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM_PATH); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM_PATH); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC_PATH); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC_PATH); + return -1; + } + + return 0; +} + +static int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) +{ + int ret; + char mountPath[BUF_SIZE] = {0x0}; + char mount[BUF_SIZE] = {0x0}; + + ret = snprintf(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); + if (ret < 0) { + fprintf(stderr, "error: assemble mount info path failed: ppid(%d)\n", getppid()); + return -1; + } + + ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); + if (ret < 0) { + fprintf(stderr, "error: cat file content failed\n"); + return -1; + } + + char cgroup[BUF_SIZE] = {0x0}; + char cgroupPath[BUF_SIZE] = {0x0}; + ret = snprintf(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", args->pid); + if (ret < 0) { + fprintf(stderr, "error: assemble cgroup path failed: pid(%d)\n", args->pid); + return -1; + } + + ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); + if (ret < 0) { + fprintf(stderr, "error: cat file content failed\n"); + return -1; + } + + // cut last '\n' off + cgroup[strcspn(cgroup, "\n")] = '\0'; + + ret = snprintf(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); + if (ret < 0) { + fprintf(stderr, "error: assemble cgroup device path failed: \n"); + return -1; + } + + return 0; +} + +int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) +{ + int ret; + char devicePath[BUF_SIZE] = {0}; + FILE *cgroupAllow = NULL; + + static const char *sep = ","; + char list[BUF_SIZE] = {0}; + strcpy(list, args->devices); + char *token = NULL; + + cgroupAllow = fopen(cgroupPath, "a"); + if (cgroupAllow == NULL) { + fprintf(stderr, "error: failed to open cgroup file: %s\n", cgroupPath); + return -1; + } + + ret = SetupDriverCgroup(cgroupAllow); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to setup driver cgroup\n"); + return -1; + } + + token = strtok(list, sep); + while (token != NULL) { + ret = snprintf(devicePath, BUF_SIZE, "/dev/" DEVICE_NAME "%d", atoi(token)); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, (const char *)devicePath); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to setup cgroup %s\n", token); + return -1; + } + + token = strtok(NULL, sep); + } + + fclose(cgroupAllow); + return 0; +} + +static int SetupMounts(struct CmdArgs *args) +{ + int ret; + char cgroupPath[BUF_SIZE] = {0}; + + char containerNsPath[BUF_SIZE] = {0}; + ret = GetNsPath(args->pid, "mnt", containerNsPath, BUF_SIZE); + if (ret < 0) { + fprintf(stderr, "error: failed to get container mnt ns path: pid(%d)\n", args->pid); + return ret; + } + + char originNsPath[BUF_SIZE] = {0}; + ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); + if (ret < 0) { + fprintf(stderr, "error: failed to get self ns path\n"); + return ret; + } + + int originNsFd = open((const char *)originNsPath, O_RDONLY); + if (originNsFd < 0) { + fprintf(stderr, "error: failed to get self ns fd: %s\n", originNsPath); + return -1; + } + + ret = GetCgroupPath(args, cgroupPath, BUF_SIZE); + if (ret < 0) { + fprintf(stderr, "error: failed to get cgroup path\n"); + return -1; + } + + // enter container's mount namespace + ret = EnterNsByPath((const char *) containerNsPath, CLONE_NEWNS); + if (ret < 0) { + fprintf(stderr, "error: failed to set to container ns: %s\n", containerNsPath); + close(originNsFd); + return -1; + } + + ret = DoMount(args->rootfs, args->devices); + if (ret < 0) { + fprintf(stderr, "error: failed to do mounts\n"); + close(originNsFd); + return -1; + } + + ret = DoMountFiles(args->rootfs); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount files\n"); + close(originNsFd); + return -1; + } + + ret = SetupCgroup(args, (const char *)cgroupPath); + if (ret < 0) { + fprintf(stderr, "error: failed to set up cgroup\n"); + close(originNsFd); + return -1; + } + + // back to original namespace + ret = EnterNsByFd(originNsFd, CLONE_NEWNS); + if (ret < 0) { + fprintf(stderr, "error: failed to set ns back\n"); + close(originNsFd); + return -1; + } + + close(originNsFd); + return 0; +} + +#ifdef gtest +int _main(int argc, char **argv) { +#else +int main(int argc, char **argv) { +#endif + int c; + int optionIndex; + struct CmdArgs args = { + .devices = NULL, + .rootfs = NULL, + .pid = -1 + }; + + while ((c = getopt_long(argc, argv, "d:p:r", g_opts, &optionIndex)) != -1) { + switch (c) { + case 'd': + args.devices = strdup(optarg); + break; + case 'p': + args.pid = atoi(optarg); + break; + case 'r': + args.rootfs = strdup(optarg); + break; + default: + fprintf(stderr, "unrecongnized option\n"); + return -1; // unrecognized option + } + } + + if (!IsCmdArgsValid(&args)) { + FreeCmdArgs(&args); + return -1; + } + + int ret = SetupMounts(&args); + if (ret < 0) { + FreeCmdArgs(&args); + return ret; + } + + FreeCmdArgs(&args); + return 0; +} diff --git a/cli/test/CMakeLists.txt b/cli/test/CMakeLists.txt new file mode 100644 index 0000000..2863f5f --- /dev/null +++ b/cli/test/CMakeLists.txt @@ -0,0 +1,157 @@ +cmake_minimum_required(VERSION 2.6) + +project(demo) +macro(dtcenter_init_complier_settings) + set(compiler_flags + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + ) + + if (MSVC) + # For MSVC, CMake sets certain flags to defaults we want to override. + # This replacement code is taken from sample in the CMake Wiki at + # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace. + foreach(flag_var ${compiler_flags}) + if (NOT BUILD_SHARED_LIBS) + # When DTCenter is built as a shared library, it should also use + # shared runtime libraries. Otherwise, it may end up with multiple + # copies of runtime library data in different modules, resulting in + # hard-to-find crashes. When it is built as a static library, it is + # preferable to use CRT as static libraries, as we don't have to rely + # on CRT DLLs being available. CMake always defaults to using shared + # CRT libraries, so we override that default here. + string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}") + endif () + + # Do not create .pdb files + string(REPLACE "/Zi" "/Z7" ${flag_var} "${${flag_var}}") + string(REPLACE "/ZI" "/Z7" ${flag_var} "${${flag_var}}") + + # We prefer more strict warning checking for building DTCenter. + # Replaces /W3 with /W4 in defaults. + # string(REPLACE "/W3" "/W4" ${flag_var} "${${flag_var}}") + endforeach() + + # Suppress MSVC warnning + add_definitions(-wd4996) + + # Summary of tuple support for Microsoft Visual Studio: + # Compiler version(MS) version(cmake) Support + # ---------- ----------- -------------- ----------------------------- + # vs 2005 8 1400 disabled warings [4355] + # <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple. + # VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10 + # VS 2013 12 1800 std::tr1::tuple + if (MSVC) + if (MSVC_VERSION EQUAL 1400) + add_definitions(-wd4355) + endif (MSVC_VERSION EQUAL 1400) + + if (MSVC_VERSION EQUAL 1700) + add_definitions(/D _VARIADIC_MAX=10) + endif (MSVC_VERSION EQUAL 1700) + endif (MSVC) + + # Summary of name for Microsoft Visual Studio: + # Compiler version(MS) version(cmake) Name + # ---------- ----------- -------------- ----------------------------- + # VS 2005 8 1400 vs2005 + # VS 2008 9 1500 vs2008 + # VS 2010 10 1600 vs2010 + # VS 2012 11 1700 vs2012 + # VS 2013 12 1800 vs2013 + # VS 2015 13 1900 vs2015 + if (MSVC_VERSION EQUAL 1400) + set(MSVC_NAME "vs2005") + elseif (MSVC_VERSION EQUAL 1500) + set(MSVC_NAME "vs2008") + elseif (MSVC_VERSION EQUAL 1600) + set(MSVC_NAME "vs2010") + elseif (MSVC_VERSION EQUAL 1700) + set(MSVC_NAME "vs2012") + elseif (MSVC_VERSION EQUAL 1800) + set(MSVC_NAME "vs2013") + elseif (MSVC_VERSION EQUAL 1900) + set(MSVC_NAME "vs2015") + elseif (MSVC_VERSION EQUAL 1910) + set(MSVC_NAME "vs2017") + else () + message(FATAL_ERROR "Please add the MSVC_NAME for MSVC_VERSION[${MSVC_VERSION}]") + endif (MSVC_VERSION EQUAL 1400) + + if (NOT BUILD_SHARED_LIBS) + set(LIBRARY_POSTFIX "mtd") + else () + set(LIBRARY_POSTFIX "mdd") + endif (NOT BUILD_SHARED_LIBS) + endif (MSVC) + + if(UNIX) + # 调试开关 + add_definitions(-g) + # 关闭优化开关 + add_definitions(-O0) + # 4.8.5编译选项 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + # ASAN编译选项 + if (BUILD_ASAN) + add_definitions(-fsanitize=address -fsanitize-recover=all) + add_definitions(-fno-omit-frame-pointer -fno-stack-protector) + add_definitions(-fsanitize=leak) + endif(BUILD_ASAN) + + if (BUILD_FUZZ) + # 包含FUZZ时,必须使用C++11语法编译 + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif(BUILD_FUZZ) + + # DTCenter定义的宏 + add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX) + + # 默认不支持中文用例名,如果要支持请打开以下配置 + # add_definitions(-DDTCENTER_CN2EN) + + # GCC编译器告警开关 + add_definitions(-Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=0) + add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) + add_definitions(-Wno-sign-compare -Wno-nonnull-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers -Wno-missing-field-initializers) + #add_definitions(-fprofile-arcs -ftest-coverage) + # 以下只对C++语言有有效 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wno-reorder") + + # GCC 4.3.4不支持 -Wno-conversion-null, 先注释掉 + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null") + + #add_definitions(-rdynamic) + + + endif(UNIX) +endmacro() +dtcenter_init_complier_settings() +add_definitions(-g -O0) +add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX -D_GLIBCXX_USE_CXX11_ABI=0) +add_definitions(-Dgtest) + +# GCC编译器告警开关 +add_definitions(-Wall -Wextra) +add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) +add_definitions(-Wno-sign-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers) + + +set(UT_DEMO_SRCS testcase/main.cpp ../src/main.c testcase/gtest_mytestcase.cpp) + +add_executable(ut_demo ${UT_DEMO_SRCS}) +target_link_libraries(ut_demo + ${PROJECT_SOURCE_DIR}/lib/libdtcenter.a +) +target_link_libraries(ut_demo -pthread) +target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/include) diff --git a/cli/test/include/gtest/UdpSocket.h b/cli/test/include/gtest/UdpSocket.h new file mode 100644 index 0000000..8adec87 --- /dev/null +++ b/cli/test/include/gtest/UdpSocket.h @@ -0,0 +1,220 @@ +#pragma once + +#include "gtest/internal/gtest-port.h" + +#ifdef GTEST_OS_WINDOWS +//此处不包含winsock.h了 +#include +#endif + +#ifdef GTEST_OS_LINUX +#include +#include +#include +#include +#include +#include +#include + +#define HANDLE void* +#define UINT32 unsigned int +#define UINT8 unsigned char +#define UIN16 unsigned short +#define SOCKET unsigned int +#define INVALID_SOCKET 0 +#define SOCKET_ERROR -1 +#endif +/*相关接口*/ +namespace testing { + /*ulLogtype枚举宏定义:消息的打印级别*/ +#define DT_SETUP 0 /*全局初始化事件*/ +#define DT_TEARDOWN 1 /*全局加载事件*/ +#define DT_TESTCASE_BEGIN 2 /*用例开始事件*/ +#define DT_TESTCASE_END 3 /*用例结束事件*/ + +#define DT_MSG_MAGIC_WORD 0x4F4F4F4F + + + +//是下面MsgStruct的消息内容 + +#define DT_MSG_TRACE_HEADER \ +unsigned int ulMagicWord; \ +unsigned int usProdType; \ +unsigned int usLength \ + +#pragma pack(push,1) +//传向socket的消息内容中的消息头 + struct DT_MSG_TRACE_HEADER_SUCT + { + DT_MSG_TRACE_HEADER; + }; + + typedef struct + { + DT_MSG_TRACE_HEADER; + }DT_MSG_TRACE_STRU; + + //传向Socket的适应msgtype为字符串类型的消息体 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int direction; //发送方向 + unsigned int protocal; //协议 + unsigned int msgFlag; //消息类型是INT32时为1,为0时INT8 * + unsigned int msgTypeLen; //消息类型的长度 (msgType == 0) strlen(msgTypeStr) + strlen(reservered) + unsigned char msgTypeStr[1]; //消息类型 + unsigned int msgcontentlength; //消息内容的长度 + unsigned char msgcontent[1]; //消息内容 + }DT_MSG_TRACE_DATA_STRU_INT8; + + //传向Socket的适应msgtype为int类型的消息体 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int direction; //发送方向 + unsigned int protocal; //协议 + unsigned int msgFlag; //消息类型是INT32时为1,为0时INT8 * + unsigned int msgType; //消息类型 + unsigned int msgcontentlength; //消息内容的长度 + unsigned char msgcontent[1]; //消息内容 + }DT_MSG_TRACE_DATA_STRU_INT32; + + + //msgtype消息类型 +#define OUTER_MSG 0 //外部消息 +#define INNER_MSG 1 //内部消息 + +//传向Socket的适应NodeB的消息体 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int msgType; //内外部消息 0: 外部消息 1:内部消息 RecPId的长度 + unsigned int SenderCpuId; //发出的Cpuid,若msgType为内部消息时,SenderCpuId = RecCpuId + unsigned int SenderPId; //发出的pid, + unsigned int RecCpuId; //收到的Cpuid, + unsigned int RecPId; //收到的pid, + unsigned int msgcontentlength; //msgContents长度 + unsigned char msgContents[1]; //消息内容 + }DT_MSG_TRACE_DATA_STRU_NodeB; + + //传向Socket的适应LTE的消息体 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int msgType; + unsigned int SenderCpuId; //发出的Cpuid + unsigned int SenderPId; //发出的pid, + unsigned int RecCpuId; //收到的Cpuid, + unsigned int RecPId; //收到的pid, + unsigned int msgcontentlength; //msgContents长度 + unsigned char msgContents[1]; //消息内容 + }DT_MSG_TRACE_DATA_STRU_LTE; + + //传向Socket的公用的dopra 消息 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int msgType; + unsigned int SenderCpuId; //发出的Cpuid + unsigned int SenderPId; //发出的pid, + unsigned int RecCpuId; //收到的Cpuid, + unsigned int RecPId; //收到的pid, + unsigned int msgcontentlength; //msgContents长度 + unsigned char msgContents[1]; //消息内容 + }DT_MSG_TRACE_DATA_STRU_Common; + + //传向Socket的5G产品的Service消息 + typedef struct + { + DT_MSG_TRACE_HEADER; + unsigned int SenderServiceID; // 服务提供者ID + unsigned int ReceiverServiceID; // 服务使用者ID + unsigned int ServiceType; // 服务类型ID + unsigned int ServiceID; // API或者ABI的ID + unsigned int MsgContentSize; // 原始服务消息长度 + unsigned char MsgContents[1]; // 原始消息内容 + } DT_MSG_TRACE_DATA_STRU_SERVICE; +#pragma pack(pop) + + + /*MessageStruct,统一的消息头结构*/ + typedef struct + { + unsigned int ulMsgHead; /*消息头,4字节,统一为0xf634f634*/ + unsigned int ulMsgLen; /*消息总长度(包括消息体),4字节*/ + unsigned int ulMsgHeadLen; /*消息头长度,4字节*/ + unsigned int ulVersionId; /*版本号,4字节,目前为0x00000001*/ + unsigned char aucdate_time[24]; /*消息发送时间,24字节,字符串如:2009-08-24 12:13:15.999 */ + unsigned int ulReserved; /*保留字节*/ + unsigned int ulSource; /*发送的消息类型,值域0-1,具体意义见上面的ulSource宏定义*/ + unsigned int ulLogtype; /*消息的打印级别,值域0-9,具体意义见上面的ulLogtype宏定义*/ + unsigned int ulMsgBodyLen; /*消息体长度*/ + } MsgStruct; + +#define SERVERPORT 6868 +#define LOCALPORT 7878 + + /*udpSocket消息通信类定义*/ + /*请不要自己直接使用下面的类,否则会给定位问题带来麻烦*/ + class UdpSocket + { + public: + UdpSocket(void); + ~UdpSocket(void); + + private: + UINT32 m_localPort; + std::string m_strServerIP; + SOCKET m_hHandle; + sockaddr_in addrTo; + bool m_bTraceFlag; + bool m_bPortTraceFlag; /*串口开关*/ + bool m_bDocPrintFlag; /*Doc界面打印开关*/ + std::string m_SuiteName; /*当前发送消息的测试套名称*/ + std::string m_preSuiteName; /*上一个测试套名称*/ + std::string m_CaseName; /*测试用例名称*/ + HANDLE m_FileHandle; /*记录串口消息的文件句柄*/ + std::string m_fileFolderPath; /*创建的AutoStar文件夹的路径*/ + bool m_bNewFileFlag; + + int Init_Socket(); /*socket初始化*/ + int CreateSocket(void); /*创建socket*/ + int MessageSend(UINT32 ulSource, UINT32 ulLogtype, UINT32 usDataLen, UINT8 *poctData); /*消息发送*/ + int WritePortMessageToTxt(UINT32 ulLogtype, UINT8 *poctData); /*写串口消息到文本*/ + unsigned int DT_MessageHead_INT32(UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData, UINT32 msgFlag); + unsigned int DT_MessageHead_INT8(UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData, UINT32 msgFlag); + unsigned int DT_MessageHead_NodeB(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); + unsigned int DT_MessageHead_LTE(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); + unsigned int DT_MessageHead_InnerMsg(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); + public: + int SocketBind(void); /*socket绑定*/ + int UdpSendMessage(UINT32 ulSource, UINT32 ulLogtype, UINT32 usDataLen, UINT8 *poctData); /*消息发送*/ + int ReceiveMessage(UINT8 *recvData); /*消息接收*/ + int CloseSocket(void); /*socket关闭*/ + int SetServerIP(std::string strIP); + int SetLocalPort(UINT32 localPort); + int OpenTrace(bool bTrace); /*消息发送开关*/ + int ComportMsgPrint(bool bFlag); /*串口打印开关*/ + int SetSuiteCaseName(const char *pSuiteName, const char *pCaseName); + void DT_SendMessageToTracer_INT32(UINT32 ulSource, UINT32 ucProt, UINT32 ucDirection, UINT32 MsgType, UINT32 usDataLen, UINT8 *poctData); /*INT32的消息类型的消息发送*/ + void DT_SendMessageToTracer_INT8(UINT32 ulSource, UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData); /*字符串的消息类型的消息发送*/ + void DT_SendMessageToTracer_NodeB(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ + void DT_SendMessageToTracer_LTE(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ + void DT_SendMessageToTracer_InnerMsg(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ + void DT_SendMessageToTracer_ServiceMsg( // 5G产品, 服务消息跟踪 + UINT32 ulSource, + UINT32 SenderServiceId, + UINT32 ReceiverServiceId, + UINT32 ServiceType, // 0 : ABI 1 : API + UINT32 ServiceID, // API ID or ABI ID + UINT32 usDataLen, + UINT8 *poctData); + + bool GetPrintDocFlag(); /*获取Doc界面打印开关*/ + void SetPrintDocFlag(bool bFlag); /*设置Doc界面打印开关*/ + void SetNewFileCreateFlag(bool bFlag); /*设置串口打印重定向到文件时,本进程范围内不覆盖之前的打印*/ + + }; + +} diff --git a/cli/test/include/gtest/gtest-death-test.h b/cli/test/include/gtest/gtest-death-test.h new file mode 100644 index 0000000..a27883f --- /dev/null +++ b/cli/test/include/gtest/gtest-death-test.h @@ -0,0 +1,283 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file defines the public API for death tests. It is +// #included by gtest.h so a user doesn't need to include this +// directly. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ +#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ + +#include "gtest/internal/gtest-death-test-internal.h" + +namespace testing { + +// This flag controls the style of death tests. Valid values are "threadsafe", +// meaning that the death test child process will re-execute the test binary +// from the start, running only a single death test, or "fast", +// meaning that the child process will execute the test logic immediately +// after forking. +GTEST_DECLARE_string_(death_test_style); + +#if GTEST_HAS_DEATH_TEST + +// The following macros are useful for writing death tests. + +// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is +// executed: +// +// 1. It generates a warning if there is more than one active +// thread. This is because it's safe to fork() or clone() only +// when there is a single thread. +// +// 2. The parent process clone()s a sub-process and runs the death +// test in it; the sub-process exits with code 0 at the end of the +// death test, if it hasn't exited already. +// +// 3. The parent process waits for the sub-process to terminate. +// +// 4. The parent process checks the exit code and error message of +// the sub-process. +// +// Examples: +// +// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); +// for (int i = 0; i < 5; i++) { +// EXPECT_DEATH(server.ProcessRequest(i), +// "Invalid request .* in ProcessRequest()") +// << "Failed to die on request " << i); +// } +// +// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); +// +// bool KilledBySIGHUP(int exit_code) { +// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; +// } +// +// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); +// +// On the regular expressions used in death tests: +// +// On POSIX-compliant systems (*nix), we use the library, +// which uses the POSIX extended regex syntax. +// +// On other platforms (e.g. Windows), we only support a simple regex +// syntax implemented as part of Google Test. This limited +// implementation should be enough most of the time when writing +// death tests; though it lacks many features you can find in PCRE +// or POSIX extended regex syntax. For example, we don't support +// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and +// repetition count ("x{5,7}"), among others. +// +// Below is the syntax that we do support. We chose it to be a +// subset of both PCRE and POSIX extended regex, so it's easy to +// learn wherever you come from. In the following: 'A' denotes a +// literal character, period (.), or a single \\ escape sequence; +// 'x' and 'y' denote regular expressions; 'm' and 'n' are for +// natural numbers. +// +// c matches any literal character c +// \\d matches any decimal digit +// \\D matches any character that's not a decimal digit +// \\f matches \f +// \\n matches \n +// \\r matches \r +// \\s matches any ASCII whitespace, including \n +// \\S matches any character that's not a whitespace +// \\t matches \t +// \\v matches \v +// \\w matches any letter, _, or decimal digit +// \\W matches any character that \\w doesn't match +// \\c matches any literal character c, which must be a punctuation +// . matches any single character except \n +// A? matches 0 or 1 occurrences of A +// A* matches 0 or many occurrences of A +// A+ matches 1 or many occurrences of A +// ^ matches the beginning of a string (not that of each line) +// $ matches the end of a string (not that of each line) +// xy matches x followed by y +// +// If you accidentally use PCRE or POSIX extended regex features +// not implemented by us, you will get a run-time failure. In that +// case, please try to rewrite your regular expression within the +// above syntax. +// +// This implementation is *not* meant to be as highly tuned or robust +// as a compiled regex library, but should perform well enough for a +// death test, which already incurs significant overhead by launching +// a child process. +// +// Known caveats: +// +// A "threadsafe" style death test obtains the path to the test +// program from argv[0] and re-executes it in the sub-process. For +// simplicity, the current implementation doesn't search the PATH +// when launching the sub-process. This means that the user must +// invoke the test program via a path that contains at least one +// path separator (e.g. path/to/foo_test and +// /absolute/path/to/bar_test are fine, but foo_test is not). This +// is rarely a problem as people usually don't put the test binary +// directory in PATH. +// +// TODO(wan@google.com): make thread-safe death tests search the PATH. + +// Asserts that a given statement causes the program to exit, with an +// integer exit status that satisfies predicate, and emitting error output +// that matches regex. +# define ASSERT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) + +// Like ASSERT_EXIT, but continues on to successive tests in the +// test case, if any: +# define EXPECT_EXIT(statement, predicate, regex) \ + GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) + +// Asserts that a given statement causes the program to exit, either by +// explicitly exiting with a nonzero exit code or being killed by a +// signal, and emitting error output that matches regex. +# define ASSERT_DEATH(statement, regex) \ + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) + +// Like ASSERT_DEATH, but continues on to successive tests in the +// test case, if any: +# define EXPECT_DEATH(statement, regex) \ + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) + +// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: + +// Tests that an exit code describes a normal exit with a given exit code. +class GTEST_API_ ExitedWithCode { + public: + explicit ExitedWithCode(int exit_code); + bool operator()(int exit_status) const; + private: + // No implementation - assignment is unsupported. + void operator=(const ExitedWithCode& other); + + const int exit_code_; +}; + +# if !GTEST_OS_WINDOWS +// Tests that an exit code describes an exit due to termination by a +// given signal. +class GTEST_API_ KilledBySignal { + public: + explicit KilledBySignal(int signum); + bool operator()(int exit_status) const; + private: + const int signum_; +}; +# endif // !GTEST_OS_WINDOWS + +// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. +// The death testing framework causes this to have interesting semantics, +// since the sideeffects of the call are only visible in opt mode, and not +// in debug mode. +// +// In practice, this can be used to test functions that utilize the +// LOG(DFATAL) macro using the following style: +// +// int DieInDebugOr12(int* sideeffect) { +// if (sideeffect) { +// *sideeffect = 12; +// } +// LOG(DFATAL) << "death"; +// return 12; +// } +// +// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { +// int sideeffect = 0; +// // Only asserts in dbg. +// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); +// +// #ifdef NDEBUG +// // opt-mode has sideeffect visible. +// EXPECT_EQ(12, sideeffect); +// #else +// // dbg-mode no visible sideeffect. +// EXPECT_EQ(0, sideeffect); +// #endif +// } +// +// This will assert that DieInDebugReturn12InOpt() crashes in debug +// mode, usually due to a DCHECK or LOG(DFATAL), but returns the +// appropriate fallback value (12 in this case) in opt mode. If you +// need to test that a function has appropriate side-effects in opt +// mode, include assertions against the side-effects. A general +// pattern for this is: +// +// EXPECT_DEBUG_DEATH({ +// // Side-effects here will have an effect after this statement in +// // opt mode, but none in debug mode. +// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); +// }, "death"); +// +# ifdef NDEBUG + +# define EXPECT_DEBUG_DEATH(statement, regex) \ + do { statement; } while (::testing::internal::AlwaysFalse()) + +# define ASSERT_DEBUG_DEATH(statement, regex) \ + do { statement; } while (::testing::internal::AlwaysFalse()) + +# else + +# define EXPECT_DEBUG_DEATH(statement, regex) \ + EXPECT_DEATH(statement, regex) + +# define ASSERT_DEBUG_DEATH(statement, regex) \ + ASSERT_DEATH(statement, regex) + +# endif // NDEBUG for EXPECT_DEBUG_DEATH +#endif // GTEST_HAS_DEATH_TEST + +// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and +// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if +// death tests are supported; otherwise they just issue a warning. This is +// useful when you are combining death test assertions with normal test +// assertions in one test. +#if GTEST_HAS_DEATH_TEST +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ + EXPECT_DEATH(statement, regex) +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ + ASSERT_DEATH(statement, regex) +#else +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ + GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ + GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) +#endif + +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ diff --git a/cli/test/include/gtest/gtest-message.h b/cli/test/include/gtest/gtest-message.h new file mode 100644 index 0000000..9b7142f --- /dev/null +++ b/cli/test/include/gtest/gtest-message.h @@ -0,0 +1,230 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file defines the Message class. +// +// IMPORTANT NOTE: Due to limitation of the C++ language, we have to +// leave some internal implementation details in this header file. +// They are clearly marked by comments like this: +// +// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +// +// Such code is NOT meant to be used by a user directly, and is subject +// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user +// program! + +#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ +#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ + +#include + +#include "gtest/internal/gtest-string.h" +#include "gtest/internal/gtest-internal.h" + +namespace testing { + +// The Message class works like an ostream repeater. +// +// Typical usage: +// +// 1. You stream a bunch of values to a Message object. +// It will remember the text in a stringstream. +// 2. Then you stream the Message object to an ostream. +// This causes the text in the Message to be streamed +// to the ostream. +// +// For example; +// +// testing::Message foo; +// foo << 1 << " != " << 2; +// std::cout << foo; +// +// will print "1 != 2". +// +// Message is not intended to be inherited from. In particular, its +// destructor is not virtual. +// +// Note that stringstream behaves differently in gcc and in MSVC. You +// can stream a NULL char pointer to it in the former, but not in the +// latter (it causes an access violation if you do). The Message +// class hides this difference by treating a NULL char pointer as +// "(null)". +class GTEST_API_ Message { + private: + // The type of basic IO manipulators (endl, ends, and flush) for + // narrow streams. + typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); + + public: + // Constructs an empty Message. + // We allocate the stringstream separately because otherwise each use of + // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's + // stack frame leading to huge stack frames in some cases; gcc does not reuse + // the stack space. + Message() : ss_(new ::std::stringstream) { + // By default, we want there to be enough precision when printing + // a double to a Message. + *ss_ << std::setprecision(std::numeric_limits::digits10 + 2); + } + + // Copy constructor. + Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT + *ss_ << msg.GetString(); + } + + // Constructs a Message from a C-string. + explicit Message(const char* str) : ss_(new ::std::stringstream) { + *ss_ << str; + } + +#if GTEST_OS_SYMBIAN + // Streams a value (either a pointer or not) to this object. + template + inline Message& operator <<(const T& value) { + StreamHelper(typename internal::is_pointer::type(), value); + return *this; + } +#else + // Streams a non-pointer value to this object. + template + inline Message& operator <<(const T& val) { + ::GTestStreamToHelper(ss_.get(), val); + return *this; + } + + // Streams a pointer value to this object. + // + // This function is an overload of the previous one. When you + // stream a pointer to a Message, this definition will be used as it + // is more specialized. (The C++ Standard, section + // [temp.func.order].) If you stream a non-pointer, then the + // previous definition will be used. + // + // The reason for this overload is that streaming a NULL pointer to + // ostream is undefined behavior. Depending on the compiler, you + // may get "0", "(nil)", "(null)", or an access violation. To + // ensure consistent result across compilers, we always treat NULL + // as "(null)". + template + inline Message& operator <<(T* const& pointer) { // NOLINT + if (pointer == NULL) { + *ss_ << "(null)"; + } else { + ::GTestStreamToHelper(ss_.get(), pointer); + } + return *this; + } +#endif // GTEST_OS_SYMBIAN + + // Since the basic IO manipulators are overloaded for both narrow + // and wide streams, we have to provide this specialized definition + // of operator <<, even though its body is the same as the + // templatized version above. Without this definition, streaming + // endl or other basic IO manipulators to Message will confuse the + // compiler. + Message& operator <<(BasicNarrowIoManip val) { + *ss_ << val; + return *this; + } + + // Instead of 1/0, we want to see true/false for bool values. + Message& operator <<(bool b) { + return *this << (b ? "true" : "false"); + } + + // These two overloads allow streaming a wide C string to a Message + // using the UTF-8 encoding. + Message& operator <<(const wchar_t* wide_c_str) { + return *this << internal::String::ShowWideCString(wide_c_str); + } + Message& operator <<(wchar_t* wide_c_str) { + return *this << internal::String::ShowWideCString(wide_c_str); + } + +#if GTEST_HAS_STD_WSTRING + // Converts the given wide string to a narrow string using the UTF-8 + // encoding, and streams the result to this Message object. + Message& operator <<(const ::std::wstring& wstr); +#endif // GTEST_HAS_STD_WSTRING + +#if GTEST_HAS_GLOBAL_WSTRING + // Converts the given wide string to a narrow string using the UTF-8 + // encoding, and streams the result to this Message object. + Message& operator <<(const ::wstring& wstr); +#endif // GTEST_HAS_GLOBAL_WSTRING + + // Gets the text streamed to this object so far as a String. + // Each '\0' character in the buffer is replaced with "\\0". + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + internal::String GetString() const { + return internal::StringStreamToString(ss_.get()); + } + + private: + +#if GTEST_OS_SYMBIAN + // These are needed as the Nokia Symbian Compiler cannot decide between + // const T& and const T* in a function template. The Nokia compiler _can_ + // decide between class template specializations for T and T*, so a + // tr1::type_traits-like is_pointer works, and we can overload on that. + template + inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) { + if (pointer == NULL) { + *ss_ << "(null)"; + } else { + ::GTestStreamToHelper(ss_.get(), pointer); + } + } + template + inline void StreamHelper(internal::false_type /*dummy*/, const T& value) { + ::GTestStreamToHelper(ss_.get(), value); + } +#endif // GTEST_OS_SYMBIAN + + // We'll hold the text streamed to this object here. + const internal::scoped_ptr< ::std::stringstream> ss_; + + // We declare (but don't implement) this to prevent the compiler + // from implementing the assignment operator. + void operator=(const Message&); +}; + +// Streams a Message to an ostream. +inline std::ostream& operator <<(std::ostream& os, const Message& sb) { + return os << sb.GetString(); +} + +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ diff --git a/cli/test/include/gtest/gtest-param-test.h b/cli/test/include/gtest/gtest-param-test.h new file mode 100644 index 0000000..6407cfd --- /dev/null +++ b/cli/test/include/gtest/gtest-param-test.h @@ -0,0 +1,1421 @@ +// This file was GENERATED by command: +// pump.py gtest-param-test.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: vladl@google.com (Vlad Losev) +// +// Macros and functions for implementing parameterized tests +// in Google C++ Testing Framework (Google Test) +// +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ +#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ + + +// Value-parameterized tests allow you to test your code with different +// parameters without writing multiple copies of the same test. +// +// Here is how you use value-parameterized tests: + +#if 0 + +// To write value-parameterized tests, first you should define a fixture +// class. It is usually derived from testing::TestWithParam (see below for +// another inheritance scheme that's sometimes useful in more complicated +// class hierarchies), where the type of your parameter values. +// TestWithParam is itself derived from testing::Test. T can be any +// copyable type. If it's a raw pointer, you are responsible for managing the +// lifespan of the pointed values. + +class FooTest : public ::testing::TestWithParam { + // You can implement all the usual class fixture members here. +}; + +// Then, use the TEST_P macro to define as many parameterized tests +// for this fixture as you want. The _P suffix is for "parameterized" +// or "pattern", whichever you prefer to think. + +TEST_P(FooTest, DoesBlah) { + // Inside a test, access the test parameter with the GetParam() method + // of the TestWithParam class: + EXPECT_TRUE(foo.Blah(GetParam())); + ... +} + +TEST_P(FooTest, HasBlahBlah) { + ... +} + +// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test +// case with any set of parameters you want. Google Test defines a number +// of functions for generating test parameters. They return what we call +// (surprise!) parameter generators. Here is a summary of them, which +// are all in the testing namespace: +// +// +// Range(begin, end [, step]) - Yields values {begin, begin+step, +// begin+step+step, ...}. The values do not +// include end. step defaults to 1. +// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. +// ValuesIn(container) - Yields values from a C-style array, an STL +// ValuesIn(begin,end) container, or an iterator range [begin, end). +// Bool() - Yields sequence {false, true}. +// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product +// for the math savvy) of the values generated +// by the N generators. +// +// For more details, see comments at the definitions of these functions below +// in this file. +// +// The following statement will instantiate tests from the FooTest test case +// each with parameter values "meeny", "miny", and "moe". + +INSTANTIATE_TEST_CASE_P(InstantiationName, + FooTest, + Values("meeny", "miny", "moe")); + +// To distinguish different instances of the pattern, (yes, you +// can instantiate it more then once) the first argument to the +// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the +// actual test case name. Remember to pick unique prefixes for different +// instantiations. The tests from the instantiation above will have +// these names: +// +// * InstantiationName/FooTest.DoesBlah/0 for "meeny" +// * InstantiationName/FooTest.DoesBlah/1 for "miny" +// * InstantiationName/FooTest.DoesBlah/2 for "moe" +// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" +// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" +// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" +// +// You can use these names in --gtest_filter. +// +// This statement will instantiate all tests from FooTest again, each +// with parameter values "cat" and "dog": + +const char* pets[] = {"cat", "dog"}; +INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); + +// The tests from the instantiation above will have these names: +// +// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" +// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" +// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" +// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" +// +// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests +// in the given test case, whether their definitions come before or +// AFTER the INSTANTIATE_TEST_CASE_P statement. +// +// Please also note that generator expressions (including parameters to the +// generators) are evaluated in InitGoogleTest(), after main() has started. +// This allows the user on one hand, to adjust generator parameters in order +// to dynamically determine a set of tests to run and on the other hand, +// give the user a chance to inspect the generated tests with Google Test +// reflection API before RUN_ALL_TESTS() is executed. +// +// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc +// for more examples. +// +// In the future, we plan to publish the API for defining new parameter +// generators. But for now this interface remains part of the internal +// implementation and is subject to change. +// +// +// A parameterized test fixture must be derived from testing::Test and from +// testing::WithParamInterface, where T is the type of the parameter +// values. Inheriting from TestWithParam satisfies that requirement because +// TestWithParam inherits from both Test and WithParamInterface. In more +// complicated hierarchies, however, it is occasionally useful to inherit +// separately from Test and WithParamInterface. For example: + +class BaseTest : public ::testing::Test { + // You can inherit all the usual members for a non-parameterized test + // fixture here. +}; + +class DerivedTest : public BaseTest, public ::testing::WithParamInterface { + // The usual test fixture members go here too. +}; + +TEST_F(BaseTest, HasFoo) { + // This is an ordinary non-parameterized test. +} + +TEST_P(DerivedTest, DoesBlah) { + // GetParam works just the same here as if you inherit from TestWithParam. + EXPECT_TRUE(foo.Blah(GetParam())); +} + +#endif // 0 + +#include "gtest/internal/gtest-port.h" + +#if !GTEST_OS_SYMBIAN +# include +#endif + +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-param-util.h" +#include "gtest/internal/gtest-param-util-generated.h" + +#if GTEST_HAS_PARAM_TEST + +namespace testing { + +// Functions producing parameter generators. +// +// Google Test uses these generators to produce parameters for value- +// parameterized tests. When a parameterized test case is instantiated +// with a particular generator, Google Test creates and runs tests +// for each element in the sequence produced by the generator. +// +// In the following sample, tests from test case FooTest are instantiated +// each three times with parameter values 3, 5, and 8: +// +// class FooTest : public TestWithParam { ... }; +// +// TEST_P(FooTest, TestThis) { +// } +// TEST_P(FooTest, TestThat) { +// } +// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); +// + +// Range() returns generators providing sequences of values in a range. +// +// Synopsis: +// Range(start, end) +// - returns a generator producing a sequence of values {start, start+1, +// start+2, ..., }. +// Range(start, end, step) +// - returns a generator producing a sequence of values {start, start+step, +// start+step+step, ..., }. +// Notes: +// * The generated sequences never include end. For example, Range(1, 5) +// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) +// returns a generator producing {1, 3, 5, 7}. +// * start and end must have the same type. That type may be any integral or +// floating-point type or a user defined type satisfying these conditions: +// * It must be assignable (have operator=() defined). +// * It must have operator+() (operator+(int-compatible type) for +// two-operand version). +// * It must have operator<() defined. +// Elements in the resulting sequences will also have that type. +// * Condition start < end must be satisfied in order for resulting sequences +// to contain any elements. +// +template +internal::ParamGenerator Range(T start, T end, IncrementT step) { + return internal::ParamGenerator( + new internal::RangeGenerator(start, end, step)); +} + +template +internal::ParamGenerator Range(T start, T end) { + return Range(start, end, 1); +} + +// ValuesIn() function allows generation of tests with parameters coming from +// a container. +// +// Synopsis: +// ValuesIn(const T (&array)[N]) +// - returns a generator producing sequences with elements from +// a C-style array. +// ValuesIn(const Container& container) +// - returns a generator producing sequences with elements from +// an STL-style container. +// ValuesIn(Iterator begin, Iterator end) +// - returns a generator producing sequences with elements from +// a range [begin, end) defined by a pair of STL-style iterators. These +// iterators can also be plain C pointers. +// +// Please note that ValuesIn copies the values from the containers +// passed in and keeps them to generate tests in RUN_ALL_TESTS(). +// +// Examples: +// +// This instantiates tests from test case StringTest +// each with C-string values of "foo", "bar", and "baz": +// +// const char* strings[] = {"foo", "bar", "baz"}; +// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); +// +// This instantiates tests from test case StlStringTest +// each with STL strings with values "a" and "b": +// +// ::std::vector< ::std::string> GetParameterStrings() { +// ::std::vector< ::std::string> v; +// v.push_back("a"); +// v.push_back("b"); +// return v; +// } +// +// INSTANTIATE_TEST_CASE_P(CharSequence, +// StlStringTest, +// ValuesIn(GetParameterStrings())); +// +// +// This will also instantiate tests from CharTest +// each with parameter values 'a' and 'b': +// +// ::std::list GetParameterChars() { +// ::std::list list; +// list.push_back('a'); +// list.push_back('b'); +// return list; +// } +// ::std::list l = GetParameterChars(); +// INSTANTIATE_TEST_CASE_P(CharSequence2, +// CharTest, +// ValuesIn(l.begin(), l.end())); +// +template +internal::ParamGenerator< + typename ::testing::internal::IteratorTraits::value_type> +ValuesIn(ForwardIterator begin, ForwardIterator end) { + typedef typename ::testing::internal::IteratorTraits + ::value_type ParamType; + return internal::ParamGenerator( + new internal::ValuesInIteratorRangeGenerator(begin, end)); +} + +template +internal::ParamGenerator ValuesIn(const T (&array)[N]) { + return ValuesIn(array, array + N); +} + +template +internal::ParamGenerator ValuesIn( + const Container& container) { + return ValuesIn(container.begin(), container.end()); +} + +// Values() allows generating tests from explicitly specified list of +// parameters. +// +// Synopsis: +// Values(T v1, T v2, ..., T vN) +// - returns a generator producing sequences with elements v1, v2, ..., vN. +// +// For example, this instantiates tests from test case BarTest each +// with values "one", "two", and "three": +// +// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); +// +// This instantiates tests from test case BazTest each with values 1, 2, 3.5. +// The exact type of values will depend on the type of parameter in BazTest. +// +// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); +// +// Currently, Values() supports from 1 to 50 parameters. +// +template +internal::ValueArray1 Values(T1 v1) { + return internal::ValueArray1(v1); +} + +template +internal::ValueArray2 Values(T1 v1, T2 v2) { + return internal::ValueArray2(v1, v2); +} + +template +internal::ValueArray3 Values(T1 v1, T2 v2, T3 v3) { + return internal::ValueArray3(v1, v2, v3); +} + +template +internal::ValueArray4 Values(T1 v1, T2 v2, T3 v3, T4 v4) { + return internal::ValueArray4(v1, v2, v3, v4); +} + +template +internal::ValueArray5 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5) { + return internal::ValueArray5(v1, v2, v3, v4, v5); +} + +template +internal::ValueArray6 Values(T1 v1, T2 v2, T3 v3, + T4 v4, T5 v5, T6 v6) { + return internal::ValueArray6(v1, v2, v3, v4, v5, v6); +} + +template +internal::ValueArray7 Values(T1 v1, T2 v2, T3 v3, + T4 v4, T5 v5, T6 v6, T7 v7) { + return internal::ValueArray7(v1, v2, v3, v4, v5, + v6, v7); +} + +template +internal::ValueArray8 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { + return internal::ValueArray8(v1, v2, v3, v4, + v5, v6, v7, v8); +} + +template +internal::ValueArray9 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { + return internal::ValueArray9(v1, v2, v3, + v4, v5, v6, v7, v8, v9); +} + +template +internal::ValueArray10 Values(T1 v1, + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { + return internal::ValueArray10(v1, + v2, v3, v4, v5, v6, v7, v8, v9, v10); +} + +template +internal::ValueArray11 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11) { + return internal::ValueArray11(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); +} + +template +internal::ValueArray12 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12) { + return internal::ValueArray12(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); +} + +template +internal::ValueArray13 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13) { + return internal::ValueArray13(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); +} + +template +internal::ValueArray14 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { + return internal::ValueArray14(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14); +} + +template +internal::ValueArray15 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { + return internal::ValueArray15(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15); +} + +template +internal::ValueArray16 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16) { + return internal::ValueArray16(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, + v12, v13, v14, v15, v16); +} + +template +internal::ValueArray17 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17) { + return internal::ValueArray17(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, + v11, v12, v13, v14, v15, v16, v17); +} + +template +internal::ValueArray18 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18) { + return internal::ValueArray18(v1, v2, v3, v4, v5, v6, v7, v8, v9, + v10, v11, v12, v13, v14, v15, v16, v17, v18); +} + +template +internal::ValueArray19 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { + return internal::ValueArray19(v1, v2, v3, v4, v5, v6, v7, v8, + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); +} + +template +internal::ValueArray20 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { + return internal::ValueArray20(v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); +} + +template +internal::ValueArray21 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { + return internal::ValueArray21(v1, v2, v3, v4, v5, v6, + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); +} + +template +internal::ValueArray22 Values(T1 v1, T2 v2, T3 v3, + T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22) { + return internal::ValueArray22(v1, v2, v3, v4, + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, + v20, v21, v22); +} + +template +internal::ValueArray23 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22, T23 v23) { + return internal::ValueArray23(v1, v2, v3, + v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, + v20, v21, v22, v23); +} + +template +internal::ValueArray24 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22, T23 v23, T24 v24) { + return internal::ValueArray24(v1, v2, + v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, + v19, v20, v21, v22, v23, v24); +} + +template +internal::ValueArray25 Values(T1 v1, + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, + T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, + T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { + return internal::ValueArray25(v1, + v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, + v18, v19, v20, v21, v22, v23, v24, v25); +} + +template +internal::ValueArray26 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26) { + return internal::ValueArray26(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); +} + +template +internal::ValueArray27 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27) { + return internal::ValueArray27(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, + v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); +} + +template +internal::ValueArray28 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28) { + return internal::ValueArray28(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, + v28); +} + +template +internal::ValueArray29 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29) { + return internal::ValueArray29(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, + v27, v28, v29); +} + +template +internal::ValueArray30 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, + T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, + T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { + return internal::ValueArray30(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, + v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, + v26, v27, v28, v29, v30); +} + +template +internal::ValueArray31 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { + return internal::ValueArray31(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, + v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, + v25, v26, v27, v28, v29, v30, v31); +} + +template +internal::ValueArray32 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, + T32 v32) { + return internal::ValueArray32(v1, v2, v3, v4, v5, v6, v7, v8, v9, + v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31, v32); +} + +template +internal::ValueArray33 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, + T32 v32, T33 v33) { + return internal::ValueArray33(v1, v2, v3, v4, v5, v6, v7, v8, + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); +} + +template +internal::ValueArray34 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, + T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, + T31 v31, T32 v32, T33 v33, T34 v34) { + return internal::ValueArray34(v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, + v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); +} + +template +internal::ValueArray35 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { + return internal::ValueArray35(v1, v2, v3, v4, v5, v6, + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, + v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); +} + +template +internal::ValueArray36 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { + return internal::ValueArray36(v1, v2, v3, v4, + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, + v34, v35, v36); +} + +template +internal::ValueArray37 Values(T1 v1, T2 v2, T3 v3, + T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, + T37 v37) { + return internal::ValueArray37(v1, v2, v3, + v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, + v34, v35, v36, v37); +} + +template +internal::ValueArray38 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, + T37 v37, T38 v38) { + return internal::ValueArray38(v1, v2, + v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, + v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, + v33, v34, v35, v36, v37, v38); +} + +template +internal::ValueArray39 Values(T1 v1, T2 v2, + T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, + T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, + T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, + T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, + T37 v37, T38 v38, T39 v39) { + return internal::ValueArray39(v1, + v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, + v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, + v32, v33, v34, v35, v36, v37, v38, v39); +} + +template +internal::ValueArray40 Values(T1 v1, + T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, + T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, + T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, + T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, + T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { + return internal::ValueArray40(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, + v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); +} + +template +internal::ValueArray41 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { + return internal::ValueArray41(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, + v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, + v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); +} + +template +internal::ValueArray42 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42) { + return internal::ValueArray42(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, + v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, + v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, + v42); +} + +template +internal::ValueArray43 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43) { + return internal::ValueArray43(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, + v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, + v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, + v41, v42, v43); +} + +template +internal::ValueArray44 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44) { + return internal::ValueArray44(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, + v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, + v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, + v40, v41, v42, v43, v44); +} + +template +internal::ValueArray45 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, + T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, + T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, + T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, + T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, + T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { + return internal::ValueArray45(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, + v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, + v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, + v39, v40, v41, v42, v43, v44, v45); +} + +template +internal::ValueArray46 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { + return internal::ValueArray46(v1, v2, v3, v4, v5, v6, v7, v8, v9, + v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, + v38, v39, v40, v41, v42, v43, v44, v45, v46); +} + +template +internal::ValueArray47 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { + return internal::ValueArray47(v1, v2, v3, v4, v5, v6, v7, v8, + v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, + v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); +} + +template +internal::ValueArray48 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, + T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, + T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, + T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, + T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, + T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, + T48 v48) { + return internal::ValueArray48(v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, + v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, + v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); +} + +template +internal::ValueArray49 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, + T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, + T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, + T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, + T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, + T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, + T47 v47, T48 v48, T49 v49) { + return internal::ValueArray49(v1, v2, v3, v4, v5, v6, + v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, + v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, + v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); +} + +template +internal::ValueArray50 Values(T1 v1, T2 v2, T3 v3, T4 v4, + T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, + T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, + T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, + T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, + T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, + T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { + return internal::ValueArray50(v1, v2, v3, v4, + v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, + v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, + v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, + v48, v49, v50); +} + +// Bool() allows generating tests with parameters in a set of (false, true). +// +// Synopsis: +// Bool() +// - returns a generator producing sequences with elements {false, true}. +// +// It is useful when testing code that depends on Boolean flags. Combinations +// of multiple flags can be tested when several Bool()'s are combined using +// Combine() function. +// +// In the following example all tests in the test case FlagDependentTest +// will be instantiated twice with parameters false and true. +// +// class FlagDependentTest : public testing::TestWithParam { +// virtual void SetUp() { +// external_flag = GetParam(); +// } +// } +// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); +// +inline internal::ParamGenerator Bool() { + return Values(false, true); +} + +# if GTEST_HAS_COMBINE +// Combine() allows the user to combine two or more sequences to produce +// values of a Cartesian product of those sequences' elements. +// +// Synopsis: +// Combine(gen1, gen2, ..., genN) +// - returns a generator producing sequences with elements coming from +// the Cartesian product of elements from the sequences generated by +// gen1, gen2, ..., genN. The sequence elements will have a type of +// tuple where T1, T2, ..., TN are the types +// of elements from sequences produces by gen1, gen2, ..., genN. +// +// Combine can have up to 10 arguments. This number is currently limited +// by the maximum number of elements in the tuple implementation used by Google +// Test. +// +// Example: +// +// This will instantiate tests in test case AnimalTest each one with +// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), +// tuple("dog", BLACK), and tuple("dog", WHITE): +// +// enum Color { BLACK, GRAY, WHITE }; +// class AnimalTest +// : public testing::TestWithParam > {...}; +// +// TEST_P(AnimalTest, AnimalLooksNice) {...} +// +// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, +// Combine(Values("cat", "dog"), +// Values(BLACK, WHITE))); +// +// This will instantiate tests in FlagDependentTest with all variations of two +// Boolean flags: +// +// class FlagDependentTest +// : public testing::TestWithParam > { +// virtual void SetUp() { +// // Assigns external_flag_1 and external_flag_2 values from the tuple. +// tie(external_flag_1, external_flag_2) = GetParam(); +// } +// }; +// +// TEST_P(FlagDependentTest, TestFeature1) { +// // Test your code using external_flag_1 and external_flag_2 here. +// } +// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, +// Combine(Bool(), Bool())); +// +template +internal::CartesianProductHolder2 Combine( + const Generator1& g1, const Generator2& g2) { + return internal::CartesianProductHolder2( + g1, g2); +} + +template +internal::CartesianProductHolder3 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3) { + return internal::CartesianProductHolder3( + g1, g2, g3); +} + +template +internal::CartesianProductHolder4 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4) { + return internal::CartesianProductHolder4( + g1, g2, g3, g4); +} + +template +internal::CartesianProductHolder5 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5) { + return internal::CartesianProductHolder5( + g1, g2, g3, g4, g5); +} + +template +internal::CartesianProductHolder6 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5, const Generator6& g6) { + return internal::CartesianProductHolder6( + g1, g2, g3, g4, g5, g6); +} + +template +internal::CartesianProductHolder7 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5, const Generator6& g6, + const Generator7& g7) { + return internal::CartesianProductHolder7( + g1, g2, g3, g4, g5, g6, g7); +} + +template +internal::CartesianProductHolder8 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5, const Generator6& g6, + const Generator7& g7, const Generator8& g8) { + return internal::CartesianProductHolder8( + g1, g2, g3, g4, g5, g6, g7, g8); +} + +template +internal::CartesianProductHolder9 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5, const Generator6& g6, + const Generator7& g7, const Generator8& g8, const Generator9& g9) { + return internal::CartesianProductHolder9( + g1, g2, g3, g4, g5, g6, g7, g8, g9); +} + +template +internal::CartesianProductHolder10 Combine( + const Generator1& g1, const Generator2& g2, const Generator3& g3, + const Generator4& g4, const Generator5& g5, const Generator6& g6, + const Generator7& g7, const Generator8& g8, const Generator9& g9, + const Generator10& g10) { + return internal::CartesianProductHolder10( + g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); +} +# endif // GTEST_HAS_COMBINE + + + +# define TEST_P(test_case_name, test_name) \ + class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ + : public test_case_name { \ + public: \ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ + virtual void TestBody(); \ + private: \ + static int AddToRegistry() { \ + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ + GetTestCasePatternHolder(\ + #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ + #test_case_name, \ + #test_name, \ + new ::testing::internal::TestMetaFactory< \ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ + return 0; \ + } \ + static int gtest_registering_dummy_; \ + GTEST_DISALLOW_COPY_AND_ASSIGN_(\ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ + }; \ + int GTEST_TEST_CLASS_NAME_(test_case_name, \ + test_name)::gtest_registering_dummy_ = \ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ + void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() + +# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ + ::testing::internal::ParamGenerator \ + gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ + int gtest_##prefix##test_case_name##_dummy_ = \ + ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ + GetTestCasePatternHolder(\ + #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ + #prefix, \ + >est_##prefix##test_case_name##_EvalGenerator_, \ + __FILE__, __LINE__) + +} // namespace testing + +#endif // GTEST_HAS_PARAM_TEST + +#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/cli/test/include/gtest/gtest-printers.h b/cli/test/include/gtest/gtest-printers.h new file mode 100644 index 0000000..9cbab3f --- /dev/null +++ b/cli/test/include/gtest/gtest-printers.h @@ -0,0 +1,796 @@ +// Copyright 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +// Google Test - The Google C++ Testing Framework +// +// This file implements a universal value printer that can print a +// value of any type T: +// +// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); +// +// A user can teach this function how to print a class type T by +// defining either operator<<() or PrintTo() in the namespace that +// defines T. More specifically, the FIRST defined function in the +// following list will be used (assuming T is defined in namespace +// foo): +// +// 1. foo::PrintTo(const T&, ostream*) +// 2. operator<<(ostream&, const T&) defined in either foo or the +// global namespace. +// +// If none of the above is defined, it will print the debug string of +// the value if it is a protocol buffer, or print the raw bytes in the +// value otherwise. +// +// To aid debugging: when T is a reference type, the address of the +// value is also printed; when T is a (const) char pointer, both the +// pointer value and the NUL-terminated string it points to are +// printed. +// +// We also provide some convenient wrappers: +// +// // Prints a value to a string. For a (const or not) char +// // pointer, the NUL-terminated string (but not the pointer) is +// // printed. +// std::string ::testing::PrintToString(const T& value); +// +// // Prints a value tersely: for a reference type, the referenced +// // value (but not the address) is printed; for a (const or not) char +// // pointer, the NUL-terminated string (but not the pointer) is +// // printed. +// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); +// +// // Prints value using the type inferred by the compiler. The difference +// // from UniversalTersePrint() is that this function prints both the +// // pointer and the NUL-terminated string for a (const or not) char pointer. +// void ::testing::internal::UniversalPrint(const T& value, ostream*); +// +// // Prints the fields of a tuple tersely to a string vector, one +// // element for each field. Tuple support must be enabled in +// // gtest-port.h. +// std::vector UniversalTersePrintTupleFieldsToStrings( +// const Tuple& value); +// +// Known limitation: +// +// The print primitives print the elements of an STL-style container +// using the compiler-inferred type of *iter where iter is a +// const_iterator of the container. When const_iterator is an input +// iterator but not a forward iterator, this inferred type may not +// match value_type, and the print output may be incorrect. In +// practice, this is rarely a problem as for most containers +// const_iterator is a forward iterator. We'll fix this if there's an +// actual need for it. Note that this fix cannot rely on value_type +// being defined as many user-defined container types don't have +// value_type. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ +#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ + +#include // NOLINT +#include +#include +#include +#include +#include "gtest/internal/gtest-port.h" +#include "gtest/internal/gtest-internal.h" + +namespace testing { + +// Definitions in the 'internal' and 'internal2' name spaces are +// subject to change without notice. DO NOT USE THEM IN USER CODE! +namespace internal2 { + +// Prints the given number of bytes in the given object to the given +// ostream. +GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, + size_t count, + ::std::ostream* os); + +// For selecting which printer to use when a given type has neither << +// nor PrintTo(). +enum TypeKind { + kProtobuf, // a protobuf type + kConvertibleToInteger, // a type implicitly convertible to BiggestInt + // (e.g. a named or unnamed enum type) + kOtherType // anything else +}; + +// TypeWithoutFormatter::PrintValue(value, os) is called +// by the universal printer to print a value of type T when neither +// operator<< nor PrintTo() is defined for T, where kTypeKind is the +// "kind" of T as defined by enum TypeKind. +template +class TypeWithoutFormatter { + public: + // This default version is called when kTypeKind is kOtherType. + static void PrintValue(const T& value, ::std::ostream* os) { + PrintBytesInObjectTo(reinterpret_cast(&value), + sizeof(value), os); + } +}; + +// We print a protobuf using its ShortDebugString() when the string +// doesn't exceed this many characters; otherwise we print it using +// DebugString() for better readability. +const size_t kProtobufOneLinerMaxLength = 50; + +template +class TypeWithoutFormatter { + public: + static void PrintValue(const T& value, ::std::ostream* os) { + const ::testing::internal::string short_str = value.ShortDebugString(); + const ::testing::internal::string pretty_str = + short_str.length() <= kProtobufOneLinerMaxLength ? + short_str : ("\n" + value.DebugString()); + *os << ("<" + pretty_str + ">"); + } +}; + +template +class TypeWithoutFormatter { + public: + // Since T has no << operator or PrintTo() but can be implicitly + // converted to BiggestInt, we print it as a BiggestInt. + // + // Most likely T is an enum type (either named or unnamed), in which + // case printing it as an integer is the desired behavior. In case + // T is not an enum, printing it as an integer is the best we can do + // given that it has no user-defined printer. + static void PrintValue(const T& value, ::std::ostream* os) { + const internal::BiggestInt kBigInt = value; + *os << kBigInt; + } +}; + +// Prints the given value to the given ostream. If the value is a +// protocol message, its debug string is printed; if it's an enum or +// of a type implicitly convertible to BiggestInt, it's printed as an +// integer; otherwise the bytes in the value are printed. This is +// what UniversalPrinter::Print() does when it knows nothing about +// type T and T has neither << operator nor PrintTo(). +// +// A user can override this behavior for a class type Foo by defining +// a << operator in the namespace where Foo is defined. +// +// We put this operator in namespace 'internal2' instead of 'internal' +// to simplify the implementation, as much code in 'internal' needs to +// use << in STL, which would conflict with our own << were it defined +// in 'internal'. +// +// Note that this operator<< takes a generic std::basic_ostream type instead of the more restricted std::ostream. If +// we define it to take an std::ostream instead, we'll get an +// "ambiguous overloads" compiler error when trying to print a type +// Foo that supports streaming to std::basic_ostream, as the compiler cannot tell whether +// operator<<(std::ostream&, const T&) or +// operator<<(std::basic_stream, const Foo&) is more +// specific. +template +::std::basic_ostream& operator<<( + ::std::basic_ostream& os, const T& x) { + TypeWithoutFormatter::value ? kProtobuf : + internal::ImplicitlyConvertible::value ? + kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); + return os; +} + +} // namespace internal2 +} // namespace testing + +// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up +// magic needed for implementing UniversalPrinter won't work. +namespace testing_internal { + +// Used to print a value that is not an STL-style container when the +// user doesn't define PrintTo() for it. +template +void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { + // With the following statement, during unqualified name lookup, + // testing::internal2::operator<< appears as if it was declared in + // the nearest enclosing namespace that contains both + // ::testing_internal and ::testing::internal2, i.e. the global + // namespace. For more details, refer to the C++ Standard section + // 7.3.4-1 [namespace.udir]. This allows us to fall back onto + // testing::internal2::operator<< in case T doesn't come with a << + // operator. + // + // We cannot write 'using ::testing::internal2::operator<<;', which + // gcc 3.3 fails to compile due to a compiler bug. + using namespace ::testing::internal2; // NOLINT + + // Assuming T is defined in namespace foo, in the next statement, + // the compiler will consider all of: + // + // 1. foo::operator<< (thanks to Koenig look-up), + // 2. ::operator<< (as the current namespace is enclosed in ::), + // 3. testing::internal2::operator<< (thanks to the using statement above). + // + // The operator<< whose type matches T best will be picked. + // + // We deliberately allow #2 to be a candidate, as sometimes it's + // impossible to define #1 (e.g. when foo is ::std, defining + // anything in it is undefined behavior unless you are a compiler + // vendor.). + *os << value; +} + +} // namespace testing_internal + +namespace testing { +namespace internal { + +// UniversalPrinter::Print(value, ostream_ptr) prints the given +// value to the given ostream. The caller must ensure that +// 'ostream_ptr' is not NULL, or the behavior is undefined. +// +// We define UniversalPrinter as a class template (as opposed to a +// function template), as we need to partially specialize it for +// reference types, which cannot be done with function templates. +template +class UniversalPrinter; + +template +void UniversalPrint(const T& value, ::std::ostream* os); + +// Used to print an STL-style container when the user doesn't define +// a PrintTo() for it. +template +void DefaultPrintTo(IsContainer /* dummy */, + false_type /* is not a pointer */, + const C& container, ::std::ostream* os) { + const size_t kMaxCount = 32; // The maximum number of elements to print. + *os << '{'; + size_t count = 0; + for (typename C::const_iterator it = container.begin(); + it != container.end(); ++it, ++count) { + if (count > 0) { + *os << ','; + if (count == kMaxCount) { // Enough has been printed. + *os << " ..."; + break; + } + } + *os << ' '; + // We cannot call PrintTo(*it, os) here as PrintTo() doesn't + // handle *it being a native array. + internal::UniversalPrint(*it, os); + } + + if (count > 0) { + *os << ' '; + } + *os << '}'; +} + +// Used to print a pointer that is neither a char pointer nor a member +// pointer, when the user doesn't define PrintTo() for it. (A member +// variable pointer or member function pointer doesn't really point to +// a location in the address space. Their representation is +// implementation-defined. Therefore they will be printed as raw +// bytes.) +template +void DefaultPrintTo(IsNotContainer /* dummy */, + true_type /* is a pointer */, + T* p, ::std::ostream* os) { + if (p == NULL) { + *os << "NULL"; + } else { + // C++ doesn't allow casting from a function pointer to any object + // pointer. + // + // IsTrue() silences warnings: "Condition is always true", + // "unreachable code". + if (IsTrue(ImplicitlyConvertible::value)) { + // T is not a function type. We just call << to print p, + // relying on ADL to pick up user-defined << for their pointer + // types, if any. + *os << p; + } else { + // T is a function type, so '*os << p' doesn't do what we want + // (it just prints p as bool). We want to print p as a const + // void*. However, we cannot cast it to const void* directly, + // even using reinterpret_cast, as earlier versions of gcc + // (e.g. 3.4.5) cannot compile the cast when p is a function + // pointer. Casting to UInt64 first solves the problem. + *os << reinterpret_cast( + reinterpret_cast(p)); + } + } +} + +// Used to print a non-container, non-pointer value when the user +// doesn't define PrintTo() for it. +template +void DefaultPrintTo(IsNotContainer /* dummy */, + false_type /* is not a pointer */, + const T& value, ::std::ostream* os) { + ::testing_internal::DefaultPrintNonContainerTo(value, os); +} + +// Prints the given value using the << operator if it has one; +// otherwise prints the bytes in it. This is what +// UniversalPrinter::Print() does when PrintTo() is not specialized +// or overloaded for type T. +// +// A user can override this behavior for a class type Foo by defining +// an overload of PrintTo() in the namespace where Foo is defined. We +// give the user this option as sometimes defining a << operator for +// Foo is not desirable (e.g. the coding style may prevent doing it, +// or there is already a << operator but it doesn't do what the user +// wants). +template +void PrintTo(const T& value, ::std::ostream* os) { + // DefaultPrintTo() is overloaded. The type of its first two + // arguments determine which version will be picked. If T is an + // STL-style container, the version for container will be called; if + // T is a pointer, the pointer version will be called; otherwise the + // generic version will be called. + // + // Note that we check for container types here, prior to we check + // for protocol message types in our operator<<. The rationale is: + // + // For protocol messages, we want to give people a chance to + // override Google Mock's format by defining a PrintTo() or + // operator<<. For STL containers, other formats can be + // incompatible with Google Mock's format for the container + // elements; therefore we check for container types here to ensure + // that our format is used. + // + // The second argument of DefaultPrintTo() is needed to bypass a bug + // in Symbian's C++ compiler that prevents it from picking the right + // overload between: + // + // PrintTo(const T& x, ...); + // PrintTo(T* x, ...); + DefaultPrintTo(IsContainerTest(0), is_pointer(), value, os); +} + +// The following list of PrintTo() overloads tells +// UniversalPrinter::Print() how to print standard types (built-in +// types, strings, plain arrays, and pointers). + +// Overloads for various char types. +GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); +GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); +inline void PrintTo(char c, ::std::ostream* os) { + // When printing a plain char, we always treat it as unsigned. This + // way, the output won't be affected by whether the compiler thinks + // char is signed or not. + PrintTo(static_cast(c), os); +} + +// Overloads for other simple built-in types. +inline void PrintTo(bool x, ::std::ostream* os) { + *os << (x ? "true" : "false"); +} + +// Overload for wchar_t type. +// Prints a wchar_t as a symbol if it is printable or as its internal +// code otherwise and also as its decimal code (except for L'\0'). +// The L'\0' char is printed as "L'\\0'". The decimal code is printed +// as signed integer when wchar_t is implemented by the compiler +// as a signed type and is printed as an unsigned integer when wchar_t +// is implemented as an unsigned type. +GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); + +// Overloads for C strings. +GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); +inline void PrintTo(char* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} + +// signed/unsigned char is often used for representing binary data, so +// we print pointers to it as void* to be safe. +inline void PrintTo(const signed char* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} +inline void PrintTo(signed char* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} +inline void PrintTo(const unsigned char* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} +inline void PrintTo(unsigned char* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} + +// MSVC can be configured to define wchar_t as a typedef of unsigned +// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native +// type. When wchar_t is a typedef, defining an overload for const +// wchar_t* would cause unsigned short* be printed as a wide string, +// possibly causing invalid memory accesses. +#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) +// Overloads for wide C strings +GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); +inline void PrintTo(wchar_t* s, ::std::ostream* os) { + PrintTo(ImplicitCast_(s), os); +} +#endif + +// Overload for C arrays. Multi-dimensional arrays are printed +// properly. + +// Prints the given number of elements in an array, without printing +// the curly braces. +template +void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { + UniversalPrint(a[0], os); + for (size_t i = 1; i != count; i++) { + *os << ", "; + UniversalPrint(a[i], os); + } +} + +// Overloads for ::string and ::std::string. +#if GTEST_HAS_GLOBAL_STRING +GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); +inline void PrintTo(const ::string& s, ::std::ostream* os) { + PrintStringTo(s, os); +} +#endif // GTEST_HAS_GLOBAL_STRING + +GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); +inline void PrintTo(const ::std::string& s, ::std::ostream* os) { + PrintStringTo(s, os); +} + +// Overloads for ::wstring and ::std::wstring. +#if GTEST_HAS_GLOBAL_WSTRING +GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); +inline void PrintTo(const ::wstring& s, ::std::ostream* os) { + PrintWideStringTo(s, os); +} +#endif // GTEST_HAS_GLOBAL_WSTRING + +#if GTEST_HAS_STD_WSTRING +GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); +inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { + PrintWideStringTo(s, os); +} +#endif // GTEST_HAS_STD_WSTRING + +#if GTEST_HAS_TR1_TUPLE +// Overload for ::std::tr1::tuple. Needed for printing function arguments, +// which are packed as tuples. + +// Helper function for printing a tuple. T must be instantiated with +// a tuple type. +template +void PrintTupleTo(const T& t, ::std::ostream* os); + +// Overloaded PrintTo() for tuples of various arities. We support +// tuples of up-to 10 fields. The following implementation works +// regardless of whether tr1::tuple is implemented using the +// non-standard variadic template feature or not. + +inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo(const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} + +template +void PrintTo( + const ::std::tr1::tuple& t, + ::std::ostream* os) { + PrintTupleTo(t, os); +} +#endif // GTEST_HAS_TR1_TUPLE + +// Overload for std::pair. +template +void PrintTo(const ::std::pair& value, ::std::ostream* os) { + *os << '('; + // We cannot use UniversalPrint(value.first, os) here, as T1 may be + // a reference type. The same for printing value.second. + UniversalPrinter::Print(value.first, os); + *os << ", "; + UniversalPrinter::Print(value.second, os); + *os << ')'; +} + +// Implements printing a non-reference type T by letting the compiler +// pick the right overload of PrintTo() for T. +template +class UniversalPrinter { + public: + // MSVC warns about adding const to a function type, so we want to + // disable the warning. +#ifdef _MSC_VER +# pragma warning(push) // Saves the current warning state. +# pragma warning(disable:4180) // Temporarily disables warning 4180. +#endif // _MSC_VER + + // Note: we deliberately don't call this PrintTo(), as that name + // conflicts with ::testing::internal::PrintTo in the body of the + // function. + static void Print(const T& value, ::std::ostream* os) { + // By default, ::testing::internal::PrintTo() is used for printing + // the value. + // + // Thanks to Koenig look-up, if T is a class and has its own + // PrintTo() function defined in its namespace, that function will + // be visible here. Since it is more specific than the generic ones + // in ::testing::internal, it will be picked by the compiler in the + // following statement - exactly what we want. + PrintTo(value, os); + } + +#ifdef _MSC_VER +# pragma warning(pop) // Restores the warning state. +#endif // _MSC_VER +}; + +// UniversalPrintArray(begin, len, os) prints an array of 'len' +// elements, starting at address 'begin'. +template +void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { + if (len == 0) { + *os << "{}"; + } else { + *os << "{ "; + const size_t kThreshold = 18; + const size_t kChunkSize = 8; + // If the array has more than kThreshold elements, we'll have to + // omit some details by printing only the first and the last + // kChunkSize elements. + // TODO(wan@google.com): let the user control the threshold using a flag. + if (len <= kThreshold) { + PrintRawArrayTo(begin, len, os); + } else { + PrintRawArrayTo(begin, kChunkSize, os); + *os << ", ..., "; + PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); + } + *os << " }"; + } +} +// This overload prints a (const) char array compactly. +GTEST_API_ void UniversalPrintArray(const char* begin, + size_t len, + ::std::ostream* os); + +// Implements printing an array type T[N]. +template +class UniversalPrinter { + public: + // Prints the given array, omitting some elements when there are too + // many. + static void Print(const T (&a)[N], ::std::ostream* os) { + UniversalPrintArray(a, N, os); + } +}; + +// Implements printing a reference type T&. +template +class UniversalPrinter { + public: + // MSVC warns about adding const to a function type, so we want to + // disable the warning. +#ifdef _MSC_VER +# pragma warning(push) // Saves the current warning state. +# pragma warning(disable:4180) // Temporarily disables warning 4180. +#endif // _MSC_VER + + static void Print(const T& value, ::std::ostream* os) { + // Prints the address of the value. We use reinterpret_cast here + // as static_cast doesn't compile when T is a function type. + *os << "@" << reinterpret_cast(&value) << " "; + + // Then prints the value itself. + UniversalPrint(value, os); + } + +#ifdef _MSC_VER +# pragma warning(pop) // Restores the warning state. +#endif // _MSC_VER +}; + +// Prints a value tersely: for a reference type, the referenced value +// (but not the address) is printed; for a (const) char pointer, the +// NUL-terminated string (but not the pointer) is printed. +template +void UniversalTersePrint(const T& value, ::std::ostream* os) { + UniversalPrint(value, os); +} +inline void UniversalTersePrint(const char* str, ::std::ostream* os) { + if (str == NULL) { + *os << "NULL"; + } else { + UniversalPrint(string(str), os); + } +} +inline void UniversalTersePrint(char* str, ::std::ostream* os) { + UniversalTersePrint(static_cast(str), os); +} + +// Prints a value using the type inferred by the compiler. The +// difference between this and UniversalTersePrint() is that for a +// (const) char pointer, this prints both the pointer and the +// NUL-terminated string. +template +void UniversalPrint(const T& value, ::std::ostream* os) { + UniversalPrinter::Print(value, os); +} + +#if GTEST_HAS_TR1_TUPLE +typedef ::std::vector Strings; + +// This helper template allows PrintTo() for tuples and +// UniversalTersePrintTupleFieldsToStrings() to be defined by +// induction on the number of tuple fields. The idea is that +// TuplePrefixPrinter::PrintPrefixTo(t, os) prints the first N +// fields in tuple t, and can be defined in terms of +// TuplePrefixPrinter. + +// The inductive case. +template +struct TuplePrefixPrinter { + // Prints the first N fields of a tuple. + template + static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { + TuplePrefixPrinter::PrintPrefixTo(t, os); + *os << ", "; + UniversalPrinter::type> + ::Print(::std::tr1::get(t), os); + } + + // Tersely prints the first N fields of a tuple to a string vector, + // one element for each field. + template + static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { + TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); + ::std::stringstream ss; + UniversalTersePrint(::std::tr1::get(t), &ss); + strings->push_back(ss.str()); + } +}; + +// Base cases. +template <> +struct TuplePrefixPrinter<0> { + template + static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} + + template + static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} +}; +// We have to specialize the entire TuplePrefixPrinter<> class +// template here, even though the definition of +// TersePrintPrefixToStrings() is the same as the generic version, as +// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't +// support specializing a method template of a class template. +template <> +struct TuplePrefixPrinter<1> { + template + static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { + UniversalPrinter::type>:: + Print(::std::tr1::get<0>(t), os); + } + + template + static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { + ::std::stringstream ss; + UniversalTersePrint(::std::tr1::get<0>(t), &ss); + strings->push_back(ss.str()); + } +}; + +// Helper function for printing a tuple. T must be instantiated with +// a tuple type. +template +void PrintTupleTo(const T& t, ::std::ostream* os) { + *os << "("; + TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: + PrintPrefixTo(t, os); + *os << ")"; +} + +// Prints the fields of a tuple tersely to a string vector, one +// element for each field. See the comment before +// UniversalTersePrint() for how we define "tersely". +template +Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { + Strings result; + TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: + TersePrintPrefixToStrings(value, &result); + return result; +} +#endif // GTEST_HAS_TR1_TUPLE + +} // namespace internal + +template +::std::string PrintToString(const T& value) { + ::std::stringstream ss; + internal::UniversalTersePrint(value, &ss); + return ss.str(); +} + +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ diff --git a/cli/test/include/gtest/gtest-spi.h b/cli/test/include/gtest/gtest-spi.h new file mode 100644 index 0000000..b226e55 --- /dev/null +++ b/cli/test/include/gtest/gtest-spi.h @@ -0,0 +1,232 @@ +// Copyright 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// Utilities for testing Google Test itself and code that uses Google Test +// (e.g. frameworks built on top of Google Test). + +#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ +#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ + +#include "gtest/gtest.h" + +namespace testing { + +// This helper class can be used to mock out Google Test failure reporting +// so that we can test Google Test or code that builds on Google Test. +// +// An object of this class appends a TestPartResult object to the +// TestPartResultArray object given in the constructor whenever a Google Test +// failure is reported. It can either intercept only failures that are +// generated in the same thread that created this object or it can intercept +// all generated failures. The scope of this mock object can be controlled with +// the second argument to the two arguments constructor. +class GTEST_API_ ScopedFakeTestPartResultReporter + : public TestPartResultReporterInterface { + public: + // The two possible mocking modes of this object. + enum InterceptMode { + INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. + INTERCEPT_ALL_THREADS // Intercepts all failures. + }; + + // The c'tor sets this object as the test part result reporter used + // by Google Test. The 'result' parameter specifies where to report the + // results. This reporter will only catch failures generated in the current + // thread. DEPRECATED + explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); + + // Same as above, but you can choose the interception scope of this object. + ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, + TestPartResultArray* result); + + // The d'tor restores the previous test part result reporter. + virtual ~ScopedFakeTestPartResultReporter(); + + // Appends the TestPartResult object to the TestPartResultArray + // received in the constructor. + // + // This method is from the TestPartResultReporterInterface + // interface. + virtual void ReportTestPartResult(const TestPartResult& result); + private: + void Init(); + + const InterceptMode intercept_mode_; + TestPartResultReporterInterface* old_reporter_; + TestPartResultArray* const result_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); +}; + +namespace internal { + +// A helper class for implementing EXPECT_FATAL_FAILURE() and +// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given +// TestPartResultArray contains exactly one failure that has the given +// type and contains the given substring. If that's not the case, a +// non-fatal failure will be generated. +class GTEST_API_ SingleFailureChecker { + public: + // The constructor remembers the arguments. + SingleFailureChecker(const TestPartResultArray* results, + TestPartResult::Type type, + const string& substr); + ~SingleFailureChecker(); + private: + const TestPartResultArray* const results_; + const TestPartResult::Type type_; + const string substr_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); +}; + +} // namespace internal + +} // namespace testing + +// A set of macros for testing Google Test assertions or code that's expected +// to generate Google Test fatal failures. It verifies that the given +// statement will cause exactly one fatal Google Test failure with 'substr' +// being part of the failure message. +// +// There are two different versions of this macro. EXPECT_FATAL_FAILURE only +// affects and considers failures generated in the current thread and +// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. +// +// The verification of the assertion is done correctly even when the statement +// throws an exception or aborts the current function. +// +// Known restrictions: +// - 'statement' cannot reference local non-static variables or +// non-static members of the current object. +// - 'statement' cannot return a value. +// - You cannot stream a failure message to this macro. +// +// Note that even though the implementations of the following two +// macros are much alike, we cannot refactor them to use a common +// helper macro, due to some peculiarity in how the preprocessor +// works. The AcceptsMacroThatExpandsToUnprotectedComma test in +// gtest_unittest.cc will fail to compile if we do that. +#define EXPECT_FATAL_FAILURE(statement, substr) \ + do { \ + class GTestExpectFatalFailureHelper {\ + public:\ + static void Execute() { statement; }\ + };\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ + GTestExpectFatalFailureHelper::Execute();\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ + do { \ + class GTestExpectFatalFailureHelper {\ + public:\ + static void Execute() { statement; }\ + };\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ALL_THREADS, >est_failures);\ + GTestExpectFatalFailureHelper::Execute();\ + }\ + } while (::testing::internal::AlwaysFalse()) + +// A macro for testing Google Test assertions or code that's expected to +// generate Google Test non-fatal failures. It asserts that the given +// statement will cause exactly one non-fatal Google Test failure with 'substr' +// being part of the failure message. +// +// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only +// affects and considers failures generated in the current thread and +// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. +// +// 'statement' is allowed to reference local variables and members of +// the current object. +// +// The verification of the assertion is done correctly even when the statement +// throws an exception or aborts the current function. +// +// Known restrictions: +// - You cannot stream a failure message to this macro. +// +// Note that even though the implementations of the following two +// macros are much alike, we cannot refactor them to use a common +// helper macro, due to some peculiarity in how the preprocessor +// works. If we do that, the code won't compile when the user gives +// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that +// expands to code containing an unprotected comma. The +// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc +// catches that. +// +// For the same reason, we have to write +// if (::testing::internal::AlwaysTrue()) { statement; } +// instead of +// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) +// to avoid an MSVC warning on unreachable code. +#define EXPECT_NONFATAL_FAILURE(statement, substr) \ + do {\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ + (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ + if (::testing::internal::AlwaysTrue()) { statement; }\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ + do {\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ + (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS,\ + >est_failures);\ + if (::testing::internal::AlwaysTrue()) { statement; }\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_ diff --git a/cli/test/include/gtest/gtest-test-part.h b/cli/test/include/gtest/gtest-test-part.h new file mode 100644 index 0000000..0a9e460 --- /dev/null +++ b/cli/test/include/gtest/gtest-test-part.h @@ -0,0 +1,180 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: mheule@google.com (Markus Heule) +// + +#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ +#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ + +#include +#include +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-string.h" + +namespace testing { + +// A copyable object representing the result of a test part (i.e. an +// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). +// +// Don't inherit from TestPartResult as its destructor is not virtual. +class GTEST_API_ TestPartResult { + public: + // The possible outcomes of a test part (i.e. an assertion or an + // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). + enum Type { + kSuccess, // Succeeded. + kNonFatalFailure, // Failed but the test can continue. + kFatalFailure, // Failed and the test should be terminated. + kFouceSuccess //强制使用例成功,且直接返回退出用例 + }; + + // C'tor. TestPartResult does NOT have a default constructor. + // Always use this constructor (with parameters) to create a + // TestPartResult object. + TestPartResult(Type a_type, + const char* a_file_name, + int a_line_number, + const char* a_message) + : type_(a_type), + file_name_(a_file_name), + line_number_(a_line_number), + summary_(ExtractSummary(a_message)), + message_(a_message) { + } + + // Gets the outcome of the test part. + Type type() const { return type_; } + + // Gets the name of the source file where the test part took place, or + // NULL if it's unknown. + const char* file_name() const { return file_name_.c_str(); } + + // Gets the line in the source file where the test part took place, + // or -1 if it's unknown. + int line_number() const { return line_number_; } + + // Gets the summary of the failure message. + const char* summary() const { return summary_.c_str(); } + + // Gets the message associated with the test part. + const char* message() const { return message_.c_str(); } + + // Returns true iff the test part passed. + bool passed() const { return ((type_ == kSuccess) || (type_ == kFouceSuccess)); } + + // Returns true iff the test part failed. + bool failed() const { return ((type_ != kSuccess) && (type_ != kFouceSuccess)); } + + // Returns true iff the test part non-fatally failed. + bool nonfatally_failed() const { return type_ == kNonFatalFailure; } + + // Returns true iff the test part fatally failed. + bool fatally_failed() const { return type_ == kFatalFailure; } + + // Returns true if 强制成功. + bool fatally_succeed() const { return type_ == kFouceSuccess; } + private: + Type type_; + + // Gets the summary of the failure message by omitting the stack + // trace in it. + static internal::String ExtractSummary(const char* message); + + // The name of the source file where the test part took place, or + // NULL if the source file is unknown. + internal::String file_name_; + // The line in the source file where the test part took place, or -1 + // if the line number is unknown. + int line_number_; + internal::String summary_; // The test failure summary. + internal::String message_; // The test failure message. +}; + +// Prints a TestPartResult object. +std::ostream& operator<<(std::ostream& os, const TestPartResult& result); + +// An array of TestPartResult objects. +// +// Don't inherit from TestPartResultArray as its destructor is not +// virtual. +class GTEST_API_ TestPartResultArray { + public: + TestPartResultArray() {} + + // Appends the given TestPartResult to the array. + void Append(const TestPartResult& result); + + // Returns the TestPartResult at the given index (0-based). + const TestPartResult& GetTestPartResult(int index) const; + + // Returns the number of TestPartResult objects in the array. + int size() const; + + private: + std::vector array_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); +}; + +// This interface knows how to report a test part result. +class TestPartResultReporterInterface { + public: + virtual ~TestPartResultReporterInterface() {} + + virtual void ReportTestPartResult(const TestPartResult& result) = 0; +}; + +namespace internal { + +// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a +// statement generates new fatal failures. To do so it registers itself as the +// current test part result reporter. Besides checking if fatal failures were +// reported, it only delegates the reporting to the former result reporter. +// The original result reporter is restored in the destructor. +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +class GTEST_API_ HasNewFatalFailureHelper + : public TestPartResultReporterInterface { + public: + HasNewFatalFailureHelper(); + virtual ~HasNewFatalFailureHelper(); + virtual void ReportTestPartResult(const TestPartResult& result); + bool has_new_fatal_failure() const { return has_new_fatal_failure_; } + private: + bool has_new_fatal_failure_; + TestPartResultReporterInterface* original_reporter_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); +}; + +} // namespace internal + +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ diff --git a/cli/test/include/gtest/gtest-typed-test.h b/cli/test/include/gtest/gtest-typed-test.h new file mode 100644 index 0000000..fe1e83b --- /dev/null +++ b/cli/test/include/gtest/gtest-typed-test.h @@ -0,0 +1,259 @@ +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ +#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ + +// This header implements typed tests and type-parameterized tests. + +// Typed (aka type-driven) tests repeat the same test for types in a +// list. You must know which types you want to test with when writing +// typed tests. Here's how you do it: + +#if 0 + +// First, define a fixture class template. It should be parameterized +// by a type. Remember to derive it from testing::Test. +template +class FooTest : public testing::Test { + public: + ... + typedef std::list List; + static T shared_; + T value_; +}; + +// Next, associate a list of types with the test case, which will be +// repeated for each type in the list. The typedef is necessary for +// the macro to parse correctly. +typedef testing::Types MyTypes; +TYPED_TEST_CASE(FooTest, MyTypes); + +// If the type list contains only one type, you can write that type +// directly without Types<...>: +// TYPED_TEST_CASE(FooTest, int); + +// Then, use TYPED_TEST() instead of TEST_F() to define as many typed +// tests for this test case as you want. +TYPED_TEST(FooTest, DoesBlah) { + // Inside a test, refer to TypeParam to get the type parameter. + // Since we are inside a derived class template, C++ requires use to + // visit the members of FooTest via 'this'. + TypeParam n = this->value_; + + // To visit static members of the fixture, add the TestFixture:: + // prefix. + n += TestFixture::shared_; + + // To refer to typedefs in the fixture, add the "typename + // TestFixture::" prefix. + typename TestFixture::List values; + values.push_back(n); + ... +} + +TYPED_TEST(FooTest, HasPropertyA) { ... } + +#endif // 0 + +// Type-parameterized tests are abstract test patterns parameterized +// by a type. Compared with typed tests, type-parameterized tests +// allow you to define the test pattern without knowing what the type +// parameters are. The defined pattern can be instantiated with +// different types any number of times, in any number of translation +// units. +// +// If you are designing an interface or concept, you can define a +// suite of type-parameterized tests to verify properties that any +// valid implementation of the interface/concept should have. Then, +// each implementation can easily instantiate the test suite to verify +// that it conforms to the requirements, without having to write +// similar tests repeatedly. Here's an example: + +#if 0 + +// First, define a fixture class template. It should be parameterized +// by a type. Remember to derive it from testing::Test. +template +class FooTest : public testing::Test { + ... +}; + +// Next, declare that you will define a type-parameterized test case +// (the _P suffix is for "parameterized" or "pattern", whichever you +// prefer): +TYPED_TEST_CASE_P(FooTest); + +// Then, use TYPED_TEST_P() to define as many type-parameterized tests +// for this type-parameterized test case as you want. +TYPED_TEST_P(FooTest, DoesBlah) { + // Inside a test, refer to TypeParam to get the type parameter. + TypeParam n = 0; + ... +} + +TYPED_TEST_P(FooTest, HasPropertyA) { ... } + +// Now the tricky part: you need to register all test patterns before +// you can instantiate them. The first argument of the macro is the +// test case name; the rest are the names of the tests in this test +// case. +REGISTER_TYPED_TEST_CASE_P(FooTest, + DoesBlah, HasPropertyA); + +// Finally, you are free to instantiate the pattern with the types you +// want. If you put the above code in a header file, you can #include +// it in multiple C++ source files and instantiate it multiple times. +// +// To distinguish different instances of the pattern, the first +// argument to the INSTANTIATE_* macro is a prefix that will be added +// to the actual test case name. Remember to pick unique prefixes for +// different instances. +typedef testing::Types MyTypes; +INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); + +// If the type list contains only one type, you can write that type +// directly without Types<...>: +// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); + +#endif // 0 + +#include "gtest/internal/gtest-port.h" +#include "gtest/internal/gtest-type-util.h" + +// Implements typed tests. + +#if GTEST_HAS_TYPED_TEST + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the name of the typedef for the type parameters of the +// given test case. +# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ + +// The 'Types' template argument below must have spaces around it +// since some compilers may choke on '>>' when passing a template +// instance (e.g. Types) +# define TYPED_TEST_CASE(CaseName, Types) \ + typedef ::testing::internal::TypeList< Types >::type \ + GTEST_TYPE_PARAMS_(CaseName) + +# define TYPED_TEST(CaseName, TestName) \ + template \ + class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ + : public CaseName { \ + private: \ + typedef CaseName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + virtual void TestBody(); \ + }; \ + bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::internal::TypeParameterizedTest< \ + CaseName, \ + ::testing::internal::TemplateSel< \ + GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ + GTEST_TYPE_PARAMS_(CaseName)>::Register(\ + "", #CaseName, #TestName, 0); \ + template \ + void GTEST_TEST_CLASS_NAME_(CaseName, TestName)::TestBody() + +#endif // GTEST_HAS_TYPED_TEST + +// Implements type-parameterized tests. + +#if GTEST_HAS_TYPED_TEST_P + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the namespace name that the type-parameterized tests for +// the given type-parameterized test case are defined in. The exact +// name of the namespace is subject to change without notice. +# define GTEST_CASE_NAMESPACE_(TestCaseName) \ + gtest_case_##TestCaseName##_ + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the name of the variable used to remember the names of +// the defined tests in the given test case. +# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ + gtest_typed_test_case_p_state_##TestCaseName##_ + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. +// +// Expands to the name of the variable used to remember the names of +// the registered tests in the given test case. +# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ + gtest_registered_test_names_##TestCaseName##_ + +// The variables defined in the type-parameterized test macros are +// static as typically these macros are used in a .h file that can be +// #included in multiple translation units linked together. +# define TYPED_TEST_CASE_P(CaseName) \ + static ::testing::internal::TypedTestCasePState \ + GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) + +# define TYPED_TEST_P(CaseName, TestName) \ + namespace GTEST_CASE_NAMESPACE_(CaseName) { \ + template \ + class TestName : public CaseName { \ + private: \ + typedef CaseName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + virtual void TestBody(); \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ + __FILE__, __LINE__, #CaseName, #TestName); \ + } \ + template \ + void GTEST_CASE_NAMESPACE_(CaseName)::TestName::TestBody() + +# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ + namespace GTEST_CASE_NAMESPACE_(CaseName) { \ + typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ + } \ + static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ + GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ + __FILE__, __LINE__, #__VA_ARGS__) + +// The 'Types' template argument below must have spaces around it +// since some compilers may choke on '>>' when passing a template +// instance (e.g. Types) +# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ + bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::internal::TypeParameterizedTestCase::type>::Register(\ + #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) + +#endif // GTEST_HAS_TYPED_TEST_P + +#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/cli/test/include/gtest/gtest.h b/cli/test/include/gtest/gtest.h new file mode 100644 index 0000000..27959ee --- /dev/null +++ b/cli/test/include/gtest/gtest.h @@ -0,0 +1,2552 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file defines the public API for Google Test. It should be +// included by any test program that uses Google Test. +// +// IMPORTANT NOTE: Due to limitation of the C++ language, we have to +// leave some internal implementation details in this header file. +// They are clearly marked by comments like this: +// +// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +// +// Such code is NOT meant to be used by a user directly, and is subject +// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user +// program! +// +// Acknowledgment: Google Test borrowed the idea of automatic test +// registration from Barthelemy Dagenais' (barthelemy@prologique.com) +// easyUnit framework. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ +#define GTEST_INCLUDE_GTEST_GTEST_H_ + +#include +#include +#include +#include + +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-string.h" +#include "gtest/gtest-death-test.h" +#include "gtest/gtest-message.h" +#include "gtest/gtest-param-test.h" +#include "gtest/gtest-printers.h" +#include "gtest/gtest_prod.h" +#include "gtest/gtest-test-part.h" +#include "gtest/gtest-typed-test.h" + +// Depending on the platform, different string classes are available. +// On Linux, in addition to ::std::string, Google also makes use of +// class ::string, which has the same interface as ::std::string, but +// has a different implementation. +// +// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that +// ::string is available AND is a distinct type to ::std::string, or +// define it to 0 to indicate otherwise. +// +// If the user's ::std::string and ::string are the same class due to +// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0. +// +// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined +// heuristically. + +#define VERSION_STRING "verions:1025!\n\ +add FORCE_SUCCESS()\n" + +#define PRINT_DT_VERSION() printf("%s", VERSION_STRING); +//added by ywx627293 +extern "C" std::string g_current_cmd; +//add end + +extern int gtest_assert_count_; + +namespace testing { + +extern std::map map_testcase_assert; +// Declares the flags. + +// This flag temporary enables the disabled tests. +GTEST_DECLARE_bool_(also_run_disabled_tests); + +// This flag brings the debugger on an assertion failure. +GTEST_DECLARE_bool_(break_on_failure); + +// This flag controls whether Google Test catches all test-thrown exceptions +// and logs them as failures. +GTEST_DECLARE_bool_(catch_exceptions); + +// This flag enables using colors in terminal output. Available values are +// "yes" to enable colors, "no" (disable colors), or "auto" (the default) +// to let Google Test decide. +GTEST_DECLARE_string_(color); + +// This flag sets up the filter to select by name using a glob pattern +// the tests to run. If the filter is not given all tests are executed. +GTEST_DECLARE_string_(filter); + +// This flag causes the Google Test to list tests. None of the tests listed +// are actually run if the flag is provided. +GTEST_DECLARE_bool_(list_tests); + +//以下是autostar团队增加的命令 +GTEST_DECLARE_bool_(save_tests); +GTEST_DECLARE_string_(list_order); +GTEST_DECLARE_string_(dark_list_order); +GTEST_DECLARE_bool_(style_check); +GTEST_DECLARE_string_(style_check_output); +GTEST_DECLARE_string_(fuzzing_config); +GTEST_DECLARE_string_(fuzzing_args); +//end autostar + +// This flag controls whether Google Test emits a detailed XML report to a file +// in addition to its normal textual output. +GTEST_DECLARE_string_(output); + +// This flags control whether Google Test prints the elapsed time for each +// test. +GTEST_DECLARE_bool_(print_time); + +// This flag specifies the random number seed. +GTEST_DECLARE_int32_(random_seed); + +// This flag sets how many times the tests are repeated. The default value +// is 1. If the value is -1 the tests are repeating forever. +GTEST_DECLARE_int32_(repeat); + +// This flag controls whether Google Test includes Google Test internal +// stack frames in failure stack traces. +GTEST_DECLARE_bool_(show_internal_stack_frames); + +// When this flag is specified, tests' order is randomized on every iteration. +GTEST_DECLARE_bool_(shuffle); + +// This flag specifies the maximum number of stack frames to be +// printed in a failure message. +GTEST_DECLARE_int32_(stack_trace_depth); + +// When this flag is specified, a failed assertion will throw an +// exception if exceptions are enabled, or exit the program with a +// non-zero code otherwise. +GTEST_DECLARE_bool_(throw_on_failure); + +// When this flag is set with a "host:port" string, on supported +// platforms test results are streamed to the specified port on +// the specified host machine. +GTEST_DECLARE_string_(stream_result_to); + +GTEST_DECLARE_bool_(simple_reports); + +//socket local port +GTEST_DECLARE_int32_(local_port); + +//socket server ip +GTEST_DECLARE_string_(server_ip); +// The upper limit for valid stack trace depths. +const int kMaxStackTraceDepth = 100; +//guoqiuju 增加 +extern int g_set_throw_effect; + +namespace internal { + +class AssertHelper; +class DefaultGlobalTestPartResultReporter; +class ExecDeathTest; +class NoExecDeathTest; +class FinalSuccessChecker; +class GTestFlagSaver; +class TestResultAccessor; +class TestEventListenersAccessor; +class TestEventRepeater; +class WindowsDeathTest; +class UnitTestImpl* GetUnitTestImpl(); +void ReportFailureInUnknownLocation(TestPartResult::Type result_type, + const String& message); + +// Converts a streamable value to a String. A NULL pointer is +// converted to "(null)". When the input value is a ::string, +// ::std::string, ::wstring, or ::std::wstring object, each NUL +// character in it is replaced with "\\0". +// Declared in gtest-internal.h but defined here, so that it has access +// to the definition of the Message class, required by the ARM +// compiler. +template +String StreamableToString(const T& streamable) { + return (Message() << streamable).GetString(); +} + +} // namespace internal + +// The friend relationship of some of these classes is cyclic. +// If we don't forward declare them the compiler might confuse the classes +// in friendship clauses with same named classes on the scope. +class Test; +class TestCase; +class TestInfo; +class UnitTest; + +// A class for indicating whether an assertion was successful. When +// the assertion wasn't successful, the AssertionResult object +// remembers a non-empty message that describes how it failed. +// +// To create an instance of this class, use one of the factory functions +// (AssertionSuccess() and AssertionFailure()). +// +// This class is useful for two purposes: +// 1. Defining predicate functions to be used with Boolean test assertions +// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts +// 2. Defining predicate-format functions to be +// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). +// +// For example, if you define IsEven predicate: +// +// testing::AssertionResult IsEven(int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess(); +// else +// return testing::AssertionFailure() << n << " is odd"; +// } +// +// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) +// will print the message +// +// Value of: IsEven(Fib(5)) +// Actual: false (5 is odd) +// Expected: true +// +// instead of a more opaque +// +// Value of: IsEven(Fib(5)) +// Actual: false +// Expected: true +// +// in case IsEven is a simple Boolean predicate. +// +// If you expect your predicate to be reused and want to support informative +// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up +// about half as often as positive ones in our tests), supply messages for +// both success and failure cases: +// +// testing::AssertionResult IsEven(int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess() << n << " is even"; +// else +// return testing::AssertionFailure() << n << " is odd"; +// } +// +// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print +// +// Value of: IsEven(Fib(6)) +// Actual: true (8 is even) +// Expected: false +// +// NB: Predicates that support negative Boolean assertions have reduced +// performance in positive ones so be careful not to use them in tests +// that have lots (tens of thousands) of positive Boolean assertions. +// +// To use this class with EXPECT_PRED_FORMAT assertions such as: +// +// // Verifies that Foo() returns an even number. +// EXPECT_PRED_FORMAT1(IsEven, Foo()); +// +// you need to define: +// +// testing::AssertionResult IsEven(const char* expr, int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess(); +// else +// return testing::AssertionFailure() +// << "Expected: " << expr << " is even\n Actual: it's " << n; +// } +// +// If Foo() returns 5, you will see the following message: +// +// Expected: Foo() is even +// Actual: it's 5 +// +#pragma pack(push, 4) //该类修改为4字节对齐,防止用户修改字节对齐后不恢复,导致message_错误 +class GTEST_API_ AssertionResult { + public: + // Copy constructor. + // Used in EXPECT_TRUE/FALSE(assertion_result). + AssertionResult(const AssertionResult& other); + // Used in the EXPECT_TRUE/FALSE(bool_expression). + explicit AssertionResult(bool success) : success_(success) {} + + // Returns true iff the assertion succeeded. + operator bool() const { return success_; } // NOLINT + + // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. + AssertionResult operator!() const; + + // Returns the text streamed into this AssertionResult. Test assertions + // use it when they fail (i.e., the predicate's outcome doesn't match the + // assertion's expectation). When nothing has been streamed into the + // object, returns an empty string. + const char* message() const { + return message_.get() != NULL ? message_->c_str() : ""; + } + // TODO(vladl@google.com): Remove this after making sure no clients use it. + // Deprecated; please use message() instead. + const char* failure_message() const { return message(); } + + // Streams a custom failure message into this object. + template AssertionResult& operator<<(const T& value) { + AppendMessage(Message() << value); + return *this; + } + + // Allows streaming basic output manipulators such as endl or flush into + // this object. + AssertionResult& operator<<( + ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { + AppendMessage(Message() << basic_manipulator); + return *this; + } + + private: + // Appends the contents of message to message_. + void AppendMessage(const Message& a_message) { + if (message_.get() == NULL) + message_.reset(new ::std::string); + message_->append(a_message.GetString().c_str()); + } + + // Stores result of the assertion predicate. + bool success_; + // Stores the message describing the condition in case the expectation + // construct is not satisfied with the predicate's outcome. + // Referenced via a pointer to avoid taking too much stack frame space + // with test assertions. + internal::scoped_ptr< ::std::string> message_; + + GTEST_DISALLOW_ASSIGN_(AssertionResult); +}; +#pragma pack(pop) + +// Makes a successful assertion result. +GTEST_API_ AssertionResult AssertionSuccess(); + +// Makes a failed assertion result. +GTEST_API_ AssertionResult AssertionFailure(); + +// Makes a failed assertion result with the given failure message. +// Deprecated; use AssertionFailure() << msg. +GTEST_API_ AssertionResult AssertionFailure(const Message& msg); + +// The abstract class that all tests inherit from. +// +// In Google Test, a unit test program contains one or many TestCases, and +// each TestCase contains one or many Tests. +// +// When you define a test using the TEST macro, you don't need to +// explicitly derive from Test - the TEST macro automatically does +// this for you. +// +// The only time you derive from Test is when defining a test fixture +// to be used a TEST_F. For example: +// +// class FooTest : public testing::Test { +// protected: +// virtual void SetUp() { ... } +// virtual void TearDown() { ... } +// ... +// }; +// +// TEST_F(FooTest, Bar) { ... } +// TEST_F(FooTest, Baz) { ... } +// +// Test is not copyable. +class GTEST_API_ Test { + public: + friend class TestInfo; + + // Defines types for pointers to functions that set up and tear down + // a test case. + typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; + typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; + + // The d'tor is virtual as we intend to inherit from Test. + virtual ~Test(); + + // Sets up the stuff shared by all tests in this test case. + // + // Google Test will call Foo::SetUpTestCase() before running the first + // test in test case Foo. Hence a sub-class can define its own + // SetUpTestCase() method to shadow the one defined in the super + // class. + static void SetUpTestCase() {} + + // Tears down the stuff shared by all tests in this test case. + // + // Google Test will call Foo::TearDownTestCase() after running the last + // test in test case Foo. Hence a sub-class can define its own + // TearDownTestCase() method to shadow the one defined in the super + // class. + static void TearDownTestCase() {} + + // Returns true iff the current test has a fatal failure. + static bool HasFatalFailure(); + + // Returns true iff the current test has a non-fatal failure. + static bool HasNonfatalFailure(); + + static bool HasFatalSuccess(); + // Returns true iff the current test has a (either fatal or + // non-fatal) failure. + static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } + + // Logs a property for the current test. Only the last value for a given + // key is remembered. + // These are public static so they can be called from utility functions + // that are not members of the test fixture. + // The arguments are const char* instead strings, as Google Test is used + // on platforms where string doesn't compile. + // + // Note that a driving consideration for these RecordProperty methods + // was to produce xml output suited to the Greenspan charting utility, + // which at present will only chart values that fit in a 32-bit int. It + // is the user's responsibility to restrict their values to 32-bit ints + // if they intend them to be used with Greenspan. + static void RecordProperty(const char* key, const char* value); + static void RecordProperty(const char* key, int value); + + protected: + // Creates a Test object. + Test(); + + // Sets up the test fixture. + virtual void SetUp(); + + // Tears down the test fixture. + virtual void TearDown(); + + private: + // Returns true iff the current test has the same fixture class as + // the first test in the current test case. + static bool HasSameFixtureClass(); + + // Runs the test after the test fixture has been set up. + // + // A sub-class must implement this to define the test logic. + // + // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. + // Instead, use the TEST or TEST_F macro. + virtual void TestBody() = 0; + + // Sets up, executes, and tears down the test. + void Run(); + +//由autostar增加,用于发送消息 + void TestRunSend(TestInfo* impl, int iState); + void RunCtorRegFunc(); + void RunDtorRegFunc(); + //end autostar + + // Deletes self. We deliberately pick an unusual name for this + // internal method to avoid clashing with names used in user TESTs. + void DeleteSelf_() { delete this; } + + // Uses a GTestFlagSaver to save and restore all Google Test flags. + const internal::GTestFlagSaver* const gtest_flag_saver_; + + // Often a user mis-spells SetUp() as Setup() and spends a long time + // wondering why it is never called by Google Test. The declaration of + // the following method is solely for catching such an error at + // compile time: + // + // - The return type is deliberately chosen to be not void, so it + // will be a conflict if a user declares void Setup() in his test + // fixture. + // + // - This method is private, so it will be another compiler error + // if a user calls it from his test fixture. + // + // DO NOT OVERRIDE THIS FUNCTION. + // + // If you see an error about overriding the following function or + // about it being private, you have mis-spelled SetUp() as Setup(). + struct Setup_should_be_spelled_SetUp {}; + virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } + + // We disallow copying Tests. + GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); +}; + +typedef internal::TimeInMillis TimeInMillis; + +// A copyable object representing a user specified test property which can be +// output as a key/value string pair. +// +// Don't inherit from TestProperty as its destructor is not virtual. +class TestProperty { + public: + // C'tor. TestProperty does NOT have a default constructor. + // Always use this constructor (with parameters) to create a + // TestProperty object. + TestProperty(const char* a_key, const char* a_value) : + key_(a_key), value_(a_value) { + } + + // Gets the user supplied key. + const char* key() const { + return key_.c_str(); + } + + // Gets the user supplied value. + const char* value() const { + return value_.c_str(); + } + + // Sets a new value, overriding the one supplied in the constructor. + void SetValue(const char* new_value) { + value_ = new_value; + } + + private: + // The key supplied by the user. + internal::String key_; + // The value supplied by the user. + internal::String value_; +}; + +// The result of a single Test. This includes a list of +// TestPartResults, a list of TestProperties, a count of how many +// death tests there are in the Test, and how much time it took to run +// the Test. +// +// TestResult is not copyable. +class GTEST_API_ TestResult { + public: + // Creates an empty TestResult. + TestResult(); + + // D'tor. Do not inherit from TestResult. + ~TestResult(); + + // Gets the number of all test parts. This is the sum of the number + // of successful test parts and the number of failed test parts. + int total_part_count() const; + + // Returns the number of the test properties. + int test_property_count() const; + + // Returns true iff the test passed (i.e. no test part failed). + bool Passed() const { return !Failed(); } + + // Returns true iff the test failed. + bool Failed() const; + + // Returns true iff the test fatally failed. + bool HasFatalFailure() const; + + bool HasFatalSuccess() const; + // Returns true iff the test has a non-fatal failure. + bool HasNonfatalFailure() const; + + // Returns the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const { return elapsed_time_; } + + // Returns the i-th test part result among all the results. i can range + // from 0 to test_property_count() - 1. If i is not in that range, aborts + // the program. + const TestPartResult& GetTestPartResult(int i) const; + + // Returns the i-th test property. i can range from 0 to + // test_property_count() - 1. If i is not in that range, aborts the + // program. + const TestProperty& GetTestProperty(int i) const; + + // Adds a test part result to the list. + //autostar 修改public属性 + void AddTestPartResult(const TestPartResult& test_part_result); + + private: + friend class TestInfo; + friend class UnitTest; + friend class internal::DefaultGlobalTestPartResultReporter; + friend class internal::ExecDeathTest; + friend class internal::TestResultAccessor; + friend class internal::UnitTestImpl; + friend class internal::WindowsDeathTest; + + // Gets the vector of TestPartResults. + const std::vector& test_part_results() const { + return test_part_results_; + } + + // Gets the vector of TestProperties. + const std::vector& test_properties() const { + return test_properties_; + } + + // Sets the elapsed time. + void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } + + // Adds a test property to the list. The property is validated and may add + // a non-fatal failure if invalid (e.g., if it conflicts with reserved + // key names). If a property is already recorded for the same key, the + // value will be updated, rather than storing multiple values for the same + // key. + void RecordProperty(const TestProperty& test_property); + + // Adds a failure if the key is a reserved attribute of Google Test + // testcase tags. Returns true if the property is valid. + // TODO(russr): Validate attribute names are legal and human readable. + static bool ValidateTestProperty(const TestProperty& test_property); + + // Returns the death test count. + int death_test_count() const { return death_test_count_; } + + // Increments the death test count, returning the new count. + int increment_death_test_count() { return ++death_test_count_; } + + // Clears the test part results. + void ClearTestPartResults(); + + // Clears the object. + void Clear(); + + // Protects mutable state of the property vector and of owned + // properties, whose values may be updated. + internal::Mutex test_properites_mutex_; + + // The vector of TestPartResults + std::vector test_part_results_; + // The vector of TestProperties + std::vector test_properties_; + // Running count of death tests. + int death_test_count_; + // The elapsed time, in milliseconds. + TimeInMillis elapsed_time_; + + // We disallow copying TestResult. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); +}; // class TestResult + +// A TestInfo object stores the following information about a test: +// +// Test case name +// Test name +// Whether the test should be run +// A function pointer that creates the test object when invoked +// Test result +// +// The constructor of TestInfo registers itself with the UnitTest +// singleton such that the RUN_ALL_TESTS() macro knows which tests to +// run. +class GTEST_API_ TestInfo { + public: + // Destructs a TestInfo object. This function is not virtual, so + // don't inherit from TestInfo. + ~TestInfo(); + + // Returns the test case name. + const char* test_case_name() const { return test_case_name_.c_str(); } + + // Returns the test name. + const char* name() const { return name_.c_str(); } + + // Returns the name of the parameter type, or NULL if this is not a typed + // or a type-parameterized test. + const char* type_param() const { + if (type_param_.get() != NULL) + return type_param_->c_str(); + return NULL; + } + + // Returns the text representation of the value parameter, or NULL if this + // is not a value-parameterized test. + const char* value_param() const { + if (value_param_.get() != NULL) + return value_param_->c_str(); + return NULL; + } + + // Returns true if this test should run, that is if the test is not disabled + // (or it is disabled but the also_run_disabled_tests flag has been specified) + // and its full name matches the user-specified filter. + // + // Google Test allows the user to filter the tests by their full names. + // The full name of a test Bar in test case Foo is defined as + // "Foo.Bar". Only the tests that match the filter will run. + // + // A filter is a colon-separated list of glob (not regex) patterns, + // optionally followed by a '-' and a colon-separated list of + // negative patterns (tests to exclude). A test is run if it + // matches one of the positive patterns and does not match any of + // the negative patterns. + // + // For example, *A*:Foo.* is a filter that matches any string that + // contains the character 'A' or starts with "Foo.". + bool should_run() const { return should_run_; } + + // Returns the result of the test. + const TestResult* result() const { return &result_; } + + //由autostar增加,用于保存用例所在的文件和行号 + std::string GetFilePath() const { return strFilePath; } + std::string GetCaseId() const { return name_id_; } + int GetCaseLine() const { return iCaseLine; } + TestResult* resultEx() const { return (TestResult*)&result_; } + + private: + +#if GTEST_HAS_DEATH_TEST + friend class internal::DefaultDeathTestFactory; +#endif // GTEST_HAS_DEATH_TEST + friend class Test; + friend class TestCase; + friend class internal::UnitTestImpl; + friend TestInfo* internal::MakeAndRegisterTestInfo( + const char* test_case_name, const char* name, + const char* type_param, + const char* value_param, + internal::TypeId fixture_class_id, + Test::SetUpTestCaseFunc set_up_tc, + Test::TearDownTestCaseFunc tear_down_tc, + internal::TestFactoryBase* factory, + std::string sFilePath, + int iLine, + const char* name_id); + + // Constructs a TestInfo object. The newly constructed instance assumes + // ownership of the factory object. + TestInfo(const char* test_case_name, const char* name, + const char* a_type_param, + const char* a_value_param, + internal::TypeId fixture_class_id, + internal::TestFactoryBase* factory, + std::string sFilePath, + int iLine, + const char* name_id = ""); + + // Increments the number of death tests encountered in this test so + // far. + int increment_death_test_count() { + return result_.increment_death_test_count(); + } + + //由autostar增加,用于保存用例所在的文件和行号 + void SetFilePath( std::string sFilePath ) { strFilePath = sFilePath; } + void SetCaseLine( int iLine ) { iCaseLine = iLine; } + + // Creates the test object, runs it, records its result, and then + // deletes it. + void Run(); + + static void ClearTestResult(TestInfo* test_info) { + test_info->result_.Clear(); + } + + // These fields are immutable properties of the test. + const std::string test_case_name_; // Test case name + const std::string name_; // Test name + const std::string name_id_; // Test name id + // Name of the parameter type, or NULL if this is not a typed or a + // type-parameterized test. + const internal::scoped_ptr type_param_; + // Text representation of the value parameter, or NULL if this is not a + // value-parameterized test. + const internal::scoped_ptr value_param_; + const internal::TypeId fixture_class_id_; // ID of the test fixture class + bool should_run_; // True iff this test should run + bool is_disabled_; // True iff this test is disabled + bool matches_filter_; // True if this test matches the + // user-specified filter. + internal::TestFactoryBase* const factory_; // The factory that creates + // the test object + + // This field is mutable and needs to be reset before running the + // test for the second time. + TestResult result_; + + std::string strFilePath; + int iCaseLine; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); +}; + +// A test case, which consists of a vector of TestInfos. +// +// TestCase is not copyable. +class GTEST_API_ TestCase { + public: + // Creates a TestCase with the given name. + // + // TestCase does NOT have a default constructor. Always use this + // constructor to create a TestCase object. + // + // Arguments: + // + // name: name of the test case + // a_type_param: the name of the test's type parameter, or NULL if + // this is not a type-parameterized test. + // set_up_tc: pointer to the function that sets up the test case + // tear_down_tc: pointer to the function that tears down the test case + TestCase(const char* name, const char* a_type_param, + Test::SetUpTestCaseFunc set_up_tc, + Test::TearDownTestCaseFunc tear_down_tc); + + // Destructor of TestCase. + virtual ~TestCase(); + + // Gets the name of the TestCase. + const char* name() const { return name_.c_str(); } + + // Returns the name of the parameter type, or NULL if this is not a + // type-parameterized test case. + const char* type_param() const { + if (type_param_.get() != NULL) + return type_param_->c_str(); + return NULL; + } + + // Returns true if any test in this test case should run. + bool should_run() const { return should_run_; } + + // Gets the number of successful tests in this test case. + int successful_test_count() const; + + // Gets the number of failed tests in this test case. + int failed_test_count() const; + + // Gets the number of disabled tests in this test case. + int disabled_test_count() const; + + // Get the number of tests in this test case that should run. + int test_to_run_count() const; + + // Gets the number of all tests in this test case. + int total_test_count() const; + + // Returns true iff the test case passed. + bool Passed() const { return !Failed(); } + + // Returns true iff the test case failed. + bool Failed() const { return failed_test_count() > 0; } + + // Returns the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const { return elapsed_time_; } + + // Returns the i-th test among all the tests. i can range from 0 to + // total_test_count() - 1. If i is not in that range, returns NULL. + const TestInfo* GetTestInfo(int i) const; + + int total_testcase_assert_count() const; + + private: + friend class Test; + friend class internal::UnitTestImpl; + + // Gets the (mutable) vector of TestInfos in this TestCase. + std::vector& test_info_list() { return test_info_list_; } + + // Gets the (immutable) vector of TestInfos in this TestCase. + const std::vector& test_info_list() const { + return test_info_list_; + } + + // Returns the i-th test among all the tests. i can range from 0 to + // total_test_count() - 1. If i is not in that range, returns NULL. + TestInfo* GetMutableTestInfo(int i); + + // Sets the should_run member. + void set_should_run(bool should) { should_run_ = should; } + + // Adds a TestInfo to this test case. Will delete the TestInfo upon + // destruction of the TestCase object. + void AddTestInfo(TestInfo * test_info); + + // Clears the results of all tests in this test case. + void ClearResult(); + + // Clears the results of all tests in the given test case. + static void ClearTestCaseResult(TestCase* test_case) { + test_case->ClearResult(); + } + + // Runs every test in this TestCase. + void Run(); + + // Runs SetUpTestCase() for this TestCase. This wrapper is needed + // for catching exceptions thrown from SetUpTestCase(). + //modify by guoqiuju,修改在测试套事件中assert系列不抛异常,这样就可以继续执行和返回结果 + void RunSetUpTestCase() { g_set_throw_effect = 0; (*set_up_tc_)(); g_set_throw_effect = 1;} + + // Runs TearDownTestCase() for this TestCase. This wrapper is + // needed for catching exceptions thrown from TearDownTestCase(). + //modify by guoqiuju,修改在测试套事件中assert系列不抛异常,这样就可以继续执行和返回结果 + void RunTearDownTestCase() { g_set_throw_effect = 0; (*tear_down_tc_)(); g_set_throw_effect = 1;} + + // Returns true iff test passed. + static bool TestPassed(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Passed(); + } + + // Returns true iff test failed. + static bool TestFailed(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Failed(); + } + + // Returns true iff test is disabled. + static bool TestDisabled(const TestInfo* test_info) { + return test_info->is_disabled_; + } + + // Returns true if the given test should run. + static bool ShouldRunTest(const TestInfo* test_info) { + return test_info->should_run(); + } + + // Shuffles the tests in this test case. + void ShuffleTests(internal::Random* random); + + // Restores the test order to before the first shuffle. + void UnshuffleTests(); + + //让所有测试用例失败 + void SetTestsFail(); + + //让所有测试用例成功 + void SetTestsPass(); + // Name of the test case. + internal::String name_; + // Name of the parameter type, or NULL if this is not a typed or a + // type-parameterized test. + const internal::scoped_ptr type_param_; + // The vector of TestInfos in their original order. It owns the + // elements in the vector. + std::vector test_info_list_; + // Provides a level of indirection for the test list to allow easy + // shuffling and restoring the test order. The i-th element in this + // vector is the index of the i-th test in the shuffled test list. + std::vector test_indices_; + // Pointer to the function that sets up the test case. + Test::SetUpTestCaseFunc set_up_tc_; + // Pointer to the function that tears down the test case. + Test::TearDownTestCaseFunc tear_down_tc_; + // True iff any test in this test case should run. + bool should_run_; + // Elapsed time, in milliseconds. + TimeInMillis elapsed_time_; + + // We disallow copying TestCases. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); +}; + +// An Environment object is capable of setting up and tearing down an +// environment. The user should subclass this to define his own +// environment(s). +// +// An Environment object does the set-up and tear-down in virtual +// methods SetUp() and TearDown() instead of the constructor and the +// destructor, as: +// +// 1. You cannot safely throw from a destructor. This is a problem +// as in some cases Google Test is used where exceptions are enabled, and +// we may want to implement ASSERT_* using exceptions where they are +// available. +// 2. You cannot use ASSERT_* directly in a constructor or +// destructor. +class Environment { + public: + // The d'tor is virtual as we need to subclass Environment. + virtual ~Environment() {} + + // Override this to define how to set up the environment. + virtual void SetUp() {} + + // Override this to define how to tear down the environment. + virtual void TearDown() {} + private: + // If you see an error about overriding the following function or + // about it being private, you have mis-spelled SetUp() as Setup(). + struct Setup_should_be_spelled_SetUp {}; + virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } +}; + +// The interface for tracing execution of tests. The methods are organized in +// the order the corresponding events are fired. +class TestEventListener { + public: + virtual ~TestEventListener() {} + + // Fired before any test activity starts. + virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; + + // Fired before each iteration of tests starts. There may be more than + // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration + // index, starting from 0. + virtual void OnTestIterationStart(const UnitTest& unit_test, + int iteration) = 0; + + // Fired before environment set-up for each iteration of tests starts. + virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; + + // Fired after environment set-up for each iteration of tests ends. + virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; + + // Fired before the test case starts. + virtual void OnTestCaseStart(const TestCase& test_case) = 0; + + // Fired before the test starts. + virtual void OnTestStart(const TestInfo& test_info) = 0; + + // Fired before the test set-up starts. + virtual void OnTestSetUpStart(const Test& test) {} + + // Fired after the test set-up ends. + virtual void OnTestSetUpEnd(const Test& test) {} + + // Fired after a failed assertion or a SUCCEED() invocation. + virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; + + // Fired before the test tear-down starts. + virtual void OnTestTearDownStart(const Test& test) {} + + // Fired after the test tear-down ends. + virtual void OnTestTearDownEnd(const Test& test) {} + + // Fired after the test ends. + virtual void OnTestEnd(const TestInfo& test_info) = 0; + + // Fired after the test case ends. + virtual void OnTestCaseEnd(const TestCase& test_case) = 0; + + // Fired before environment tear-down for each iteration of tests starts. + virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; + + // Fired after environment tear-down for each iteration of tests ends. + virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; + + // Fired after each iteration of tests finishes. + virtual void OnTestIterationEnd(const UnitTest& unit_test, + int iteration) = 0; + + // Fired after all test activities have ended. + virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; +}; + +// The convenience class for users who need to override just one or two +// methods and are not concerned that a possible change to a signature of +// the methods they override will not be caught during the build. For +// comments about each method please see the definition of TestEventListener +// above. +class EmptyTestEventListener : public TestEventListener { + public: + virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} + virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, + int /*iteration*/) {} + virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} + virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} + virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} + virtual void OnTestStart(const TestInfo& /*test_info*/) {} + virtual void OnTestSetUpStart(const Test& /*test*/) {} + virtual void OnTestSetUpEnd(const Test& /*test*/) {} + virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} + virtual void OnTestTearDownStart(const Test& /*test*/) {} + virtual void OnTestTearDownEnd(const Test& /*test*/) {} + virtual void OnTestEnd(const TestInfo& /*test_info*/) {} + virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} + virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} + virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} + virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, + int /*iteration*/) {} + virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} +}; + +struct styleCheckItem +{ + styleCheckItem() + { + file = ""; + line = 0; + assert_count = 0; + } + std::string file; + int line; + int assert_count; +}; + +class styleCheck : public EmptyTestEventListener +{ +public: + static void tick(); + static std::map styleCheckData; + virtual void OnTestProgramEnd(const UnitTest &ut); + virtual void OnTestStart(const TestInfo &ti); +}; + +// TestEventListeners lets users add listeners to track events in Google Test. +class GTEST_API_ TestEventListeners { + public: + TestEventListeners(); + ~TestEventListeners(); + + // Appends an event listener to the end of the list. Google Test assumes + // the ownership of the listener (i.e. it will delete the listener when + // the test program finishes). + void Append(TestEventListener* listener); + + // Removes the given event listener from the list and returns it. It then + // becomes the caller's responsibility to delete the listener. Returns + // NULL if the listener is not found in the list. + TestEventListener* Release(TestEventListener* listener); + + // Returns the standard listener responsible for the default console + // output. Can be removed from the listeners list to shut down default + // console output. Note that removing this object from the listener list + // with Release transfers its ownership to the caller and makes this + // function return NULL the next time. + TestEventListener* default_result_printer() const { + return default_result_printer_; + } + + // Returns the standard listener responsible for the default XML output + // controlled by the --gtest_output=xml flag. Can be removed from the + // listeners list by users who want to shut down the default XML output + // controlled by this flag and substitute it with custom one. Note that + // removing this object from the listener list with Release transfers its + // ownership to the caller and makes this function return NULL the next + // time. + TestEventListener* default_xml_generator() const { + return default_xml_generator_; + } + +private: + friend class Test; + friend class TestCase; + friend class TestInfo; + friend class internal::DefaultGlobalTestPartResultReporter; + friend class internal::NoExecDeathTest; + friend class internal::TestEventListenersAccessor; + friend class internal::UnitTestImpl; + + // Returns repeater that broadcasts the TestEventListener events to all + // subscribers. + TestEventListener* repeater(); + + // Sets the default_result_printer attribute to the provided listener. + // The listener is also added to the listener list and previous + // default_result_printer is removed from it and deleted. The listener can + // also be NULL in which case it will not be added to the list. Does + // nothing if the previous and the current listener objects are the same. + void SetDefaultResultPrinter(TestEventListener* listener); + + // Sets the default_xml_generator attribute to the provided listener. The + // listener is also added to the listener list and previous + // default_xml_generator is removed from it and deleted. The listener can + // also be NULL in which case it will not be added to the list. Does + // nothing if the previous and the current listener objects are the same. + void SetDefaultXmlGenerator(TestEventListener* listener); + + // Controls whether events will be forwarded by the repeater to the + // listeners in the list. + bool EventForwardingEnabled() const; + void SuppressEventForwarding(); + + // The actual list of listeners. + internal::TestEventRepeater* repeater_; + // Listener responsible for the standard result output. + TestEventListener* default_result_printer_; + // Listener responsible for the creation of the XML output file. + TestEventListener* default_xml_generator_; + + // We disallow copying TestEventListeners. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); +}; + +// A UnitTest consists of a vector of TestCases. +// +// This is a singleton class. The only instance of UnitTest is +// created when UnitTest::GetInstance() is first called. This +// instance is never deleted. +// +// UnitTest is not copyable. +// +// This class is thread-safe as long as the methods are called +// according to their specification. +class GTEST_API_ UnitTest { + public: + // Gets the singleton UnitTest object. The first time this method + // is called, a UnitTest object is constructed and returned. + // Consecutive calls will return the same object. + static UnitTest* GetInstance(); + + // Runs all tests in this UnitTest object and prints the result. + // Returns 0 if successful, or 1 otherwise. + // + // This method can only be called from the main thread. + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + int Run() GTEST_MUST_USE_RESULT_; + + // Returns the working directory when the first TEST() or TEST_F() + // was executed. The UnitTest object owns the string. + const char* original_working_dir() const; + + // Returns the TestCase object for the test that's currently running, + // or NULL if no test is running. + const TestCase* current_test_case() const; + + // Returns the TestInfo object for the test that's currently running, + // or NULL if no test is running. + const TestInfo* current_test_info() const; + + // Returns the random seed used at the start of the current test run. + int random_seed() const; + +#if GTEST_HAS_PARAM_TEST + // Returns the ParameterizedTestCaseRegistry object used to keep track of + // value-parameterized tests and instantiate and register them. + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + internal::ParameterizedTestCaseRegistry& parameterized_test_registry(); +#endif // GTEST_HAS_PARAM_TEST + + // Gets the number of successful test cases. + int successful_test_case_count() const; + + // Gets the number of failed test cases. + int failed_test_case_count() const; + + // Gets the number of all test cases. + int total_test_case_count() const; + + // Gets the number of all test cases that contain at least one test + // that should run. + int test_case_to_run_count() const; + + // Gets the number of successful tests. + int successful_test_count() const; + + // Gets the number of failed tests. + int failed_test_count() const; + + // Gets the number of disabled tests. + int disabled_test_count() const; + + // Gets the number of all tests. + int total_test_count() const; + + // Gets the number of tests that should run. + int test_to_run_count() const; + + // Gets the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const; + + // Returns true iff the unit test passed (i.e. all test cases passed). + bool Passed() const; + + // Returns true iff the unit test failed (i.e. some test case failed + // or something outside of all tests failed). + bool Failed() const; + + // Gets the i-th test case among all the test cases. i can range from 0 to + // total_test_case_count() - 1. If i is not in that range, returns NULL. + const TestCase* GetTestCase(int i) const; + + // Returns the list of event listeners that can be used to track events + // inside Google Test. + TestEventListeners& listeners(); + + // Adds a TestPartResult to the current TestResult object. All + // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) + // eventually call this to report their results. The user code + // should use the assertion macros instead of calling this directly. + //此函数由autostar修改,从private改为public属性,方便给amock使用 + void AddTestPartResult(TestPartResult::Type result_type, + const char* file_name, + int line_number, + const internal::String& message, + const internal::String& os_stack_trace); + + private: + // Registers and returns a global test environment. When a test + // program is run, all global test environments will be set-up in + // the order they were registered. After all tests in the program + // have finished, all global test environments will be torn-down in + // the *reverse* order they were registered. + // + // The UnitTest object takes ownership of the given environment. + // + // This method can only be called from the main thread. + Environment* AddEnvironment(Environment* env); + + // Adds a TestProperty to the current TestResult object. If the result already + // contains a property with the same key, the value will be updated. + void RecordPropertyForCurrentTest(const char* key, const char* value); + + // Gets the i-th test case among all the test cases. i can range from 0 to + // total_test_case_count() - 1. If i is not in that range, returns NULL. + TestCase* GetMutableTestCase(int i); + + // Accessors for the implementation object. + internal::UnitTestImpl* impl() { return impl_; } + const internal::UnitTestImpl* impl() const { return impl_; } + + // These classes and funcions are friends as they need to access private + // members of UnitTest. + friend class Test; + friend class internal::AssertHelper; + friend class internal::ScopedTrace; + friend Environment* AddGlobalTestEnvironment(Environment* env); + friend internal::UnitTestImpl* internal::GetUnitTestImpl(); + friend void internal::ReportFailureInUnknownLocation( + TestPartResult::Type result_type, + const internal::String& message); + + // Creates an empty UnitTest. + UnitTest(); + + // D'tor + virtual ~UnitTest(); + + // Pushes a trace defined by SCOPED_TRACE() on to the per-thread + // Google Test trace stack. + void PushGTestTrace(const internal::TraceInfo& trace); + + // Pops a trace from the per-thread Google Test trace stack. + void PopGTestTrace(); + + // Protects mutable state in *impl_. This is mutable as some const + // methods need to lock it too. + mutable internal::Mutex mutex_; + + // Opaque implementation object. This field is never changed once + // the object is constructed. We don't mark it as const here, as + // doing so will cause a warning in the constructor of UnitTest. + // Mutable state in *impl_ is protected by mutex_. + internal::UnitTestImpl* impl_; + + // We disallow copying UnitTest. + GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); +}; + +// A convenient wrapper for adding an environment for the test +// program. +// +// You should call this before RUN_ALL_TESTS() is called, probably in +// main(). If you use gtest_main, you need to call this before main() +// starts for it to take effect. For example, you can define a global +// variable like this: +// +// testing::Environment* const foo_env = +// testing::AddGlobalTestEnvironment(new FooEnvironment); +// +// However, we strongly recommend you to write your own main() and +// call AddGlobalTestEnvironment() there, as relying on initialization +// of global variables makes the code harder to read and may cause +// problems when you register multiple environments from different +// translation units and the environments have dependencies among them +// (remember that the compiler doesn't guarantee the order in which +// global variables from different translation units are initialized). +inline Environment* AddGlobalTestEnvironment(Environment* env) { + return UnitTest::GetInstance()->AddEnvironment(env); +} + +// Initializes Google Test. This must be called before calling +// RUN_ALL_TESTS(). In particular, it parses a command line for the +// flags that Google Test recognizes. Whenever a Google Test flag is +// seen, it is removed from argv, and *argc is decremented. +// +// No value is returned. Instead, the Google Test flag variables are +// updated. +// +// Calling the function for the second time has no user-visible effect. +//这个重载函数由autostar修改,增加一个参数用来设置消息发送时的IP地址 +GTEST_API_ void InitGoogleTest(int* argc, char** argv, std::string strIP) ; + +// This overloaded version can be used in Windows programs compiled in +// UNICODE mode. +GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv, std::string ) ; + +namespace internal { + +// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) +// operand to be used in a failure message. The type (but not value) +// of the other operand may affect the format. This allows us to +// print a char* as a raw pointer when it is compared against another +// char*, and print it as a C string when it is compared against an +// std::string object, for example. +// +// The default implementation ignores the type of the other operand. +// Some specialized versions are used to handle formatting wide or +// narrow C strings. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +template +String FormatForComparisonFailureMessage(const T1& value, + const T2& /* other_operand */) { + // C++Builder compiles this incorrectly if the namespace isn't explicitly + // given. + return ::testing::PrintToString(value); +} + +// The helper function for {ASSERT|EXPECT}_EQ. +template +AssertionResult CmpHelperEQ(const char* expected_expression, + const char* actual_expression, + const T1& expected, + const T2& actual) { +#ifdef _MSC_VER +# pragma warning(push) // Saves the current warning state. +# pragma warning(disable:4389) // Temporarily disables warning on + // signed/unsigned mismatch. +#endif + + if (expected == actual) { + return AssertionSuccess(); + } + +#ifdef _MSC_VER +# pragma warning(pop) // Restores the warning state. +#endif + + return EqFailure(expected_expression, + actual_expression, + FormatForComparisonFailureMessage(expected, actual), + FormatForComparisonFailureMessage(actual, expected), + false); +} + +// With this overloaded version, we allow anonymous enums to be used +// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums +// can be implicitly cast to BiggestInt. +GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression, + const char* actual_expression, + BiggestInt expected, + BiggestInt actual); + +// The helper class for {ASSERT|EXPECT}_EQ. The template argument +// lhs_is_null_literal is true iff the first argument to ASSERT_EQ() +// is a null pointer literal. The following default implementation is +// for lhs_is_null_literal being false. +template +class EqHelper { + public: + // This templatized version is for the general case. + template + static AssertionResult Compare(const char* expected_expression, + const char* actual_expression, + const T1& expected, + const T2& actual) { + return CmpHelperEQ(expected_expression, actual_expression, expected, + actual); + } + + // With this overloaded version, we allow anonymous enums to be used + // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous + // enums can be implicitly cast to BiggestInt. + // + // Even though its body looks the same as the above version, we + // cannot merge the two, as it will make anonymous enums unhappy. + static AssertionResult Compare(const char* expected_expression, + const char* actual_expression, + BiggestInt expected, + BiggestInt actual) { + return CmpHelperEQ(expected_expression, actual_expression, expected, + actual); + } +}; + +// This specialization is used when the first argument to ASSERT_EQ() +// is a null pointer literal, like NULL, false, or 0. +template <> +class EqHelper { + public: + // We define two overloaded versions of Compare(). The first + // version will be picked when the second argument to ASSERT_EQ() is + // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or + // EXPECT_EQ(false, a_bool). + template + static AssertionResult Compare( + const char* expected_expression, + const char* actual_expression, + const T1& expected, + const T2& actual, + // The following line prevents this overload from being considered if T2 + // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) + // expands to Compare("", "", NULL, my_ptr), which requires a conversion + // to match the Secret* in the other overload, which would otherwise make + // this template match better. + typename EnableIf::value>::type* = 0) { + return CmpHelperEQ(expected_expression, actual_expression, expected, + actual); + } + + // This version will be picked when the second argument to ASSERT_EQ() is a + // pointer, e.g. ASSERT_EQ(NULL, a_pointer). + template + static AssertionResult Compare( + const char* expected_expression, + const char* actual_expression, + // We used to have a second template parameter instead of Secret*. That + // template parameter would deduce to 'long', making this a better match + // than the first overload even without the first overload's EnableIf. + // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to + // non-pointer argument" (even a deduced integral argument), so the old + // implementation caused warnings in user code. + Secret* /* expected (NULL) */, + T* actual) { + // We already know that 'expected' is a null pointer. + return CmpHelperEQ(expected_expression, actual_expression, + static_cast(NULL), actual); + } +}; + +// A macro for implementing the helper functions needed to implement +// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste +// of similar code. +// +// For each templatized helper function, we also define an overloaded +// version for BiggestInt in order to reduce code bloat and allow +// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled +// with gcc 4. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ +template \ +AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ + const T1& val1, const T2& val2) {\ + if (val1 op val2) {\ + return AssertionSuccess();\ + } else {\ + return AssertionFailure() \ + << "Expected: (" << expr1 << ") " #op " (" << expr2\ + << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ + << " vs " << FormatForComparisonFailureMessage(val2, val1);\ + }\ +}\ +GTEST_API_ AssertionResult CmpHelper##op_name(\ + const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) + +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + +// Implements the helper function for {ASSERT|EXPECT}_NE +GTEST_IMPL_CMP_HELPER_(NE, !=); +// Implements the helper function for {ASSERT|EXPECT}_LE +GTEST_IMPL_CMP_HELPER_(LE, <=); +// Implements the helper function for {ASSERT|EXPECT}_LT +GTEST_IMPL_CMP_HELPER_(LT, < ); +// Implements the helper function for {ASSERT|EXPECT}_GE +GTEST_IMPL_CMP_HELPER_(GE, >=); +// Implements the helper function for {ASSERT|EXPECT}_GT +GTEST_IMPL_CMP_HELPER_(GT, > ); + +#undef GTEST_IMPL_CMP_HELPER_ + +// The helper function for {ASSERT|EXPECT}_STREQ. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, + const char* actual_expression, + const char* expected, + const char* actual); + +// The helper function for {ASSERT|EXPECT}_STRCASEEQ. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, + const char* actual_expression, + const char* expected, + const char* actual); + +// The helper function for {ASSERT|EXPECT}_STRNE. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + +// The helper function for {ASSERT|EXPECT}_STRCASENE. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + + +// Helper function for *_STREQ on wide strings. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, + const char* actual_expression, + const wchar_t* expected, + const wchar_t* actual); + +// Helper function for *_STRNE on wide strings. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, + const char* s2_expression, + const wchar_t* s1, + const wchar_t* s2); + +} // namespace internal + +// IsSubstring() and IsNotSubstring() are intended to be used as the +// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by +// themselves. They check whether needle is a substring of haystack +// (NULL is considered a substring of itself only), and return an +// appropriate error message when they fail. +// +// The {needle,haystack}_expr arguments are the stringified +// expressions that generated the two real arguments. +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const char* needle, const char* haystack); +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const wchar_t* needle, const wchar_t* haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const char* needle, const char* haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const wchar_t* needle, const wchar_t* haystack); +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::string& needle, const ::std::string& haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::string& needle, const ::std::string& haystack); + +#if GTEST_HAS_STD_WSTRING +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::wstring& needle, const ::std::wstring& haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::wstring& needle, const ::std::wstring& haystack); +#endif // GTEST_HAS_STD_WSTRING + +namespace internal { + +// Helper template function for comparing floating-points. +// +// Template parameter: +// +// RawType: the raw floating-point type (either float or double) +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +template +AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression, + const char* actual_expression, + RawType expected, + RawType actual) { + const FloatingPoint lhs(expected), rhs(actual); + + if (lhs.AlmostEquals(rhs)) { + return AssertionSuccess(); + } + + ::std::stringstream expected_ss; + expected_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << expected; + + ::std::stringstream actual_ss; + actual_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << actual; + + return EqFailure(expected_expression, + actual_expression, + StringStreamToString(&expected_ss), + StringStreamToString(&actual_ss), + false); +} + +// Helper function for implementing ASSERT_NEAR. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, + const char* expr2, + const char* abs_error_expr, + double val1, + double val2, + double abs_error); + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// A class that enables one to stream messages to assertion macros +class GTEST_API_ AssertHelper { + public: + // Constructor. + AssertHelper(TestPartResult::Type type, + const char* file, + int line, + const char* message); + ~AssertHelper(); + + // Message assignment is a semantic trick to enable assertion + // streaming; see the GTEST_MESSAGE_ macro below. + void operator=(const Message& message) const; + + private: + // We put our data in a struct so that the size of the AssertHelper class can + // be as small as possible. This is important because gcc is incapable of + // re-using stack space even for temporary variables, so every EXPECT_EQ + // reserves stack space for another AssertHelper. + struct AssertHelperData { + AssertHelperData(TestPartResult::Type t, + const char* srcfile, + int line_num, + const char* msg) + : type(t), file(srcfile), line(line_num), message(msg) { } + + TestPartResult::Type const type; + const char* const file; + int const line; + String const message; + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); + }; + + AssertHelperData* const data_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); +}; + +} // namespace internal + +#if GTEST_HAS_PARAM_TEST +// The pure interface class that all value-parameterized tests inherit from. +// A value-parameterized class must inherit from both ::testing::Test and +// ::testing::WithParamInterface. In most cases that just means inheriting +// from ::testing::TestWithParam, but more complicated test hierarchies +// may need to inherit from Test and WithParamInterface at different levels. +// +// This interface has support for accessing the test parameter value via +// the GetParam() method. +// +// Use it with one of the parameter generator defining functions, like Range(), +// Values(), ValuesIn(), Bool(), and Combine(). +// +// class FooTest : public ::testing::TestWithParam { +// protected: +// FooTest() { +// // Can use GetParam() here. +// } +// virtual ~FooTest() { +// // Can use GetParam() here. +// } +// virtual void SetUp() { +// // Can use GetParam() here. +// } +// virtual void TearDown { +// // Can use GetParam() here. +// } +// }; +// TEST_P(FooTest, DoesBar) { +// // Can use GetParam() method here. +// Foo foo; +// ASSERT_TRUE(foo.DoesBar(GetParam())); +// } +// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); + +template +class WithParamInterface { + public: + typedef T ParamType; + virtual ~WithParamInterface() {} + + // The current parameter value. Is also available in the test fixture's + // constructor. This member function is non-static, even though it only + // references static data, to reduce the opportunity for incorrect uses + // like writing 'WithParamInterface::GetParam()' for a test that + // uses a fixture whose parameter type is int. + const ParamType& GetParam() const { return *parameter_; } + + private: + // Sets parameter value. The caller is responsible for making sure the value + // remains alive and unchanged throughout the current test. + static void SetParam(const ParamType* parameter) { + parameter_ = parameter; + } + + // Static value used for accessing parameter during a test lifetime. + static const ParamType* parameter_; + + // TestClass must be a subclass of WithParamInterface and Test. + template friend class internal::ParameterizedTestFactory; +}; + +template +const T* WithParamInterface::parameter_ = NULL; + +// Most value-parameterized classes can ignore the existence of +// WithParamInterface, and can just inherit from ::testing::TestWithParam. + +template +class TestWithParam : public Test, public WithParamInterface { +}; + +#endif // GTEST_HAS_PARAM_TEST + +// Macros for indicating success/failure in test code. + +// ADD_FAILURE unconditionally adds a failure to the current test. +// SUCCEED generates a success - it doesn't automatically make the +// current test successful, as a test is only successful when it has +// no failure. +// +// EXPECT_* verifies that a certain condition is satisfied. If not, +// it behaves like ADD_FAILURE. In particular: +// +// EXPECT_TRUE verifies that a Boolean condition is true. +// EXPECT_FALSE verifies that a Boolean condition is false. +// +// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except +// that they will also abort the current function on failure. People +// usually want the fail-fast behavior of FAIL and ASSERT_*, but those +// writing data-driven tests often find themselves using ADD_FAILURE +// and EXPECT_* more. +// +// Examples: +// +// EXPECT_TRUE(server.StatusIsOK()); +// ASSERT_FALSE(server.HasPendingRequest(port)) +// << "There are still pending requests " << "on port " << port; + +// Generates a nonfatal failure with a generic message. +#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") + +// Generates a nonfatal failure at the given source file location with +// a generic message. +#define ADD_FAILURE_AT(file, line) \ + GTEST_MESSAGE_AT_(file, line, "Failed", \ + ::testing::TestPartResult::kNonFatalFailure) + +// Generates a fatal failure with a generic message. +#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") + +// Generates a fatal failure with a generic message. +#define GTEST_FORCE_SUCCESS_() GTEST_FATAL_SUCCESS_("Succeed") + +// Define this macro to 1 to omit the definition of FAIL(), which is a +// generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_FAIL +# define FAIL() GTEST_FAIL() +#endif + +//add by qiaoyang 强制置用例成功,直接返回 +#if !GTEST_DONT_DEFINE_Immediately_Succeed +# define FORCE_SUCCESS() GTEST_FORCE_SUCCESS_() +#endif + +// Generates a success with a generic message. +#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") + +// Define this macro to 1 to omit the definition of SUCCEED(), which +// is a generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_SUCCEED +# define SUCCEED() GTEST_SUCCEED() +#endif + +// Macros for testing exceptions. +// +// * {ASSERT|EXPECT}_THROW(statement, expected_exception): +// Tests that the statement throws the expected exception. +// * {ASSERT|EXPECT}_NO_THROW(statement): +// Tests that the statement doesn't throw any exception. +// * {ASSERT|EXPECT}_ANY_THROW(statement): +// Tests that the statement throws an exception. + +#define EXPECT_THROW(statement, expected_exception) \ + GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) +#define EXPECT_NO_THROW(statement) \ + GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) +#define EXPECT_ANY_THROW(statement) \ + GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) +#define ASSERT_THROW(statement, expected_exception) \ + GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) +#define ASSERT_NO_THROW(statement) \ + GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) +#define ASSERT_ANY_THROW(statement) \ + GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) + +// Boolean assertions. Condition can be either a Boolean expression or an +// AssertionResult. For more information on how to use AssertionResult with +// these macros see comments on that class. +#define EXPECT_TRUE(condition) \ + GTEST_TEST_BOOLEAN2_(condition, #condition, false, true, \ + GTEST_NONFATAL_FAILURE_) +#define EXPECT_FALSE(condition) \ + GTEST_TEST_BOOLEAN2_(!(condition), #condition, true, false, \ + GTEST_NONFATAL_FAILURE_) +#define ASSERT_TRUE(condition) \ + GTEST_TEST_BOOLEAN2_(condition, #condition, false, true, \ + GTEST_FATAL_FAILURE_) +#define ASSERT_FALSE(condition) \ + GTEST_TEST_BOOLEAN2_(!(condition), #condition, true, false, \ + GTEST_FATAL_FAILURE_) + +// Includes the auto-generated header that implements a family of +// generic predicate assertion macros. +#include "gtest/gtest_pred_impl.h" + +// Macros for testing equalities and inequalities. +// +// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual +// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 +// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 +// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 +// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 +// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 +// +// When they are not, Google Test prints both the tested expressions and +// their actual values. The values must be compatible built-in types, +// or you will get a compiler error. By "compatible" we mean that the +// values can be compared by the respective operator. +// +// Note: +// +// 1. It is possible to make a user-defined type work with +// {ASSERT|EXPECT}_??(), but that requires overloading the +// comparison operators and is thus discouraged by the Google C++ +// Usage Guide. Therefore, you are advised to use the +// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are +// equal. +// +// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on +// pointers (in particular, C strings). Therefore, if you use it +// with two C strings, you are testing how their locations in memory +// are related, not how their content is related. To compare two C +// strings by content, use {ASSERT|EXPECT}_STR*(). +// +// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to +// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you +// what the actual value is when it fails, and similarly for the +// other comparisons. +// +// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() +// evaluate their arguments, which is undefined. +// +// 5. These macros evaluate their arguments exactly once. +// +// Examples: +// +// EXPECT_NE(5, Foo()); +// EXPECT_EQ(NULL, a_pointer); +// ASSERT_LT(i, array_size); +// ASSERT_GT(records.size(), 0) << "There is no record left."; + +#define EXPECT_EQ(expected, actual) \ + EXPECT_PRED_FORMAT2(::testing::internal:: \ + EqHelper::Compare, \ + expected, actual) +#define EXPECT_NE(expected, actual) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) +#define EXPECT_LE(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) +#define EXPECT_LT(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) +#define EXPECT_GE(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) +#define EXPECT_GT(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) + +#define GTEST_ASSERT_EQ(expected, actual) \ + ASSERT_PRED_FORMAT2(::testing::internal:: \ + EqHelper::Compare, \ + expected, actual) +#define GTEST_ASSERT_NE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) +#define GTEST_ASSERT_LE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) +#define GTEST_ASSERT_LT(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) +#define GTEST_ASSERT_GE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) +#define GTEST_ASSERT_GT(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) + +// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of +// ASSERT_XY(), which clashes with some users' own code. + +#if !GTEST_DONT_DEFINE_ASSERT_EQ +# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_NE +# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_LE +# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_LT +# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_GE +# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_GT +# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) +#endif + +// C String Comparisons. All tests treat NULL and any non-NULL string +// as different. Two NULLs are equal. +// +// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 +// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 +// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case +// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case +// +// For wide or narrow string objects, you can use the +// {ASSERT|EXPECT}_??() macros. +// +// Don't depend on the order in which the arguments are evaluated, +// which is undefined. +// +// These macros evaluate their arguments exactly once. + +#define EXPECT_STREQ(expected, actual) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) +#define EXPECT_STRNE(s1, s2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) +#define EXPECT_STRCASEEQ(expected, actual) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) +#define EXPECT_STRCASENE(s1, s2)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) + +#define ASSERT_STREQ(expected, actual) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) +#define ASSERT_STRNE(s1, s2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) +#define ASSERT_STRCASEEQ(expected, actual) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) +#define ASSERT_STRCASENE(s1, s2)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) + +// Macros for comparing floating-point numbers. +// +// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): +// Tests that two float values are almost equal. +// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): +// Tests that two double values are almost equal. +// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): +// Tests that v1 and v2 are within the given distance to each other. +// +// Google Test uses ULP-based comparison to automatically pick a default +// error bound that is appropriate for the operands. See the +// FloatingPoint template class in gtest-internal.h if you are +// interested in the implementation details. + +#define EXPECT_FLOAT_EQ(expected, actual)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + expected, actual) + +#define EXPECT_DOUBLE_EQ(expected, actual)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + expected, actual) + +#define ASSERT_FLOAT_EQ(expected, actual)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + expected, actual) + +#define ASSERT_DOUBLE_EQ(expected, actual)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + expected, actual) + +#define EXPECT_NEAR(val1, val2, abs_error)\ + EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ + val1, val2, abs_error) + +#define ASSERT_NEAR(val1, val2, abs_error)\ + ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ + val1, val2, abs_error) + +// These predicate format functions work on floating-point values, and +// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. +// +// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); + +// Asserts that val1 is less than, or almost equal to, val2. Fails +// otherwise. In particular, it fails if either val1 or val2 is NaN. +GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, + float val1, float val2); +GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, + double val1, double val2); + + +#if GTEST_OS_WINDOWS + +// Macros that test for HRESULT failure and success, these are only useful +// on Windows, and rely on Windows SDK macros and APIs to compile. +// +// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) +// +// When expr unexpectedly fails or succeeds, Google Test prints the +// expected result and the actual result with both a human-readable +// string representation of the error, if available, as well as the +// hex result code. +# define EXPECT_HRESULT_SUCCEEDED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) + +# define ASSERT_HRESULT_SUCCEEDED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) + +# define EXPECT_HRESULT_FAILED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) + +# define ASSERT_HRESULT_FAILED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) + +#endif // GTEST_OS_WINDOWS + +// Macros that execute statement and check that it doesn't generate new fatal +// failures in the current thread. +// +// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); +// +// Examples: +// +// EXPECT_NO_FATAL_FAILURE(Process()); +// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; +// +#define ASSERT_NO_FATAL_FAILURE(statement) \ + GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) +#define EXPECT_NO_FATAL_FAILURE(statement) \ + GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) + +// Causes a trace (including the source file path, the current line +// number, and the given message) to be included in every test failure +// message generated by code in the current scope. The effect is +// undone when the control leaves the current scope. +// +// The message argument can be anything streamable to std::ostream. +// +// In the implementation, we include the current line number as part +// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s +// to appear in the same block - as long as they are on different +// lines. +#define SCOPED_TRACE(message) \ + ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ + __FILE__, __LINE__, ::testing::Message() << (message)) + +// Compile-time assertion for type equality. +// StaticAssertTypeEq() compiles iff type1 and type2 are +// the same type. The value it returns is not interesting. +// +// Instead of making StaticAssertTypeEq a class template, we make it a +// function template that invokes a helper class template. This +// prevents a user from misusing StaticAssertTypeEq by +// defining objects of that type. +// +// CAVEAT: +// +// When used inside a method of a class template, +// StaticAssertTypeEq() is effective ONLY IF the method is +// instantiated. For example, given: +// +// template class Foo { +// public: +// void Bar() { testing::StaticAssertTypeEq(); } +// }; +// +// the code: +// +// void Test1() { Foo foo; } +// +// will NOT generate a compiler error, as Foo::Bar() is never +// actually instantiated. Instead, you need: +// +// void Test2() { Foo foo; foo.Bar(); } +// +// to cause a compiler error. +template +bool StaticAssertTypeEq() { + (void)internal::StaticAssertTypeEqHelper(); + return true; +} + +// Defines a test. +// +// The first parameter is the name of the test case, and the second +// parameter is the name of the test within the test case. +// +// The convention is to end the test case name with "Test". For +// example, a test case for the Foo class can be named FooTest. +// +// The user should put his test code between braces after using this +// macro. Example: +// +// TEST(FooTest, InitializesCorrectly) { +// Foo foo; +// EXPECT_TRUE(foo.StatusIsOK()); +// } + +#define POLESTAR_CHECK_FUZZ "\\FUZZ_TestCases\\" +#define POLESTAR_CHECK_STR "\\testcases\\llt\\" +#define POLESTAR_CHECK_HLT "\\testcases\\hlt\\" +#define POLESTAR_TEST_HLT "POLESTAR_HLT" +#define POLESTAR_TEST_LLT "POLESTAR_LLT" +#define POLESTAR_TEST_PCST "POLESTAR_PCST" + +inline const char *get_test_type(char *file_name) +{ + unsigned int loop = 0; + + if (file_name==0) return POLESTAR_TEST_HLT; + + for (loop=0;loop() here to get the type ID of testing::Test. This +// is to work around a suspected linker bug when using Google Test as +// a framework on Mac OS X. The bug causes GetTypeId< +// ::testing::Test>() to return different values depending on whether +// the call is from the Google Test framework itself or from user test +// code. GetTestTypeId() is guaranteed to always return the same +// value, as it always calls GetTypeId<>() from the Google Test +// framework. +#define GTEST_TEST(test_case_name, test_name, ...)\ + GTEST_TEST_(test_case_name, test_name, \ + ::testing::Test, ::testing::internal::GetTestTypeId(), ##__VA_ARGS__) + +// Define this macro to 1 to omit the definition of TEST(), which +// is a generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_TEST +# define TEST(test_case_name, test_name, ...) GTEST_TEST(test_case_name, test_name, ##__VA_ARGS__) +#endif + +// Defines a test that uses a test fixture. +// +// The first parameter is the name of the test fixture class, which +// also doubles as the test case name. The second parameter is the +// name of the test within the test case. +// +// A test fixture class must be declared earlier. The user should put +// his test code between braces after using this macro. Example: +// +// class FooTest : public testing::Test { +// protected: +// virtual void SetUp() { b_.AddElement(3); } +// +// Foo a_; +// Foo b_; +// }; +// +// TEST_F(FooTest, InitializesCorrectly) { +// EXPECT_TRUE(a_.StatusIsOK()); +// } +// +// TEST_F(FooTest, ReturnsElementCountCorrectly) { +// EXPECT_EQ(0, a_.size()); +// EXPECT_EQ(1, b_.size()); +// } + +//Autostar add 中文用例名转为测试套名加行号 by xutaiqiang +#if DTCENTER_CN2EN + +#define DT_CH2EN1(test_fixture, LineNo) test_fixture##_Line##LineNo +#define DT_CH2EN(test_fixture, LineNo) DT_CH2EN1(test_fixture, LineNo) + +#define TEST_F(test_fixture, test_name, ...)\ + GTEST_TEST_CH(test_fixture, DT_CH2EN(test_fixture, __LINE__), ##__VA_ARGS__) + +#define GTEST_TEST_CH(test_fixture, test_name, ...)\ + GTEST_TEST_(test_fixture, test_name, test_fixture, \ + ::testing::internal::GetTypeId(), ##__VA_ARGS__) +#else + +#define TEST_F(test_fixture, test_name, ...)\ + GTEST_TEST_(test_fixture, test_name, test_fixture, \ + ::testing::internal::GetTypeId(), ##__VA_ARGS__) +#endif + +// Use this macro in main() to run all tests. It returns 0 if all +// tests are successful, or 1 otherwise. +// +// RUN_ALL_TESTS() should be invoked after the command line has been +// parsed by InitGoogleTest(). + +// modify by dtcenter 2018-04-16 +// for fuzzing testing +#ifdef DT_FUZZ +extern "C" { + typedef int (*GTEST_RunHook)(); +} + +extern "C" __attribute__ ((visibility("default"))) void __gcov_flush(void); +extern "C" int GTEST_Run(); +extern "C" bool FUZZ_NeedRunGlobalSetup(); +extern "C" bool FUZZ_NeedRunTestsuitSetup(const std::string &suitname); +extern "C" bool FUZZ_NeedRunTestcaseSetup(const std::string &casename); +extern "C" bool FUZZ_NeedRunGlobalTeardown(); +extern "C" bool FUZZ_NeedRunTestsuitTeardown(const std::string &suitname); +extern "C" bool FUZZ_NeedRunTestcaseTeardown(const std::string &casename); +extern "C" int FUZZ_Main(GTEST_RunHook run_proc, const std::string &fuzzer_config_file, const std::string &fuzzer_args); +#define RUN_ALL_TESTS()\ + (::testing::FUZZ_Main(::testing::GTEST_Run, GTEST_FLAG(fuzzing_config), GTEST_FLAG(fuzzing_args))) +#else +#define RUN_ALL_TESTS()\ + (::testing::UnitTest::GetInstance()->Run()) +#endif //DT_FUZZ + +//由autostar增加,用于结构体类型的变量比较 +void AssertStructVar(const char *pcFileName, int lLineNum, void *pst1, void *pst2, int lLen ); +void ExpectStructVar(const char *pcFileName, int lLineNum, void *pst1, void *pst2, int lLen , const char *Msg); +// Add By wwj Add Struct Cmp Marco +#define ASSERT_SAME_DATA(Expect, Atual)\ + ::testing::AssertStructVar( __FILE__, __LINE__, (void *)&(Expect), (void *)&(Atual), sizeof(Atual)) +#define ASSERT_SAME_MEMORY(Expect, Atual, Len)\ + ::testing::AssertStructVar( __FILE__, __LINE__, Expect, Atual, Len) +#define EXPECT_SAME_MEMORY(Expect, Atual, Len, Msg)\ + ::testing::ExpectStructVar( __FILE__, __LINE__, Expect, Atual, Len, Msg) + +//函数声明,无需给外部使用的函数声明请在此处增加 +typedef int (*PFUNC)(); +typedef int (*DT_USERPRINT)(const char *, va_list ); + +class RegFunc +{ +public: + static RegFunc* GetInstance(); + //向列表中添加注册函数 + void AddRegFuncCtorList(PFUNC pFuncName); + void AddRegFuncDtorList(PFUNC pFuncName); + //从列表中删除注册的函数 + void DelRegFuncCtorList(PFUNC pFuncName); + void DelRegFuncDtorList(PFUNC pFuncName); + //清空列表,可以中途使用,初始构造函数有调用 + void ClearRegFuncList(); + //获取列表内容 + std::vector GetRegFuncCtorList(); + std::vector GetRegFuncDtorList(); + void RunCtorRegFunc(); + void RunDtorRegFunc(); +private: + RegFunc(); + ~RegFunc(); + std::vector m_RegFuncCtorList; + std::vector m_RegFuncDtorList; + static RegFunc *m_pRegFuncInst; +}; + +bool IsFileExist(const std::string &path); +bool IsDirectoryExist(const std::string &path); +std::string GetApplicationFullPath(); +std::string GetApplicationDir(); +std::string GetApplicationName(); +void SwitchOnTrace(bool bFlag); +void ComprotMsgPrint(bool bFlag); +void Send_Send_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void Send_Recv_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void Send_Expect_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void Send_User_INFO(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void Send_Send_Serial_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void OpenBaseCompare(bool bFlag); +int BaseCompare(unsigned int ulSource, unsigned int ulLogtype, unsigned int ulDataLen, unsigned char *poctData); +void SetBaseResultDir(char* dir); +void Send_Every_Msg(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); +void SendMsgToTracer_INT32(unsigned int ulSource, unsigned int ucProt,unsigned int ucDirection, unsigned int MsgType,unsigned int usDataLen, unsigned char *poctData); +void SendMsgToTracer_INT8(unsigned int ulSource,unsigned int ucProt,unsigned int ucDirection, unsigned char *pstrMsgType,unsigned int usDataLen, unsigned char *poctData); +void SendMsgToTracer_NodeB(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); +void SendMsgToTracer_LTE(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); +void SendMsgToTracer_InnerMsg(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); +void SendMessageToTracer_ServiceMsg( + unsigned int ulSource, + unsigned int SenderServiceId, + unsigned int ReceiverServiceId, + unsigned int ServiceType, // API or ABI + unsigned int ServiceID, // API ID or ABI ID + unsigned int usDataLen, + unsigned char *poctData); +void PrintOnDoc(bool bFlag); +int SendCaseInfoToServer(); +int GetSendMsg(unsigned char **poctData, unsigned int *len); +int GetNodAttribute(char *Caption, char *ArrValue); +extern "C" int DT_CommPrint( char *pcFormat, ... ); +void DT_RegisterUserPrint( DT_USERPRINT pfnUserPrint); +void DT_SetUserXslPath(std::string xslPath); +std::string DT_GetUserXslPath(); + +/*对gtest的初始化操作 +argc、argv:是命令行参数 +bFlag:true表示是结果生成xml文件,默认为false,不生成。 +strIP:是发消息时server的IP地址,默认为本机127.0.0.1。 +注意:后两个参数如果不需要设置可以不用填写。 +*/ +#define SERVERDEFAULTIP "127.0.0.1" +// Returns 0 if all tests passed, or 1 other wise. +int Init_UT(int argc, wchar_t* argv[], bool bFlag = false, std::string strIP = SERVERDEFAULTIP); +int Init_UT(int argc, char* argv[], bool bFlag = false, std::string strIP = SERVERDEFAULTIP); + +//分别向测试用例类 Test的构造函数和析构函数里加入调用的外部函数 +#define ADD_FUNC_TEST_CTOR(name)\ + ::testing::RegFunc::GetInstance()->AddRegFuncCtorList(name) +#define ADD_FUNC_TEST_DTOR(name)\ + ::testing::RegFunc::GetInstance()->AddRegFuncDtorList(name) +//从列表中删除注册的函数 +#define DEL_FUNC_TEST_CTOR(name)\ + ::testing::RegFunc::GetInstance()->DelRegFuncCtorList(name) +#define DEL_FUNC_TEST_DTOR(name)\ + ::testing::RegFunc::GetInstance()->DelRegFuncDtorList(name) +#define GET_FUNC_CTOR_LIST()\ + ::testing::RegFunc::GetInstance()->GetRegFuncCtorList() +#define GET_FUNC_DTOR_LIST()\ + ::testing::RegFunc::GetInstance()->GetRegFuncDtorList() +//用户请勿使用,会导致AMock打桩失败。清除所有注册函数的接口 +#define CLEAR_FUNC_LIST()\ + ::testing::RegFunc::GetInstance()->ClearRegFuncList() + + +/*ulSource枚举宏定义:发送的消息的类型,根据不同的产品来进行扩展*/ +#define UTCENTER 0 /* UT_Center工具发送的消息,包括 */ +#define PRODUCT_RNC12 1 /* RNC12产品消息 */ +#define PRODUCT_LTE 2 /* LTE产品消息 */ +#define PRODUCT_ROSA 3 /* Rosa产品消息 */ +#define PRODUCT_NODEB 4 /* NodeB产品消息 */ +#define PRODUCT_MBSC 5 /* MBSC产品消息 */ +#define PRODUCT_WIMAX 6 /* wimax产品消息 */ +#define PRODUCT_TD 7 /* TD 产品信息 */ +#define PRODUCT_AP 8 /* AP产品信息 */ +#define PRODUCT_TD_RRU 9 /* TD RRU产品信息 */ +#define PRODUCT_RNC_R13 10 /* RNC13产品信息 */ +#define PRODUCT_GBSC 11 /* GBSC产品信息 */ +#define PRODUCT_COMMON 12 /* 适合各个产品的内部消息 */ + +/*ulLogtype枚举宏定义:消息的打印级别*/ +#define DT_PRINTF_INFO 4 /* 用户打印信息*/ +#define DT_PRINTF_ERROR 6 /* 用例错误信息*/ +#define DT_MSG_EXPECT 7 /* 期望接收的消息*/ +#define DT_MSG_SEND 8 /* 用例发送的消息*/ +#define DT_MSG_RECV 9 /* 实际接收的消息*/ +#define DT_MSG_SERIAL 10 /* 实际接收的消息*/ +#define DT_COMPARE_TXT_MSG 11 /* 用于比较的TXT类型的消息*/ +#define DT_COMPARE_BIT_MSG 12 /* 用于比较的BIT类型的消息*/ +#define DT_PRINTF_CPU_INFO 13 /* 打印CPU信息 */ +#define DT_SERVICE_MSG_SEND 14 /* 5G产品发送的服务消息 */ + + +/*ulSource:上面的取值 +usDataLen:数据长度 +poctData:要发送的数据 +*/ + +//添加全局空间 +//设置是否需要跟踪消息,默认为不发送 +//true 为发送 +#define SWITCH_ON_TRACE(bFlag)\ + ::testing::SwitchOnTrace(bFlag); \ + ::testing::OpenBaseCompare(bFlag) + +//串口打印开关 +#define COMPORT_MSG_PRINT(bFlag)\ + ::testing::ComprotMsgPrint(bFlag); + +//Doc界面打印开关,控制正确的用例和测试套是否需要打印到控制台上 +#define PRINT_ON_DOC(bFlag)\ + ::testing::PrintOnDoc(bFlag); + + +#define SEND_SEND_MSG(ulSource, usDataLen, poctData)\ + (::testing::Send_Send_MSG(ulSource, DT_MSG_SEND, usDataLen, (unsigned char *)poctData)) + +#define SEND_RECV_MSG(ulSource, usDataLen, poctData)\ + (::testing::Send_Recv_MSG(ulSource, DT_MSG_RECV, usDataLen, (unsigned char *)poctData)) + +#define SEND_EXPECT_MSG(ulSource, usDataLen, poctData)\ + (::testing::Send_Expect_MSG(ulSource, DT_MSG_EXPECT, usDataLen, (unsigned char *)poctData)) + +#define SEND_USER_INFO(usDataLen, poctData)\ + (::testing::Send_User_INFO(UTCENTER, DT_PRINTF_INFO, usDataLen, (unsigned char *)poctData)) + +#define SEND_SEND_SERIAL_MSG(ulSource, usDataLen, poctData)\ + (::testing::Send_Send_Serial_MSG(ulSource, DT_MSG_SERIAL, usDataLen, (unsigned char *)poctData)) + +//其中compareType为DT_COMPARE_TXT_MSG(文本消息)或DT_COMPARE_BIT_MSG(二进制消息)中的一个 +#define SEND_COMPARE_MSG(ulSource, usDataLen, poctData, compareType)\ + ::testing::BaseCompare(ulSource, compareType, usDataLen, (unsigned char *)poctData);\ + ::testing::Send_Every_Msg(ulSource, compareType, usDataLen, (unsigned char *)poctData) + +#define SET_BASE_DIR(dir) \ + (::testing::SetBaseResultDir(dir)) +#define GET_SEND_MSG(poctData, len)\ + (::testing::GetSendMsg(poctData, len)) + +#define GET_NODE_ATTRITUBE(Caption, ArrValue)\ + (::testing::GetNodAttribute(Caption, ArrValue)) + +#define SEND_MSG_TO_TRACER_INT32(ulSource,ucProt,ucDirection, MsgType,usDataLen,poctData)\ + (::testing::SendMsgToTracer_INT32(ulSource,ucProt,ucDirection, MsgType,usDataLen,poctData)) + +#define SEND_MSG_TO_TRACER_INT8(ulSource,ucProt,ucDirection, pstrMsgType,usDataLen, poctData)\ + (::testing::SendMsgToTracer_INT8(ulSource,ucProt,ucDirection, pstrMsgType,usDataLen, poctData)) + +#define SEND_MSG_TO_TRACER_NODEB(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ + (::testing::SendMsgToTracer_NodeB(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) +#define SEND_MSG_TO_TRACER_LTE(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ + (::testing::SendMsgToTracer_LTE(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) +#define SEND_MSG_TO_TRACER_InnerMsg(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ + (::testing::SendMsgToTracer_InnerMsg(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) + +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_GTEST_H_ diff --git a/cli/test/include/gtest/gtest_pred_impl.h b/cli/test/include/gtest/gtest_pred_impl.h new file mode 100644 index 0000000..f1538b5 --- /dev/null +++ b/cli/test/include/gtest/gtest_pred_impl.h @@ -0,0 +1,371 @@ +// Copyright 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This file is AUTOMATICALLY GENERATED on 09/24/2010 by command +// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! +// +// Implements a family of generic predicate assertion macros. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ +#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ + +// Makes sure this header is not included before gtest.h. +#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ +# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. +#endif // GTEST_INCLUDE_GTEST_GTEST_H_ + +// This header implements a family of generic predicate assertion +// macros: +// +// ASSERT_PRED_FORMAT1(pred_format, v1) +// ASSERT_PRED_FORMAT2(pred_format, v1, v2) +// ... +// +// where pred_format is a function or functor that takes n (in the +// case of ASSERT_PRED_FORMATn) values and their source expression +// text, and returns a testing::AssertionResult. See the definition +// of ASSERT_EQ in gtest.h for an example. +// +// If you don't care about formatting, you can use the more +// restrictive version: +// +// ASSERT_PRED1(pred, v1) +// ASSERT_PRED2(pred, v1, v2) +// ... +// +// where pred is an n-ary function or functor that returns bool, +// and the values v1, v2, ..., must support the << operator for +// streaming to std::ostream. +// +// We also define the EXPECT_* variations. +// +// For now we only support predicates whose arity is at most 5. +// Please email googletestframework@googlegroups.com if you need +// support for higher arities. + +// GTEST_ASSERT_ is the basic statement to which all of the assertions +// in this file reduce. Don't use this in your code. + +#define GTEST_ASSERT_(expression, on_failure) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (const ::testing::AssertionResult gtest_ar = (expression)) \ + ; \ + else \ + on_failure(gtest_ar.failure_message()) + +#define GTEST_ASSERT2_(expression, on_failure) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if(++gtest_assert_count_) \ + if (const ::testing::AssertionResult gtest_ar = (expression)) \ + ; \ + else \ + on_failure(gtest_ar.failure_message()) + +// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use +// this in your code. +template +AssertionResult AssertPred1Helper(const char* pred_text, + const char* e1, + Pred pred, + const T1& v1) { + if (pred(v1)) return AssertionSuccess(); + + return AssertionFailure() << pred_text << "(" + << e1 << ") evaluates to false, where" + << "\n" << e1 << " evaluates to " << v1; +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. +// Don't use this in your code. +#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, v1),\ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use +// this in your code. +#define GTEST_PRED1_(pred, v1, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ + #v1, \ + pred, \ + v1), on_failure) + +// Unary predicate assertion macros. +#define EXPECT_PRED_FORMAT1(pred_format, v1) \ + GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED1(pred, v1) \ + GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT1(pred_format, v1) \ + GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED1(pred, v1) \ + GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use +// this in your code. +template +AssertionResult AssertPred2Helper(const char* pred_text, + const char* e1, + const char* e2, + Pred pred, + const T1& v1, + const T2& v2) { + if (pred(v1, v2)) return AssertionSuccess(); + + return AssertionFailure() << pred_text << "(" + << e1 << ", " + << e2 << ") evaluates to false, where" + << "\n" << e1 << " evaluates to " << v1 + << "\n" << e2 << " evaluates to " << v2; +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. +// Don't use this in your code. +#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ + GTEST_ASSERT2_(pred_format(#v1, #v2, v1, v2),\ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use +// this in your code. +#define GTEST_PRED2_(pred, v1, v2, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ + #v1, \ + #v2, \ + pred, \ + v1, \ + v2), on_failure) + +// Binary predicate assertion macros. +#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ + GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED2(pred, v1, v2) \ + GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ + GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED2(pred, v1, v2) \ + GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use +// this in your code. +template +AssertionResult AssertPred3Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3) { + if (pred(v1, v2, v3)) return AssertionSuccess(); + + return AssertionFailure() << pred_text << "(" + << e1 << ", " + << e2 << ", " + << e3 << ") evaluates to false, where" + << "\n" << e1 << " evaluates to " << v1 + << "\n" << e2 << " evaluates to " << v2 + << "\n" << e3 << " evaluates to " << v3; +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. +// Don't use this in your code. +#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use +// this in your code. +#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + pred, \ + v1, \ + v2, \ + v3), on_failure) + +// Ternary predicate assertion macros. +#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ + GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED3(pred, v1, v2, v3) \ + GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ + GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED3(pred, v1, v2, v3) \ + GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use +// this in your code. +template +AssertionResult AssertPred4Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + const char* e4, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3, + const T4& v4) { + if (pred(v1, v2, v3, v4)) return AssertionSuccess(); + + return AssertionFailure() << pred_text << "(" + << e1 << ", " + << e2 << ", " + << e3 << ", " + << e4 << ") evaluates to false, where" + << "\n" << e1 << " evaluates to " << v1 + << "\n" << e2 << " evaluates to " << v2 + << "\n" << e3 << " evaluates to " << v3 + << "\n" << e4 << " evaluates to " << v4; +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. +// Don't use this in your code. +#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use +// this in your code. +#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + #v4, \ + pred, \ + v1, \ + v2, \ + v3, \ + v4), on_failure) + +// 4-ary predicate assertion macros. +#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ + GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ + GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ + GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ + GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use +// this in your code. +template +AssertionResult AssertPred5Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + const char* e4, + const char* e5, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3, + const T4& v4, + const T5& v5) { + if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); + + return AssertionFailure() << pred_text << "(" + << e1 << ", " + << e2 << ", " + << e3 << ", " + << e4 << ", " + << e5 << ") evaluates to false, where" + << "\n" << e1 << " evaluates to " << v1 + << "\n" << e2 << " evaluates to " << v2 + << "\n" << e3 << " evaluates to " << v3 + << "\n" << e4 << " evaluates to " << v4 + << "\n" << e5 << " evaluates to " << v5; +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. +// Don't use this in your code. +#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use +// this in your code. +#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + #v4, \ + #v5, \ + pred, \ + v1, \ + v2, \ + v3, \ + v4, \ + v5), on_failure) + +// 5-ary predicate assertion macros. +#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ + GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ + GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ + GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ + GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) + + + +#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ diff --git a/cli/test/include/gtest/gtest_prod.h b/cli/test/include/gtest/gtest_prod.h new file mode 100644 index 0000000..da80ddc --- /dev/null +++ b/cli/test/include/gtest/gtest_prod.h @@ -0,0 +1,58 @@ +// Copyright 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// Google C++ Testing Framework definitions useful in production code. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ +#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ + +// When you need to test the private or protected members of a class, +// use the FRIEND_TEST macro to declare your tests as friends of the +// class. For example: +// +// class MyClass { +// private: +// void MyMethod(); +// FRIEND_TEST(MyClassTest, MyMethod); +// }; +// +// class MyClassTest : public testing::Test { +// // ... +// }; +// +// TEST_F(MyClassTest, MyMethod) { +// // Can call MyClass::MyMethod() here. +// } + +#define FRIEND_TEST(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test + +#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/cli/test/include/gtest/internal/gtest-death-test-internal.h b/cli/test/include/gtest/internal/gtest-death-test-internal.h new file mode 100644 index 0000000..1d9f83b --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-death-test-internal.h @@ -0,0 +1,308 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file defines internal utilities needed for implementing +// death tests. They are subject to change without notice. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ + +#include "gtest/internal/gtest-internal.h" + +#include + +namespace testing { +namespace internal { + +GTEST_DECLARE_string_(internal_run_death_test); + +// Names of the flags (needed for parsing Google Test flags). +const char kDeathTestStyleFlag[] = "death_test_style"; +const char kDeathTestUseFork[] = "death_test_use_fork"; +const char kInternalRunDeathTestFlag[] = "internal_run_death_test"; + +#if GTEST_HAS_DEATH_TEST + +// DeathTest is a class that hides much of the complexity of the +// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method +// returns a concrete class that depends on the prevailing death test +// style, as defined by the --gtest_death_test_style and/or +// --gtest_internal_run_death_test flags. + +// In describing the results of death tests, these terms are used with +// the corresponding definitions: +// +// exit status: The integer exit information in the format specified +// by wait(2) +// exit code: The integer code passed to exit(3), _exit(2), or +// returned from main() +class GTEST_API_ DeathTest { + public: + // Create returns false if there was an error determining the + // appropriate action to take for the current death test; for example, + // if the gtest_death_test_style flag is set to an invalid value. + // The LastMessage method will return a more detailed message in that + // case. Otherwise, the DeathTest pointer pointed to by the "test" + // argument is set. If the death test should be skipped, the pointer + // is set to NULL; otherwise, it is set to the address of a new concrete + // DeathTest object that controls the execution of the current test. + static bool Create(const char* statement, const RE* regex, + const char* file, int line, DeathTest** test); + DeathTest(); + virtual ~DeathTest() { } + + // A helper class that aborts a death test when it's deleted. + class ReturnSentinel { + public: + explicit ReturnSentinel(DeathTest* test) : test_(test) { } + ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } + private: + DeathTest* const test_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); + } GTEST_ATTRIBUTE_UNUSED_; + + // An enumeration of possible roles that may be taken when a death + // test is encountered. EXECUTE means that the death test logic should + // be executed immediately. OVERSEE means that the program should prepare + // the appropriate environment for a child process to execute the death + // test, then wait for it to complete. + enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; + + // An enumeration of the three reasons that a test might be aborted. + enum AbortReason { + TEST_ENCOUNTERED_RETURN_STATEMENT, + TEST_THREW_EXCEPTION, + TEST_DID_NOT_DIE + }; + + // Assumes one of the above roles. + virtual TestRole AssumeRole() = 0; + + // Waits for the death test to finish and returns its status. + virtual int Wait() = 0; + + // Returns true if the death test passed; that is, the test process + // exited during the test, its exit status matches a user-supplied + // predicate, and its stderr output matches a user-supplied regular + // expression. + // The user-supplied predicate may be a macro expression rather + // than a function pointer or functor, or else Wait and Passed could + // be combined. + virtual bool Passed(bool exit_status_ok) = 0; + + // Signals that the death test did not die as expected. + virtual void Abort(AbortReason reason) = 0; + + // Returns a human-readable outcome message regarding the outcome of + // the last death test. + static const char* LastMessage(); + + static void set_last_death_test_message(const String& message); + + private: + // A string containing a description of the outcome of the last death test. + static String last_death_test_message_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); +}; + +// Factory interface for death tests. May be mocked out for testing. +class DeathTestFactory { + public: + virtual ~DeathTestFactory() { } + virtual bool Create(const char* statement, const RE* regex, + const char* file, int line, DeathTest** test) = 0; +}; + +// A concrete DeathTestFactory implementation for normal use. +class DefaultDeathTestFactory : public DeathTestFactory { + public: + virtual bool Create(const char* statement, const RE* regex, + const char* file, int line, DeathTest** test); +}; + +// Returns true if exit_status describes a process that was terminated +// by a signal, or exited normally with a nonzero exit code. +GTEST_API_ bool ExitedUnsuccessfully(int exit_status); + +// Traps C++ exceptions escaping statement and reports them as test +// failures. Note that trapping SEH exceptions is not implemented here. +# if GTEST_HAS_EXCEPTIONS +# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ + try { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } catch (const ::std::exception& gtest_exception) { \ + fprintf(\ + stderr, \ + "\n%s: Caught std::exception-derived exception escaping the " \ + "death test statement. Exception message: %s\n", \ + ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ + gtest_exception.what()); \ + fflush(stderr); \ + death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ + } catch (...) { \ + death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ + } + +# else +# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) + +# endif + +// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, +// ASSERT_EXIT*, and EXPECT_EXIT*. +# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + const ::testing::internal::RE& gtest_regex = (regex); \ + ::testing::internal::DeathTest* gtest_dt; \ + if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ + __FILE__, __LINE__, >est_dt)) { \ + goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ + } \ + if (gtest_dt != NULL) { \ + ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ + gtest_dt_ptr(gtest_dt); \ + switch (gtest_dt->AssumeRole()) { \ + case ::testing::internal::DeathTest::OVERSEE_TEST: \ + if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ + goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ + } \ + break; \ + case ::testing::internal::DeathTest::EXECUTE_TEST: { \ + ::testing::internal::DeathTest::ReturnSentinel \ + gtest_sentinel(gtest_dt); \ + GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ + gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ + break; \ + } \ + default: \ + break; \ + } \ + } \ + } else \ + GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ + fail(::testing::internal::DeathTest::LastMessage()) +// The symbol "fail" here expands to something into which a message +// can be streamed. + +// A class representing the parsed contents of the +// --gtest_internal_run_death_test flag, as it existed when +// RUN_ALL_TESTS was called. +class InternalRunDeathTestFlag { + public: + InternalRunDeathTestFlag(const String& a_file, + int a_line, + int an_index, + int a_write_fd) + : file_(a_file), line_(a_line), index_(an_index), + write_fd_(a_write_fd) {} + + ~InternalRunDeathTestFlag() { + if (write_fd_ >= 0) + posix::Close(write_fd_); + } + + String file() const { return file_; } + int line() const { return line_; } + int index() const { return index_; } + int write_fd() const { return write_fd_; } + + private: + String file_; + int line_; + int index_; + int write_fd_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); +}; + +// Returns a newly created InternalRunDeathTestFlag object with fields +// initialized from the GTEST_FLAG(internal_run_death_test) flag if +// the flag is specified; otherwise returns NULL. +InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); + +#else // GTEST_HAS_DEATH_TEST + +// This macro is used for implementing macros such as +// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where +// death tests are not supported. Those macros must compile on such systems +// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on +// systems that support death tests. This allows one to write such a macro +// on a system that does not support death tests and be sure that it will +// compile on a death-test supporting system. +// +// Parameters: +// statement - A statement that a macro such as EXPECT_DEATH would test +// for program termination. This macro has to make sure this +// statement is compiled but not executed, to ensure that +// EXPECT_DEATH_IF_SUPPORTED compiles with a certain +// parameter iff EXPECT_DEATH compiles with it. +// regex - A regex that a macro such as EXPECT_DEATH would use to test +// the output of statement. This parameter has to be +// compiled but not evaluated by this macro, to ensure that +// this macro only accepts expressions that a macro such as +// EXPECT_DEATH would accept. +// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED +// and a return statement for ASSERT_DEATH_IF_SUPPORTED. +// This ensures that ASSERT_DEATH_IF_SUPPORTED will not +// compile inside functions where ASSERT_DEATH doesn't +// compile. +// +// The branch that has an always false condition is used to ensure that +// statement and regex are compiled (and thus syntactically correct) but +// never executed. The unreachable code macro protects the terminator +// statement from generating an 'unreachable code' warning in case +// statement unconditionally returns or throws. The Message constructor at +// the end allows the syntax of streaming additional messages into the +// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. +# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + GTEST_LOG_(WARNING) \ + << "Death tests are not supported on this platform.\n" \ + << "Statement '" #statement "' cannot be verified."; \ + } else if (::testing::internal::AlwaysFalse()) { \ + ::testing::internal::RE::PartialMatch(".*", (regex)); \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + terminator; \ + } else \ + ::testing::Message() + +#endif // GTEST_HAS_DEATH_TEST + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ diff --git a/cli/test/include/gtest/internal/gtest-filepath.h b/cli/test/include/gtest/internal/gtest-filepath.h new file mode 100644 index 0000000..b36b3cf --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-filepath.h @@ -0,0 +1,210 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: keith.ray@gmail.com (Keith Ray) +// +// Google Test filepath utilities +// +// This header file declares classes and functions used internally by +// Google Test. They are subject to change without notice. +// +// This file is #included in . +// Do not include this header file separately! + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ + +#include "gtest/internal/gtest-string.h" + +namespace testing { +namespace internal { + +// FilePath - a class for file and directory pathname manipulation which +// handles platform-specific conventions (like the pathname separator). +// Used for helper functions for naming files in a directory for xml output. +// Except for Set methods, all methods are const or static, which provides an +// "immutable value object" -- useful for peace of mind. +// A FilePath with a value ending in a path separator ("like/this/") represents +// a directory, otherwise it is assumed to represent a file. In either case, +// it may or may not represent an actual file or directory in the file system. +// Names are NOT checked for syntax correctness -- no checking for illegal +// characters, malformed paths, etc. + +class GTEST_API_ FilePath { + public: + FilePath() : pathname_("") { } + FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } + + explicit FilePath(const char* pathname) : pathname_(pathname) { + Normalize(); + } + + explicit FilePath(const String& pathname) : pathname_(pathname) { + Normalize(); + } + + FilePath& operator=(const FilePath& rhs) { + Set(rhs); + return *this; + } + + void Set(const FilePath& rhs) { + pathname_ = rhs.pathname_; + } + + String ToString() const { return pathname_; } + const char* c_str() const { return pathname_.c_str(); } + + // Returns the current working directory, or "" if unsuccessful. + static FilePath GetCurrentDir(); + + // Given directory = "dir", base_name = "test", number = 0, + // extension = "xml", returns "dir/test.xml". If number is greater + // than zero (e.g., 12), returns "dir/test_12.xml". + // On Windows platform, uses \ as the separator rather than /. + static FilePath MakeFileName(const FilePath& directory, + const FilePath& base_name, + int number, + const char* extension); + + // Given directory = "dir", relative_path = "test.xml", + // returns "dir/test.xml". + // On Windows, uses \ as the separator rather than /. + static FilePath ConcatPaths(const FilePath& directory, + const FilePath& relative_path); + + // Returns a pathname for a file that does not currently exist. The pathname + // will be directory/base_name.extension or + // directory/base_name_.extension if directory/base_name.extension + // already exists. The number will be incremented until a pathname is found + // that does not already exist. + // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. + // There could be a race condition if two or more processes are calling this + // function at the same time -- they could both pick the same filename. + static FilePath GenerateUniqueFileName(const FilePath& directory, + const FilePath& base_name, + const char* extension); + + // Returns true iff the path is NULL or "". + bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; } + + // If input name has a trailing separator character, removes it and returns + // the name, otherwise return the name string unmodified. + // On Windows platform, uses \ as the separator, other platforms use /. + FilePath RemoveTrailingPathSeparator() const; + + // Returns a copy of the FilePath with the directory part removed. + // Example: FilePath("path/to/file").RemoveDirectoryName() returns + // FilePath("file"). If there is no directory part ("just_a_file"), it returns + // the FilePath unmodified. If there is no file part ("just_a_dir/") it + // returns an empty FilePath (""). + // On Windows platform, '\' is the path separator, otherwise it is '/'. + FilePath RemoveDirectoryName() const; + + // RemoveFileName returns the directory path with the filename removed. + // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". + // If the FilePath is "a_file" or "/a_file", RemoveFileName returns + // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does + // not have a file, like "just/a/dir/", it returns the FilePath unmodified. + // On Windows platform, '\' is the path separator, otherwise it is '/'. + FilePath RemoveFileName() const; + + // Returns a copy of the FilePath with the case-insensitive extension removed. + // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns + // FilePath("dir/file"). If a case-insensitive extension is not + // found, returns a copy of the original FilePath. + FilePath RemoveExtension(const char* extension) const; + + // Creates directories so that path exists. Returns true if successful or if + // the directories already exist; returns false if unable to create + // directories for any reason. Will also return false if the FilePath does + // not represent a directory (that is, it doesn't end with a path separator). + bool CreateDirectoriesRecursively() const; + + // Create the directory so that path exists. Returns true if successful or + // if the directory already exists; returns false if unable to create the + // directory for any reason, including if the parent directory does not + // exist. Not named "CreateDirectory" because that's a macro on Windows. + bool CreateFolder() const; + + // Returns true if FilePath describes something in the file-system, + // either a file, directory, or whatever, and that something exists. + bool FileOrDirectoryExists() const; + + // Returns true if pathname describes a directory in the file-system + // that exists. + bool DirectoryExists() const; + + // Returns true if FilePath ends with a path separator, which indicates that + // it is intended to represent a directory. Returns false otherwise. + // This does NOT check that a directory (or file) actually exists. + bool IsDirectory() const; + + // Returns true if pathname describes a root directory. (Windows has one + // root directory per disk drive.) + bool IsRootDirectory() const; + + // Returns true if pathname describes an absolute path. + bool IsAbsolutePath() const; + + private: + // Replaces multiple consecutive separators with a single separator. + // For example, "bar///foo" becomes "bar/foo". Does not eliminate other + // redundancies that might be in a pathname involving "." or "..". + // + // A pathname with multiple consecutive separators may occur either through + // user error or as a result of some scripts or APIs that generate a pathname + // with a trailing separator. On other platforms the same API or script + // may NOT generate a pathname with a trailing "/". Then elsewhere that + // pathname may have another "/" and pathname components added to it, + // without checking for the separator already being there. + // The script language and operating system may allow paths like "foo//bar" + // but some of the functions in FilePath will not handle that correctly. In + // particular, RemoveTrailingPathSeparator() only removes one separator, and + // it is called in CreateDirectoriesRecursively() assuming that it will change + // a pathname from directory syntax (trailing separator) to filename syntax. + // + // On Windows this method also replaces the alternate path separator '/' with + // the primary path separator '\\', so that for example "bar\\/\\foo" becomes + // "bar\\foo". + + void Normalize(); + + // Returns a pointer to the last occurence of a valid path separator in + // the FilePath. On Windows, for example, both '/' and '\' are valid path + // separators. Returns NULL if no path separator was found. + const char* FindLastPathSeparator() const; + + String pathname_; +}; // class FilePath + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ diff --git a/cli/test/include/gtest/internal/gtest-internal.h b/cli/test/include/gtest/internal/gtest-internal.h new file mode 100644 index 0000000..691a202 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-internal.h @@ -0,0 +1,1280 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file declares functions and macros used internally by +// Google Test. They are subject to change without notice. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ + +#include "gtest/internal/gtest-port.h" + +#if GTEST_OS_LINUX +# include +# include +# include +# include +#endif // GTEST_OS_LINUX + +#include +#include +#include +#include +#include + +#include "gtest/internal/gtest-string.h" +#include "gtest/internal/gtest-filepath.h" +#include "gtest/internal/gtest-type-util.h" + +// Due to C++ preprocessor weirdness, we need double indirection to +// concatenate two tokens when one of them is __LINE__. Writing +// +// foo ## __LINE__ +// +// will result in the token foo__LINE__, instead of foo followed by +// the current line number. For more details, see +// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 +#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) +#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar + +// Google Test defines the testing::Message class to allow construction of +// test messages via the << operator. The idea is that anything +// streamable to std::ostream can be streamed to a testing::Message. +// This allows a user to use his own types in Google Test assertions by +// overloading the << operator. +// +// util/gtl/stl_logging-inl.h overloads << for STL containers. These +// overloads cannot be defined in the std namespace, as that will be +// undefined behavior. Therefore, they are defined in the global +// namespace instead. +// +// C++'s symbol lookup rule (i.e. Koenig lookup) says that these +// overloads are visible in either the std namespace or the global +// namespace, but not other namespaces, including the testing +// namespace which Google Test's Message class is in. +// +// To allow STL containers (and other types that has a << operator +// defined in the global namespace) to be used in Google Test assertions, +// testing::Message must access the custom << operator from the global +// namespace. Hence this helper function. +// +// Note: Jeffrey Yasskin suggested an alternative fix by "using +// ::operator<<;" in the definition of Message's operator<<. That fix +// doesn't require a helper function, but unfortunately doesn't +// compile with MSVC. +template +inline void GTestStreamToHelper(std::ostream* os, const T& val) { + *os << val; +} + +class ProtocolMessage; +namespace proto2 { class Message; } + +namespace testing { + +// Forward declarations. + +class AssertionResult; // Result of an assertion. +class Message; // Represents a failure message. +class Test; // Represents a test. +class TestInfo; // Information about a test. +class TestPartResult; // Result of a test part. +class UnitTest; // A collection of test cases. + +template +::std::string PrintToString(const T& value); + +namespace internal { + +struct TraceInfo; // Information about a trace point. +class ScopedTrace; // Implements scoped trace. +class TestInfoImpl; // Opaque implementation of TestInfo +class UnitTestImpl; // Opaque implementation of UnitTest + +// How many times InitGoogleTest() has been called. +extern int g_init_gtest_count; + +// The text used in failure messages to indicate the start of the +// stack trace. +GTEST_API_ extern const char kStackTraceMarker[]; + +// A secret type that Google Test users don't know about. It has no +// definition on purpose. Therefore it's impossible to create a +// Secret object, which is what we want. +class Secret; + +// Two overloaded helpers for checking at compile time whether an +// expression is a null pointer literal (i.e. NULL or any 0-valued +// compile-time integral constant). Their return values have +// different sizes, so we can use sizeof() to test which version is +// picked by the compiler. These helpers have no implementations, as +// we only need their signatures. +// +// Given IsNullLiteralHelper(x), the compiler will pick the first +// version if x can be implicitly converted to Secret*, and pick the +// second version otherwise. Since Secret is a secret and incomplete +// type, the only expression a user can write that has type Secret* is +// a null pointer literal. Therefore, we know that x is a null +// pointer literal if and only if the first version is picked by the +// compiler. +char IsNullLiteralHelper(Secret* p); +char (&IsNullLiteralHelper(...))[2]; // NOLINT + +// A compile-time bool constant that is true if and only if x is a +// null pointer literal (i.e. NULL or any 0-valued compile-time +// integral constant). +#ifdef GTEST_ELLIPSIS_NEEDS_POD_ +// We lose support for NULL detection where the compiler doesn't like +// passing non-POD classes through ellipsis (...). +# define GTEST_IS_NULL_LITERAL_(x) false +#else +# define GTEST_IS_NULL_LITERAL_(x) \ + (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) +#endif // GTEST_ELLIPSIS_NEEDS_POD_ + +// Appends the user-supplied message to the Google-Test-generated message. +GTEST_API_ String AppendUserMessage(const String& gtest_msg, + const Message& user_msg); + +// A helper class for creating scoped traces in user programs. +class GTEST_API_ ScopedTrace { + public: + // The c'tor pushes the given source file location and message onto + // a trace stack maintained by Google Test. + ScopedTrace(const char* file, int line, const Message& message); + + // The d'tor pops the info pushed by the c'tor. + // + // Note that the d'tor is not virtual in order to be efficient. + // Don't inherit from ScopedTrace! + ~ScopedTrace(); + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); +} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its + // c'tor and d'tor. Therefore it doesn't + // need to be used otherwise. + +// Converts a streamable value to a String. A NULL pointer is +// converted to "(null)". When the input value is a ::string, +// ::std::string, ::wstring, or ::std::wstring object, each NUL +// character in it is replaced with "\\0". +// Declared here but defined in gtest.h, so that it has access +// to the definition of the Message class, required by the ARM +// compiler. +template +String StreamableToString(const T& streamable); + +// The Symbian compiler has a bug that prevents it from selecting the +// correct overload of FormatForComparisonFailureMessage (see below) +// unless we pass the first argument by reference. If we do that, +// however, Visual Age C++ 10.1 generates a compiler error. Therefore +// we only apply the work-around for Symbian. +#if defined(__SYMBIAN32__) +# define GTEST_CREF_WORKAROUND_ const& +#else +# define GTEST_CREF_WORKAROUND_ +#endif + +// When this operand is a const char* or char*, if the other operand +// is a ::std::string or ::string, we print this operand as a C string +// rather than a pointer (we do the same for wide strings); otherwise +// we print it as a pointer to be safe. + +// This internal macro is used to avoid duplicated code. +#define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\ +inline String FormatForComparisonFailureMessage(\ + operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ + const operand2_type& /*operand2*/) {\ + return operand1_printer(str);\ +}\ +inline String FormatForComparisonFailureMessage(\ + const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ + const operand2_type& /*operand2*/) {\ + return operand1_printer(str);\ +} + +GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted) +#if GTEST_HAS_STD_WSTRING +GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted) +#endif // GTEST_HAS_STD_WSTRING + +#if GTEST_HAS_GLOBAL_STRING +GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted) +#endif // GTEST_HAS_GLOBAL_STRING +#if GTEST_HAS_GLOBAL_WSTRING +GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted) +#endif // GTEST_HAS_GLOBAL_WSTRING + +#undef GTEST_FORMAT_IMPL_ + +// The next four overloads handle the case where the operand being +// printed is a char/wchar_t pointer and the other operand is not a +// string/wstring object. In such cases, we just print the operand as +// a pointer to be safe. +#define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \ + template \ + String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \ + const T&) { \ + return PrintToString(static_cast(p)); \ + } + +GTEST_FORMAT_CHAR_PTR_IMPL_(char) +GTEST_FORMAT_CHAR_PTR_IMPL_(const char) +GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t) +GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t) + +#undef GTEST_FORMAT_CHAR_PTR_IMPL_ + +// Constructs and returns the message for an equality assertion +// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. +// +// The first four parameters are the expressions used in the assertion +// and their values, as strings. For example, for ASSERT_EQ(foo, bar) +// where foo is 5 and bar is 6, we have: +// +// expected_expression: "foo" +// actual_expression: "bar" +// expected_value: "5" +// actual_value: "6" +// +// The ignoring_case parameter is true iff the assertion is a +// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will +// be inserted into the message. +GTEST_API_ AssertionResult EqFailure(const char* expected_expression, + const char* actual_expression, + const String& expected_value, + const String& actual_value, + bool ignoring_case); + +// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. +GTEST_API_ String GetBoolAssertionFailureMessage( + const AssertionResult& assertion_result, + const char* expression_text, + const char* actual_predicate_value, + const char* expected_predicate_value); + +// This template class represents an IEEE floating-point number +// (either single-precision or double-precision, depending on the +// template parameters). +// +// The purpose of this class is to do more sophisticated number +// comparison. (Due to round-off error, etc, it's very unlikely that +// two floating-points will be equal exactly. Hence a naive +// comparison by the == operation often doesn't work.) +// +// Format of IEEE floating-point: +// +// The most-significant bit being the leftmost, an IEEE +// floating-point looks like +// +// sign_bit exponent_bits fraction_bits +// +// Here, sign_bit is a single bit that designates the sign of the +// number. +// +// For float, there are 8 exponent bits and 23 fraction bits. +// +// For double, there are 11 exponent bits and 52 fraction bits. +// +// More details can be found at +// http://en.wikipedia.org/wiki/IEEE_floating-point_standard. +// +// Template parameter: +// +// RawType: the raw floating-point type (either float or double) +template +class FloatingPoint { + public: + // Defines the unsigned integer type that has the same size as the + // floating point number. + typedef typename TypeWithSize::UInt Bits; + + // Constants. + + // # of bits in a number. + static const size_t kBitCount = 8*sizeof(RawType); + + // # of fraction bits in a number. + static const size_t kFractionBitCount = + std::numeric_limits::digits - 1; + + // # of exponent bits in a number. + static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; + + // The mask for the sign bit. + static const Bits kSignBitMask = static_cast(1) << (kBitCount - 1); + + // The mask for the fraction bits. + static const Bits kFractionBitMask = + ~static_cast(0) >> (kExponentBitCount + 1); + + // The mask for the exponent bits. + static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); + + // How many ULP's (Units in the Last Place) we want to tolerate when + // comparing two numbers. The larger the value, the more error we + // allow. A 0 value means that two numbers must be exactly the same + // to be considered equal. + // + // The maximum error of a single floating-point operation is 0.5 + // units in the last place. On Intel CPU's, all floating-point + // calculations are done with 80-bit precision, while double has 64 + // bits. Therefore, 4 should be enough for ordinary use. + // + // See the following article for more details on ULP: + // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm. + static const size_t kMaxUlps = 4; + + // Constructs a FloatingPoint from a raw floating-point number. + // + // On an Intel CPU, passing a non-normalized NAN (Not a Number) + // around may change its bits, although the new value is guaranteed + // to be also a NAN. Therefore, don't expect this constructor to + // preserve the bits in x when x is a NAN. + explicit FloatingPoint(const RawType& x) { u_.value_ = x; } + + // Static methods + + // Reinterprets a bit pattern as a floating-point number. + // + // This function is needed to test the AlmostEquals() method. + static RawType ReinterpretBits(const Bits bits) { + FloatingPoint fp(0); + fp.u_.bits_ = bits; + return fp.u_.value_; + } + + // Returns the floating-point number that represent positive infinity. + static RawType Infinity() { + return ReinterpretBits(kExponentBitMask); + } + + // Non-static methods + + // Returns the bits that represents this number. + const Bits &bits() const { return u_.bits_; } + + // Returns the exponent bits of this number. + Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } + + // Returns the fraction bits of this number. + Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } + + // Returns the sign bit of this number. + Bits sign_bit() const { return kSignBitMask & u_.bits_; } + + // Returns true iff this is NAN (not a number). + bool is_nan() const { + // It's a NAN if the exponent bits are all ones and the fraction + // bits are not entirely zeros. + return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); + } + + // Returns true iff this number is at most kMaxUlps ULP's away from + // rhs. In particular, this function: + // + // - returns false if either number is (or both are) NAN. + // - treats really large numbers as almost equal to infinity. + // - thinks +0.0 and -0.0 are 0 DLP's apart. + bool AlmostEquals(const FloatingPoint& rhs) const { + // The IEEE standard says that any comparison operation involving + // a NAN must return false. + if (is_nan() || rhs.is_nan()) return false; + + return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) + <= kMaxUlps; + } + + private: + // The data type used to store the actual floating-point number. + union FloatingPointUnion { + RawType value_; // The raw floating-point number. + Bits bits_; // The bits that represent the number. + }; + + // Converts an integer from the sign-and-magnitude representation to + // the biased representation. More precisely, let N be 2 to the + // power of (kBitCount - 1), an integer x is represented by the + // unsigned number x + N. + // + // For instance, + // + // -N + 1 (the most negative number representable using + // sign-and-magnitude) is represented by 1; + // 0 is represented by N; and + // N - 1 (the biggest number representable using + // sign-and-magnitude) is represented by 2N - 1. + // + // Read http://en.wikipedia.org/wiki/Signed_number_representations + // for more details on signed number representations. + static Bits SignAndMagnitudeToBiased(const Bits &sam) { + if (kSignBitMask & sam) { + // sam represents a negative number. + return ~sam + 1; + } else { + // sam represents a positive number. + return kSignBitMask | sam; + } + } + + // Given two numbers in the sign-and-magnitude representation, + // returns the distance between them as an unsigned number. + static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, + const Bits &sam2) { + const Bits biased1 = SignAndMagnitudeToBiased(sam1); + const Bits biased2 = SignAndMagnitudeToBiased(sam2); + return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); + } + + FloatingPointUnion u_; +}; + +// Typedefs the instances of the FloatingPoint template class that we +// care to use. +typedef FloatingPoint Float; +typedef FloatingPoint Double; + +// In order to catch the mistake of putting tests that use different +// test fixture classes in the same test case, we need to assign +// unique IDs to fixture classes and compare them. The TypeId type is +// used to hold such IDs. The user should treat TypeId as an opaque +// type: the only operation allowed on TypeId values is to compare +// them for equality using the == operator. +typedef const void* TypeId; + +template +class TypeIdHelper { + public: + // dummy_ must not have a const type. Otherwise an overly eager + // compiler (e.g. MSVC 7.1 & 8.0) may try to merge + // TypeIdHelper::dummy_ for different Ts as an "optimization". + static bool dummy_; +}; + +template +bool TypeIdHelper::dummy_ = false; + +// GetTypeId() returns the ID of type T. Different values will be +// returned for different types. Calling the function twice with the +// same type argument is guaranteed to return the same ID. +template +TypeId GetTypeId() { + // The compiler is required to allocate a different + // TypeIdHelper::dummy_ variable for each T used to instantiate + // the template. Therefore, the address of dummy_ is guaranteed to + // be unique. + return &(TypeIdHelper::dummy_); +} + +// Returns the type ID of ::testing::Test. Always call this instead +// of GetTypeId< ::testing::Test>() to get the type ID of +// ::testing::Test, as the latter may give the wrong result due to a +// suspected linker bug when compiling Google Test as a Mac OS X +// framework. +GTEST_API_ TypeId GetTestTypeId(); + +// Defines the abstract factory interface that creates instances +// of a Test object. +class TestFactoryBase { + public: + virtual ~TestFactoryBase() {} + + // Creates a test instance to run. The instance is both created and destroyed + // within TestInfoImpl::Run() + virtual Test* CreateTest() = 0; + + protected: + TestFactoryBase() {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); +}; + +// This class provides implementation of TeastFactoryBase interface. +// It is used in TEST and TEST_F macros. +template +class TestFactoryImpl : public TestFactoryBase { + public: + virtual Test* CreateTest() { return new TestClass; } +}; + +#if GTEST_OS_WINDOWS + +// Predicate-formatters for implementing the HRESULT checking macros +// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} +// We pass a long instead of HRESULT to avoid causing an +// include dependency for the HRESULT type. +GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, + long hr); // NOLINT +GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, + long hr); // NOLINT + +#endif // GTEST_OS_WINDOWS + +// Types of SetUpTestCase() and TearDownTestCase() functions. +typedef void (*SetUpTestCaseFunc)(); +typedef void (*TearDownTestCaseFunc)(); + +// Creates a new TestInfo object and registers it with Google Test; +// returns the created object. +// +// Arguments: +// +// test_case_name: name of the test case +// name: name of the test +// type_param the name of the test's type parameter, or NULL if +// this is not a typed or a type-parameterized test. +// value_param text representation of the test's value parameter, +// or NULL if this is not a type-parameterized test. +// fixture_class_id: ID of the test fixture class +// set_up_tc: pointer to the function that sets up the test case +// tear_down_tc: pointer to the function that tears down the test case +// factory: pointer to the factory that creates a test object. +// The newly created TestInfo instance will assume +// ownership of the factory object. +GTEST_API_ TestInfo* MakeAndRegisterTestInfo( + const char* test_case_name, const char* name, + const char* type_param, + const char* value_param, + TypeId fixture_class_id, + SetUpTestCaseFunc set_up_tc, + TearDownTestCaseFunc tear_down_tc, + TestFactoryBase* factory, + std::string sFilePath, + int iLine, + const char* name_id = ""); + +// If *pstr starts with the given prefix, modifies *pstr to be right +// past the prefix and returns true; otherwise leaves *pstr unchanged +// and returns false. None of pstr, *pstr, and prefix can be NULL. +GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); + +#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +// State of the definition of a type-parameterized test case. +class GTEST_API_ TypedTestCasePState { + public: + TypedTestCasePState() : registered_(false) {} + + // Adds the given test name to defined_test_names_ and return true + // if the test case hasn't been registered; otherwise aborts the + // program. + bool AddTestName(const char* file, int line, const char* case_name, + const char* test_name) { + if (registered_) { + fprintf(stderr, "%s Test %s must be defined before " + "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n", + FormatFileLocation(file, line).c_str(), test_name, case_name); + fflush(stderr); + posix::Abort(); + } + defined_test_names_.insert(test_name); + return true; + } + + // Verifies that registered_tests match the test names in + // defined_test_names_; returns registered_tests if successful, or + // aborts the program otherwise. + const char* VerifyRegisteredTestNames( + const char* file, int line, const char* registered_tests); + + private: + bool registered_; + ::std::set defined_test_names_; +}; + +// Skips to the first non-space char after the first comma in 'str'; +// returns NULL if no comma is found in 'str'. +inline const char* SkipComma(const char* str) { + const char* comma = strchr(str, ','); + if (comma == NULL) { + return NULL; + } + while (IsSpace(*(++comma))) {} + return comma; +} + +// Returns the prefix of 'str' before the first comma in it; returns +// the entire string if it contains no comma. +inline String GetPrefixUntilComma(const char* str) { + const char* comma = strchr(str, ','); + return comma == NULL ? String(str) : String(str, comma - str); +} + +// TypeParameterizedTest::Register() +// registers a list of type-parameterized tests with Google Test. The +// return value is insignificant - we just need to return something +// such that we can call this function in a namespace scope. +// +// Implementation note: The GTEST_TEMPLATE_ macro declares a template +// template parameter. It's defined in gtest-type-util.h. +template +class TypeParameterizedTest { + public: + // 'index' is the index of the test in the type list 'Types' + // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, + // Types). Valid values for 'index' are [0, N - 1] where N is the + // length of Types. + static bool Register(const char* prefix, const char* case_name, + const char* test_names, int index) { + typedef typename Types::Head Type; + typedef Fixture FixtureClass; + typedef typename GTEST_BIND_(TestSel, Type) TestClass; + + // First, registers the first type-parameterized test in the type + // list. + MakeAndRegisterTestInfo( + String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/", + case_name, index).c_str(), + GetPrefixUntilComma(test_names).c_str(), + GetTypeName().c_str(), + NULL, // No value parameter. + GetTypeId(), + TestClass::SetUpTestCase, + TestClass::TearDownTestCase, + new TestFactoryImpl); + + // Next, recurses (at compile time) with the tail of the type list. + return TypeParameterizedTest + ::Register(prefix, case_name, test_names, index + 1); + } +}; + +// The base case for the compile time recursion. +template +class TypeParameterizedTest { + public: + static bool Register(const char* /*prefix*/, const char* /*case_name*/, + const char* /*test_names*/, int /*index*/) { + return true; + } +}; + +// TypeParameterizedTestCase::Register() +// registers *all combinations* of 'Tests' and 'Types' with Google +// Test. The return value is insignificant - we just need to return +// something such that we can call this function in a namespace scope. +template +class TypeParameterizedTestCase { + public: + static bool Register(const char* prefix, const char* case_name, + const char* test_names) { + typedef typename Tests::Head Head; + + // First, register the first test in 'Test' for each type in 'Types'. + TypeParameterizedTest::Register( + prefix, case_name, test_names, 0); + + // Next, recurses (at compile time) with the tail of the test list. + return TypeParameterizedTestCase + ::Register(prefix, case_name, SkipComma(test_names)); + } +}; + +// The base case for the compile time recursion. +template +class TypeParameterizedTestCase { + public: + static bool Register(const char* /*prefix*/, const char* /*case_name*/, + const char* /*test_names*/) { + return true; + } +}; + +#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +// Returns the current OS stack trace as a String. +// +// The maximum number of stack frames to be included is specified by +// the gtest_stack_trace_depth flag. The skip_count parameter +// specifies the number of top frames to be skipped, which doesn't +// count against the number of frames to be included. +// +// For example, if Foo() calls Bar(), which in turn calls +// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in +// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. +GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test, + int skip_count); + +// Helpers for suppressing warnings on unreachable code or constant +// condition. + +// Always returns true. +GTEST_API_ bool AlwaysTrue(); + +// Always returns false. +inline bool AlwaysFalse() { return !AlwaysTrue(); } + +// Helper for suppressing false warning from Clang on a const char* +// variable declared in a conditional expression always being NULL in +// the else branch. +struct GTEST_API_ ConstCharPtr { + ConstCharPtr(const char* str) : value(str) {} + operator bool() const { return true; } + const char* value; +}; + +// A simple Linear Congruential Generator for generating random +// numbers with a uniform distribution. Unlike rand() and srand(), it +// doesn't use global state (and therefore can't interfere with user +// code). Unlike rand_r(), it's portable. An LCG isn't very random, +// but it's good enough for our purposes. +class GTEST_API_ Random { + public: + static const UInt32 kMaxRange = 1u << 31; + + explicit Random(UInt32 seed) : state_(seed) {} + + void Reseed(UInt32 seed) { state_ = seed; } + + // Generates a random number from [0, range). Crashes if 'range' is + // 0 or greater than kMaxRange. + UInt32 Generate(UInt32 range); + + private: + UInt32 state_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); +}; + +// Defining a variable of type CompileAssertTypesEqual will cause a +// compiler error iff T1 and T2 are different types. +template +struct CompileAssertTypesEqual; + +template +struct CompileAssertTypesEqual { +}; + +// Removes the reference from a type if it is a reference type, +// otherwise leaves it unchanged. This is the same as +// tr1::remove_reference, which is not widely available yet. +template +struct RemoveReference { typedef T type; }; // NOLINT +template +struct RemoveReference { typedef T type; }; // NOLINT + +// A handy wrapper around RemoveReference that works when the argument +// T depends on template parameters. +#define GTEST_REMOVE_REFERENCE_(T) \ + typename ::testing::internal::RemoveReference::type + +// Removes const from a type if it is a const type, otherwise leaves +// it unchanged. This is the same as tr1::remove_const, which is not +// widely available yet. +template +struct RemoveConst { typedef T type; }; // NOLINT +template +struct RemoveConst { typedef T type; }; // NOLINT + +// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above +// definition to fail to remove the const in 'const int[3]' and 'const +// char[3][4]'. The following specialization works around the bug. +// However, it causes trouble with GCC and thus needs to be +// conditionally compiled. +#if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__) +template +struct RemoveConst { + typedef typename RemoveConst::type type[N]; +}; +#endif + +// A handy wrapper around RemoveConst that works when the argument +// T depends on template parameters. +#define GTEST_REMOVE_CONST_(T) \ + typename ::testing::internal::RemoveConst::type + +// Turns const U&, U&, const U, and U all into U. +#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ + GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) + +// Adds reference to a type if it is not a reference type, +// otherwise leaves it unchanged. This is the same as +// tr1::add_reference, which is not widely available yet. +template +struct AddReference { typedef T& type; }; // NOLINT +template +struct AddReference { typedef T& type; }; // NOLINT + +// A handy wrapper around AddReference that works when the argument T +// depends on template parameters. +#define GTEST_ADD_REFERENCE_(T) \ + typename ::testing::internal::AddReference::type + +// Adds a reference to const on top of T as necessary. For example, +// it transforms +// +// char ==> const char& +// const char ==> const char& +// char& ==> const char& +// const char& ==> const char& +// +// The argument T must depend on some template parameters. +#define GTEST_REFERENCE_TO_CONST_(T) \ + GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) + +// ImplicitlyConvertible::value is a compile-time bool +// constant that's true iff type From can be implicitly converted to +// type To. +template +class ImplicitlyConvertible { + private: + // We need the following helper functions only for their types. + // They have no implementations. + + // MakeFrom() is an expression whose type is From. We cannot simply + // use From(), as the type From may not have a public default + // constructor. + static From MakeFrom(); + + // These two functions are overloaded. Given an expression + // Helper(x), the compiler will pick the first version if x can be + // implicitly converted to type To; otherwise it will pick the + // second version. + // + // The first version returns a value of size 1, and the second + // version returns a value of size 2. Therefore, by checking the + // size of Helper(x), which can be done at compile time, we can tell + // which version of Helper() is used, and hence whether x can be + // implicitly converted to type To. + static char Helper(To); + static char (&Helper(...))[2]; // NOLINT + + // We have to put the 'public' section after the 'private' section, + // or MSVC refuses to compile the code. + public: + // MSVC warns about implicitly converting from double to int for + // possible loss of data, so we need to temporarily disable the + // warning. +#ifdef _MSC_VER +# pragma warning(push) // Saves the current warning state. +# pragma warning(disable:4244) // Temporarily disables warning 4244. + + static const bool value = + sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; +# pragma warning(pop) // Restores the warning state. +#elif defined(__BORLANDC__) + // C++Builder cannot use member overload resolution during template + // instantiation. The simplest workaround is to use its C++0x type traits + // functions (C++Builder 2009 and above only). + static const bool value = __is_convertible(From, To); +#else + static const bool value = + sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; +#endif // _MSV_VER +}; +template +const bool ImplicitlyConvertible::value; + +// IsAProtocolMessage::value is a compile-time bool constant that's +// true iff T is type ProtocolMessage, proto2::Message, or a subclass +// of those. +template +struct IsAProtocolMessage + : public bool_constant< + ImplicitlyConvertible::value || + ImplicitlyConvertible::value> { +}; + +// When the compiler sees expression IsContainerTest(0), if C is an +// STL-style container class, the first overload of IsContainerTest +// will be viable (since both C::iterator* and C::const_iterator* are +// valid types and NULL can be implicitly converted to them). It will +// be picked over the second overload as 'int' is a perfect match for +// the type of argument 0. If C::iterator or C::const_iterator is not +// a valid type, the first overload is not viable, and the second +// overload will be picked. Therefore, we can determine whether C is +// a container class by checking the type of IsContainerTest(0). +// The value of the expression is insignificant. +// +// Note that we look for both C::iterator and C::const_iterator. The +// reason is that C++ injects the name of a class as a member of the +// class itself (e.g. you can refer to class iterator as either +// 'iterator' or 'iterator::iterator'). If we look for C::iterator +// only, for example, we would mistakenly think that a class named +// iterator is an STL container. +// +// Also note that the simpler approach of overloading +// IsContainerTest(typename C::const_iterator*) and +// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. +typedef int IsContainer; +template +IsContainer IsContainerTest(int /* dummy */, + typename C::iterator* /* it */ = NULL, + typename C::const_iterator* /* const_it */ = NULL) { + return 0; +} + +typedef char IsNotContainer; +template +IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } + +// EnableIf::type is void when 'Cond' is true, and +// undefined when 'Cond' is false. To use SFINAE to make a function +// overload only apply when a particular expression is true, add +// "typename EnableIf::type* = 0" as the last parameter. +template struct EnableIf; +template<> struct EnableIf { typedef void type; }; // NOLINT + +// Utilities for native arrays. + +// ArrayEq() compares two k-dimensional native arrays using the +// elements' operator==, where k can be any integer >= 0. When k is +// 0, ArrayEq() degenerates into comparing a single pair of values. + +template +bool ArrayEq(const T* lhs, size_t size, const U* rhs); + +// This generic version is used when k is 0. +template +inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } + +// This overload is used when k >= 1. +template +inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { + return internal::ArrayEq(lhs, N, rhs); +} + +// This helper reduces code bloat. If we instead put its logic inside +// the previous ArrayEq() function, arrays with different sizes would +// lead to different copies of the template code. +template +bool ArrayEq(const T* lhs, size_t size, const U* rhs) { + for (size_t i = 0; i != size; i++) { + if (!internal::ArrayEq(lhs[i], rhs[i])) + return false; + } + return true; +} + +// Finds the first element in the iterator range [begin, end) that +// equals elem. Element may be a native array type itself. +template +Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { + for (Iter it = begin; it != end; ++it) { + if (internal::ArrayEq(*it, elem)) + return it; + } + return end; +} + +// CopyArray() copies a k-dimensional native array using the elements' +// operator=, where k can be any integer >= 0. When k is 0, +// CopyArray() degenerates into copying a single value. + +template +void CopyArray(const T* from, size_t size, U* to); + +// This generic version is used when k is 0. +template +inline void CopyArray(const T& from, U* to) { *to = from; } + +// This overload is used when k >= 1. +template +inline void CopyArray(const T(&from)[N], U(*to)[N]) { + internal::CopyArray(from, N, *to); +} + +// This helper reduces code bloat. If we instead put its logic inside +// the previous CopyArray() function, arrays with different sizes +// would lead to different copies of the template code. +template +void CopyArray(const T* from, size_t size, U* to) { + for (size_t i = 0; i != size; i++) { + internal::CopyArray(from[i], to + i); + } +} + +// The relation between an NativeArray object (see below) and the +// native array it represents. +enum RelationToSource { + kReference, // The NativeArray references the native array. + kCopy // The NativeArray makes a copy of the native array and + // owns the copy. +}; + +// Adapts a native array to a read-only STL-style container. Instead +// of the complete STL container concept, this adaptor only implements +// members useful for Google Mock's container matchers. New members +// should be added as needed. To simplify the implementation, we only +// support Element being a raw type (i.e. having no top-level const or +// reference modifier). It's the client's responsibility to satisfy +// this requirement. Element can be an array type itself (hence +// multi-dimensional arrays are supported). +template +class NativeArray { + public: + // STL-style container typedefs. + typedef Element value_type; + typedef Element* iterator; + typedef const Element* const_iterator; + + // Constructs from a native array. + NativeArray(const Element* array, size_t count, RelationToSource relation) { + Init(array, count, relation); + } + + // Copy constructor. + NativeArray(const NativeArray& rhs) { + Init(rhs.array_, rhs.size_, rhs.relation_to_source_); + } + + ~NativeArray() { + // Ensures that the user doesn't instantiate NativeArray with a + // const or reference type. + static_cast(StaticAssertTypeEqHelper()); + if (relation_to_source_ == kCopy) + delete[] array_; + } + + // STL-style container methods. + size_t size() const { return size_; } + const_iterator begin() const { return array_; } + const_iterator end() const { return array_ + size_; } + bool operator==(const NativeArray& rhs) const { + return size() == rhs.size() && + ArrayEq(begin(), size(), rhs.begin()); + } + + private: + // Initializes this object; makes a copy of the input array if + // 'relation' is kCopy. + void Init(const Element* array, size_t a_size, RelationToSource relation) { + if (relation == kReference) { + array_ = array; + } else { + Element* const copy = new Element[a_size]; + CopyArray(array, a_size, copy); + array_ = copy; + } + size_ = a_size; + relation_to_source_ = relation; + } + + const Element* array_; + size_t size_; + RelationToSource relation_to_source_; + + GTEST_DISALLOW_ASSIGN_(NativeArray); +}; + + +#if GTEST_HAS_EXCEPTIONS +//add by qiaoyang,增加强制置成功的用例抛出的异常类 +class GoogleTestSuccessException { +public: + explicit GoogleTestSuccessException(const char *str) :strmsg(str){} +private: + string strmsg; +}; +#endif + +} // namespace internal +} // namespace testing + +#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ + ::testing::internal::AssertHelper(result_type, file, line, message) \ + = ::testing::Message() + +#define GTEST_MESSAGE_(message, result_type) \ + GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) + +//#define GTEST_FATAL_FAILURE_(message) +// return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) +//modify by autostar +//修改为直接抛异常出来,这样直接就从用例执行中退出,异常类型直接用0,不用宏,避免包含h文件的问题 +#define GTEST_FATAL_FAILURE_(message) \ +{\ + GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure);\ + if (::testing::g_set_throw_effect)\ + throw 0;\ +} + +#define GTEST_NONFATAL_FAILURE_(message) \ + GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) + +#define GTEST_SUCCESS_(message) \ + GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) + +//add by qiaoyang 强制置用例成功,直接返回 +#define GTEST_FATAL_SUCCESS_(message) \ + GTEST_MESSAGE_(message, ::testing::TestPartResult::kFouceSuccess);\ + if (::testing::g_set_throw_effect)\ + throw ::testing::internal::GoogleTestSuccessException("Fouce Succeed!");\ +// Suppresses MSVC warnings 4072 (unreachable code) for the code following +// statement if it returns or throws (or doesn't return or throw in some +// situations). +#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ + if (::testing::internal::AlwaysTrue()) { statement; } + +#define GTEST_TEST_THROW_(statement, expected_exception, fail) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::ConstCharPtr gtest_msg = "") { \ + bool gtest_caught_expected = false; \ + try { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } \ + catch (expected_exception const&) { \ + gtest_caught_expected = true; \ + } \ + catch (...) { \ + gtest_msg.value = \ + "Expected: " #statement " throws an exception of type " \ + #expected_exception ".\n Actual: it throws a different type."; \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ + } \ + if (!gtest_caught_expected) { \ + gtest_msg.value = \ + "Expected: " #statement " throws an exception of type " \ + #expected_exception ".\n Actual: it throws nothing."; \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ + } \ + } else \ + GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ + fail(gtest_msg.value) + +#define GTEST_TEST_NO_THROW_(statement, fail) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + try { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } \ + catch (...) { \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ + } \ + } else \ + GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ + fail("Expected: " #statement " doesn't throw an exception.\n" \ + " Actual: it throws.") + +#define GTEST_TEST_ANY_THROW_(statement, fail) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + bool gtest_caught_any = false; \ + try { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } \ + catch (...) { \ + gtest_caught_any = true; \ + } \ + if (!gtest_caught_any) { \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ + } \ + } else \ + GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ + fail("Expected: " #statement " throws an exception.\n" \ + " Actual: it doesn't.") + + +// Implements Boolean test assertions such as EXPECT_TRUE. expression can be +// either a boolean expression or an AssertionResult. text is a textual +// represenation of expression as it was passed into the EXPECT_TRUE. +#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (const ::testing::AssertionResult gtest_ar_ = \ + ::testing::AssertionResult(expression)) \ + ; \ + else \ + fail(::testing::internal::GetBoolAssertionFailureMessage(\ + gtest_ar_, text, #actual, #expected).c_str()) + +#define GTEST_TEST_BOOLEAN2_(expression, text, actual, expected, fail) \ +{ \ + ::testing::styleCheck::tick(); \ +} \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if(++gtest_assert_count_) \ + if (const ::testing::AssertionResult gtest_ar_ = \ + ::testing::AssertionResult(expression)) \ + ; \ + else \ + fail(::testing::internal::GetBoolAssertionFailureMessage(\ + gtest_ar_, text, #actual, #expected).c_str()) + +#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ + } \ + } else \ + GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ + fail("Expected: " #statement " doesn't generate new fatal " \ + "failures in the current thread.\n" \ + " Actual: it does.") + +// Expands to the name of the class that implements the given test. +#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ + test_case_name##_##test_name##_Test + +// Helper macro for defining tests. +//autostar修改,增加 __FILE__ __LINE__宏 +#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id, ...)\ +class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ + public:\ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ + private:\ + virtual void TestBody();\ + static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ + GTEST_DISALLOW_COPY_AND_ASSIGN_(\ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ +};\ +\ +::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ + ::test_info_ =\ + ::testing::internal::MakeAndRegisterTestInfo(\ + #test_case_name, #test_name, NULL, NULL, \ + (parent_id), \ + parent_class::SetUpTestCase, \ + parent_class::TearDownTestCase, \ + new ::testing::internal::TestFactoryImpl<\ + GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>,\ + __FILE__, __LINE__, ##__VA_ARGS__);\ +void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ diff --git a/cli/test/include/gtest/internal/gtest-linked_ptr.h b/cli/test/include/gtest/internal/gtest-linked_ptr.h new file mode 100644 index 0000000..57147b4 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-linked_ptr.h @@ -0,0 +1,233 @@ +// Copyright 2003 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Dan Egnor (egnor@google.com) +// +// A "smart" pointer type with reference tracking. Every pointer to a +// particular object is kept on a circular linked list. When the last pointer +// to an object is destroyed or reassigned, the object is deleted. +// +// Used properly, this deletes the object when the last reference goes away. +// There are several caveats: +// - Like all reference counting schemes, cycles lead to leaks. +// - Each smart pointer is actually two pointers (8 bytes instead of 4). +// - Every time a pointer is assigned, the entire list of pointers to that +// object is traversed. This class is therefore NOT SUITABLE when there +// will often be more than two or three pointers to a particular object. +// - References are only tracked as long as linked_ptr<> objects are copied. +// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS +// will happen (double deletion). +// +// A good use of this class is storing object references in STL containers. +// You can safely put linked_ptr<> in a vector<>. +// Other uses may not be as good. +// +// Note: If you use an incomplete type with linked_ptr<>, the class +// *containing* linked_ptr<> must have a constructor and destructor (even +// if they do nothing!). +// +// Bill Gibbons suggested we use something like this. +// +// Thread Safety: +// Unlike other linked_ptr implementations, in this implementation +// a linked_ptr object is thread-safe in the sense that: +// - it's safe to copy linked_ptr objects concurrently, +// - it's safe to copy *from* a linked_ptr and read its underlying +// raw pointer (e.g. via get()) concurrently, and +// - it's safe to write to two linked_ptrs that point to the same +// shared object concurrently. +// TODO(wan@google.com): rename this to safe_linked_ptr to avoid +// confusion with normal linked_ptr. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ + +#include +#include + +#include "gtest/internal/gtest-port.h" + +namespace testing { +namespace internal { + +// Protects copying of all linked_ptr objects. +GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); + +// This is used internally by all instances of linked_ptr<>. It needs to be +// a non-template class because different types of linked_ptr<> can refer to +// the same object (linked_ptr(obj) vs linked_ptr(obj)). +// So, it needs to be possible for different types of linked_ptr to participate +// in the same circular linked list, so we need a single class type here. +// +// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr. +class linked_ptr_internal { + public: + // Create a new circle that includes only this instance. + void join_new() { + next_ = this; + } + + // Many linked_ptr operations may change p.link_ for some linked_ptr + // variable p in the same circle as this object. Therefore we need + // to prevent two such operations from occurring concurrently. + // + // Note that different types of linked_ptr objects can coexist in a + // circle (e.g. linked_ptr, linked_ptr, and + // linked_ptr). Therefore we must use a single mutex to + // protect all linked_ptr objects. This can create serious + // contention in production code, but is acceptable in a testing + // framework. + + // Join an existing circle. + // L < g_linked_ptr_mutex + void join(linked_ptr_internal const* ptr) { + MutexLock lock(&g_linked_ptr_mutex); + + linked_ptr_internal const* p = ptr; + while (p->next_ != ptr) p = p->next_; + p->next_ = this; + next_ = ptr; + } + + // Leave whatever circle we're part of. Returns true if we were the + // last member of the circle. Once this is done, you can join() another. + // L < g_linked_ptr_mutex + bool depart() { + MutexLock lock(&g_linked_ptr_mutex); + + if (next_ == this) return true; + linked_ptr_internal const* p = next_; + while (p->next_ != this) p = p->next_; + p->next_ = next_; + return false; + } + + private: + mutable linked_ptr_internal const* next_; +}; + +template +class linked_ptr { + public: + typedef T element_type; + + // Take over ownership of a raw pointer. This should happen as soon as + // possible after the object is created. + explicit linked_ptr(T* ptr = NULL) { capture(ptr); } + ~linked_ptr() { depart(); } + + // Copy an existing linked_ptr<>, adding ourselves to the list of references. + template linked_ptr(linked_ptr const& ptr) { copy(&ptr); } + linked_ptr(linked_ptr const& ptr) { // NOLINT + assert(&ptr != this); + copy(&ptr); + } + + // Assignment releases the old value and acquires the new. + template linked_ptr& operator=(linked_ptr const& ptr) { + depart(); + copy(&ptr); + return *this; + } + + linked_ptr& operator=(linked_ptr const& ptr) { + if (&ptr != this) { + depart(); + copy(&ptr); + } + return *this; + } + + // Smart pointer members. + void reset(T* ptr = NULL) { + depart(); + capture(ptr); + } + T* get() const { return value_; } + T* operator->() const { return value_; } + T& operator*() const { return *value_; } + + bool operator==(T* p) const { return value_ == p; } + bool operator!=(T* p) const { return value_ != p; } + template + bool operator==(linked_ptr const& ptr) const { + return value_ == ptr.get(); + } + template + bool operator!=(linked_ptr const& ptr) const { + return value_ != ptr.get(); + } + + private: + template + friend class linked_ptr; + + T* value_; + linked_ptr_internal link_; + + void depart() { + if (link_.depart()) delete value_; + } + + void capture(T* ptr) { + value_ = ptr; + link_.join_new(); + } + + template void copy(linked_ptr const* ptr) { + value_ = ptr->get(); + if (value_) + link_.join(&ptr->link_); + else + link_.join_new(); + } +}; + +template inline +bool operator==(T* ptr, const linked_ptr& x) { + return ptr == x.get(); +} + +template inline +bool operator!=(T* ptr, const linked_ptr& x) { + return ptr != x.get(); +} + +// A function to convert T* into linked_ptr +// Doing e.g. make_linked_ptr(new FooBarBaz(arg)) is a shorter notation +// for linked_ptr >(new FooBarBaz(arg)) +template +linked_ptr make_linked_ptr(T* ptr) { + return linked_ptr(ptr); +} + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util-generated.h b/cli/test/include/gtest/internal/gtest-param-util-generated.h new file mode 100644 index 0000000..2582675 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-param-util-generated.h @@ -0,0 +1,4822 @@ +// This file was GENERATED by command: +// pump.py gtest-param-util-generated.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: vladl@google.com (Vlad Losev) + +// Type and function utilities for implementing parameterized tests. +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +// Currently Google Test supports at most 50 arguments in Values, +// and at most 10 arguments in Combine. Please contact +// googletestframework@googlegroups.com if you need more. +// Please note that the number of arguments to Combine is limited +// by the maximum arity of the implementation of tr1::tuple which is +// currently set at 10. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ + +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include "gtest/internal/gtest-param-util.h" +#include "gtest/internal/gtest-port.h" + +#if GTEST_HAS_PARAM_TEST + +namespace testing { + +// Forward declarations of ValuesIn(), which is implemented in +// include/gtest/gtest-param-test.h. +template +internal::ParamGenerator< + typename ::testing::internal::IteratorTraits::value_type> +ValuesIn(ForwardIterator begin, ForwardIterator end); + +template +internal::ParamGenerator ValuesIn(const T (&array)[N]); + +template +internal::ParamGenerator ValuesIn( + const Container& container); + +namespace internal { + +// Used in the Values() function to provide polymorphic capabilities. +template +class ValueArray1 { + public: + explicit ValueArray1(T1 v1) : v1_(v1) {} + + template + operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray1& other); + + const T1 v1_; +}; + +template +class ValueArray2 { + public: + ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray2& other); + + const T1 v1_; + const T2 v2_; +}; + +template +class ValueArray3 { + public: + ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray3& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; +}; + +template +class ValueArray4 { + public: + ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray4& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; +}; + +template +class ValueArray5 { + public: + ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray5& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; +}; + +template +class ValueArray6 { + public: + ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray6& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; +}; + +template +class ValueArray7 { + public: + ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray7& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; +}; + +template +class ValueArray8 { + public: + ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray8& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; +}; + +template +class ValueArray9 { + public: + ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, + T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray9& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; +}; + +template +class ValueArray10 { + public: + ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray10& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; +}; + +template +class ValueArray11 { + public: + ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray11& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; +}; + +template +class ValueArray12 { + public: + ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray12& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; +}; + +template +class ValueArray13 { + public: + ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray13& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; +}; + +template +class ValueArray14 { + public: + ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray14& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; +}; + +template +class ValueArray15 { + public: + ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray15& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; +}; + +template +class ValueArray16 { + public: + ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray16& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; +}; + +template +class ValueArray17 { + public: + ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, + T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray17& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; +}; + +template +class ValueArray18 { + public: + ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray18& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; +}; + +template +class ValueArray19 { + public: + ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray19& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; +}; + +template +class ValueArray20 { + public: + ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray20& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; +}; + +template +class ValueArray21 { + public: + ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray21& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; +}; + +template +class ValueArray22 { + public: + ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray22& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; +}; + +template +class ValueArray23 { + public: + ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, + v23_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray23& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; +}; + +template +class ValueArray24 { + public: + ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray24& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; +}; + +template +class ValueArray25 { + public: + ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, + T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray25& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; +}; + +template +class ValueArray26 { + public: + ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray26& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; +}; + +template +class ValueArray27 { + public: + ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray27& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; +}; + +template +class ValueArray28 { + public: + ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray28& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; +}; + +template +class ValueArray29 { + public: + ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray29& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; +}; + +template +class ValueArray30 { + public: + ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray30& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; +}; + +template +class ValueArray31 { + public: + ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray31& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; +}; + +template +class ValueArray32 { + public: + ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray32& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; +}; + +template +class ValueArray33 { + public: + ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, + T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray33& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; +}; + +template +class ValueArray34 { + public: + ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray34& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; +}; + +template +class ValueArray35 { + public: + ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), + v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, + v35_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray35& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; +}; + +template +class ValueArray36 { + public: + ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), + v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray36& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; +}; + +template +class ValueArray37 { + public: + ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), + v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), + v36_(v36), v37_(v37) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray37& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; +}; + +template +class ValueArray38 { + public: + ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray38& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; +}; + +template +class ValueArray39 { + public: + ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray39& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; +}; + +template +class ValueArray40 { + public: + ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), + v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), + v40_(v40) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray40& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; +}; + +template +class ValueArray41 { + public: + ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, + T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray41& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; +}; + +template +class ValueArray42 { + public: + ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray42& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; +}; + +template +class ValueArray43 { + public: + ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), + v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), + v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray43& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; +}; + +template +class ValueArray44 { + public: + ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), + v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), + v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), + v43_(v43), v44_(v44) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray44& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; +}; + +template +class ValueArray45 { + public: + ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), + v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), + v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), + v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray45& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; +}; + +template +class ValueArray46 { + public: + ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), + v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray46& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; +}; + +template +class ValueArray47 { + public: + ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), + v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), + v47_(v47) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, + v47_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray47& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; +}; + +template +class ValueArray48 { + public: + ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), + v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), + v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), + v46_(v46), v47_(v47), v48_(v48) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, + v48_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray48& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; +}; + +template +class ValueArray49 { + public: + ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, + T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), + v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, + v48_, v49_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray49& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; + const T49 v49_; +}; + +template +class ValueArray50 { + public: + ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, + T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), + v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} + + template + operator ParamGenerator() const { + const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, + v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, + v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, + v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, + v48_, v49_, v50_}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray50& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; + const T49 v49_; + const T50 v50_; +}; + +# if GTEST_HAS_COMBINE +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Generates values from the Cartesian product of values produced +// by the argument generators. +// +template +class CartesianProductGenerator2 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator2(const ParamGenerator& g1, + const ParamGenerator& g2) + : g1_(g1), g2_(g2) {} + virtual ~CartesianProductGenerator2() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current2_; + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + ParamType current_value_; + }; // class CartesianProductGenerator2::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator2& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; +}; // class CartesianProductGenerator2 + + +template +class CartesianProductGenerator3 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator3(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3) + : g1_(g1), g2_(g2), g3_(g3) {} + virtual ~CartesianProductGenerator3() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current3_; + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + ParamType current_value_; + }; // class CartesianProductGenerator3::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator3& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; +}; // class CartesianProductGenerator3 + + +template +class CartesianProductGenerator4 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator4(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} + virtual ~CartesianProductGenerator4() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current4_; + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + ParamType current_value_; + }; // class CartesianProductGenerator4::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator4& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; +}; // class CartesianProductGenerator4 + + +template +class CartesianProductGenerator5 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator5(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} + virtual ~CartesianProductGenerator5() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current5_; + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + ParamType current_value_; + }; // class CartesianProductGenerator5::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator5& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; +}; // class CartesianProductGenerator5 + + +template +class CartesianProductGenerator6 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator6(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} + virtual ~CartesianProductGenerator6() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current6_; + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + ParamType current_value_; + }; // class CartesianProductGenerator6::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator6& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; +}; // class CartesianProductGenerator6 + + +template +class CartesianProductGenerator7 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator7(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} + virtual ~CartesianProductGenerator7() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current7_; + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + ParamType current_value_; + }; // class CartesianProductGenerator7::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator7& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; +}; // class CartesianProductGenerator7 + + +template +class CartesianProductGenerator8 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator8(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), + g8_(g8) {} + virtual ~CartesianProductGenerator8() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current8_; + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + ParamType current_value_; + }; // class CartesianProductGenerator8::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator8& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; +}; // class CartesianProductGenerator8 + + +template +class CartesianProductGenerator9 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator9(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8, const ParamGenerator& g9) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9) {} + virtual ~CartesianProductGenerator9() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end(), g9_, g9_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8, + const ParamGenerator& g9, + const typename ParamGenerator::iterator& current9) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8), + begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current9_; + if (current9_ == end9_) { + current9_ = begin9_; + ++current8_; + } + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_ && + current9_ == typed_other->current9_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_), + begin9_(other.begin9_), + end9_(other.end9_), + current9_(other.current9_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_, + *current9_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_ || + current9_ == end9_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + const typename ParamGenerator::iterator begin9_; + const typename ParamGenerator::iterator end9_; + typename ParamGenerator::iterator current9_; + ParamType current_value_; + }; // class CartesianProductGenerator9::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator9& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; + const ParamGenerator g9_; +}; // class CartesianProductGenerator9 + + +template +class CartesianProductGenerator10 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator10(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8, const ParamGenerator& g9, + const ParamGenerator& g10) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9), g10_(g10) {} + virtual ~CartesianProductGenerator10() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end(), g9_, g9_.end(), g10_, g10_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8, + const ParamGenerator& g9, + const typename ParamGenerator::iterator& current9, + const ParamGenerator& g10, + const typename ParamGenerator::iterator& current10) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8), + begin9_(g9.begin()), end9_(g9.end()), current9_(current9), + begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current10_; + if (current10_ == end10_) { + current10_ = begin10_; + ++current9_; + } + if (current9_ == end9_) { + current9_ = begin9_; + ++current8_; + } + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_ && + current9_ == typed_other->current9_ && + current10_ == typed_other->current10_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_), + begin9_(other.begin9_), + end9_(other.end9_), + current9_(other.current9_), + begin10_(other.begin10_), + end10_(other.end10_), + current10_(other.current10_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_, + *current9_, *current10_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_ || + current9_ == end9_ || + current10_ == end10_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + const typename ParamGenerator::iterator begin9_; + const typename ParamGenerator::iterator end9_; + typename ParamGenerator::iterator current9_; + const typename ParamGenerator::iterator begin10_; + const typename ParamGenerator::iterator end10_; + typename ParamGenerator::iterator current10_; + ParamType current_value_; + }; // class CartesianProductGenerator10::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator10& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; + const ParamGenerator g9_; + const ParamGenerator g10_; +}; // class CartesianProductGenerator10 + + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Helper classes providing Combine() with polymorphic features. They allow +// casting CartesianProductGeneratorN to ParamGenerator if T is +// convertible to U. +// +template +class CartesianProductHolder2 { + public: +CartesianProductHolder2(const Generator1& g1, const Generator2& g2) + : g1_(g1), g2_(g2) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator2( + static_cast >(g1_), + static_cast >(g2_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder2& other); + + const Generator1 g1_; + const Generator2 g2_; +}; // class CartesianProductHolder2 + +template +class CartesianProductHolder3 { + public: +CartesianProductHolder3(const Generator1& g1, const Generator2& g2, + const Generator3& g3) + : g1_(g1), g2_(g2), g3_(g3) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator3( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder3& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; +}; // class CartesianProductHolder3 + +template +class CartesianProductHolder4 { + public: +CartesianProductHolder4(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator4( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder4& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; +}; // class CartesianProductHolder4 + +template +class CartesianProductHolder5 { + public: +CartesianProductHolder5(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator5( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder5& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; +}; // class CartesianProductHolder5 + +template +class CartesianProductHolder6 { + public: +CartesianProductHolder6(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator6( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder6& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; +}; // class CartesianProductHolder6 + +template +class CartesianProductHolder7 { + public: +CartesianProductHolder7(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator7( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder7& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; +}; // class CartesianProductHolder7 + +template +class CartesianProductHolder8 { + public: +CartesianProductHolder8(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), + g8_(g8) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator8( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder8& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; +}; // class CartesianProductHolder8 + +template +class CartesianProductHolder9 { + public: +CartesianProductHolder9(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8, + const Generator9& g9) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator9( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_), + static_cast >(g9_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder9& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; + const Generator9 g9_; +}; // class CartesianProductHolder9 + +template +class CartesianProductHolder10 { + public: +CartesianProductHolder10(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8, + const Generator9& g9, const Generator10& g10) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9), g10_(g10) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator10( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_), + static_cast >(g9_), + static_cast >(g10_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder10& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; + const Generator9 g9_; + const Generator10 g10_; +}; // class CartesianProductHolder10 + +# endif // GTEST_HAS_COMBINE + +} // namespace internal +} // namespace testing + +#endif // GTEST_HAS_PARAM_TEST + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump b/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump new file mode 100644 index 0000000..dbe9386 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump @@ -0,0 +1,301 @@ +$$ -*- mode: c++; -*- +$var n = 50 $$ Maximum length of Values arguments we want to support. +$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: vladl@google.com (Vlad Losev) + +// Type and function utilities for implementing parameterized tests. +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +// Currently Google Test supports at most $n arguments in Values, +// and at most $maxtuple arguments in Combine. Please contact +// googletestframework@googlegroups.com if you need more. +// Please note that the number of arguments to Combine is limited +// by the maximum arity of the implementation of tr1::tuple which is +// currently set at $maxtuple. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ + +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include "gtest/internal/gtest-param-util.h" +#include "gtest/internal/gtest-port.h" + +#if GTEST_HAS_PARAM_TEST + +namespace testing { + +// Forward declarations of ValuesIn(), which is implemented in +// include/gtest/gtest-param-test.h. +template +internal::ParamGenerator< + typename ::testing::internal::IteratorTraits::value_type> +ValuesIn(ForwardIterator begin, ForwardIterator end); + +template +internal::ParamGenerator ValuesIn(const T (&array)[N]); + +template +internal::ParamGenerator ValuesIn( + const Container& container); + +namespace internal { + +// Used in the Values() function to provide polymorphic capabilities. +template +class ValueArray1 { + public: + explicit ValueArray1(T1 v1) : v1_(v1) {} + + template + operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray1& other); + + const T1 v1_; +}; + +$range i 2..n +$for i [[ +$range j 1..i + +template <$for j, [[typename T$j]]> +class ValueArray$i { + public: + ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {} + + template + operator ParamGenerator() const { + const T array[] = {$for j, [[v$(j)_]]}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray$i& other); + +$for j [[ + + const T$j v$(j)_; +]] + +}; + +]] + +# if GTEST_HAS_COMBINE +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Generates values from the Cartesian product of values produced +// by the argument generators. +// +$range i 2..maxtuple +$for i [[ +$range j 1..i +$range k 2..i + +template <$for j, [[typename T$j]]> +class CartesianProductGenerator$i + : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > { + public: + typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType; + + CartesianProductGenerator$i($for j, [[const ParamGenerator& g$j]]) + : $for j, [[g$(j)_(g$j)]] {} + virtual ~CartesianProductGenerator$i() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, $for j, [[ + + const ParamGenerator& g$j, + const typename ParamGenerator::iterator& current$(j)]]) + : base_(base), +$for j, [[ + + begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j) +]] { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current$(i)_; + +$for k [[ + if (current$(i+2-k)_ == end$(i+2-k)_) { + current$(i+2-k)_ = begin$(i+2-k)_; + ++current$(i+2-k-1)_; + } + +]] + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ($for j && [[ + + current$(j)_ == typed_other->current$(j)_ +]]); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), $for j, [[ + + begin$(j)_(other.begin$(j)_), + end$(j)_(other.end$(j)_), + current$(j)_(other.current$(j)_) +]] { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType($for j, [[*current$(j)_]]); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return +$for j || [[ + + current$(j)_ == end$(j)_ +]]; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. +$for j [[ + + const typename ParamGenerator::iterator begin$(j)_; + const typename ParamGenerator::iterator end$(j)_; + typename ParamGenerator::iterator current$(j)_; +]] + + ParamType current_value_; + }; // class CartesianProductGenerator$i::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator$i& other); + + +$for j [[ + const ParamGenerator g$(j)_; + +]] +}; // class CartesianProductGenerator$i + + +]] + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Helper classes providing Combine() with polymorphic features. They allow +// casting CartesianProductGeneratorN to ParamGenerator if T is +// convertible to U. +// +$range i 2..maxtuple +$for i [[ +$range j 1..i + +template <$for j, [[class Generator$j]]> +class CartesianProductHolder$i { + public: +CartesianProductHolder$i($for j, [[const Generator$j& g$j]]) + : $for j, [[g$(j)_(g$j)]] {} + template <$for j, [[typename T$j]]> + operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const { + return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >( + new CartesianProductGenerator$i<$for j, [[T$j]]>( +$for j,[[ + + static_cast >(g$(j)_) +]])); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder$i& other); + + +$for j [[ + const Generator$j g$(j)_; + +]] +}; // class CartesianProductHolder$i + +]] + +# endif // GTEST_HAS_COMBINE + +} // namespace internal +} // namespace testing + +#endif // GTEST_HAS_PARAM_TEST + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util.h b/cli/test/include/gtest/internal/gtest-param-util.h new file mode 100644 index 0000000..17af47f --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-param-util.h @@ -0,0 +1,628 @@ +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: vladl@google.com (Vlad Losev) + +// Type and function utilities for implementing parameterized tests. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ + +#include +#include +#include + +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-linked_ptr.h" +#include "gtest/internal/gtest-port.h" +#include "gtest/gtest-printers.h" + +#if GTEST_HAS_PARAM_TEST + +namespace testing { +namespace internal { + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Outputs a message explaining invalid registration of different +// fixture class for the same test case. This may happen when +// TEST_P macro is used to define two tests with the same name +// but in different namespaces. +GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, + const char* file, int line); + +template class ParamGeneratorInterface; +template class ParamGenerator; + +// Interface for iterating over elements provided by an implementation +// of ParamGeneratorInterface. +template +class ParamIteratorInterface { + public: + virtual ~ParamIteratorInterface() {} + // A pointer to the base generator instance. + // Used only for the purposes of iterator comparison + // to make sure that two iterators belong to the same generator. + virtual const ParamGeneratorInterface* BaseGenerator() const = 0; + // Advances iterator to point to the next element + // provided by the generator. The caller is responsible + // for not calling Advance() on an iterator equal to + // BaseGenerator()->End(). + virtual void Advance() = 0; + // Clones the iterator object. Used for implementing copy semantics + // of ParamIterator. + virtual ParamIteratorInterface* Clone() const = 0; + // Dereferences the current iterator and provides (read-only) access + // to the pointed value. It is the caller's responsibility not to call + // Current() on an iterator equal to BaseGenerator()->End(). + // Used for implementing ParamGenerator::operator*(). + virtual const T* Current() const = 0; + // Determines whether the given iterator and other point to the same + // element in the sequence generated by the generator. + // Used for implementing ParamGenerator::operator==(). + virtual bool Equals(const ParamIteratorInterface& other) const = 0; +}; + +// Class iterating over elements provided by an implementation of +// ParamGeneratorInterface. It wraps ParamIteratorInterface +// and implements the const forward iterator concept. +template +class ParamIterator { + public: + typedef T value_type; + typedef const T& reference; + typedef ptrdiff_t difference_type; + + // ParamIterator assumes ownership of the impl_ pointer. + ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} + ParamIterator& operator=(const ParamIterator& other) { + if (this != &other) + impl_.reset(other.impl_->Clone()); + return *this; + } + + const T& operator*() const { return *impl_->Current(); } + const T* operator->() const { return impl_->Current(); } + // Prefix version of operator++. + ParamIterator& operator++() { + impl_->Advance(); + return *this; + } + // Postfix version of operator++. + ParamIterator operator++(int /*unused*/) { + ParamIteratorInterface* clone = impl_->Clone(); + impl_->Advance(); + return ParamIterator(clone); + } + bool operator==(const ParamIterator& other) const { + return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); + } + bool operator!=(const ParamIterator& other) const { + return !(*this == other); + } + + private: + friend class ParamGenerator; + explicit ParamIterator(ParamIteratorInterface* impl) : impl_(impl) {} + scoped_ptr > impl_; +}; + +// ParamGeneratorInterface is the binary interface to access generators +// defined in other translation units. +template +class ParamGeneratorInterface { + public: + typedef T ParamType; + + virtual ~ParamGeneratorInterface() {} + + // Generator interface definition + virtual ParamIteratorInterface* Begin() const = 0; + virtual ParamIteratorInterface* End() const = 0; +}; + +// Wraps ParamGeneratorInterface and provides general generator syntax +// compatible with the STL Container concept. +// This class implements copy initialization semantics and the contained +// ParamGeneratorInterface instance is shared among all copies +// of the original object. This is possible because that instance is immutable. +template +class ParamGenerator { + public: + typedef ParamIterator iterator; + + explicit ParamGenerator(ParamGeneratorInterface* impl) : impl_(impl) {} + ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} + + ParamGenerator& operator=(const ParamGenerator& other) { + impl_ = other.impl_; + return *this; + } + + iterator begin() const { return iterator(impl_->Begin()); } + iterator end() const { return iterator(impl_->End()); } + + private: + linked_ptr > impl_; +}; + +// Generates values from a range of two comparable values. Can be used to +// generate sequences of user-defined types that implement operator+() and +// operator<(). +// This class is used in the Range() function. +template +class RangeGenerator : public ParamGeneratorInterface { + public: + RangeGenerator(T begin, T end, IncrementT step) + : begin_(begin), end_(end), + step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} + virtual ~RangeGenerator() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, begin_, 0, step_); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, end_, end_index_, step_); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, T value, int index, + IncrementT step) + : base_(base), value_(value), index_(index), step_(step) {} + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + virtual void Advance() { + value_ = value_ + step_; + index_++; + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const T* Current() const { return &value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const int other_index = + CheckedDowncastToActualType(&other)->index_; + return index_ == other_index; + } + + private: + Iterator(const Iterator& other) + : ParamIteratorInterface(), + base_(other.base_), value_(other.value_), index_(other.index_), + step_(other.step_) {} + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + T value_; + int index_; + const IncrementT step_; + }; // class RangeGenerator::Iterator + + static int CalculateEndIndex(const T& begin, + const T& end, + const IncrementT& step) { + int end_index = 0; + for (T i = begin; i < end; i = i + step) + end_index++; + return end_index; + } + + // No implementation - assignment is unsupported. + void operator=(const RangeGenerator& other); + + const T begin_; + const T end_; + const IncrementT step_; + // The index for the end() iterator. All the elements in the generated + // sequence are indexed (0-based) to aid iterator comparison. + const int end_index_; +}; // class RangeGenerator + + +// Generates values from a pair of STL-style iterators. Used in the +// ValuesIn() function. The elements are copied from the source range +// since the source can be located on the stack, and the generator +// is likely to persist beyond that stack frame. +template +class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { + public: + template + ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) + : container_(begin, end) {} + virtual ~ValuesInIteratorRangeGenerator() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, container_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, container_.end()); + } + + private: + typedef typename ::std::vector ContainerType; + + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + typename ContainerType::const_iterator iterator) + : base_(base), iterator_(iterator) {} + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + virtual void Advance() { + ++iterator_; + value_.reset(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + // We need to use cached value referenced by iterator_ because *iterator_ + // can return a temporary object (and of type other then T), so just + // having "return &*iterator_;" doesn't work. + // value_ is updated here and not in Advance() because Advance() + // can advance iterator_ beyond the end of the range, and we cannot + // detect that fact. The client code, on the other hand, is + // responsible for not calling Current() on an out-of-range iterator. + virtual const T* Current() const { + if (value_.get() == NULL) + value_.reset(new T(*iterator_)); + return value_.get(); + } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + return iterator_ == + CheckedDowncastToActualType(&other)->iterator_; + } + + private: + Iterator(const Iterator& other) + // The explicit constructor call suppresses a false warning + // emitted by gcc when supplied with the -Wextra option. + : ParamIteratorInterface(), + base_(other.base_), + iterator_(other.iterator_) {} + + const ParamGeneratorInterface* const base_; + typename ContainerType::const_iterator iterator_; + // A cached value of *iterator_. We keep it here to allow access by + // pointer in the wrapping iterator's operator->(). + // value_ needs to be mutable to be accessed in Current(). + // Use of scoped_ptr helps manage cached value's lifetime, + // which is bound by the lifespan of the iterator itself. + mutable scoped_ptr value_; + }; // class ValuesInIteratorRangeGenerator::Iterator + + // No implementation - assignment is unsupported. + void operator=(const ValuesInIteratorRangeGenerator& other); + + const ContainerType container_; +}; // class ValuesInIteratorRangeGenerator + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Stores a parameter value and later creates tests parameterized with that +// value. +template +class ParameterizedTestFactory : public TestFactoryBase { + public: + typedef typename TestClass::ParamType ParamType; + explicit ParameterizedTestFactory(ParamType parameter) : + parameter_(parameter) {} + virtual Test* CreateTest() { + TestClass::SetParam(¶meter_); + return new TestClass(); + } + + private: + const ParamType parameter_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); +}; + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// TestMetaFactoryBase is a base class for meta-factories that create +// test factories for passing into MakeAndRegisterTestInfo function. +template +class TestMetaFactoryBase { + public: + virtual ~TestMetaFactoryBase() {} + + virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; +}; + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// TestMetaFactory creates test factories for passing into +// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives +// ownership of test factory pointer, same factory object cannot be passed +// into that method twice. But ParameterizedTestCaseInfo is going to call +// it for each Test/Parameter value combination. Thus it needs meta factory +// creator class. +template +class TestMetaFactory + : public TestMetaFactoryBase { + public: + typedef typename TestCase::ParamType ParamType; + + TestMetaFactory() {} + + virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { + return new ParameterizedTestFactory(parameter); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); +}; + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// ParameterizedTestCaseInfoBase is a generic interface +// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase +// accumulates test information provided by TEST_P macro invocations +// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations +// and uses that information to register all resulting test instances +// in RegisterTests method. The ParameterizeTestCaseRegistry class holds +// a collection of pointers to the ParameterizedTestCaseInfo objects +// and calls RegisterTests() on each of them when asked. +class ParameterizedTestCaseInfoBase { + public: + virtual ~ParameterizedTestCaseInfoBase() {} + + // Base part of test case name for display purposes. + virtual const string& GetTestCaseName() const = 0; + // Test case id to verify identity. + virtual TypeId GetTestCaseTypeId() const = 0; + // UnitTest class invokes this method to register tests in this + // test case right before running them in RUN_ALL_TESTS macro. + // This method should not be called more then once on any single + // instance of a ParameterizedTestCaseInfoBase derived class. + virtual void RegisterTests() = 0; + + protected: + ParameterizedTestCaseInfoBase() {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); +}; + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P +// macro invocations for a particular test case and generators +// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that +// test case. It registers tests with all values generated by all +// generators when asked. +template +class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { + public: + // ParamType and GeneratorCreationFunc are private types but are required + // for declarations of public methods AddTestPattern() and + // AddTestCaseInstantiation(). + typedef typename TestCase::ParamType ParamType; + // A function that returns an instance of appropriate generator type. + typedef ParamGenerator(GeneratorCreationFunc)(); + + explicit ParameterizedTestCaseInfo(const char* name) + : test_case_name_(name) {} + + // Test case base name for display purposes. + virtual const string& GetTestCaseName() const { return test_case_name_; } + // Test case id to verify identity. + virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); } + // TEST_P macro uses AddTestPattern() to record information + // about a single test in a LocalTestInfo structure. + // test_case_name is the base name of the test case (without invocation + // prefix). test_base_name is the name of an individual test without + // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is + // test case base name and DoBar is test base name. + void AddTestPattern(const char* test_case_name, + const char* test_base_name, + TestMetaFactoryBase* meta_factory) { + tests_.push_back(linked_ptr(new TestInfo(test_case_name, + test_base_name, + meta_factory))); + } + // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information + // about a generator. + int AddTestCaseInstantiation(const string& instantiation_name, + GeneratorCreationFunc* func, + const char* sFilePath/* file */, + int iLine/* line */) { + instantiations_.push_back(::std::make_pair(instantiation_name, func)); + //add by qiaoyang + test_case_p_sfilePath_ = sFilePath; + test_case_p_iLine_ = iLine; + return 0; // Return value used only to run this method in namespace scope. + } + // UnitTest class invokes this method to register tests in this test case + // test cases right before running tests in RUN_ALL_TESTS macro. + // This method should not be called more then once on any single + // instance of a ParameterizedTestCaseInfoBase derived class. + // UnitTest has a guard to prevent from calling this method more then once. + virtual void RegisterTests() { + for (typename TestInfoContainer::iterator test_it = tests_.begin(); + test_it != tests_.end(); ++test_it) { + linked_ptr test_info = *test_it; + for (typename InstantiationContainer::iterator gen_it = + instantiations_.begin(); gen_it != instantiations_.end(); + ++gen_it) { + const string& instantiation_name = gen_it->first; + ParamGenerator generator((*gen_it->second)()); + + Message test_case_name_stream; + if ( !instantiation_name.empty() ) + test_case_name_stream << instantiation_name << "/"; + test_case_name_stream << test_info->test_case_base_name; + + int i = 0; + for (typename ParamGenerator::iterator param_it = + generator.begin(); + param_it != generator.end(); ++param_it, ++i) { + Message test_name_stream; + test_name_stream << test_info->test_base_name << "/" << i; + MakeAndRegisterTestInfo( + test_case_name_stream.GetString().c_str(), + test_name_stream.GetString().c_str(), + NULL, // No type parameter. + PrintToString(*param_it).c_str(), + GetTestCaseTypeId(), + TestCase::SetUpTestCase, + TestCase::TearDownTestCase, + test_info->test_meta_factory->CreateTestFactory(*param_it), +// __FILE__, __LINE__);//autostar增加后两个参数,使用参数化功能 + test_case_p_sfilePath_, test_case_p_iLine_);//autostar增加后两个参数,使用参数化功能 + } // for param_it + } // for gen_it + } // for test_it + } // RegisterTests + + private: + // LocalTestInfo structure keeps information about a single test registered + // with TEST_P macro. + struct TestInfo { + TestInfo(const char* a_test_case_base_name, + const char* a_test_base_name, + TestMetaFactoryBase* a_test_meta_factory) : + test_case_base_name(a_test_case_base_name), + test_base_name(a_test_base_name), + test_meta_factory(a_test_meta_factory) {} + + const string test_case_base_name; + const string test_base_name; + const scoped_ptr > test_meta_factory; + }; + typedef ::std::vector > TestInfoContainer; + // Keeps pairs of + // received from INSTANTIATE_TEST_CASE_P macros. + typedef ::std::vector > + InstantiationContainer; + + const string test_case_name_; + TestInfoContainer tests_; + InstantiationContainer instantiations_; + + //add by qiaoyang + std::string test_case_p_sfilePath_; + int test_case_p_iLine_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); +}; // class ParameterizedTestCaseInfo + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase +// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P +// macros use it to locate their corresponding ParameterizedTestCaseInfo +// descriptors. +class ParameterizedTestCaseRegistry { + public: + ParameterizedTestCaseRegistry() {} + ~ParameterizedTestCaseRegistry() { + for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); + it != test_case_infos_.end(); ++it) { + delete *it; + } + } + + // Looks up or creates and returns a structure containing information about + // tests and instantiations of a particular test case. + template + ParameterizedTestCaseInfo* GetTestCasePatternHolder( + const char* test_case_name, + const char* file, + int line) { + ParameterizedTestCaseInfo* typed_test_info = NULL; + for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); + it != test_case_infos_.end(); ++it) { + if ((*it)->GetTestCaseName() == test_case_name) { + if ((*it)->GetTestCaseTypeId() != GetTypeId()) { + // Complain about incorrect usage of Google Test facilities + // and terminate the program since we cannot guaranty correct + // test case setup and tear-down in this case. + ReportInvalidTestCaseType(test_case_name, file, line); + posix::Abort(); + } else { + // At this point we are sure that the object we found is of the same + // type we are looking for, so we downcast it to that type + // without further checks. + typed_test_info = CheckedDowncastToActualType< + ParameterizedTestCaseInfo >(*it); + } + break; + } + } + if (typed_test_info == NULL) { + typed_test_info = new ParameterizedTestCaseInfo(test_case_name); + test_case_infos_.push_back(typed_test_info); + } + return typed_test_info; + } + void RegisterTests() { + for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); + it != test_case_infos_.end(); ++it) { + (*it)->RegisterTests(); + } + } + + private: + typedef ::std::vector TestCaseInfoContainer; + + TestCaseInfoContainer test_case_infos_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); +}; + +} // namespace internal +} // namespace testing + +#endif // GTEST_HAS_PARAM_TEST + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ diff --git a/cli/test/include/gtest/internal/gtest-port.h b/cli/test/include/gtest/internal/gtest-port.h new file mode 100644 index 0000000..c313915 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-port.h @@ -0,0 +1,1782 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: wan@google.com (Zhanyong Wan) +// +// Low-level types and utilities for porting Google Test to various +// platforms. They are subject to change without notice. DO NOT USE +// THEM IN USER CODE. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ + +// The user can define the following macros in the build script to +// control Google Test's behavior. If the user doesn't define a macro +// in this list, Google Test will define it. +// +// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) +// is/isn't available. +// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions +// are enabled. +// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string +// is/isn't available (some systems define +// ::string, which is different to std::string). +// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string +// is/isn't available (some systems define +// ::wstring, which is different to std::wstring). +// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular +// expressions are/aren't available. +// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that +// is/isn't available. +// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't +// enabled. +// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that +// std::wstring does/doesn't work (Google Test can +// be used where std::wstring is unavailable). +// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple +// is/isn't available. +// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the +// compiler supports Microsoft's "Structured +// Exception Handling". +// GTEST_HAS_STREAM_REDIRECTION +// - Define it to 1/0 to indicate whether the +// platform supports I/O stream redirection using +// dup() and dup2(). +// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google +// Test's own tr1 tuple implementation should be +// used. Unused when the user sets +// GTEST_HAS_TR1_TUPLE to 0. +// GTEST_LINKED_AS_SHARED_LIBRARY +// - Define to 1 when compiling tests that use +// Google Test as a shared library (known as +// DLL on Windows). +// GTEST_CREATE_SHARED_LIBRARY +// - Define to 1 when compiling Google Test itself +// as a shared library. + +// This header defines the following utilities: +// +// Macros indicating the current platform (defined to 1 if compiled on +// the given platform; otherwise undefined): +// GTEST_OS_AIX - IBM AIX +// GTEST_OS_CYGWIN - Cygwin +// GTEST_OS_HPUX - HP-UX +// GTEST_OS_LINUX - Linux +// GTEST_OS_LINUX_ANDROID - Google Android +// GTEST_OS_MAC - Mac OS X +// GTEST_OS_NACL - Google Native Client (NaCl) +// GTEST_OS_SOLARIS - Sun Solaris +// GTEST_OS_SYMBIAN - Symbian +// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) +// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop +// GTEST_OS_WINDOWS_MINGW - MinGW +// GTEST_OS_WINDOWS_MOBILE - Windows Mobile +// GTEST_OS_ZOS - z/OS +// +// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the +// most stable support. Since core members of the Google Test project +// don't have access to other platforms, support for them may be less +// stable. If you notice any problems on your platform, please notify +// googletestframework@googlegroups.com (patches for fixing them are +// even more welcome!). +// +// Note that it is possible that none of the GTEST_OS_* macros are defined. +// +// Macros indicating available Google Test features (defined to 1 if +// the corresponding feature is supported; otherwise undefined): +// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized +// tests) +// GTEST_HAS_DEATH_TEST - death tests +// GTEST_HAS_PARAM_TEST - value-parameterized tests +// GTEST_HAS_TYPED_TEST - typed tests +// GTEST_HAS_TYPED_TEST_P - type-parameterized tests +// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with +// GTEST_HAS_POSIX_RE (see above) which users can +// define themselves. +// GTEST_USES_SIMPLE_RE - our own simple regex is used; +// the above two are mutually exclusive. +// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). +// +// Macros for basic C++ coding: +// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. +// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a +// variable don't have to be used. +// GTEST_DISALLOW_ASSIGN_ - disables operator=. +// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. +// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. +// +// Synchronization: +// Mutex, MutexLock, ThreadLocal, GetThreadCount() +// - synchronization primitives. +// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above +// synchronization primitives have real implementations +// and Google Test is thread-safe; or 0 otherwise. +// +// Template meta programming: +// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. +// IteratorTraits - partial implementation of std::iterator_traits, which +// is not available in libCstd when compiled with Sun C++. +// +// Smart pointers: +// scoped_ptr - as in TR2. +// +// Regular expressions: +// RE - a simple regular expression class using the POSIX +// Extended Regular Expression syntax on UNIX-like +// platforms, or a reduced regular exception syntax on +// other platforms, including Windows. +// +// Logging: +// GTEST_LOG_() - logs messages at the specified severity level. +// LogToStderr() - directs all log messages to stderr. +// FlushInfoLog() - flushes informational log messages. +// +// Stdout and stderr capturing: +// CaptureStdout() - starts capturing stdout. +// GetCapturedStdout() - stops capturing stdout and returns the captured +// string. +// CaptureStderr() - starts capturing stderr. +// GetCapturedStderr() - stops capturing stderr and returns the captured +// string. +// +// Integer types: +// TypeWithSize - maps an integer to a int type. +// Int32, UInt32, Int64, UInt64, TimeInMillis +// - integers of known sizes. +// BiggestInt - the biggest signed integer type. +// +// Command-line utilities: +// GTEST_FLAG() - references a flag. +// GTEST_DECLARE_*() - declares a flag. +// GTEST_DEFINE_*() - defines a flag. +// GetArgvs() - returns the command line as a vector of strings. +// +// Environment variable utilities: +// GetEnv() - gets the value of an environment variable. +// BoolFromGTestEnv() - parses a bool environment variable. +// Int32FromGTestEnv() - parses an Int32 environment variable. +// StringFromGTestEnv() - parses a string environment variable. + +#include // for isspace, etc +#include // for ptrdiff_t +#include +#include +#include +#ifndef _WIN32_WCE +# include +# include +#endif // !_WIN32_WCE + +#include // NOLINT +#include // NOLINT +#include // NOLINT + +#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" +#define GTEST_FLAG_PREFIX_ "gtest_" +#define GTEST_FLAG_PREFIX_DASH_ "gtest-" +#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" +#define GTEST_NAME_ "Google Test" +#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" + +// Determines the version of gcc that is used to compile this. +#ifdef __GNUC__ +// 40302 means version 4.3.2. +# define GTEST_GCC_VER_ \ + (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) +#endif // __GNUC__ + +// Determines the platform on which Google Test is compiled. +#ifdef __CYGWIN__ +# define GTEST_OS_CYGWIN 1 +#elif defined __SYMBIAN32__ +# define GTEST_OS_SYMBIAN 1 +#elif defined _WIN32 +# define GTEST_OS_WINDOWS 1 +# ifdef _WIN32_WCE +# define GTEST_OS_WINDOWS_MOBILE 1 +# elif defined(__MINGW__) || defined(__MINGW32__) +# define GTEST_OS_WINDOWS_MINGW 1 +# else +# define GTEST_OS_WINDOWS_DESKTOP 1 +# endif // _WIN32_WCE +#elif defined __APPLE__ +# define GTEST_OS_MAC 1 +#elif defined __linux__ +# define GTEST_OS_LINUX 1 +# ifdef ANDROID +# define GTEST_OS_LINUX_ANDROID 1 +# endif // ANDROID +#elif defined __MVS__ +# define GTEST_OS_ZOS 1 +#elif defined(__sun) && defined(__SVR4) +# define GTEST_OS_SOLARIS 1 +#elif defined(_AIX) +# define GTEST_OS_AIX 1 +#elif defined(__hpux) +# define GTEST_OS_HPUX 1 +#elif defined __native_client__ +# define GTEST_OS_NACL 1 +#elif defined DTCENTER //Autostar add 中文用例转测试套名加行号的宏定义 by xutaiqiang +#define DTCENTER_CN2EN 1 +#endif // __CYGWIN__ + +// Brings in definitions for functions used in the testing::internal::posix +// namespace (read, write, close, chdir, isatty, stat). We do not currently +// use them on Windows Mobile. +#if !GTEST_OS_WINDOWS +// This assumes that non-Windows OSes provide unistd.h. For OSes where this +// is not the case, we need to include headers that provide the functions +// mentioned above. +# include +# if !GTEST_OS_NACL +// TODO(vladl@google.com): Remove this condition when Native Client SDK adds +// strings.h (tracked in +// http://code.google.com/p/nativeclient/issues/detail?id=1175). +# include // Native Client doesn't provide strings.h. +# endif +#elif !GTEST_OS_WINDOWS_MOBILE +# include +# include +#endif + +// Defines this to true iff Google Test can use POSIX regular expressions. +#ifndef GTEST_HAS_POSIX_RE +# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) +#endif + +#if GTEST_HAS_POSIX_RE + +// On some platforms, needs someone to define size_t, and +// won't compile otherwise. We can #include it here as we already +// included , which is guaranteed to define size_t through +// . +# include // NOLINT + +# define GTEST_USES_POSIX_RE 1 + +#elif GTEST_OS_WINDOWS + +// is not available on Windows. Use our own simple regex +// implementation instead. +# define GTEST_USES_SIMPLE_RE 1 + +#else + +// may not be available on this platform. Use our own +// simple regex implementation instead. +# define GTEST_USES_SIMPLE_RE 1 + +#endif // GTEST_HAS_POSIX_RE + +#ifndef GTEST_HAS_EXCEPTIONS +// The user didn't tell us whether exceptions are enabled, so we need +// to figure it out. +# if defined(_MSC_VER) || defined(__BORLANDC__) +// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS +// macro to enable exceptions, so we'll do the same. +// Assumes that exceptions are enabled by default. +# ifndef _HAS_EXCEPTIONS +# define _HAS_EXCEPTIONS 1 +# endif // _HAS_EXCEPTIONS +# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS +# elif defined(__GNUC__) && __EXCEPTIONS +// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. +# define GTEST_HAS_EXCEPTIONS 1 +# elif defined(__SUNPRO_CC) +// Sun Pro CC supports exceptions. However, there is no compile-time way of +// detecting whether they are enabled or not. Therefore, we assume that +// they are enabled unless the user tells us otherwise. +# define GTEST_HAS_EXCEPTIONS 1 +# elif defined(__IBMCPP__) && __EXCEPTIONS +// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. +# define GTEST_HAS_EXCEPTIONS 1 +# elif defined(__HP_aCC) +// Exception handling is in effect by default in HP aCC compiler. It has to +// be turned of by +noeh compiler option if desired. +# define GTEST_HAS_EXCEPTIONS 1 +# else +// For other compilers, we assume exceptions are disabled to be +// conservative. +# define GTEST_HAS_EXCEPTIONS 0 +# endif // defined(_MSC_VER) || defined(__BORLANDC__) +#endif // GTEST_HAS_EXCEPTIONS + +#if !defined(GTEST_HAS_STD_STRING) +// Even though we don't use this macro any longer, we keep it in case +// some clients still depend on it. +# define GTEST_HAS_STD_STRING 1 +#elif !GTEST_HAS_STD_STRING +// The user told us that ::std::string isn't available. +# error "Google Test cannot be used where ::std::string isn't available." +#endif // !defined(GTEST_HAS_STD_STRING) + +#ifndef GTEST_HAS_GLOBAL_STRING +// The user didn't tell us whether ::string is available, so we need +// to figure it out. + +# define GTEST_HAS_GLOBAL_STRING 0 + +#endif // GTEST_HAS_GLOBAL_STRING + +#ifndef GTEST_HAS_STD_WSTRING +// The user didn't tell us whether ::std::wstring is available, so we need +// to figure it out. +// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring +// is available. + +// Cygwin 1.7 and below doesn't support ::std::wstring. +// Solaris' libc++ doesn't support it either. Android has +// no support for it at least as recent as Froyo (2.2). +# define GTEST_HAS_STD_WSTRING \ + (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) + +#endif // GTEST_HAS_STD_WSTRING + +#ifndef GTEST_HAS_GLOBAL_WSTRING +// The user didn't tell us whether ::wstring is available, so we need +// to figure it out. +# define GTEST_HAS_GLOBAL_WSTRING \ + (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) +#endif // GTEST_HAS_GLOBAL_WSTRING + +// Determines whether RTTI is available. +#ifndef GTEST_HAS_RTTI +// The user didn't tell us whether RTTI is enabled, so we need to +// figure it out. + +# ifdef _MSC_VER + +# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. +# define GTEST_HAS_RTTI 1 +# else +# define GTEST_HAS_RTTI 0 +# endif + +// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. +# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) + +# ifdef __GXX_RTTI +# define GTEST_HAS_RTTI 1 +# else +# define GTEST_HAS_RTTI 0 +# endif // __GXX_RTTI + +// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if +// both the typeid and dynamic_cast features are present. +# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) + +# ifdef __RTTI_ALL__ +# define GTEST_HAS_RTTI 1 +# else +# define GTEST_HAS_RTTI 0 +# endif + +# else + +// For all other compilers, we assume RTTI is enabled. +# define GTEST_HAS_RTTI 1 + +# endif // _MSC_VER + +#endif // GTEST_HAS_RTTI + +// It's this header's responsibility to #include when RTTI +// is enabled. +#if GTEST_HAS_RTTI +# include +#endif + +// Determines whether Google Test can use the pthreads library. +#ifndef GTEST_HAS_PTHREAD +// The user didn't tell us explicitly, so we assume pthreads support is +// available on Linux and Mac. +// +// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 +// to your compiler flags. +# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX) +#endif // GTEST_HAS_PTHREAD + +#if GTEST_HAS_PTHREAD +// gtest-port.h guarantees to #include when GTEST_HAS_PTHREAD is +// true. +# include // NOLINT + +// For timespec and nanosleep, used below. +# include // NOLINT +#endif + +// Determines whether Google Test can use tr1/tuple. You can define +// this macro to 0 to prevent Google Test from using tuple (any +// feature depending on tuple with be disabled in this mode). +#ifndef GTEST_HAS_TR1_TUPLE +// The user didn't tell us not to do it, so we assume it's OK. +# define GTEST_HAS_TR1_TUPLE 1 +#endif // GTEST_HAS_TR1_TUPLE + +// Determines whether Google Test's own tr1 tuple implementation +// should be used. +#ifndef GTEST_USE_OWN_TR1_TUPLE +// The user didn't tell us, so we need to figure it out. + +// We use our own TR1 tuple if we aren't sure the user has an +// implementation of it already. At this time, GCC 4.0.0+ and MSVC +// 2010 are the only mainstream compilers that come with a TR1 tuple +// implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by +// defining __GNUC__ and friends, but cannot compile GCC's tuple +// implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB +// Feature Pack download, which we cannot assume the user has. +# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \ + || _MSC_VER >= 1600 +# define GTEST_USE_OWN_TR1_TUPLE 0 +# else +# define GTEST_USE_OWN_TR1_TUPLE 1 +# endif + +#endif // GTEST_USE_OWN_TR1_TUPLE + +// To avoid conditional compilation everywhere, we make it +// gtest-port.h's responsibility to #include the header implementing +// tr1/tuple. +#if GTEST_HAS_TR1_TUPLE + +# if GTEST_USE_OWN_TR1_TUPLE +# include "gtest/internal/gtest-tuple.h" +# elif GTEST_OS_SYMBIAN + +// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to +// use STLport's tuple implementation, which unfortunately doesn't +// work as the copy of STLport distributed with Symbian is incomplete. +// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to +// use its own tuple implementation. +# ifdef BOOST_HAS_TR1_TUPLE +# undef BOOST_HAS_TR1_TUPLE +# endif // BOOST_HAS_TR1_TUPLE + +// This prevents , which defines +// BOOST_HAS_TR1_TUPLE, from being #included by Boost's . +# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED +# include + +# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) +// GCC 4.0+ implements tr1/tuple in the header. This does +// not conform to the TR1 spec, which requires the header to be . + +# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 +// Until version 4.3.2, gcc has a bug that causes , +// which is #included by , to not compile when RTTI is +// disabled. _TR1_FUNCTIONAL is the header guard for +// . Hence the following #define is a hack to prevent +// from being included. +# define _TR1_FUNCTIONAL 1 +# include +# undef _TR1_FUNCTIONAL // Allows the user to #include + // if he chooses to. +# else +# include // NOLINT +# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 + +# else +// If the compiler is not GCC 4.0+, we assume the user is using a +// spec-conforming TR1 implementation. +# include // NOLINT +# endif // GTEST_USE_OWN_TR1_TUPLE + +#endif // GTEST_HAS_TR1_TUPLE + +// Determines whether clone(2) is supported. +// Usually it will only be available on Linux, excluding +// Linux on the Itanium architecture. +// Also see http://linux.die.net/man/2/clone. +#ifndef GTEST_HAS_CLONE +// The user didn't tell us, so we need to figure it out. + +# if GTEST_OS_LINUX && !defined(__ia64__) +# define GTEST_HAS_CLONE 1 +# else +# define GTEST_HAS_CLONE 0 +# endif // GTEST_OS_LINUX && !defined(__ia64__) + +#endif // GTEST_HAS_CLONE + +// Determines whether to support stream redirection. This is used to test +// output correctness and to implement death tests. +#ifndef GTEST_HAS_STREAM_REDIRECTION +// By default, we assume that stream redirection is supported on all +// platforms except known mobile ones. +# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN +# define GTEST_HAS_STREAM_REDIRECTION 0 +# else +# define GTEST_HAS_STREAM_REDIRECTION 1 +# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN +#endif // GTEST_HAS_STREAM_REDIRECTION + +// Determines whether to support death tests. +// Google Test does not support death tests for VC 7.1 and earlier as +// abort() in a VC 7.1 application compiled as GUI in debug config +// pops up a dialog window that cannot be suppressed programmatically. +#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ + (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ + GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX) +# define GTEST_HAS_DEATH_TEST 1 +# include // NOLINT +#endif + +// We don't support MSVC 7.1 with exceptions disabled now. Therefore +// all the compilers we care about are adequate for supporting +// value-parameterized tests. +#define GTEST_HAS_PARAM_TEST 1 + +// Determines whether to support type-driven tests. + +// Typed tests need and variadic macros, which GCC, VC++ 8.0, +// Sun Pro CC, IBM Visual Age, and HP aCC support. +#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ + defined(__IBMCPP__) || defined(__HP_aCC) +# define GTEST_HAS_TYPED_TEST 1 +# define GTEST_HAS_TYPED_TEST_P 1 +#endif + +// Determines whether to support Combine(). This only makes sense when +// value-parameterized tests are enabled. The implementation doesn't +// work on Sun Studio since it doesn't understand templated conversion +// operators. +#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) +# define GTEST_HAS_COMBINE 1 +#endif + +// Determines whether the system compiler uses UTF-16 for encoding wide strings. +#define GTEST_WIDE_STRING_USES_UTF16_ \ + (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) + +// Determines whether test results can be streamed to a socket. +#if GTEST_OS_LINUX +# define GTEST_CAN_STREAM_RESULTS_ 1 +#endif + +// Defines some utility macros. + +// The GNU compiler emits a warning if nested "if" statements are followed by +// an "else" statement and braces are not used to explicitly disambiguate the +// "else" binding. This leads to problems with code like: +// +// if (gate) +// ASSERT_*(condition) << "Some message"; +// +// The "switch (0) case 0:" idiom is used to suppress this. +#ifdef __INTEL_COMPILER +# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ +#else +# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT +#endif + +// Use this annotation at the end of a struct/class definition to +// prevent the compiler from optimizing away instances that are never +// used. This is useful when all interesting logic happens inside the +// c'tor and / or d'tor. Example: +// +// struct Foo { +// Foo() { ... } +// } GTEST_ATTRIBUTE_UNUSED_; +// +// Also use it after a variable or parameter declaration to tell the +// compiler the variable/parameter does not have to be used. +#if defined(__GNUC__) && !defined(COMPILER_ICC) +# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) +#else +# define GTEST_ATTRIBUTE_UNUSED_ +#endif + +// A macro to disallow operator= +// This should be used in the private: declarations for a class. +#define GTEST_DISALLOW_ASSIGN_(type)\ + void operator=(type const &) + +// A macro to disallow copy constructor and operator= +// This should be used in the private: declarations for a class. +#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ + type(type const &);\ + GTEST_DISALLOW_ASSIGN_(type) + +// Tell the compiler to warn about unused return values for functions declared +// with this macro. The macro should be used on function declarations +// following the argument list: +// +// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; +#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) +# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) +#else +# define GTEST_MUST_USE_RESULT_ +#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC + +// Determine whether the compiler supports Microsoft's Structured Exception +// Handling. This is supported by several Windows compilers but generally +// does not exist on any other system. +#ifndef GTEST_HAS_SEH +// The user didn't tell us, so we need to figure it out. + +# if defined(_MSC_VER) || defined(__BORLANDC__) +// These two compilers are known to support SEH. +# define GTEST_HAS_SEH 1 +# else +// Assume no SEH. +# define GTEST_HAS_SEH 0 +# endif + +#endif // GTEST_HAS_SEH + +#ifdef _MSC_VER + +# if GTEST_LINKED_AS_SHARED_LIBRARY +# define GTEST_API_ __declspec(dllimport) +# elif GTEST_CREATE_SHARED_LIBRARY +# define GTEST_API_ __declspec(dllexport) +# endif + +#endif // _MSC_VER + +#ifndef GTEST_API_ +# define GTEST_API_ +#endif + +#ifdef __GNUC__ +// Ask the compiler to never inline a given function. +# define GTEST_NO_INLINE_ __attribute__((noinline)) +#else +# define GTEST_NO_INLINE_ +#endif + +namespace testing { + +class Message; + +namespace internal { + +class String; + +// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time +// expression is true. For example, you could use it to verify the +// size of a static array: +// +// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, +// content_type_names_incorrect_size); +// +// or to make sure a struct is smaller than a certain size: +// +// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); +// +// The second argument to the macro is the name of the variable. If +// the expression is false, most compilers will issue a warning/error +// containing the name of the variable. + +template +struct CompileAssert { +}; + +#define GTEST_COMPILE_ASSERT_(expr, msg) \ + typedef ::testing::internal::CompileAssert<(bool(expr))> \ + msg[bool(expr) ? 1 : -1] + +// Implementation details of GTEST_COMPILE_ASSERT_: +// +// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 +// elements (and thus is invalid) when the expression is false. +// +// - The simpler definition +// +// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] +// +// does not work, as gcc supports variable-length arrays whose sizes +// are determined at run-time (this is gcc's extension and not part +// of the C++ standard). As a result, gcc fails to reject the +// following code with the simple definition: +// +// int foo; +// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is +// // not a compile-time constant. +// +// - By using the type CompileAssert<(bool(expr))>, we ensures that +// expr is a compile-time constant. (Template arguments must be +// determined at compile-time.) +// +// - The outter parentheses in CompileAssert<(bool(expr))> are necessary +// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written +// +// CompileAssert +// +// instead, these compilers will refuse to compile +// +// GTEST_COMPILE_ASSERT_(5 > 0, some_message); +// +// (They seem to think the ">" in "5 > 0" marks the end of the +// template argument list.) +// +// - The array size is (bool(expr) ? 1 : -1), instead of simply +// +// ((expr) ? 1 : -1). +// +// This is to avoid running into a bug in MS VC 7.1, which +// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. + +// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. +// +// This template is declared, but intentionally undefined. +template +struct StaticAssertTypeEqHelper; + +template +struct StaticAssertTypeEqHelper {}; + +#if GTEST_HAS_GLOBAL_STRING +typedef ::string string; +#else +typedef ::std::string string; +#endif // GTEST_HAS_GLOBAL_STRING + +#if GTEST_HAS_GLOBAL_WSTRING +typedef ::wstring wstring; +#elif GTEST_HAS_STD_WSTRING +typedef ::std::wstring wstring; +#endif // GTEST_HAS_GLOBAL_WSTRING + +// A helper for suppressing warnings on constant condition. It just +// returns 'condition'. +GTEST_API_ bool IsTrue(bool condition); + +// Defines scoped_ptr. + +// This implementation of scoped_ptr is PARTIAL - it only contains +// enough stuff to satisfy Google Test's need. + +#pragma pack(push, 4) //该类修改为4字节对齐,防止用户修改字节对齐后不恢复,导致message_错误 + +template +class scoped_ptr { + public: + typedef T element_type; + + explicit scoped_ptr(T* p = NULL) : ptr_(p) {} + ~scoped_ptr() { reset(); } + + T& operator*() const { return *ptr_; } + T* operator->() const { return ptr_; } + T* get() const { return ptr_; } + + T* release() { + T* const ptr = ptr_; + ptr_ = NULL; + return ptr; + } + + void reset(T* p = NULL) { + if (p != ptr_) { + if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. + delete ptr_; + } + ptr_ = p; + } + } + private: + T* ptr_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); +}; +#pragma pack(pop) + +// Defines RE. + +// A simple C++ wrapper for . It uses the POSIX Extended +// Regular Expression syntax. +class GTEST_API_ RE { + public: + // A copy constructor is required by the Standard to initialize object + // references from r-values. + RE(const RE& other) { Init(other.pattern()); } + + // Constructs an RE from a string. + RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT + +#if GTEST_HAS_GLOBAL_STRING + + RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT + +#endif // GTEST_HAS_GLOBAL_STRING + + RE(const char* regex) { Init(regex); } // NOLINT + ~RE(); + + // Returns the string representation of the regex. + const char* pattern() const { return pattern_; } + + // FullMatch(str, re) returns true iff regular expression re matches + // the entire str. + // PartialMatch(str, re) returns true iff regular expression re + // matches a substring of str (including str itself). + // + // TODO(wan@google.com): make FullMatch() and PartialMatch() work + // when str contains NUL characters. + static bool FullMatch(const ::std::string& str, const RE& re) { + return FullMatch(str.c_str(), re); + } + static bool PartialMatch(const ::std::string& str, const RE& re) { + return PartialMatch(str.c_str(), re); + } + +#if GTEST_HAS_GLOBAL_STRING + + static bool FullMatch(const ::string& str, const RE& re) { + return FullMatch(str.c_str(), re); + } + static bool PartialMatch(const ::string& str, const RE& re) { + return PartialMatch(str.c_str(), re); + } + +#endif // GTEST_HAS_GLOBAL_STRING + + static bool FullMatch(const char* str, const RE& re); + static bool PartialMatch(const char* str, const RE& re); + + private: + void Init(const char* regex); + + // We use a const char* instead of a string, as Google Test may be used + // where string is not available. We also do not use Google Test's own + // String type here, in order to simplify dependencies between the + // files. + const char* pattern_; + bool is_valid_; + +#if GTEST_USES_POSIX_RE + + regex_t full_regex_; // For FullMatch(). + regex_t partial_regex_; // For PartialMatch(). + +#else // GTEST_USES_SIMPLE_RE + + const char* full_pattern_; // For FullMatch(); + +#endif + + GTEST_DISALLOW_ASSIGN_(RE); +}; + +// Formats a source file path and a line number as they would appear +// in an error message from the compiler used to compile this code. +GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); + +// Formats a file location for compiler-independent XML output. +// Although this function is not platform dependent, we put it next to +// FormatFileLocation in order to contrast the two functions. +GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, + int line); + +// Defines logging utilities: +// GTEST_LOG_(severity) - logs messages at the specified severity level. The +// message itself is streamed into the macro. +// LogToStderr() - directs all log messages to stderr. +// FlushInfoLog() - flushes informational log messages. + +enum GTestLogSeverity { + GTEST_INFO, + GTEST_WARNING, + GTEST_ERROR, + GTEST_FATAL +}; + +// Formats log entry severity, provides a stream object for streaming the +// log message, and terminates the message with a newline when going out of +// scope. +class GTEST_API_ GTestLog { + public: + GTestLog(GTestLogSeverity severity, const char* file, int line); + + // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. + ~GTestLog(); + + ::std::ostream& GetStream() { return ::std::cerr; } + + private: + const GTestLogSeverity severity_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); +}; + +#define GTEST_LOG_(severity) \ + ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ + __FILE__, __LINE__).GetStream() + +inline void LogToStderr() {} +inline void FlushInfoLog() { fflush(NULL); } + +// INTERNAL IMPLEMENTATION - DO NOT USE. +// +// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition +// is not satisfied. +// Synopsys: +// GTEST_CHECK_(boolean_condition); +// or +// GTEST_CHECK_(boolean_condition) << "Additional message"; +// +// This checks the condition and if the condition is not satisfied +// it prints message about the condition violation, including the +// condition itself, plus additional message streamed into it, if any, +// and then it aborts the program. It aborts the program irrespective of +// whether it is built in the debug mode or not. +#define GTEST_CHECK_(condition) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::IsTrue(condition)) \ + ; \ + else \ + GTEST_LOG_(FATAL) << "Condition " #condition " failed. " + +// An all-mode assert to verify that the given POSIX-style function +// call returns 0 (indicating success). Known limitation: this +// doesn't expand to a balanced 'if' statement, so enclose the macro +// in {} if you need to use it as the only statement in an 'if' +// branch. +#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ + if (const int gtest_error = (posix_call)) \ + GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ + << gtest_error + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Use ImplicitCast_ as a safe version of static_cast for upcasting in +// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a +// const Foo*). When you use ImplicitCast_, the compiler checks that +// the cast is safe. Such explicit ImplicitCast_s are necessary in +// surprisingly many situations where C++ demands an exact type match +// instead of an argument type convertable to a target type. +// +// The syntax for using ImplicitCast_ is the same as for static_cast: +// +// ImplicitCast_(expr) +// +// ImplicitCast_ would have been part of the C++ standard library, +// but the proposal was submitted too late. It will probably make +// its way into the language in the future. +// +// This relatively ugly name is intentional. It prevents clashes with +// similar functions users may have (e.g., implicit_cast). The internal +// namespace alone is not enough because the function can be found by ADL. +template +inline To ImplicitCast_(To x) { return x; } + +// When you upcast (that is, cast a pointer from type Foo to type +// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts +// always succeed. When you downcast (that is, cast a pointer from +// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because +// how do you know the pointer is really of type SubclassOfFoo? It +// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, +// when you downcast, you should use this macro. In debug mode, we +// use dynamic_cast<> to double-check the downcast is legal (we die +// if it's not). In normal mode, we do the efficient static_cast<> +// instead. Thus, it's important to test in debug mode to make sure +// the cast is legal! +// This is the only place in the code we should use dynamic_cast<>. +// In particular, you SHOULDN'T be using dynamic_cast<> in order to +// do RTTI (eg code like this: +// if (dynamic_cast(foo)) HandleASubclass1Object(foo); +// if (dynamic_cast(foo)) HandleASubclass2Object(foo); +// You should design the code some other way not to need this. +// +// This relatively ugly name is intentional. It prevents clashes with +// similar functions users may have (e.g., down_cast). The internal +// namespace alone is not enough because the function can be found by ADL. +template // use like this: DownCast_(foo); +inline To DownCast_(From* f) { // so we only accept pointers + // Ensures that To is a sub-type of From *. This test is here only + // for compile-time type checking, and has no overhead in an + // optimized build at run-time, as it will be optimized away + // completely. + if (false) { + const To to = NULL; + ::testing::internal::ImplicitCast_(to); + } + +#if GTEST_HAS_RTTI + // RTTI: debug mode only! + GTEST_CHECK_(f == NULL || dynamic_cast(f) != NULL); +#endif + return static_cast(f); +} + +// Downcasts the pointer of type Base to Derived. +// Derived must be a subclass of Base. The parameter MUST +// point to a class of type Derived, not any subclass of it. +// When RTTI is available, the function performs a runtime +// check to enforce this. +template +Derived* CheckedDowncastToActualType(Base* base) { +#if GTEST_HAS_RTTI + GTEST_CHECK_(typeid(*base) == typeid(Derived)); + return dynamic_cast(base); // NOLINT +#else + return static_cast(base); // Poor man's downcast. +#endif +} + +#if GTEST_HAS_STREAM_REDIRECTION + +// Defines the stderr capturer: +// CaptureStdout - starts capturing stdout. +// GetCapturedStdout - stops capturing stdout and returns the captured string. +// CaptureStderr - starts capturing stderr. +// GetCapturedStderr - stops capturing stderr and returns the captured string. +// +GTEST_API_ void CaptureStdout(); +GTEST_API_ String GetCapturedStdout(); +GTEST_API_ void CaptureStderr(); +GTEST_API_ String GetCapturedStderr(); + +#endif // GTEST_HAS_STREAM_REDIRECTION + + +#if GTEST_HAS_DEATH_TEST + +// A copy of all command line arguments. Set by InitGoogleTest(). +extern ::std::vector g_argvs; + +// GTEST_HAS_DEATH_TEST implies we have ::std::string. +const ::std::vector& GetArgvs(); + +#endif // GTEST_HAS_DEATH_TEST + +// Defines synchronization primitives. + +#if GTEST_HAS_PTHREAD + +// Sleeps for (roughly) n milli-seconds. This function is only for +// testing Google Test's own constructs. Don't use it in user tests, +// either directly or indirectly. +inline void SleepMilliseconds(int n) { + const timespec time = { + 0, // 0 seconds. + n * 1000L * 1000L, // And n ms. + }; + nanosleep(&time, NULL); +} + +// Allows a controller thread to pause execution of newly created +// threads until notified. Instances of this class must be created +// and destroyed in the controller thread. +// +// This class is only for testing Google Test's own constructs. Do not +// use it in user tests, either directly or indirectly. +class Notification { + public: + Notification() : notified_(false) {} + + // Notifies all threads created with this notification to start. Must + // be called from the controller thread. + void Notify() { notified_ = true; } + + // Blocks until the controller thread notifies. Must be called from a test + // thread. + void WaitForNotification() { + while(!notified_) { + SleepMilliseconds(10); + } + } + + private: + volatile bool notified_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); +}; + +// As a C-function, ThreadFuncWithCLinkage cannot be templated itself. +// Consequently, it cannot select a correct instantiation of ThreadWithParam +// in order to call its Run(). Introducing ThreadWithParamBase as a +// non-templated base class for ThreadWithParam allows us to bypass this +// problem. +class ThreadWithParamBase { + public: + virtual ~ThreadWithParamBase() {} + virtual void Run() = 0; +}; + +// pthread_create() accepts a pointer to a function type with the C linkage. +// According to the Standard (7.5/1), function types with different linkages +// are different even if they are otherwise identical. Some compilers (for +// example, SunStudio) treat them as different types. Since class methods +// cannot be defined with C-linkage we need to define a free C-function to +// pass into pthread_create(). +extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { + static_cast(thread)->Run(); + return NULL; +} + +// Helper class for testing Google Test's multi-threading constructs. +// To use it, write: +// +// void ThreadFunc(int param) { /* Do things with param */ } +// Notification thread_can_start; +// ... +// // The thread_can_start parameter is optional; you can supply NULL. +// ThreadWithParam thread(&ThreadFunc, 5, &thread_can_start); +// thread_can_start.Notify(); +// +// These classes are only for testing Google Test's own constructs. Do +// not use them in user tests, either directly or indirectly. +template +class ThreadWithParam : public ThreadWithParamBase { + public: + typedef void (*UserThreadFunc)(T); + + ThreadWithParam( + UserThreadFunc func, T param, Notification* thread_can_start) + : func_(func), + param_(param), + thread_can_start_(thread_can_start), + finished_(false) { + ThreadWithParamBase* const base = this; + // The thread can be created only after all fields except thread_ + // have been initialized. + GTEST_CHECK_POSIX_SUCCESS_( + pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); + } + ~ThreadWithParam() { Join(); } + + void Join() { + if (!finished_) { + GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); + finished_ = true; + } + } + + virtual void Run() { + if (thread_can_start_ != NULL) + thread_can_start_->WaitForNotification(); + func_(param_); + } + + private: + const UserThreadFunc func_; // User-supplied thread function. + const T param_; // User-supplied parameter to the thread function. + // When non-NULL, used to block execution until the controller thread + // notifies. + Notification* const thread_can_start_; + bool finished_; // true iff we know that the thread function has finished. + pthread_t thread_; // The native thread object. + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); +}; + +// MutexBase and Mutex implement mutex on pthreads-based platforms. They +// are used in conjunction with class MutexLock: +// +// Mutex mutex; +// ... +// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end +// // of the current scope. +// +// MutexBase implements behavior for both statically and dynamically +// allocated mutexes. Do not use MutexBase directly. Instead, write +// the following to define a static mutex: +// +// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); +// +// You can forward declare a static mutex like this: +// +// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); +// +// To create a dynamic mutex, just define an object of type Mutex. +class MutexBase { + public: + // Acquires this mutex. + void Lock() { + GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); + owner_ = pthread_self(); + } + + // Releases this mutex. + void Unlock() { + // We don't protect writing to owner_ here, as it's the caller's + // responsibility to ensure that the current thread holds the + // mutex when this is called. + owner_ = 0; + GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); + } + + // Does nothing if the current thread holds the mutex. Otherwise, crashes + // with high probability. + void AssertHeld() const { + GTEST_CHECK_(owner_ == pthread_self()) + << "The current thread is not holding the mutex @" << this; + } + + // A static mutex may be used before main() is entered. It may even + // be used before the dynamic initialization stage. Therefore we + // must be able to initialize a static mutex object at link time. + // This means MutexBase has to be a POD and its member variables + // have to be public. + public: + pthread_mutex_t mutex_; // The underlying pthread mutex. + pthread_t owner_; // The thread holding the mutex; 0 means no one holds it. +}; + +// Forward-declares a static mutex. +# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ + extern ::testing::internal::MutexBase mutex + +// Defines and statically (i.e. at link time) initializes a static mutex. +# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ + ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 } + +// The Mutex class can only be used for mutexes created at runtime. It +// shares its API with MutexBase otherwise. +class Mutex : public MutexBase { + public: + Mutex() { + GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); + owner_ = 0; + } + ~Mutex() { + GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); + } + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); +}; + +// We cannot name this class MutexLock as the ctor declaration would +// conflict with a macro named MutexLock, which is defined on some +// platforms. Hence the typedef trick below. +class GTestMutexLock { + public: + explicit GTestMutexLock(MutexBase* mutex) + : mutex_(mutex) { mutex_->Lock(); } + + ~GTestMutexLock() { mutex_->Unlock(); } + + private: + MutexBase* const mutex_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); +}; + +typedef GTestMutexLock MutexLock; + +// Helpers for ThreadLocal. + +// pthread_key_create() requires DeleteThreadLocalValue() to have +// C-linkage. Therefore it cannot be templatized to access +// ThreadLocal. Hence the need for class +// ThreadLocalValueHolderBase. +class ThreadLocalValueHolderBase { + public: + virtual ~ThreadLocalValueHolderBase() {} +}; + +// Called by pthread to delete thread-local data stored by +// pthread_setspecific(). +extern "C" inline void DeleteThreadLocalValue(void* value_holder) { + delete static_cast(value_holder); +} + +// Implements thread-local storage on pthreads-based systems. +// +// // Thread 1 +// ThreadLocal tl(100); // 100 is the default value for each thread. +// +// // Thread 2 +// tl.set(150); // Changes the value for thread 2 only. +// EXPECT_EQ(150, tl.get()); +// +// // Thread 1 +// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. +// tl.set(200); +// EXPECT_EQ(200, tl.get()); +// +// The template type argument T must have a public copy constructor. +// In addition, the default ThreadLocal constructor requires T to have +// a public default constructor. +// +// An object managed for a thread by a ThreadLocal instance is deleted +// when the thread exits. Or, if the ThreadLocal instance dies in +// that thread, when the ThreadLocal dies. It's the user's +// responsibility to ensure that all other threads using a ThreadLocal +// have exited when it dies, or the per-thread objects for those +// threads will not be deleted. +// +// Google Test only uses global ThreadLocal objects. That means they +// will die after main() has returned. Therefore, no per-thread +// object managed by Google Test will be leaked as long as all threads +// using Google Test have exited when main() returns. +template +class ThreadLocal { + public: + ThreadLocal() : key_(CreateKey()), + default_() {} + explicit ThreadLocal(const T& value) : key_(CreateKey()), + default_(value) {} + + ~ThreadLocal() { + // Destroys the managed object for the current thread, if any. + DeleteThreadLocalValue(pthread_getspecific(key_)); + + // Releases resources associated with the key. This will *not* + // delete managed objects for other threads. + GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); + } + + T* pointer() { return GetOrCreateValue(); } + const T* pointer() const { return GetOrCreateValue(); } + const T& get() const { return *pointer(); } + void set(const T& value) { *pointer() = value; } + + private: + // Holds a value of type T. + class ValueHolder : public ThreadLocalValueHolderBase { + public: + explicit ValueHolder(const T& value) : value_(value) {} + + T* pointer() { return &value_; } + + private: + T value_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); + }; + + static pthread_key_t CreateKey() { + pthread_key_t key; + // When a thread exits, DeleteThreadLocalValue() will be called on + // the object managed for that thread. + GTEST_CHECK_POSIX_SUCCESS_( + pthread_key_create(&key, &DeleteThreadLocalValue)); + return key; + } + + T* GetOrCreateValue() const { + ThreadLocalValueHolderBase* const holder = + static_cast(pthread_getspecific(key_)); + if (holder != NULL) { + return CheckedDowncastToActualType(holder)->pointer(); + } + + ValueHolder* const new_holder = new ValueHolder(default_); + ThreadLocalValueHolderBase* const holder_base = new_holder; + GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); + return new_holder->pointer(); + } + + // A key pthreads uses for looking up per-thread values. + const pthread_key_t key_; + const T default_; // The default value for each thread. + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); +}; + +# define GTEST_IS_THREADSAFE 1 + +#else // GTEST_HAS_PTHREAD + +// A dummy implementation of synchronization primitives (mutex, lock, +// and thread-local variable). Necessary for compiling Google Test where +// mutex is not supported - using Google Test in multiple threads is not +// supported on such platforms. + +class Mutex { + public: + Mutex() {} + void AssertHeld() const {} +}; + +# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ + extern ::testing::internal::Mutex mutex + +# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex + +class GTestMutexLock { + public: + explicit GTestMutexLock(Mutex*) {} // NOLINT +}; + +typedef GTestMutexLock MutexLock; + +template +class ThreadLocal { + public: + ThreadLocal() : value_() {} + explicit ThreadLocal(const T& value) : value_(value) {} + T* pointer() { return &value_; } + const T* pointer() const { return &value_; } + const T& get() const { return value_; } + void set(const T& value) { value_ = value; } + private: + T value_; +}; + +// The above synchronization primitives have dummy implementations. +// Therefore Google Test is not thread-safe. +# define GTEST_IS_THREADSAFE 0 + +#endif // GTEST_HAS_PTHREAD + +// Returns the number of threads running in the process, or 0 to indicate that +// we cannot detect it. +GTEST_API_ size_t GetThreadCount(); + +// Passing non-POD classes through ellipsis (...) crashes the ARM +// compiler and generates a warning in Sun Studio. The Nokia Symbian +// and the IBM XL C/C++ compiler try to instantiate a copy constructor +// for objects passed through ellipsis (...), failing for uncopyable +// objects. We define this to ensure that only POD is passed through +// ellipsis on these systems. +#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) +// We lose support for NULL detection where the compiler doesn't like +// passing non-POD classes through ellipsis (...). +# define GTEST_ELLIPSIS_NEEDS_POD_ 1 +#else +# define GTEST_CAN_COMPARE_NULL 1 +#endif + +// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between +// const T& and const T* in a function template. These compilers +// _can_ decide between class template specializations for T and T*, +// so a tr1::type_traits-like is_pointer works. +#if defined(__SYMBIAN32__) || defined(__IBMCPP__) +# define GTEST_NEEDS_IS_POINTER_ 1 +#endif + +template +struct bool_constant { + typedef bool_constant type; + static const bool value = bool_value; +}; +template const bool bool_constant::value; + +typedef bool_constant false_type; +typedef bool_constant true_type; + +template +struct is_pointer : public false_type {}; + +template +struct is_pointer : public true_type {}; + +template +struct IteratorTraits { + typedef typename Iterator::value_type value_type; +}; + +template +struct IteratorTraits { + typedef T value_type; +}; + +template +struct IteratorTraits { + typedef T value_type; +}; + +#if GTEST_OS_WINDOWS +# define GTEST_PATH_SEP_ "\\" +# define GTEST_HAS_ALT_PATH_SEP_ 1 +// The biggest signed integer type the compiler supports. +typedef __int64 BiggestInt; +#else +# define GTEST_PATH_SEP_ "/" +# define GTEST_HAS_ALT_PATH_SEP_ 0 +typedef long long BiggestInt; // NOLINT +#endif // GTEST_OS_WINDOWS + +// Utilities for char. + +// isspace(int ch) and friends accept an unsigned char or EOF. char +// may be signed, depending on the compiler (or compiler flags). +// Therefore we need to cast a char to unsigned char before calling +// isspace(), etc. + +inline bool IsAlpha(char ch) { + return isalpha(static_cast(ch)) != 0; +} +inline bool IsAlNum(char ch) { + return isalnum(static_cast(ch)) != 0; +} +inline bool IsDigit(char ch) { + return isdigit(static_cast(ch)) != 0; +} +inline bool IsLower(char ch) { + return islower(static_cast(ch)) != 0; +} +inline bool IsSpace(char ch) { + return isspace(static_cast(ch)) != 0; +} +inline bool IsUpper(char ch) { + return isupper(static_cast(ch)) != 0; +} +inline bool IsXDigit(char ch) { + return isxdigit(static_cast(ch)) != 0; +} + +inline char ToLower(char ch) { + return static_cast(tolower(static_cast(ch))); +} +inline char ToUpper(char ch) { + return static_cast(toupper(static_cast(ch))); +} + +// The testing::internal::posix namespace holds wrappers for common +// POSIX functions. These wrappers hide the differences between +// Windows/MSVC and POSIX systems. Since some compilers define these +// standard functions as macros, the wrapper cannot have the same name +// as the wrapped function. + +namespace posix { + +// Functions with a different name on Windows. + +#if GTEST_OS_WINDOWS + +typedef struct _stat StatStruct; + +# ifdef __BORLANDC__ +inline int IsATTY(int fd) { return isatty(fd); } +inline int StrCaseCmp(const char* s1, const char* s2) { + return stricmp(s1, s2); +} +inline char* StrDup(const char* src) { return strdup(src); } +# else // !__BORLANDC__ +# if GTEST_OS_WINDOWS_MOBILE +inline int IsATTY(int /* fd */) { return 0; } +# else +inline int IsATTY(int fd) { return _isatty(fd); } +# endif // GTEST_OS_WINDOWS_MOBILE +inline int StrCaseCmp(const char* s1, const char* s2) { + return _stricmp(s1, s2); +} +inline char* StrDup(const char* src) { return _strdup(src); } +# endif // __BORLANDC__ + +# if GTEST_OS_WINDOWS_MOBILE +inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } +// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this +// time and thus not defined there. +# else +inline int FileNo(FILE* file) { return _fileno(file); } +inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } +inline int RmDir(const char* dir) { return _rmdir(dir); } +inline bool IsDir(const StatStruct& st) { + return (_S_IFDIR & st.st_mode) != 0; +} +# endif // GTEST_OS_WINDOWS_MOBILE + +#else + +typedef struct stat StatStruct; + +inline int FileNo(FILE* file) { return fileno(file); } +inline int IsATTY(int fd) { return isatty(fd); } +inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } +inline int StrCaseCmp(const char* s1, const char* s2) { + return strcasecmp(s1, s2); +} +inline char* StrDup(const char* src) { return strdup(src); } +inline int RmDir(const char* dir) { return rmdir(dir); } +inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } + +#endif // GTEST_OS_WINDOWS + +// Functions deprecated by MSVC 8.0. + +#ifdef _MSC_VER +// Temporarily disable warning 4996 (deprecated function). +# pragma warning(push) +# pragma warning(disable:4996) +#endif + +//由autostar修改,因为加入其他功能引入mfc的文件,符号冲突,把此函数改名字 +inline const char* ASStrNCpy(char* dest, const char* src, size_t n) { + return strncpy(dest, src, n); +} + +// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and +// StrError() aren't needed on Windows CE at this time and thus not +// defined there. + +#if !GTEST_OS_WINDOWS_MOBILE +inline int ChDir(const char* dir) { return chdir(dir); } +#endif +inline FILE* FOpen(const char* path, const char* mode) { + return fopen(path, mode); +} +#if !GTEST_OS_WINDOWS_MOBILE +inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { + return freopen(path, mode, stream); +} +inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } +#endif +inline int FClose(FILE* fp) { return fclose(fp); } +#if !GTEST_OS_WINDOWS_MOBILE +inline int Read(int fd, void* buf, unsigned int count) { + return static_cast(read(fd, buf, count)); +} +inline int Write(int fd, const void* buf, unsigned int count) { + return static_cast(write(fd, buf, count)); +} +inline int Close(int fd) { return close(fd); } +inline const char* StrError(int errnum) { return strerror(errnum); } +#endif +inline const char* GetEnv(const char* name) { +#if GTEST_OS_WINDOWS_MOBILE + // We are on Windows CE, which has no environment variables. + return NULL; +#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) + // Environment variables which we programmatically clear will be set to the + // empty string rather than unset (NULL). Handle that case. + const char* const env = getenv(name); + return (env != NULL && env[0] != '\0') ? env : NULL; +#else + return getenv(name); +#endif +} + +#ifdef _MSC_VER +# pragma warning(pop) // Restores the warning state. +#endif + +#if GTEST_OS_WINDOWS_MOBILE +// Windows CE has no C library. The abort() function is used in +// several places in Google Test. This implementation provides a reasonable +// imitation of standard behaviour. +void Abort(); +#else +inline void Abort() { abort(); } +#endif // GTEST_OS_WINDOWS_MOBILE + +} // namespace posix + +// The maximum number a BiggestInt can represent. This definition +// works no matter BiggestInt is represented in one's complement or +// two's complement. +// +// We cannot rely on numeric_limits in STL, as __int64 and long long +// are not part of standard C++ and numeric_limits doesn't need to be +// defined for them. +const BiggestInt kMaxBiggestInt = + ~(static_cast(1) << (8*sizeof(BiggestInt) - 1)); + +// This template class serves as a compile-time function from size to +// type. It maps a size in bytes to a primitive type with that +// size. e.g. +// +// TypeWithSize<4>::UInt +// +// is typedef-ed to be unsigned int (unsigned integer made up of 4 +// bytes). +// +// Such functionality should belong to STL, but I cannot find it +// there. +// +// Google Test uses this class in the implementation of floating-point +// comparison. +// +// For now it only handles UInt (unsigned int) as that's all Google Test +// needs. Other types can be easily added in the future if need +// arises. +template +class TypeWithSize { + public: + // This prevents the user from using TypeWithSize with incorrect + // values of N. + typedef void UInt; +}; + +// The specialization for size 4. +template <> +class TypeWithSize<4> { + public: + // unsigned int has size 4 in both gcc and MSVC. + // + // As base/basictypes.h doesn't compile on Windows, we cannot use + // uint32, uint64, and etc here. + typedef int Int; + typedef unsigned int UInt; +}; + +// The specialization for size 8. +template <> +class TypeWithSize<8> { + public: + +#if GTEST_OS_WINDOWS + typedef __int64 Int; + typedef unsigned __int64 UInt; +#else + typedef long long Int; // NOLINT + typedef unsigned long long UInt; // NOLINT +#endif // GTEST_OS_WINDOWS +}; + +// Integer types of known sizes. +typedef TypeWithSize<4>::Int Int32; +typedef TypeWithSize<4>::UInt UInt32; +typedef TypeWithSize<8>::Int Int64; +typedef TypeWithSize<8>::UInt UInt64; +typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. + +// Utilities for command line flags and environment variables. + +// Macro for referencing flags. +#define GTEST_FLAG(name) FLAGS_gtest_##name + +// Macros for declaring flags. +#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) +#define GTEST_DECLARE_int32_(name) \ + GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) +#define GTEST_DECLARE_string_(name) \ + GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name) + +// Macros for defining flags. +#define GTEST_DEFINE_bool_(name, default_val, doc) \ + GTEST_API_ bool GTEST_FLAG(name) = (default_val) +#define GTEST_DEFINE_int32_(name, default_val, doc) \ + GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) +#define GTEST_DEFINE_string_(name, default_val, doc) \ + GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val) + +// Parses 'str' for a 32-bit signed integer. If successful, writes the result +// to *value and returns true; otherwise leaves *value unchanged and returns +// false. +// TODO(chandlerc): Find a better way to refactor flag and environment parsing +// out of both gtest-port.cc and gtest.cc to avoid exporting this utility +// function. +bool ParseInt32(const Message& src_text, const char* str, Int32* value); + +// Parses a bool/Int32/string from the environment variable +// corresponding to the given Google Test flag. +bool BoolFromGTestEnv(const char* flag, bool default_val); +GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); +const char* StringFromGTestEnv(const char* flag, const char* default_val); + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ diff --git a/cli/test/include/gtest/internal/gtest-string.h b/cli/test/include/gtest/internal/gtest-string.h new file mode 100644 index 0000000..dc3a07b --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-string.h @@ -0,0 +1,350 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) +// +// The Google C++ Testing Framework (Google Test) +// +// This header file declares the String class and functions used internally by +// Google Test. They are subject to change without notice. They should not used +// by code external to Google Test. +// +// This header file is #included by . +// It should not be #included by other files. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ + +#ifdef __BORLANDC__ +// string.h is not guaranteed to provide strcpy on C++ Builder. +# include +#endif + +#include +#include "gtest/internal/gtest-port.h" + +#include + +namespace testing { +namespace internal { + +// String - a UTF-8 string class. +// +// For historic reasons, we don't use std::string. +// +// TODO(wan@google.com): replace this class with std::string or +// implement it in terms of the latter. +// +// Note that String can represent both NULL and the empty string, +// while std::string cannot represent NULL. +// +// NULL and the empty string are considered different. NULL is less +// than anything (including the empty string) except itself. +// +// This class only provides minimum functionality necessary for +// implementing Google Test. We do not intend to implement a full-fledged +// string class here. +// +// Since the purpose of this class is to provide a substitute for +// std::string on platforms where it cannot be used, we define a copy +// constructor and assignment operators such that we don't need +// conditional compilation in a lot of places. +// +// In order to make the representation efficient, the d'tor of String +// is not virtual. Therefore DO NOT INHERIT FROM String. +class GTEST_API_ String { + public: + // Static utility methods + + // Returns the input enclosed in double quotes if it's not NULL; + // otherwise returns "(null)". For example, "\"Hello\"" is returned + // for input "Hello". + // + // This is useful for printing a C string in the syntax of a literal. + // + // Known issue: escape sequences are not handled yet. + static String ShowCStringQuoted(const char* c_str); + + // Clones a 0-terminated C string, allocating memory using new. The + // caller is responsible for deleting the return value using + // delete[]. Returns the cloned string, or NULL if the input is + // NULL. + // + // This is different from strdup() in string.h, which allocates + // memory using malloc(). + static const char* CloneCString(const char* c_str); + +#if GTEST_OS_WINDOWS_MOBILE + // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be + // able to pass strings to Win32 APIs on CE we need to convert them + // to 'Unicode', UTF-16. + + // Creates a UTF-16 wide string from the given ANSI string, allocating + // memory using new. The caller is responsible for deleting the return + // value using delete[]. Returns the wide string, or NULL if the + // input is NULL. + // + // The wide string is created using the ANSI codepage (CP_ACP) to + // match the behaviour of the ANSI versions of Win32 calls and the + // C runtime. + static LPCWSTR AnsiToUtf16(const char* c_str); + + // Creates an ANSI string from the given wide string, allocating + // memory using new. The caller is responsible for deleting the return + // value using delete[]. Returns the ANSI string, or NULL if the + // input is NULL. + // + // The returned string is created using the ANSI codepage (CP_ACP) to + // match the behaviour of the ANSI versions of Win32 calls and the + // C runtime. + static const char* Utf16ToAnsi(LPCWSTR utf16_str); +#endif + + // Compares two C strings. Returns true iff they have the same content. + // + // Unlike strcmp(), this function can handle NULL argument(s). A + // NULL C string is considered different to any non-NULL C string, + // including the empty string. + static bool CStringEquals(const char* lhs, const char* rhs); + + // Converts a wide C string to a String using the UTF-8 encoding. + // NULL will be converted to "(null)". If an error occurred during + // the conversion, "(failed to convert from wide string)" is + // returned. + static String ShowWideCString(const wchar_t* wide_c_str); + + // Similar to ShowWideCString(), except that this function encloses + // the converted string in double quotes. + static String ShowWideCStringQuoted(const wchar_t* wide_c_str); + + // Compares two wide C strings. Returns true iff they have the same + // content. + // + // Unlike wcscmp(), this function can handle NULL argument(s). A + // NULL C string is considered different to any non-NULL C string, + // including the empty string. + static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); + + // Compares two C strings, ignoring case. Returns true iff they + // have the same content. + // + // Unlike strcasecmp(), this function can handle NULL argument(s). + // A NULL C string is considered different to any non-NULL C string, + // including the empty string. + static bool CaseInsensitiveCStringEquals(const char* lhs, + const char* rhs); + + // Compares two wide C strings, ignoring case. Returns true iff they + // have the same content. + // + // Unlike wcscasecmp(), this function can handle NULL argument(s). + // A NULL C string is considered different to any non-NULL wide C string, + // including the empty string. + // NB: The implementations on different platforms slightly differ. + // On windows, this method uses _wcsicmp which compares according to LC_CTYPE + // environment variable. On GNU platform this method uses wcscasecmp + // which compares according to LC_CTYPE category of the current locale. + // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the + // current locale. + static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, + const wchar_t* rhs); + + // Formats a list of arguments to a String, using the same format + // spec string as for printf. + // + // We do not use the StringPrintf class as it is not universally + // available. + // + // The result is limited to 4096 characters (including the tailing + // 0). If 4096 characters are not enough to format the input, + // "" is returned. + static String Format(const char* format, ...); + + // C'tors + + // The default c'tor constructs a NULL string. + String() : c_str_(NULL), length_(0) {} + + // Constructs a String by cloning a 0-terminated C string. + String(const char* a_c_str) { // NOLINT + if (a_c_str == NULL) { + c_str_ = NULL; + length_ = 0; + } else { + ConstructNonNull(a_c_str, strlen(a_c_str)); + } + } + + // Constructs a String by copying a given number of chars from a + // buffer. E.g. String("hello", 3) creates the string "hel", + // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "", + // and String(NULL, 1) results in access violation. + String(const char* buffer, size_t a_length) { + ConstructNonNull(buffer, a_length); + } + + // The copy c'tor creates a new copy of the string. The two + // String objects do not share content. + String(const String& str) : c_str_(NULL), length_(0) { *this = str; } + + // D'tor. String is intended to be a final class, so the d'tor + // doesn't need to be virtual. + ~String() { delete[] c_str_; } + + // Allows a String to be implicitly converted to an ::std::string or + // ::string, and vice versa. Converting a String containing a NULL + // pointer to ::std::string or ::string is undefined behavior. + // Converting a ::std::string or ::string containing an embedded NUL + // character to a String will result in the prefix up to the first + // NUL character. + String(const ::std::string& str) { + ConstructNonNull(str.c_str(), str.length()); + } + + operator ::std::string() const { return ::std::string(c_str(), length()); } + +#if GTEST_HAS_GLOBAL_STRING + String(const ::string& str) { + ConstructNonNull(str.c_str(), str.length()); + } + + operator ::string() const { return ::string(c_str(), length()); } +#endif // GTEST_HAS_GLOBAL_STRING + + // Returns true iff this is an empty string (i.e. ""). + bool empty() const { return (c_str() != NULL) && (length() == 0); } + + // Compares this with another String. + // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0 + // if this is greater than rhs. + int Compare(const String& rhs) const; + + // Returns true iff this String equals the given C string. A NULL + // string and a non-NULL string are considered not equal. + bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; } + + // Returns true iff this String is less than the given String. A + // NULL string is considered less than "". + bool operator<(const String& rhs) const { return Compare(rhs) < 0; } + + // Returns true iff this String doesn't equal the given C string. A NULL + // string and a non-NULL string are considered not equal. + bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); } + + // Returns true iff this String ends with the given suffix. *Any* + // String is considered to end with a NULL or empty suffix. + bool EndsWith(const char* suffix) const; + + // Returns true iff this String ends with the given suffix, not considering + // case. Any String is considered to end with a NULL or empty suffix. + bool EndsWithCaseInsensitive(const char* suffix) const; + + // Returns the length of the encapsulated string, or 0 if the + // string is NULL. + size_t length() const { return length_; } + + // Gets the 0-terminated C string this String object represents. + // The String object still owns the string. Therefore the caller + // should NOT delete the return value. + const char* c_str() const { return c_str_; } + + // Assigns a C string to this object. Self-assignment works. + const String& operator=(const char* a_c_str) { + return *this = String(a_c_str); + } + + // Assigns a String object to this object. Self-assignment works. + const String& operator=(const String& rhs) { + if (this != &rhs) { + delete[] c_str_; + if (rhs.c_str() == NULL) { + c_str_ = NULL; + length_ = 0; + } else { + ConstructNonNull(rhs.c_str(), rhs.length()); + } + } + + return *this; + } + + private: + // Constructs a non-NULL String from the given content. This + // function can only be called when c_str_ has not been allocated. + // ConstructNonNull(NULL, 0) results in an empty string (""). + // ConstructNonNull(NULL, non_zero) is undefined behavior. + void ConstructNonNull(const char* buffer, size_t a_length) { + char* const str = new char[a_length + 1]; + memcpy(str, buffer, a_length); + str[a_length] = '\0'; + c_str_ = str; + length_ = a_length; + } + + const char* c_str_; + size_t length_; +}; // class String + +// Streams a String to an ostream. Each '\0' character in the String +// is replaced with "\\0". +inline ::std::ostream& operator<<(::std::ostream& os, const String& str) { + if (str.c_str() == NULL) { + os << "(null)"; + } else { + const char* const c_str = str.c_str(); + for (size_t i = 0; i != str.length(); i++) { + if (c_str[i] == '\0') { + os << "\\0"; + } else { + os << c_str[i]; + } + } + } + return os; +} + +// Gets the content of the stringstream's buffer as a String. Each '\0' +// character in the buffer is replaced with "\\0". +GTEST_API_ String StringStreamToString(::std::stringstream* stream); + +// Converts a streamable value to a String. A NULL pointer is +// converted to "(null)". When the input value is a ::string, +// ::std::string, ::wstring, or ::std::wstring object, each NUL +// character in it is replaced with "\\0". + +// Declared here but defined in gtest.h, so that it has access +// to the definition of the Message class, required by the ARM +// compiler. +template +String StreamableToString(const T& streamable); + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ diff --git a/cli/test/include/gtest/internal/gtest-tuple.h b/cli/test/include/gtest/internal/gtest-tuple.h new file mode 100644 index 0000000..d1af50e --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-tuple.h @@ -0,0 +1,968 @@ +// This file was GENERATED by a script. DO NOT EDIT BY HAND!!! + +// Copyright 2009 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +// Implements a subset of TR1 tuple needed by Google Test and Google Mock. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ + +#include // For ::std::pair. + +// The compiler used in Symbian has a bug that prevents us from declaring the +// tuple template as a friend (it complains that tuple is redefined). This +// hack bypasses the bug by declaring the members that should otherwise be +// private as public. +// Sun Studio versions < 12 also have the above bug. +#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) +# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: +#else +# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ + template friend class tuple; \ + private: +#endif + +// GTEST_n_TUPLE_(T) is the type of an n-tuple. +#define GTEST_0_TUPLE_(T) tuple<> +#define GTEST_1_TUPLE_(T) tuple +#define GTEST_2_TUPLE_(T) tuple +#define GTEST_3_TUPLE_(T) tuple +#define GTEST_4_TUPLE_(T) tuple +#define GTEST_5_TUPLE_(T) tuple +#define GTEST_6_TUPLE_(T) tuple +#define GTEST_7_TUPLE_(T) tuple +#define GTEST_8_TUPLE_(T) tuple +#define GTEST_9_TUPLE_(T) tuple +#define GTEST_10_TUPLE_(T) tuple + +// GTEST_n_TYPENAMES_(T) declares a list of n typenames. +#define GTEST_0_TYPENAMES_(T) +#define GTEST_1_TYPENAMES_(T) typename T##0 +#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 +#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 +#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3 +#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4 +#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4, typename T##5 +#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4, typename T##5, typename T##6 +#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 +#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4, typename T##5, typename T##6, \ + typename T##7, typename T##8 +#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ + typename T##3, typename T##4, typename T##5, typename T##6, \ + typename T##7, typename T##8, typename T##9 + +// In theory, defining stuff in the ::std namespace is undefined +// behavior. We can do this as we are playing the role of a standard +// library vendor. +namespace std { +namespace tr1 { + +template +class tuple; + +// Anything in namespace gtest_internal is Google Test's INTERNAL +// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. +namespace gtest_internal { + +// ByRef::type is T if T is a reference; otherwise it's const T&. +template +struct ByRef { typedef const T& type; }; // NOLINT +template +struct ByRef { typedef T& type; }; // NOLINT + +// A handy wrapper for ByRef. +#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type + +// AddRef::type is T if T is a reference; otherwise it's T&. This +// is the same as tr1::add_reference::type. +template +struct AddRef { typedef T& type; }; // NOLINT +template +struct AddRef { typedef T& type; }; // NOLINT + +// A handy wrapper for AddRef. +#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type + +// A helper for implementing get(). +template class Get; + +// A helper for implementing tuple_element. kIndexValid is true +// iff k < the number of fields in tuple type T. +template +struct TupleElement; + +template +struct TupleElement { typedef T0 type; }; + +template +struct TupleElement { typedef T1 type; }; + +template +struct TupleElement { typedef T2 type; }; + +template +struct TupleElement { typedef T3 type; }; + +template +struct TupleElement { typedef T4 type; }; + +template +struct TupleElement { typedef T5 type; }; + +template +struct TupleElement { typedef T6 type; }; + +template +struct TupleElement { typedef T7 type; }; + +template +struct TupleElement { typedef T8 type; }; + +template +struct TupleElement { typedef T9 type; }; + +} // namespace gtest_internal + +template <> +class tuple<> { + public: + tuple() {} + tuple(const tuple& /* t */) {} + tuple& operator=(const tuple& /* t */) { return *this; } +}; + +template +class GTEST_1_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} + + tuple(const tuple& t) : f0_(t.f0_) {} + + template + tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_1_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { + f0_ = t.f0_; + return *this; + } + + T0 f0_; +}; + +template +class GTEST_2_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), + f1_(f1) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} + + template + tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} + template + tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_2_TUPLE_(U)& t) { + return CopyFrom(t); + } + template + tuple& operator=(const ::std::pair& p) { + f0_ = p.first; + f1_ = p.second; + return *this; + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + return *this; + } + + T0 f0_; + T1 f1_; +}; + +template +class GTEST_3_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} + + template + tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_3_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; +}; + +template +class GTEST_4_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), + f3_(f3) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} + + template + tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_4_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; +}; + +template +class GTEST_5_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, + GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_) {} + + template + tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_5_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; +}; + +template +class GTEST_6_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, + GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), + f5_(f5) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_), f5_(t.f5_) {} + + template + tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_6_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + f5_ = t.f5_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; + T5 f5_; +}; + +template +class GTEST_7_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, + GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), + f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} + + template + tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_7_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + f5_ = t.f5_; + f6_ = t.f6_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; + T5 f5_; + T6 f6_; +}; + +template +class GTEST_8_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, + GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, + GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), + f5_(f5), f6_(f6), f7_(f7) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} + + template + tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_8_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + f5_ = t.f5_; + f6_ = t.f6_; + f7_ = t.f7_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; + T5 f5_; + T6 f6_; + T7 f7_; +}; + +template +class GTEST_9_TUPLE_(T) { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, + GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, + GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), + f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} + + template + tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_9_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + f5_ = t.f5_; + f6_ = t.f6_; + f7_ = t.f7_; + f8_ = t.f8_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; + T5 f5_; + T6 f6_; + T7 f7_; + T8 f8_; +}; + +template +class tuple { + public: + template friend class gtest_internal::Get; + + tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), + f9_() {} + + explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, + GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, + GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, + GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), + f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} + + tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), + f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} + + template + tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), + f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), + f9_(t.f9_) {} + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_10_TUPLE_(U)& t) { + return CopyFrom(t); + } + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { + f0_ = t.f0_; + f1_ = t.f1_; + f2_ = t.f2_; + f3_ = t.f3_; + f4_ = t.f4_; + f5_ = t.f5_; + f6_ = t.f6_; + f7_ = t.f7_; + f8_ = t.f8_; + f9_ = t.f9_; + return *this; + } + + T0 f0_; + T1 f1_; + T2 f2_; + T3 f3_; + T4 f4_; + T5 f5_; + T6 f6_; + T7 f7_; + T8 f8_; + T9 f9_; +}; + +// 6.1.3.2 Tuple creation functions. + +// Known limitations: we don't support passing an +// std::tr1::reference_wrapper to make_tuple(). And we don't +// implement tie(). + +inline tuple<> make_tuple() { return tuple<>(); } + +template +inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { + return GTEST_1_TUPLE_(T)(f0); +} + +template +inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { + return GTEST_2_TUPLE_(T)(f0, f1); +} + +template +inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { + return GTEST_3_TUPLE_(T)(f0, f1, f2); +} + +template +inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3) { + return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); +} + +template +inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4) { + return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); +} + +template +inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4, const T5& f5) { + return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); +} + +template +inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4, const T5& f5, const T6& f6) { + return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); +} + +template +inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { + return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); +} + +template +inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, + const T8& f8) { + return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); +} + +template +inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, + const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, + const T8& f8, const T9& f9) { + return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); +} + +// 6.1.3.3 Tuple helper classes. + +template struct tuple_size; + +template +struct tuple_size { static const int value = 0; }; + +template +struct tuple_size { static const int value = 1; }; + +template +struct tuple_size { static const int value = 2; }; + +template +struct tuple_size { static const int value = 3; }; + +template +struct tuple_size { static const int value = 4; }; + +template +struct tuple_size { static const int value = 5; }; + +template +struct tuple_size { static const int value = 6; }; + +template +struct tuple_size { static const int value = 7; }; + +template +struct tuple_size { static const int value = 8; }; + +template +struct tuple_size { static const int value = 9; }; + +template +struct tuple_size { static const int value = 10; }; + +template +struct tuple_element { + typedef typename gtest_internal::TupleElement< + k < (tuple_size::value), k, Tuple>::type type; +}; + +#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type + +// 6.1.3.4 Element access. + +namespace gtest_internal { + +template <> +class Get<0> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) + Field(Tuple& t) { return t.f0_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) + ConstField(const Tuple& t) { return t.f0_; } +}; + +template <> +class Get<1> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) + Field(Tuple& t) { return t.f1_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) + ConstField(const Tuple& t) { return t.f1_; } +}; + +template <> +class Get<2> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) + Field(Tuple& t) { return t.f2_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) + ConstField(const Tuple& t) { return t.f2_; } +}; + +template <> +class Get<3> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) + Field(Tuple& t) { return t.f3_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) + ConstField(const Tuple& t) { return t.f3_; } +}; + +template <> +class Get<4> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) + Field(Tuple& t) { return t.f4_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) + ConstField(const Tuple& t) { return t.f4_; } +}; + +template <> +class Get<5> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) + Field(Tuple& t) { return t.f5_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) + ConstField(const Tuple& t) { return t.f5_; } +}; + +template <> +class Get<6> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) + Field(Tuple& t) { return t.f6_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) + ConstField(const Tuple& t) { return t.f6_; } +}; + +template <> +class Get<7> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) + Field(Tuple& t) { return t.f7_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) + ConstField(const Tuple& t) { return t.f7_; } +}; + +template <> +class Get<8> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) + Field(Tuple& t) { return t.f8_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) + ConstField(const Tuple& t) { return t.f8_; } +}; + +template <> +class Get<9> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) + Field(Tuple& t) { return t.f9_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) + ConstField(const Tuple& t) { return t.f9_; } +}; + +} // namespace gtest_internal + +template +GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) +get(GTEST_10_TUPLE_(T)& t) { + return gtest_internal::Get::Field(t); +} + +template +GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) +get(const GTEST_10_TUPLE_(T)& t) { + return gtest_internal::Get::ConstField(t); +} + +// 6.1.3.5 Relational operators + +// We only implement == and !=, as we don't have a need for the rest yet. + +namespace gtest_internal { + +// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the +// first k fields of t1 equals the first k fields of t2. +// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if +// k1 != k2. +template +struct SameSizeTuplePrefixComparator; + +template <> +struct SameSizeTuplePrefixComparator<0, 0> { + template + static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { + return true; + } +}; + +template +struct SameSizeTuplePrefixComparator { + template + static bool Eq(const Tuple1& t1, const Tuple2& t2) { + return SameSizeTuplePrefixComparator::Eq(t1, t2) && + ::std::tr1::get(t1) == ::std::tr1::get(t2); + } +}; + +} // namespace gtest_internal + +template +inline bool operator==(const GTEST_10_TUPLE_(T)& t, + const GTEST_10_TUPLE_(U)& u) { + return gtest_internal::SameSizeTuplePrefixComparator< + tuple_size::value, + tuple_size::value>::Eq(t, u); +} + +template +inline bool operator!=(const GTEST_10_TUPLE_(T)& t, + const GTEST_10_TUPLE_(U)& u) { return !(t == u); } + +// 6.1.4 Pairs. +// Unimplemented. + +} // namespace tr1 +} // namespace std + +#undef GTEST_0_TUPLE_ +#undef GTEST_1_TUPLE_ +#undef GTEST_2_TUPLE_ +#undef GTEST_3_TUPLE_ +#undef GTEST_4_TUPLE_ +#undef GTEST_5_TUPLE_ +#undef GTEST_6_TUPLE_ +#undef GTEST_7_TUPLE_ +#undef GTEST_8_TUPLE_ +#undef GTEST_9_TUPLE_ +#undef GTEST_10_TUPLE_ + +#undef GTEST_0_TYPENAMES_ +#undef GTEST_1_TYPENAMES_ +#undef GTEST_2_TYPENAMES_ +#undef GTEST_3_TYPENAMES_ +#undef GTEST_4_TYPENAMES_ +#undef GTEST_5_TYPENAMES_ +#undef GTEST_6_TYPENAMES_ +#undef GTEST_7_TYPENAMES_ +#undef GTEST_8_TYPENAMES_ +#undef GTEST_9_TYPENAMES_ +#undef GTEST_10_TYPENAMES_ + +#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ +#undef GTEST_BY_REF_ +#undef GTEST_ADD_REF_ +#undef GTEST_TUPLE_ELEMENT_ + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/cli/test/include/gtest/internal/gtest-tuple.h.pump b/cli/test/include/gtest/internal/gtest-tuple.h.pump new file mode 100644 index 0000000..ef51909 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-tuple.h.pump @@ -0,0 +1,336 @@ +$$ -*- mode: c++; -*- +$var n = 10 $$ Maximum number of tuple fields we want to support. +$$ This meta comment fixes auto-indentation in Emacs. }} +// Copyright 2009 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +// Implements a subset of TR1 tuple needed by Google Test and Google Mock. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ + +#include // For ::std::pair. + +// The compiler used in Symbian has a bug that prevents us from declaring the +// tuple template as a friend (it complains that tuple is redefined). This +// hack bypasses the bug by declaring the members that should otherwise be +// private as public. +// Sun Studio versions < 12 also have the above bug. +#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) +# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: +#else +# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ + template friend class tuple; \ + private: +#endif + + +$range i 0..n-1 +$range j 0..n +$range k 1..n +// GTEST_n_TUPLE_(T) is the type of an n-tuple. +#define GTEST_0_TUPLE_(T) tuple<> + +$for k [[ +$range m 0..k-1 +$range m2 k..n-1 +#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]> + +]] + +// GTEST_n_TYPENAMES_(T) declares a list of n typenames. + +$for j [[ +$range m 0..j-1 +#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]] + + +]] + +// In theory, defining stuff in the ::std namespace is undefined +// behavior. We can do this as we are playing the role of a standard +// library vendor. +namespace std { +namespace tr1 { + +template <$for i, [[typename T$i = void]]> +class tuple; + +// Anything in namespace gtest_internal is Google Test's INTERNAL +// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. +namespace gtest_internal { + +// ByRef::type is T if T is a reference; otherwise it's const T&. +template +struct ByRef { typedef const T& type; }; // NOLINT +template +struct ByRef { typedef T& type; }; // NOLINT + +// A handy wrapper for ByRef. +#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type + +// AddRef::type is T if T is a reference; otherwise it's T&. This +// is the same as tr1::add_reference::type. +template +struct AddRef { typedef T& type; }; // NOLINT +template +struct AddRef { typedef T& type; }; // NOLINT + +// A handy wrapper for AddRef. +#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type + +// A helper for implementing get(). +template class Get; + +// A helper for implementing tuple_element. kIndexValid is true +// iff k < the number of fields in tuple type T. +template +struct TupleElement; + + +$for i [[ +template +struct TupleElement [[]] +{ typedef T$i type; }; + + +]] +} // namespace gtest_internal + +template <> +class tuple<> { + public: + tuple() {} + tuple(const tuple& /* t */) {} + tuple& operator=(const tuple& /* t */) { return *this; } +}; + + +$for k [[ +$range m 0..k-1 +template +class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] { + public: + template friend class gtest_internal::Get; + + tuple() : $for m, [[f$(m)_()]] {} + + explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]] +$for m, [[f$(m)_(f$m)]] {} + + tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} + + template + tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} + +$if k == 2 [[ + template + tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} + +]] + + tuple& operator=(const tuple& t) { return CopyFrom(t); } + + template + tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) { + return CopyFrom(t); + } + +$if k == 2 [[ + template + tuple& operator=(const ::std::pair& p) { + f0_ = p.first; + f1_ = p.second; + return *this; + } + +]] + + GTEST_DECLARE_TUPLE_AS_FRIEND_ + + template + tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) { + +$for m [[ + f$(m)_ = t.f$(m)_; + +]] + return *this; + } + + +$for m [[ + T$m f$(m)_; + +]] +}; + + +]] +// 6.1.3.2 Tuple creation functions. + +// Known limitations: we don't support passing an +// std::tr1::reference_wrapper to make_tuple(). And we don't +// implement tie(). + +inline tuple<> make_tuple() { return tuple<>(); } + +$for k [[ +$range m 0..k-1 + +template +inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) { + return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]); +} + +]] + +// 6.1.3.3 Tuple helper classes. + +template struct tuple_size; + + +$for j [[ +template +struct tuple_size { static const int value = $j; }; + + +]] +template +struct tuple_element { + typedef typename gtest_internal::TupleElement< + k < (tuple_size::value), k, Tuple>::type type; +}; + +#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type + +// 6.1.3.4 Element access. + +namespace gtest_internal { + + +$for i [[ +template <> +class Get<$i> { + public: + template + static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) + Field(Tuple& t) { return t.f$(i)_; } // NOLINT + + template + static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) + ConstField(const Tuple& t) { return t.f$(i)_; } +}; + + +]] +} // namespace gtest_internal + +template +GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) +get(GTEST_$(n)_TUPLE_(T)& t) { + return gtest_internal::Get::Field(t); +} + +template +GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) +get(const GTEST_$(n)_TUPLE_(T)& t) { + return gtest_internal::Get::ConstField(t); +} + +// 6.1.3.5 Relational operators + +// We only implement == and !=, as we don't have a need for the rest yet. + +namespace gtest_internal { + +// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the +// first k fields of t1 equals the first k fields of t2. +// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if +// k1 != k2. +template +struct SameSizeTuplePrefixComparator; + +template <> +struct SameSizeTuplePrefixComparator<0, 0> { + template + static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { + return true; + } +}; + +template +struct SameSizeTuplePrefixComparator { + template + static bool Eq(const Tuple1& t1, const Tuple2& t2) { + return SameSizeTuplePrefixComparator::Eq(t1, t2) && + ::std::tr1::get(t1) == ::std::tr1::get(t2); + } +}; + +} // namespace gtest_internal + +template +inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t, + const GTEST_$(n)_TUPLE_(U)& u) { + return gtest_internal::SameSizeTuplePrefixComparator< + tuple_size::value, + tuple_size::value>::Eq(t, u); +} + +template +inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t, + const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); } + +// 6.1.4 Pairs. +// Unimplemented. + +} // namespace tr1 +} // namespace std + + +$for j [[ +#undef GTEST_$(j)_TUPLE_ + +]] + + +$for j [[ +#undef GTEST_$(j)_TYPENAMES_ + +]] + +#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ +#undef GTEST_BY_REF_ +#undef GTEST_ADD_REF_ +#undef GTEST_TUPLE_ELEMENT_ + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/cli/test/include/gtest/internal/gtest-type-util.h b/cli/test/include/gtest/internal/gtest-type-util.h new file mode 100644 index 0000000..b7b01b0 --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-type-util.h @@ -0,0 +1,3330 @@ +// This file was GENERATED by command: +// pump.py gtest-type-util.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +// Type utilities needed for implementing typed and type-parameterized +// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +// Currently we support at most 50 types in a list, and at most 50 +// type-parameterized tests in one type-parameterized test case. +// Please contact googletestframework@googlegroups.com if you need +// more. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ + +#include "gtest/internal/gtest-port.h" +#include "gtest/internal/gtest-string.h" + +// #ifdef __GNUC__ is too general here. It is possible to use gcc without using +// libstdc++ (which is where cxxabi.h comes from). +# ifdef __GLIBCXX__ +# include +# elif defined(__HP_aCC) +# include +# endif // __GLIBCXX__ + +namespace testing { +namespace internal { + +// GetTypeName() returns a human-readable name of type T. +// NB: This function is also used in Google Mock, so don't move it inside of +// the typed-test-only section below. +template +String GetTypeName() { +# if GTEST_HAS_RTTI + + const char* const name = typeid(T).name(); +# if defined(__GLIBCXX__) || defined(__HP_aCC) + int status = 0; + // gcc's implementation of typeid(T).name() mangles the type name, + // so we have to demangle it. +# ifdef __GLIBCXX__ + using abi::__cxa_demangle; +# endif // __GLIBCXX__ + char* const readable_name = __cxa_demangle(name, 0, 0, &status); + const String name_str(status == 0 ? readable_name : name); + free(readable_name); + return name_str; +# else + return name; +# endif // __GLIBCXX__ || __HP_aCC + +# else + + return ""; + +# endif // GTEST_HAS_RTTI +} + +#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +// AssertyTypeEq::type is defined iff T1 and T2 are the same +// type. This can be used as a compile-time assertion to ensure that +// two types are equal. + +template +struct AssertTypeEq; + +template +struct AssertTypeEq { + typedef bool type; +}; + +// A unique type used as the default value for the arguments of class +// template Types. This allows us to simulate variadic templates +// (e.g. Types, Type, and etc), which C++ doesn't +// support directly. +struct None {}; + +// The following family of struct and struct templates are used to +// represent type lists. In particular, TypesN +// represents a type list with N types (T1, T2, ..., and TN) in it. +// Except for Types0, every struct in the family has two member types: +// Head for the first type in the list, and Tail for the rest of the +// list. + +// The empty type list. +struct Types0 {}; + +// Type lists of length 1, 2, 3, and so on. + +template +struct Types1 { + typedef T1 Head; + typedef Types0 Tail; +}; +template +struct Types2 { + typedef T1 Head; + typedef Types1 Tail; +}; + +template +struct Types3 { + typedef T1 Head; + typedef Types2 Tail; +}; + +template +struct Types4 { + typedef T1 Head; + typedef Types3 Tail; +}; + +template +struct Types5 { + typedef T1 Head; + typedef Types4 Tail; +}; + +template +struct Types6 { + typedef T1 Head; + typedef Types5 Tail; +}; + +template +struct Types7 { + typedef T1 Head; + typedef Types6 Tail; +}; + +template +struct Types8 { + typedef T1 Head; + typedef Types7 Tail; +}; + +template +struct Types9 { + typedef T1 Head; + typedef Types8 Tail; +}; + +template +struct Types10 { + typedef T1 Head; + typedef Types9 Tail; +}; + +template +struct Types11 { + typedef T1 Head; + typedef Types10 Tail; +}; + +template +struct Types12 { + typedef T1 Head; + typedef Types11 Tail; +}; + +template +struct Types13 { + typedef T1 Head; + typedef Types12 Tail; +}; + +template +struct Types14 { + typedef T1 Head; + typedef Types13 Tail; +}; + +template +struct Types15 { + typedef T1 Head; + typedef Types14 Tail; +}; + +template +struct Types16 { + typedef T1 Head; + typedef Types15 Tail; +}; + +template +struct Types17 { + typedef T1 Head; + typedef Types16 Tail; +}; + +template +struct Types18 { + typedef T1 Head; + typedef Types17 Tail; +}; + +template +struct Types19 { + typedef T1 Head; + typedef Types18 Tail; +}; + +template +struct Types20 { + typedef T1 Head; + typedef Types19 Tail; +}; + +template +struct Types21 { + typedef T1 Head; + typedef Types20 Tail; +}; + +template +struct Types22 { + typedef T1 Head; + typedef Types21 Tail; +}; + +template +struct Types23 { + typedef T1 Head; + typedef Types22 Tail; +}; + +template +struct Types24 { + typedef T1 Head; + typedef Types23 Tail; +}; + +template +struct Types25 { + typedef T1 Head; + typedef Types24 Tail; +}; + +template +struct Types26 { + typedef T1 Head; + typedef Types25 Tail; +}; + +template +struct Types27 { + typedef T1 Head; + typedef Types26 Tail; +}; + +template +struct Types28 { + typedef T1 Head; + typedef Types27 Tail; +}; + +template +struct Types29 { + typedef T1 Head; + typedef Types28 Tail; +}; + +template +struct Types30 { + typedef T1 Head; + typedef Types29 Tail; +}; + +template +struct Types31 { + typedef T1 Head; + typedef Types30 Tail; +}; + +template +struct Types32 { + typedef T1 Head; + typedef Types31 Tail; +}; + +template +struct Types33 { + typedef T1 Head; + typedef Types32 Tail; +}; + +template +struct Types34 { + typedef T1 Head; + typedef Types33 Tail; +}; + +template +struct Types35 { + typedef T1 Head; + typedef Types34 Tail; +}; + +template +struct Types36 { + typedef T1 Head; + typedef Types35 Tail; +}; + +template +struct Types37 { + typedef T1 Head; + typedef Types36 Tail; +}; + +template +struct Types38 { + typedef T1 Head; + typedef Types37 Tail; +}; + +template +struct Types39 { + typedef T1 Head; + typedef Types38 Tail; +}; + +template +struct Types40 { + typedef T1 Head; + typedef Types39 Tail; +}; + +template +struct Types41 { + typedef T1 Head; + typedef Types40 Tail; +}; + +template +struct Types42 { + typedef T1 Head; + typedef Types41 Tail; +}; + +template +struct Types43 { + typedef T1 Head; + typedef Types42 Tail; +}; + +template +struct Types44 { + typedef T1 Head; + typedef Types43 Tail; +}; + +template +struct Types45 { + typedef T1 Head; + typedef Types44 Tail; +}; + +template +struct Types46 { + typedef T1 Head; + typedef Types45 Tail; +}; + +template +struct Types47 { + typedef T1 Head; + typedef Types46 Tail; +}; + +template +struct Types48 { + typedef T1 Head; + typedef Types47 Tail; +}; + +template +struct Types49 { + typedef T1 Head; + typedef Types48 Tail; +}; + +template +struct Types50 { + typedef T1 Head; + typedef Types49 Tail; +}; + + +} // namespace internal + +// We don't want to require the users to write TypesN<...> directly, +// as that would require them to count the length. Types<...> is much +// easier to write, but generates horrible messages when there is a +// compiler error, as gcc insists on printing out each template +// argument, even if it has the default value (this means Types +// will appear as Types in the compiler +// errors). +// +// Our solution is to combine the best part of the two approaches: a +// user would write Types, and Google Test will translate +// that to TypesN internally to make error messages +// readable. The translation is done by the 'type' member of the +// Types template. +template +struct Types { + typedef internal::Types50 type; +}; + +template <> +struct Types { + typedef internal::Types0 type; +}; +template +struct Types { + typedef internal::Types1 type; +}; +template +struct Types { + typedef internal::Types2 type; +}; +template +struct Types { + typedef internal::Types3 type; +}; +template +struct Types { + typedef internal::Types4 type; +}; +template +struct Types { + typedef internal::Types5 type; +}; +template +struct Types { + typedef internal::Types6 type; +}; +template +struct Types { + typedef internal::Types7 type; +}; +template +struct Types { + typedef internal::Types8 type; +}; +template +struct Types { + typedef internal::Types9 type; +}; +template +struct Types { + typedef internal::Types10 type; +}; +template +struct Types { + typedef internal::Types11 type; +}; +template +struct Types { + typedef internal::Types12 type; +}; +template +struct Types { + typedef internal::Types13 type; +}; +template +struct Types { + typedef internal::Types14 type; +}; +template +struct Types { + typedef internal::Types15 type; +}; +template +struct Types { + typedef internal::Types16 type; +}; +template +struct Types { + typedef internal::Types17 type; +}; +template +struct Types { + typedef internal::Types18 type; +}; +template +struct Types { + typedef internal::Types19 type; +}; +template +struct Types { + typedef internal::Types20 type; +}; +template +struct Types { + typedef internal::Types21 type; +}; +template +struct Types { + typedef internal::Types22 type; +}; +template +struct Types { + typedef internal::Types23 type; +}; +template +struct Types { + typedef internal::Types24 type; +}; +template +struct Types { + typedef internal::Types25 type; +}; +template +struct Types { + typedef internal::Types26 type; +}; +template +struct Types { + typedef internal::Types27 type; +}; +template +struct Types { + typedef internal::Types28 type; +}; +template +struct Types { + typedef internal::Types29 type; +}; +template +struct Types { + typedef internal::Types30 type; +}; +template +struct Types { + typedef internal::Types31 type; +}; +template +struct Types { + typedef internal::Types32 type; +}; +template +struct Types { + typedef internal::Types33 type; +}; +template +struct Types { + typedef internal::Types34 type; +}; +template +struct Types { + typedef internal::Types35 type; +}; +template +struct Types { + typedef internal::Types36 type; +}; +template +struct Types { + typedef internal::Types37 type; +}; +template +struct Types { + typedef internal::Types38 type; +}; +template +struct Types { + typedef internal::Types39 type; +}; +template +struct Types { + typedef internal::Types40 type; +}; +template +struct Types { + typedef internal::Types41 type; +}; +template +struct Types { + typedef internal::Types42 type; +}; +template +struct Types { + typedef internal::Types43 type; +}; +template +struct Types { + typedef internal::Types44 type; +}; +template +struct Types { + typedef internal::Types45 type; +}; +template +struct Types { + typedef internal::Types46 type; +}; +template +struct Types { + typedef internal::Types47 type; +}; +template +struct Types { + typedef internal::Types48 type; +}; +template +struct Types { + typedef internal::Types49 type; +}; + +namespace internal { + +# define GTEST_TEMPLATE_ template class + +// The template "selector" struct TemplateSel is used to +// represent Tmpl, which must be a class template with one type +// parameter, as a type. TemplateSel::Bind::type is defined +// as the type Tmpl. This allows us to actually instantiate the +// template "selected" by TemplateSel. +// +// This trick is necessary for simulating typedef for class templates, +// which C++ doesn't support directly. +template +struct TemplateSel { + template + struct Bind { + typedef Tmpl type; + }; +}; + +# define GTEST_BIND_(TmplSel, T) \ + TmplSel::template Bind::type + +// A unique struct template used as the default value for the +// arguments of class template Templates. This allows us to simulate +// variadic templates (e.g. Templates, Templates, +// and etc), which C++ doesn't support directly. +template +struct NoneT {}; + +// The following family of struct and struct templates are used to +// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except +// for Templates0, every struct in the family has two member types: +// Head for the selector of the first template in the list, and Tail +// for the rest of the list. + +// The empty template list. +struct Templates0 {}; + +// Template lists of length 1, 2, 3, and so on. + +template +struct Templates1 { + typedef TemplateSel Head; + typedef Templates0 Tail; +}; +template +struct Templates2 { + typedef TemplateSel Head; + typedef Templates1 Tail; +}; + +template +struct Templates3 { + typedef TemplateSel Head; + typedef Templates2 Tail; +}; + +template +struct Templates4 { + typedef TemplateSel Head; + typedef Templates3 Tail; +}; + +template +struct Templates5 { + typedef TemplateSel Head; + typedef Templates4 Tail; +}; + +template +struct Templates6 { + typedef TemplateSel Head; + typedef Templates5 Tail; +}; + +template +struct Templates7 { + typedef TemplateSel Head; + typedef Templates6 Tail; +}; + +template +struct Templates8 { + typedef TemplateSel Head; + typedef Templates7 Tail; +}; + +template +struct Templates9 { + typedef TemplateSel Head; + typedef Templates8 Tail; +}; + +template +struct Templates10 { + typedef TemplateSel Head; + typedef Templates9 Tail; +}; + +template +struct Templates11 { + typedef TemplateSel Head; + typedef Templates10 Tail; +}; + +template +struct Templates12 { + typedef TemplateSel Head; + typedef Templates11 Tail; +}; + +template +struct Templates13 { + typedef TemplateSel Head; + typedef Templates12 Tail; +}; + +template +struct Templates14 { + typedef TemplateSel Head; + typedef Templates13 Tail; +}; + +template +struct Templates15 { + typedef TemplateSel Head; + typedef Templates14 Tail; +}; + +template +struct Templates16 { + typedef TemplateSel Head; + typedef Templates15 Tail; +}; + +template +struct Templates17 { + typedef TemplateSel Head; + typedef Templates16 Tail; +}; + +template +struct Templates18 { + typedef TemplateSel Head; + typedef Templates17 Tail; +}; + +template +struct Templates19 { + typedef TemplateSel Head; + typedef Templates18 Tail; +}; + +template +struct Templates20 { + typedef TemplateSel Head; + typedef Templates19 Tail; +}; + +template +struct Templates21 { + typedef TemplateSel Head; + typedef Templates20 Tail; +}; + +template +struct Templates22 { + typedef TemplateSel Head; + typedef Templates21 Tail; +}; + +template +struct Templates23 { + typedef TemplateSel Head; + typedef Templates22 Tail; +}; + +template +struct Templates24 { + typedef TemplateSel Head; + typedef Templates23 Tail; +}; + +template +struct Templates25 { + typedef TemplateSel Head; + typedef Templates24 Tail; +}; + +template +struct Templates26 { + typedef TemplateSel Head; + typedef Templates25 Tail; +}; + +template +struct Templates27 { + typedef TemplateSel Head; + typedef Templates26 Tail; +}; + +template +struct Templates28 { + typedef TemplateSel Head; + typedef Templates27 Tail; +}; + +template +struct Templates29 { + typedef TemplateSel Head; + typedef Templates28 Tail; +}; + +template +struct Templates30 { + typedef TemplateSel Head; + typedef Templates29 Tail; +}; + +template +struct Templates31 { + typedef TemplateSel Head; + typedef Templates30 Tail; +}; + +template +struct Templates32 { + typedef TemplateSel Head; + typedef Templates31 Tail; +}; + +template +struct Templates33 { + typedef TemplateSel Head; + typedef Templates32 Tail; +}; + +template +struct Templates34 { + typedef TemplateSel Head; + typedef Templates33 Tail; +}; + +template +struct Templates35 { + typedef TemplateSel Head; + typedef Templates34 Tail; +}; + +template +struct Templates36 { + typedef TemplateSel Head; + typedef Templates35 Tail; +}; + +template +struct Templates37 { + typedef TemplateSel Head; + typedef Templates36 Tail; +}; + +template +struct Templates38 { + typedef TemplateSel Head; + typedef Templates37 Tail; +}; + +template +struct Templates39 { + typedef TemplateSel Head; + typedef Templates38 Tail; +}; + +template +struct Templates40 { + typedef TemplateSel Head; + typedef Templates39 Tail; +}; + +template +struct Templates41 { + typedef TemplateSel Head; + typedef Templates40 Tail; +}; + +template +struct Templates42 { + typedef TemplateSel Head; + typedef Templates41 Tail; +}; + +template +struct Templates43 { + typedef TemplateSel Head; + typedef Templates42 Tail; +}; + +template +struct Templates44 { + typedef TemplateSel Head; + typedef Templates43 Tail; +}; + +template +struct Templates45 { + typedef TemplateSel Head; + typedef Templates44 Tail; +}; + +template +struct Templates46 { + typedef TemplateSel Head; + typedef Templates45 Tail; +}; + +template +struct Templates47 { + typedef TemplateSel Head; + typedef Templates46 Tail; +}; + +template +struct Templates48 { + typedef TemplateSel Head; + typedef Templates47 Tail; +}; + +template +struct Templates49 { + typedef TemplateSel Head; + typedef Templates48 Tail; +}; + +template +struct Templates50 { + typedef TemplateSel Head; + typedef Templates49 Tail; +}; + + +// We don't want to require the users to write TemplatesN<...> directly, +// as that would require them to count the length. Templates<...> is much +// easier to write, but generates horrible messages when there is a +// compiler error, as gcc insists on printing out each template +// argument, even if it has the default value (this means Templates +// will appear as Templates in the compiler +// errors). +// +// Our solution is to combine the best part of the two approaches: a +// user would write Templates, and Google Test will translate +// that to TemplatesN internally to make error messages +// readable. The translation is done by the 'type' member of the +// Templates template. +template +struct Templates { + typedef Templates50 type; +}; + +template <> +struct Templates { + typedef Templates0 type; +}; +template +struct Templates { + typedef Templates1 type; +}; +template +struct Templates { + typedef Templates2 type; +}; +template +struct Templates { + typedef Templates3 type; +}; +template +struct Templates { + typedef Templates4 type; +}; +template +struct Templates { + typedef Templates5 type; +}; +template +struct Templates { + typedef Templates6 type; +}; +template +struct Templates { + typedef Templates7 type; +}; +template +struct Templates { + typedef Templates8 type; +}; +template +struct Templates { + typedef Templates9 type; +}; +template +struct Templates { + typedef Templates10 type; +}; +template +struct Templates { + typedef Templates11 type; +}; +template +struct Templates { + typedef Templates12 type; +}; +template +struct Templates { + typedef Templates13 type; +}; +template +struct Templates { + typedef Templates14 type; +}; +template +struct Templates { + typedef Templates15 type; +}; +template +struct Templates { + typedef Templates16 type; +}; +template +struct Templates { + typedef Templates17 type; +}; +template +struct Templates { + typedef Templates18 type; +}; +template +struct Templates { + typedef Templates19 type; +}; +template +struct Templates { + typedef Templates20 type; +}; +template +struct Templates { + typedef Templates21 type; +}; +template +struct Templates { + typedef Templates22 type; +}; +template +struct Templates { + typedef Templates23 type; +}; +template +struct Templates { + typedef Templates24 type; +}; +template +struct Templates { + typedef Templates25 type; +}; +template +struct Templates { + typedef Templates26 type; +}; +template +struct Templates { + typedef Templates27 type; +}; +template +struct Templates { + typedef Templates28 type; +}; +template +struct Templates { + typedef Templates29 type; +}; +template +struct Templates { + typedef Templates30 type; +}; +template +struct Templates { + typedef Templates31 type; +}; +template +struct Templates { + typedef Templates32 type; +}; +template +struct Templates { + typedef Templates33 type; +}; +template +struct Templates { + typedef Templates34 type; +}; +template +struct Templates { + typedef Templates35 type; +}; +template +struct Templates { + typedef Templates36 type; +}; +template +struct Templates { + typedef Templates37 type; +}; +template +struct Templates { + typedef Templates38 type; +}; +template +struct Templates { + typedef Templates39 type; +}; +template +struct Templates { + typedef Templates40 type; +}; +template +struct Templates { + typedef Templates41 type; +}; +template +struct Templates { + typedef Templates42 type; +}; +template +struct Templates { + typedef Templates43 type; +}; +template +struct Templates { + typedef Templates44 type; +}; +template +struct Templates { + typedef Templates45 type; +}; +template +struct Templates { + typedef Templates46 type; +}; +template +struct Templates { + typedef Templates47 type; +}; +template +struct Templates { + typedef Templates48 type; +}; +template +struct Templates { + typedef Templates49 type; +}; + +// The TypeList template makes it possible to use either a single type +// or a Types<...> list in TYPED_TEST_CASE() and +// INSTANTIATE_TYPED_TEST_CASE_P(). + +template +struct TypeList { typedef Types1 type; }; + +template +struct TypeList > { + typedef typename Types::type type; +}; + +#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/cli/test/include/gtest/internal/gtest-type-util.h.pump b/cli/test/include/gtest/internal/gtest-type-util.h.pump new file mode 100644 index 0000000..27f331d --- /dev/null +++ b/cli/test/include/gtest/internal/gtest-type-util.h.pump @@ -0,0 +1,296 @@ +$$ -*- mode: c++; -*- +$var n = 50 $$ Maximum length of type lists we want to support. +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) + +// Type utilities needed for implementing typed and type-parameterized +// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +// Currently we support at most $n types in a list, and at most $n +// type-parameterized tests in one type-parameterized test case. +// Please contact googletestframework@googlegroups.com if you need +// more. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ + +#include "gtest/internal/gtest-port.h" +#include "gtest/internal/gtest-string.h" + +// #ifdef __GNUC__ is too general here. It is possible to use gcc without using +// libstdc++ (which is where cxxabi.h comes from). +# ifdef __GLIBCXX__ +# include +# elif defined(__HP_aCC) +# include +# endif // __GLIBCXX__ + +namespace testing { +namespace internal { + +// GetTypeName() returns a human-readable name of type T. +// NB: This function is also used in Google Mock, so don't move it inside of +// the typed-test-only section below. +template +String GetTypeName() { +# if GTEST_HAS_RTTI + + const char* const name = typeid(T).name(); +# if defined(__GLIBCXX__) || defined(__HP_aCC) + int status = 0; + // gcc's implementation of typeid(T).name() mangles the type name, + // so we have to demangle it. +# ifdef __GLIBCXX__ + using abi::__cxa_demangle; +# endif // __GLIBCXX__ + char* const readable_name = __cxa_demangle(name, 0, 0, &status); + const String name_str(status == 0 ? readable_name : name); + free(readable_name); + return name_str; +# else + return name; +# endif // __GLIBCXX__ || __HP_aCC + +# else + + return ""; + +# endif // GTEST_HAS_RTTI +} + +#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +// AssertyTypeEq::type is defined iff T1 and T2 are the same +// type. This can be used as a compile-time assertion to ensure that +// two types are equal. + +template +struct AssertTypeEq; + +template +struct AssertTypeEq { + typedef bool type; +}; + +// A unique type used as the default value for the arguments of class +// template Types. This allows us to simulate variadic templates +// (e.g. Types, Type, and etc), which C++ doesn't +// support directly. +struct None {}; + +// The following family of struct and struct templates are used to +// represent type lists. In particular, TypesN +// represents a type list with N types (T1, T2, ..., and TN) in it. +// Except for Types0, every struct in the family has two member types: +// Head for the first type in the list, and Tail for the rest of the +// list. + +// The empty type list. +struct Types0 {}; + +// Type lists of length 1, 2, 3, and so on. + +template +struct Types1 { + typedef T1 Head; + typedef Types0 Tail; +}; + +$range i 2..n + +$for i [[ +$range j 1..i +$range k 2..i +template <$for j, [[typename T$j]]> +struct Types$i { + typedef T1 Head; + typedef Types$(i-1)<$for k, [[T$k]]> Tail; +}; + + +]] + +} // namespace internal + +// We don't want to require the users to write TypesN<...> directly, +// as that would require them to count the length. Types<...> is much +// easier to write, but generates horrible messages when there is a +// compiler error, as gcc insists on printing out each template +// argument, even if it has the default value (this means Types +// will appear as Types in the compiler +// errors). +// +// Our solution is to combine the best part of the two approaches: a +// user would write Types, and Google Test will translate +// that to TypesN internally to make error messages +// readable. The translation is done by the 'type' member of the +// Types template. + +$range i 1..n +template <$for i, [[typename T$i = internal::None]]> +struct Types { + typedef internal::Types$n<$for i, [[T$i]]> type; +}; + +template <> +struct Types<$for i, [[internal::None]]> { + typedef internal::Types0 type; +}; + +$range i 1..n-1 +$for i [[ +$range j 1..i +$range k i+1..n +template <$for j, [[typename T$j]]> +struct Types<$for j, [[T$j]]$for k[[, internal::None]]> { + typedef internal::Types$i<$for j, [[T$j]]> type; +}; + +]] + +namespace internal { + +# define GTEST_TEMPLATE_ template class + +// The template "selector" struct TemplateSel is used to +// represent Tmpl, which must be a class template with one type +// parameter, as a type. TemplateSel::Bind::type is defined +// as the type Tmpl. This allows us to actually instantiate the +// template "selected" by TemplateSel. +// +// This trick is necessary for simulating typedef for class templates, +// which C++ doesn't support directly. +template +struct TemplateSel { + template + struct Bind { + typedef Tmpl type; + }; +}; + +# define GTEST_BIND_(TmplSel, T) \ + TmplSel::template Bind::type + +// A unique struct template used as the default value for the +// arguments of class template Templates. This allows us to simulate +// variadic templates (e.g. Templates, Templates, +// and etc), which C++ doesn't support directly. +template +struct NoneT {}; + +// The following family of struct and struct templates are used to +// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except +// for Templates0, every struct in the family has two member types: +// Head for the selector of the first template in the list, and Tail +// for the rest of the list. + +// The empty template list. +struct Templates0 {}; + +// Template lists of length 1, 2, 3, and so on. + +template +struct Templates1 { + typedef TemplateSel Head; + typedef Templates0 Tail; +}; + +$range i 2..n + +$for i [[ +$range j 1..i +$range k 2..i +template <$for j, [[GTEST_TEMPLATE_ T$j]]> +struct Templates$i { + typedef TemplateSel Head; + typedef Templates$(i-1)<$for k, [[T$k]]> Tail; +}; + + +]] + +// We don't want to require the users to write TemplatesN<...> directly, +// as that would require them to count the length. Templates<...> is much +// easier to write, but generates horrible messages when there is a +// compiler error, as gcc insists on printing out each template +// argument, even if it has the default value (this means Templates +// will appear as Templates in the compiler +// errors). +// +// Our solution is to combine the best part of the two approaches: a +// user would write Templates, and Google Test will translate +// that to TemplatesN internally to make error messages +// readable. The translation is done by the 'type' member of the +// Templates template. + +$range i 1..n +template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]> +struct Templates { + typedef Templates$n<$for i, [[T$i]]> type; +}; + +template <> +struct Templates<$for i, [[NoneT]]> { + typedef Templates0 type; +}; + +$range i 1..n-1 +$for i [[ +$range j 1..i +$range k i+1..n +template <$for j, [[GTEST_TEMPLATE_ T$j]]> +struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> { + typedef Templates$i<$for j, [[T$j]]> type; +}; + +]] + +// The TypeList template makes it possible to use either a single type +// or a Types<...> list in TYPED_TEST_CASE() and +// INSTANTIATE_TYPED_TEST_CASE_P(). + +template +struct TypeList { typedef Types1 type; }; + + +$range i 1..n +template <$for i, [[typename T$i]]> +struct TypeList > { + typedef typename Types<$for i, [[T$i]]>::type type; +}; + +#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/cli/test/include/gtest/msxml6.h b/cli/test/include/gtest/msxml6.h new file mode 100644 index 0000000..f7946e3 --- /dev/null +++ b/cli/test/include/gtest/msxml6.h @@ -0,0 +1,27093 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* Compiler settings for msxml6.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + + +#ifndef __msxml6_h__ +#define __msxml6_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IXMLDOMImplementation_FWD_DEFINED__ +#define __IXMLDOMImplementation_FWD_DEFINED__ +typedef interface IXMLDOMImplementation IXMLDOMImplementation; +#endif /* __IXMLDOMImplementation_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMNode_FWD_DEFINED__ +#define __IXMLDOMNode_FWD_DEFINED__ +typedef interface IXMLDOMNode IXMLDOMNode; +#endif /* __IXMLDOMNode_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMDocumentFragment_FWD_DEFINED__ +#define __IXMLDOMDocumentFragment_FWD_DEFINED__ +typedef interface IXMLDOMDocumentFragment IXMLDOMDocumentFragment; +#endif /* __IXMLDOMDocumentFragment_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMDocument_FWD_DEFINED__ +#define __IXMLDOMDocument_FWD_DEFINED__ +typedef interface IXMLDOMDocument IXMLDOMDocument; +#endif /* __IXMLDOMDocument_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMDocument2_FWD_DEFINED__ +#define __IXMLDOMDocument2_FWD_DEFINED__ +typedef interface IXMLDOMDocument2 IXMLDOMDocument2; +#endif /* __IXMLDOMDocument2_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMDocument3_FWD_DEFINED__ +#define __IXMLDOMDocument3_FWD_DEFINED__ +typedef interface IXMLDOMDocument3 IXMLDOMDocument3; +#endif /* __IXMLDOMDocument3_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMNodeList_FWD_DEFINED__ +#define __IXMLDOMNodeList_FWD_DEFINED__ +typedef interface IXMLDOMNodeList IXMLDOMNodeList; +#endif /* __IXMLDOMNodeList_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMNamedNodeMap_FWD_DEFINED__ +#define __IXMLDOMNamedNodeMap_FWD_DEFINED__ +typedef interface IXMLDOMNamedNodeMap IXMLDOMNamedNodeMap; +#endif /* __IXMLDOMNamedNodeMap_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMCharacterData_FWD_DEFINED__ +#define __IXMLDOMCharacterData_FWD_DEFINED__ +typedef interface IXMLDOMCharacterData IXMLDOMCharacterData; +#endif /* __IXMLDOMCharacterData_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMAttribute_FWD_DEFINED__ +#define __IXMLDOMAttribute_FWD_DEFINED__ +typedef interface IXMLDOMAttribute IXMLDOMAttribute; +#endif /* __IXMLDOMAttribute_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMElement_FWD_DEFINED__ +#define __IXMLDOMElement_FWD_DEFINED__ +typedef interface IXMLDOMElement IXMLDOMElement; +#endif /* __IXMLDOMElement_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMText_FWD_DEFINED__ +#define __IXMLDOMText_FWD_DEFINED__ +typedef interface IXMLDOMText IXMLDOMText; +#endif /* __IXMLDOMText_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMComment_FWD_DEFINED__ +#define __IXMLDOMComment_FWD_DEFINED__ +typedef interface IXMLDOMComment IXMLDOMComment; +#endif /* __IXMLDOMComment_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMProcessingInstruction_FWD_DEFINED__ +#define __IXMLDOMProcessingInstruction_FWD_DEFINED__ +typedef interface IXMLDOMProcessingInstruction IXMLDOMProcessingInstruction; +#endif /* __IXMLDOMProcessingInstruction_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMCDATASection_FWD_DEFINED__ +#define __IXMLDOMCDATASection_FWD_DEFINED__ +typedef interface IXMLDOMCDATASection IXMLDOMCDATASection; +#endif /* __IXMLDOMCDATASection_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMDocumentType_FWD_DEFINED__ +#define __IXMLDOMDocumentType_FWD_DEFINED__ +typedef interface IXMLDOMDocumentType IXMLDOMDocumentType; +#endif /* __IXMLDOMDocumentType_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMNotation_FWD_DEFINED__ +#define __IXMLDOMNotation_FWD_DEFINED__ +typedef interface IXMLDOMNotation IXMLDOMNotation; +#endif /* __IXMLDOMNotation_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMEntity_FWD_DEFINED__ +#define __IXMLDOMEntity_FWD_DEFINED__ +typedef interface IXMLDOMEntity IXMLDOMEntity; +#endif /* __IXMLDOMEntity_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMEntityReference_FWD_DEFINED__ +#define __IXMLDOMEntityReference_FWD_DEFINED__ +typedef interface IXMLDOMEntityReference IXMLDOMEntityReference; +#endif /* __IXMLDOMEntityReference_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMParseError_FWD_DEFINED__ +#define __IXMLDOMParseError_FWD_DEFINED__ +typedef interface IXMLDOMParseError IXMLDOMParseError; +#endif /* __IXMLDOMParseError_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMParseError2_FWD_DEFINED__ +#define __IXMLDOMParseError2_FWD_DEFINED__ +typedef interface IXMLDOMParseError2 IXMLDOMParseError2; +#endif /* __IXMLDOMParseError2_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMParseErrorCollection_FWD_DEFINED__ +#define __IXMLDOMParseErrorCollection_FWD_DEFINED__ +typedef interface IXMLDOMParseErrorCollection IXMLDOMParseErrorCollection; +#endif /* __IXMLDOMParseErrorCollection_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMSchemaCollection_FWD_DEFINED__ +#define __IXMLDOMSchemaCollection_FWD_DEFINED__ +typedef interface IXMLDOMSchemaCollection IXMLDOMSchemaCollection; +#endif /* __IXMLDOMSchemaCollection_FWD_DEFINED__ */ + + +#ifndef __IXTLRuntime_FWD_DEFINED__ +#define __IXTLRuntime_FWD_DEFINED__ +typedef interface IXTLRuntime IXTLRuntime; +#endif /* __IXTLRuntime_FWD_DEFINED__ */ + + +#ifndef __IXSLTemplate_FWD_DEFINED__ +#define __IXSLTemplate_FWD_DEFINED__ +typedef interface IXSLTemplate IXSLTemplate; +#endif /* __IXSLTemplate_FWD_DEFINED__ */ + + +#ifndef __IXSLProcessor_FWD_DEFINED__ +#define __IXSLProcessor_FWD_DEFINED__ +typedef interface IXSLProcessor IXSLProcessor; +#endif /* __IXSLProcessor_FWD_DEFINED__ */ + + +#ifndef __ISAXXMLReader_FWD_DEFINED__ +#define __ISAXXMLReader_FWD_DEFINED__ +typedef interface ISAXXMLReader ISAXXMLReader; +#endif /* __ISAXXMLReader_FWD_DEFINED__ */ + + +#ifndef __ISAXXMLFilter_FWD_DEFINED__ +#define __ISAXXMLFilter_FWD_DEFINED__ +typedef interface ISAXXMLFilter ISAXXMLFilter; +#endif /* __ISAXXMLFilter_FWD_DEFINED__ */ + + +#ifndef __ISAXLocator_FWD_DEFINED__ +#define __ISAXLocator_FWD_DEFINED__ +typedef interface ISAXLocator ISAXLocator; +#endif /* __ISAXLocator_FWD_DEFINED__ */ + + +#ifndef __ISAXEntityResolver_FWD_DEFINED__ +#define __ISAXEntityResolver_FWD_DEFINED__ +typedef interface ISAXEntityResolver ISAXEntityResolver; +#endif /* __ISAXEntityResolver_FWD_DEFINED__ */ + + +#ifndef __ISAXContentHandler_FWD_DEFINED__ +#define __ISAXContentHandler_FWD_DEFINED__ +typedef interface ISAXContentHandler ISAXContentHandler; +#endif /* __ISAXContentHandler_FWD_DEFINED__ */ + + +#ifndef __ISAXDTDHandler_FWD_DEFINED__ +#define __ISAXDTDHandler_FWD_DEFINED__ +typedef interface ISAXDTDHandler ISAXDTDHandler; +#endif /* __ISAXDTDHandler_FWD_DEFINED__ */ + + +#ifndef __ISAXErrorHandler_FWD_DEFINED__ +#define __ISAXErrorHandler_FWD_DEFINED__ +typedef interface ISAXErrorHandler ISAXErrorHandler; +#endif /* __ISAXErrorHandler_FWD_DEFINED__ */ + + +#ifndef __ISAXLexicalHandler_FWD_DEFINED__ +#define __ISAXLexicalHandler_FWD_DEFINED__ +typedef interface ISAXLexicalHandler ISAXLexicalHandler; +#endif /* __ISAXLexicalHandler_FWD_DEFINED__ */ + + +#ifndef __ISAXDeclHandler_FWD_DEFINED__ +#define __ISAXDeclHandler_FWD_DEFINED__ +typedef interface ISAXDeclHandler ISAXDeclHandler; +#endif /* __ISAXDeclHandler_FWD_DEFINED__ */ + + +#ifndef __ISAXAttributes_FWD_DEFINED__ +#define __ISAXAttributes_FWD_DEFINED__ +typedef interface ISAXAttributes ISAXAttributes; +#endif /* __ISAXAttributes_FWD_DEFINED__ */ + + +#ifndef __IVBSAXXMLReader_FWD_DEFINED__ +#define __IVBSAXXMLReader_FWD_DEFINED__ +typedef interface IVBSAXXMLReader IVBSAXXMLReader; +#endif /* __IVBSAXXMLReader_FWD_DEFINED__ */ + + +#ifndef __IVBSAXXMLFilter_FWD_DEFINED__ +#define __IVBSAXXMLFilter_FWD_DEFINED__ +typedef interface IVBSAXXMLFilter IVBSAXXMLFilter; +#endif /* __IVBSAXXMLFilter_FWD_DEFINED__ */ + + +#ifndef __IVBSAXLocator_FWD_DEFINED__ +#define __IVBSAXLocator_FWD_DEFINED__ +typedef interface IVBSAXLocator IVBSAXLocator; +#endif /* __IVBSAXLocator_FWD_DEFINED__ */ + + +#ifndef __IVBSAXEntityResolver_FWD_DEFINED__ +#define __IVBSAXEntityResolver_FWD_DEFINED__ +typedef interface IVBSAXEntityResolver IVBSAXEntityResolver; +#endif /* __IVBSAXEntityResolver_FWD_DEFINED__ */ + + +#ifndef __IVBSAXContentHandler_FWD_DEFINED__ +#define __IVBSAXContentHandler_FWD_DEFINED__ +typedef interface IVBSAXContentHandler IVBSAXContentHandler; +#endif /* __IVBSAXContentHandler_FWD_DEFINED__ */ + + +#ifndef __IVBSAXDTDHandler_FWD_DEFINED__ +#define __IVBSAXDTDHandler_FWD_DEFINED__ +typedef interface IVBSAXDTDHandler IVBSAXDTDHandler; +#endif /* __IVBSAXDTDHandler_FWD_DEFINED__ */ + + +#ifndef __IVBSAXErrorHandler_FWD_DEFINED__ +#define __IVBSAXErrorHandler_FWD_DEFINED__ +typedef interface IVBSAXErrorHandler IVBSAXErrorHandler; +#endif /* __IVBSAXErrorHandler_FWD_DEFINED__ */ + + +#ifndef __IVBSAXLexicalHandler_FWD_DEFINED__ +#define __IVBSAXLexicalHandler_FWD_DEFINED__ +typedef interface IVBSAXLexicalHandler IVBSAXLexicalHandler; +#endif /* __IVBSAXLexicalHandler_FWD_DEFINED__ */ + + +#ifndef __IVBSAXDeclHandler_FWD_DEFINED__ +#define __IVBSAXDeclHandler_FWD_DEFINED__ +typedef interface IVBSAXDeclHandler IVBSAXDeclHandler; +#endif /* __IVBSAXDeclHandler_FWD_DEFINED__ */ + + +#ifndef __IVBSAXAttributes_FWD_DEFINED__ +#define __IVBSAXAttributes_FWD_DEFINED__ +typedef interface IVBSAXAttributes IVBSAXAttributes; +#endif /* __IVBSAXAttributes_FWD_DEFINED__ */ + + +#ifndef __IMXWriter_FWD_DEFINED__ +#define __IMXWriter_FWD_DEFINED__ +typedef interface IMXWriter IMXWriter; +#endif /* __IMXWriter_FWD_DEFINED__ */ + + +#ifndef __IMXAttributes_FWD_DEFINED__ +#define __IMXAttributes_FWD_DEFINED__ +typedef interface IMXAttributes IMXAttributes; +#endif /* __IMXAttributes_FWD_DEFINED__ */ + + +#ifndef __IMXReaderControl_FWD_DEFINED__ +#define __IMXReaderControl_FWD_DEFINED__ +typedef interface IMXReaderControl IMXReaderControl; +#endif /* __IMXReaderControl_FWD_DEFINED__ */ + + +#ifndef __IMXSchemaDeclHandler_FWD_DEFINED__ +#define __IMXSchemaDeclHandler_FWD_DEFINED__ +typedef interface IMXSchemaDeclHandler IMXSchemaDeclHandler; +#endif /* __IMXSchemaDeclHandler_FWD_DEFINED__ */ + + +#ifndef __IMXXMLFilter_FWD_DEFINED__ +#define __IMXXMLFilter_FWD_DEFINED__ +typedef interface IMXXMLFilter IMXXMLFilter; +#endif /* __IMXXMLFilter_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMSchemaCollection2_FWD_DEFINED__ +#define __IXMLDOMSchemaCollection2_FWD_DEFINED__ +typedef interface IXMLDOMSchemaCollection2 IXMLDOMSchemaCollection2; +#endif /* __IXMLDOMSchemaCollection2_FWD_DEFINED__ */ + + +#ifndef __ISchemaStringCollection_FWD_DEFINED__ +#define __ISchemaStringCollection_FWD_DEFINED__ +typedef interface ISchemaStringCollection ISchemaStringCollection; +#endif /* __ISchemaStringCollection_FWD_DEFINED__ */ + + +#ifndef __ISchemaItemCollection_FWD_DEFINED__ +#define __ISchemaItemCollection_FWD_DEFINED__ +typedef interface ISchemaItemCollection ISchemaItemCollection; +#endif /* __ISchemaItemCollection_FWD_DEFINED__ */ + + +#ifndef __ISchemaItem_FWD_DEFINED__ +#define __ISchemaItem_FWD_DEFINED__ +typedef interface ISchemaItem ISchemaItem; +#endif /* __ISchemaItem_FWD_DEFINED__ */ + + +#ifndef __ISchema_FWD_DEFINED__ +#define __ISchema_FWD_DEFINED__ +typedef interface ISchema ISchema; +#endif /* __ISchema_FWD_DEFINED__ */ + + +#ifndef __ISchemaParticle_FWD_DEFINED__ +#define __ISchemaParticle_FWD_DEFINED__ +typedef interface ISchemaParticle ISchemaParticle; +#endif /* __ISchemaParticle_FWD_DEFINED__ */ + + +#ifndef __ISchemaAttribute_FWD_DEFINED__ +#define __ISchemaAttribute_FWD_DEFINED__ +typedef interface ISchemaAttribute ISchemaAttribute; +#endif /* __ISchemaAttribute_FWD_DEFINED__ */ + + +#ifndef __ISchemaElement_FWD_DEFINED__ +#define __ISchemaElement_FWD_DEFINED__ +typedef interface ISchemaElement ISchemaElement; +#endif /* __ISchemaElement_FWD_DEFINED__ */ + + +#ifndef __ISchemaType_FWD_DEFINED__ +#define __ISchemaType_FWD_DEFINED__ +typedef interface ISchemaType ISchemaType; +#endif /* __ISchemaType_FWD_DEFINED__ */ + + +#ifndef __ISchemaComplexType_FWD_DEFINED__ +#define __ISchemaComplexType_FWD_DEFINED__ +typedef interface ISchemaComplexType ISchemaComplexType; +#endif /* __ISchemaComplexType_FWD_DEFINED__ */ + + +#ifndef __ISchemaAttributeGroup_FWD_DEFINED__ +#define __ISchemaAttributeGroup_FWD_DEFINED__ +typedef interface ISchemaAttributeGroup ISchemaAttributeGroup; +#endif /* __ISchemaAttributeGroup_FWD_DEFINED__ */ + + +#ifndef __ISchemaModelGroup_FWD_DEFINED__ +#define __ISchemaModelGroup_FWD_DEFINED__ +typedef interface ISchemaModelGroup ISchemaModelGroup; +#endif /* __ISchemaModelGroup_FWD_DEFINED__ */ + + +#ifndef __ISchemaAny_FWD_DEFINED__ +#define __ISchemaAny_FWD_DEFINED__ +typedef interface ISchemaAny ISchemaAny; +#endif /* __ISchemaAny_FWD_DEFINED__ */ + + +#ifndef __ISchemaIdentityConstraint_FWD_DEFINED__ +#define __ISchemaIdentityConstraint_FWD_DEFINED__ +typedef interface ISchemaIdentityConstraint ISchemaIdentityConstraint; +#endif /* __ISchemaIdentityConstraint_FWD_DEFINED__ */ + + +#ifndef __ISchemaNotation_FWD_DEFINED__ +#define __ISchemaNotation_FWD_DEFINED__ +typedef interface ISchemaNotation ISchemaNotation; +#endif /* __ISchemaNotation_FWD_DEFINED__ */ + + +#ifndef __IXMLDOMSelection_FWD_DEFINED__ +#define __IXMLDOMSelection_FWD_DEFINED__ +typedef interface IXMLDOMSelection IXMLDOMSelection; +#endif /* __IXMLDOMSelection_FWD_DEFINED__ */ + + +#ifndef __XMLDOMDocumentEvents_FWD_DEFINED__ +#define __XMLDOMDocumentEvents_FWD_DEFINED__ +typedef interface XMLDOMDocumentEvents XMLDOMDocumentEvents; +#endif /* __XMLDOMDocumentEvents_FWD_DEFINED__ */ + + +#ifndef __IXMLHTTPRequest_FWD_DEFINED__ +#define __IXMLHTTPRequest_FWD_DEFINED__ +typedef interface IXMLHTTPRequest IXMLHTTPRequest; +#endif /* __IXMLHTTPRequest_FWD_DEFINED__ */ + + +#ifndef __IServerXMLHTTPRequest_FWD_DEFINED__ +#define __IServerXMLHTTPRequest_FWD_DEFINED__ +typedef interface IServerXMLHTTPRequest IServerXMLHTTPRequest; +#endif /* __IServerXMLHTTPRequest_FWD_DEFINED__ */ + + +#ifndef __IServerXMLHTTPRequest2_FWD_DEFINED__ +#define __IServerXMLHTTPRequest2_FWD_DEFINED__ +typedef interface IServerXMLHTTPRequest2 IServerXMLHTTPRequest2; +#endif /* __IServerXMLHTTPRequest2_FWD_DEFINED__ */ + + +#ifndef __IMXNamespacePrefixes_FWD_DEFINED__ +#define __IMXNamespacePrefixes_FWD_DEFINED__ +typedef interface IMXNamespacePrefixes IMXNamespacePrefixes; +#endif /* __IMXNamespacePrefixes_FWD_DEFINED__ */ + + +#ifndef __IVBMXNamespaceManager_FWD_DEFINED__ +#define __IVBMXNamespaceManager_FWD_DEFINED__ +typedef interface IVBMXNamespaceManager IVBMXNamespaceManager; +#endif /* __IVBMXNamespaceManager_FWD_DEFINED__ */ + + +#ifndef __IMXNamespaceManager_FWD_DEFINED__ +#define __IMXNamespaceManager_FWD_DEFINED__ +typedef interface IMXNamespaceManager IMXNamespaceManager; +#endif /* __IMXNamespaceManager_FWD_DEFINED__ */ + + +#ifndef __DOMDocument_FWD_DEFINED__ +#define __DOMDocument_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DOMDocument DOMDocument; +#else +typedef struct DOMDocument DOMDocument; +#endif /* __cplusplus */ + +#endif /* __DOMDocument_FWD_DEFINED__ */ + + +#ifndef __DOMDocument26_FWD_DEFINED__ +#define __DOMDocument26_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DOMDocument26 DOMDocument26; +#else +typedef struct DOMDocument26 DOMDocument26; +#endif /* __cplusplus */ + +#endif /* __DOMDocument26_FWD_DEFINED__ */ + + +#ifndef __DOMDocument30_FWD_DEFINED__ +#define __DOMDocument30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DOMDocument30 DOMDocument30; +#else +typedef struct DOMDocument30 DOMDocument30; +#endif /* __cplusplus */ + +#endif /* __DOMDocument30_FWD_DEFINED__ */ + + +#ifndef __DOMDocument40_FWD_DEFINED__ +#define __DOMDocument40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DOMDocument40 DOMDocument40; +#else +typedef struct DOMDocument40 DOMDocument40; +#endif /* __cplusplus */ + +#endif /* __DOMDocument40_FWD_DEFINED__ */ + + +#ifndef __DOMDocument60_FWD_DEFINED__ +#define __DOMDocument60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DOMDocument60 DOMDocument60; +#else +typedef struct DOMDocument60 DOMDocument60; +#endif /* __cplusplus */ + +#endif /* __DOMDocument60_FWD_DEFINED__ */ + + +#ifndef __FreeThreadedDOMDocument_FWD_DEFINED__ +#define __FreeThreadedDOMDocument_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class FreeThreadedDOMDocument FreeThreadedDOMDocument; +#else +typedef struct FreeThreadedDOMDocument FreeThreadedDOMDocument; +#endif /* __cplusplus */ + +#endif /* __FreeThreadedDOMDocument_FWD_DEFINED__ */ + + +#ifndef __FreeThreadedDOMDocument26_FWD_DEFINED__ +#define __FreeThreadedDOMDocument26_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class FreeThreadedDOMDocument26 FreeThreadedDOMDocument26; +#else +typedef struct FreeThreadedDOMDocument26 FreeThreadedDOMDocument26; +#endif /* __cplusplus */ + +#endif /* __FreeThreadedDOMDocument26_FWD_DEFINED__ */ + + +#ifndef __FreeThreadedDOMDocument30_FWD_DEFINED__ +#define __FreeThreadedDOMDocument30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class FreeThreadedDOMDocument30 FreeThreadedDOMDocument30; +#else +typedef struct FreeThreadedDOMDocument30 FreeThreadedDOMDocument30; +#endif /* __cplusplus */ + +#endif /* __FreeThreadedDOMDocument30_FWD_DEFINED__ */ + + +#ifndef __FreeThreadedDOMDocument40_FWD_DEFINED__ +#define __FreeThreadedDOMDocument40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class FreeThreadedDOMDocument40 FreeThreadedDOMDocument40; +#else +typedef struct FreeThreadedDOMDocument40 FreeThreadedDOMDocument40; +#endif /* __cplusplus */ + +#endif /* __FreeThreadedDOMDocument40_FWD_DEFINED__ */ + + +#ifndef __FreeThreadedDOMDocument60_FWD_DEFINED__ +#define __FreeThreadedDOMDocument60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class FreeThreadedDOMDocument60 FreeThreadedDOMDocument60; +#else +typedef struct FreeThreadedDOMDocument60 FreeThreadedDOMDocument60; +#endif /* __cplusplus */ + +#endif /* __FreeThreadedDOMDocument60_FWD_DEFINED__ */ + + +#ifndef __XMLSchemaCache_FWD_DEFINED__ +#define __XMLSchemaCache_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLSchemaCache XMLSchemaCache; +#else +typedef struct XMLSchemaCache XMLSchemaCache; +#endif /* __cplusplus */ + +#endif /* __XMLSchemaCache_FWD_DEFINED__ */ + + +#ifndef __XMLSchemaCache26_FWD_DEFINED__ +#define __XMLSchemaCache26_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLSchemaCache26 XMLSchemaCache26; +#else +typedef struct XMLSchemaCache26 XMLSchemaCache26; +#endif /* __cplusplus */ + +#endif /* __XMLSchemaCache26_FWD_DEFINED__ */ + + +#ifndef __XMLSchemaCache30_FWD_DEFINED__ +#define __XMLSchemaCache30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLSchemaCache30 XMLSchemaCache30; +#else +typedef struct XMLSchemaCache30 XMLSchemaCache30; +#endif /* __cplusplus */ + +#endif /* __XMLSchemaCache30_FWD_DEFINED__ */ + + +#ifndef __XMLSchemaCache40_FWD_DEFINED__ +#define __XMLSchemaCache40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLSchemaCache40 XMLSchemaCache40; +#else +typedef struct XMLSchemaCache40 XMLSchemaCache40; +#endif /* __cplusplus */ + +#endif /* __XMLSchemaCache40_FWD_DEFINED__ */ + + +#ifndef __XMLSchemaCache60_FWD_DEFINED__ +#define __XMLSchemaCache60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLSchemaCache60 XMLSchemaCache60; +#else +typedef struct XMLSchemaCache60 XMLSchemaCache60; +#endif /* __cplusplus */ + +#endif /* __XMLSchemaCache60_FWD_DEFINED__ */ + + +#ifndef __XSLTemplate_FWD_DEFINED__ +#define __XSLTemplate_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XSLTemplate XSLTemplate; +#else +typedef struct XSLTemplate XSLTemplate; +#endif /* __cplusplus */ + +#endif /* __XSLTemplate_FWD_DEFINED__ */ + + +#ifndef __XSLTemplate26_FWD_DEFINED__ +#define __XSLTemplate26_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XSLTemplate26 XSLTemplate26; +#else +typedef struct XSLTemplate26 XSLTemplate26; +#endif /* __cplusplus */ + +#endif /* __XSLTemplate26_FWD_DEFINED__ */ + + +#ifndef __XSLTemplate30_FWD_DEFINED__ +#define __XSLTemplate30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XSLTemplate30 XSLTemplate30; +#else +typedef struct XSLTemplate30 XSLTemplate30; +#endif /* __cplusplus */ + +#endif /* __XSLTemplate30_FWD_DEFINED__ */ + + +#ifndef __XSLTemplate40_FWD_DEFINED__ +#define __XSLTemplate40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XSLTemplate40 XSLTemplate40; +#else +typedef struct XSLTemplate40 XSLTemplate40; +#endif /* __cplusplus */ + +#endif /* __XSLTemplate40_FWD_DEFINED__ */ + + +#ifndef __XSLTemplate60_FWD_DEFINED__ +#define __XSLTemplate60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XSLTemplate60 XSLTemplate60; +#else +typedef struct XSLTemplate60 XSLTemplate60; +#endif /* __cplusplus */ + +#endif /* __XSLTemplate60_FWD_DEFINED__ */ + + +#ifndef __XMLHTTP_FWD_DEFINED__ +#define __XMLHTTP_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLHTTP XMLHTTP; +#else +typedef struct XMLHTTP XMLHTTP; +#endif /* __cplusplus */ + +#endif /* __XMLHTTP_FWD_DEFINED__ */ + + +#ifndef __XMLHTTP26_FWD_DEFINED__ +#define __XMLHTTP26_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLHTTP26 XMLHTTP26; +#else +typedef struct XMLHTTP26 XMLHTTP26; +#endif /* __cplusplus */ + +#endif /* __XMLHTTP26_FWD_DEFINED__ */ + + +#ifndef __XMLHTTP30_FWD_DEFINED__ +#define __XMLHTTP30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLHTTP30 XMLHTTP30; +#else +typedef struct XMLHTTP30 XMLHTTP30; +#endif /* __cplusplus */ + +#endif /* __XMLHTTP30_FWD_DEFINED__ */ + + +#ifndef __XMLHTTP40_FWD_DEFINED__ +#define __XMLHTTP40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLHTTP40 XMLHTTP40; +#else +typedef struct XMLHTTP40 XMLHTTP40; +#endif /* __cplusplus */ + +#endif /* __XMLHTTP40_FWD_DEFINED__ */ + + +#ifndef __XMLHTTP60_FWD_DEFINED__ +#define __XMLHTTP60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class XMLHTTP60 XMLHTTP60; +#else +typedef struct XMLHTTP60 XMLHTTP60; +#endif /* __cplusplus */ + +#endif /* __XMLHTTP60_FWD_DEFINED__ */ + + +#ifndef __ServerXMLHTTP_FWD_DEFINED__ +#define __ServerXMLHTTP_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ServerXMLHTTP ServerXMLHTTP; +#else +typedef struct ServerXMLHTTP ServerXMLHTTP; +#endif /* __cplusplus */ + +#endif /* __ServerXMLHTTP_FWD_DEFINED__ */ + + +#ifndef __ServerXMLHTTP30_FWD_DEFINED__ +#define __ServerXMLHTTP30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ServerXMLHTTP30 ServerXMLHTTP30; +#else +typedef struct ServerXMLHTTP30 ServerXMLHTTP30; +#endif /* __cplusplus */ + +#endif /* __ServerXMLHTTP30_FWD_DEFINED__ */ + + +#ifndef __ServerXMLHTTP40_FWD_DEFINED__ +#define __ServerXMLHTTP40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ServerXMLHTTP40 ServerXMLHTTP40; +#else +typedef struct ServerXMLHTTP40 ServerXMLHTTP40; +#endif /* __cplusplus */ + +#endif /* __ServerXMLHTTP40_FWD_DEFINED__ */ + + +#ifndef __ServerXMLHTTP60_FWD_DEFINED__ +#define __ServerXMLHTTP60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class ServerXMLHTTP60 ServerXMLHTTP60; +#else +typedef struct ServerXMLHTTP60 ServerXMLHTTP60; +#endif /* __cplusplus */ + +#endif /* __ServerXMLHTTP60_FWD_DEFINED__ */ + + +#ifndef __SAXXMLReader_FWD_DEFINED__ +#define __SAXXMLReader_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXXMLReader SAXXMLReader; +#else +typedef struct SAXXMLReader SAXXMLReader; +#endif /* __cplusplus */ + +#endif /* __SAXXMLReader_FWD_DEFINED__ */ + + +#ifndef __SAXXMLReader30_FWD_DEFINED__ +#define __SAXXMLReader30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXXMLReader30 SAXXMLReader30; +#else +typedef struct SAXXMLReader30 SAXXMLReader30; +#endif /* __cplusplus */ + +#endif /* __SAXXMLReader30_FWD_DEFINED__ */ + + +#ifndef __SAXXMLReader40_FWD_DEFINED__ +#define __SAXXMLReader40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXXMLReader40 SAXXMLReader40; +#else +typedef struct SAXXMLReader40 SAXXMLReader40; +#endif /* __cplusplus */ + +#endif /* __SAXXMLReader40_FWD_DEFINED__ */ + + +#ifndef __SAXXMLReader60_FWD_DEFINED__ +#define __SAXXMLReader60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXXMLReader60 SAXXMLReader60; +#else +typedef struct SAXXMLReader60 SAXXMLReader60; +#endif /* __cplusplus */ + +#endif /* __SAXXMLReader60_FWD_DEFINED__ */ + + +#ifndef __MXXMLWriter_FWD_DEFINED__ +#define __MXXMLWriter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXXMLWriter MXXMLWriter; +#else +typedef struct MXXMLWriter MXXMLWriter; +#endif /* __cplusplus */ + +#endif /* __MXXMLWriter_FWD_DEFINED__ */ + + +#ifndef __MXXMLWriter30_FWD_DEFINED__ +#define __MXXMLWriter30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXXMLWriter30 MXXMLWriter30; +#else +typedef struct MXXMLWriter30 MXXMLWriter30; +#endif /* __cplusplus */ + +#endif /* __MXXMLWriter30_FWD_DEFINED__ */ + + +#ifndef __MXXMLWriter40_FWD_DEFINED__ +#define __MXXMLWriter40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXXMLWriter40 MXXMLWriter40; +#else +typedef struct MXXMLWriter40 MXXMLWriter40; +#endif /* __cplusplus */ + +#endif /* __MXXMLWriter40_FWD_DEFINED__ */ + + +#ifndef __MXXMLWriter60_FWD_DEFINED__ +#define __MXXMLWriter60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXXMLWriter60 MXXMLWriter60; +#else +typedef struct MXXMLWriter60 MXXMLWriter60; +#endif /* __cplusplus */ + +#endif /* __MXXMLWriter60_FWD_DEFINED__ */ + + +#ifndef __MXHTMLWriter_FWD_DEFINED__ +#define __MXHTMLWriter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXHTMLWriter MXHTMLWriter; +#else +typedef struct MXHTMLWriter MXHTMLWriter; +#endif /* __cplusplus */ + +#endif /* __MXHTMLWriter_FWD_DEFINED__ */ + + +#ifndef __MXHTMLWriter30_FWD_DEFINED__ +#define __MXHTMLWriter30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXHTMLWriter30 MXHTMLWriter30; +#else +typedef struct MXHTMLWriter30 MXHTMLWriter30; +#endif /* __cplusplus */ + +#endif /* __MXHTMLWriter30_FWD_DEFINED__ */ + + +#ifndef __MXHTMLWriter40_FWD_DEFINED__ +#define __MXHTMLWriter40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXHTMLWriter40 MXHTMLWriter40; +#else +typedef struct MXHTMLWriter40 MXHTMLWriter40; +#endif /* __cplusplus */ + +#endif /* __MXHTMLWriter40_FWD_DEFINED__ */ + + +#ifndef __MXHTMLWriter60_FWD_DEFINED__ +#define __MXHTMLWriter60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXHTMLWriter60 MXHTMLWriter60; +#else +typedef struct MXHTMLWriter60 MXHTMLWriter60; +#endif /* __cplusplus */ + +#endif /* __MXHTMLWriter60_FWD_DEFINED__ */ + + +#ifndef __SAXAttributes_FWD_DEFINED__ +#define __SAXAttributes_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXAttributes SAXAttributes; +#else +typedef struct SAXAttributes SAXAttributes; +#endif /* __cplusplus */ + +#endif /* __SAXAttributes_FWD_DEFINED__ */ + + +#ifndef __SAXAttributes30_FWD_DEFINED__ +#define __SAXAttributes30_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXAttributes30 SAXAttributes30; +#else +typedef struct SAXAttributes30 SAXAttributes30; +#endif /* __cplusplus */ + +#endif /* __SAXAttributes30_FWD_DEFINED__ */ + + +#ifndef __SAXAttributes40_FWD_DEFINED__ +#define __SAXAttributes40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXAttributes40 SAXAttributes40; +#else +typedef struct SAXAttributes40 SAXAttributes40; +#endif /* __cplusplus */ + +#endif /* __SAXAttributes40_FWD_DEFINED__ */ + + +#ifndef __SAXAttributes60_FWD_DEFINED__ +#define __SAXAttributes60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SAXAttributes60 SAXAttributes60; +#else +typedef struct SAXAttributes60 SAXAttributes60; +#endif /* __cplusplus */ + +#endif /* __SAXAttributes60_FWD_DEFINED__ */ + + +#ifndef __MXNamespaceManager_FWD_DEFINED__ +#define __MXNamespaceManager_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXNamespaceManager MXNamespaceManager; +#else +typedef struct MXNamespaceManager MXNamespaceManager; +#endif /* __cplusplus */ + +#endif /* __MXNamespaceManager_FWD_DEFINED__ */ + + +#ifndef __MXNamespaceManager40_FWD_DEFINED__ +#define __MXNamespaceManager40_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXNamespaceManager40 MXNamespaceManager40; +#else +typedef struct MXNamespaceManager40 MXNamespaceManager40; +#endif /* __cplusplus */ + +#endif /* __MXNamespaceManager40_FWD_DEFINED__ */ + + +#ifndef __MXNamespaceManager60_FWD_DEFINED__ +#define __MXNamespaceManager60_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MXNamespaceManager60 MXNamespaceManager60; +#else +typedef struct MXNamespaceManager60 MXNamespaceManager60; +#endif /* __cplusplus */ + +#endif /* __MXNamespaceManager60_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "unknwn.h" +#include "objidl.h" +#include "oaidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_msxml6_0000 */ +/* [local] */ + +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1997-2005. +// +//-------------------------------------------------------------------------- +#define DOMDocument DOMDocument2 +#define CLSID_DOMDocument CLSID_DOMDocument2 + +#if !defined(_W64) +#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +#define _W64 __w64 +#else +#define _W64 +#endif +#endif +#if defined(_WIN64) + typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; +#else + typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; +#endif +#ifdef __ISAXXMLReader_INTERFACE_DEFINED__ +#undef __MSXML2_LIBRARY_DEFINED__ +#endif +#ifdef __USE_MSXML6_NAMESPACE__ +namespace MSXML6 { +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_msxml6_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_msxml6_0000_v0_0_s_ifspec; + + +#ifndef __MSXML2_LIBRARY_DEFINED__ +#define __MSXML2_LIBRARY_DEFINED__ + +/* library MSXML2 */ +/* [lcid][helpstring][version][uuid] */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#undef ParseURL +#if !defined(__msxml_h__) || defined(__IXMLElementNotificationSink_INTERFACE_DEFINED__) +typedef /* [helpstring] */ +enum tagDOMNodeType + { NODE_INVALID = 0, + NODE_ELEMENT = NODE_INVALID + 1, + NODE_ATTRIBUTE = NODE_ELEMENT + 1, + NODE_TEXT = NODE_ATTRIBUTE + 1, + NODE_CDATA_SECTION = NODE_TEXT + 1, + NODE_ENTITY_REFERENCE = NODE_CDATA_SECTION + 1, + NODE_ENTITY = NODE_ENTITY_REFERENCE + 1, + NODE_PROCESSING_INSTRUCTION = NODE_ENTITY + 1, + NODE_COMMENT = NODE_PROCESSING_INSTRUCTION + 1, + NODE_DOCUMENT = NODE_COMMENT + 1, + NODE_DOCUMENT_TYPE = NODE_DOCUMENT + 1, + NODE_DOCUMENT_FRAGMENT = NODE_DOCUMENT_TYPE + 1, + NODE_NOTATION = NODE_DOCUMENT_FRAGMENT + 1 + } DOMNodeType; + +#endif +#if !defined(__msxml_sxh_enums__) +#define __msxml_sxh_enums__ +typedef /* [helpstring] */ +enum _SERVERXMLHTTP_OPTION + { SXH_OPTION_URL = -1, + SXH_OPTION_URL_CODEPAGE = SXH_OPTION_URL + 1, + SXH_OPTION_ESCAPE_PERCENT_IN_URL = SXH_OPTION_URL_CODEPAGE + 1, + SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS = SXH_OPTION_ESCAPE_PERCENT_IN_URL + 1, + SXH_OPTION_SELECT_CLIENT_SSL_CERT = SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS + 1 + } SERVERXMLHTTP_OPTION; + +typedef /* [helpstring] */ +enum _SXH_SERVER_CERT_OPTION + { SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x100, + SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x200, + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x1000, + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x2000, + SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = SXH_SERVER_CERT_IGNORE_UNKNOWN_CA + SXH_SERVER_CERT_IGNORE_WRONG_USAGE + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID + } SXH_SERVER_CERT_OPTION; + +typedef /* [helpstring] */ +enum _SXH_PROXY_SETTING + { SXH_PROXY_SET_DEFAULT = 0, + SXH_PROXY_SET_PRECONFIG = 0, + SXH_PROXY_SET_DIRECT = 0x1, + SXH_PROXY_SET_PROXY = 0x2 + } SXH_PROXY_SETTING; + +#endif // !defined(__msxml_sxh_enums__) +#if !defined(__msxml_som_enums__) +#define __msxml_som_enums__ +typedef /* [helpstring] */ +enum _SOMITEMTYPE + { SOMITEM_SCHEMA = 0x1000, + SOMITEM_ATTRIBUTE = 0x1001, + SOMITEM_ATTRIBUTEGROUP = 0x1002, + SOMITEM_NOTATION = 0x1003, + SOMITEM_ANNOTATION = 0x1004, + SOMITEM_IDENTITYCONSTRAINT = 0x1100, + SOMITEM_KEY = 0x1101, + SOMITEM_KEYREF = 0x1102, + SOMITEM_UNIQUE = 0x1103, + SOMITEM_ANYTYPE = 0x2000, + SOMITEM_DATATYPE = 0x2100, + SOMITEM_DATATYPE_ANYTYPE = 0x2101, + SOMITEM_DATATYPE_ANYURI = 0x2102, + SOMITEM_DATATYPE_BASE64BINARY = 0x2103, + SOMITEM_DATATYPE_BOOLEAN = 0x2104, + SOMITEM_DATATYPE_BYTE = 0x2105, + SOMITEM_DATATYPE_DATE = 0x2106, + SOMITEM_DATATYPE_DATETIME = 0x2107, + SOMITEM_DATATYPE_DAY = 0x2108, + SOMITEM_DATATYPE_DECIMAL = 0x2109, + SOMITEM_DATATYPE_DOUBLE = 0x210a, + SOMITEM_DATATYPE_DURATION = 0x210b, + SOMITEM_DATATYPE_ENTITIES = 0x210c, + SOMITEM_DATATYPE_ENTITY = 0x210d, + SOMITEM_DATATYPE_FLOAT = 0x210e, + SOMITEM_DATATYPE_HEXBINARY = 0x210f, + SOMITEM_DATATYPE_ID = 0x2110, + SOMITEM_DATATYPE_IDREF = 0x2111, + SOMITEM_DATATYPE_IDREFS = 0x2112, + SOMITEM_DATATYPE_INT = 0x2113, + SOMITEM_DATATYPE_INTEGER = 0x2114, + SOMITEM_DATATYPE_LANGUAGE = 0x2115, + SOMITEM_DATATYPE_LONG = 0x2116, + SOMITEM_DATATYPE_MONTH = 0x2117, + SOMITEM_DATATYPE_MONTHDAY = 0x2118, + SOMITEM_DATATYPE_NAME = 0x2119, + SOMITEM_DATATYPE_NCNAME = 0x211a, + SOMITEM_DATATYPE_NEGATIVEINTEGER = 0x211b, + SOMITEM_DATATYPE_NMTOKEN = 0x211c, + SOMITEM_DATATYPE_NMTOKENS = 0x211d, + SOMITEM_DATATYPE_NONNEGATIVEINTEGER = 0x211e, + SOMITEM_DATATYPE_NONPOSITIVEINTEGER = 0x211f, + SOMITEM_DATATYPE_NORMALIZEDSTRING = 0x2120, + SOMITEM_DATATYPE_NOTATION = 0x2121, + SOMITEM_DATATYPE_POSITIVEINTEGER = 0x2122, + SOMITEM_DATATYPE_QNAME = 0x2123, + SOMITEM_DATATYPE_SHORT = 0x2124, + SOMITEM_DATATYPE_STRING = 0x2125, + SOMITEM_DATATYPE_TIME = 0x2126, + SOMITEM_DATATYPE_TOKEN = 0x2127, + SOMITEM_DATATYPE_UNSIGNEDBYTE = 0x2128, + SOMITEM_DATATYPE_UNSIGNEDINT = 0x2129, + SOMITEM_DATATYPE_UNSIGNEDLONG = 0x212a, + SOMITEM_DATATYPE_UNSIGNEDSHORT = 0x212b, + SOMITEM_DATATYPE_YEAR = 0x212c, + SOMITEM_DATATYPE_YEARMONTH = 0x212d, + SOMITEM_DATATYPE_ANYSIMPLETYPE = 0x21ff, + SOMITEM_SIMPLETYPE = 0x2200, + SOMITEM_COMPLEXTYPE = 0x2400, + SOMITEM_PARTICLE = 0x4000, + SOMITEM_ANY = 0x4001, + SOMITEM_ANYATTRIBUTE = 0x4002, + SOMITEM_ELEMENT = 0x4003, + SOMITEM_GROUP = 0x4100, + SOMITEM_ALL = 0x4101, + SOMITEM_CHOICE = 0x4102, + SOMITEM_SEQUENCE = 0x4103, + SOMITEM_EMPTYPARTICLE = 0x4104, + SOMITEM_NULL = 0x800, + SOMITEM_NULL_TYPE = 0x2800, + SOMITEM_NULL_ANY = 0x4801, + SOMITEM_NULL_ANYATTRIBUTE = 0x4802, + SOMITEM_NULL_ELEMENT = 0x4803 + } SOMITEMTYPE; + +typedef /* [helpstring] */ +enum _SCHEMAUSE + { SCHEMAUSE_OPTIONAL = 0, + SCHEMAUSE_PROHIBITED = SCHEMAUSE_OPTIONAL + 1, + SCHEMAUSE_REQUIRED = SCHEMAUSE_PROHIBITED + 1 + } SCHEMAUSE; + +typedef /* [helpstring] */ +enum _SCHEMADERIVATIONMETHOD + { SCHEMADERIVATIONMETHOD_EMPTY = 0, + SCHEMADERIVATIONMETHOD_SUBSTITUTION = 0x1, + SCHEMADERIVATIONMETHOD_EXTENSION = 0x2, + SCHEMADERIVATIONMETHOD_RESTRICTION = 0x4, + SCHEMADERIVATIONMETHOD_LIST = 0x8, + SCHEMADERIVATIONMETHOD_UNION = 0x10, + SCHEMADERIVATIONMETHOD_ALL = 0xff, + SCHEMADERIVATIONMETHOD_NONE = 0x100 + } SCHEMADERIVATIONMETHOD; + +typedef /* [helpstring] */ +enum _SCHEMACONTENTTYPE + { SCHEMACONTENTTYPE_EMPTY = 0, + SCHEMACONTENTTYPE_TEXTONLY = SCHEMACONTENTTYPE_EMPTY + 1, + SCHEMACONTENTTYPE_ELEMENTONLY = SCHEMACONTENTTYPE_TEXTONLY + 1, + SCHEMACONTENTTYPE_MIXED = SCHEMACONTENTTYPE_ELEMENTONLY + 1 + } SCHEMACONTENTTYPE; + +typedef /* [helpstring] */ +enum _SCHEMAPROCESSCONTENTS + { SCHEMAPROCESSCONTENTS_NONE = 0, + SCHEMAPROCESSCONTENTS_SKIP = SCHEMAPROCESSCONTENTS_NONE + 1, + SCHEMAPROCESSCONTENTS_LAX = SCHEMAPROCESSCONTENTS_SKIP + 1, + SCHEMAPROCESSCONTENTS_STRICT = SCHEMAPROCESSCONTENTS_LAX + 1 + } SCHEMAPROCESSCONTENTS; + +typedef /* [helpstring] */ +enum _SCHEMAWHITESPACE + { SCHEMAWHITESPACE_NONE = -1, + SCHEMAWHITESPACE_PRESERVE = 0, + SCHEMAWHITESPACE_REPLACE = 1, + SCHEMAWHITESPACE_COLLAPSE = 2 + } SCHEMAWHITESPACE; + +typedef /* [helpstring] */ +enum _SCHEMATYPEVARIETY + { SCHEMATYPEVARIETY_NONE = -1, + SCHEMATYPEVARIETY_ATOMIC = 0, + SCHEMATYPEVARIETY_LIST = 1, + SCHEMATYPEVARIETY_UNION = 2 + } SCHEMATYPEVARIETY; + +#endif // !defined(__msxml_som_enums__) + +EXTERN_C const IID LIBID_MSXML2; + +#ifndef __IXMLDOMImplementation_INTERFACE_DEFINED__ +#define __IXMLDOMImplementation_INTERFACE_DEFINED__ + +/* interface IXMLDOMImplementation */ +/* [uuid][dual][oleautomation][unique][nonextensible][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMImplementation; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8F-7B36-11d2-B20E-00C04F983E60") + IXMLDOMImplementation : public IDispatch + { + public: + virtual /* [id] */ HRESULT STDMETHODCALLTYPE hasFeature( + /* [in] */ BSTR feature, + /* [in] */ BSTR version, + /* [retval][out] */ VARIANT_BOOL *hasFeature) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMImplementationVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMImplementation * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMImplementation * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMImplementation * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMImplementation * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMImplementation * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMImplementation * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMImplementation * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *hasFeature )( + IXMLDOMImplementation * This, + /* [in] */ BSTR feature, + /* [in] */ BSTR version, + /* [retval][out] */ VARIANT_BOOL *hasFeature); + + END_INTERFACE + } IXMLDOMImplementationVtbl; + + interface IXMLDOMImplementation + { + CONST_VTBL struct IXMLDOMImplementationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMImplementation_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMImplementation_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMImplementation_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMImplementation_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMImplementation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMImplementation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMImplementation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMImplementation_hasFeature(This,feature,version,hasFeature) \ + (This)->lpVtbl -> hasFeature(This,feature,version,hasFeature) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMImplementation_hasFeature_Proxy( + IXMLDOMImplementation * This, + /* [in] */ BSTR feature, + /* [in] */ BSTR version, + /* [retval][out] */ VARIANT_BOOL *hasFeature); + + +void __RPC_STUB IXMLDOMImplementation_hasFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMImplementation_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMNode_INTERFACE_DEFINED__ +#define __IXMLDOMNode_INTERFACE_DEFINED__ + +/* interface IXMLDOMNode */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMNode; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF80-7B36-11d2-B20E-00C04F983E60") + IXMLDOMNode : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeName( + /* [retval][out] */ BSTR *name) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeValue( + /* [retval][out] */ VARIANT *value) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_nodeValue( + /* [in] */ VARIANT value) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeType( + /* [retval][out] */ DOMNodeType *type) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( + /* [retval][out] */ IXMLDOMNode **parent) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_childNodes( + /* [retval][out] */ IXMLDOMNodeList **childList) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( + /* [retval][out] */ IXMLDOMNode **firstChild) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( + /* [retval][out] */ IXMLDOMNode **lastChild) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( + /* [retval][out] */ IXMLDOMNode **previousSibling) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( + /* [retval][out] */ IXMLDOMNode **nextSibling) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE insertBefore( + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE replaceChild( + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeChild( + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE appendChild( + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE hasChildNodes( + /* [retval][out] */ VARIANT_BOOL *hasChild) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ownerDocument( + /* [retval][out] */ IXMLDOMDocument **DOMDocument) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE cloneNode( + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeTypeString( + /* [out][retval] */ BSTR *nodeType) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_text( + /* [out][retval] */ BSTR *text) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_text( + /* [in] */ BSTR text) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_specified( + /* [retval][out] */ VARIANT_BOOL *isSpecified) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_definition( + /* [out][retval] */ IXMLDOMNode **definitionNode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeTypedValue( + /* [out][retval] */ VARIANT *typedValue) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_nodeTypedValue( + /* [in] */ VARIANT typedValue) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dataType( + /* [out][retval] */ VARIANT *dataTypeName) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_dataType( + /* [in] */ BSTR dataTypeName) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_xml( + /* [out][retval] */ BSTR *xmlString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transformNode( + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE selectNodes( + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE selectSingleNode( + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parsed( + /* [out][retval] */ VARIANT_BOOL *isParsed) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( + /* [out][retval] */ BSTR *namespaceURI) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_prefix( + /* [out][retval] */ BSTR *prefixString) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_baseName( + /* [out][retval] */ BSTR *nameString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transformNodeToObject( + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMNodeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMNode * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMNode * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMNode * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMNode * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMNode * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMNode * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMNode * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMNode * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMNode * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMNode * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMNode * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMNode * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMNode * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMNode * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMNode * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMNode * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMNode * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + END_INTERFACE + } IXMLDOMNodeVtbl; + + interface IXMLDOMNode + { + CONST_VTBL struct IXMLDOMNodeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMNode_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMNode_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMNode_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMNode_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMNode_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMNode_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMNode_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMNode_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMNode_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMNode_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMNode_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMNode_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMNode_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMNode_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMNode_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMNode_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMNode_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMNode_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMNode_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMNode_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMNode_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMNode_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMNode_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMNode_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMNode_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMNode_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMNode_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMNode_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMNode_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMNode_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMNode_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMNode_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMNode_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMNode_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMNode_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMNode_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMNode_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMNode_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMNode_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMNode_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMNode_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMNode_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMNode_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeName_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ BSTR *name); + + +void __RPC_STUB IXMLDOMNode_get_nodeName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeValue_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT *value); + + +void __RPC_STUB IXMLDOMNode_get_nodeValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_nodeValue_Proxy( + IXMLDOMNode * This, + /* [in] */ VARIANT value); + + +void __RPC_STUB IXMLDOMNode_put_nodeValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeType_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ DOMNodeType *type); + + +void __RPC_STUB IXMLDOMNode_get_nodeType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_parentNode_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **parent); + + +void __RPC_STUB IXMLDOMNode_get_parentNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_childNodes_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + +void __RPC_STUB IXMLDOMNode_get_childNodes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_firstChild_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + +void __RPC_STUB IXMLDOMNode_get_firstChild_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_lastChild_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + +void __RPC_STUB IXMLDOMNode_get_lastChild_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_previousSibling_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + +void __RPC_STUB IXMLDOMNode_get_previousSibling_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nextSibling_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + +void __RPC_STUB IXMLDOMNode_get_nextSibling_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_attributes_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + +void __RPC_STUB IXMLDOMNode_get_attributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_insertBefore_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + +void __RPC_STUB IXMLDOMNode_insertBefore_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_replaceChild_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + +void __RPC_STUB IXMLDOMNode_replaceChild_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_removeChild_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + +void __RPC_STUB IXMLDOMNode_removeChild_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_appendChild_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + +void __RPC_STUB IXMLDOMNode_appendChild_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_hasChildNodes_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + +void __RPC_STUB IXMLDOMNode_hasChildNodes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_ownerDocument_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + +void __RPC_STUB IXMLDOMNode_get_ownerDocument_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_cloneNode_Proxy( + IXMLDOMNode * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + +void __RPC_STUB IXMLDOMNode_cloneNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeTypeString_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *nodeType); + + +void __RPC_STUB IXMLDOMNode_get_nodeTypeString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_text_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *text); + + +void __RPC_STUB IXMLDOMNode_get_text_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_text_Proxy( + IXMLDOMNode * This, + /* [in] */ BSTR text); + + +void __RPC_STUB IXMLDOMNode_put_text_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_specified_Proxy( + IXMLDOMNode * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + +void __RPC_STUB IXMLDOMNode_get_specified_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_definition_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + +void __RPC_STUB IXMLDOMNode_get_definition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeTypedValue_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT *typedValue); + + +void __RPC_STUB IXMLDOMNode_get_nodeTypedValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_nodeTypedValue_Proxy( + IXMLDOMNode * This, + /* [in] */ VARIANT typedValue); + + +void __RPC_STUB IXMLDOMNode_put_nodeTypedValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_dataType_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT *dataTypeName); + + +void __RPC_STUB IXMLDOMNode_get_dataType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_dataType_Proxy( + IXMLDOMNode * This, + /* [in] */ BSTR dataTypeName); + + +void __RPC_STUB IXMLDOMNode_put_dataType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_xml_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *xmlString); + + +void __RPC_STUB IXMLDOMNode_get_xml_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_transformNode_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + +void __RPC_STUB IXMLDOMNode_transformNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_selectNodes_Proxy( + IXMLDOMNode * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + +void __RPC_STUB IXMLDOMNode_selectNodes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_selectSingleNode_Proxy( + IXMLDOMNode * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + +void __RPC_STUB IXMLDOMNode_selectSingleNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_parsed_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + +void __RPC_STUB IXMLDOMNode_get_parsed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_namespaceURI_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *namespaceURI); + + +void __RPC_STUB IXMLDOMNode_get_namespaceURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_prefix_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *prefixString); + + +void __RPC_STUB IXMLDOMNode_get_prefix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_baseName_Proxy( + IXMLDOMNode * This, + /* [out][retval] */ BSTR *nameString); + + +void __RPC_STUB IXMLDOMNode_get_baseName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_transformNodeToObject_Proxy( + IXMLDOMNode * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + +void __RPC_STUB IXMLDOMNode_transformNodeToObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMNode_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ +#define __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ + +/* interface IXMLDOMDocumentFragment */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMDocumentFragment; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa413-272f-11d2-836f-0000f87a7782") + IXMLDOMDocumentFragment : public IXMLDOMNode + { + public: + }; + +#else /* C style interface */ + + typedef struct IXMLDOMDocumentFragmentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMDocumentFragment * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMDocumentFragment * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMDocumentFragment * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMDocumentFragment * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMDocumentFragment * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMDocumentFragment * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMDocumentFragment * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMDocumentFragment * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMDocumentFragment * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMDocumentFragment * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMDocumentFragment * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMDocumentFragment * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMDocumentFragment * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMDocumentFragment * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMDocumentFragment * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMDocumentFragment * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMDocumentFragment * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + END_INTERFACE + } IXMLDOMDocumentFragmentVtbl; + + interface IXMLDOMDocumentFragment + { + CONST_VTBL struct IXMLDOMDocumentFragmentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMDocumentFragment_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMDocumentFragment_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMDocumentFragment_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMDocumentFragment_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMDocumentFragment_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMDocumentFragment_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMDocumentFragment_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMDocumentFragment_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMDocumentFragment_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMDocumentFragment_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMDocumentFragment_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMDocumentFragment_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMDocumentFragment_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMDocumentFragment_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMDocumentFragment_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMDocumentFragment_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMDocumentFragment_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMDocumentFragment_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMDocumentFragment_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMDocumentFragment_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMDocumentFragment_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMDocumentFragment_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMDocumentFragment_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMDocumentFragment_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMDocumentFragment_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMDocumentFragment_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMDocumentFragment_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMDocumentFragment_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMDocumentFragment_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMDocumentFragment_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMDocumentFragment_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocumentFragment_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocumentFragment_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMDocumentFragment_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMDocumentFragment_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMDocumentFragment_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMDocumentFragment_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMDocumentFragment_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMDocumentFragment_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMDocumentFragment_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMDocumentFragment_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMDocumentFragment_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMDocumentFragment_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMDocument_INTERFACE_DEFINED__ +#define __IXMLDOMDocument_INTERFACE_DEFINED__ + +/* interface IXMLDOMDocument */ +/* [hidden][unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMDocument; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF81-7B36-11d2-B20E-00C04F983E60") + IXMLDOMDocument : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_doctype( + /* [retval][out] */ IXMLDOMDocumentType **documentType) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_implementation( + /* [retval][out] */ IXMLDOMImplementation **impl) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_documentElement( + /* [retval][out] */ IXMLDOMElement **DOMElement) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_documentElement( + /* [in] */ IXMLDOMElement *DOMElement) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createElement( + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMElement **element) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createDocumentFragment( + /* [retval][out] */ IXMLDOMDocumentFragment **docFrag) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createTextNode( + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMText **text) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createComment( + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMComment **comment) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createCDATASection( + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMCDATASection **cdata) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createProcessingInstruction( + /* [in] */ BSTR target, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMProcessingInstruction **pi) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createAttribute( + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attribute) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createEntityReference( + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMEntityReference **entityRef) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getElementsByTagName( + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createNode( + /* [in] */ VARIANT Type, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [out][retval] */ IXMLDOMNode **node) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nodeFromID( + /* [in] */ BSTR idString, + /* [out][retval] */ IXMLDOMNode **node) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE load( + /* [in] */ VARIANT xmlSource, + /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( + /* [out][retval] */ long *value) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parseError( + /* [out][retval] */ IXMLDOMParseError **errorObj) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_url( + /* [out][retval] */ BSTR *urlString) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_async( + /* [out][retval] */ VARIANT_BOOL *isAsync) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_async( + /* [in] */ VARIANT_BOOL isAsync) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE loadXML( + /* [in] */ BSTR bstrXML, + /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE save( + /* [in] */ VARIANT destination) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_validateOnParse( + /* [out][retval] */ VARIANT_BOOL *isValidating) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_validateOnParse( + /* [in] */ VARIANT_BOOL isValidating) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_resolveExternals( + /* [out][retval] */ VARIANT_BOOL *isResolving) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_resolveExternals( + /* [in] */ VARIANT_BOOL isResolving) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_preserveWhiteSpace( + /* [out][retval] */ VARIANT_BOOL *isPreserving) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_preserveWhiteSpace( + /* [in] */ VARIANT_BOOL isPreserving) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_onreadystatechange( + /* [in] */ VARIANT readystatechangeSink) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ondataavailable( + /* [in] */ VARIANT ondataavailableSink) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ontransformnode( + /* [in] */ VARIANT ontransformnodeSink) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMDocumentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMDocument * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMDocument * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMDocument * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMDocument * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMDocument * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMDocument * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMDocument * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMDocument * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMDocument * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMDocument * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMDocument * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMDocument * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMDocument * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMDocument * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMDocument * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMDocument * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMDocument * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMDocument * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMDocument * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMDocumentType **documentType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMImplementation **impl); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMElement **DOMElement); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMElement *DOMElement); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( + IXMLDOMDocument * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMElement **element); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMText **text); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMComment **comment); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMCDATASection **cdata); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( + IXMLDOMDocument * This, + /* [in] */ BSTR target, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMProcessingInstruction **pi); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( + IXMLDOMDocument * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attribute); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( + IXMLDOMDocument * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMEntityReference **entityRef); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( + IXMLDOMDocument * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( + IXMLDOMDocument * This, + /* [in] */ VARIANT Type, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( + IXMLDOMDocument * This, + /* [in] */ BSTR idString, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( + IXMLDOMDocument * This, + /* [in] */ VARIANT xmlSource, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IXMLDOMDocument * This, + /* [out][retval] */ long *value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( + IXMLDOMDocument * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *urlString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isAsync); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isAsync); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IXMLDOMDocument * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( + IXMLDOMDocument * This, + /* [in] */ BSTR bstrXML, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( + IXMLDOMDocument * This, + /* [in] */ VARIANT destination); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isValidating); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isValidating); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isResolving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isResolving); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IXMLDOMDocument * This, + /* [in] */ VARIANT readystatechangeSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( + IXMLDOMDocument * This, + /* [in] */ VARIANT ondataavailableSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( + IXMLDOMDocument * This, + /* [in] */ VARIANT ontransformnodeSink); + + END_INTERFACE + } IXMLDOMDocumentVtbl; + + interface IXMLDOMDocument + { + CONST_VTBL struct IXMLDOMDocumentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMDocument_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMDocument_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMDocument_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMDocument_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMDocument_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMDocument_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMDocument_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMDocument_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMDocument_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMDocument_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMDocument_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMDocument_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMDocument_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMDocument_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMDocument_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMDocument_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMDocument_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMDocument_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMDocument_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMDocument_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMDocument_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMDocument_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMDocument_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMDocument_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMDocument_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMDocument_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMDocument_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMDocument_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMDocument_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMDocument_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMDocument_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMDocument_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMDocument_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMDocument_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMDocument_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMDocument_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMDocument_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMDocument_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMDocument_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMDocument_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMDocument_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMDocument_get_doctype(This,documentType) \ + (This)->lpVtbl -> get_doctype(This,documentType) + +#define IXMLDOMDocument_get_implementation(This,impl) \ + (This)->lpVtbl -> get_implementation(This,impl) + +#define IXMLDOMDocument_get_documentElement(This,DOMElement) \ + (This)->lpVtbl -> get_documentElement(This,DOMElement) + +#define IXMLDOMDocument_putref_documentElement(This,DOMElement) \ + (This)->lpVtbl -> putref_documentElement(This,DOMElement) + +#define IXMLDOMDocument_createElement(This,tagName,element) \ + (This)->lpVtbl -> createElement(This,tagName,element) + +#define IXMLDOMDocument_createDocumentFragment(This,docFrag) \ + (This)->lpVtbl -> createDocumentFragment(This,docFrag) + +#define IXMLDOMDocument_createTextNode(This,data,text) \ + (This)->lpVtbl -> createTextNode(This,data,text) + +#define IXMLDOMDocument_createComment(This,data,comment) \ + (This)->lpVtbl -> createComment(This,data,comment) + +#define IXMLDOMDocument_createCDATASection(This,data,cdata) \ + (This)->lpVtbl -> createCDATASection(This,data,cdata) + +#define IXMLDOMDocument_createProcessingInstruction(This,target,data,pi) \ + (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) + +#define IXMLDOMDocument_createAttribute(This,name,attribute) \ + (This)->lpVtbl -> createAttribute(This,name,attribute) + +#define IXMLDOMDocument_createEntityReference(This,name,entityRef) \ + (This)->lpVtbl -> createEntityReference(This,name,entityRef) + +#define IXMLDOMDocument_getElementsByTagName(This,tagName,resultList) \ + (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) + +#define IXMLDOMDocument_createNode(This,Type,name,namespaceURI,node) \ + (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) + +#define IXMLDOMDocument_nodeFromID(This,idString,node) \ + (This)->lpVtbl -> nodeFromID(This,idString,node) + +#define IXMLDOMDocument_load(This,xmlSource,isSuccessful) \ + (This)->lpVtbl -> load(This,xmlSource,isSuccessful) + +#define IXMLDOMDocument_get_readyState(This,value) \ + (This)->lpVtbl -> get_readyState(This,value) + +#define IXMLDOMDocument_get_parseError(This,errorObj) \ + (This)->lpVtbl -> get_parseError(This,errorObj) + +#define IXMLDOMDocument_get_url(This,urlString) \ + (This)->lpVtbl -> get_url(This,urlString) + +#define IXMLDOMDocument_get_async(This,isAsync) \ + (This)->lpVtbl -> get_async(This,isAsync) + +#define IXMLDOMDocument_put_async(This,isAsync) \ + (This)->lpVtbl -> put_async(This,isAsync) + +#define IXMLDOMDocument_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IXMLDOMDocument_loadXML(This,bstrXML,isSuccessful) \ + (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) + +#define IXMLDOMDocument_save(This,destination) \ + (This)->lpVtbl -> save(This,destination) + +#define IXMLDOMDocument_get_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> get_validateOnParse(This,isValidating) + +#define IXMLDOMDocument_put_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> put_validateOnParse(This,isValidating) + +#define IXMLDOMDocument_get_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> get_resolveExternals(This,isResolving) + +#define IXMLDOMDocument_put_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> put_resolveExternals(This,isResolving) + +#define IXMLDOMDocument_get_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument_put_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument_put_onreadystatechange(This,readystatechangeSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) + +#define IXMLDOMDocument_put_ondataavailable(This,ondataavailableSink) \ + (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) + +#define IXMLDOMDocument_put_ontransformnode(This,ontransformnodeSink) \ + (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_doctype_Proxy( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMDocumentType **documentType); + + +void __RPC_STUB IXMLDOMDocument_get_doctype_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_implementation_Proxy( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMImplementation **impl); + + +void __RPC_STUB IXMLDOMDocument_get_implementation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_documentElement_Proxy( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMElement **DOMElement); + + +void __RPC_STUB IXMLDOMDocument_get_documentElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_putref_documentElement_Proxy( + IXMLDOMDocument * This, + /* [in] */ IXMLDOMElement *DOMElement); + + +void __RPC_STUB IXMLDOMDocument_putref_documentElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createElement_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMElement **element); + + +void __RPC_STUB IXMLDOMDocument_createElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createDocumentFragment_Proxy( + IXMLDOMDocument * This, + /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); + + +void __RPC_STUB IXMLDOMDocument_createDocumentFragment_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createTextNode_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMText **text); + + +void __RPC_STUB IXMLDOMDocument_createTextNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createComment_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMComment **comment); + + +void __RPC_STUB IXMLDOMDocument_createComment_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createCDATASection_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMCDATASection **cdata); + + +void __RPC_STUB IXMLDOMDocument_createCDATASection_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createProcessingInstruction_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR target, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMProcessingInstruction **pi); + + +void __RPC_STUB IXMLDOMDocument_createProcessingInstruction_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createAttribute_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attribute); + + +void __RPC_STUB IXMLDOMDocument_createAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createEntityReference_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMEntityReference **entityRef); + + +void __RPC_STUB IXMLDOMDocument_createEntityReference_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_getElementsByTagName_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + +void __RPC_STUB IXMLDOMDocument_getElementsByTagName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createNode_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT Type, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [out][retval] */ IXMLDOMNode **node); + + +void __RPC_STUB IXMLDOMDocument_createNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_nodeFromID_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR idString, + /* [out][retval] */ IXMLDOMNode **node); + + +void __RPC_STUB IXMLDOMDocument_nodeFromID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_load_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT xmlSource, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + +void __RPC_STUB IXMLDOMDocument_load_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_readyState_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ long *value); + + +void __RPC_STUB IXMLDOMDocument_get_readyState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_parseError_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + +void __RPC_STUB IXMLDOMDocument_get_parseError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_url_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ BSTR *urlString); + + +void __RPC_STUB IXMLDOMDocument_get_url_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_async_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isAsync); + + +void __RPC_STUB IXMLDOMDocument_get_async_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_async_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isAsync); + + +void __RPC_STUB IXMLDOMDocument_put_async_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_abort_Proxy( + IXMLDOMDocument * This); + + +void __RPC_STUB IXMLDOMDocument_abort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_loadXML_Proxy( + IXMLDOMDocument * This, + /* [in] */ BSTR bstrXML, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + +void __RPC_STUB IXMLDOMDocument_loadXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_save_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT destination); + + +void __RPC_STUB IXMLDOMDocument_save_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_validateOnParse_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isValidating); + + +void __RPC_STUB IXMLDOMDocument_get_validateOnParse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_validateOnParse_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isValidating); + + +void __RPC_STUB IXMLDOMDocument_put_validateOnParse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_resolveExternals_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isResolving); + + +void __RPC_STUB IXMLDOMDocument_get_resolveExternals_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_resolveExternals_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isResolving); + + +void __RPC_STUB IXMLDOMDocument_put_resolveExternals_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_preserveWhiteSpace_Proxy( + IXMLDOMDocument * This, + /* [out][retval] */ VARIANT_BOOL *isPreserving); + + +void __RPC_STUB IXMLDOMDocument_get_preserveWhiteSpace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_preserveWhiteSpace_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT_BOOL isPreserving); + + +void __RPC_STUB IXMLDOMDocument_put_preserveWhiteSpace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_onreadystatechange_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT readystatechangeSink); + + +void __RPC_STUB IXMLDOMDocument_put_onreadystatechange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_ondataavailable_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT ondataavailableSink); + + +void __RPC_STUB IXMLDOMDocument_put_ondataavailable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_ontransformnode_Proxy( + IXMLDOMDocument * This, + /* [in] */ VARIANT ontransformnodeSink); + + +void __RPC_STUB IXMLDOMDocument_put_ontransformnode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMDocument_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMDocument2_INTERFACE_DEFINED__ +#define __IXMLDOMDocument2_INTERFACE_DEFINED__ + +/* interface IXMLDOMDocument2 */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMDocument2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF95-7B36-11d2-B20E-00C04F983E60") + IXMLDOMDocument2 : public IXMLDOMDocument + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaces( + /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_schemas( + /* [retval][out] */ VARIANT *otherCollection) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_schemas( + /* [in] */ VARIANT otherCollection) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE validate( + /* [out][retval] */ IXMLDOMParseError **errorObj) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProperty( + /* [in] */ BSTR name, + /* [in] */ VARIANT value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMDocument2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMDocument2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMDocument2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMDocument2 * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMDocument2 * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMDocument2 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMDocument2 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMDocument2 * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMDocument2 * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMDocument2 * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMDocument2 * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMDocument2 * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMDocument2 * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMDocument2 * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMDocumentType **documentType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMImplementation **impl); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMElement **DOMElement); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( + IXMLDOMDocument2 * This, + /* [in] */ IXMLDOMElement *DOMElement); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMElement **element); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMText **text); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMComment **comment); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMCDATASection **cdata); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR target, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMProcessingInstruction **pi); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attribute); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMEntityReference **entityRef); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT Type, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR idString, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT xmlSource, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IXMLDOMDocument2 * This, + /* [out][retval] */ long *value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( + IXMLDOMDocument2 * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( + IXMLDOMDocument2 * This, + /* [out][retval] */ BSTR *urlString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT_BOOL *isAsync); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT_BOOL isAsync); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IXMLDOMDocument2 * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR bstrXML, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT destination); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT_BOOL *isValidating); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT_BOOL isValidating); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT_BOOL *isResolving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT_BOOL isResolving); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( + IXMLDOMDocument2 * This, + /* [out][retval] */ VARIANT_BOOL *isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT_BOOL isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT readystatechangeSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT ondataavailableSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT ontransformnodeSink); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_schemas )( + IXMLDOMDocument2 * This, + /* [retval][out] */ VARIANT *otherCollection); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_schemas )( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT otherCollection); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validate )( + IXMLDOMDocument2 * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + END_INTERFACE + } IXMLDOMDocument2Vtbl; + + interface IXMLDOMDocument2 + { + CONST_VTBL struct IXMLDOMDocument2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMDocument2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMDocument2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMDocument2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMDocument2_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMDocument2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMDocument2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMDocument2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMDocument2_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMDocument2_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMDocument2_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMDocument2_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMDocument2_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMDocument2_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMDocument2_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMDocument2_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMDocument2_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMDocument2_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMDocument2_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMDocument2_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMDocument2_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMDocument2_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMDocument2_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMDocument2_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMDocument2_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMDocument2_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMDocument2_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMDocument2_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMDocument2_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMDocument2_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMDocument2_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMDocument2_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument2_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument2_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMDocument2_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMDocument2_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMDocument2_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMDocument2_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMDocument2_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMDocument2_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMDocument2_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMDocument2_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMDocument2_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMDocument2_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMDocument2_get_doctype(This,documentType) \ + (This)->lpVtbl -> get_doctype(This,documentType) + +#define IXMLDOMDocument2_get_implementation(This,impl) \ + (This)->lpVtbl -> get_implementation(This,impl) + +#define IXMLDOMDocument2_get_documentElement(This,DOMElement) \ + (This)->lpVtbl -> get_documentElement(This,DOMElement) + +#define IXMLDOMDocument2_putref_documentElement(This,DOMElement) \ + (This)->lpVtbl -> putref_documentElement(This,DOMElement) + +#define IXMLDOMDocument2_createElement(This,tagName,element) \ + (This)->lpVtbl -> createElement(This,tagName,element) + +#define IXMLDOMDocument2_createDocumentFragment(This,docFrag) \ + (This)->lpVtbl -> createDocumentFragment(This,docFrag) + +#define IXMLDOMDocument2_createTextNode(This,data,text) \ + (This)->lpVtbl -> createTextNode(This,data,text) + +#define IXMLDOMDocument2_createComment(This,data,comment) \ + (This)->lpVtbl -> createComment(This,data,comment) + +#define IXMLDOMDocument2_createCDATASection(This,data,cdata) \ + (This)->lpVtbl -> createCDATASection(This,data,cdata) + +#define IXMLDOMDocument2_createProcessingInstruction(This,target,data,pi) \ + (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) + +#define IXMLDOMDocument2_createAttribute(This,name,attribute) \ + (This)->lpVtbl -> createAttribute(This,name,attribute) + +#define IXMLDOMDocument2_createEntityReference(This,name,entityRef) \ + (This)->lpVtbl -> createEntityReference(This,name,entityRef) + +#define IXMLDOMDocument2_getElementsByTagName(This,tagName,resultList) \ + (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) + +#define IXMLDOMDocument2_createNode(This,Type,name,namespaceURI,node) \ + (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) + +#define IXMLDOMDocument2_nodeFromID(This,idString,node) \ + (This)->lpVtbl -> nodeFromID(This,idString,node) + +#define IXMLDOMDocument2_load(This,xmlSource,isSuccessful) \ + (This)->lpVtbl -> load(This,xmlSource,isSuccessful) + +#define IXMLDOMDocument2_get_readyState(This,value) \ + (This)->lpVtbl -> get_readyState(This,value) + +#define IXMLDOMDocument2_get_parseError(This,errorObj) \ + (This)->lpVtbl -> get_parseError(This,errorObj) + +#define IXMLDOMDocument2_get_url(This,urlString) \ + (This)->lpVtbl -> get_url(This,urlString) + +#define IXMLDOMDocument2_get_async(This,isAsync) \ + (This)->lpVtbl -> get_async(This,isAsync) + +#define IXMLDOMDocument2_put_async(This,isAsync) \ + (This)->lpVtbl -> put_async(This,isAsync) + +#define IXMLDOMDocument2_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IXMLDOMDocument2_loadXML(This,bstrXML,isSuccessful) \ + (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) + +#define IXMLDOMDocument2_save(This,destination) \ + (This)->lpVtbl -> save(This,destination) + +#define IXMLDOMDocument2_get_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> get_validateOnParse(This,isValidating) + +#define IXMLDOMDocument2_put_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> put_validateOnParse(This,isValidating) + +#define IXMLDOMDocument2_get_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> get_resolveExternals(This,isResolving) + +#define IXMLDOMDocument2_put_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> put_resolveExternals(This,isResolving) + +#define IXMLDOMDocument2_get_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument2_put_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument2_put_onreadystatechange(This,readystatechangeSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) + +#define IXMLDOMDocument2_put_ondataavailable(This,ondataavailableSink) \ + (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) + +#define IXMLDOMDocument2_put_ontransformnode(This,ontransformnodeSink) \ + (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) + + +#define IXMLDOMDocument2_get_namespaces(This,namespaceCollection) \ + (This)->lpVtbl -> get_namespaces(This,namespaceCollection) + +#define IXMLDOMDocument2_get_schemas(This,otherCollection) \ + (This)->lpVtbl -> get_schemas(This,otherCollection) + +#define IXMLDOMDocument2_putref_schemas(This,otherCollection) \ + (This)->lpVtbl -> putref_schemas(This,otherCollection) + +#define IXMLDOMDocument2_validate(This,errorObj) \ + (This)->lpVtbl -> validate(This,errorObj) + +#define IXMLDOMDocument2_setProperty(This,name,value) \ + (This)->lpVtbl -> setProperty(This,name,value) + +#define IXMLDOMDocument2_getProperty(This,name,value) \ + (This)->lpVtbl -> getProperty(This,name,value) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_get_namespaces_Proxy( + IXMLDOMDocument2 * This, + /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); + + +void __RPC_STUB IXMLDOMDocument2_get_namespaces_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_get_schemas_Proxy( + IXMLDOMDocument2 * This, + /* [retval][out] */ VARIANT *otherCollection); + + +void __RPC_STUB IXMLDOMDocument2_get_schemas_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_putref_schemas_Proxy( + IXMLDOMDocument2 * This, + /* [in] */ VARIANT otherCollection); + + +void __RPC_STUB IXMLDOMDocument2_putref_schemas_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_validate_Proxy( + IXMLDOMDocument2 * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + +void __RPC_STUB IXMLDOMDocument2_validate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_setProperty_Proxy( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + +void __RPC_STUB IXMLDOMDocument2_setProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_getProperty_Proxy( + IXMLDOMDocument2 * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + +void __RPC_STUB IXMLDOMDocument2_getProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMDocument2_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMDocument3_INTERFACE_DEFINED__ +#define __IXMLDOMDocument3_INTERFACE_DEFINED__ + +/* interface IXMLDOMDocument3 */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMDocument3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF96-7B36-11d2-B20E-00C04F983E60") + IXMLDOMDocument3 : public IXMLDOMDocument2 + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE validateNode( + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ IXMLDOMParseError **errorObj) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE importNode( + /* [in] */ IXMLDOMNode *node, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **clone) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMDocument3Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMDocument3 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMDocument3 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMDocument3 * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMDocument3 * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMDocument3 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMDocument3 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMDocument3 * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMDocument3 * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMDocument3 * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMDocument3 * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMDocument3 * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMDocument3 * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMDocument3 * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMDocumentType **documentType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMImplementation **impl); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMElement **DOMElement); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMElement *DOMElement); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMElement **element); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMText **text); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMComment **comment); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMCDATASection **cdata); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR target, + /* [in] */ BSTR data, + /* [retval][out] */ IXMLDOMProcessingInstruction **pi); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attribute); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMEntityReference **entityRef); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT Type, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR idString, + /* [out][retval] */ IXMLDOMNode **node); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT xmlSource, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IXMLDOMDocument3 * This, + /* [out][retval] */ long *value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( + IXMLDOMDocument3 * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( + IXMLDOMDocument3 * This, + /* [out][retval] */ BSTR *urlString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT_BOOL *isAsync); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT_BOOL isAsync); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IXMLDOMDocument3 * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR bstrXML, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT destination); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT_BOOL *isValidating); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT_BOOL isValidating); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT_BOOL *isResolving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT_BOOL isResolving); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( + IXMLDOMDocument3 * This, + /* [out][retval] */ VARIANT_BOOL *isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT_BOOL isPreserving); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT readystatechangeSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT ondataavailableSink); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT ontransformnodeSink); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( + IXMLDOMDocument3 * This, + /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_schemas )( + IXMLDOMDocument3 * This, + /* [retval][out] */ VARIANT *otherCollection); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_schemas )( + IXMLDOMDocument3 * This, + /* [in] */ VARIANT otherCollection); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validate )( + IXMLDOMDocument3 * This, + /* [out][retval] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( + IXMLDOMDocument3 * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validateNode )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ IXMLDOMParseError **errorObj); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *importNode )( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *node, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **clone); + + END_INTERFACE + } IXMLDOMDocument3Vtbl; + + interface IXMLDOMDocument3 + { + CONST_VTBL struct IXMLDOMDocument3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMDocument3_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMDocument3_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMDocument3_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMDocument3_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMDocument3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMDocument3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMDocument3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMDocument3_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMDocument3_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMDocument3_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMDocument3_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMDocument3_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMDocument3_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMDocument3_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMDocument3_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMDocument3_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMDocument3_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMDocument3_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMDocument3_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMDocument3_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMDocument3_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMDocument3_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMDocument3_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMDocument3_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMDocument3_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMDocument3_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMDocument3_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMDocument3_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMDocument3_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMDocument3_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMDocument3_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument3_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocument3_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMDocument3_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMDocument3_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMDocument3_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMDocument3_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMDocument3_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMDocument3_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMDocument3_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMDocument3_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMDocument3_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMDocument3_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMDocument3_get_doctype(This,documentType) \ + (This)->lpVtbl -> get_doctype(This,documentType) + +#define IXMLDOMDocument3_get_implementation(This,impl) \ + (This)->lpVtbl -> get_implementation(This,impl) + +#define IXMLDOMDocument3_get_documentElement(This,DOMElement) \ + (This)->lpVtbl -> get_documentElement(This,DOMElement) + +#define IXMLDOMDocument3_putref_documentElement(This,DOMElement) \ + (This)->lpVtbl -> putref_documentElement(This,DOMElement) + +#define IXMLDOMDocument3_createElement(This,tagName,element) \ + (This)->lpVtbl -> createElement(This,tagName,element) + +#define IXMLDOMDocument3_createDocumentFragment(This,docFrag) \ + (This)->lpVtbl -> createDocumentFragment(This,docFrag) + +#define IXMLDOMDocument3_createTextNode(This,data,text) \ + (This)->lpVtbl -> createTextNode(This,data,text) + +#define IXMLDOMDocument3_createComment(This,data,comment) \ + (This)->lpVtbl -> createComment(This,data,comment) + +#define IXMLDOMDocument3_createCDATASection(This,data,cdata) \ + (This)->lpVtbl -> createCDATASection(This,data,cdata) + +#define IXMLDOMDocument3_createProcessingInstruction(This,target,data,pi) \ + (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) + +#define IXMLDOMDocument3_createAttribute(This,name,attribute) \ + (This)->lpVtbl -> createAttribute(This,name,attribute) + +#define IXMLDOMDocument3_createEntityReference(This,name,entityRef) \ + (This)->lpVtbl -> createEntityReference(This,name,entityRef) + +#define IXMLDOMDocument3_getElementsByTagName(This,tagName,resultList) \ + (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) + +#define IXMLDOMDocument3_createNode(This,Type,name,namespaceURI,node) \ + (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) + +#define IXMLDOMDocument3_nodeFromID(This,idString,node) \ + (This)->lpVtbl -> nodeFromID(This,idString,node) + +#define IXMLDOMDocument3_load(This,xmlSource,isSuccessful) \ + (This)->lpVtbl -> load(This,xmlSource,isSuccessful) + +#define IXMLDOMDocument3_get_readyState(This,value) \ + (This)->lpVtbl -> get_readyState(This,value) + +#define IXMLDOMDocument3_get_parseError(This,errorObj) \ + (This)->lpVtbl -> get_parseError(This,errorObj) + +#define IXMLDOMDocument3_get_url(This,urlString) \ + (This)->lpVtbl -> get_url(This,urlString) + +#define IXMLDOMDocument3_get_async(This,isAsync) \ + (This)->lpVtbl -> get_async(This,isAsync) + +#define IXMLDOMDocument3_put_async(This,isAsync) \ + (This)->lpVtbl -> put_async(This,isAsync) + +#define IXMLDOMDocument3_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IXMLDOMDocument3_loadXML(This,bstrXML,isSuccessful) \ + (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) + +#define IXMLDOMDocument3_save(This,destination) \ + (This)->lpVtbl -> save(This,destination) + +#define IXMLDOMDocument3_get_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> get_validateOnParse(This,isValidating) + +#define IXMLDOMDocument3_put_validateOnParse(This,isValidating) \ + (This)->lpVtbl -> put_validateOnParse(This,isValidating) + +#define IXMLDOMDocument3_get_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> get_resolveExternals(This,isResolving) + +#define IXMLDOMDocument3_put_resolveExternals(This,isResolving) \ + (This)->lpVtbl -> put_resolveExternals(This,isResolving) + +#define IXMLDOMDocument3_get_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument3_put_preserveWhiteSpace(This,isPreserving) \ + (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) + +#define IXMLDOMDocument3_put_onreadystatechange(This,readystatechangeSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) + +#define IXMLDOMDocument3_put_ondataavailable(This,ondataavailableSink) \ + (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) + +#define IXMLDOMDocument3_put_ontransformnode(This,ontransformnodeSink) \ + (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) + + +#define IXMLDOMDocument3_get_namespaces(This,namespaceCollection) \ + (This)->lpVtbl -> get_namespaces(This,namespaceCollection) + +#define IXMLDOMDocument3_get_schemas(This,otherCollection) \ + (This)->lpVtbl -> get_schemas(This,otherCollection) + +#define IXMLDOMDocument3_putref_schemas(This,otherCollection) \ + (This)->lpVtbl -> putref_schemas(This,otherCollection) + +#define IXMLDOMDocument3_validate(This,errorObj) \ + (This)->lpVtbl -> validate(This,errorObj) + +#define IXMLDOMDocument3_setProperty(This,name,value) \ + (This)->lpVtbl -> setProperty(This,name,value) + +#define IXMLDOMDocument3_getProperty(This,name,value) \ + (This)->lpVtbl -> getProperty(This,name,value) + + +#define IXMLDOMDocument3_validateNode(This,node,errorObj) \ + (This)->lpVtbl -> validateNode(This,node,errorObj) + +#define IXMLDOMDocument3_importNode(This,node,deep,clone) \ + (This)->lpVtbl -> importNode(This,node,deep,clone) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument3_validateNode_Proxy( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ IXMLDOMParseError **errorObj); + + +void __RPC_STUB IXMLDOMDocument3_validateNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument3_importNode_Proxy( + IXMLDOMDocument3 * This, + /* [in] */ IXMLDOMNode *node, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **clone); + + +void __RPC_STUB IXMLDOMDocument3_importNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMDocument3_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMNodeList_INTERFACE_DEFINED__ +#define __IXMLDOMNodeList_INTERFACE_DEFINED__ + +/* interface IXMLDOMNodeList */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMNodeList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF82-7B36-11d2-B20E-00C04F983E60") + IXMLDOMNodeList : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *listLength) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nextNode( + /* [retval][out] */ IXMLDOMNode **nextItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [out][retval] */ IUnknown **ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMNodeListVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMNodeList * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMNodeList * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMNodeList * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMNodeList * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMNodeList * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMNodeList * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMNodeList * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + IXMLDOMNodeList * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMNodeList * This, + /* [retval][out] */ long *listLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( + IXMLDOMNodeList * This, + /* [retval][out] */ IXMLDOMNode **nextItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IXMLDOMNodeList * This); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMNodeList * This, + /* [out][retval] */ IUnknown **ppUnk); + + END_INTERFACE + } IXMLDOMNodeListVtbl; + + interface IXMLDOMNodeList + { + CONST_VTBL struct IXMLDOMNodeListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMNodeList_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMNodeList_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMNodeList_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMNodeList_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMNodeList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMNodeList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMNodeList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMNodeList_get_item(This,index,listItem) \ + (This)->lpVtbl -> get_item(This,index,listItem) + +#define IXMLDOMNodeList_get_length(This,listLength) \ + (This)->lpVtbl -> get_length(This,listLength) + +#define IXMLDOMNodeList_nextNode(This,nextItem) \ + (This)->lpVtbl -> nextNode(This,nextItem) + +#define IXMLDOMNodeList_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IXMLDOMNodeList_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get_item_Proxy( + IXMLDOMNodeList * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem); + + +void __RPC_STUB IXMLDOMNodeList_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get_length_Proxy( + IXMLDOMNodeList * This, + /* [retval][out] */ long *listLength); + + +void __RPC_STUB IXMLDOMNodeList_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_nextNode_Proxy( + IXMLDOMNodeList * This, + /* [retval][out] */ IXMLDOMNode **nextItem); + + +void __RPC_STUB IXMLDOMNodeList_nextNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_reset_Proxy( + IXMLDOMNodeList * This); + + +void __RPC_STUB IXMLDOMNodeList_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get__newEnum_Proxy( + IXMLDOMNodeList * This, + /* [out][retval] */ IUnknown **ppUnk); + + +void __RPC_STUB IXMLDOMNodeList_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMNodeList_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ +#define __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ + +/* interface IXMLDOMNamedNodeMap */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMNamedNodeMap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF83-7B36-11d2-B20E-00C04F983E60") + IXMLDOMNamedNodeMap : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getNamedItem( + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setNamedItem( + /* [in] */ IXMLDOMNode *newItem, + /* [retval][out] */ IXMLDOMNode **nameItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeNamedItem( + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *listLength) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getQualifiedItem( + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeQualifiedItem( + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nextNode( + /* [retval][out] */ IXMLDOMNode **nextItem) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [out][retval] */ IUnknown **ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMNamedNodeMapVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMNamedNodeMap * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMNamedNodeMap * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMNamedNodeMap * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMNamedNodeMap * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMNamedNodeMap * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMNamedNodeMap * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMNamedNodeMap * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getNamedItem )( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setNamedItem )( + IXMLDOMNamedNodeMap * This, + /* [in] */ IXMLDOMNode *newItem, + /* [retval][out] */ IXMLDOMNode **nameItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeNamedItem )( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + IXMLDOMNamedNodeMap * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMNamedNodeMap * This, + /* [retval][out] */ long *listLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getQualifiedItem )( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeQualifiedItem )( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( + IXMLDOMNamedNodeMap * This, + /* [retval][out] */ IXMLDOMNode **nextItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IXMLDOMNamedNodeMap * This); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMNamedNodeMap * This, + /* [out][retval] */ IUnknown **ppUnk); + + END_INTERFACE + } IXMLDOMNamedNodeMapVtbl; + + interface IXMLDOMNamedNodeMap + { + CONST_VTBL struct IXMLDOMNamedNodeMapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMNamedNodeMap_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMNamedNodeMap_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMNamedNodeMap_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMNamedNodeMap_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMNamedNodeMap_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMNamedNodeMap_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMNamedNodeMap_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMNamedNodeMap_getNamedItem(This,name,namedItem) \ + (This)->lpVtbl -> getNamedItem(This,name,namedItem) + +#define IXMLDOMNamedNodeMap_setNamedItem(This,newItem,nameItem) \ + (This)->lpVtbl -> setNamedItem(This,newItem,nameItem) + +#define IXMLDOMNamedNodeMap_removeNamedItem(This,name,namedItem) \ + (This)->lpVtbl -> removeNamedItem(This,name,namedItem) + +#define IXMLDOMNamedNodeMap_get_item(This,index,listItem) \ + (This)->lpVtbl -> get_item(This,index,listItem) + +#define IXMLDOMNamedNodeMap_get_length(This,listLength) \ + (This)->lpVtbl -> get_length(This,listLength) + +#define IXMLDOMNamedNodeMap_getQualifiedItem(This,baseName,namespaceURI,qualifiedItem) \ + (This)->lpVtbl -> getQualifiedItem(This,baseName,namespaceURI,qualifiedItem) + +#define IXMLDOMNamedNodeMap_removeQualifiedItem(This,baseName,namespaceURI,qualifiedItem) \ + (This)->lpVtbl -> removeQualifiedItem(This,baseName,namespaceURI,qualifiedItem) + +#define IXMLDOMNamedNodeMap_nextNode(This,nextItem) \ + (This)->lpVtbl -> nextNode(This,nextItem) + +#define IXMLDOMNamedNodeMap_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IXMLDOMNamedNodeMap_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_getNamedItem_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_getNamedItem_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_setNamedItem_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ IXMLDOMNode *newItem, + /* [retval][out] */ IXMLDOMNode **nameItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_setNamedItem_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_removeNamedItem_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMNode **namedItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_removeNamedItem_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get_item_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get_length_Proxy( + IXMLDOMNamedNodeMap * This, + /* [retval][out] */ long *listLength); + + +void __RPC_STUB IXMLDOMNamedNodeMap_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_getQualifiedItem_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_getQualifiedItem_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_removeQualifiedItem_Proxy( + IXMLDOMNamedNodeMap * This, + /* [in] */ BSTR baseName, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **qualifiedItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_removeQualifiedItem_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_nextNode_Proxy( + IXMLDOMNamedNodeMap * This, + /* [retval][out] */ IXMLDOMNode **nextItem); + + +void __RPC_STUB IXMLDOMNamedNodeMap_nextNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_reset_Proxy( + IXMLDOMNamedNodeMap * This); + + +void __RPC_STUB IXMLDOMNamedNodeMap_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get__newEnum_Proxy( + IXMLDOMNamedNodeMap * This, + /* [out][retval] */ IUnknown **ppUnk); + + +void __RPC_STUB IXMLDOMNamedNodeMap_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMCharacterData_INTERFACE_DEFINED__ +#define __IXMLDOMCharacterData_INTERFACE_DEFINED__ + +/* interface IXMLDOMCharacterData */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMCharacterData; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF84-7B36-11d2-B20E-00C04F983E60") + IXMLDOMCharacterData : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_data( + /* [retval][out] */ BSTR *data) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_data( + /* [in] */ BSTR data) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *dataLength) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE substringData( + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE appendData( + /* [in] */ BSTR data) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE insertData( + /* [in] */ long offset, + /* [in] */ BSTR data) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE deleteData( + /* [in] */ long offset, + /* [in] */ long count) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE replaceData( + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMCharacterDataVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMCharacterData * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMCharacterData * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMCharacterData * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMCharacterData * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMCharacterData * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMCharacterData * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMCharacterData * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMCharacterData * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMCharacterData * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMCharacterData * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMCharacterData * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMCharacterData * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMCharacterData * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMCharacterData * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMCharacterData * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMCharacterData * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMCharacterData * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMCharacterData * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMCharacterData * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMCharacterData * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMCharacterData * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMCharacterData * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( + IXMLDOMCharacterData * This, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR data); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMCharacterData * This, + /* [retval][out] */ long *dataLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( + IXMLDOMCharacterData * This, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data); + + END_INTERFACE + } IXMLDOMCharacterDataVtbl; + + interface IXMLDOMCharacterData + { + CONST_VTBL struct IXMLDOMCharacterDataVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMCharacterData_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMCharacterData_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMCharacterData_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMCharacterData_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMCharacterData_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMCharacterData_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMCharacterData_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMCharacterData_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMCharacterData_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMCharacterData_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMCharacterData_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMCharacterData_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMCharacterData_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMCharacterData_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMCharacterData_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMCharacterData_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMCharacterData_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMCharacterData_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMCharacterData_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMCharacterData_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMCharacterData_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMCharacterData_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMCharacterData_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMCharacterData_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMCharacterData_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMCharacterData_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMCharacterData_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMCharacterData_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMCharacterData_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMCharacterData_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMCharacterData_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMCharacterData_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMCharacterData_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMCharacterData_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMCharacterData_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMCharacterData_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMCharacterData_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMCharacterData_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMCharacterData_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMCharacterData_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMCharacterData_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMCharacterData_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMCharacterData_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMCharacterData_get_data(This,data) \ + (This)->lpVtbl -> get_data(This,data) + +#define IXMLDOMCharacterData_put_data(This,data) \ + (This)->lpVtbl -> put_data(This,data) + +#define IXMLDOMCharacterData_get_length(This,dataLength) \ + (This)->lpVtbl -> get_length(This,dataLength) + +#define IXMLDOMCharacterData_substringData(This,offset,count,data) \ + (This)->lpVtbl -> substringData(This,offset,count,data) + +#define IXMLDOMCharacterData_appendData(This,data) \ + (This)->lpVtbl -> appendData(This,data) + +#define IXMLDOMCharacterData_insertData(This,offset,data) \ + (This)->lpVtbl -> insertData(This,offset,data) + +#define IXMLDOMCharacterData_deleteData(This,offset,count) \ + (This)->lpVtbl -> deleteData(This,offset,count) + +#define IXMLDOMCharacterData_replaceData(This,offset,count,data) \ + (This)->lpVtbl -> replaceData(This,offset,count,data) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_get_data_Proxy( + IXMLDOMCharacterData * This, + /* [retval][out] */ BSTR *data); + + +void __RPC_STUB IXMLDOMCharacterData_get_data_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_put_data_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ BSTR data); + + +void __RPC_STUB IXMLDOMCharacterData_put_data_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_get_length_Proxy( + IXMLDOMCharacterData * This, + /* [retval][out] */ long *dataLength); + + +void __RPC_STUB IXMLDOMCharacterData_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_substringData_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data); + + +void __RPC_STUB IXMLDOMCharacterData_substringData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_appendData_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ BSTR data); + + +void __RPC_STUB IXMLDOMCharacterData_appendData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_insertData_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ BSTR data); + + +void __RPC_STUB IXMLDOMCharacterData_insertData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_deleteData_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count); + + +void __RPC_STUB IXMLDOMCharacterData_deleteData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_replaceData_Proxy( + IXMLDOMCharacterData * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data); + + +void __RPC_STUB IXMLDOMCharacterData_replaceData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMCharacterData_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMAttribute_INTERFACE_DEFINED__ +#define __IXMLDOMAttribute_INTERFACE_DEFINED__ + +/* interface IXMLDOMAttribute */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMAttribute; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF85-7B36-11d2-B20E-00C04F983E60") + IXMLDOMAttribute : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_name( + /* [retval][out] */ BSTR *attributeName) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_value( + /* [retval][out] */ VARIANT *attributeValue) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_value( + /* [in] */ VARIANT attributeValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMAttributeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMAttribute * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMAttribute * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMAttribute * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMAttribute * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMAttribute * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMAttribute * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMAttribute * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMAttribute * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMAttribute * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMAttribute * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMAttribute * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMAttribute * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMAttribute * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMAttribute * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMAttribute * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMAttribute * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMAttribute * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMAttribute * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMAttribute * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMAttribute * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMAttribute * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMAttribute * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMAttribute * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMAttribute * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMAttribute * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMAttribute * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + IXMLDOMAttribute * This, + /* [retval][out] */ BSTR *attributeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_value )( + IXMLDOMAttribute * This, + /* [retval][out] */ VARIANT *attributeValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_value )( + IXMLDOMAttribute * This, + /* [in] */ VARIANT attributeValue); + + END_INTERFACE + } IXMLDOMAttributeVtbl; + + interface IXMLDOMAttribute + { + CONST_VTBL struct IXMLDOMAttributeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMAttribute_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMAttribute_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMAttribute_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMAttribute_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMAttribute_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMAttribute_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMAttribute_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMAttribute_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMAttribute_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMAttribute_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMAttribute_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMAttribute_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMAttribute_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMAttribute_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMAttribute_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMAttribute_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMAttribute_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMAttribute_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMAttribute_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMAttribute_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMAttribute_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMAttribute_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMAttribute_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMAttribute_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMAttribute_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMAttribute_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMAttribute_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMAttribute_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMAttribute_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMAttribute_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMAttribute_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMAttribute_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMAttribute_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMAttribute_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMAttribute_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMAttribute_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMAttribute_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMAttribute_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMAttribute_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMAttribute_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMAttribute_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMAttribute_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMAttribute_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMAttribute_get_name(This,attributeName) \ + (This)->lpVtbl -> get_name(This,attributeName) + +#define IXMLDOMAttribute_get_value(This,attributeValue) \ + (This)->lpVtbl -> get_value(This,attributeValue) + +#define IXMLDOMAttribute_put_value(This,attributeValue) \ + (This)->lpVtbl -> put_value(This,attributeValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_get_name_Proxy( + IXMLDOMAttribute * This, + /* [retval][out] */ BSTR *attributeName); + + +void __RPC_STUB IXMLDOMAttribute_get_name_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_get_value_Proxy( + IXMLDOMAttribute * This, + /* [retval][out] */ VARIANT *attributeValue); + + +void __RPC_STUB IXMLDOMAttribute_get_value_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_put_value_Proxy( + IXMLDOMAttribute * This, + /* [in] */ VARIANT attributeValue); + + +void __RPC_STUB IXMLDOMAttribute_put_value_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMAttribute_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMElement_INTERFACE_DEFINED__ +#define __IXMLDOMElement_INTERFACE_DEFINED__ + +/* interface IXMLDOMElement */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMElement; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF86-7B36-11d2-B20E-00C04F983E60") + IXMLDOMElement : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_tagName( + /* [retval][out] */ BSTR *tagName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAttribute( + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttribute( + /* [in] */ BSTR name, + /* [in] */ VARIANT value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttribute( + /* [in] */ BSTR name) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAttributeNode( + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttributeNode( + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttributeNode( + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getElementsByTagName( + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE normalize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMElementVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMElement * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMElement * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMElement * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMElement * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMElement * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMElement * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMElement * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMElement * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMElement * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMElement * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMElement * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMElement * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMElement * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMElement * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMElement * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMElement * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMElement * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMElement * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMElement * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMElement * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMElement * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMElement * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMElement * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMElement * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMElement * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_tagName )( + IXMLDOMElement * This, + /* [retval][out] */ BSTR *tagName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAttribute )( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttribute )( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttribute )( + IXMLDOMElement * This, + /* [in] */ BSTR name); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAttributeNode )( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttributeNode )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttributeNode )( + IXMLDOMElement * This, + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( + IXMLDOMElement * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *normalize )( + IXMLDOMElement * This); + + END_INTERFACE + } IXMLDOMElementVtbl; + + interface IXMLDOMElement + { + CONST_VTBL struct IXMLDOMElementVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMElement_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMElement_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMElement_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMElement_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMElement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMElement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMElement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMElement_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMElement_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMElement_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMElement_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMElement_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMElement_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMElement_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMElement_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMElement_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMElement_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMElement_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMElement_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMElement_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMElement_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMElement_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMElement_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMElement_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMElement_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMElement_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMElement_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMElement_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMElement_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMElement_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMElement_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMElement_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMElement_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMElement_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMElement_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMElement_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMElement_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMElement_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMElement_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMElement_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMElement_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMElement_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMElement_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMElement_get_tagName(This,tagName) \ + (This)->lpVtbl -> get_tagName(This,tagName) + +#define IXMLDOMElement_getAttribute(This,name,value) \ + (This)->lpVtbl -> getAttribute(This,name,value) + +#define IXMLDOMElement_setAttribute(This,name,value) \ + (This)->lpVtbl -> setAttribute(This,name,value) + +#define IXMLDOMElement_removeAttribute(This,name) \ + (This)->lpVtbl -> removeAttribute(This,name) + +#define IXMLDOMElement_getAttributeNode(This,name,attributeNode) \ + (This)->lpVtbl -> getAttributeNode(This,name,attributeNode) + +#define IXMLDOMElement_setAttributeNode(This,DOMAttribute,attributeNode) \ + (This)->lpVtbl -> setAttributeNode(This,DOMAttribute,attributeNode) + +#define IXMLDOMElement_removeAttributeNode(This,DOMAttribute,attributeNode) \ + (This)->lpVtbl -> removeAttributeNode(This,DOMAttribute,attributeNode) + +#define IXMLDOMElement_getElementsByTagName(This,tagName,resultList) \ + (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) + +#define IXMLDOMElement_normalize(This) \ + (This)->lpVtbl -> normalize(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_get_tagName_Proxy( + IXMLDOMElement * This, + /* [retval][out] */ BSTR *tagName); + + +void __RPC_STUB IXMLDOMElement_get_tagName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getAttribute_Proxy( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + +void __RPC_STUB IXMLDOMElement_getAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_setAttribute_Proxy( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + +void __RPC_STUB IXMLDOMElement_setAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_removeAttribute_Proxy( + IXMLDOMElement * This, + /* [in] */ BSTR name); + + +void __RPC_STUB IXMLDOMElement_removeAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getAttributeNode_Proxy( + IXMLDOMElement * This, + /* [in] */ BSTR name, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + +void __RPC_STUB IXMLDOMElement_getAttributeNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_setAttributeNode_Proxy( + IXMLDOMElement * This, + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + +void __RPC_STUB IXMLDOMElement_setAttributeNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_removeAttributeNode_Proxy( + IXMLDOMElement * This, + /* [in] */ IXMLDOMAttribute *DOMAttribute, + /* [retval][out] */ IXMLDOMAttribute **attributeNode); + + +void __RPC_STUB IXMLDOMElement_removeAttributeNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getElementsByTagName_Proxy( + IXMLDOMElement * This, + /* [in] */ BSTR tagName, + /* [retval][out] */ IXMLDOMNodeList **resultList); + + +void __RPC_STUB IXMLDOMElement_getElementsByTagName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_normalize_Proxy( + IXMLDOMElement * This); + + +void __RPC_STUB IXMLDOMElement_normalize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMElement_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMText_INTERFACE_DEFINED__ +#define __IXMLDOMText_INTERFACE_DEFINED__ + +/* interface IXMLDOMText */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMText; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF87-7B36-11d2-B20E-00C04F983E60") + IXMLDOMText : public IXMLDOMCharacterData + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE splitText( + /* [in] */ long offset, + /* [retval][out] */ IXMLDOMText **rightHandTextNode) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMTextVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMText * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMText * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMText * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMText * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMText * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMText * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMText * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMText * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMText * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMText * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMText * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMText * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMText * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMText * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMText * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMText * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMText * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMText * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMText * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMText * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMText * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMText * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMText * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMText * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMText * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMText * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( + IXMLDOMText * This, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( + IXMLDOMText * This, + /* [in] */ BSTR data); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMText * This, + /* [retval][out] */ long *dataLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( + IXMLDOMText * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( + IXMLDOMText * This, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( + IXMLDOMText * This, + /* [in] */ long offset, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( + IXMLDOMText * This, + /* [in] */ long offset, + /* [in] */ long count); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( + IXMLDOMText * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *splitText )( + IXMLDOMText * This, + /* [in] */ long offset, + /* [retval][out] */ IXMLDOMText **rightHandTextNode); + + END_INTERFACE + } IXMLDOMTextVtbl; + + interface IXMLDOMText + { + CONST_VTBL struct IXMLDOMTextVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMText_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMText_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMText_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMText_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMText_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMText_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMText_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMText_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMText_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMText_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMText_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMText_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMText_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMText_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMText_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMText_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMText_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMText_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMText_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMText_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMText_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMText_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMText_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMText_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMText_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMText_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMText_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMText_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMText_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMText_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMText_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMText_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMText_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMText_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMText_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMText_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMText_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMText_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMText_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMText_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMText_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMText_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMText_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMText_get_data(This,data) \ + (This)->lpVtbl -> get_data(This,data) + +#define IXMLDOMText_put_data(This,data) \ + (This)->lpVtbl -> put_data(This,data) + +#define IXMLDOMText_get_length(This,dataLength) \ + (This)->lpVtbl -> get_length(This,dataLength) + +#define IXMLDOMText_substringData(This,offset,count,data) \ + (This)->lpVtbl -> substringData(This,offset,count,data) + +#define IXMLDOMText_appendData(This,data) \ + (This)->lpVtbl -> appendData(This,data) + +#define IXMLDOMText_insertData(This,offset,data) \ + (This)->lpVtbl -> insertData(This,offset,data) + +#define IXMLDOMText_deleteData(This,offset,count) \ + (This)->lpVtbl -> deleteData(This,offset,count) + +#define IXMLDOMText_replaceData(This,offset,count,data) \ + (This)->lpVtbl -> replaceData(This,offset,count,data) + + +#define IXMLDOMText_splitText(This,offset,rightHandTextNode) \ + (This)->lpVtbl -> splitText(This,offset,rightHandTextNode) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMText_splitText_Proxy( + IXMLDOMText * This, + /* [in] */ long offset, + /* [retval][out] */ IXMLDOMText **rightHandTextNode); + + +void __RPC_STUB IXMLDOMText_splitText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMText_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMComment_INTERFACE_DEFINED__ +#define __IXMLDOMComment_INTERFACE_DEFINED__ + +/* interface IXMLDOMComment */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMComment; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF88-7B36-11d2-B20E-00C04F983E60") + IXMLDOMComment : public IXMLDOMCharacterData + { + public: + }; + +#else /* C style interface */ + + typedef struct IXMLDOMCommentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMComment * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMComment * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMComment * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMComment * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMComment * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMComment * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMComment * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMComment * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMComment * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMComment * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMComment * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMComment * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMComment * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMComment * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMComment * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMComment * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMComment * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMComment * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMComment * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMComment * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMComment * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMComment * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMComment * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMComment * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMComment * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMComment * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( + IXMLDOMComment * This, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( + IXMLDOMComment * This, + /* [in] */ BSTR data); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMComment * This, + /* [retval][out] */ long *dataLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( + IXMLDOMComment * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( + IXMLDOMComment * This, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( + IXMLDOMComment * This, + /* [in] */ long offset, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( + IXMLDOMComment * This, + /* [in] */ long offset, + /* [in] */ long count); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( + IXMLDOMComment * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data); + + END_INTERFACE + } IXMLDOMCommentVtbl; + + interface IXMLDOMComment + { + CONST_VTBL struct IXMLDOMCommentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMComment_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMComment_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMComment_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMComment_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMComment_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMComment_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMComment_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMComment_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMComment_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMComment_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMComment_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMComment_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMComment_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMComment_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMComment_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMComment_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMComment_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMComment_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMComment_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMComment_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMComment_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMComment_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMComment_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMComment_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMComment_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMComment_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMComment_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMComment_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMComment_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMComment_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMComment_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMComment_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMComment_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMComment_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMComment_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMComment_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMComment_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMComment_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMComment_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMComment_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMComment_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMComment_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMComment_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMComment_get_data(This,data) \ + (This)->lpVtbl -> get_data(This,data) + +#define IXMLDOMComment_put_data(This,data) \ + (This)->lpVtbl -> put_data(This,data) + +#define IXMLDOMComment_get_length(This,dataLength) \ + (This)->lpVtbl -> get_length(This,dataLength) + +#define IXMLDOMComment_substringData(This,offset,count,data) \ + (This)->lpVtbl -> substringData(This,offset,count,data) + +#define IXMLDOMComment_appendData(This,data) \ + (This)->lpVtbl -> appendData(This,data) + +#define IXMLDOMComment_insertData(This,offset,data) \ + (This)->lpVtbl -> insertData(This,offset,data) + +#define IXMLDOMComment_deleteData(This,offset,count) \ + (This)->lpVtbl -> deleteData(This,offset,count) + +#define IXMLDOMComment_replaceData(This,offset,count,data) \ + (This)->lpVtbl -> replaceData(This,offset,count,data) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IXMLDOMComment_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ +#define __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ + +/* interface IXMLDOMProcessingInstruction */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMProcessingInstruction; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF89-7B36-11d2-B20E-00C04F983E60") + IXMLDOMProcessingInstruction : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_target( + /* [retval][out] */ BSTR *name) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_data( + /* [retval][out] */ BSTR *value) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_data( + /* [in] */ BSTR value) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMProcessingInstructionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMProcessingInstruction * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMProcessingInstruction * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMProcessingInstruction * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMProcessingInstruction * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMProcessingInstruction * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMProcessingInstruction * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMProcessingInstruction * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMProcessingInstruction * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMProcessingInstruction * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMProcessingInstruction * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMProcessingInstruction * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMProcessingInstruction * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_target )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ BSTR *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR value); + + END_INTERFACE + } IXMLDOMProcessingInstructionVtbl; + + interface IXMLDOMProcessingInstruction + { + CONST_VTBL struct IXMLDOMProcessingInstructionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMProcessingInstruction_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMProcessingInstruction_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMProcessingInstruction_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMProcessingInstruction_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMProcessingInstruction_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMProcessingInstruction_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMProcessingInstruction_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMProcessingInstruction_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMProcessingInstruction_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMProcessingInstruction_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMProcessingInstruction_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMProcessingInstruction_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMProcessingInstruction_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMProcessingInstruction_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMProcessingInstruction_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMProcessingInstruction_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMProcessingInstruction_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMProcessingInstruction_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMProcessingInstruction_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMProcessingInstruction_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMProcessingInstruction_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMProcessingInstruction_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMProcessingInstruction_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMProcessingInstruction_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMProcessingInstruction_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMProcessingInstruction_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMProcessingInstruction_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMProcessingInstruction_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMProcessingInstruction_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMProcessingInstruction_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMProcessingInstruction_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMProcessingInstruction_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMProcessingInstruction_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMProcessingInstruction_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMProcessingInstruction_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMProcessingInstruction_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMProcessingInstruction_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMProcessingInstruction_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMProcessingInstruction_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMProcessingInstruction_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMProcessingInstruction_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMProcessingInstruction_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMProcessingInstruction_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMProcessingInstruction_get_target(This,name) \ + (This)->lpVtbl -> get_target(This,name) + +#define IXMLDOMProcessingInstruction_get_data(This,value) \ + (This)->lpVtbl -> get_data(This,value) + +#define IXMLDOMProcessingInstruction_put_data(This,value) \ + (This)->lpVtbl -> put_data(This,value) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_get_target_Proxy( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ BSTR *name); + + +void __RPC_STUB IXMLDOMProcessingInstruction_get_target_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_get_data_Proxy( + IXMLDOMProcessingInstruction * This, + /* [retval][out] */ BSTR *value); + + +void __RPC_STUB IXMLDOMProcessingInstruction_get_data_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_put_data_Proxy( + IXMLDOMProcessingInstruction * This, + /* [in] */ BSTR value); + + +void __RPC_STUB IXMLDOMProcessingInstruction_put_data_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMCDATASection_INTERFACE_DEFINED__ +#define __IXMLDOMCDATASection_INTERFACE_DEFINED__ + +/* interface IXMLDOMCDATASection */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMCDATASection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8A-7B36-11d2-B20E-00C04F983E60") + IXMLDOMCDATASection : public IXMLDOMText + { + public: + }; + +#else /* C style interface */ + + typedef struct IXMLDOMCDATASectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMCDATASection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMCDATASection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMCDATASection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMCDATASection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMCDATASection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMCDATASection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMCDATASection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMCDATASection * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMCDATASection * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMCDATASection * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMCDATASection * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMCDATASection * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMCDATASection * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMCDATASection * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMCDATASection * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMCDATASection * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMCDATASection * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMCDATASection * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMCDATASection * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMCDATASection * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMCDATASection * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMCDATASection * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( + IXMLDOMCDATASection * This, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR data); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMCDATASection * This, + /* [retval][out] */ long *dataLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( + IXMLDOMCDATASection * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [retval][out] */ BSTR *data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( + IXMLDOMCDATASection * This, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( + IXMLDOMCDATASection * This, + /* [in] */ long offset, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( + IXMLDOMCDATASection * This, + /* [in] */ long offset, + /* [in] */ long count); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( + IXMLDOMCDATASection * This, + /* [in] */ long offset, + /* [in] */ long count, + /* [in] */ BSTR data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *splitText )( + IXMLDOMCDATASection * This, + /* [in] */ long offset, + /* [retval][out] */ IXMLDOMText **rightHandTextNode); + + END_INTERFACE + } IXMLDOMCDATASectionVtbl; + + interface IXMLDOMCDATASection + { + CONST_VTBL struct IXMLDOMCDATASectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMCDATASection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMCDATASection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMCDATASection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMCDATASection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMCDATASection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMCDATASection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMCDATASection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMCDATASection_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMCDATASection_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMCDATASection_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMCDATASection_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMCDATASection_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMCDATASection_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMCDATASection_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMCDATASection_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMCDATASection_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMCDATASection_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMCDATASection_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMCDATASection_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMCDATASection_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMCDATASection_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMCDATASection_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMCDATASection_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMCDATASection_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMCDATASection_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMCDATASection_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMCDATASection_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMCDATASection_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMCDATASection_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMCDATASection_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMCDATASection_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMCDATASection_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMCDATASection_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMCDATASection_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMCDATASection_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMCDATASection_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMCDATASection_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMCDATASection_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMCDATASection_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMCDATASection_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMCDATASection_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMCDATASection_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMCDATASection_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMCDATASection_get_data(This,data) \ + (This)->lpVtbl -> get_data(This,data) + +#define IXMLDOMCDATASection_put_data(This,data) \ + (This)->lpVtbl -> put_data(This,data) + +#define IXMLDOMCDATASection_get_length(This,dataLength) \ + (This)->lpVtbl -> get_length(This,dataLength) + +#define IXMLDOMCDATASection_substringData(This,offset,count,data) \ + (This)->lpVtbl -> substringData(This,offset,count,data) + +#define IXMLDOMCDATASection_appendData(This,data) \ + (This)->lpVtbl -> appendData(This,data) + +#define IXMLDOMCDATASection_insertData(This,offset,data) \ + (This)->lpVtbl -> insertData(This,offset,data) + +#define IXMLDOMCDATASection_deleteData(This,offset,count) \ + (This)->lpVtbl -> deleteData(This,offset,count) + +#define IXMLDOMCDATASection_replaceData(This,offset,count,data) \ + (This)->lpVtbl -> replaceData(This,offset,count,data) + + +#define IXMLDOMCDATASection_splitText(This,offset,rightHandTextNode) \ + (This)->lpVtbl -> splitText(This,offset,rightHandTextNode) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IXMLDOMCDATASection_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMDocumentType_INTERFACE_DEFINED__ +#define __IXMLDOMDocumentType_INTERFACE_DEFINED__ + +/* interface IXMLDOMDocumentType */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMDocumentType; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8B-7B36-11d2-B20E-00C04F983E60") + IXMLDOMDocumentType : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_name( + /* [retval][out] */ BSTR *rootName) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_entities( + /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_notations( + /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMDocumentTypeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMDocumentType * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMDocumentType * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMDocumentType * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMDocumentType * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMDocumentType * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMDocumentType * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMDocumentType * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMDocumentType * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMDocumentType * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMDocumentType * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMDocumentType * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMDocumentType * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMDocumentType * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMDocumentType * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMDocumentType * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMDocumentType * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMDocumentType * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMDocumentType * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMDocumentType * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMDocumentType * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMDocumentType * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMDocumentType * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMDocumentType * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMDocumentType * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMDocumentType * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + IXMLDOMDocumentType * This, + /* [retval][out] */ BSTR *rootName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_entities )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_notations )( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap); + + END_INTERFACE + } IXMLDOMDocumentTypeVtbl; + + interface IXMLDOMDocumentType + { + CONST_VTBL struct IXMLDOMDocumentTypeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMDocumentType_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMDocumentType_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMDocumentType_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMDocumentType_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMDocumentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMDocumentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMDocumentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMDocumentType_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMDocumentType_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMDocumentType_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMDocumentType_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMDocumentType_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMDocumentType_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMDocumentType_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMDocumentType_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMDocumentType_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMDocumentType_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMDocumentType_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMDocumentType_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMDocumentType_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMDocumentType_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMDocumentType_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMDocumentType_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMDocumentType_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMDocumentType_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMDocumentType_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMDocumentType_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMDocumentType_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMDocumentType_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMDocumentType_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMDocumentType_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocumentType_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMDocumentType_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMDocumentType_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMDocumentType_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMDocumentType_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMDocumentType_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMDocumentType_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMDocumentType_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMDocumentType_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMDocumentType_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMDocumentType_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMDocumentType_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMDocumentType_get_name(This,rootName) \ + (This)->lpVtbl -> get_name(This,rootName) + +#define IXMLDOMDocumentType_get_entities(This,entityMap) \ + (This)->lpVtbl -> get_entities(This,entityMap) + +#define IXMLDOMDocumentType_get_notations(This,notationMap) \ + (This)->lpVtbl -> get_notations(This,notationMap) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_name_Proxy( + IXMLDOMDocumentType * This, + /* [retval][out] */ BSTR *rootName); + + +void __RPC_STUB IXMLDOMDocumentType_get_name_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_entities_Proxy( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap); + + +void __RPC_STUB IXMLDOMDocumentType_get_entities_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_notations_Proxy( + IXMLDOMDocumentType * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap); + + +void __RPC_STUB IXMLDOMDocumentType_get_notations_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMDocumentType_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMNotation_INTERFACE_DEFINED__ +#define __IXMLDOMNotation_INTERFACE_DEFINED__ + +/* interface IXMLDOMNotation */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMNotation; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8C-7B36-11d2-B20E-00C04F983E60") + IXMLDOMNotation : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( + /* [retval][out] */ VARIANT *publicID) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( + /* [retval][out] */ VARIANT *systemID) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMNotationVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMNotation * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMNotation * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMNotation * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMNotation * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMNotation * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMNotation * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMNotation * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMNotation * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMNotation * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMNotation * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMNotation * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMNotation * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMNotation * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMNotation * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMNotation * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMNotation * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMNotation * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMNotation * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMNotation * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMNotation * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMNotation * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMNotation * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMNotation * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT *publicID); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT *systemID); + + END_INTERFACE + } IXMLDOMNotationVtbl; + + interface IXMLDOMNotation + { + CONST_VTBL struct IXMLDOMNotationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMNotation_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMNotation_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMNotation_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMNotation_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMNotation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMNotation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMNotation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMNotation_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMNotation_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMNotation_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMNotation_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMNotation_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMNotation_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMNotation_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMNotation_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMNotation_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMNotation_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMNotation_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMNotation_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMNotation_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMNotation_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMNotation_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMNotation_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMNotation_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMNotation_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMNotation_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMNotation_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMNotation_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMNotation_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMNotation_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMNotation_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMNotation_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMNotation_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMNotation_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMNotation_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMNotation_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMNotation_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMNotation_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMNotation_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMNotation_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMNotation_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMNotation_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMNotation_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMNotation_get_publicId(This,publicID) \ + (This)->lpVtbl -> get_publicId(This,publicID) + +#define IXMLDOMNotation_get_systemId(This,systemID) \ + (This)->lpVtbl -> get_systemId(This,systemID) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNotation_get_publicId_Proxy( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT *publicID); + + +void __RPC_STUB IXMLDOMNotation_get_publicId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNotation_get_systemId_Proxy( + IXMLDOMNotation * This, + /* [retval][out] */ VARIANT *systemID); + + +void __RPC_STUB IXMLDOMNotation_get_systemId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMNotation_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMEntity_INTERFACE_DEFINED__ +#define __IXMLDOMEntity_INTERFACE_DEFINED__ + +/* interface IXMLDOMEntity */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMEntity; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8D-7B36-11d2-B20E-00C04F983E60") + IXMLDOMEntity : public IXMLDOMNode + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( + /* [retval][out] */ VARIANT *publicID) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( + /* [retval][out] */ VARIANT *systemID) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_notationName( + /* [retval][out] */ BSTR *name) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMEntityVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMEntity * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMEntity * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMEntity * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMEntity * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMEntity * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMEntity * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMEntity * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMEntity * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMEntity * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMEntity * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMEntity * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMEntity * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMEntity * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMEntity * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMEntity * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMEntity * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMEntity * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMEntity * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMEntity * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMEntity * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMEntity * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMEntity * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMEntity * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT *publicID); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT *systemID); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_notationName )( + IXMLDOMEntity * This, + /* [retval][out] */ BSTR *name); + + END_INTERFACE + } IXMLDOMEntityVtbl; + + interface IXMLDOMEntity + { + CONST_VTBL struct IXMLDOMEntityVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMEntity_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMEntity_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMEntity_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMEntity_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMEntity_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMEntity_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMEntity_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMEntity_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMEntity_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMEntity_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMEntity_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMEntity_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMEntity_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMEntity_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMEntity_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMEntity_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMEntity_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMEntity_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMEntity_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMEntity_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMEntity_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMEntity_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMEntity_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMEntity_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMEntity_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMEntity_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMEntity_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMEntity_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMEntity_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMEntity_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMEntity_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMEntity_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMEntity_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMEntity_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMEntity_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMEntity_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMEntity_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMEntity_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMEntity_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMEntity_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMEntity_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMEntity_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMEntity_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXMLDOMEntity_get_publicId(This,publicID) \ + (This)->lpVtbl -> get_publicId(This,publicID) + +#define IXMLDOMEntity_get_systemId(This,systemID) \ + (This)->lpVtbl -> get_systemId(This,systemID) + +#define IXMLDOMEntity_get_notationName(This,name) \ + (This)->lpVtbl -> get_notationName(This,name) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_publicId_Proxy( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT *publicID); + + +void __RPC_STUB IXMLDOMEntity_get_publicId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_systemId_Proxy( + IXMLDOMEntity * This, + /* [retval][out] */ VARIANT *systemID); + + +void __RPC_STUB IXMLDOMEntity_get_systemId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_notationName_Proxy( + IXMLDOMEntity * This, + /* [retval][out] */ BSTR *name); + + +void __RPC_STUB IXMLDOMEntity_get_notationName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMEntity_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMEntityReference_INTERFACE_DEFINED__ +#define __IXMLDOMEntityReference_INTERFACE_DEFINED__ + +/* interface IXMLDOMEntityReference */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMEntityReference; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF8E-7B36-11d2-B20E-00C04F983E60") + IXMLDOMEntityReference : public IXMLDOMNode + { + public: + }; + +#else /* C style interface */ + + typedef struct IXMLDOMEntityReferenceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMEntityReference * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMEntityReference * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMEntityReference * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMEntityReference * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMEntityReference * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMEntityReference * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMEntityReference * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXMLDOMEntityReference * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXMLDOMEntityReference * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXMLDOMEntityReference * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXMLDOMEntityReference * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXMLDOMEntityReference * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXMLDOMEntityReference * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXMLDOMEntityReference * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXMLDOMEntityReference * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXMLDOMEntityReference * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXMLDOMEntityReference * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXMLDOMEntityReference * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXMLDOMEntityReference * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXMLDOMEntityReference * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXMLDOMEntityReference * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXMLDOMEntityReference * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXMLDOMEntityReference * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXMLDOMEntityReference * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXMLDOMEntityReference * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXMLDOMEntityReference * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + END_INTERFACE + } IXMLDOMEntityReferenceVtbl; + + interface IXMLDOMEntityReference + { + CONST_VTBL struct IXMLDOMEntityReferenceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMEntityReference_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMEntityReference_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMEntityReference_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMEntityReference_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMEntityReference_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMEntityReference_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMEntityReference_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMEntityReference_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXMLDOMEntityReference_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXMLDOMEntityReference_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXMLDOMEntityReference_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXMLDOMEntityReference_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXMLDOMEntityReference_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXMLDOMEntityReference_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXMLDOMEntityReference_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXMLDOMEntityReference_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXMLDOMEntityReference_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXMLDOMEntityReference_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXMLDOMEntityReference_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXMLDOMEntityReference_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXMLDOMEntityReference_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXMLDOMEntityReference_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXMLDOMEntityReference_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXMLDOMEntityReference_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXMLDOMEntityReference_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXMLDOMEntityReference_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXMLDOMEntityReference_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXMLDOMEntityReference_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXMLDOMEntityReference_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXMLDOMEntityReference_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXMLDOMEntityReference_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXMLDOMEntityReference_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXMLDOMEntityReference_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXMLDOMEntityReference_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXMLDOMEntityReference_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXMLDOMEntityReference_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXMLDOMEntityReference_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXMLDOMEntityReference_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXMLDOMEntityReference_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXMLDOMEntityReference_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXMLDOMEntityReference_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXMLDOMEntityReference_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXMLDOMEntityReference_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IXMLDOMEntityReference_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMParseError_INTERFACE_DEFINED__ +#define __IXMLDOMParseError_INTERFACE_DEFINED__ + +/* interface IXMLDOMParseError */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMParseError; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa426-272f-11d2-836f-0000f87a7782") + IXMLDOMParseError : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_errorCode( + /* [out][retval] */ long *errorCode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_url( + /* [out][retval] */ BSTR *urlString) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_reason( + /* [out][retval] */ BSTR *reasonString) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_srcText( + /* [out][retval] */ BSTR *sourceString) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_line( + /* [out][retval] */ long *lineNumber) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_linepos( + /* [out][retval] */ long *linePosition) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_filepos( + /* [out][retval] */ long *filePosition) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMParseErrorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMParseError * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMParseError * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMParseError * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMParseError * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMParseError * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMParseError * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMParseError * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorCode )( + IXMLDOMParseError * This, + /* [out][retval] */ long *errorCode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *urlString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_reason )( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *reasonString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_srcText )( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *sourceString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_line )( + IXMLDOMParseError * This, + /* [out][retval] */ long *lineNumber); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_linepos )( + IXMLDOMParseError * This, + /* [out][retval] */ long *linePosition); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_filepos )( + IXMLDOMParseError * This, + /* [out][retval] */ long *filePosition); + + END_INTERFACE + } IXMLDOMParseErrorVtbl; + + interface IXMLDOMParseError + { + CONST_VTBL struct IXMLDOMParseErrorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMParseError_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMParseError_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMParseError_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMParseError_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMParseError_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMParseError_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMParseError_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMParseError_get_errorCode(This,errorCode) \ + (This)->lpVtbl -> get_errorCode(This,errorCode) + +#define IXMLDOMParseError_get_url(This,urlString) \ + (This)->lpVtbl -> get_url(This,urlString) + +#define IXMLDOMParseError_get_reason(This,reasonString) \ + (This)->lpVtbl -> get_reason(This,reasonString) + +#define IXMLDOMParseError_get_srcText(This,sourceString) \ + (This)->lpVtbl -> get_srcText(This,sourceString) + +#define IXMLDOMParseError_get_line(This,lineNumber) \ + (This)->lpVtbl -> get_line(This,lineNumber) + +#define IXMLDOMParseError_get_linepos(This,linePosition) \ + (This)->lpVtbl -> get_linepos(This,linePosition) + +#define IXMLDOMParseError_get_filepos(This,filePosition) \ + (This)->lpVtbl -> get_filepos(This,filePosition) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_errorCode_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ long *errorCode); + + +void __RPC_STUB IXMLDOMParseError_get_errorCode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_url_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *urlString); + + +void __RPC_STUB IXMLDOMParseError_get_url_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_reason_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *reasonString); + + +void __RPC_STUB IXMLDOMParseError_get_reason_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_srcText_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ BSTR *sourceString); + + +void __RPC_STUB IXMLDOMParseError_get_srcText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_line_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ long *lineNumber); + + +void __RPC_STUB IXMLDOMParseError_get_line_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_linepos_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ long *linePosition); + + +void __RPC_STUB IXMLDOMParseError_get_linepos_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_filepos_Proxy( + IXMLDOMParseError * This, + /* [out][retval] */ long *filePosition); + + +void __RPC_STUB IXMLDOMParseError_get_filepos_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMParseError_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMParseError2_INTERFACE_DEFINED__ +#define __IXMLDOMParseError2_INTERFACE_DEFINED__ + +/* interface IXMLDOMParseError2 */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMParseError2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa428-272f-11d2-836f-0000f87a7782") + IXMLDOMParseError2 : public IXMLDOMParseError + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_errorXPath( + /* [retval][out] */ BSTR *xpathexpr) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_allErrors( + /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE errorParameters( + /* [in] */ long index, + /* [retval][out] */ BSTR *param) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_errorParametersCount( + /* [retval][out] */ long *count) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMParseError2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMParseError2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMParseError2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMParseError2 * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMParseError2 * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMParseError2 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMParseError2 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMParseError2 * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorCode )( + IXMLDOMParseError2 * This, + /* [out][retval] */ long *errorCode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( + IXMLDOMParseError2 * This, + /* [out][retval] */ BSTR *urlString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_reason )( + IXMLDOMParseError2 * This, + /* [out][retval] */ BSTR *reasonString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_srcText )( + IXMLDOMParseError2 * This, + /* [out][retval] */ BSTR *sourceString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_line )( + IXMLDOMParseError2 * This, + /* [out][retval] */ long *lineNumber); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_linepos )( + IXMLDOMParseError2 * This, + /* [out][retval] */ long *linePosition); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_filepos )( + IXMLDOMParseError2 * This, + /* [out][retval] */ long *filePosition); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorXPath )( + IXMLDOMParseError2 * This, + /* [retval][out] */ BSTR *xpathexpr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_allErrors )( + IXMLDOMParseError2 * This, + /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *errorParameters )( + IXMLDOMParseError2 * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *param); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorParametersCount )( + IXMLDOMParseError2 * This, + /* [retval][out] */ long *count); + + END_INTERFACE + } IXMLDOMParseError2Vtbl; + + interface IXMLDOMParseError2 + { + CONST_VTBL struct IXMLDOMParseError2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMParseError2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMParseError2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMParseError2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMParseError2_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMParseError2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMParseError2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMParseError2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMParseError2_get_errorCode(This,errorCode) \ + (This)->lpVtbl -> get_errorCode(This,errorCode) + +#define IXMLDOMParseError2_get_url(This,urlString) \ + (This)->lpVtbl -> get_url(This,urlString) + +#define IXMLDOMParseError2_get_reason(This,reasonString) \ + (This)->lpVtbl -> get_reason(This,reasonString) + +#define IXMLDOMParseError2_get_srcText(This,sourceString) \ + (This)->lpVtbl -> get_srcText(This,sourceString) + +#define IXMLDOMParseError2_get_line(This,lineNumber) \ + (This)->lpVtbl -> get_line(This,lineNumber) + +#define IXMLDOMParseError2_get_linepos(This,linePosition) \ + (This)->lpVtbl -> get_linepos(This,linePosition) + +#define IXMLDOMParseError2_get_filepos(This,filePosition) \ + (This)->lpVtbl -> get_filepos(This,filePosition) + + +#define IXMLDOMParseError2_get_errorXPath(This,xpathexpr) \ + (This)->lpVtbl -> get_errorXPath(This,xpathexpr) + +#define IXMLDOMParseError2_get_allErrors(This,allErrors) \ + (This)->lpVtbl -> get_allErrors(This,allErrors) + +#define IXMLDOMParseError2_errorParameters(This,index,param) \ + (This)->lpVtbl -> errorParameters(This,index,param) + +#define IXMLDOMParseError2_get_errorParametersCount(This,count) \ + (This)->lpVtbl -> get_errorParametersCount(This,count) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_errorXPath_Proxy( + IXMLDOMParseError2 * This, + /* [retval][out] */ BSTR *xpathexpr); + + +void __RPC_STUB IXMLDOMParseError2_get_errorXPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_allErrors_Proxy( + IXMLDOMParseError2 * This, + /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors); + + +void __RPC_STUB IXMLDOMParseError2_get_allErrors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_errorParameters_Proxy( + IXMLDOMParseError2 * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *param); + + +void __RPC_STUB IXMLDOMParseError2_errorParameters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_errorParametersCount_Proxy( + IXMLDOMParseError2 * This, + /* [retval][out] */ long *count); + + +void __RPC_STUB IXMLDOMParseError2_get_errorParametersCount_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMParseError2_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ +#define __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ + +/* interface IXMLDOMParseErrorCollection */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMParseErrorCollection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa429-272f-11d2-836f-0000f87a7782") + IXMLDOMParseErrorCollection : public IDispatch + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ IXMLDOMParseError2 **error) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *length) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_next( + /* [retval][out] */ IXMLDOMParseError2 **error) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [retval][out] */ IUnknown **ppunk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMParseErrorCollectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMParseErrorCollection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMParseErrorCollection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMParseErrorCollection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMParseErrorCollection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMParseErrorCollection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMParseErrorCollection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMParseErrorCollection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + IXMLDOMParseErrorCollection * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMParseError2 **error); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ long *length); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_next )( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ IXMLDOMParseError2 **error); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IXMLDOMParseErrorCollection * This); + + /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + END_INTERFACE + } IXMLDOMParseErrorCollectionVtbl; + + interface IXMLDOMParseErrorCollection + { + CONST_VTBL struct IXMLDOMParseErrorCollectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMParseErrorCollection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMParseErrorCollection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMParseErrorCollection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMParseErrorCollection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMParseErrorCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMParseErrorCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMParseErrorCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMParseErrorCollection_get_item(This,index,error) \ + (This)->lpVtbl -> get_item(This,index,error) + +#define IXMLDOMParseErrorCollection_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define IXMLDOMParseErrorCollection_get_next(This,error) \ + (This)->lpVtbl -> get_next(This,error) + +#define IXMLDOMParseErrorCollection_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IXMLDOMParseErrorCollection_get__newEnum(This,ppunk) \ + (This)->lpVtbl -> get__newEnum(This,ppunk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_item_Proxy( + IXMLDOMParseErrorCollection * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMParseError2 **error); + + +void __RPC_STUB IXMLDOMParseErrorCollection_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_length_Proxy( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ long *length); + + +void __RPC_STUB IXMLDOMParseErrorCollection_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_next_Proxy( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ IXMLDOMParseError2 **error); + + +void __RPC_STUB IXMLDOMParseErrorCollection_get_next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_reset_Proxy( + IXMLDOMParseErrorCollection * This); + + +void __RPC_STUB IXMLDOMParseErrorCollection_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get__newEnum_Proxy( + IXMLDOMParseErrorCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + +void __RPC_STUB IXMLDOMParseErrorCollection_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ +#define __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ + +/* interface IXMLDOMSchemaCollection */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMSchemaCollection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("373984c8-b845-449b-91e7-45ac83036ade") + IXMLDOMSchemaCollection : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE add( + /* [in] */ BSTR namespaceURI, + /* [in] */ VARIANT var) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE get( + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **schemaNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE remove( + /* [in] */ BSTR namespaceURI) = 0; + + virtual /* [propget][helpstring][id] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *length) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( + /* [in] */ long index, + /* [retval][out] */ BSTR *length) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addCollection( + /* [in] */ IXMLDOMSchemaCollection *otherCollection) = 0; + + virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [out][retval] */ IUnknown **ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMSchemaCollectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMSchemaCollection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMSchemaCollection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMSchemaCollection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMSchemaCollection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMSchemaCollection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMSchemaCollection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMSchemaCollection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *add )( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI, + /* [in] */ VARIANT var); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get )( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **schemaNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *remove )( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI); + + /* [propget][helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMSchemaCollection * This, + /* [retval][out] */ long *length); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMSchemaCollection * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *length); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addCollection )( + IXMLDOMSchemaCollection * This, + /* [in] */ IXMLDOMSchemaCollection *otherCollection); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMSchemaCollection * This, + /* [out][retval] */ IUnknown **ppUnk); + + END_INTERFACE + } IXMLDOMSchemaCollectionVtbl; + + interface IXMLDOMSchemaCollection + { + CONST_VTBL struct IXMLDOMSchemaCollectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMSchemaCollection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMSchemaCollection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMSchemaCollection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMSchemaCollection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMSchemaCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMSchemaCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMSchemaCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMSchemaCollection_add(This,namespaceURI,var) \ + (This)->lpVtbl -> add(This,namespaceURI,var) + +#define IXMLDOMSchemaCollection_get(This,namespaceURI,schemaNode) \ + (This)->lpVtbl -> get(This,namespaceURI,schemaNode) + +#define IXMLDOMSchemaCollection_remove(This,namespaceURI) \ + (This)->lpVtbl -> remove(This,namespaceURI) + +#define IXMLDOMSchemaCollection_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define IXMLDOMSchemaCollection_get_namespaceURI(This,index,length) \ + (This)->lpVtbl -> get_namespaceURI(This,index,length) + +#define IXMLDOMSchemaCollection_addCollection(This,otherCollection) \ + (This)->lpVtbl -> addCollection(This,otherCollection) + +#define IXMLDOMSchemaCollection_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_add_Proxy( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI, + /* [in] */ VARIANT var); + + +void __RPC_STUB IXMLDOMSchemaCollection_add_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_Proxy( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **schemaNode); + + +void __RPC_STUB IXMLDOMSchemaCollection_get_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_remove_Proxy( + IXMLDOMSchemaCollection * This, + /* [in] */ BSTR namespaceURI); + + +void __RPC_STUB IXMLDOMSchemaCollection_remove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_length_Proxy( + IXMLDOMSchemaCollection * This, + /* [retval][out] */ long *length); + + +void __RPC_STUB IXMLDOMSchemaCollection_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_namespaceURI_Proxy( + IXMLDOMSchemaCollection * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *length); + + +void __RPC_STUB IXMLDOMSchemaCollection_get_namespaceURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_addCollection_Proxy( + IXMLDOMSchemaCollection * This, + /* [in] */ IXMLDOMSchemaCollection *otherCollection); + + +void __RPC_STUB IXMLDOMSchemaCollection_addCollection_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get__newEnum_Proxy( + IXMLDOMSchemaCollection * This, + /* [out][retval] */ IUnknown **ppUnk); + + +void __RPC_STUB IXMLDOMSchemaCollection_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ */ + + +#ifndef __IXTLRuntime_INTERFACE_DEFINED__ +#define __IXTLRuntime_INTERFACE_DEFINED__ + +/* interface IXTLRuntime */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXTLRuntime; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa425-272f-11d2-836f-0000f87a7782") + IXTLRuntime : public IXMLDOMNode + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE uniqueID( + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pID) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE depth( + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pDepth) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE childNumber( + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ancestorChildNumber( + /* [in] */ BSTR bstrNodeName, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE absoluteChildNumber( + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatIndex( + /* [in] */ long lIndex, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatNumber( + /* [in] */ double dblNumber, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatDate( + /* [in] */ VARIANT varDate, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatTime( + /* [in] */ VARIANT varTime, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXTLRuntimeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXTLRuntime * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXTLRuntime * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXTLRuntime * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXTLRuntime * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXTLRuntime * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXTLRuntime * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXTLRuntime * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( + IXTLRuntime * This, + /* [retval][out] */ BSTR *name); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( + IXTLRuntime * This, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( + IXTLRuntime * This, + /* [in] */ VARIANT value); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( + IXTLRuntime * This, + /* [retval][out] */ DOMNodeType *type); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNode **parent); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNodeList **childList); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNode **firstChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNode **lastChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNode **previousSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNode **nextSibling); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ VARIANT refChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *newChild, + /* [in] */ IXMLDOMNode *oldChild, + /* [retval][out] */ IXMLDOMNode **outOldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *childNode, + /* [retval][out] */ IXMLDOMNode **oldChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *newChild, + /* [retval][out] */ IXMLDOMNode **outNewChild); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( + IXTLRuntime * This, + /* [retval][out] */ VARIANT_BOOL *hasChild); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( + IXTLRuntime * This, + /* [retval][out] */ IXMLDOMDocument **DOMDocument); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( + IXTLRuntime * This, + /* [in] */ VARIANT_BOOL deep, + /* [retval][out] */ IXMLDOMNode **cloneRoot); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *nodeType); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *text); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( + IXTLRuntime * This, + /* [in] */ BSTR text); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( + IXTLRuntime * This, + /* [retval][out] */ VARIANT_BOOL *isSpecified); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( + IXTLRuntime * This, + /* [out][retval] */ IXMLDOMNode **definitionNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( + IXTLRuntime * This, + /* [out][retval] */ VARIANT *typedValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( + IXTLRuntime * This, + /* [in] */ VARIANT typedValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( + IXTLRuntime * This, + /* [out][retval] */ VARIANT *dataTypeName); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( + IXTLRuntime * This, + /* [in] */ BSTR dataTypeName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [out][retval] */ BSTR *xmlString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( + IXTLRuntime * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNodeList **resultList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( + IXTLRuntime * This, + /* [in] */ BSTR queryString, + /* [out][retval] */ IXMLDOMNode **resultNode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( + IXTLRuntime * This, + /* [out][retval] */ VARIANT_BOOL *isParsed); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *prefixString); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( + IXTLRuntime * This, + /* [out][retval] */ BSTR *nameString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *stylesheet, + /* [in] */ VARIANT outputObject); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *uniqueID )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pID); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *depth )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pDepth); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *childNumber )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ancestorChildNumber )( + IXTLRuntime * This, + /* [in] */ BSTR bstrNodeName, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *absoluteChildNumber )( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatIndex )( + IXTLRuntime * This, + /* [in] */ long lIndex, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatNumber )( + IXTLRuntime * This, + /* [in] */ double dblNumber, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatDate )( + IXTLRuntime * This, + /* [in] */ VARIANT varDate, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatTime )( + IXTLRuntime * This, + /* [in] */ VARIANT varTime, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString); + + END_INTERFACE + } IXTLRuntimeVtbl; + + interface IXTLRuntime + { + CONST_VTBL struct IXTLRuntimeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXTLRuntime_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXTLRuntime_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXTLRuntime_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXTLRuntime_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXTLRuntime_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXTLRuntime_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXTLRuntime_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXTLRuntime_get_nodeName(This,name) \ + (This)->lpVtbl -> get_nodeName(This,name) + +#define IXTLRuntime_get_nodeValue(This,value) \ + (This)->lpVtbl -> get_nodeValue(This,value) + +#define IXTLRuntime_put_nodeValue(This,value) \ + (This)->lpVtbl -> put_nodeValue(This,value) + +#define IXTLRuntime_get_nodeType(This,type) \ + (This)->lpVtbl -> get_nodeType(This,type) + +#define IXTLRuntime_get_parentNode(This,parent) \ + (This)->lpVtbl -> get_parentNode(This,parent) + +#define IXTLRuntime_get_childNodes(This,childList) \ + (This)->lpVtbl -> get_childNodes(This,childList) + +#define IXTLRuntime_get_firstChild(This,firstChild) \ + (This)->lpVtbl -> get_firstChild(This,firstChild) + +#define IXTLRuntime_get_lastChild(This,lastChild) \ + (This)->lpVtbl -> get_lastChild(This,lastChild) + +#define IXTLRuntime_get_previousSibling(This,previousSibling) \ + (This)->lpVtbl -> get_previousSibling(This,previousSibling) + +#define IXTLRuntime_get_nextSibling(This,nextSibling) \ + (This)->lpVtbl -> get_nextSibling(This,nextSibling) + +#define IXTLRuntime_get_attributes(This,attributeMap) \ + (This)->lpVtbl -> get_attributes(This,attributeMap) + +#define IXTLRuntime_insertBefore(This,newChild,refChild,outNewChild) \ + (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) + +#define IXTLRuntime_replaceChild(This,newChild,oldChild,outOldChild) \ + (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) + +#define IXTLRuntime_removeChild(This,childNode,oldChild) \ + (This)->lpVtbl -> removeChild(This,childNode,oldChild) + +#define IXTLRuntime_appendChild(This,newChild,outNewChild) \ + (This)->lpVtbl -> appendChild(This,newChild,outNewChild) + +#define IXTLRuntime_hasChildNodes(This,hasChild) \ + (This)->lpVtbl -> hasChildNodes(This,hasChild) + +#define IXTLRuntime_get_ownerDocument(This,DOMDocument) \ + (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) + +#define IXTLRuntime_cloneNode(This,deep,cloneRoot) \ + (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) + +#define IXTLRuntime_get_nodeTypeString(This,nodeType) \ + (This)->lpVtbl -> get_nodeTypeString(This,nodeType) + +#define IXTLRuntime_get_text(This,text) \ + (This)->lpVtbl -> get_text(This,text) + +#define IXTLRuntime_put_text(This,text) \ + (This)->lpVtbl -> put_text(This,text) + +#define IXTLRuntime_get_specified(This,isSpecified) \ + (This)->lpVtbl -> get_specified(This,isSpecified) + +#define IXTLRuntime_get_definition(This,definitionNode) \ + (This)->lpVtbl -> get_definition(This,definitionNode) + +#define IXTLRuntime_get_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) + +#define IXTLRuntime_put_nodeTypedValue(This,typedValue) \ + (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) + +#define IXTLRuntime_get_dataType(This,dataTypeName) \ + (This)->lpVtbl -> get_dataType(This,dataTypeName) + +#define IXTLRuntime_put_dataType(This,dataTypeName) \ + (This)->lpVtbl -> put_dataType(This,dataTypeName) + +#define IXTLRuntime_get_xml(This,xmlString) \ + (This)->lpVtbl -> get_xml(This,xmlString) + +#define IXTLRuntime_transformNode(This,stylesheet,xmlString) \ + (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) + +#define IXTLRuntime_selectNodes(This,queryString,resultList) \ + (This)->lpVtbl -> selectNodes(This,queryString,resultList) + +#define IXTLRuntime_selectSingleNode(This,queryString,resultNode) \ + (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) + +#define IXTLRuntime_get_parsed(This,isParsed) \ + (This)->lpVtbl -> get_parsed(This,isParsed) + +#define IXTLRuntime_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define IXTLRuntime_get_prefix(This,prefixString) \ + (This)->lpVtbl -> get_prefix(This,prefixString) + +#define IXTLRuntime_get_baseName(This,nameString) \ + (This)->lpVtbl -> get_baseName(This,nameString) + +#define IXTLRuntime_transformNodeToObject(This,stylesheet,outputObject) \ + (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) + + +#define IXTLRuntime_uniqueID(This,pNode,pID) \ + (This)->lpVtbl -> uniqueID(This,pNode,pID) + +#define IXTLRuntime_depth(This,pNode,pDepth) \ + (This)->lpVtbl -> depth(This,pNode,pDepth) + +#define IXTLRuntime_childNumber(This,pNode,pNumber) \ + (This)->lpVtbl -> childNumber(This,pNode,pNumber) + +#define IXTLRuntime_ancestorChildNumber(This,bstrNodeName,pNode,pNumber) \ + (This)->lpVtbl -> ancestorChildNumber(This,bstrNodeName,pNode,pNumber) + +#define IXTLRuntime_absoluteChildNumber(This,pNode,pNumber) \ + (This)->lpVtbl -> absoluteChildNumber(This,pNode,pNumber) + +#define IXTLRuntime_formatIndex(This,lIndex,bstrFormat,pbstrFormattedString) \ + (This)->lpVtbl -> formatIndex(This,lIndex,bstrFormat,pbstrFormattedString) + +#define IXTLRuntime_formatNumber(This,dblNumber,bstrFormat,pbstrFormattedString) \ + (This)->lpVtbl -> formatNumber(This,dblNumber,bstrFormat,pbstrFormattedString) + +#define IXTLRuntime_formatDate(This,varDate,bstrFormat,varDestLocale,pbstrFormattedString) \ + (This)->lpVtbl -> formatDate(This,varDate,bstrFormat,varDestLocale,pbstrFormattedString) + +#define IXTLRuntime_formatTime(This,varTime,bstrFormat,varDestLocale,pbstrFormattedString) \ + (This)->lpVtbl -> formatTime(This,varTime,bstrFormat,varDestLocale,pbstrFormattedString) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_uniqueID_Proxy( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pID); + + +void __RPC_STUB IXTLRuntime_uniqueID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_depth_Proxy( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pDepth); + + +void __RPC_STUB IXTLRuntime_depth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_childNumber_Proxy( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + +void __RPC_STUB IXTLRuntime_childNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_ancestorChildNumber_Proxy( + IXTLRuntime * This, + /* [in] */ BSTR bstrNodeName, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + +void __RPC_STUB IXTLRuntime_ancestorChildNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_absoluteChildNumber_Proxy( + IXTLRuntime * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ long *pNumber); + + +void __RPC_STUB IXTLRuntime_absoluteChildNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatIndex_Proxy( + IXTLRuntime * This, + /* [in] */ long lIndex, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString); + + +void __RPC_STUB IXTLRuntime_formatIndex_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatNumber_Proxy( + IXTLRuntime * This, + /* [in] */ double dblNumber, + /* [in] */ BSTR bstrFormat, + /* [retval][out] */ BSTR *pbstrFormattedString); + + +void __RPC_STUB IXTLRuntime_formatNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatDate_Proxy( + IXTLRuntime * This, + /* [in] */ VARIANT varDate, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString); + + +void __RPC_STUB IXTLRuntime_formatDate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatTime_Proxy( + IXTLRuntime * This, + /* [in] */ VARIANT varTime, + /* [in] */ BSTR bstrFormat, + /* [optional][in] */ VARIANT varDestLocale, + /* [retval][out] */ BSTR *pbstrFormattedString); + + +void __RPC_STUB IXTLRuntime_formatTime_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXTLRuntime_INTERFACE_DEFINED__ */ + + +#ifndef __IXSLTemplate_INTERFACE_DEFINED__ +#define __IXSLTemplate_INTERFACE_DEFINED__ + +/* interface IXSLTemplate */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXSLTemplate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF93-7B36-11d2-B20E-00C04F983E60") + IXSLTemplate : public IDispatch + { + public: + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_stylesheet( + /* [in] */ IXMLDOMNode *stylesheet) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_stylesheet( + /* [retval][out] */ IXMLDOMNode **stylesheet) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createProcessor( + /* [retval][out] */ IXSLProcessor **ppProcessor) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXSLTemplateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXSLTemplate * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXSLTemplate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXSLTemplate * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXSLTemplate * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXSLTemplate * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXSLTemplate * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXSLTemplate * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_stylesheet )( + IXSLTemplate * This, + /* [in] */ IXMLDOMNode *stylesheet); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_stylesheet )( + IXSLTemplate * This, + /* [retval][out] */ IXMLDOMNode **stylesheet); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessor )( + IXSLTemplate * This, + /* [retval][out] */ IXSLProcessor **ppProcessor); + + END_INTERFACE + } IXSLTemplateVtbl; + + interface IXSLTemplate + { + CONST_VTBL struct IXSLTemplateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXSLTemplate_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXSLTemplate_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXSLTemplate_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXSLTemplate_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXSLTemplate_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXSLTemplate_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXSLTemplate_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXSLTemplate_putref_stylesheet(This,stylesheet) \ + (This)->lpVtbl -> putref_stylesheet(This,stylesheet) + +#define IXSLTemplate_get_stylesheet(This,stylesheet) \ + (This)->lpVtbl -> get_stylesheet(This,stylesheet) + +#define IXSLTemplate_createProcessor(This,ppProcessor) \ + (This)->lpVtbl -> createProcessor(This,ppProcessor) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_putref_stylesheet_Proxy( + IXSLTemplate * This, + /* [in] */ IXMLDOMNode *stylesheet); + + +void __RPC_STUB IXSLTemplate_putref_stylesheet_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_get_stylesheet_Proxy( + IXSLTemplate * This, + /* [retval][out] */ IXMLDOMNode **stylesheet); + + +void __RPC_STUB IXSLTemplate_get_stylesheet_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_createProcessor_Proxy( + IXSLTemplate * This, + /* [retval][out] */ IXSLProcessor **ppProcessor); + + +void __RPC_STUB IXSLTemplate_createProcessor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXSLTemplate_INTERFACE_DEFINED__ */ + + +#ifndef __IXSLProcessor_INTERFACE_DEFINED__ +#define __IXSLProcessor_INTERFACE_DEFINED__ + +/* interface IXSLProcessor */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXSLProcessor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2933BF92-7B36-11d2-B20E-00C04F983E60") + IXSLProcessor : public IDispatch + { + public: + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_input( + /* [in] */ VARIANT var) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_input( + /* [retval][out] */ VARIANT *pVar) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ownerTemplate( + /* [retval][out] */ IXSLTemplate **ppTemplate) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setStartMode( + /* [in] */ BSTR mode, + /* [defaultvalue][in] */ BSTR namespaceURI = L"") = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_startMode( + /* [retval][out] */ BSTR *mode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_startModeURI( + /* [retval][out] */ BSTR *namespaceURI) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_output( + /* [in] */ VARIANT output) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_output( + /* [retval][out] */ VARIANT *pOutput) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transform( + /* [retval][out] */ VARIANT_BOOL *pDone) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( + /* [retval][out] */ long *pReadyState) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addParameter( + /* [in] */ BSTR baseName, + /* [in] */ VARIANT parameter, + /* [defaultvalue][in] */ BSTR namespaceURI = L"") = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addObject( + /* [in] */ IDispatch *obj, + /* [in] */ BSTR namespaceURI) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_stylesheet( + /* [retval][out] */ IXMLDOMNode **stylesheet) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXSLProcessorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXSLProcessor * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXSLProcessor * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXSLProcessor * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXSLProcessor * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXSLProcessor * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXSLProcessor * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXSLProcessor * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_input )( + IXSLProcessor * This, + /* [in] */ VARIANT var); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_input )( + IXSLProcessor * This, + /* [retval][out] */ VARIANT *pVar); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerTemplate )( + IXSLProcessor * This, + /* [retval][out] */ IXSLTemplate **ppTemplate); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setStartMode )( + IXSLProcessor * This, + /* [in] */ BSTR mode, + /* [defaultvalue][in] */ BSTR namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_startMode )( + IXSLProcessor * This, + /* [retval][out] */ BSTR *mode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_startModeURI )( + IXSLProcessor * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_output )( + IXSLProcessor * This, + /* [in] */ VARIANT output); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( + IXSLProcessor * This, + /* [retval][out] */ VARIANT *pOutput); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transform )( + IXSLProcessor * This, + /* [retval][out] */ VARIANT_BOOL *pDone); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IXSLProcessor * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IXSLProcessor * This, + /* [retval][out] */ long *pReadyState); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addParameter )( + IXSLProcessor * This, + /* [in] */ BSTR baseName, + /* [in] */ VARIANT parameter, + /* [defaultvalue][in] */ BSTR namespaceURI); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addObject )( + IXSLProcessor * This, + /* [in] */ IDispatch *obj, + /* [in] */ BSTR namespaceURI); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_stylesheet )( + IXSLProcessor * This, + /* [retval][out] */ IXMLDOMNode **stylesheet); + + END_INTERFACE + } IXSLProcessorVtbl; + + interface IXSLProcessor + { + CONST_VTBL struct IXSLProcessorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXSLProcessor_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXSLProcessor_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXSLProcessor_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXSLProcessor_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXSLProcessor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXSLProcessor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXSLProcessor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXSLProcessor_put_input(This,var) \ + (This)->lpVtbl -> put_input(This,var) + +#define IXSLProcessor_get_input(This,pVar) \ + (This)->lpVtbl -> get_input(This,pVar) + +#define IXSLProcessor_get_ownerTemplate(This,ppTemplate) \ + (This)->lpVtbl -> get_ownerTemplate(This,ppTemplate) + +#define IXSLProcessor_setStartMode(This,mode,namespaceURI) \ + (This)->lpVtbl -> setStartMode(This,mode,namespaceURI) + +#define IXSLProcessor_get_startMode(This,mode) \ + (This)->lpVtbl -> get_startMode(This,mode) + +#define IXSLProcessor_get_startModeURI(This,namespaceURI) \ + (This)->lpVtbl -> get_startModeURI(This,namespaceURI) + +#define IXSLProcessor_put_output(This,output) \ + (This)->lpVtbl -> put_output(This,output) + +#define IXSLProcessor_get_output(This,pOutput) \ + (This)->lpVtbl -> get_output(This,pOutput) + +#define IXSLProcessor_transform(This,pDone) \ + (This)->lpVtbl -> transform(This,pDone) + +#define IXSLProcessor_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IXSLProcessor_get_readyState(This,pReadyState) \ + (This)->lpVtbl -> get_readyState(This,pReadyState) + +#define IXSLProcessor_addParameter(This,baseName,parameter,namespaceURI) \ + (This)->lpVtbl -> addParameter(This,baseName,parameter,namespaceURI) + +#define IXSLProcessor_addObject(This,obj,namespaceURI) \ + (This)->lpVtbl -> addObject(This,obj,namespaceURI) + +#define IXSLProcessor_get_stylesheet(This,stylesheet) \ + (This)->lpVtbl -> get_stylesheet(This,stylesheet) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_put_input_Proxy( + IXSLProcessor * This, + /* [in] */ VARIANT var); + + +void __RPC_STUB IXSLProcessor_put_input_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_input_Proxy( + IXSLProcessor * This, + /* [retval][out] */ VARIANT *pVar); + + +void __RPC_STUB IXSLProcessor_get_input_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_ownerTemplate_Proxy( + IXSLProcessor * This, + /* [retval][out] */ IXSLTemplate **ppTemplate); + + +void __RPC_STUB IXSLProcessor_get_ownerTemplate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_setStartMode_Proxy( + IXSLProcessor * This, + /* [in] */ BSTR mode, + /* [defaultvalue][in] */ BSTR namespaceURI); + + +void __RPC_STUB IXSLProcessor_setStartMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_startMode_Proxy( + IXSLProcessor * This, + /* [retval][out] */ BSTR *mode); + + +void __RPC_STUB IXSLProcessor_get_startMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_startModeURI_Proxy( + IXSLProcessor * This, + /* [retval][out] */ BSTR *namespaceURI); + + +void __RPC_STUB IXSLProcessor_get_startModeURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_put_output_Proxy( + IXSLProcessor * This, + /* [in] */ VARIANT output); + + +void __RPC_STUB IXSLProcessor_put_output_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_output_Proxy( + IXSLProcessor * This, + /* [retval][out] */ VARIANT *pOutput); + + +void __RPC_STUB IXSLProcessor_get_output_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_transform_Proxy( + IXSLProcessor * This, + /* [retval][out] */ VARIANT_BOOL *pDone); + + +void __RPC_STUB IXSLProcessor_transform_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_reset_Proxy( + IXSLProcessor * This); + + +void __RPC_STUB IXSLProcessor_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_readyState_Proxy( + IXSLProcessor * This, + /* [retval][out] */ long *pReadyState); + + +void __RPC_STUB IXSLProcessor_get_readyState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_addParameter_Proxy( + IXSLProcessor * This, + /* [in] */ BSTR baseName, + /* [in] */ VARIANT parameter, + /* [defaultvalue][in] */ BSTR namespaceURI); + + +void __RPC_STUB IXSLProcessor_addParameter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_addObject_Proxy( + IXSLProcessor * This, + /* [in] */ IDispatch *obj, + /* [in] */ BSTR namespaceURI); + + +void __RPC_STUB IXSLProcessor_addObject_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_stylesheet_Proxy( + IXSLProcessor * This, + /* [retval][out] */ IXMLDOMNode **stylesheet); + + +void __RPC_STUB IXSLProcessor_get_stylesheet_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXSLProcessor_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXXMLReader_INTERFACE_DEFINED__ +#define __ISAXXMLReader_INTERFACE_DEFINED__ + +/* interface ISAXXMLReader */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXXMLReader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a4f96ed0-f829-476e-81c0-cdc7bd2a0802") + ISAXXMLReader : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE getFeature( + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT_BOOL *pvfValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE putFeature( + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT_BOOL vfValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE getProperty( + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT *pvarValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE putProperty( + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT varValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE getEntityResolver( + /* [retval][out] */ ISAXEntityResolver **ppResolver) = 0; + + virtual HRESULT STDMETHODCALLTYPE putEntityResolver( + /* [in] */ ISAXEntityResolver *pResolver) = 0; + + virtual HRESULT STDMETHODCALLTYPE getContentHandler( + /* [retval][out] */ ISAXContentHandler **ppHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE putContentHandler( + /* [in] */ ISAXContentHandler *pHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE getDTDHandler( + /* [retval][out] */ ISAXDTDHandler **ppHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE putDTDHandler( + /* [in] */ ISAXDTDHandler *pHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE getErrorHandler( + /* [retval][out] */ ISAXErrorHandler **ppHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE putErrorHandler( + /* [in] */ ISAXErrorHandler *pHandler) = 0; + + virtual HRESULT STDMETHODCALLTYPE getBaseURL( + /* [retval][out] */ const wchar_t **ppwchBaseUrl) = 0; + + virtual HRESULT STDMETHODCALLTYPE putBaseURL( + /* [in] */ const wchar_t *pwchBaseUrl) = 0; + + virtual HRESULT STDMETHODCALLTYPE getSecureBaseURL( + /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl) = 0; + + virtual HRESULT STDMETHODCALLTYPE putSecureBaseURL( + /* [in] */ const wchar_t *pwchSecureBaseUrl) = 0; + + virtual HRESULT STDMETHODCALLTYPE parse( + /* [optional][in] */ VARIANT varInput) = 0; + + virtual HRESULT STDMETHODCALLTYPE parseURL( + /* [in] */ const wchar_t *pwchUrl) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXXMLReaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXXMLReader * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXXMLReader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXXMLReader * This); + + HRESULT ( STDMETHODCALLTYPE *getFeature )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT_BOOL *pvfValue); + + HRESULT ( STDMETHODCALLTYPE *putFeature )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT_BOOL vfValue); + + HRESULT ( STDMETHODCALLTYPE *getProperty )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT *pvarValue); + + HRESULT ( STDMETHODCALLTYPE *putProperty )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT varValue); + + HRESULT ( STDMETHODCALLTYPE *getEntityResolver )( + ISAXXMLReader * This, + /* [retval][out] */ ISAXEntityResolver **ppResolver); + + HRESULT ( STDMETHODCALLTYPE *putEntityResolver )( + ISAXXMLReader * This, + /* [in] */ ISAXEntityResolver *pResolver); + + HRESULT ( STDMETHODCALLTYPE *getContentHandler )( + ISAXXMLReader * This, + /* [retval][out] */ ISAXContentHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putContentHandler )( + ISAXXMLReader * This, + /* [in] */ ISAXContentHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getDTDHandler )( + ISAXXMLReader * This, + /* [retval][out] */ ISAXDTDHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putDTDHandler )( + ISAXXMLReader * This, + /* [in] */ ISAXDTDHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getErrorHandler )( + ISAXXMLReader * This, + /* [retval][out] */ ISAXErrorHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putErrorHandler )( + ISAXXMLReader * This, + /* [in] */ ISAXErrorHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getBaseURL )( + ISAXXMLReader * This, + /* [retval][out] */ const wchar_t **ppwchBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *putBaseURL )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *getSecureBaseURL )( + ISAXXMLReader * This, + /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *putSecureBaseURL )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchSecureBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *parse )( + ISAXXMLReader * This, + /* [optional][in] */ VARIANT varInput); + + HRESULT ( STDMETHODCALLTYPE *parseURL )( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchUrl); + + END_INTERFACE + } ISAXXMLReaderVtbl; + + interface ISAXXMLReader + { + CONST_VTBL struct ISAXXMLReaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXXMLReader_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXXMLReader_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXXMLReader_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXXMLReader_getFeature(This,pwchName,pvfValue) \ + (This)->lpVtbl -> getFeature(This,pwchName,pvfValue) + +#define ISAXXMLReader_putFeature(This,pwchName,vfValue) \ + (This)->lpVtbl -> putFeature(This,pwchName,vfValue) + +#define ISAXXMLReader_getProperty(This,pwchName,pvarValue) \ + (This)->lpVtbl -> getProperty(This,pwchName,pvarValue) + +#define ISAXXMLReader_putProperty(This,pwchName,varValue) \ + (This)->lpVtbl -> putProperty(This,pwchName,varValue) + +#define ISAXXMLReader_getEntityResolver(This,ppResolver) \ + (This)->lpVtbl -> getEntityResolver(This,ppResolver) + +#define ISAXXMLReader_putEntityResolver(This,pResolver) \ + (This)->lpVtbl -> putEntityResolver(This,pResolver) + +#define ISAXXMLReader_getContentHandler(This,ppHandler) \ + (This)->lpVtbl -> getContentHandler(This,ppHandler) + +#define ISAXXMLReader_putContentHandler(This,pHandler) \ + (This)->lpVtbl -> putContentHandler(This,pHandler) + +#define ISAXXMLReader_getDTDHandler(This,ppHandler) \ + (This)->lpVtbl -> getDTDHandler(This,ppHandler) + +#define ISAXXMLReader_putDTDHandler(This,pHandler) \ + (This)->lpVtbl -> putDTDHandler(This,pHandler) + +#define ISAXXMLReader_getErrorHandler(This,ppHandler) \ + (This)->lpVtbl -> getErrorHandler(This,ppHandler) + +#define ISAXXMLReader_putErrorHandler(This,pHandler) \ + (This)->lpVtbl -> putErrorHandler(This,pHandler) + +#define ISAXXMLReader_getBaseURL(This,ppwchBaseUrl) \ + (This)->lpVtbl -> getBaseURL(This,ppwchBaseUrl) + +#define ISAXXMLReader_putBaseURL(This,pwchBaseUrl) \ + (This)->lpVtbl -> putBaseURL(This,pwchBaseUrl) + +#define ISAXXMLReader_getSecureBaseURL(This,ppwchSecureBaseUrl) \ + (This)->lpVtbl -> getSecureBaseURL(This,ppwchSecureBaseUrl) + +#define ISAXXMLReader_putSecureBaseURL(This,pwchSecureBaseUrl) \ + (This)->lpVtbl -> putSecureBaseURL(This,pwchSecureBaseUrl) + +#define ISAXXMLReader_parse(This,varInput) \ + (This)->lpVtbl -> parse(This,varInput) + +#define ISAXXMLReader_parseURL(This,pwchUrl) \ + (This)->lpVtbl -> parseURL(This,pwchUrl) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getFeature_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT_BOOL *pvfValue); + + +void __RPC_STUB ISAXXMLReader_getFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putFeature_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT_BOOL vfValue); + + +void __RPC_STUB ISAXXMLReader_putFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getProperty_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT *pvarValue); + + +void __RPC_STUB ISAXXMLReader_getProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putProperty_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT varValue); + + +void __RPC_STUB ISAXXMLReader_putProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getEntityResolver_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ ISAXEntityResolver **ppResolver); + + +void __RPC_STUB ISAXXMLReader_getEntityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putEntityResolver_Proxy( + ISAXXMLReader * This, + /* [in] */ ISAXEntityResolver *pResolver); + + +void __RPC_STUB ISAXXMLReader_putEntityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getContentHandler_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ ISAXContentHandler **ppHandler); + + +void __RPC_STUB ISAXXMLReader_getContentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putContentHandler_Proxy( + ISAXXMLReader * This, + /* [in] */ ISAXContentHandler *pHandler); + + +void __RPC_STUB ISAXXMLReader_putContentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getDTDHandler_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ ISAXDTDHandler **ppHandler); + + +void __RPC_STUB ISAXXMLReader_getDTDHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putDTDHandler_Proxy( + ISAXXMLReader * This, + /* [in] */ ISAXDTDHandler *pHandler); + + +void __RPC_STUB ISAXXMLReader_putDTDHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getErrorHandler_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ ISAXErrorHandler **ppHandler); + + +void __RPC_STUB ISAXXMLReader_getErrorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putErrorHandler_Proxy( + ISAXXMLReader * This, + /* [in] */ ISAXErrorHandler *pHandler); + + +void __RPC_STUB ISAXXMLReader_putErrorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getBaseURL_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ const wchar_t **ppwchBaseUrl); + + +void __RPC_STUB ISAXXMLReader_getBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putBaseURL_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchBaseUrl); + + +void __RPC_STUB ISAXXMLReader_putBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_getSecureBaseURL_Proxy( + ISAXXMLReader * This, + /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); + + +void __RPC_STUB ISAXXMLReader_getSecureBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_putSecureBaseURL_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchSecureBaseUrl); + + +void __RPC_STUB ISAXXMLReader_putSecureBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_parse_Proxy( + ISAXXMLReader * This, + /* [optional][in] */ VARIANT varInput); + + +void __RPC_STUB ISAXXMLReader_parse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLReader_parseURL_Proxy( + ISAXXMLReader * This, + /* [in] */ const wchar_t *pwchUrl); + + +void __RPC_STUB ISAXXMLReader_parseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXXMLReader_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXXMLFilter_INTERFACE_DEFINED__ +#define __ISAXXMLFilter_INTERFACE_DEFINED__ + +/* interface ISAXXMLFilter */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXXMLFilter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("70409222-ca09-4475-acb8-40312fe8d145") + ISAXXMLFilter : public ISAXXMLReader + { + public: + virtual HRESULT STDMETHODCALLTYPE getParent( + /* [retval][out] */ ISAXXMLReader **ppReader) = 0; + + virtual HRESULT STDMETHODCALLTYPE putParent( + /* [in] */ ISAXXMLReader *pReader) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXXMLFilterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXXMLFilter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXXMLFilter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXXMLFilter * This); + + HRESULT ( STDMETHODCALLTYPE *getFeature )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT_BOOL *pvfValue); + + HRESULT ( STDMETHODCALLTYPE *putFeature )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT_BOOL vfValue); + + HRESULT ( STDMETHODCALLTYPE *getProperty )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchName, + /* [retval][out] */ VARIANT *pvarValue); + + HRESULT ( STDMETHODCALLTYPE *putProperty )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ VARIANT varValue); + + HRESULT ( STDMETHODCALLTYPE *getEntityResolver )( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXEntityResolver **ppResolver); + + HRESULT ( STDMETHODCALLTYPE *putEntityResolver )( + ISAXXMLFilter * This, + /* [in] */ ISAXEntityResolver *pResolver); + + HRESULT ( STDMETHODCALLTYPE *getContentHandler )( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXContentHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putContentHandler )( + ISAXXMLFilter * This, + /* [in] */ ISAXContentHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getDTDHandler )( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXDTDHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putDTDHandler )( + ISAXXMLFilter * This, + /* [in] */ ISAXDTDHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getErrorHandler )( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXErrorHandler **ppHandler); + + HRESULT ( STDMETHODCALLTYPE *putErrorHandler )( + ISAXXMLFilter * This, + /* [in] */ ISAXErrorHandler *pHandler); + + HRESULT ( STDMETHODCALLTYPE *getBaseURL )( + ISAXXMLFilter * This, + /* [retval][out] */ const wchar_t **ppwchBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *putBaseURL )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *getSecureBaseURL )( + ISAXXMLFilter * This, + /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *putSecureBaseURL )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchSecureBaseUrl); + + HRESULT ( STDMETHODCALLTYPE *parse )( + ISAXXMLFilter * This, + /* [optional][in] */ VARIANT varInput); + + HRESULT ( STDMETHODCALLTYPE *parseURL )( + ISAXXMLFilter * This, + /* [in] */ const wchar_t *pwchUrl); + + HRESULT ( STDMETHODCALLTYPE *getParent )( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXXMLReader **ppReader); + + HRESULT ( STDMETHODCALLTYPE *putParent )( + ISAXXMLFilter * This, + /* [in] */ ISAXXMLReader *pReader); + + END_INTERFACE + } ISAXXMLFilterVtbl; + + interface ISAXXMLFilter + { + CONST_VTBL struct ISAXXMLFilterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXXMLFilter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXXMLFilter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXXMLFilter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXXMLFilter_getFeature(This,pwchName,pvfValue) \ + (This)->lpVtbl -> getFeature(This,pwchName,pvfValue) + +#define ISAXXMLFilter_putFeature(This,pwchName,vfValue) \ + (This)->lpVtbl -> putFeature(This,pwchName,vfValue) + +#define ISAXXMLFilter_getProperty(This,pwchName,pvarValue) \ + (This)->lpVtbl -> getProperty(This,pwchName,pvarValue) + +#define ISAXXMLFilter_putProperty(This,pwchName,varValue) \ + (This)->lpVtbl -> putProperty(This,pwchName,varValue) + +#define ISAXXMLFilter_getEntityResolver(This,ppResolver) \ + (This)->lpVtbl -> getEntityResolver(This,ppResolver) + +#define ISAXXMLFilter_putEntityResolver(This,pResolver) \ + (This)->lpVtbl -> putEntityResolver(This,pResolver) + +#define ISAXXMLFilter_getContentHandler(This,ppHandler) \ + (This)->lpVtbl -> getContentHandler(This,ppHandler) + +#define ISAXXMLFilter_putContentHandler(This,pHandler) \ + (This)->lpVtbl -> putContentHandler(This,pHandler) + +#define ISAXXMLFilter_getDTDHandler(This,ppHandler) \ + (This)->lpVtbl -> getDTDHandler(This,ppHandler) + +#define ISAXXMLFilter_putDTDHandler(This,pHandler) \ + (This)->lpVtbl -> putDTDHandler(This,pHandler) + +#define ISAXXMLFilter_getErrorHandler(This,ppHandler) \ + (This)->lpVtbl -> getErrorHandler(This,ppHandler) + +#define ISAXXMLFilter_putErrorHandler(This,pHandler) \ + (This)->lpVtbl -> putErrorHandler(This,pHandler) + +#define ISAXXMLFilter_getBaseURL(This,ppwchBaseUrl) \ + (This)->lpVtbl -> getBaseURL(This,ppwchBaseUrl) + +#define ISAXXMLFilter_putBaseURL(This,pwchBaseUrl) \ + (This)->lpVtbl -> putBaseURL(This,pwchBaseUrl) + +#define ISAXXMLFilter_getSecureBaseURL(This,ppwchSecureBaseUrl) \ + (This)->lpVtbl -> getSecureBaseURL(This,ppwchSecureBaseUrl) + +#define ISAXXMLFilter_putSecureBaseURL(This,pwchSecureBaseUrl) \ + (This)->lpVtbl -> putSecureBaseURL(This,pwchSecureBaseUrl) + +#define ISAXXMLFilter_parse(This,varInput) \ + (This)->lpVtbl -> parse(This,varInput) + +#define ISAXXMLFilter_parseURL(This,pwchUrl) \ + (This)->lpVtbl -> parseURL(This,pwchUrl) + + +#define ISAXXMLFilter_getParent(This,ppReader) \ + (This)->lpVtbl -> getParent(This,ppReader) + +#define ISAXXMLFilter_putParent(This,pReader) \ + (This)->lpVtbl -> putParent(This,pReader) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXXMLFilter_getParent_Proxy( + ISAXXMLFilter * This, + /* [retval][out] */ ISAXXMLReader **ppReader); + + +void __RPC_STUB ISAXXMLFilter_getParent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXXMLFilter_putParent_Proxy( + ISAXXMLFilter * This, + /* [in] */ ISAXXMLReader *pReader); + + +void __RPC_STUB ISAXXMLFilter_putParent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXXMLFilter_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXLocator_INTERFACE_DEFINED__ +#define __ISAXLocator_INTERFACE_DEFINED__ + +/* interface ISAXLocator */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXLocator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9b7e472a-0de4-4640-bff3-84d38a051c31") + ISAXLocator : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE getColumnNumber( + /* [retval][out] */ int *pnColumn) = 0; + + virtual HRESULT STDMETHODCALLTYPE getLineNumber( + /* [retval][out] */ int *pnLine) = 0; + + virtual HRESULT STDMETHODCALLTYPE getPublicId( + /* [retval][out] */ const wchar_t **ppwchPublicId) = 0; + + virtual HRESULT STDMETHODCALLTYPE getSystemId( + /* [retval][out] */ const wchar_t **ppwchSystemId) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXLocatorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXLocator * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXLocator * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXLocator * This); + + HRESULT ( STDMETHODCALLTYPE *getColumnNumber )( + ISAXLocator * This, + /* [retval][out] */ int *pnColumn); + + HRESULT ( STDMETHODCALLTYPE *getLineNumber )( + ISAXLocator * This, + /* [retval][out] */ int *pnLine); + + HRESULT ( STDMETHODCALLTYPE *getPublicId )( + ISAXLocator * This, + /* [retval][out] */ const wchar_t **ppwchPublicId); + + HRESULT ( STDMETHODCALLTYPE *getSystemId )( + ISAXLocator * This, + /* [retval][out] */ const wchar_t **ppwchSystemId); + + END_INTERFACE + } ISAXLocatorVtbl; + + interface ISAXLocator + { + CONST_VTBL struct ISAXLocatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXLocator_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXLocator_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXLocator_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXLocator_getColumnNumber(This,pnColumn) \ + (This)->lpVtbl -> getColumnNumber(This,pnColumn) + +#define ISAXLocator_getLineNumber(This,pnLine) \ + (This)->lpVtbl -> getLineNumber(This,pnLine) + +#define ISAXLocator_getPublicId(This,ppwchPublicId) \ + (This)->lpVtbl -> getPublicId(This,ppwchPublicId) + +#define ISAXLocator_getSystemId(This,ppwchSystemId) \ + (This)->lpVtbl -> getSystemId(This,ppwchSystemId) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXLocator_getColumnNumber_Proxy( + ISAXLocator * This, + /* [retval][out] */ int *pnColumn); + + +void __RPC_STUB ISAXLocator_getColumnNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLocator_getLineNumber_Proxy( + ISAXLocator * This, + /* [retval][out] */ int *pnLine); + + +void __RPC_STUB ISAXLocator_getLineNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLocator_getPublicId_Proxy( + ISAXLocator * This, + /* [retval][out] */ const wchar_t **ppwchPublicId); + + +void __RPC_STUB ISAXLocator_getPublicId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLocator_getSystemId_Proxy( + ISAXLocator * This, + /* [retval][out] */ const wchar_t **ppwchSystemId); + + +void __RPC_STUB ISAXLocator_getSystemId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXLocator_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXEntityResolver_INTERFACE_DEFINED__ +#define __ISAXEntityResolver_INTERFACE_DEFINED__ + +/* interface ISAXEntityResolver */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXEntityResolver; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("99bca7bd-e8c4-4d5f-a0cf-6d907901ff07") + ISAXEntityResolver : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE resolveEntity( + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [retval][out] */ VARIANT *pvarInput) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXEntityResolverVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXEntityResolver * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXEntityResolver * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXEntityResolver * This); + + HRESULT ( STDMETHODCALLTYPE *resolveEntity )( + ISAXEntityResolver * This, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [retval][out] */ VARIANT *pvarInput); + + END_INTERFACE + } ISAXEntityResolverVtbl; + + interface ISAXEntityResolver + { + CONST_VTBL struct ISAXEntityResolverVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXEntityResolver_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXEntityResolver_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXEntityResolver_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXEntityResolver_resolveEntity(This,pwchPublicId,pwchSystemId,pvarInput) \ + (This)->lpVtbl -> resolveEntity(This,pwchPublicId,pwchSystemId,pvarInput) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXEntityResolver_resolveEntity_Proxy( + ISAXEntityResolver * This, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [retval][out] */ VARIANT *pvarInput); + + +void __RPC_STUB ISAXEntityResolver_resolveEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXEntityResolver_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXContentHandler_INTERFACE_DEFINED__ +#define __ISAXContentHandler_INTERFACE_DEFINED__ + +/* interface ISAXContentHandler */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXContentHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1545cdfa-9e4e-4497-a8a4-2bf7d0112c44") + ISAXContentHandler : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE putDocumentLocator( + /* [in] */ ISAXLocator *pLocator) = 0; + + virtual HRESULT STDMETHODCALLTYPE startDocument( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE endDocument( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE startPrefixMapping( + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri) = 0; + + virtual HRESULT STDMETHODCALLTYPE endPrefixMapping( + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix) = 0; + + virtual HRESULT STDMETHODCALLTYPE startElement( + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [in] */ ISAXAttributes *pAttributes) = 0; + + virtual HRESULT STDMETHODCALLTYPE endElement( + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName) = 0; + + virtual HRESULT STDMETHODCALLTYPE characters( + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars) = 0; + + virtual HRESULT STDMETHODCALLTYPE ignorableWhitespace( + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars) = 0; + + virtual HRESULT STDMETHODCALLTYPE processingInstruction( + /* [in] */ const wchar_t *pwchTarget, + /* [in] */ int cchTarget, + /* [in] */ const wchar_t *pwchData, + /* [in] */ int cchData) = 0; + + virtual HRESULT STDMETHODCALLTYPE skippedEntity( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXContentHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXContentHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXContentHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXContentHandler * This); + + HRESULT ( STDMETHODCALLTYPE *putDocumentLocator )( + ISAXContentHandler * This, + /* [in] */ ISAXLocator *pLocator); + + HRESULT ( STDMETHODCALLTYPE *startDocument )( + ISAXContentHandler * This); + + HRESULT ( STDMETHODCALLTYPE *endDocument )( + ISAXContentHandler * This); + + HRESULT ( STDMETHODCALLTYPE *startPrefixMapping )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri); + + HRESULT ( STDMETHODCALLTYPE *endPrefixMapping )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix); + + HRESULT ( STDMETHODCALLTYPE *startElement )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [in] */ ISAXAttributes *pAttributes); + + HRESULT ( STDMETHODCALLTYPE *endElement )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName); + + HRESULT ( STDMETHODCALLTYPE *characters )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + HRESULT ( STDMETHODCALLTYPE *ignorableWhitespace )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + HRESULT ( STDMETHODCALLTYPE *processingInstruction )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchTarget, + /* [in] */ int cchTarget, + /* [in] */ const wchar_t *pwchData, + /* [in] */ int cchData); + + HRESULT ( STDMETHODCALLTYPE *skippedEntity )( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + END_INTERFACE + } ISAXContentHandlerVtbl; + + interface ISAXContentHandler + { + CONST_VTBL struct ISAXContentHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXContentHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXContentHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXContentHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXContentHandler_putDocumentLocator(This,pLocator) \ + (This)->lpVtbl -> putDocumentLocator(This,pLocator) + +#define ISAXContentHandler_startDocument(This) \ + (This)->lpVtbl -> startDocument(This) + +#define ISAXContentHandler_endDocument(This) \ + (This)->lpVtbl -> endDocument(This) + +#define ISAXContentHandler_startPrefixMapping(This,pwchPrefix,cchPrefix,pwchUri,cchUri) \ + (This)->lpVtbl -> startPrefixMapping(This,pwchPrefix,cchPrefix,pwchUri,cchUri) + +#define ISAXContentHandler_endPrefixMapping(This,pwchPrefix,cchPrefix) \ + (This)->lpVtbl -> endPrefixMapping(This,pwchPrefix,cchPrefix) + +#define ISAXContentHandler_startElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName,pAttributes) \ + (This)->lpVtbl -> startElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName,pAttributes) + +#define ISAXContentHandler_endElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName) \ + (This)->lpVtbl -> endElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName) + +#define ISAXContentHandler_characters(This,pwchChars,cchChars) \ + (This)->lpVtbl -> characters(This,pwchChars,cchChars) + +#define ISAXContentHandler_ignorableWhitespace(This,pwchChars,cchChars) \ + (This)->lpVtbl -> ignorableWhitespace(This,pwchChars,cchChars) + +#define ISAXContentHandler_processingInstruction(This,pwchTarget,cchTarget,pwchData,cchData) \ + (This)->lpVtbl -> processingInstruction(This,pwchTarget,cchTarget,pwchData,cchData) + +#define ISAXContentHandler_skippedEntity(This,pwchName,cchName) \ + (This)->lpVtbl -> skippedEntity(This,pwchName,cchName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_putDocumentLocator_Proxy( + ISAXContentHandler * This, + /* [in] */ ISAXLocator *pLocator); + + +void __RPC_STUB ISAXContentHandler_putDocumentLocator_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_startDocument_Proxy( + ISAXContentHandler * This); + + +void __RPC_STUB ISAXContentHandler_startDocument_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_endDocument_Proxy( + ISAXContentHandler * This); + + +void __RPC_STUB ISAXContentHandler_endDocument_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_startPrefixMapping_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri); + + +void __RPC_STUB ISAXContentHandler_startPrefixMapping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_endPrefixMapping_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ int cchPrefix); + + +void __RPC_STUB ISAXContentHandler_endPrefixMapping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_startElement_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [in] */ ISAXAttributes *pAttributes); + + +void __RPC_STUB ISAXContentHandler_startElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_endElement_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchNamespaceUri, + /* [in] */ int cchNamespaceUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName); + + +void __RPC_STUB ISAXContentHandler_endElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_characters_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + +void __RPC_STUB ISAXContentHandler_characters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_ignorableWhitespace_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + +void __RPC_STUB ISAXContentHandler_ignorableWhitespace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_processingInstruction_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchTarget, + /* [in] */ int cchTarget, + /* [in] */ const wchar_t *pwchData, + /* [in] */ int cchData); + + +void __RPC_STUB ISAXContentHandler_processingInstruction_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXContentHandler_skippedEntity_Proxy( + ISAXContentHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + +void __RPC_STUB ISAXContentHandler_skippedEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXContentHandler_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXDTDHandler_INTERFACE_DEFINED__ +#define __ISAXDTDHandler_INTERFACE_DEFINED__ + +/* interface ISAXDTDHandler */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXDTDHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e15c1baf-afb3-4d60-8c36-19a8c45defed") + ISAXDTDHandler : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE notationDecl( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId) = 0; + + virtual HRESULT STDMETHODCALLTYPE unparsedEntityDecl( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId, + /* [in] */ const wchar_t *pwchNotationName, + /* [in] */ int cchNotationName) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXDTDHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXDTDHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXDTDHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXDTDHandler * This); + + HRESULT ( STDMETHODCALLTYPE *notationDecl )( + ISAXDTDHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + HRESULT ( STDMETHODCALLTYPE *unparsedEntityDecl )( + ISAXDTDHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId, + /* [in] */ const wchar_t *pwchNotationName, + /* [in] */ int cchNotationName); + + END_INTERFACE + } ISAXDTDHandlerVtbl; + + interface ISAXDTDHandler + { + CONST_VTBL struct ISAXDTDHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXDTDHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXDTDHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXDTDHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXDTDHandler_notationDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ + (This)->lpVtbl -> notationDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) + +#define ISAXDTDHandler_unparsedEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId,pwchNotationName,cchNotationName) \ + (This)->lpVtbl -> unparsedEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId,pwchNotationName,cchNotationName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXDTDHandler_notationDecl_Proxy( + ISAXDTDHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + +void __RPC_STUB ISAXDTDHandler_notationDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXDTDHandler_unparsedEntityDecl_Proxy( + ISAXDTDHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId, + /* [in] */ const wchar_t *pwchNotationName, + /* [in] */ int cchNotationName); + + +void __RPC_STUB ISAXDTDHandler_unparsedEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXDTDHandler_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXErrorHandler_INTERFACE_DEFINED__ +#define __ISAXErrorHandler_INTERFACE_DEFINED__ + +/* interface ISAXErrorHandler */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXErrorHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a60511c4-ccf5-479e-98a3-dc8dc545b7d0") + ISAXErrorHandler : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE error( + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode) = 0; + + virtual HRESULT STDMETHODCALLTYPE fatalError( + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode) = 0; + + virtual HRESULT STDMETHODCALLTYPE ignorableWarning( + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXErrorHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXErrorHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXErrorHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXErrorHandler * This); + + HRESULT ( STDMETHODCALLTYPE *error )( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + HRESULT ( STDMETHODCALLTYPE *fatalError )( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + HRESULT ( STDMETHODCALLTYPE *ignorableWarning )( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + END_INTERFACE + } ISAXErrorHandlerVtbl; + + interface ISAXErrorHandler + { + CONST_VTBL struct ISAXErrorHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXErrorHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXErrorHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXErrorHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXErrorHandler_error(This,pLocator,pwchErrorMessage,hrErrorCode) \ + (This)->lpVtbl -> error(This,pLocator,pwchErrorMessage,hrErrorCode) + +#define ISAXErrorHandler_fatalError(This,pLocator,pwchErrorMessage,hrErrorCode) \ + (This)->lpVtbl -> fatalError(This,pLocator,pwchErrorMessage,hrErrorCode) + +#define ISAXErrorHandler_ignorableWarning(This,pLocator,pwchErrorMessage,hrErrorCode) \ + (This)->lpVtbl -> ignorableWarning(This,pLocator,pwchErrorMessage,hrErrorCode) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXErrorHandler_error_Proxy( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + +void __RPC_STUB ISAXErrorHandler_error_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXErrorHandler_fatalError_Proxy( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + +void __RPC_STUB ISAXErrorHandler_fatalError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXErrorHandler_ignorableWarning_Proxy( + ISAXErrorHandler * This, + /* [in] */ ISAXLocator *pLocator, + /* [in] */ const wchar_t *pwchErrorMessage, + /* [in] */ HRESULT hrErrorCode); + + +void __RPC_STUB ISAXErrorHandler_ignorableWarning_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXErrorHandler_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXLexicalHandler_INTERFACE_DEFINED__ +#define __ISAXLexicalHandler_INTERFACE_DEFINED__ + +/* interface ISAXLexicalHandler */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXLexicalHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7f85d5f5-47a8-4497-bda5-84ba04819ea6") + ISAXLexicalHandler : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE startDTD( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId) = 0; + + virtual HRESULT STDMETHODCALLTYPE endDTD( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE startEntity( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName) = 0; + + virtual HRESULT STDMETHODCALLTYPE endEntity( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName) = 0; + + virtual HRESULT STDMETHODCALLTYPE startCDATA( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE endCDATA( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE comment( + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXLexicalHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXLexicalHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXLexicalHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXLexicalHandler * This); + + HRESULT ( STDMETHODCALLTYPE *startDTD )( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + HRESULT ( STDMETHODCALLTYPE *endDTD )( + ISAXLexicalHandler * This); + + HRESULT ( STDMETHODCALLTYPE *startEntity )( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + HRESULT ( STDMETHODCALLTYPE *endEntity )( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + HRESULT ( STDMETHODCALLTYPE *startCDATA )( + ISAXLexicalHandler * This); + + HRESULT ( STDMETHODCALLTYPE *endCDATA )( + ISAXLexicalHandler * This); + + HRESULT ( STDMETHODCALLTYPE *comment )( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + END_INTERFACE + } ISAXLexicalHandlerVtbl; + + interface ISAXLexicalHandler + { + CONST_VTBL struct ISAXLexicalHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXLexicalHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXLexicalHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXLexicalHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXLexicalHandler_startDTD(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ + (This)->lpVtbl -> startDTD(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) + +#define ISAXLexicalHandler_endDTD(This) \ + (This)->lpVtbl -> endDTD(This) + +#define ISAXLexicalHandler_startEntity(This,pwchName,cchName) \ + (This)->lpVtbl -> startEntity(This,pwchName,cchName) + +#define ISAXLexicalHandler_endEntity(This,pwchName,cchName) \ + (This)->lpVtbl -> endEntity(This,pwchName,cchName) + +#define ISAXLexicalHandler_startCDATA(This) \ + (This)->lpVtbl -> startCDATA(This) + +#define ISAXLexicalHandler_endCDATA(This) \ + (This)->lpVtbl -> endCDATA(This) + +#define ISAXLexicalHandler_comment(This,pwchChars,cchChars) \ + (This)->lpVtbl -> comment(This,pwchChars,cchChars) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startDTD_Proxy( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + +void __RPC_STUB ISAXLexicalHandler_startDTD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endDTD_Proxy( + ISAXLexicalHandler * This); + + +void __RPC_STUB ISAXLexicalHandler_endDTD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startEntity_Proxy( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + +void __RPC_STUB ISAXLexicalHandler_startEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endEntity_Proxy( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName); + + +void __RPC_STUB ISAXLexicalHandler_endEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startCDATA_Proxy( + ISAXLexicalHandler * This); + + +void __RPC_STUB ISAXLexicalHandler_startCDATA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endCDATA_Proxy( + ISAXLexicalHandler * This); + + +void __RPC_STUB ISAXLexicalHandler_endCDATA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_comment_Proxy( + ISAXLexicalHandler * This, + /* [in] */ const wchar_t *pwchChars, + /* [in] */ int cchChars); + + +void __RPC_STUB ISAXLexicalHandler_comment_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXLexicalHandler_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXDeclHandler_INTERFACE_DEFINED__ +#define __ISAXDeclHandler_INTERFACE_DEFINED__ + +/* interface ISAXDeclHandler */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXDeclHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("862629ac-771a-47b2-8337-4e6843c1be90") + ISAXDeclHandler : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE elementDecl( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchModel, + /* [in] */ int cchModel) = 0; + + virtual HRESULT STDMETHODCALLTYPE attributeDecl( + /* [in] */ const wchar_t *pwchElementName, + /* [in] */ int cchElementName, + /* [in] */ const wchar_t *pwchAttributeName, + /* [in] */ int cchAttributeName, + /* [in] */ const wchar_t *pwchType, + /* [in] */ int cchType, + /* [in] */ const wchar_t *pwchValueDefault, + /* [in] */ int cchValueDefault, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE internalEntityDecl( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE externalEntityDecl( + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXDeclHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXDeclHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXDeclHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXDeclHandler * This); + + HRESULT ( STDMETHODCALLTYPE *elementDecl )( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchModel, + /* [in] */ int cchModel); + + HRESULT ( STDMETHODCALLTYPE *attributeDecl )( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchElementName, + /* [in] */ int cchElementName, + /* [in] */ const wchar_t *pwchAttributeName, + /* [in] */ int cchAttributeName, + /* [in] */ const wchar_t *pwchType, + /* [in] */ int cchType, + /* [in] */ const wchar_t *pwchValueDefault, + /* [in] */ int cchValueDefault, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue); + + HRESULT ( STDMETHODCALLTYPE *internalEntityDecl )( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue); + + HRESULT ( STDMETHODCALLTYPE *externalEntityDecl )( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + END_INTERFACE + } ISAXDeclHandlerVtbl; + + interface ISAXDeclHandler + { + CONST_VTBL struct ISAXDeclHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXDeclHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXDeclHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXDeclHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXDeclHandler_elementDecl(This,pwchName,cchName,pwchModel,cchModel) \ + (This)->lpVtbl -> elementDecl(This,pwchName,cchName,pwchModel,cchModel) + +#define ISAXDeclHandler_attributeDecl(This,pwchElementName,cchElementName,pwchAttributeName,cchAttributeName,pwchType,cchType,pwchValueDefault,cchValueDefault,pwchValue,cchValue) \ + (This)->lpVtbl -> attributeDecl(This,pwchElementName,cchElementName,pwchAttributeName,cchAttributeName,pwchType,cchType,pwchValueDefault,cchValueDefault,pwchValue,cchValue) + +#define ISAXDeclHandler_internalEntityDecl(This,pwchName,cchName,pwchValue,cchValue) \ + (This)->lpVtbl -> internalEntityDecl(This,pwchName,cchName,pwchValue,cchValue) + +#define ISAXDeclHandler_externalEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ + (This)->lpVtbl -> externalEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXDeclHandler_elementDecl_Proxy( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchModel, + /* [in] */ int cchModel); + + +void __RPC_STUB ISAXDeclHandler_elementDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXDeclHandler_attributeDecl_Proxy( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchElementName, + /* [in] */ int cchElementName, + /* [in] */ const wchar_t *pwchAttributeName, + /* [in] */ int cchAttributeName, + /* [in] */ const wchar_t *pwchType, + /* [in] */ int cchType, + /* [in] */ const wchar_t *pwchValueDefault, + /* [in] */ int cchValueDefault, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue); + + +void __RPC_STUB ISAXDeclHandler_attributeDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXDeclHandler_internalEntityDecl_Proxy( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchValue, + /* [in] */ int cchValue); + + +void __RPC_STUB ISAXDeclHandler_internalEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXDeclHandler_externalEntityDecl_Proxy( + ISAXDeclHandler * This, + /* [in] */ const wchar_t *pwchName, + /* [in] */ int cchName, + /* [in] */ const wchar_t *pwchPublicId, + /* [in] */ int cchPublicId, + /* [in] */ const wchar_t *pwchSystemId, + /* [in] */ int cchSystemId); + + +void __RPC_STUB ISAXDeclHandler_externalEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXDeclHandler_INTERFACE_DEFINED__ */ + + +#ifndef __ISAXAttributes_INTERFACE_DEFINED__ +#define __ISAXAttributes_INTERFACE_DEFINED__ + +/* interface ISAXAttributes */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_ISAXAttributes; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f078abe1-45d2-4832-91ea-4466ce2f25c9") + ISAXAttributes : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE getLength( + /* [retval][out] */ int *pnLength) = 0; + + virtual HRESULT STDMETHODCALLTYPE getURI( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri) = 0; + + virtual HRESULT STDMETHODCALLTYPE getLocalName( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName) = 0; + + virtual HRESULT STDMETHODCALLTYPE getQName( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName) = 0; + + virtual HRESULT STDMETHODCALLTYPE getName( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName) = 0; + + virtual HRESULT STDMETHODCALLTYPE getIndexFromName( + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [retval][out] */ int *pnIndex) = 0; + + virtual HRESULT STDMETHODCALLTYPE getIndexFromQName( + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [retval][out] */ int *pnIndex) = 0; + + virtual HRESULT STDMETHODCALLTYPE getType( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType) = 0; + + virtual HRESULT STDMETHODCALLTYPE getTypeFromName( + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType) = 0; + + virtual HRESULT STDMETHODCALLTYPE getTypeFromQName( + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType) = 0; + + virtual HRESULT STDMETHODCALLTYPE getValue( + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE getValueFromName( + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE getValueFromQName( + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISAXAttributesVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISAXAttributes * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISAXAttributes * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISAXAttributes * This); + + HRESULT ( STDMETHODCALLTYPE *getLength )( + ISAXAttributes * This, + /* [retval][out] */ int *pnLength); + + HRESULT ( STDMETHODCALLTYPE *getURI )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri); + + HRESULT ( STDMETHODCALLTYPE *getLocalName )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName); + + HRESULT ( STDMETHODCALLTYPE *getQName )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName); + + HRESULT ( STDMETHODCALLTYPE *getName )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName); + + HRESULT ( STDMETHODCALLTYPE *getIndexFromName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [retval][out] */ int *pnIndex); + + HRESULT ( STDMETHODCALLTYPE *getIndexFromQName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [retval][out] */ int *pnIndex); + + HRESULT ( STDMETHODCALLTYPE *getType )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + HRESULT ( STDMETHODCALLTYPE *getTypeFromName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + HRESULT ( STDMETHODCALLTYPE *getTypeFromQName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + HRESULT ( STDMETHODCALLTYPE *getValue )( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + HRESULT ( STDMETHODCALLTYPE *getValueFromName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + HRESULT ( STDMETHODCALLTYPE *getValueFromQName )( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + END_INTERFACE + } ISAXAttributesVtbl; + + interface ISAXAttributes + { + CONST_VTBL struct ISAXAttributesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISAXAttributes_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISAXAttributes_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISAXAttributes_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISAXAttributes_getLength(This,pnLength) \ + (This)->lpVtbl -> getLength(This,pnLength) + +#define ISAXAttributes_getURI(This,nIndex,ppwchUri,pcchUri) \ + (This)->lpVtbl -> getURI(This,nIndex,ppwchUri,pcchUri) + +#define ISAXAttributes_getLocalName(This,nIndex,ppwchLocalName,pcchLocalName) \ + (This)->lpVtbl -> getLocalName(This,nIndex,ppwchLocalName,pcchLocalName) + +#define ISAXAttributes_getQName(This,nIndex,ppwchQName,pcchQName) \ + (This)->lpVtbl -> getQName(This,nIndex,ppwchQName,pcchQName) + +#define ISAXAttributes_getName(This,nIndex,ppwchUri,pcchUri,ppwchLocalName,pcchLocalName,ppwchQName,pcchQName) \ + (This)->lpVtbl -> getName(This,nIndex,ppwchUri,pcchUri,ppwchLocalName,pcchLocalName,ppwchQName,pcchQName) + +#define ISAXAttributes_getIndexFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,pnIndex) \ + (This)->lpVtbl -> getIndexFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,pnIndex) + +#define ISAXAttributes_getIndexFromQName(This,pwchQName,cchQName,pnIndex) \ + (This)->lpVtbl -> getIndexFromQName(This,pwchQName,cchQName,pnIndex) + +#define ISAXAttributes_getType(This,nIndex,ppwchType,pcchType) \ + (This)->lpVtbl -> getType(This,nIndex,ppwchType,pcchType) + +#define ISAXAttributes_getTypeFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchType,pcchType) \ + (This)->lpVtbl -> getTypeFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchType,pcchType) + +#define ISAXAttributes_getTypeFromQName(This,pwchQName,cchQName,ppwchType,pcchType) \ + (This)->lpVtbl -> getTypeFromQName(This,pwchQName,cchQName,ppwchType,pcchType) + +#define ISAXAttributes_getValue(This,nIndex,ppwchValue,pcchValue) \ + (This)->lpVtbl -> getValue(This,nIndex,ppwchValue,pcchValue) + +#define ISAXAttributes_getValueFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchValue,pcchValue) \ + (This)->lpVtbl -> getValueFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchValue,pcchValue) + +#define ISAXAttributes_getValueFromQName(This,pwchQName,cchQName,ppwchValue,pcchValue) \ + (This)->lpVtbl -> getValueFromQName(This,pwchQName,cchQName,ppwchValue,pcchValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getLength_Proxy( + ISAXAttributes * This, + /* [retval][out] */ int *pnLength); + + +void __RPC_STUB ISAXAttributes_getLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getURI_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri); + + +void __RPC_STUB ISAXAttributes_getURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getLocalName_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName); + + +void __RPC_STUB ISAXAttributes_getLocalName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getQName_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName); + + +void __RPC_STUB ISAXAttributes_getQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getName_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchUri, + /* [out] */ int *pcchUri, + /* [out] */ const wchar_t **ppwchLocalName, + /* [out] */ int *pcchLocalName, + /* [out] */ const wchar_t **ppwchQName, + /* [out] */ int *pcchQName); + + +void __RPC_STUB ISAXAttributes_getName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getIndexFromName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [retval][out] */ int *pnIndex); + + +void __RPC_STUB ISAXAttributes_getIndexFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getIndexFromQName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [retval][out] */ int *pnIndex); + + +void __RPC_STUB ISAXAttributes_getIndexFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getType_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + +void __RPC_STUB ISAXAttributes_getType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getTypeFromName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + +void __RPC_STUB ISAXAttributes_getTypeFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getTypeFromQName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchType, + /* [out] */ int *pcchType); + + +void __RPC_STUB ISAXAttributes_getTypeFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getValue_Proxy( + ISAXAttributes * This, + /* [in] */ int nIndex, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + +void __RPC_STUB ISAXAttributes_getValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getValueFromName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchUri, + /* [in] */ int cchUri, + /* [in] */ const wchar_t *pwchLocalName, + /* [in] */ int cchLocalName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + +void __RPC_STUB ISAXAttributes_getValueFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE ISAXAttributes_getValueFromQName_Proxy( + ISAXAttributes * This, + /* [in] */ const wchar_t *pwchQName, + /* [in] */ int cchQName, + /* [out] */ const wchar_t **ppwchValue, + /* [out] */ int *pcchValue); + + +void __RPC_STUB ISAXAttributes_getValueFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISAXAttributes_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXXMLReader_INTERFACE_DEFINED__ +#define __IVBSAXXMLReader_INTERFACE_DEFINED__ + +/* interface IVBSAXXMLReader */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXXMLReader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8c033caa-6cd6-4f73-b728-4531af74945f") + IVBSAXXMLReader : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getFeature( + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE putFeature( + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE putProperty( + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_entityResolver( + /* [retval][out] */ IVBSAXEntityResolver **oResolver) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_entityResolver( + /* [in] */ IVBSAXEntityResolver *oResolver) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_contentHandler( + /* [retval][out] */ IVBSAXContentHandler **oHandler) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_contentHandler( + /* [in] */ IVBSAXContentHandler *oHandler) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dtdHandler( + /* [retval][out] */ IVBSAXDTDHandler **oHandler) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_dtdHandler( + /* [in] */ IVBSAXDTDHandler *oHandler) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_errorHandler( + /* [retval][out] */ IVBSAXErrorHandler **oHandler) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_errorHandler( + /* [in] */ IVBSAXErrorHandler *oHandler) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_baseURL( + /* [retval][out] */ BSTR *strBaseURL) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_baseURL( + /* [in] */ BSTR strBaseURL) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_secureBaseURL( + /* [retval][out] */ BSTR *strSecureBaseURL) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_secureBaseURL( + /* [in] */ BSTR strSecureBaseURL) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE parse( + /* [optional][in] */ VARIANT varInput) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE parseURL( + /* [in] */ BSTR strURL) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXXMLReaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXXMLReader * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXXMLReader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXXMLReader * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXXMLReader * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXXMLReader * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXXMLReader * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXXMLReader * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getFeature )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *putFeature )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *putProperty )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_entityResolver )( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXEntityResolver **oResolver); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_entityResolver )( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXEntityResolver *oResolver); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_contentHandler )( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXContentHandler **oHandler); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_contentHandler )( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXContentHandler *oHandler); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dtdHandler )( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXDTDHandler **oHandler); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_dtdHandler )( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXDTDHandler *oHandler); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorHandler )( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXErrorHandler **oHandler); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_errorHandler )( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXErrorHandler *oHandler); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseURL )( + IVBSAXXMLReader * This, + /* [retval][out] */ BSTR *strBaseURL); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_baseURL )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strBaseURL); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_secureBaseURL )( + IVBSAXXMLReader * This, + /* [retval][out] */ BSTR *strSecureBaseURL); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_secureBaseURL )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strSecureBaseURL); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *parse )( + IVBSAXXMLReader * This, + /* [optional][in] */ VARIANT varInput); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *parseURL )( + IVBSAXXMLReader * This, + /* [in] */ BSTR strURL); + + END_INTERFACE + } IVBSAXXMLReaderVtbl; + + interface IVBSAXXMLReader + { + CONST_VTBL struct IVBSAXXMLReaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXXMLReader_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXXMLReader_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXXMLReader_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXXMLReader_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXXMLReader_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXXMLReader_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXXMLReader_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXXMLReader_getFeature(This,strName,fValue) \ + (This)->lpVtbl -> getFeature(This,strName,fValue) + +#define IVBSAXXMLReader_putFeature(This,strName,fValue) \ + (This)->lpVtbl -> putFeature(This,strName,fValue) + +#define IVBSAXXMLReader_getProperty(This,strName,varValue) \ + (This)->lpVtbl -> getProperty(This,strName,varValue) + +#define IVBSAXXMLReader_putProperty(This,strName,varValue) \ + (This)->lpVtbl -> putProperty(This,strName,varValue) + +#define IVBSAXXMLReader_get_entityResolver(This,oResolver) \ + (This)->lpVtbl -> get_entityResolver(This,oResolver) + +#define IVBSAXXMLReader_putref_entityResolver(This,oResolver) \ + (This)->lpVtbl -> putref_entityResolver(This,oResolver) + +#define IVBSAXXMLReader_get_contentHandler(This,oHandler) \ + (This)->lpVtbl -> get_contentHandler(This,oHandler) + +#define IVBSAXXMLReader_putref_contentHandler(This,oHandler) \ + (This)->lpVtbl -> putref_contentHandler(This,oHandler) + +#define IVBSAXXMLReader_get_dtdHandler(This,oHandler) \ + (This)->lpVtbl -> get_dtdHandler(This,oHandler) + +#define IVBSAXXMLReader_putref_dtdHandler(This,oHandler) \ + (This)->lpVtbl -> putref_dtdHandler(This,oHandler) + +#define IVBSAXXMLReader_get_errorHandler(This,oHandler) \ + (This)->lpVtbl -> get_errorHandler(This,oHandler) + +#define IVBSAXXMLReader_putref_errorHandler(This,oHandler) \ + (This)->lpVtbl -> putref_errorHandler(This,oHandler) + +#define IVBSAXXMLReader_get_baseURL(This,strBaseURL) \ + (This)->lpVtbl -> get_baseURL(This,strBaseURL) + +#define IVBSAXXMLReader_put_baseURL(This,strBaseURL) \ + (This)->lpVtbl -> put_baseURL(This,strBaseURL) + +#define IVBSAXXMLReader_get_secureBaseURL(This,strSecureBaseURL) \ + (This)->lpVtbl -> get_secureBaseURL(This,strSecureBaseURL) + +#define IVBSAXXMLReader_put_secureBaseURL(This,strSecureBaseURL) \ + (This)->lpVtbl -> put_secureBaseURL(This,strSecureBaseURL) + +#define IVBSAXXMLReader_parse(This,varInput) \ + (This)->lpVtbl -> parse(This,varInput) + +#define IVBSAXXMLReader_parseURL(This,strURL) \ + (This)->lpVtbl -> parseURL(This,strURL) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_getFeature_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue); + + +void __RPC_STUB IVBSAXXMLReader_getFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putFeature_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue); + + +void __RPC_STUB IVBSAXXMLReader_putFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_getProperty_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue); + + +void __RPC_STUB IVBSAXXMLReader_getProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putProperty_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue); + + +void __RPC_STUB IVBSAXXMLReader_putProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_entityResolver_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXEntityResolver **oResolver); + + +void __RPC_STUB IVBSAXXMLReader_get_entityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_entityResolver_Proxy( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXEntityResolver *oResolver); + + +void __RPC_STUB IVBSAXXMLReader_putref_entityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_contentHandler_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXContentHandler **oHandler); + + +void __RPC_STUB IVBSAXXMLReader_get_contentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_contentHandler_Proxy( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXContentHandler *oHandler); + + +void __RPC_STUB IVBSAXXMLReader_putref_contentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_dtdHandler_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXDTDHandler **oHandler); + + +void __RPC_STUB IVBSAXXMLReader_get_dtdHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_dtdHandler_Proxy( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXDTDHandler *oHandler); + + +void __RPC_STUB IVBSAXXMLReader_putref_dtdHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_errorHandler_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ IVBSAXErrorHandler **oHandler); + + +void __RPC_STUB IVBSAXXMLReader_get_errorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_errorHandler_Proxy( + IVBSAXXMLReader * This, + /* [in] */ IVBSAXErrorHandler *oHandler); + + +void __RPC_STUB IVBSAXXMLReader_putref_errorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_baseURL_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ BSTR *strBaseURL); + + +void __RPC_STUB IVBSAXXMLReader_get_baseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_put_baseURL_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strBaseURL); + + +void __RPC_STUB IVBSAXXMLReader_put_baseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_secureBaseURL_Proxy( + IVBSAXXMLReader * This, + /* [retval][out] */ BSTR *strSecureBaseURL); + + +void __RPC_STUB IVBSAXXMLReader_get_secureBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_put_secureBaseURL_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strSecureBaseURL); + + +void __RPC_STUB IVBSAXXMLReader_put_secureBaseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_parse_Proxy( + IVBSAXXMLReader * This, + /* [optional][in] */ VARIANT varInput); + + +void __RPC_STUB IVBSAXXMLReader_parse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_parseURL_Proxy( + IVBSAXXMLReader * This, + /* [in] */ BSTR strURL); + + +void __RPC_STUB IVBSAXXMLReader_parseURL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXXMLReader_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXXMLFilter_INTERFACE_DEFINED__ +#define __IVBSAXXMLFilter_INTERFACE_DEFINED__ + +/* interface IVBSAXXMLFilter */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXXMLFilter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1299eb1b-5b88-433e-82de-82ca75ad4e04") + IVBSAXXMLFilter : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parent( + /* [retval][out] */ IVBSAXXMLReader **oReader) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_parent( + /* [in] */ IVBSAXXMLReader *oReader) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXXMLFilterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXXMLFilter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXXMLFilter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXXMLFilter * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXXMLFilter * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXXMLFilter * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXXMLFilter * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXXMLFilter * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parent )( + IVBSAXXMLFilter * This, + /* [retval][out] */ IVBSAXXMLReader **oReader); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_parent )( + IVBSAXXMLFilter * This, + /* [in] */ IVBSAXXMLReader *oReader); + + END_INTERFACE + } IVBSAXXMLFilterVtbl; + + interface IVBSAXXMLFilter + { + CONST_VTBL struct IVBSAXXMLFilterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXXMLFilter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXXMLFilter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXXMLFilter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXXMLFilter_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXXMLFilter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXXMLFilter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXXMLFilter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXXMLFilter_get_parent(This,oReader) \ + (This)->lpVtbl -> get_parent(This,oReader) + +#define IVBSAXXMLFilter_putref_parent(This,oReader) \ + (This)->lpVtbl -> putref_parent(This,oReader) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLFilter_get_parent_Proxy( + IVBSAXXMLFilter * This, + /* [retval][out] */ IVBSAXXMLReader **oReader); + + +void __RPC_STUB IVBSAXXMLFilter_get_parent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLFilter_putref_parent_Proxy( + IVBSAXXMLFilter * This, + /* [in] */ IVBSAXXMLReader *oReader); + + +void __RPC_STUB IVBSAXXMLFilter_putref_parent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXXMLFilter_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXLocator_INTERFACE_DEFINED__ +#define __IVBSAXLocator_INTERFACE_DEFINED__ + +/* interface IVBSAXLocator */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXLocator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("796e7ac5-5aa2-4eff-acad-3faaf01a3288") + IVBSAXLocator : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_columnNumber( + /* [retval][out] */ int *nColumn) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_lineNumber( + /* [retval][out] */ int *nLine) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( + /* [retval][out] */ BSTR *strPublicId) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( + /* [retval][out] */ BSTR *strSystemId) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXLocatorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXLocator * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXLocator * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXLocator * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXLocator * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXLocator * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXLocator * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXLocator * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_columnNumber )( + IVBSAXLocator * This, + /* [retval][out] */ int *nColumn); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lineNumber )( + IVBSAXLocator * This, + /* [retval][out] */ int *nLine); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( + IVBSAXLocator * This, + /* [retval][out] */ BSTR *strPublicId); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( + IVBSAXLocator * This, + /* [retval][out] */ BSTR *strSystemId); + + END_INTERFACE + } IVBSAXLocatorVtbl; + + interface IVBSAXLocator + { + CONST_VTBL struct IVBSAXLocatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXLocator_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXLocator_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXLocator_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXLocator_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXLocator_get_columnNumber(This,nColumn) \ + (This)->lpVtbl -> get_columnNumber(This,nColumn) + +#define IVBSAXLocator_get_lineNumber(This,nLine) \ + (This)->lpVtbl -> get_lineNumber(This,nLine) + +#define IVBSAXLocator_get_publicId(This,strPublicId) \ + (This)->lpVtbl -> get_publicId(This,strPublicId) + +#define IVBSAXLocator_get_systemId(This,strSystemId) \ + (This)->lpVtbl -> get_systemId(This,strSystemId) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_columnNumber_Proxy( + IVBSAXLocator * This, + /* [retval][out] */ int *nColumn); + + +void __RPC_STUB IVBSAXLocator_get_columnNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_lineNumber_Proxy( + IVBSAXLocator * This, + /* [retval][out] */ int *nLine); + + +void __RPC_STUB IVBSAXLocator_get_lineNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_publicId_Proxy( + IVBSAXLocator * This, + /* [retval][out] */ BSTR *strPublicId); + + +void __RPC_STUB IVBSAXLocator_get_publicId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_systemId_Proxy( + IVBSAXLocator * This, + /* [retval][out] */ BSTR *strSystemId); + + +void __RPC_STUB IVBSAXLocator_get_systemId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXLocator_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXEntityResolver_INTERFACE_DEFINED__ +#define __IVBSAXEntityResolver_INTERFACE_DEFINED__ + +/* interface IVBSAXEntityResolver */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXEntityResolver; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0c05d096-f45b-4aca-ad1a-aa0bc25518dc") + IVBSAXEntityResolver : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE resolveEntity( + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [retval][out] */ VARIANT *varInput) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXEntityResolverVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXEntityResolver * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXEntityResolver * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXEntityResolver * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXEntityResolver * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXEntityResolver * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXEntityResolver * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXEntityResolver * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *resolveEntity )( + IVBSAXEntityResolver * This, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [retval][out] */ VARIANT *varInput); + + END_INTERFACE + } IVBSAXEntityResolverVtbl; + + interface IVBSAXEntityResolver + { + CONST_VTBL struct IVBSAXEntityResolverVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXEntityResolver_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXEntityResolver_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXEntityResolver_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXEntityResolver_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXEntityResolver_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXEntityResolver_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXEntityResolver_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXEntityResolver_resolveEntity(This,strPublicId,strSystemId,varInput) \ + (This)->lpVtbl -> resolveEntity(This,strPublicId,strSystemId,varInput) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXEntityResolver_resolveEntity_Proxy( + IVBSAXEntityResolver * This, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [retval][out] */ VARIANT *varInput); + + +void __RPC_STUB IVBSAXEntityResolver_resolveEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXEntityResolver_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXContentHandler_INTERFACE_DEFINED__ +#define __IVBSAXContentHandler_INTERFACE_DEFINED__ + +/* interface IVBSAXContentHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXContentHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2ed7290a-4dd5-4b46-bb26-4e4155e77faa") + IVBSAXContentHandler : public IDispatch + { + public: + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_documentLocator( + /* [in] */ IVBSAXLocator *oLocator) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startDocument( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endDocument( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startPrefixMapping( + /* [out][in] */ BSTR *strPrefix, + /* [out][in] */ BSTR *strURI) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endPrefixMapping( + /* [out][in] */ BSTR *strPrefix) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startElement( + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName, + /* [in] */ IVBSAXAttributes *oAttributes) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endElement( + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE characters( + /* [out][in] */ BSTR *strChars) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ignorableWhitespace( + /* [out][in] */ BSTR *strChars) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE processingInstruction( + /* [out][in] */ BSTR *strTarget, + /* [out][in] */ BSTR *strData) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE skippedEntity( + /* [out][in] */ BSTR *strName) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXContentHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXContentHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXContentHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXContentHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXContentHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXContentHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXContentHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXContentHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentLocator )( + IVBSAXContentHandler * This, + /* [in] */ IVBSAXLocator *oLocator); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startDocument )( + IVBSAXContentHandler * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endDocument )( + IVBSAXContentHandler * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startPrefixMapping )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strPrefix, + /* [out][in] */ BSTR *strURI); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endPrefixMapping )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strPrefix); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startElement )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName, + /* [in] */ IVBSAXAttributes *oAttributes); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endElement )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *characters )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strChars); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ignorableWhitespace )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strChars); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *processingInstruction )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strTarget, + /* [out][in] */ BSTR *strData); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *skippedEntity )( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strName); + + END_INTERFACE + } IVBSAXContentHandlerVtbl; + + interface IVBSAXContentHandler + { + CONST_VTBL struct IVBSAXContentHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXContentHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXContentHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXContentHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXContentHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXContentHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXContentHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXContentHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXContentHandler_putref_documentLocator(This,oLocator) \ + (This)->lpVtbl -> putref_documentLocator(This,oLocator) + +#define IVBSAXContentHandler_startDocument(This) \ + (This)->lpVtbl -> startDocument(This) + +#define IVBSAXContentHandler_endDocument(This) \ + (This)->lpVtbl -> endDocument(This) + +#define IVBSAXContentHandler_startPrefixMapping(This,strPrefix,strURI) \ + (This)->lpVtbl -> startPrefixMapping(This,strPrefix,strURI) + +#define IVBSAXContentHandler_endPrefixMapping(This,strPrefix) \ + (This)->lpVtbl -> endPrefixMapping(This,strPrefix) + +#define IVBSAXContentHandler_startElement(This,strNamespaceURI,strLocalName,strQName,oAttributes) \ + (This)->lpVtbl -> startElement(This,strNamespaceURI,strLocalName,strQName,oAttributes) + +#define IVBSAXContentHandler_endElement(This,strNamespaceURI,strLocalName,strQName) \ + (This)->lpVtbl -> endElement(This,strNamespaceURI,strLocalName,strQName) + +#define IVBSAXContentHandler_characters(This,strChars) \ + (This)->lpVtbl -> characters(This,strChars) + +#define IVBSAXContentHandler_ignorableWhitespace(This,strChars) \ + (This)->lpVtbl -> ignorableWhitespace(This,strChars) + +#define IVBSAXContentHandler_processingInstruction(This,strTarget,strData) \ + (This)->lpVtbl -> processingInstruction(This,strTarget,strData) + +#define IVBSAXContentHandler_skippedEntity(This,strName) \ + (This)->lpVtbl -> skippedEntity(This,strName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_putref_documentLocator_Proxy( + IVBSAXContentHandler * This, + /* [in] */ IVBSAXLocator *oLocator); + + +void __RPC_STUB IVBSAXContentHandler_putref_documentLocator_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startDocument_Proxy( + IVBSAXContentHandler * This); + + +void __RPC_STUB IVBSAXContentHandler_startDocument_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endDocument_Proxy( + IVBSAXContentHandler * This); + + +void __RPC_STUB IVBSAXContentHandler_endDocument_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startPrefixMapping_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strPrefix, + /* [out][in] */ BSTR *strURI); + + +void __RPC_STUB IVBSAXContentHandler_startPrefixMapping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endPrefixMapping_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strPrefix); + + +void __RPC_STUB IVBSAXContentHandler_endPrefixMapping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startElement_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName, + /* [in] */ IVBSAXAttributes *oAttributes); + + +void __RPC_STUB IVBSAXContentHandler_startElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endElement_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strNamespaceURI, + /* [out][in] */ BSTR *strLocalName, + /* [out][in] */ BSTR *strQName); + + +void __RPC_STUB IVBSAXContentHandler_endElement_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_characters_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strChars); + + +void __RPC_STUB IVBSAXContentHandler_characters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_ignorableWhitespace_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strChars); + + +void __RPC_STUB IVBSAXContentHandler_ignorableWhitespace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_processingInstruction_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strTarget, + /* [out][in] */ BSTR *strData); + + +void __RPC_STUB IVBSAXContentHandler_processingInstruction_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_skippedEntity_Proxy( + IVBSAXContentHandler * This, + /* [out][in] */ BSTR *strName); + + +void __RPC_STUB IVBSAXContentHandler_skippedEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXContentHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXDTDHandler_INTERFACE_DEFINED__ +#define __IVBSAXDTDHandler_INTERFACE_DEFINED__ + +/* interface IVBSAXDTDHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXDTDHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("24fb3297-302d-4620-ba39-3a732d850558") + IVBSAXDTDHandler : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE notationDecl( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE unparsedEntityDecl( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [out][in] */ BSTR *strNotationName) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXDTDHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXDTDHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXDTDHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXDTDHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXDTDHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXDTDHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXDTDHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXDTDHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *notationDecl )( + IVBSAXDTDHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *unparsedEntityDecl )( + IVBSAXDTDHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [out][in] */ BSTR *strNotationName); + + END_INTERFACE + } IVBSAXDTDHandlerVtbl; + + interface IVBSAXDTDHandler + { + CONST_VTBL struct IVBSAXDTDHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXDTDHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXDTDHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXDTDHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXDTDHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXDTDHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXDTDHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXDTDHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXDTDHandler_notationDecl(This,strName,strPublicId,strSystemId) \ + (This)->lpVtbl -> notationDecl(This,strName,strPublicId,strSystemId) + +#define IVBSAXDTDHandler_unparsedEntityDecl(This,strName,strPublicId,strSystemId,strNotationName) \ + (This)->lpVtbl -> unparsedEntityDecl(This,strName,strPublicId,strSystemId,strNotationName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDTDHandler_notationDecl_Proxy( + IVBSAXDTDHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + +void __RPC_STUB IVBSAXDTDHandler_notationDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDTDHandler_unparsedEntityDecl_Proxy( + IVBSAXDTDHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId, + /* [out][in] */ BSTR *strNotationName); + + +void __RPC_STUB IVBSAXDTDHandler_unparsedEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXDTDHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXErrorHandler_INTERFACE_DEFINED__ +#define __IVBSAXErrorHandler_INTERFACE_DEFINED__ + +/* interface IVBSAXErrorHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXErrorHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("d963d3fe-173c-4862-9095-b92f66995f52") + IVBSAXErrorHandler : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE error( + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE fatalError( + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ignorableWarning( + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXErrorHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXErrorHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXErrorHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXErrorHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXErrorHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXErrorHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXErrorHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXErrorHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *error )( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *fatalError )( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ignorableWarning )( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + END_INTERFACE + } IVBSAXErrorHandlerVtbl; + + interface IVBSAXErrorHandler + { + CONST_VTBL struct IVBSAXErrorHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXErrorHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXErrorHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXErrorHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXErrorHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXErrorHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXErrorHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXErrorHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXErrorHandler_error(This,oLocator,strErrorMessage,nErrorCode) \ + (This)->lpVtbl -> error(This,oLocator,strErrorMessage,nErrorCode) + +#define IVBSAXErrorHandler_fatalError(This,oLocator,strErrorMessage,nErrorCode) \ + (This)->lpVtbl -> fatalError(This,oLocator,strErrorMessage,nErrorCode) + +#define IVBSAXErrorHandler_ignorableWarning(This,oLocator,strErrorMessage,nErrorCode) \ + (This)->lpVtbl -> ignorableWarning(This,oLocator,strErrorMessage,nErrorCode) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_error_Proxy( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + +void __RPC_STUB IVBSAXErrorHandler_error_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_fatalError_Proxy( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + +void __RPC_STUB IVBSAXErrorHandler_fatalError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_ignorableWarning_Proxy( + IVBSAXErrorHandler * This, + /* [in] */ IVBSAXLocator *oLocator, + /* [out][in] */ BSTR *strErrorMessage, + /* [in] */ long nErrorCode); + + +void __RPC_STUB IVBSAXErrorHandler_ignorableWarning_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXErrorHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXLexicalHandler_INTERFACE_DEFINED__ +#define __IVBSAXLexicalHandler_INTERFACE_DEFINED__ + +/* interface IVBSAXLexicalHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXLexicalHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("032aac35-8c0e-4d9d-979f-e3b702935576") + IVBSAXLexicalHandler : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startDTD( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endDTD( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startEntity( + /* [out][in] */ BSTR *strName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endEntity( + /* [out][in] */ BSTR *strName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startCDATA( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endCDATA( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE comment( + /* [out][in] */ BSTR *strChars) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXLexicalHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXLexicalHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXLexicalHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXLexicalHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXLexicalHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXLexicalHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXLexicalHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXLexicalHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startDTD )( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endDTD )( + IVBSAXLexicalHandler * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startEntity )( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endEntity )( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startCDATA )( + IVBSAXLexicalHandler * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endCDATA )( + IVBSAXLexicalHandler * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *comment )( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strChars); + + END_INTERFACE + } IVBSAXLexicalHandlerVtbl; + + interface IVBSAXLexicalHandler + { + CONST_VTBL struct IVBSAXLexicalHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXLexicalHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXLexicalHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXLexicalHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXLexicalHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXLexicalHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXLexicalHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXLexicalHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXLexicalHandler_startDTD(This,strName,strPublicId,strSystemId) \ + (This)->lpVtbl -> startDTD(This,strName,strPublicId,strSystemId) + +#define IVBSAXLexicalHandler_endDTD(This) \ + (This)->lpVtbl -> endDTD(This) + +#define IVBSAXLexicalHandler_startEntity(This,strName) \ + (This)->lpVtbl -> startEntity(This,strName) + +#define IVBSAXLexicalHandler_endEntity(This,strName) \ + (This)->lpVtbl -> endEntity(This,strName) + +#define IVBSAXLexicalHandler_startCDATA(This) \ + (This)->lpVtbl -> startCDATA(This) + +#define IVBSAXLexicalHandler_endCDATA(This) \ + (This)->lpVtbl -> endCDATA(This) + +#define IVBSAXLexicalHandler_comment(This,strChars) \ + (This)->lpVtbl -> comment(This,strChars) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startDTD_Proxy( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + +void __RPC_STUB IVBSAXLexicalHandler_startDTD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endDTD_Proxy( + IVBSAXLexicalHandler * This); + + +void __RPC_STUB IVBSAXLexicalHandler_endDTD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startEntity_Proxy( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName); + + +void __RPC_STUB IVBSAXLexicalHandler_startEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endEntity_Proxy( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strName); + + +void __RPC_STUB IVBSAXLexicalHandler_endEntity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startCDATA_Proxy( + IVBSAXLexicalHandler * This); + + +void __RPC_STUB IVBSAXLexicalHandler_startCDATA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endCDATA_Proxy( + IVBSAXLexicalHandler * This); + + +void __RPC_STUB IVBSAXLexicalHandler_endCDATA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_comment_Proxy( + IVBSAXLexicalHandler * This, + /* [out][in] */ BSTR *strChars); + + +void __RPC_STUB IVBSAXLexicalHandler_comment_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXLexicalHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXDeclHandler_INTERFACE_DEFINED__ +#define __IVBSAXDeclHandler_INTERFACE_DEFINED__ + +/* interface IVBSAXDeclHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXDeclHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e8917260-7579-4be1-b5dd-7afbfa6f077b") + IVBSAXDeclHandler : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE elementDecl( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strModel) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE attributeDecl( + /* [out][in] */ BSTR *strElementName, + /* [out][in] */ BSTR *strAttributeName, + /* [out][in] */ BSTR *strType, + /* [out][in] */ BSTR *strValueDefault, + /* [out][in] */ BSTR *strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE internalEntityDecl( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE externalEntityDecl( + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXDeclHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXDeclHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXDeclHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXDeclHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXDeclHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXDeclHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXDeclHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXDeclHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *elementDecl )( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strModel); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *attributeDecl )( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strElementName, + /* [out][in] */ BSTR *strAttributeName, + /* [out][in] */ BSTR *strType, + /* [out][in] */ BSTR *strValueDefault, + /* [out][in] */ BSTR *strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *internalEntityDecl )( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *externalEntityDecl )( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + END_INTERFACE + } IVBSAXDeclHandlerVtbl; + + interface IVBSAXDeclHandler + { + CONST_VTBL struct IVBSAXDeclHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXDeclHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXDeclHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXDeclHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXDeclHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXDeclHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXDeclHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXDeclHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXDeclHandler_elementDecl(This,strName,strModel) \ + (This)->lpVtbl -> elementDecl(This,strName,strModel) + +#define IVBSAXDeclHandler_attributeDecl(This,strElementName,strAttributeName,strType,strValueDefault,strValue) \ + (This)->lpVtbl -> attributeDecl(This,strElementName,strAttributeName,strType,strValueDefault,strValue) + +#define IVBSAXDeclHandler_internalEntityDecl(This,strName,strValue) \ + (This)->lpVtbl -> internalEntityDecl(This,strName,strValue) + +#define IVBSAXDeclHandler_externalEntityDecl(This,strName,strPublicId,strSystemId) \ + (This)->lpVtbl -> externalEntityDecl(This,strName,strPublicId,strSystemId) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_elementDecl_Proxy( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strModel); + + +void __RPC_STUB IVBSAXDeclHandler_elementDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_attributeDecl_Proxy( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strElementName, + /* [out][in] */ BSTR *strAttributeName, + /* [out][in] */ BSTR *strType, + /* [out][in] */ BSTR *strValueDefault, + /* [out][in] */ BSTR *strValue); + + +void __RPC_STUB IVBSAXDeclHandler_attributeDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_internalEntityDecl_Proxy( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strValue); + + +void __RPC_STUB IVBSAXDeclHandler_internalEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_externalEntityDecl_Proxy( + IVBSAXDeclHandler * This, + /* [out][in] */ BSTR *strName, + /* [out][in] */ BSTR *strPublicId, + /* [out][in] */ BSTR *strSystemId); + + +void __RPC_STUB IVBSAXDeclHandler_externalEntityDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXDeclHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IVBSAXAttributes_INTERFACE_DEFINED__ +#define __IVBSAXAttributes_INTERFACE_DEFINED__ + +/* interface IVBSAXAttributes */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IVBSAXAttributes; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("10dc0586-132b-4cac-8bb3-db00ac8b7ee0") + IVBSAXAttributes : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ int *nLength) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getURI( + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strURI) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getLocalName( + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strLocalName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getQName( + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strQName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getIndexFromName( + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ int *nIndex) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getIndexFromQName( + /* [in] */ BSTR strQName, + /* [retval][out] */ int *nIndex) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getType( + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strType) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getTypeFromName( + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strType) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getTypeFromQName( + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strType) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValue( + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValueFromName( + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValueFromQName( + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBSAXAttributesVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBSAXAttributes * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBSAXAttributes * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBSAXAttributes * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBSAXAttributes * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBSAXAttributes * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBSAXAttributes * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBSAXAttributes * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IVBSAXAttributes * This, + /* [retval][out] */ int *nLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getURI )( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strURI); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getLocalName )( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strLocalName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getQName )( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strQName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getIndexFromName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ int *nIndex); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getIndexFromQName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ int *nIndex); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getType )( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strType); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getTypeFromName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strType); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getTypeFromQName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strType); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValue )( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValueFromName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValueFromQName )( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strValue); + + END_INTERFACE + } IVBSAXAttributesVtbl; + + interface IVBSAXAttributes + { + CONST_VTBL struct IVBSAXAttributesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBSAXAttributes_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBSAXAttributes_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBSAXAttributes_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBSAXAttributes_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBSAXAttributes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBSAXAttributes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBSAXAttributes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBSAXAttributes_get_length(This,nLength) \ + (This)->lpVtbl -> get_length(This,nLength) + +#define IVBSAXAttributes_getURI(This,nIndex,strURI) \ + (This)->lpVtbl -> getURI(This,nIndex,strURI) + +#define IVBSAXAttributes_getLocalName(This,nIndex,strLocalName) \ + (This)->lpVtbl -> getLocalName(This,nIndex,strLocalName) + +#define IVBSAXAttributes_getQName(This,nIndex,strQName) \ + (This)->lpVtbl -> getQName(This,nIndex,strQName) + +#define IVBSAXAttributes_getIndexFromName(This,strURI,strLocalName,nIndex) \ + (This)->lpVtbl -> getIndexFromName(This,strURI,strLocalName,nIndex) + +#define IVBSAXAttributes_getIndexFromQName(This,strQName,nIndex) \ + (This)->lpVtbl -> getIndexFromQName(This,strQName,nIndex) + +#define IVBSAXAttributes_getType(This,nIndex,strType) \ + (This)->lpVtbl -> getType(This,nIndex,strType) + +#define IVBSAXAttributes_getTypeFromName(This,strURI,strLocalName,strType) \ + (This)->lpVtbl -> getTypeFromName(This,strURI,strLocalName,strType) + +#define IVBSAXAttributes_getTypeFromQName(This,strQName,strType) \ + (This)->lpVtbl -> getTypeFromQName(This,strQName,strType) + +#define IVBSAXAttributes_getValue(This,nIndex,strValue) \ + (This)->lpVtbl -> getValue(This,nIndex,strValue) + +#define IVBSAXAttributes_getValueFromName(This,strURI,strLocalName,strValue) \ + (This)->lpVtbl -> getValueFromName(This,strURI,strLocalName,strValue) + +#define IVBSAXAttributes_getValueFromQName(This,strQName,strValue) \ + (This)->lpVtbl -> getValueFromQName(This,strQName,strValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_get_length_Proxy( + IVBSAXAttributes * This, + /* [retval][out] */ int *nLength); + + +void __RPC_STUB IVBSAXAttributes_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getURI_Proxy( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strURI); + + +void __RPC_STUB IVBSAXAttributes_getURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getLocalName_Proxy( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strLocalName); + + +void __RPC_STUB IVBSAXAttributes_getLocalName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getQName_Proxy( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strQName); + + +void __RPC_STUB IVBSAXAttributes_getQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getIndexFromName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ int *nIndex); + + +void __RPC_STUB IVBSAXAttributes_getIndexFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getIndexFromQName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ int *nIndex); + + +void __RPC_STUB IVBSAXAttributes_getIndexFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getType_Proxy( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strType); + + +void __RPC_STUB IVBSAXAttributes_getType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getTypeFromName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strType); + + +void __RPC_STUB IVBSAXAttributes_getTypeFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getTypeFromQName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strType); + + +void __RPC_STUB IVBSAXAttributes_getTypeFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValue_Proxy( + IVBSAXAttributes * This, + /* [in] */ int nIndex, + /* [retval][out] */ BSTR *strValue); + + +void __RPC_STUB IVBSAXAttributes_getValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValueFromName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [retval][out] */ BSTR *strValue); + + +void __RPC_STUB IVBSAXAttributes_getValueFromName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValueFromQName_Proxy( + IVBSAXAttributes * This, + /* [in] */ BSTR strQName, + /* [retval][out] */ BSTR *strValue); + + +void __RPC_STUB IVBSAXAttributes_getValueFromQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBSAXAttributes_INTERFACE_DEFINED__ */ + + +#ifndef __IMXWriter_INTERFACE_DEFINED__ +#define __IMXWriter_INTERFACE_DEFINED__ + +/* interface IMXWriter */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IMXWriter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4d7ff4ba-1565-4ea8-94e1-6e724a46f98d") + IMXWriter : public IDispatch + { + public: + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_output( + /* [in] */ VARIANT varDestination) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_output( + /* [retval][out] */ VARIANT *varDestination) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_encoding( + /* [in] */ BSTR strEncoding) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_encoding( + /* [retval][out] */ BSTR *strEncoding) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_byteOrderMark( + /* [in] */ VARIANT_BOOL fWriteByteOrderMark) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_byteOrderMark( + /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_indent( + /* [in] */ VARIANT_BOOL fIndentMode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_indent( + /* [retval][out] */ VARIANT_BOOL *fIndentMode) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_standalone( + /* [in] */ VARIANT_BOOL fValue) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_standalone( + /* [retval][out] */ VARIANT_BOOL *fValue) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_omitXMLDeclaration( + /* [in] */ VARIANT_BOOL fValue) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_omitXMLDeclaration( + /* [retval][out] */ VARIANT_BOOL *fValue) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_version( + /* [in] */ BSTR strVersion) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_version( + /* [retval][out] */ BSTR *strVersion) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_disableOutputEscaping( + /* [in] */ VARIANT_BOOL fValue) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_disableOutputEscaping( + /* [retval][out] */ VARIANT_BOOL *fValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE flush( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXWriterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXWriter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXWriter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXWriter * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXWriter * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXWriter * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXWriter * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXWriter * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_output )( + IMXWriter * This, + /* [in] */ VARIANT varDestination); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( + IMXWriter * This, + /* [retval][out] */ VARIANT *varDestination); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_encoding )( + IMXWriter * This, + /* [in] */ BSTR strEncoding); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_encoding )( + IMXWriter * This, + /* [retval][out] */ BSTR *strEncoding); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_byteOrderMark )( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fWriteByteOrderMark); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_byteOrderMark )( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_indent )( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fIndentMode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_indent )( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fIndentMode); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_standalone )( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_standalone )( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_omitXMLDeclaration )( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_omitXMLDeclaration )( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_version )( + IMXWriter * This, + /* [in] */ BSTR strVersion); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_version )( + IMXWriter * This, + /* [retval][out] */ BSTR *strVersion); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_disableOutputEscaping )( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_disableOutputEscaping )( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *flush )( + IMXWriter * This); + + END_INTERFACE + } IMXWriterVtbl; + + interface IMXWriter + { + CONST_VTBL struct IMXWriterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXWriter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXWriter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXWriter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXWriter_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXWriter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXWriter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXWriter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXWriter_put_output(This,varDestination) \ + (This)->lpVtbl -> put_output(This,varDestination) + +#define IMXWriter_get_output(This,varDestination) \ + (This)->lpVtbl -> get_output(This,varDestination) + +#define IMXWriter_put_encoding(This,strEncoding) \ + (This)->lpVtbl -> put_encoding(This,strEncoding) + +#define IMXWriter_get_encoding(This,strEncoding) \ + (This)->lpVtbl -> get_encoding(This,strEncoding) + +#define IMXWriter_put_byteOrderMark(This,fWriteByteOrderMark) \ + (This)->lpVtbl -> put_byteOrderMark(This,fWriteByteOrderMark) + +#define IMXWriter_get_byteOrderMark(This,fWriteByteOrderMark) \ + (This)->lpVtbl -> get_byteOrderMark(This,fWriteByteOrderMark) + +#define IMXWriter_put_indent(This,fIndentMode) \ + (This)->lpVtbl -> put_indent(This,fIndentMode) + +#define IMXWriter_get_indent(This,fIndentMode) \ + (This)->lpVtbl -> get_indent(This,fIndentMode) + +#define IMXWriter_put_standalone(This,fValue) \ + (This)->lpVtbl -> put_standalone(This,fValue) + +#define IMXWriter_get_standalone(This,fValue) \ + (This)->lpVtbl -> get_standalone(This,fValue) + +#define IMXWriter_put_omitXMLDeclaration(This,fValue) \ + (This)->lpVtbl -> put_omitXMLDeclaration(This,fValue) + +#define IMXWriter_get_omitXMLDeclaration(This,fValue) \ + (This)->lpVtbl -> get_omitXMLDeclaration(This,fValue) + +#define IMXWriter_put_version(This,strVersion) \ + (This)->lpVtbl -> put_version(This,strVersion) + +#define IMXWriter_get_version(This,strVersion) \ + (This)->lpVtbl -> get_version(This,strVersion) + +#define IMXWriter_put_disableOutputEscaping(This,fValue) \ + (This)->lpVtbl -> put_disableOutputEscaping(This,fValue) + +#define IMXWriter_get_disableOutputEscaping(This,fValue) \ + (This)->lpVtbl -> get_disableOutputEscaping(This,fValue) + +#define IMXWriter_flush(This) \ + (This)->lpVtbl -> flush(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_output_Proxy( + IMXWriter * This, + /* [in] */ VARIANT varDestination); + + +void __RPC_STUB IMXWriter_put_output_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_output_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT *varDestination); + + +void __RPC_STUB IMXWriter_get_output_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_encoding_Proxy( + IMXWriter * This, + /* [in] */ BSTR strEncoding); + + +void __RPC_STUB IMXWriter_put_encoding_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_encoding_Proxy( + IMXWriter * This, + /* [retval][out] */ BSTR *strEncoding); + + +void __RPC_STUB IMXWriter_get_encoding_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_byteOrderMark_Proxy( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fWriteByteOrderMark); + + +void __RPC_STUB IMXWriter_put_byteOrderMark_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_byteOrderMark_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark); + + +void __RPC_STUB IMXWriter_get_byteOrderMark_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_indent_Proxy( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fIndentMode); + + +void __RPC_STUB IMXWriter_put_indent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_indent_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fIndentMode); + + +void __RPC_STUB IMXWriter_get_indent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_standalone_Proxy( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + +void __RPC_STUB IMXWriter_put_standalone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_standalone_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + +void __RPC_STUB IMXWriter_get_standalone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_omitXMLDeclaration_Proxy( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + +void __RPC_STUB IMXWriter_put_omitXMLDeclaration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_omitXMLDeclaration_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + +void __RPC_STUB IMXWriter_get_omitXMLDeclaration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_version_Proxy( + IMXWriter * This, + /* [in] */ BSTR strVersion); + + +void __RPC_STUB IMXWriter_put_version_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_version_Proxy( + IMXWriter * This, + /* [retval][out] */ BSTR *strVersion); + + +void __RPC_STUB IMXWriter_get_version_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_disableOutputEscaping_Proxy( + IMXWriter * This, + /* [in] */ VARIANT_BOOL fValue); + + +void __RPC_STUB IMXWriter_put_disableOutputEscaping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_disableOutputEscaping_Proxy( + IMXWriter * This, + /* [retval][out] */ VARIANT_BOOL *fValue); + + +void __RPC_STUB IMXWriter_get_disableOutputEscaping_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXWriter_flush_Proxy( + IMXWriter * This); + + +void __RPC_STUB IMXWriter_flush_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXWriter_INTERFACE_DEFINED__ */ + + +#ifndef __IMXAttributes_INTERFACE_DEFINED__ +#define __IMXAttributes_INTERFACE_DEFINED__ + +/* interface IMXAttributes */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IMXAttributes; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f10d27cc-3ec0-415c-8ed8-77ab1c5e7262") + IMXAttributes : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addAttribute( + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addAttributeFromIndex( + /* [in] */ VARIANT varAtts, + /* [in] */ int nIndex) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE clear( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttribute( + /* [in] */ int nIndex) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttribute( + /* [in] */ int nIndex, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttributes( + /* [in] */ VARIANT varAtts) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setLocalName( + /* [in] */ int nIndex, + /* [in] */ BSTR strLocalName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setQName( + /* [in] */ int nIndex, + /* [in] */ BSTR strQName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setType( + /* [in] */ int nIndex, + /* [in] */ BSTR strType) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setURI( + /* [in] */ int nIndex, + /* [in] */ BSTR strURI) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setValue( + /* [in] */ int nIndex, + /* [in] */ BSTR strValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXAttributesVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXAttributes * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXAttributes * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXAttributes * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXAttributes * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXAttributes * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXAttributes * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXAttributes * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addAttribute )( + IMXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addAttributeFromIndex )( + IMXAttributes * This, + /* [in] */ VARIANT varAtts, + /* [in] */ int nIndex); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *clear )( + IMXAttributes * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttribute )( + IMXAttributes * This, + /* [in] */ int nIndex); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttribute )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttributes )( + IMXAttributes * This, + /* [in] */ VARIANT varAtts); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setLocalName )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strLocalName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setQName )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strQName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setType )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strType); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setURI )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strURI); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setValue )( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strValue); + + END_INTERFACE + } IMXAttributesVtbl; + + interface IMXAttributes + { + CONST_VTBL struct IMXAttributesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXAttributes_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXAttributes_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXAttributes_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXAttributes_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXAttributes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXAttributes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXAttributes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXAttributes_addAttribute(This,strURI,strLocalName,strQName,strType,strValue) \ + (This)->lpVtbl -> addAttribute(This,strURI,strLocalName,strQName,strType,strValue) + +#define IMXAttributes_addAttributeFromIndex(This,varAtts,nIndex) \ + (This)->lpVtbl -> addAttributeFromIndex(This,varAtts,nIndex) + +#define IMXAttributes_clear(This) \ + (This)->lpVtbl -> clear(This) + +#define IMXAttributes_removeAttribute(This,nIndex) \ + (This)->lpVtbl -> removeAttribute(This,nIndex) + +#define IMXAttributes_setAttribute(This,nIndex,strURI,strLocalName,strQName,strType,strValue) \ + (This)->lpVtbl -> setAttribute(This,nIndex,strURI,strLocalName,strQName,strType,strValue) + +#define IMXAttributes_setAttributes(This,varAtts) \ + (This)->lpVtbl -> setAttributes(This,varAtts) + +#define IMXAttributes_setLocalName(This,nIndex,strLocalName) \ + (This)->lpVtbl -> setLocalName(This,nIndex,strLocalName) + +#define IMXAttributes_setQName(This,nIndex,strQName) \ + (This)->lpVtbl -> setQName(This,nIndex,strQName) + +#define IMXAttributes_setType(This,nIndex,strType) \ + (This)->lpVtbl -> setType(This,nIndex,strType) + +#define IMXAttributes_setURI(This,nIndex,strURI) \ + (This)->lpVtbl -> setURI(This,nIndex,strURI) + +#define IMXAttributes_setValue(This,nIndex,strValue) \ + (This)->lpVtbl -> setValue(This,nIndex,strValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_addAttribute_Proxy( + IMXAttributes * This, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue); + + +void __RPC_STUB IMXAttributes_addAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_addAttributeFromIndex_Proxy( + IMXAttributes * This, + /* [in] */ VARIANT varAtts, + /* [in] */ int nIndex); + + +void __RPC_STUB IMXAttributes_addAttributeFromIndex_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_clear_Proxy( + IMXAttributes * This); + + +void __RPC_STUB IMXAttributes_clear_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_removeAttribute_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex); + + +void __RPC_STUB IMXAttributes_removeAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setAttribute_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strURI, + /* [in] */ BSTR strLocalName, + /* [in] */ BSTR strQName, + /* [in] */ BSTR strType, + /* [in] */ BSTR strValue); + + +void __RPC_STUB IMXAttributes_setAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setAttributes_Proxy( + IMXAttributes * This, + /* [in] */ VARIANT varAtts); + + +void __RPC_STUB IMXAttributes_setAttributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setLocalName_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strLocalName); + + +void __RPC_STUB IMXAttributes_setLocalName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setQName_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strQName); + + +void __RPC_STUB IMXAttributes_setQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setType_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strType); + + +void __RPC_STUB IMXAttributes_setType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setURI_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strURI); + + +void __RPC_STUB IMXAttributes_setURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setValue_Proxy( + IMXAttributes * This, + /* [in] */ int nIndex, + /* [in] */ BSTR strValue); + + +void __RPC_STUB IMXAttributes_setValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXAttributes_INTERFACE_DEFINED__ */ + + +#ifndef __IMXReaderControl_INTERFACE_DEFINED__ +#define __IMXReaderControl_INTERFACE_DEFINED__ + +/* interface IMXReaderControl */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IMXReaderControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("808f4e35-8d5a-4fbe-8466-33a41279ed30") + IMXReaderControl : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE resume( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE suspend( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXReaderControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXReaderControl * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXReaderControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXReaderControl * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXReaderControl * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXReaderControl * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXReaderControl * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXReaderControl * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IMXReaderControl * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *resume )( + IMXReaderControl * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *suspend )( + IMXReaderControl * This); + + END_INTERFACE + } IMXReaderControlVtbl; + + interface IMXReaderControl + { + CONST_VTBL struct IMXReaderControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXReaderControl_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXReaderControl_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXReaderControl_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXReaderControl_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXReaderControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXReaderControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXReaderControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXReaderControl_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IMXReaderControl_resume(This) \ + (This)->lpVtbl -> resume(This) + +#define IMXReaderControl_suspend(This) \ + (This)->lpVtbl -> suspend(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_abort_Proxy( + IMXReaderControl * This); + + +void __RPC_STUB IMXReaderControl_abort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_resume_Proxy( + IMXReaderControl * This); + + +void __RPC_STUB IMXReaderControl_resume_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_suspend_Proxy( + IMXReaderControl * This); + + +void __RPC_STUB IMXReaderControl_suspend_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXReaderControl_INTERFACE_DEFINED__ */ + + +#ifndef __IMXSchemaDeclHandler_INTERFACE_DEFINED__ +#define __IMXSchemaDeclHandler_INTERFACE_DEFINED__ + +/* interface IMXSchemaDeclHandler */ +/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ + + +EXTERN_C const IID IID_IMXSchemaDeclHandler; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("fa4bb38c-faf9-4cca-9302-d1dd0fe520db") + IMXSchemaDeclHandler : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE schemaElementDecl( + /* [in] */ ISchemaElement *oSchemaElement) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXSchemaDeclHandlerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXSchemaDeclHandler * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXSchemaDeclHandler * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXSchemaDeclHandler * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXSchemaDeclHandler * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXSchemaDeclHandler * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXSchemaDeclHandler * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXSchemaDeclHandler * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *schemaElementDecl )( + IMXSchemaDeclHandler * This, + /* [in] */ ISchemaElement *oSchemaElement); + + END_INTERFACE + } IMXSchemaDeclHandlerVtbl; + + interface IMXSchemaDeclHandler + { + CONST_VTBL struct IMXSchemaDeclHandlerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXSchemaDeclHandler_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXSchemaDeclHandler_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXSchemaDeclHandler_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXSchemaDeclHandler_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXSchemaDeclHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXSchemaDeclHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXSchemaDeclHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXSchemaDeclHandler_schemaElementDecl(This,oSchemaElement) \ + (This)->lpVtbl -> schemaElementDecl(This,oSchemaElement) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXSchemaDeclHandler_schemaElementDecl_Proxy( + IMXSchemaDeclHandler * This, + /* [in] */ ISchemaElement *oSchemaElement); + + +void __RPC_STUB IMXSchemaDeclHandler_schemaElementDecl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXSchemaDeclHandler_INTERFACE_DEFINED__ */ + + +#ifndef __IMXXMLFilter_INTERFACE_DEFINED__ +#define __IMXXMLFilter_INTERFACE_DEFINED__ + +/* interface IMXXMLFilter */ +/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ + + +EXTERN_C const IID IID_IMXXMLFilter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c90352f7-643c-4fbc-bb23-e996eb2d51fd") + IMXXMLFilter : public IDispatch + { + public: + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getFeature( + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE putFeature( + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getProperty( + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE putProperty( + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_entityResolver( + /* [retval][out] */ IUnknown **oResolver) = 0; + + virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_entityResolver( + /* [in] */ IUnknown *oResolver) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentHandler( + /* [retval][out] */ IUnknown **oHandler) = 0; + + virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_contentHandler( + /* [in] */ IUnknown *oHandler) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_dtdHandler( + /* [retval][out] */ IUnknown **oHandler) = 0; + + virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_dtdHandler( + /* [in] */ IUnknown *oHandler) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_errorHandler( + /* [retval][out] */ IUnknown **oHandler) = 0; + + virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_errorHandler( + /* [in] */ IUnknown *oHandler) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXXMLFilterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXXMLFilter * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXXMLFilter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXXMLFilter * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXXMLFilter * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXXMLFilter * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXXMLFilter * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXXMLFilter * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getFeature )( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *putFeature )( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *putProperty )( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_entityResolver )( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oResolver); + + /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_entityResolver )( + IMXXMLFilter * This, + /* [in] */ IUnknown *oResolver); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentHandler )( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_contentHandler )( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_dtdHandler )( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_dtdHandler )( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_errorHandler )( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_errorHandler )( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + END_INTERFACE + } IMXXMLFilterVtbl; + + interface IMXXMLFilter + { + CONST_VTBL struct IMXXMLFilterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXXMLFilter_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXXMLFilter_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXXMLFilter_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXXMLFilter_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXXMLFilter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXXMLFilter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXXMLFilter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXXMLFilter_getFeature(This,strName,fValue) \ + (This)->lpVtbl -> getFeature(This,strName,fValue) + +#define IMXXMLFilter_putFeature(This,strName,fValue) \ + (This)->lpVtbl -> putFeature(This,strName,fValue) + +#define IMXXMLFilter_getProperty(This,strName,varValue) \ + (This)->lpVtbl -> getProperty(This,strName,varValue) + +#define IMXXMLFilter_putProperty(This,strName,varValue) \ + (This)->lpVtbl -> putProperty(This,strName,varValue) + +#define IMXXMLFilter_get_entityResolver(This,oResolver) \ + (This)->lpVtbl -> get_entityResolver(This,oResolver) + +#define IMXXMLFilter_putref_entityResolver(This,oResolver) \ + (This)->lpVtbl -> putref_entityResolver(This,oResolver) + +#define IMXXMLFilter_get_contentHandler(This,oHandler) \ + (This)->lpVtbl -> get_contentHandler(This,oHandler) + +#define IMXXMLFilter_putref_contentHandler(This,oHandler) \ + (This)->lpVtbl -> putref_contentHandler(This,oHandler) + +#define IMXXMLFilter_get_dtdHandler(This,oHandler) \ + (This)->lpVtbl -> get_dtdHandler(This,oHandler) + +#define IMXXMLFilter_putref_dtdHandler(This,oHandler) \ + (This)->lpVtbl -> putref_dtdHandler(This,oHandler) + +#define IMXXMLFilter_get_errorHandler(This,oHandler) \ + (This)->lpVtbl -> get_errorHandler(This,oHandler) + +#define IMXXMLFilter_putref_errorHandler(This,oHandler) \ + (This)->lpVtbl -> putref_errorHandler(This,oHandler) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_getFeature_Proxy( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT_BOOL *fValue); + + +void __RPC_STUB IMXXMLFilter_getFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putFeature_Proxy( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT_BOOL fValue); + + +void __RPC_STUB IMXXMLFilter_putFeature_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_getProperty_Proxy( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [retval][out] */ VARIANT *varValue); + + +void __RPC_STUB IMXXMLFilter_getProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putProperty_Proxy( + IMXXMLFilter * This, + /* [in] */ BSTR strName, + /* [in] */ VARIANT varValue); + + +void __RPC_STUB IMXXMLFilter_putProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_entityResolver_Proxy( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oResolver); + + +void __RPC_STUB IMXXMLFilter_get_entityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_entityResolver_Proxy( + IMXXMLFilter * This, + /* [in] */ IUnknown *oResolver); + + +void __RPC_STUB IMXXMLFilter_putref_entityResolver_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_contentHandler_Proxy( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + +void __RPC_STUB IMXXMLFilter_get_contentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_contentHandler_Proxy( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + +void __RPC_STUB IMXXMLFilter_putref_contentHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_dtdHandler_Proxy( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + +void __RPC_STUB IMXXMLFilter_get_dtdHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_dtdHandler_Proxy( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + +void __RPC_STUB IMXXMLFilter_putref_dtdHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_errorHandler_Proxy( + IMXXMLFilter * This, + /* [retval][out] */ IUnknown **oHandler); + + +void __RPC_STUB IMXXMLFilter_get_errorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_errorHandler_Proxy( + IMXXMLFilter * This, + /* [in] */ IUnknown *oHandler); + + +void __RPC_STUB IMXXMLFilter_putref_errorHandler_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXXMLFilter_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ +#define __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ + +/* interface IXMLDOMSchemaCollection2 */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMSchemaCollection2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b0-dd1b-4664-9a50-c2f40f4bd79a") + IXMLDOMSchemaCollection2 : public IXMLDOMSchemaCollection + { + public: + virtual /* [id] */ HRESULT STDMETHODCALLTYPE validate( void) = 0; + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_validateOnLoad( + /* [in] */ VARIANT_BOOL validateOnLoad) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_validateOnLoad( + /* [retval][out] */ VARIANT_BOOL *validateOnLoad) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getSchema( + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchema **schema) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getDeclaration( + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ ISchemaItem **item) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMSchemaCollection2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMSchemaCollection2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMSchemaCollection2 * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMSchemaCollection2 * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *add )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ BSTR namespaceURI, + /* [in] */ VARIANT var); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IXMLDOMNode **schemaNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *remove )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ BSTR namespaceURI); + + /* [propget][helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMSchemaCollection2 * This, + /* [retval][out] */ long *length); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *length); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addCollection )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ IXMLDOMSchemaCollection *otherCollection); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMSchemaCollection2 * This, + /* [out][retval] */ IUnknown **ppUnk); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *validate )( + IXMLDOMSchemaCollection2 * This); + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnLoad )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ VARIANT_BOOL validateOnLoad); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnLoad )( + IXMLDOMSchemaCollection2 * This, + /* [retval][out] */ VARIANT_BOOL *validateOnLoad); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getSchema )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchema **schema); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getDeclaration )( + IXMLDOMSchemaCollection2 * This, + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ ISchemaItem **item); + + END_INTERFACE + } IXMLDOMSchemaCollection2Vtbl; + + interface IXMLDOMSchemaCollection2 + { + CONST_VTBL struct IXMLDOMSchemaCollection2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMSchemaCollection2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMSchemaCollection2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMSchemaCollection2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMSchemaCollection2_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMSchemaCollection2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMSchemaCollection2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMSchemaCollection2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMSchemaCollection2_add(This,namespaceURI,var) \ + (This)->lpVtbl -> add(This,namespaceURI,var) + +#define IXMLDOMSchemaCollection2_get(This,namespaceURI,schemaNode) \ + (This)->lpVtbl -> get(This,namespaceURI,schemaNode) + +#define IXMLDOMSchemaCollection2_remove(This,namespaceURI) \ + (This)->lpVtbl -> remove(This,namespaceURI) + +#define IXMLDOMSchemaCollection2_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define IXMLDOMSchemaCollection2_get_namespaceURI(This,index,length) \ + (This)->lpVtbl -> get_namespaceURI(This,index,length) + +#define IXMLDOMSchemaCollection2_addCollection(This,otherCollection) \ + (This)->lpVtbl -> addCollection(This,otherCollection) + +#define IXMLDOMSchemaCollection2_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + + +#define IXMLDOMSchemaCollection2_validate(This) \ + (This)->lpVtbl -> validate(This) + +#define IXMLDOMSchemaCollection2_put_validateOnLoad(This,validateOnLoad) \ + (This)->lpVtbl -> put_validateOnLoad(This,validateOnLoad) + +#define IXMLDOMSchemaCollection2_get_validateOnLoad(This,validateOnLoad) \ + (This)->lpVtbl -> get_validateOnLoad(This,validateOnLoad) + +#define IXMLDOMSchemaCollection2_getSchema(This,namespaceURI,schema) \ + (This)->lpVtbl -> getSchema(This,namespaceURI,schema) + +#define IXMLDOMSchemaCollection2_getDeclaration(This,node,item) \ + (This)->lpVtbl -> getDeclaration(This,node,item) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_validate_Proxy( + IXMLDOMSchemaCollection2 * This); + + +void __RPC_STUB IXMLDOMSchemaCollection2_validate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_put_validateOnLoad_Proxy( + IXMLDOMSchemaCollection2 * This, + /* [in] */ VARIANT_BOOL validateOnLoad); + + +void __RPC_STUB IXMLDOMSchemaCollection2_put_validateOnLoad_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_get_validateOnLoad_Proxy( + IXMLDOMSchemaCollection2 * This, + /* [retval][out] */ VARIANT_BOOL *validateOnLoad); + + +void __RPC_STUB IXMLDOMSchemaCollection2_get_validateOnLoad_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_getSchema_Proxy( + IXMLDOMSchemaCollection2 * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchema **schema); + + +void __RPC_STUB IXMLDOMSchemaCollection2_getSchema_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_getDeclaration_Proxy( + IXMLDOMSchemaCollection2 * This, + /* [in] */ IXMLDOMNode *node, + /* [retval][out] */ ISchemaItem **item); + + +void __RPC_STUB IXMLDOMSchemaCollection2_getDeclaration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaStringCollection_INTERFACE_DEFINED__ +#define __ISchemaStringCollection_INTERFACE_DEFINED__ + +/* interface ISchemaStringCollection */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaStringCollection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b1-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaStringCollection : public IDispatch + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ BSTR *bstr) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *length) = 0; + + virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [retval][out] */ IUnknown **ppunk) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaStringCollectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaStringCollection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaStringCollection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaStringCollection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaStringCollection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaStringCollection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaStringCollection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaStringCollection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + ISchemaStringCollection * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *bstr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + ISchemaStringCollection * This, + /* [retval][out] */ long *length); + + /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + ISchemaStringCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + END_INTERFACE + } ISchemaStringCollectionVtbl; + + interface ISchemaStringCollection + { + CONST_VTBL struct ISchemaStringCollectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaStringCollection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaStringCollection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaStringCollection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaStringCollection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaStringCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaStringCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaStringCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaStringCollection_get_item(This,index,bstr) \ + (This)->lpVtbl -> get_item(This,index,bstr) + +#define ISchemaStringCollection_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define ISchemaStringCollection_get__newEnum(This,ppunk) \ + (This)->lpVtbl -> get__newEnum(This,ppunk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get_item_Proxy( + ISchemaStringCollection * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *bstr); + + +void __RPC_STUB ISchemaStringCollection_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get_length_Proxy( + ISchemaStringCollection * This, + /* [retval][out] */ long *length); + + +void __RPC_STUB ISchemaStringCollection_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get__newEnum_Proxy( + ISchemaStringCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + +void __RPC_STUB ISchemaStringCollection_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaStringCollection_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaItemCollection_INTERFACE_DEFINED__ +#define __ISchemaItemCollection_INTERFACE_DEFINED__ + +/* interface ISchemaItemCollection */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaItemCollection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b2-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaItemCollection : public IDispatch + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ ISchemaItem **item) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE itemByName( + /* [in] */ BSTR name, + /* [retval][out] */ ISchemaItem **item) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE itemByQName( + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchemaItem **item) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *length) = 0; + + virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [retval][out] */ IUnknown **ppunk) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaItemCollectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaItemCollection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaItemCollection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaItemCollection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaItemCollection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaItemCollection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaItemCollection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaItemCollection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + ISchemaItemCollection * This, + /* [in] */ long index, + /* [retval][out] */ ISchemaItem **item); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *itemByName )( + ISchemaItemCollection * This, + /* [in] */ BSTR name, + /* [retval][out] */ ISchemaItem **item); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *itemByQName )( + ISchemaItemCollection * This, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchemaItem **item); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + ISchemaItemCollection * This, + /* [retval][out] */ long *length); + + /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + ISchemaItemCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + END_INTERFACE + } ISchemaItemCollectionVtbl; + + interface ISchemaItemCollection + { + CONST_VTBL struct ISchemaItemCollectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaItemCollection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaItemCollection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaItemCollection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaItemCollection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaItemCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaItemCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaItemCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaItemCollection_get_item(This,index,item) \ + (This)->lpVtbl -> get_item(This,index,item) + +#define ISchemaItemCollection_itemByName(This,name,item) \ + (This)->lpVtbl -> itemByName(This,name,item) + +#define ISchemaItemCollection_itemByQName(This,name,namespaceURI,item) \ + (This)->lpVtbl -> itemByQName(This,name,namespaceURI,item) + +#define ISchemaItemCollection_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define ISchemaItemCollection_get__newEnum(This,ppunk) \ + (This)->lpVtbl -> get__newEnum(This,ppunk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get_item_Proxy( + ISchemaItemCollection * This, + /* [in] */ long index, + /* [retval][out] */ ISchemaItem **item); + + +void __RPC_STUB ISchemaItemCollection_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_itemByName_Proxy( + ISchemaItemCollection * This, + /* [in] */ BSTR name, + /* [retval][out] */ ISchemaItem **item); + + +void __RPC_STUB ISchemaItemCollection_itemByName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_itemByQName_Proxy( + ISchemaItemCollection * This, + /* [in] */ BSTR name, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ ISchemaItem **item); + + +void __RPC_STUB ISchemaItemCollection_itemByQName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get_length_Proxy( + ISchemaItemCollection * This, + /* [retval][out] */ long *length); + + +void __RPC_STUB ISchemaItemCollection_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get__newEnum_Proxy( + ISchemaItemCollection * This, + /* [retval][out] */ IUnknown **ppunk); + + +void __RPC_STUB ISchemaItemCollection_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaItemCollection_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaItem_INTERFACE_DEFINED__ +#define __ISchemaItem_INTERFACE_DEFINED__ + +/* interface ISchemaItem */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaItem; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b3-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaItem : public IDispatch + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_name( + /* [retval][out] */ BSTR *name) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( + /* [retval][out] */ BSTR *namespaceURI) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_schema( + /* [retval][out] */ ISchema **schema) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_id( + /* [retval][out] */ BSTR *id) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_itemType( + /* [retval][out] */ SOMITEMTYPE *itemType) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_unhandledAttributes( + /* [retval][out] */ IVBSAXAttributes **attributes) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE writeAnnotation( + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaItemVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaItem * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaItem * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaItem * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaItem * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaItem * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaItem * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaItem * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaItem * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaItem * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaItem * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaItem * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaItem * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaItem * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaItem * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + END_INTERFACE + } ISchemaItemVtbl; + + interface ISchemaItem + { + CONST_VTBL struct ISchemaItemVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaItem_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaItem_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaItem_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaItem_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaItem_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaItem_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaItem_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaItem_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaItem_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaItem_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaItem_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaItem_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaItem_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaItem_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_name_Proxy( + ISchemaItem * This, + /* [retval][out] */ BSTR *name); + + +void __RPC_STUB ISchemaItem_get_name_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_namespaceURI_Proxy( + ISchemaItem * This, + /* [retval][out] */ BSTR *namespaceURI); + + +void __RPC_STUB ISchemaItem_get_namespaceURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_schema_Proxy( + ISchemaItem * This, + /* [retval][out] */ ISchema **schema); + + +void __RPC_STUB ISchemaItem_get_schema_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_id_Proxy( + ISchemaItem * This, + /* [retval][out] */ BSTR *id); + + +void __RPC_STUB ISchemaItem_get_id_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_itemType_Proxy( + ISchemaItem * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + +void __RPC_STUB ISchemaItem_get_itemType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_unhandledAttributes_Proxy( + ISchemaItem * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + +void __RPC_STUB ISchemaItem_get_unhandledAttributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_writeAnnotation_Proxy( + ISchemaItem * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + +void __RPC_STUB ISchemaItem_writeAnnotation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaItem_INTERFACE_DEFINED__ */ + + +#ifndef __ISchema_INTERFACE_DEFINED__ +#define __ISchema_INTERFACE_DEFINED__ + +/* interface ISchema */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchema; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b4-dd1b-4664-9a50-c2f40f4bd79a") + ISchema : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_targetNamespace( + /* [retval][out] */ BSTR *targetNamespace) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_version( + /* [retval][out] */ BSTR *version) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_types( + /* [retval][out] */ ISchemaItemCollection **types) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_elements( + /* [retval][out] */ ISchemaItemCollection **elements) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( + /* [retval][out] */ ISchemaItemCollection **attributes) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributeGroups( + /* [retval][out] */ ISchemaItemCollection **attributeGroups) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_modelGroups( + /* [retval][out] */ ISchemaItemCollection **modelGroups) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_notations( + /* [retval][out] */ ISchemaItemCollection **notations) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_schemaLocations( + /* [retval][out] */ ISchemaStringCollection **schemaLocations) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchema * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchema * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchema * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchema * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchema * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchema * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchema * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchema * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchema * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchema * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchema * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchema * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchema * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchema * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_targetNamespace )( + ISchema * This, + /* [retval][out] */ BSTR *targetNamespace); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_version )( + ISchema * This, + /* [retval][out] */ BSTR *version); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_types )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **types); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_elements )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **elements); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributeGroups )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **attributeGroups); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_modelGroups )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **modelGroups); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_notations )( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **notations); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schemaLocations )( + ISchema * This, + /* [retval][out] */ ISchemaStringCollection **schemaLocations); + + END_INTERFACE + } ISchemaVtbl; + + interface ISchema + { + CONST_VTBL struct ISchemaVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchema_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchema_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchema_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchema_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchema_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchema_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchema_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchema_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchema_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchema_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchema_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchema_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchema_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchema_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchema_get_targetNamespace(This,targetNamespace) \ + (This)->lpVtbl -> get_targetNamespace(This,targetNamespace) + +#define ISchema_get_version(This,version) \ + (This)->lpVtbl -> get_version(This,version) + +#define ISchema_get_types(This,types) \ + (This)->lpVtbl -> get_types(This,types) + +#define ISchema_get_elements(This,elements) \ + (This)->lpVtbl -> get_elements(This,elements) + +#define ISchema_get_attributes(This,attributes) \ + (This)->lpVtbl -> get_attributes(This,attributes) + +#define ISchema_get_attributeGroups(This,attributeGroups) \ + (This)->lpVtbl -> get_attributeGroups(This,attributeGroups) + +#define ISchema_get_modelGroups(This,modelGroups) \ + (This)->lpVtbl -> get_modelGroups(This,modelGroups) + +#define ISchema_get_notations(This,notations) \ + (This)->lpVtbl -> get_notations(This,notations) + +#define ISchema_get_schemaLocations(This,schemaLocations) \ + (This)->lpVtbl -> get_schemaLocations(This,schemaLocations) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_targetNamespace_Proxy( + ISchema * This, + /* [retval][out] */ BSTR *targetNamespace); + + +void __RPC_STUB ISchema_get_targetNamespace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_version_Proxy( + ISchema * This, + /* [retval][out] */ BSTR *version); + + +void __RPC_STUB ISchema_get_version_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_types_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **types); + + +void __RPC_STUB ISchema_get_types_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_elements_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **elements); + + +void __RPC_STUB ISchema_get_elements_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_attributes_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + +void __RPC_STUB ISchema_get_attributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_attributeGroups_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **attributeGroups); + + +void __RPC_STUB ISchema_get_attributeGroups_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_modelGroups_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **modelGroups); + + +void __RPC_STUB ISchema_get_modelGroups_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_notations_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaItemCollection **notations); + + +void __RPC_STUB ISchema_get_notations_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_schemaLocations_Proxy( + ISchema * This, + /* [retval][out] */ ISchemaStringCollection **schemaLocations); + + +void __RPC_STUB ISchema_get_schemaLocations_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchema_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaParticle_INTERFACE_DEFINED__ +#define __ISchemaParticle_INTERFACE_DEFINED__ + +/* interface ISchemaParticle */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaParticle; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b5-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaParticle : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minOccurs( + /* [retval][out] */ VARIANT *minOccurs) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxOccurs( + /* [retval][out] */ VARIANT *maxOccurs) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaParticleVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaParticle * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaParticle * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaParticle * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaParticle * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaParticle * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaParticle * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaParticle * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaParticle * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaParticle * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaParticle * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaParticle * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaParticle * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaParticle * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaParticle * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( + ISchemaParticle * This, + /* [retval][out] */ VARIANT *minOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( + ISchemaParticle * This, + /* [retval][out] */ VARIANT *maxOccurs); + + END_INTERFACE + } ISchemaParticleVtbl; + + interface ISchemaParticle + { + CONST_VTBL struct ISchemaParticleVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaParticle_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaParticle_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaParticle_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaParticle_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaParticle_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaParticle_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaParticle_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaParticle_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaParticle_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaParticle_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaParticle_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaParticle_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaParticle_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaParticle_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaParticle_get_minOccurs(This,minOccurs) \ + (This)->lpVtbl -> get_minOccurs(This,minOccurs) + +#define ISchemaParticle_get_maxOccurs(This,maxOccurs) \ + (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaParticle_get_minOccurs_Proxy( + ISchemaParticle * This, + /* [retval][out] */ VARIANT *minOccurs); + + +void __RPC_STUB ISchemaParticle_get_minOccurs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaParticle_get_maxOccurs_Proxy( + ISchemaParticle * This, + /* [retval][out] */ VARIANT *maxOccurs); + + +void __RPC_STUB ISchemaParticle_get_maxOccurs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaParticle_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaAttribute_INTERFACE_DEFINED__ +#define __ISchemaAttribute_INTERFACE_DEFINED__ + +/* interface ISchemaAttribute */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaAttribute; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b6-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaAttribute : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_type( + /* [retval][out] */ ISchemaType **type) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_scope( + /* [retval][out] */ ISchemaComplexType **scope) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_defaultValue( + /* [retval][out] */ BSTR *defaultValue) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fixedValue( + /* [retval][out] */ BSTR *fixedValue) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_use( + /* [retval][out] */ SCHEMAUSE *use) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isReference( + /* [retval][out] */ VARIANT_BOOL *reference) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaAttributeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaAttribute * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaAttribute * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaAttribute * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaAttribute * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaAttribute * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaAttribute * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaAttribute * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaAttribute * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaAttribute * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaAttribute * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaAttribute * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_type )( + ISchemaAttribute * This, + /* [retval][out] */ ISchemaType **type); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_scope )( + ISchemaAttribute * This, + /* [retval][out] */ ISchemaComplexType **scope); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_defaultValue )( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *defaultValue); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fixedValue )( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *fixedValue); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_use )( + ISchemaAttribute * This, + /* [retval][out] */ SCHEMAUSE *use); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isReference )( + ISchemaAttribute * This, + /* [retval][out] */ VARIANT_BOOL *reference); + + END_INTERFACE + } ISchemaAttributeVtbl; + + interface ISchemaAttribute + { + CONST_VTBL struct ISchemaAttributeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaAttribute_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaAttribute_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaAttribute_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaAttribute_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaAttribute_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaAttribute_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaAttribute_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaAttribute_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaAttribute_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaAttribute_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaAttribute_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaAttribute_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaAttribute_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaAttribute_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaAttribute_get_type(This,type) \ + (This)->lpVtbl -> get_type(This,type) + +#define ISchemaAttribute_get_scope(This,scope) \ + (This)->lpVtbl -> get_scope(This,scope) + +#define ISchemaAttribute_get_defaultValue(This,defaultValue) \ + (This)->lpVtbl -> get_defaultValue(This,defaultValue) + +#define ISchemaAttribute_get_fixedValue(This,fixedValue) \ + (This)->lpVtbl -> get_fixedValue(This,fixedValue) + +#define ISchemaAttribute_get_use(This,use) \ + (This)->lpVtbl -> get_use(This,use) + +#define ISchemaAttribute_get_isReference(This,reference) \ + (This)->lpVtbl -> get_isReference(This,reference) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_type_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ ISchemaType **type); + + +void __RPC_STUB ISchemaAttribute_get_type_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_scope_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ ISchemaComplexType **scope); + + +void __RPC_STUB ISchemaAttribute_get_scope_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_defaultValue_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *defaultValue); + + +void __RPC_STUB ISchemaAttribute_get_defaultValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_fixedValue_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ BSTR *fixedValue); + + +void __RPC_STUB ISchemaAttribute_get_fixedValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_use_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ SCHEMAUSE *use); + + +void __RPC_STUB ISchemaAttribute_get_use_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_isReference_Proxy( + ISchemaAttribute * This, + /* [retval][out] */ VARIANT_BOOL *reference); + + +void __RPC_STUB ISchemaAttribute_get_isReference_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaAttribute_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaElement_INTERFACE_DEFINED__ +#define __ISchemaElement_INTERFACE_DEFINED__ + +/* interface ISchemaElement */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaElement; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b7-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaElement : public ISchemaParticle + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_type( + /* [retval][out] */ ISchemaType **type) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_scope( + /* [retval][out] */ ISchemaComplexType **scope) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_defaultValue( + /* [retval][out] */ BSTR *defaultValue) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fixedValue( + /* [retval][out] */ BSTR *fixedValue) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isNillable( + /* [retval][out] */ VARIANT_BOOL *nillable) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_identityConstraints( + /* [retval][out] */ ISchemaItemCollection **constraints) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_substitutionGroup( + /* [retval][out] */ ISchemaElement **element) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_substitutionGroupExclusions( + /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_disallowedSubstitutions( + /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isAbstract( + /* [retval][out] */ VARIANT_BOOL *abstract) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isReference( + /* [retval][out] */ VARIANT_BOOL *reference) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaElementVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaElement * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaElement * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaElement * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaElement * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaElement * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaElement * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaElement * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaElement * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaElement * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaElement * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaElement * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaElement * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaElement * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaElement * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( + ISchemaElement * This, + /* [retval][out] */ VARIANT *minOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( + ISchemaElement * This, + /* [retval][out] */ VARIANT *maxOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_type )( + ISchemaElement * This, + /* [retval][out] */ ISchemaType **type); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_scope )( + ISchemaElement * This, + /* [retval][out] */ ISchemaComplexType **scope); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_defaultValue )( + ISchemaElement * This, + /* [retval][out] */ BSTR *defaultValue); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fixedValue )( + ISchemaElement * This, + /* [retval][out] */ BSTR *fixedValue); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isNillable )( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *nillable); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_identityConstraints )( + ISchemaElement * This, + /* [retval][out] */ ISchemaItemCollection **constraints); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_substitutionGroup )( + ISchemaElement * This, + /* [retval][out] */ ISchemaElement **element); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_substitutionGroupExclusions )( + ISchemaElement * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_disallowedSubstitutions )( + ISchemaElement * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isAbstract )( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *abstract); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isReference )( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *reference); + + END_INTERFACE + } ISchemaElementVtbl; + + interface ISchemaElement + { + CONST_VTBL struct ISchemaElementVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaElement_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaElement_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaElement_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaElement_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaElement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaElement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaElement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaElement_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaElement_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaElement_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaElement_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaElement_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaElement_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaElement_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaElement_get_minOccurs(This,minOccurs) \ + (This)->lpVtbl -> get_minOccurs(This,minOccurs) + +#define ISchemaElement_get_maxOccurs(This,maxOccurs) \ + (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) + + +#define ISchemaElement_get_type(This,type) \ + (This)->lpVtbl -> get_type(This,type) + +#define ISchemaElement_get_scope(This,scope) \ + (This)->lpVtbl -> get_scope(This,scope) + +#define ISchemaElement_get_defaultValue(This,defaultValue) \ + (This)->lpVtbl -> get_defaultValue(This,defaultValue) + +#define ISchemaElement_get_fixedValue(This,fixedValue) \ + (This)->lpVtbl -> get_fixedValue(This,fixedValue) + +#define ISchemaElement_get_isNillable(This,nillable) \ + (This)->lpVtbl -> get_isNillable(This,nillable) + +#define ISchemaElement_get_identityConstraints(This,constraints) \ + (This)->lpVtbl -> get_identityConstraints(This,constraints) + +#define ISchemaElement_get_substitutionGroup(This,element) \ + (This)->lpVtbl -> get_substitutionGroup(This,element) + +#define ISchemaElement_get_substitutionGroupExclusions(This,exclusions) \ + (This)->lpVtbl -> get_substitutionGroupExclusions(This,exclusions) + +#define ISchemaElement_get_disallowedSubstitutions(This,disallowed) \ + (This)->lpVtbl -> get_disallowedSubstitutions(This,disallowed) + +#define ISchemaElement_get_isAbstract(This,abstract) \ + (This)->lpVtbl -> get_isAbstract(This,abstract) + +#define ISchemaElement_get_isReference(This,reference) \ + (This)->lpVtbl -> get_isReference(This,reference) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_type_Proxy( + ISchemaElement * This, + /* [retval][out] */ ISchemaType **type); + + +void __RPC_STUB ISchemaElement_get_type_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_scope_Proxy( + ISchemaElement * This, + /* [retval][out] */ ISchemaComplexType **scope); + + +void __RPC_STUB ISchemaElement_get_scope_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_defaultValue_Proxy( + ISchemaElement * This, + /* [retval][out] */ BSTR *defaultValue); + + +void __RPC_STUB ISchemaElement_get_defaultValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_fixedValue_Proxy( + ISchemaElement * This, + /* [retval][out] */ BSTR *fixedValue); + + +void __RPC_STUB ISchemaElement_get_fixedValue_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isNillable_Proxy( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *nillable); + + +void __RPC_STUB ISchemaElement_get_isNillable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_identityConstraints_Proxy( + ISchemaElement * This, + /* [retval][out] */ ISchemaItemCollection **constraints); + + +void __RPC_STUB ISchemaElement_get_identityConstraints_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_substitutionGroup_Proxy( + ISchemaElement * This, + /* [retval][out] */ ISchemaElement **element); + + +void __RPC_STUB ISchemaElement_get_substitutionGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_substitutionGroupExclusions_Proxy( + ISchemaElement * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions); + + +void __RPC_STUB ISchemaElement_get_substitutionGroupExclusions_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_disallowedSubstitutions_Proxy( + ISchemaElement * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed); + + +void __RPC_STUB ISchemaElement_get_disallowedSubstitutions_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isAbstract_Proxy( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *abstract); + + +void __RPC_STUB ISchemaElement_get_isAbstract_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isReference_Proxy( + ISchemaElement * This, + /* [retval][out] */ VARIANT_BOOL *reference); + + +void __RPC_STUB ISchemaElement_get_isReference_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaElement_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaType_INTERFACE_DEFINED__ +#define __ISchemaType_INTERFACE_DEFINED__ + +/* interface ISchemaType */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaType; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b8-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaType : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_baseTypes( + /* [retval][out] */ ISchemaItemCollection **baseTypes) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_final( + /* [retval][out] */ SCHEMADERIVATIONMETHOD *final) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_variety( + /* [retval][out] */ SCHEMATYPEVARIETY *variety) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_derivedBy( + /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE isValid( + /* [in] */ BSTR data, + /* [retval][out] */ VARIANT_BOOL *valid) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minExclusive( + /* [retval][out] */ BSTR *minExclusive) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInclusive( + /* [retval][out] */ BSTR *minInclusive) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxExclusive( + /* [retval][out] */ BSTR *maxExclusive) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxInclusive( + /* [retval][out] */ BSTR *maxInclusive) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_totalDigits( + /* [retval][out] */ VARIANT *totalDigits) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fractionDigits( + /* [retval][out] */ VARIANT *fractionDigits) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ VARIANT *length) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minLength( + /* [retval][out] */ VARIANT *minLength) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxLength( + /* [retval][out] */ VARIANT *maxLength) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_enumeration( + /* [retval][out] */ ISchemaStringCollection **enumeration) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_whitespace( + /* [retval][out] */ SCHEMAWHITESPACE *whitespace) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_patterns( + /* [retval][out] */ ISchemaStringCollection **patterns) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaTypeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaType * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaType * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaType * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaType * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaType * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaType * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaType * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaType * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaType * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaType * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaType * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaType * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaType * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaType * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_baseTypes )( + ISchemaType * This, + /* [retval][out] */ ISchemaItemCollection **baseTypes); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_final )( + ISchemaType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_variety )( + ISchemaType * This, + /* [retval][out] */ SCHEMATYPEVARIETY *variety); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_derivedBy )( + ISchemaType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *isValid )( + ISchemaType * This, + /* [in] */ BSTR data, + /* [retval][out] */ VARIANT_BOOL *valid); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minExclusive )( + ISchemaType * This, + /* [retval][out] */ BSTR *minExclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInclusive )( + ISchemaType * This, + /* [retval][out] */ BSTR *minInclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxExclusive )( + ISchemaType * This, + /* [retval][out] */ BSTR *maxExclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxInclusive )( + ISchemaType * This, + /* [retval][out] */ BSTR *maxInclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_totalDigits )( + ISchemaType * This, + /* [retval][out] */ VARIANT *totalDigits); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fractionDigits )( + ISchemaType * This, + /* [retval][out] */ VARIANT *fractionDigits); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + ISchemaType * This, + /* [retval][out] */ VARIANT *length); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minLength )( + ISchemaType * This, + /* [retval][out] */ VARIANT *minLength); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxLength )( + ISchemaType * This, + /* [retval][out] */ VARIANT *maxLength); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_enumeration )( + ISchemaType * This, + /* [retval][out] */ ISchemaStringCollection **enumeration); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_whitespace )( + ISchemaType * This, + /* [retval][out] */ SCHEMAWHITESPACE *whitespace); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_patterns )( + ISchemaType * This, + /* [retval][out] */ ISchemaStringCollection **patterns); + + END_INTERFACE + } ISchemaTypeVtbl; + + interface ISchemaType + { + CONST_VTBL struct ISchemaTypeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaType_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaType_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaType_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaType_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaType_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaType_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaType_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaType_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaType_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaType_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaType_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaType_get_baseTypes(This,baseTypes) \ + (This)->lpVtbl -> get_baseTypes(This,baseTypes) + +#define ISchemaType_get_final(This,final) \ + (This)->lpVtbl -> get_final(This,final) + +#define ISchemaType_get_variety(This,variety) \ + (This)->lpVtbl -> get_variety(This,variety) + +#define ISchemaType_get_derivedBy(This,derivedBy) \ + (This)->lpVtbl -> get_derivedBy(This,derivedBy) + +#define ISchemaType_isValid(This,data,valid) \ + (This)->lpVtbl -> isValid(This,data,valid) + +#define ISchemaType_get_minExclusive(This,minExclusive) \ + (This)->lpVtbl -> get_minExclusive(This,minExclusive) + +#define ISchemaType_get_minInclusive(This,minInclusive) \ + (This)->lpVtbl -> get_minInclusive(This,minInclusive) + +#define ISchemaType_get_maxExclusive(This,maxExclusive) \ + (This)->lpVtbl -> get_maxExclusive(This,maxExclusive) + +#define ISchemaType_get_maxInclusive(This,maxInclusive) \ + (This)->lpVtbl -> get_maxInclusive(This,maxInclusive) + +#define ISchemaType_get_totalDigits(This,totalDigits) \ + (This)->lpVtbl -> get_totalDigits(This,totalDigits) + +#define ISchemaType_get_fractionDigits(This,fractionDigits) \ + (This)->lpVtbl -> get_fractionDigits(This,fractionDigits) + +#define ISchemaType_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define ISchemaType_get_minLength(This,minLength) \ + (This)->lpVtbl -> get_minLength(This,minLength) + +#define ISchemaType_get_maxLength(This,maxLength) \ + (This)->lpVtbl -> get_maxLength(This,maxLength) + +#define ISchemaType_get_enumeration(This,enumeration) \ + (This)->lpVtbl -> get_enumeration(This,enumeration) + +#define ISchemaType_get_whitespace(This,whitespace) \ + (This)->lpVtbl -> get_whitespace(This,whitespace) + +#define ISchemaType_get_patterns(This,patterns) \ + (This)->lpVtbl -> get_patterns(This,patterns) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_baseTypes_Proxy( + ISchemaType * This, + /* [retval][out] */ ISchemaItemCollection **baseTypes); + + +void __RPC_STUB ISchemaType_get_baseTypes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_final_Proxy( + ISchemaType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); + + +void __RPC_STUB ISchemaType_get_final_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_variety_Proxy( + ISchemaType * This, + /* [retval][out] */ SCHEMATYPEVARIETY *variety); + + +void __RPC_STUB ISchemaType_get_variety_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_derivedBy_Proxy( + ISchemaType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); + + +void __RPC_STUB ISchemaType_get_derivedBy_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaType_isValid_Proxy( + ISchemaType * This, + /* [in] */ BSTR data, + /* [retval][out] */ VARIANT_BOOL *valid); + + +void __RPC_STUB ISchemaType_isValid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minExclusive_Proxy( + ISchemaType * This, + /* [retval][out] */ BSTR *minExclusive); + + +void __RPC_STUB ISchemaType_get_minExclusive_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minInclusive_Proxy( + ISchemaType * This, + /* [retval][out] */ BSTR *minInclusive); + + +void __RPC_STUB ISchemaType_get_minInclusive_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxExclusive_Proxy( + ISchemaType * This, + /* [retval][out] */ BSTR *maxExclusive); + + +void __RPC_STUB ISchemaType_get_maxExclusive_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxInclusive_Proxy( + ISchemaType * This, + /* [retval][out] */ BSTR *maxInclusive); + + +void __RPC_STUB ISchemaType_get_maxInclusive_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_totalDigits_Proxy( + ISchemaType * This, + /* [retval][out] */ VARIANT *totalDigits); + + +void __RPC_STUB ISchemaType_get_totalDigits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_fractionDigits_Proxy( + ISchemaType * This, + /* [retval][out] */ VARIANT *fractionDigits); + + +void __RPC_STUB ISchemaType_get_fractionDigits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_length_Proxy( + ISchemaType * This, + /* [retval][out] */ VARIANT *length); + + +void __RPC_STUB ISchemaType_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minLength_Proxy( + ISchemaType * This, + /* [retval][out] */ VARIANT *minLength); + + +void __RPC_STUB ISchemaType_get_minLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxLength_Proxy( + ISchemaType * This, + /* [retval][out] */ VARIANT *maxLength); + + +void __RPC_STUB ISchemaType_get_maxLength_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_enumeration_Proxy( + ISchemaType * This, + /* [retval][out] */ ISchemaStringCollection **enumeration); + + +void __RPC_STUB ISchemaType_get_enumeration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_whitespace_Proxy( + ISchemaType * This, + /* [retval][out] */ SCHEMAWHITESPACE *whitespace); + + +void __RPC_STUB ISchemaType_get_whitespace_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_patterns_Proxy( + ISchemaType * This, + /* [retval][out] */ ISchemaStringCollection **patterns); + + +void __RPC_STUB ISchemaType_get_patterns_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaType_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaComplexType_INTERFACE_DEFINED__ +#define __ISchemaComplexType_INTERFACE_DEFINED__ + +/* interface ISchemaComplexType */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaComplexType; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08b9-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaComplexType : public ISchemaType + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isAbstract( + /* [retval][out] */ VARIANT_BOOL *abstract) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_anyAttribute( + /* [retval][out] */ ISchemaAny **anyAttribute) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( + /* [retval][out] */ ISchemaItemCollection **attributes) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentType( + /* [retval][out] */ SCHEMACONTENTTYPE *contentType) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentModel( + /* [retval][out] */ ISchemaModelGroup **contentModel) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_prohibitedSubstitutions( + /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaComplexTypeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaComplexType * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaComplexType * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaComplexType * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaComplexType * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaComplexType * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaComplexType * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaComplexType * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaComplexType * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaComplexType * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaComplexType * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaComplexType * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_baseTypes )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaItemCollection **baseTypes); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_final )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_variety )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMATYPEVARIETY *variety); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_derivedBy )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *isValid )( + ISchemaComplexType * This, + /* [in] */ BSTR data, + /* [retval][out] */ VARIANT_BOOL *valid); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minExclusive )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *minExclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInclusive )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *minInclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxExclusive )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *maxExclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxInclusive )( + ISchemaComplexType * This, + /* [retval][out] */ BSTR *maxInclusive); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_totalDigits )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT *totalDigits); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fractionDigits )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT *fractionDigits); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT *length); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minLength )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT *minLength); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxLength )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT *maxLength); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_enumeration )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaStringCollection **enumeration); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_whitespace )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMAWHITESPACE *whitespace); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_patterns )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaStringCollection **patterns); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isAbstract )( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT_BOOL *abstract); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_anyAttribute )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaAny **anyAttribute); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentType )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMACONTENTTYPE *contentType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentModel )( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaModelGroup **contentModel); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_prohibitedSubstitutions )( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited); + + END_INTERFACE + } ISchemaComplexTypeVtbl; + + interface ISchemaComplexType + { + CONST_VTBL struct ISchemaComplexTypeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaComplexType_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaComplexType_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaComplexType_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaComplexType_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaComplexType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaComplexType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaComplexType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaComplexType_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaComplexType_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaComplexType_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaComplexType_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaComplexType_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaComplexType_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaComplexType_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaComplexType_get_baseTypes(This,baseTypes) \ + (This)->lpVtbl -> get_baseTypes(This,baseTypes) + +#define ISchemaComplexType_get_final(This,final) \ + (This)->lpVtbl -> get_final(This,final) + +#define ISchemaComplexType_get_variety(This,variety) \ + (This)->lpVtbl -> get_variety(This,variety) + +#define ISchemaComplexType_get_derivedBy(This,derivedBy) \ + (This)->lpVtbl -> get_derivedBy(This,derivedBy) + +#define ISchemaComplexType_isValid(This,data,valid) \ + (This)->lpVtbl -> isValid(This,data,valid) + +#define ISchemaComplexType_get_minExclusive(This,minExclusive) \ + (This)->lpVtbl -> get_minExclusive(This,minExclusive) + +#define ISchemaComplexType_get_minInclusive(This,minInclusive) \ + (This)->lpVtbl -> get_minInclusive(This,minInclusive) + +#define ISchemaComplexType_get_maxExclusive(This,maxExclusive) \ + (This)->lpVtbl -> get_maxExclusive(This,maxExclusive) + +#define ISchemaComplexType_get_maxInclusive(This,maxInclusive) \ + (This)->lpVtbl -> get_maxInclusive(This,maxInclusive) + +#define ISchemaComplexType_get_totalDigits(This,totalDigits) \ + (This)->lpVtbl -> get_totalDigits(This,totalDigits) + +#define ISchemaComplexType_get_fractionDigits(This,fractionDigits) \ + (This)->lpVtbl -> get_fractionDigits(This,fractionDigits) + +#define ISchemaComplexType_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define ISchemaComplexType_get_minLength(This,minLength) \ + (This)->lpVtbl -> get_minLength(This,minLength) + +#define ISchemaComplexType_get_maxLength(This,maxLength) \ + (This)->lpVtbl -> get_maxLength(This,maxLength) + +#define ISchemaComplexType_get_enumeration(This,enumeration) \ + (This)->lpVtbl -> get_enumeration(This,enumeration) + +#define ISchemaComplexType_get_whitespace(This,whitespace) \ + (This)->lpVtbl -> get_whitespace(This,whitespace) + +#define ISchemaComplexType_get_patterns(This,patterns) \ + (This)->lpVtbl -> get_patterns(This,patterns) + + +#define ISchemaComplexType_get_isAbstract(This,abstract) \ + (This)->lpVtbl -> get_isAbstract(This,abstract) + +#define ISchemaComplexType_get_anyAttribute(This,anyAttribute) \ + (This)->lpVtbl -> get_anyAttribute(This,anyAttribute) + +#define ISchemaComplexType_get_attributes(This,attributes) \ + (This)->lpVtbl -> get_attributes(This,attributes) + +#define ISchemaComplexType_get_contentType(This,contentType) \ + (This)->lpVtbl -> get_contentType(This,contentType) + +#define ISchemaComplexType_get_contentModel(This,contentModel) \ + (This)->lpVtbl -> get_contentModel(This,contentModel) + +#define ISchemaComplexType_get_prohibitedSubstitutions(This,prohibited) \ + (This)->lpVtbl -> get_prohibitedSubstitutions(This,prohibited) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_isAbstract_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ VARIANT_BOOL *abstract); + + +void __RPC_STUB ISchemaComplexType_get_isAbstract_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_anyAttribute_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaAny **anyAttribute); + + +void __RPC_STUB ISchemaComplexType_get_anyAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_attributes_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + +void __RPC_STUB ISchemaComplexType_get_attributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_contentType_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMACONTENTTYPE *contentType); + + +void __RPC_STUB ISchemaComplexType_get_contentType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_contentModel_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ ISchemaModelGroup **contentModel); + + +void __RPC_STUB ISchemaComplexType_get_contentModel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_prohibitedSubstitutions_Proxy( + ISchemaComplexType * This, + /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited); + + +void __RPC_STUB ISchemaComplexType_get_prohibitedSubstitutions_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaComplexType_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaAttributeGroup_INTERFACE_DEFINED__ +#define __ISchemaAttributeGroup_INTERFACE_DEFINED__ + +/* interface ISchemaAttributeGroup */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaAttributeGroup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08ba-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaAttributeGroup : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_anyAttribute( + /* [retval][out] */ ISchemaAny **anyAttribute) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( + /* [retval][out] */ ISchemaItemCollection **attributes) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaAttributeGroupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaAttributeGroup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaAttributeGroup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaAttributeGroup * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaAttributeGroup * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaAttributeGroup * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaAttributeGroup * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaAttributeGroup * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaAttributeGroup * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaAttributeGroup * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaAttributeGroup * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaAttributeGroup * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaAttributeGroup * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaAttributeGroup * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaAttributeGroup * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_anyAttribute )( + ISchemaAttributeGroup * This, + /* [retval][out] */ ISchemaAny **anyAttribute); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( + ISchemaAttributeGroup * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + END_INTERFACE + } ISchemaAttributeGroupVtbl; + + interface ISchemaAttributeGroup + { + CONST_VTBL struct ISchemaAttributeGroupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaAttributeGroup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaAttributeGroup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaAttributeGroup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaAttributeGroup_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaAttributeGroup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaAttributeGroup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaAttributeGroup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaAttributeGroup_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaAttributeGroup_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaAttributeGroup_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaAttributeGroup_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaAttributeGroup_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaAttributeGroup_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaAttributeGroup_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaAttributeGroup_get_anyAttribute(This,anyAttribute) \ + (This)->lpVtbl -> get_anyAttribute(This,anyAttribute) + +#define ISchemaAttributeGroup_get_attributes(This,attributes) \ + (This)->lpVtbl -> get_attributes(This,attributes) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttributeGroup_get_anyAttribute_Proxy( + ISchemaAttributeGroup * This, + /* [retval][out] */ ISchemaAny **anyAttribute); + + +void __RPC_STUB ISchemaAttributeGroup_get_anyAttribute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttributeGroup_get_attributes_Proxy( + ISchemaAttributeGroup * This, + /* [retval][out] */ ISchemaItemCollection **attributes); + + +void __RPC_STUB ISchemaAttributeGroup_get_attributes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaAttributeGroup_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaModelGroup_INTERFACE_DEFINED__ +#define __ISchemaModelGroup_INTERFACE_DEFINED__ + +/* interface ISchemaModelGroup */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaModelGroup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08bb-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaModelGroup : public ISchemaParticle + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_particles( + /* [retval][out] */ ISchemaItemCollection **particles) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaModelGroupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaModelGroup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaModelGroup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaModelGroup * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaModelGroup * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaModelGroup * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaModelGroup * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaModelGroup * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaModelGroup * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaModelGroup * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaModelGroup * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaModelGroup * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaModelGroup * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaModelGroup * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaModelGroup * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( + ISchemaModelGroup * This, + /* [retval][out] */ VARIANT *minOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( + ISchemaModelGroup * This, + /* [retval][out] */ VARIANT *maxOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_particles )( + ISchemaModelGroup * This, + /* [retval][out] */ ISchemaItemCollection **particles); + + END_INTERFACE + } ISchemaModelGroupVtbl; + + interface ISchemaModelGroup + { + CONST_VTBL struct ISchemaModelGroupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaModelGroup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaModelGroup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaModelGroup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaModelGroup_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaModelGroup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaModelGroup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaModelGroup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaModelGroup_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaModelGroup_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaModelGroup_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaModelGroup_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaModelGroup_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaModelGroup_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaModelGroup_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaModelGroup_get_minOccurs(This,minOccurs) \ + (This)->lpVtbl -> get_minOccurs(This,minOccurs) + +#define ISchemaModelGroup_get_maxOccurs(This,maxOccurs) \ + (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) + + +#define ISchemaModelGroup_get_particles(This,particles) \ + (This)->lpVtbl -> get_particles(This,particles) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaModelGroup_get_particles_Proxy( + ISchemaModelGroup * This, + /* [retval][out] */ ISchemaItemCollection **particles); + + +void __RPC_STUB ISchemaModelGroup_get_particles_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaModelGroup_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaAny_INTERFACE_DEFINED__ +#define __ISchemaAny_INTERFACE_DEFINED__ + +/* interface ISchemaAny */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaAny; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08bc-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaAny : public ISchemaParticle + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_namespaces( + /* [retval][out] */ ISchemaStringCollection **namespaces) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_processContents( + /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaAnyVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaAny * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaAny * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaAny * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaAny * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaAny * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaAny * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaAny * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaAny * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaAny * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaAny * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaAny * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaAny * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaAny * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaAny * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( + ISchemaAny * This, + /* [retval][out] */ VARIANT *minOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( + ISchemaAny * This, + /* [retval][out] */ VARIANT *maxOccurs); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( + ISchemaAny * This, + /* [retval][out] */ ISchemaStringCollection **namespaces); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_processContents )( + ISchemaAny * This, + /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents); + + END_INTERFACE + } ISchemaAnyVtbl; + + interface ISchemaAny + { + CONST_VTBL struct ISchemaAnyVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaAny_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaAny_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaAny_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaAny_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaAny_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaAny_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaAny_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaAny_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaAny_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaAny_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaAny_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaAny_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaAny_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaAny_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaAny_get_minOccurs(This,minOccurs) \ + (This)->lpVtbl -> get_minOccurs(This,minOccurs) + +#define ISchemaAny_get_maxOccurs(This,maxOccurs) \ + (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) + + +#define ISchemaAny_get_namespaces(This,namespaces) \ + (This)->lpVtbl -> get_namespaces(This,namespaces) + +#define ISchemaAny_get_processContents(This,processContents) \ + (This)->lpVtbl -> get_processContents(This,processContents) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAny_get_namespaces_Proxy( + ISchemaAny * This, + /* [retval][out] */ ISchemaStringCollection **namespaces); + + +void __RPC_STUB ISchemaAny_get_namespaces_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAny_get_processContents_Proxy( + ISchemaAny * This, + /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents); + + +void __RPC_STUB ISchemaAny_get_processContents_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaAny_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaIdentityConstraint_INTERFACE_DEFINED__ +#define __ISchemaIdentityConstraint_INTERFACE_DEFINED__ + +/* interface ISchemaIdentityConstraint */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaIdentityConstraint; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08bd-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaIdentityConstraint : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_selector( + /* [retval][out] */ BSTR *selector) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fields( + /* [retval][out] */ ISchemaStringCollection **fields) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_referencedKey( + /* [retval][out] */ ISchemaIdentityConstraint **key) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaIdentityConstraintVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaIdentityConstraint * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaIdentityConstraint * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaIdentityConstraint * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaIdentityConstraint * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaIdentityConstraint * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaIdentityConstraint * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaIdentityConstraint * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaIdentityConstraint * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_selector )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ BSTR *selector); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fields )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ ISchemaStringCollection **fields); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_referencedKey )( + ISchemaIdentityConstraint * This, + /* [retval][out] */ ISchemaIdentityConstraint **key); + + END_INTERFACE + } ISchemaIdentityConstraintVtbl; + + interface ISchemaIdentityConstraint + { + CONST_VTBL struct ISchemaIdentityConstraintVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaIdentityConstraint_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaIdentityConstraint_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaIdentityConstraint_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaIdentityConstraint_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaIdentityConstraint_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaIdentityConstraint_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaIdentityConstraint_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaIdentityConstraint_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaIdentityConstraint_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaIdentityConstraint_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaIdentityConstraint_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaIdentityConstraint_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaIdentityConstraint_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaIdentityConstraint_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaIdentityConstraint_get_selector(This,selector) \ + (This)->lpVtbl -> get_selector(This,selector) + +#define ISchemaIdentityConstraint_get_fields(This,fields) \ + (This)->lpVtbl -> get_fields(This,fields) + +#define ISchemaIdentityConstraint_get_referencedKey(This,key) \ + (This)->lpVtbl -> get_referencedKey(This,key) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_selector_Proxy( + ISchemaIdentityConstraint * This, + /* [retval][out] */ BSTR *selector); + + +void __RPC_STUB ISchemaIdentityConstraint_get_selector_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_fields_Proxy( + ISchemaIdentityConstraint * This, + /* [retval][out] */ ISchemaStringCollection **fields); + + +void __RPC_STUB ISchemaIdentityConstraint_get_fields_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_referencedKey_Proxy( + ISchemaIdentityConstraint * This, + /* [retval][out] */ ISchemaIdentityConstraint **key); + + +void __RPC_STUB ISchemaIdentityConstraint_get_referencedKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaIdentityConstraint_INTERFACE_DEFINED__ */ + + +#ifndef __ISchemaNotation_INTERFACE_DEFINED__ +#define __ISchemaNotation_INTERFACE_DEFINED__ + +/* interface ISchemaNotation */ +/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_ISchemaNotation; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("50ea08be-dd1b-4664-9a50-c2f40f4bd79a") + ISchemaNotation : public ISchemaItem + { + public: + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_systemIdentifier( + /* [retval][out] */ BSTR *uri) = 0; + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_publicIdentifier( + /* [retval][out] */ BSTR *uri) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISchemaNotationVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISchemaNotation * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISchemaNotation * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISchemaNotation * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISchemaNotation * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISchemaNotation * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISchemaNotation * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISchemaNotation * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( + ISchemaNotation * This, + /* [retval][out] */ BSTR *name); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( + ISchemaNotation * This, + /* [retval][out] */ BSTR *namespaceURI); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( + ISchemaNotation * This, + /* [retval][out] */ ISchema **schema); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( + ISchemaNotation * This, + /* [retval][out] */ BSTR *id); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( + ISchemaNotation * This, + /* [retval][out] */ SOMITEMTYPE *itemType); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( + ISchemaNotation * This, + /* [retval][out] */ IVBSAXAttributes **attributes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( + ISchemaNotation * This, + /* [in] */ IUnknown *annotationSink, + /* [retval][out] */ VARIANT_BOOL *isWritten); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_systemIdentifier )( + ISchemaNotation * This, + /* [retval][out] */ BSTR *uri); + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_publicIdentifier )( + ISchemaNotation * This, + /* [retval][out] */ BSTR *uri); + + END_INTERFACE + } ISchemaNotationVtbl; + + interface ISchemaNotation + { + CONST_VTBL struct ISchemaNotationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISchemaNotation_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISchemaNotation_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISchemaNotation_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISchemaNotation_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISchemaNotation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISchemaNotation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISchemaNotation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISchemaNotation_get_name(This,name) \ + (This)->lpVtbl -> get_name(This,name) + +#define ISchemaNotation_get_namespaceURI(This,namespaceURI) \ + (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) + +#define ISchemaNotation_get_schema(This,schema) \ + (This)->lpVtbl -> get_schema(This,schema) + +#define ISchemaNotation_get_id(This,id) \ + (This)->lpVtbl -> get_id(This,id) + +#define ISchemaNotation_get_itemType(This,itemType) \ + (This)->lpVtbl -> get_itemType(This,itemType) + +#define ISchemaNotation_get_unhandledAttributes(This,attributes) \ + (This)->lpVtbl -> get_unhandledAttributes(This,attributes) + +#define ISchemaNotation_writeAnnotation(This,annotationSink,isWritten) \ + (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) + + +#define ISchemaNotation_get_systemIdentifier(This,uri) \ + (This)->lpVtbl -> get_systemIdentifier(This,uri) + +#define ISchemaNotation_get_publicIdentifier(This,uri) \ + (This)->lpVtbl -> get_publicIdentifier(This,uri) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaNotation_get_systemIdentifier_Proxy( + ISchemaNotation * This, + /* [retval][out] */ BSTR *uri); + + +void __RPC_STUB ISchemaNotation_get_systemIdentifier_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaNotation_get_publicIdentifier_Proxy( + ISchemaNotation * This, + /* [retval][out] */ BSTR *uri); + + +void __RPC_STUB ISchemaNotation_get_publicIdentifier_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISchemaNotation_INTERFACE_DEFINED__ */ + + +#ifndef __IXMLDOMSelection_INTERFACE_DEFINED__ +#define __IXMLDOMSelection_INTERFACE_DEFINED__ + +/* interface IXMLDOMSelection */ +/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ + + +EXTERN_C const IID IID_IXMLDOMSelection; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AA634FC7-5888-44a7-A257-3A47150D3A0E") + IXMLDOMSelection : public IXMLDOMNodeList + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_expr( + /* [retval][out] */ BSTR *expression) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_expr( + /* [in] */ BSTR expression) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_context( + /* [retval][out] */ IXMLDOMNode **ppNode) = 0; + + virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_context( + /* [in] */ IXMLDOMNode *pNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE peekNode( + /* [retval][out] */ IXMLDOMNode **ppNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE matches( + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ IXMLDOMNode **ppNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeNext( + /* [retval][out] */ IXMLDOMNode **ppNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAll( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE clone( + /* [retval][out] */ IXMLDOMSelection **ppNode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProperty( + /* [in] */ BSTR name, + /* [in] */ VARIANT value) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLDOMSelectionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLDOMSelection * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLDOMSelection * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLDOMSelection * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLDOMSelection * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLDOMSelection * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLDOMSelection * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLDOMSelection * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + IXMLDOMSelection * This, + /* [in] */ long index, + /* [retval][out] */ IXMLDOMNode **listItem); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IXMLDOMSelection * This, + /* [retval][out] */ long *listLength); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **nextItem); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IXMLDOMSelection * This); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IXMLDOMSelection * This, + /* [out][retval] */ IUnknown **ppUnk); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_expr )( + IXMLDOMSelection * This, + /* [retval][out] */ BSTR *expression); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_expr )( + IXMLDOMSelection * This, + /* [in] */ BSTR expression); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_context )( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_context )( + IXMLDOMSelection * This, + /* [in] */ IXMLDOMNode *pNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *peekNode )( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *matches )( + IXMLDOMSelection * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ IXMLDOMNode **ppNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeNext )( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAll )( + IXMLDOMSelection * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *clone )( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMSelection **ppNode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( + IXMLDOMSelection * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( + IXMLDOMSelection * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + END_INTERFACE + } IXMLDOMSelectionVtbl; + + interface IXMLDOMSelection + { + CONST_VTBL struct IXMLDOMSelectionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLDOMSelection_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLDOMSelection_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLDOMSelection_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLDOMSelection_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLDOMSelection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLDOMSelection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLDOMSelection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLDOMSelection_get_item(This,index,listItem) \ + (This)->lpVtbl -> get_item(This,index,listItem) + +#define IXMLDOMSelection_get_length(This,listLength) \ + (This)->lpVtbl -> get_length(This,listLength) + +#define IXMLDOMSelection_nextNode(This,nextItem) \ + (This)->lpVtbl -> nextNode(This,nextItem) + +#define IXMLDOMSelection_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IXMLDOMSelection_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + + +#define IXMLDOMSelection_get_expr(This,expression) \ + (This)->lpVtbl -> get_expr(This,expression) + +#define IXMLDOMSelection_put_expr(This,expression) \ + (This)->lpVtbl -> put_expr(This,expression) + +#define IXMLDOMSelection_get_context(This,ppNode) \ + (This)->lpVtbl -> get_context(This,ppNode) + +#define IXMLDOMSelection_putref_context(This,pNode) \ + (This)->lpVtbl -> putref_context(This,pNode) + +#define IXMLDOMSelection_peekNode(This,ppNode) \ + (This)->lpVtbl -> peekNode(This,ppNode) + +#define IXMLDOMSelection_matches(This,pNode,ppNode) \ + (This)->lpVtbl -> matches(This,pNode,ppNode) + +#define IXMLDOMSelection_removeNext(This,ppNode) \ + (This)->lpVtbl -> removeNext(This,ppNode) + +#define IXMLDOMSelection_removeAll(This) \ + (This)->lpVtbl -> removeAll(This) + +#define IXMLDOMSelection_clone(This,ppNode) \ + (This)->lpVtbl -> clone(This,ppNode) + +#define IXMLDOMSelection_getProperty(This,name,value) \ + (This)->lpVtbl -> getProperty(This,name,value) + +#define IXMLDOMSelection_setProperty(This,name,value) \ + (This)->lpVtbl -> setProperty(This,name,value) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_get_expr_Proxy( + IXMLDOMSelection * This, + /* [retval][out] */ BSTR *expression); + + +void __RPC_STUB IXMLDOMSelection_get_expr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_put_expr_Proxy( + IXMLDOMSelection * This, + /* [in] */ BSTR expression); + + +void __RPC_STUB IXMLDOMSelection_put_expr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_get_context_Proxy( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + +void __RPC_STUB IXMLDOMSelection_get_context_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_putref_context_Proxy( + IXMLDOMSelection * This, + /* [in] */ IXMLDOMNode *pNode); + + +void __RPC_STUB IXMLDOMSelection_putref_context_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_peekNode_Proxy( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + +void __RPC_STUB IXMLDOMSelection_peekNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_matches_Proxy( + IXMLDOMSelection * This, + /* [in] */ IXMLDOMNode *pNode, + /* [retval][out] */ IXMLDOMNode **ppNode); + + +void __RPC_STUB IXMLDOMSelection_matches_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_removeNext_Proxy( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMNode **ppNode); + + +void __RPC_STUB IXMLDOMSelection_removeNext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_removeAll_Proxy( + IXMLDOMSelection * This); + + +void __RPC_STUB IXMLDOMSelection_removeAll_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_clone_Proxy( + IXMLDOMSelection * This, + /* [retval][out] */ IXMLDOMSelection **ppNode); + + +void __RPC_STUB IXMLDOMSelection_clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_getProperty_Proxy( + IXMLDOMSelection * This, + /* [in] */ BSTR name, + /* [retval][out] */ VARIANT *value); + + +void __RPC_STUB IXMLDOMSelection_getProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_setProperty_Proxy( + IXMLDOMSelection * This, + /* [in] */ BSTR name, + /* [in] */ VARIANT value); + + +void __RPC_STUB IXMLDOMSelection_setProperty_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLDOMSelection_INTERFACE_DEFINED__ */ + + +#ifndef __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ +#define __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ + +/* dispinterface XMLDOMDocumentEvents */ +/* [uuid][hidden] */ + + +EXTERN_C const IID DIID_XMLDOMDocumentEvents; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3efaa427-272f-11d2-836f-0000f87a7782") + XMLDOMDocumentEvents : public IDispatch + { + }; + +#else /* C style interface */ + + typedef struct XMLDOMDocumentEventsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + XMLDOMDocumentEvents * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + XMLDOMDocumentEvents * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + XMLDOMDocumentEvents * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + XMLDOMDocumentEvents * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + XMLDOMDocumentEvents * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + XMLDOMDocumentEvents * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + XMLDOMDocumentEvents * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + END_INTERFACE + } XMLDOMDocumentEventsVtbl; + + interface XMLDOMDocumentEvents + { + CONST_VTBL struct XMLDOMDocumentEventsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define XMLDOMDocumentEvents_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define XMLDOMDocumentEvents_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define XMLDOMDocumentEvents_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define XMLDOMDocumentEvents_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define XMLDOMDocumentEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define XMLDOMDocumentEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define XMLDOMDocumentEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + +#endif /* __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ */ + + +#ifndef __IXMLHTTPRequest_INTERFACE_DEFINED__ +#define __IXMLHTTPRequest_INTERFACE_DEFINED__ + +/* interface IXMLHTTPRequest */ +/* [unique][helpstring][oleautomation][dual][uuid][object] */ + + +EXTERN_C const IID IID_IXMLHTTPRequest; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ED8C108D-4349-11D2-91A4-00C04F7969E8") + IXMLHTTPRequest : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE open( + /* [in] */ BSTR bstrMethod, + /* [in] */ BSTR bstrUrl, + /* [optional][in] */ VARIANT varAsync, + /* [optional][in] */ VARIANT bstrUser, + /* [optional][in] */ VARIANT bstrPassword) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setRequestHeader( + /* [in] */ BSTR bstrHeader, + /* [in] */ BSTR bstrValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getResponseHeader( + /* [in] */ BSTR bstrHeader, + /* [retval][out] */ BSTR *pbstrValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAllResponseHeaders( + /* [retval][out] */ BSTR *pbstrHeaders) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE send( + /* [optional][in] */ VARIANT varBody) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_status( + /* [retval][out] */ long *plStatus) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_statusText( + /* [retval][out] */ BSTR *pbstrStatus) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseXML( + /* [retval][out] */ IDispatch **ppBody) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseText( + /* [retval][out] */ BSTR *pbstrBody) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseBody( + /* [retval][out] */ VARIANT *pvarBody) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseStream( + /* [retval][out] */ VARIANT *pvarBody) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( + /* [retval][out] */ long *plState) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_onreadystatechange( + /* [in] */ IDispatch *pReadyStateSink) = 0; + + }; + +#else /* C style interface */ + + typedef struct IXMLHTTPRequestVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IXMLHTTPRequest * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IXMLHTTPRequest * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IXMLHTTPRequest * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IXMLHTTPRequest * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IXMLHTTPRequest * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IXMLHTTPRequest * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IXMLHTTPRequest * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrMethod, + /* [in] */ BSTR bstrUrl, + /* [optional][in] */ VARIANT varAsync, + /* [optional][in] */ VARIANT bstrUser, + /* [optional][in] */ VARIANT bstrPassword); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [in] */ BSTR bstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [retval][out] */ BSTR *pbstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrHeaders); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( + IXMLHTTPRequest * This, + /* [optional][in] */ VARIANT varBody); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IXMLHTTPRequest * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( + IXMLHTTPRequest * This, + /* [retval][out] */ long *plStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( + IXMLHTTPRequest * This, + /* [retval][out] */ IDispatch **ppBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( + IXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( + IXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IXMLHTTPRequest * This, + /* [retval][out] */ long *plState); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IXMLHTTPRequest * This, + /* [in] */ IDispatch *pReadyStateSink); + + END_INTERFACE + } IXMLHTTPRequestVtbl; + + interface IXMLHTTPRequest + { + CONST_VTBL struct IXMLHTTPRequestVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IXMLHTTPRequest_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IXMLHTTPRequest_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IXMLHTTPRequest_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IXMLHTTPRequest_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IXMLHTTPRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IXMLHTTPRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IXMLHTTPRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IXMLHTTPRequest_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ + (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) + +#define IXMLHTTPRequest_setRequestHeader(This,bstrHeader,bstrValue) \ + (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) + +#define IXMLHTTPRequest_getResponseHeader(This,bstrHeader,pbstrValue) \ + (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) + +#define IXMLHTTPRequest_getAllResponseHeaders(This,pbstrHeaders) \ + (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) + +#define IXMLHTTPRequest_send(This,varBody) \ + (This)->lpVtbl -> send(This,varBody) + +#define IXMLHTTPRequest_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IXMLHTTPRequest_get_status(This,plStatus) \ + (This)->lpVtbl -> get_status(This,plStatus) + +#define IXMLHTTPRequest_get_statusText(This,pbstrStatus) \ + (This)->lpVtbl -> get_statusText(This,pbstrStatus) + +#define IXMLHTTPRequest_get_responseXML(This,ppBody) \ + (This)->lpVtbl -> get_responseXML(This,ppBody) + +#define IXMLHTTPRequest_get_responseText(This,pbstrBody) \ + (This)->lpVtbl -> get_responseText(This,pbstrBody) + +#define IXMLHTTPRequest_get_responseBody(This,pvarBody) \ + (This)->lpVtbl -> get_responseBody(This,pvarBody) + +#define IXMLHTTPRequest_get_responseStream(This,pvarBody) \ + (This)->lpVtbl -> get_responseStream(This,pvarBody) + +#define IXMLHTTPRequest_get_readyState(This,plState) \ + (This)->lpVtbl -> get_readyState(This,plState) + +#define IXMLHTTPRequest_put_onreadystatechange(This,pReadyStateSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_open_Proxy( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrMethod, + /* [in] */ BSTR bstrUrl, + /* [optional][in] */ VARIANT varAsync, + /* [optional][in] */ VARIANT bstrUser, + /* [optional][in] */ VARIANT bstrPassword); + + +void __RPC_STUB IXMLHTTPRequest_open_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_setRequestHeader_Proxy( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [in] */ BSTR bstrValue); + + +void __RPC_STUB IXMLHTTPRequest_setRequestHeader_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_getResponseHeader_Proxy( + IXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [retval][out] */ BSTR *pbstrValue); + + +void __RPC_STUB IXMLHTTPRequest_getResponseHeader_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_getAllResponseHeaders_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrHeaders); + + +void __RPC_STUB IXMLHTTPRequest_getAllResponseHeaders_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_send_Proxy( + IXMLHTTPRequest * This, + /* [optional][in] */ VARIANT varBody); + + +void __RPC_STUB IXMLHTTPRequest_send_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_abort_Proxy( + IXMLHTTPRequest * This); + + +void __RPC_STUB IXMLHTTPRequest_abort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_status_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ long *plStatus); + + +void __RPC_STUB IXMLHTTPRequest_get_status_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_statusText_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrStatus); + + +void __RPC_STUB IXMLHTTPRequest_get_statusText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseXML_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ IDispatch **ppBody); + + +void __RPC_STUB IXMLHTTPRequest_get_responseXML_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseText_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrBody); + + +void __RPC_STUB IXMLHTTPRequest_get_responseText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseBody_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + +void __RPC_STUB IXMLHTTPRequest_get_responseBody_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseStream_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + +void __RPC_STUB IXMLHTTPRequest_get_responseStream_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_readyState_Proxy( + IXMLHTTPRequest * This, + /* [retval][out] */ long *plState); + + +void __RPC_STUB IXMLHTTPRequest_get_readyState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_put_onreadystatechange_Proxy( + IXMLHTTPRequest * This, + /* [in] */ IDispatch *pReadyStateSink); + + +void __RPC_STUB IXMLHTTPRequest_put_onreadystatechange_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IXMLHTTPRequest_INTERFACE_DEFINED__ */ + + +#ifndef __IServerXMLHTTPRequest_INTERFACE_DEFINED__ +#define __IServerXMLHTTPRequest_INTERFACE_DEFINED__ + +/* interface IServerXMLHTTPRequest */ +/* [unique][helpstring][oleautomation][dual][uuid][object] */ + + +EXTERN_C const IID IID_IServerXMLHTTPRequest; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2e9196bf-13ba-4dd4-91ca-6c571f281495") + IServerXMLHTTPRequest : public IXMLHTTPRequest + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setTimeouts( + /* [in] */ long resolveTimeout, + /* [in] */ long connectTimeout, + /* [in] */ long sendTimeout, + /* [in] */ long receiveTimeout) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE waitForResponse( + /* [optional][in] */ VARIANT timeoutInSeconds, + /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getOption( + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [retval][out] */ VARIANT *value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setOption( + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [in] */ VARIANT value) = 0; + + }; + +#else /* C style interface */ + + typedef struct IServerXMLHTTPRequestVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IServerXMLHTTPRequest * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IServerXMLHTTPRequest * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IServerXMLHTTPRequest * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IServerXMLHTTPRequest * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IServerXMLHTTPRequest * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IServerXMLHTTPRequest * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IServerXMLHTTPRequest * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( + IServerXMLHTTPRequest * This, + /* [in] */ BSTR bstrMethod, + /* [in] */ BSTR bstrUrl, + /* [optional][in] */ VARIANT varAsync, + /* [optional][in] */ VARIANT bstrUser, + /* [optional][in] */ VARIANT bstrPassword); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( + IServerXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [in] */ BSTR bstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( + IServerXMLHTTPRequest * This, + /* [in] */ BSTR bstrHeader, + /* [retval][out] */ BSTR *pbstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrHeaders); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( + IServerXMLHTTPRequest * This, + /* [optional][in] */ VARIANT varBody); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IServerXMLHTTPRequest * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ long *plStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ IDispatch **ppBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ BSTR *pbstrBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IServerXMLHTTPRequest * This, + /* [retval][out] */ long *plState); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IServerXMLHTTPRequest * This, + /* [in] */ IDispatch *pReadyStateSink); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setTimeouts )( + IServerXMLHTTPRequest * This, + /* [in] */ long resolveTimeout, + /* [in] */ long connectTimeout, + /* [in] */ long sendTimeout, + /* [in] */ long receiveTimeout); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *waitForResponse )( + IServerXMLHTTPRequest * This, + /* [optional][in] */ VARIANT timeoutInSeconds, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getOption )( + IServerXMLHTTPRequest * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setOption )( + IServerXMLHTTPRequest * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [in] */ VARIANT value); + + END_INTERFACE + } IServerXMLHTTPRequestVtbl; + + interface IServerXMLHTTPRequest + { + CONST_VTBL struct IServerXMLHTTPRequestVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IServerXMLHTTPRequest_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IServerXMLHTTPRequest_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IServerXMLHTTPRequest_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IServerXMLHTTPRequest_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IServerXMLHTTPRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IServerXMLHTTPRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IServerXMLHTTPRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IServerXMLHTTPRequest_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ + (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) + +#define IServerXMLHTTPRequest_setRequestHeader(This,bstrHeader,bstrValue) \ + (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) + +#define IServerXMLHTTPRequest_getResponseHeader(This,bstrHeader,pbstrValue) \ + (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) + +#define IServerXMLHTTPRequest_getAllResponseHeaders(This,pbstrHeaders) \ + (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) + +#define IServerXMLHTTPRequest_send(This,varBody) \ + (This)->lpVtbl -> send(This,varBody) + +#define IServerXMLHTTPRequest_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IServerXMLHTTPRequest_get_status(This,plStatus) \ + (This)->lpVtbl -> get_status(This,plStatus) + +#define IServerXMLHTTPRequest_get_statusText(This,pbstrStatus) \ + (This)->lpVtbl -> get_statusText(This,pbstrStatus) + +#define IServerXMLHTTPRequest_get_responseXML(This,ppBody) \ + (This)->lpVtbl -> get_responseXML(This,ppBody) + +#define IServerXMLHTTPRequest_get_responseText(This,pbstrBody) \ + (This)->lpVtbl -> get_responseText(This,pbstrBody) + +#define IServerXMLHTTPRequest_get_responseBody(This,pvarBody) \ + (This)->lpVtbl -> get_responseBody(This,pvarBody) + +#define IServerXMLHTTPRequest_get_responseStream(This,pvarBody) \ + (This)->lpVtbl -> get_responseStream(This,pvarBody) + +#define IServerXMLHTTPRequest_get_readyState(This,plState) \ + (This)->lpVtbl -> get_readyState(This,plState) + +#define IServerXMLHTTPRequest_put_onreadystatechange(This,pReadyStateSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) + + +#define IServerXMLHTTPRequest_setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) \ + (This)->lpVtbl -> setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) + +#define IServerXMLHTTPRequest_waitForResponse(This,timeoutInSeconds,isSuccessful) \ + (This)->lpVtbl -> waitForResponse(This,timeoutInSeconds,isSuccessful) + +#define IServerXMLHTTPRequest_getOption(This,option,value) \ + (This)->lpVtbl -> getOption(This,option,value) + +#define IServerXMLHTTPRequest_setOption(This,option,value) \ + (This)->lpVtbl -> setOption(This,option,value) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_setTimeouts_Proxy( + IServerXMLHTTPRequest * This, + /* [in] */ long resolveTimeout, + /* [in] */ long connectTimeout, + /* [in] */ long sendTimeout, + /* [in] */ long receiveTimeout); + + +void __RPC_STUB IServerXMLHTTPRequest_setTimeouts_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_waitForResponse_Proxy( + IServerXMLHTTPRequest * This, + /* [optional][in] */ VARIANT timeoutInSeconds, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + +void __RPC_STUB IServerXMLHTTPRequest_waitForResponse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_getOption_Proxy( + IServerXMLHTTPRequest * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [retval][out] */ VARIANT *value); + + +void __RPC_STUB IServerXMLHTTPRequest_getOption_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_setOption_Proxy( + IServerXMLHTTPRequest * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [in] */ VARIANT value); + + +void __RPC_STUB IServerXMLHTTPRequest_setOption_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IServerXMLHTTPRequest_INTERFACE_DEFINED__ */ + + +#ifndef __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ +#define __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ + +/* interface IServerXMLHTTPRequest2 */ +/* [unique][helpstring][oleautomation][dual][uuid][object] */ + + +EXTERN_C const IID IID_IServerXMLHTTPRequest2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2e01311b-c322-4b0a-bd77-b90cfdc8dce7") + IServerXMLHTTPRequest2 : public IServerXMLHTTPRequest + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProxy( + /* [in] */ SXH_PROXY_SETTING proxySetting, + /* [optional][in] */ VARIANT varProxyServer, + /* [optional][in] */ VARIANT varBypassList) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProxyCredentials( + /* [in] */ BSTR bstrUserName, + /* [in] */ BSTR bstrPassword) = 0; + + }; + +#else /* C style interface */ + + typedef struct IServerXMLHTTPRequest2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IServerXMLHTTPRequest2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IServerXMLHTTPRequest2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IServerXMLHTTPRequest2 * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IServerXMLHTTPRequest2 * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IServerXMLHTTPRequest2 * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IServerXMLHTTPRequest2 * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IServerXMLHTTPRequest2 * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( + IServerXMLHTTPRequest2 * This, + /* [in] */ BSTR bstrMethod, + /* [in] */ BSTR bstrUrl, + /* [optional][in] */ VARIANT varAsync, + /* [optional][in] */ VARIANT bstrUser, + /* [optional][in] */ VARIANT bstrPassword); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( + IServerXMLHTTPRequest2 * This, + /* [in] */ BSTR bstrHeader, + /* [in] */ BSTR bstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( + IServerXMLHTTPRequest2 * This, + /* [in] */ BSTR bstrHeader, + /* [retval][out] */ BSTR *pbstrValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ BSTR *pbstrHeaders); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( + IServerXMLHTTPRequest2 * This, + /* [optional][in] */ VARIANT varBody); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( + IServerXMLHTTPRequest2 * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ long *plStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ BSTR *pbstrStatus); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ IDispatch **ppBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ BSTR *pbstrBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ VARIANT *pvarBody); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( + IServerXMLHTTPRequest2 * This, + /* [retval][out] */ long *plState); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( + IServerXMLHTTPRequest2 * This, + /* [in] */ IDispatch *pReadyStateSink); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setTimeouts )( + IServerXMLHTTPRequest2 * This, + /* [in] */ long resolveTimeout, + /* [in] */ long connectTimeout, + /* [in] */ long sendTimeout, + /* [in] */ long receiveTimeout); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *waitForResponse )( + IServerXMLHTTPRequest2 * This, + /* [optional][in] */ VARIANT timeoutInSeconds, + /* [retval][out] */ VARIANT_BOOL *isSuccessful); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getOption )( + IServerXMLHTTPRequest2 * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [retval][out] */ VARIANT *value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setOption )( + IServerXMLHTTPRequest2 * This, + /* [in] */ SERVERXMLHTTP_OPTION option, + /* [in] */ VARIANT value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProxy )( + IServerXMLHTTPRequest2 * This, + /* [in] */ SXH_PROXY_SETTING proxySetting, + /* [optional][in] */ VARIANT varProxyServer, + /* [optional][in] */ VARIANT varBypassList); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProxyCredentials )( + IServerXMLHTTPRequest2 * This, + /* [in] */ BSTR bstrUserName, + /* [in] */ BSTR bstrPassword); + + END_INTERFACE + } IServerXMLHTTPRequest2Vtbl; + + interface IServerXMLHTTPRequest2 + { + CONST_VTBL struct IServerXMLHTTPRequest2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IServerXMLHTTPRequest2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IServerXMLHTTPRequest2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IServerXMLHTTPRequest2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IServerXMLHTTPRequest2_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IServerXMLHTTPRequest2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IServerXMLHTTPRequest2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IServerXMLHTTPRequest2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IServerXMLHTTPRequest2_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ + (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) + +#define IServerXMLHTTPRequest2_setRequestHeader(This,bstrHeader,bstrValue) \ + (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) + +#define IServerXMLHTTPRequest2_getResponseHeader(This,bstrHeader,pbstrValue) \ + (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) + +#define IServerXMLHTTPRequest2_getAllResponseHeaders(This,pbstrHeaders) \ + (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) + +#define IServerXMLHTTPRequest2_send(This,varBody) \ + (This)->lpVtbl -> send(This,varBody) + +#define IServerXMLHTTPRequest2_abort(This) \ + (This)->lpVtbl -> abort(This) + +#define IServerXMLHTTPRequest2_get_status(This,plStatus) \ + (This)->lpVtbl -> get_status(This,plStatus) + +#define IServerXMLHTTPRequest2_get_statusText(This,pbstrStatus) \ + (This)->lpVtbl -> get_statusText(This,pbstrStatus) + +#define IServerXMLHTTPRequest2_get_responseXML(This,ppBody) \ + (This)->lpVtbl -> get_responseXML(This,ppBody) + +#define IServerXMLHTTPRequest2_get_responseText(This,pbstrBody) \ + (This)->lpVtbl -> get_responseText(This,pbstrBody) + +#define IServerXMLHTTPRequest2_get_responseBody(This,pvarBody) \ + (This)->lpVtbl -> get_responseBody(This,pvarBody) + +#define IServerXMLHTTPRequest2_get_responseStream(This,pvarBody) \ + (This)->lpVtbl -> get_responseStream(This,pvarBody) + +#define IServerXMLHTTPRequest2_get_readyState(This,plState) \ + (This)->lpVtbl -> get_readyState(This,plState) + +#define IServerXMLHTTPRequest2_put_onreadystatechange(This,pReadyStateSink) \ + (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) + + +#define IServerXMLHTTPRequest2_setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) \ + (This)->lpVtbl -> setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) + +#define IServerXMLHTTPRequest2_waitForResponse(This,timeoutInSeconds,isSuccessful) \ + (This)->lpVtbl -> waitForResponse(This,timeoutInSeconds,isSuccessful) + +#define IServerXMLHTTPRequest2_getOption(This,option,value) \ + (This)->lpVtbl -> getOption(This,option,value) + +#define IServerXMLHTTPRequest2_setOption(This,option,value) \ + (This)->lpVtbl -> setOption(This,option,value) + + +#define IServerXMLHTTPRequest2_setProxy(This,proxySetting,varProxyServer,varBypassList) \ + (This)->lpVtbl -> setProxy(This,proxySetting,varProxyServer,varBypassList) + +#define IServerXMLHTTPRequest2_setProxyCredentials(This,bstrUserName,bstrPassword) \ + (This)->lpVtbl -> setProxyCredentials(This,bstrUserName,bstrPassword) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest2_setProxy_Proxy( + IServerXMLHTTPRequest2 * This, + /* [in] */ SXH_PROXY_SETTING proxySetting, + /* [optional][in] */ VARIANT varProxyServer, + /* [optional][in] */ VARIANT varBypassList); + + +void __RPC_STUB IServerXMLHTTPRequest2_setProxy_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest2_setProxyCredentials_Proxy( + IServerXMLHTTPRequest2 * This, + /* [in] */ BSTR bstrUserName, + /* [in] */ BSTR bstrPassword); + + +void __RPC_STUB IServerXMLHTTPRequest2_setProxyCredentials_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ */ + + +#ifndef __IMXNamespacePrefixes_INTERFACE_DEFINED__ +#define __IMXNamespacePrefixes_INTERFACE_DEFINED__ + +/* interface IMXNamespacePrefixes */ +/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ + + +EXTERN_C const IID IID_IMXNamespacePrefixes; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c90352f4-643c-4fbc-bb23-e996eb2d51fd") + IMXNamespacePrefixes : public IDispatch + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_item( + /* [in] */ long index, + /* [retval][out] */ BSTR *prefix) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_length( + /* [retval][out] */ long *length) = 0; + + virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( + /* [retval][out] */ IUnknown **ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXNamespacePrefixesVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXNamespacePrefixes * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXNamespacePrefixes * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXNamespacePrefixes * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IMXNamespacePrefixes * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IMXNamespacePrefixes * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IMXNamespacePrefixes * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IMXNamespacePrefixes * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( + IMXNamespacePrefixes * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *prefix); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( + IMXNamespacePrefixes * This, + /* [retval][out] */ long *length); + + /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( + IMXNamespacePrefixes * This, + /* [retval][out] */ IUnknown **ppUnk); + + END_INTERFACE + } IMXNamespacePrefixesVtbl; + + interface IMXNamespacePrefixes + { + CONST_VTBL struct IMXNamespacePrefixesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXNamespacePrefixes_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXNamespacePrefixes_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXNamespacePrefixes_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXNamespacePrefixes_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMXNamespacePrefixes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMXNamespacePrefixes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMXNamespacePrefixes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IMXNamespacePrefixes_get_item(This,index,prefix) \ + (This)->lpVtbl -> get_item(This,index,prefix) + +#define IMXNamespacePrefixes_get_length(This,length) \ + (This)->lpVtbl -> get_length(This,length) + +#define IMXNamespacePrefixes_get__newEnum(This,ppUnk) \ + (This)->lpVtbl -> get__newEnum(This,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get_item_Proxy( + IMXNamespacePrefixes * This, + /* [in] */ long index, + /* [retval][out] */ BSTR *prefix); + + +void __RPC_STUB IMXNamespacePrefixes_get_item_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get_length_Proxy( + IMXNamespacePrefixes * This, + /* [retval][out] */ long *length); + + +void __RPC_STUB IMXNamespacePrefixes_get_length_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get__newEnum_Proxy( + IMXNamespacePrefixes * This, + /* [retval][out] */ IUnknown **ppUnk); + + +void __RPC_STUB IMXNamespacePrefixes_get__newEnum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXNamespacePrefixes_INTERFACE_DEFINED__ */ + + +#ifndef __IVBMXNamespaceManager_INTERFACE_DEFINED__ +#define __IVBMXNamespaceManager_INTERFACE_DEFINED__ + +/* interface IVBMXNamespaceManager */ +/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ + + +EXTERN_C const IID IID_IVBMXNamespaceManager; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c90352f5-643c-4fbc-bb23-e996eb2d51fd") + IVBMXNamespaceManager : public IDispatch + { + public: + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_allowOverride( + /* [in] */ VARIANT_BOOL fOverride) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_allowOverride( + /* [retval][out] */ VARIANT_BOOL *fOverride) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE pushContext( void) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE pushNodeContext( + /* [in] */ IXMLDOMNode *contextNode, + /* [defaultvalue][in] */ VARIANT_BOOL fDeep = -1) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE popContext( void) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE declarePrefix( + /* [in] */ BSTR prefix, + /* [in] */ BSTR namespaceURI) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getDeclaredPrefixes( + /* [retval][out] */ IMXNamespacePrefixes **prefixes) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getPrefixes( + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IMXNamespacePrefixes **prefixes) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getURI( + /* [in] */ BSTR prefix, + /* [retval][out] */ VARIANT *uri) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE getURIFromNode( + /* [in] */ BSTR strPrefix, + /* [in] */ IXMLDOMNode *contextNode, + /* [retval][out] */ VARIANT *uri) = 0; + + }; + +#else /* C style interface */ + + typedef struct IVBMXNamespaceManagerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IVBMXNamespaceManager * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IVBMXNamespaceManager * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IVBMXNamespaceManager * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IVBMXNamespaceManager * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IVBMXNamespaceManager * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IVBMXNamespaceManager * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IVBMXNamespaceManager * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_allowOverride )( + IVBMXNamespaceManager * This, + /* [in] */ VARIANT_BOOL fOverride); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_allowOverride )( + IVBMXNamespaceManager * This, + /* [retval][out] */ VARIANT_BOOL *fOverride); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *reset )( + IVBMXNamespaceManager * This); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *pushContext )( + IVBMXNamespaceManager * This); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *pushNodeContext )( + IVBMXNamespaceManager * This, + /* [in] */ IXMLDOMNode *contextNode, + /* [defaultvalue][in] */ VARIANT_BOOL fDeep); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *popContext )( + IVBMXNamespaceManager * This); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *declarePrefix )( + IVBMXNamespaceManager * This, + /* [in] */ BSTR prefix, + /* [in] */ BSTR namespaceURI); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getDeclaredPrefixes )( + IVBMXNamespaceManager * This, + /* [retval][out] */ IMXNamespacePrefixes **prefixes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getPrefixes )( + IVBMXNamespaceManager * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IMXNamespacePrefixes **prefixes); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getURI )( + IVBMXNamespaceManager * This, + /* [in] */ BSTR prefix, + /* [retval][out] */ VARIANT *uri); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *getURIFromNode )( + IVBMXNamespaceManager * This, + /* [in] */ BSTR strPrefix, + /* [in] */ IXMLDOMNode *contextNode, + /* [retval][out] */ VARIANT *uri); + + END_INTERFACE + } IVBMXNamespaceManagerVtbl; + + interface IVBMXNamespaceManager + { + CONST_VTBL struct IVBMXNamespaceManagerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IVBMXNamespaceManager_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IVBMXNamespaceManager_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IVBMXNamespaceManager_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IVBMXNamespaceManager_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IVBMXNamespaceManager_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IVBMXNamespaceManager_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IVBMXNamespaceManager_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IVBMXNamespaceManager_put_allowOverride(This,fOverride) \ + (This)->lpVtbl -> put_allowOverride(This,fOverride) + +#define IVBMXNamespaceManager_get_allowOverride(This,fOverride) \ + (This)->lpVtbl -> get_allowOverride(This,fOverride) + +#define IVBMXNamespaceManager_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IVBMXNamespaceManager_pushContext(This) \ + (This)->lpVtbl -> pushContext(This) + +#define IVBMXNamespaceManager_pushNodeContext(This,contextNode,fDeep) \ + (This)->lpVtbl -> pushNodeContext(This,contextNode,fDeep) + +#define IVBMXNamespaceManager_popContext(This) \ + (This)->lpVtbl -> popContext(This) + +#define IVBMXNamespaceManager_declarePrefix(This,prefix,namespaceURI) \ + (This)->lpVtbl -> declarePrefix(This,prefix,namespaceURI) + +#define IVBMXNamespaceManager_getDeclaredPrefixes(This,prefixes) \ + (This)->lpVtbl -> getDeclaredPrefixes(This,prefixes) + +#define IVBMXNamespaceManager_getPrefixes(This,namespaceURI,prefixes) \ + (This)->lpVtbl -> getPrefixes(This,namespaceURI,prefixes) + +#define IVBMXNamespaceManager_getURI(This,prefix,uri) \ + (This)->lpVtbl -> getURI(This,prefix,uri) + +#define IVBMXNamespaceManager_getURIFromNode(This,strPrefix,contextNode,uri) \ + (This)->lpVtbl -> getURIFromNode(This,strPrefix,contextNode,uri) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_put_allowOverride_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ VARIANT_BOOL fOverride); + + +void __RPC_STUB IVBMXNamespaceManager_put_allowOverride_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_get_allowOverride_Proxy( + IVBMXNamespaceManager * This, + /* [retval][out] */ VARIANT_BOOL *fOverride); + + +void __RPC_STUB IVBMXNamespaceManager_get_allowOverride_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_reset_Proxy( + IVBMXNamespaceManager * This); + + +void __RPC_STUB IVBMXNamespaceManager_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_pushContext_Proxy( + IVBMXNamespaceManager * This); + + +void __RPC_STUB IVBMXNamespaceManager_pushContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_pushNodeContext_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ IXMLDOMNode *contextNode, + /* [defaultvalue][in] */ VARIANT_BOOL fDeep); + + +void __RPC_STUB IVBMXNamespaceManager_pushNodeContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_popContext_Proxy( + IVBMXNamespaceManager * This); + + +void __RPC_STUB IVBMXNamespaceManager_popContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_declarePrefix_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ BSTR prefix, + /* [in] */ BSTR namespaceURI); + + +void __RPC_STUB IVBMXNamespaceManager_declarePrefix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getDeclaredPrefixes_Proxy( + IVBMXNamespaceManager * This, + /* [retval][out] */ IMXNamespacePrefixes **prefixes); + + +void __RPC_STUB IVBMXNamespaceManager_getDeclaredPrefixes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getPrefixes_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ BSTR namespaceURI, + /* [retval][out] */ IMXNamespacePrefixes **prefixes); + + +void __RPC_STUB IVBMXNamespaceManager_getPrefixes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getURI_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ BSTR prefix, + /* [retval][out] */ VARIANT *uri); + + +void __RPC_STUB IVBMXNamespaceManager_getURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getURIFromNode_Proxy( + IVBMXNamespaceManager * This, + /* [in] */ BSTR strPrefix, + /* [in] */ IXMLDOMNode *contextNode, + /* [retval][out] */ VARIANT *uri); + + +void __RPC_STUB IVBMXNamespaceManager_getURIFromNode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IVBMXNamespaceManager_INTERFACE_DEFINED__ */ + + +#ifndef __IMXNamespaceManager_INTERFACE_DEFINED__ +#define __IMXNamespaceManager_INTERFACE_DEFINED__ + +/* interface IMXNamespaceManager */ +/* [unique][helpstring][uuid][local][object][hidden] */ + + +EXTERN_C const IID IID_IMXNamespaceManager; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c90352f6-643c-4fbc-bb23-e996eb2d51fd") + IMXNamespaceManager : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE putAllowOverride( + /* [in] */ VARIANT_BOOL fOverride) = 0; + + virtual HRESULT STDMETHODCALLTYPE getAllowOverride( + /* [retval][out] */ VARIANT_BOOL *fOverride) = 0; + + virtual HRESULT STDMETHODCALLTYPE reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE pushContext( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE pushNodeContext( + /* [in] */ IXMLDOMNode *contextNode, + /* [in] */ VARIANT_BOOL fDeep) = 0; + + virtual HRESULT STDMETHODCALLTYPE popContext( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE declarePrefix( + /* [in] */ const wchar_t *prefix, + /* [in] */ const wchar_t *namespaceURI) = 0; + + virtual HRESULT STDMETHODCALLTYPE getDeclaredPrefix( + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix) = 0; + + virtual HRESULT STDMETHODCALLTYPE getPrefix( + /* [in] */ const wchar_t *pwszNamespaceURI, + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix) = 0; + + virtual HRESULT STDMETHODCALLTYPE getURI( + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ IXMLDOMNode *pContextNode, + /* [out][in] */ wchar_t *pwchUri, + /* [out][in] */ int *pcchUri) = 0; + + }; + +#else /* C style interface */ + + typedef struct IMXNamespaceManagerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IMXNamespaceManager * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IMXNamespaceManager * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IMXNamespaceManager * This); + + HRESULT ( STDMETHODCALLTYPE *putAllowOverride )( + IMXNamespaceManager * This, + /* [in] */ VARIANT_BOOL fOverride); + + HRESULT ( STDMETHODCALLTYPE *getAllowOverride )( + IMXNamespaceManager * This, + /* [retval][out] */ VARIANT_BOOL *fOverride); + + HRESULT ( STDMETHODCALLTYPE *reset )( + IMXNamespaceManager * This); + + HRESULT ( STDMETHODCALLTYPE *pushContext )( + IMXNamespaceManager * This); + + HRESULT ( STDMETHODCALLTYPE *pushNodeContext )( + IMXNamespaceManager * This, + /* [in] */ IXMLDOMNode *contextNode, + /* [in] */ VARIANT_BOOL fDeep); + + HRESULT ( STDMETHODCALLTYPE *popContext )( + IMXNamespaceManager * This); + + HRESULT ( STDMETHODCALLTYPE *declarePrefix )( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *prefix, + /* [in] */ const wchar_t *namespaceURI); + + HRESULT ( STDMETHODCALLTYPE *getDeclaredPrefix )( + IMXNamespaceManager * This, + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix); + + HRESULT ( STDMETHODCALLTYPE *getPrefix )( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *pwszNamespaceURI, + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix); + + HRESULT ( STDMETHODCALLTYPE *getURI )( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ IXMLDOMNode *pContextNode, + /* [out][in] */ wchar_t *pwchUri, + /* [out][in] */ int *pcchUri); + + END_INTERFACE + } IMXNamespaceManagerVtbl; + + interface IMXNamespaceManager + { + CONST_VTBL struct IMXNamespaceManagerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMXNamespaceManager_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMXNamespaceManager_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMXNamespaceManager_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMXNamespaceManager_putAllowOverride(This,fOverride) \ + (This)->lpVtbl -> putAllowOverride(This,fOverride) + +#define IMXNamespaceManager_getAllowOverride(This,fOverride) \ + (This)->lpVtbl -> getAllowOverride(This,fOverride) + +#define IMXNamespaceManager_reset(This) \ + (This)->lpVtbl -> reset(This) + +#define IMXNamespaceManager_pushContext(This) \ + (This)->lpVtbl -> pushContext(This) + +#define IMXNamespaceManager_pushNodeContext(This,contextNode,fDeep) \ + (This)->lpVtbl -> pushNodeContext(This,contextNode,fDeep) + +#define IMXNamespaceManager_popContext(This) \ + (This)->lpVtbl -> popContext(This) + +#define IMXNamespaceManager_declarePrefix(This,prefix,namespaceURI) \ + (This)->lpVtbl -> declarePrefix(This,prefix,namespaceURI) + +#define IMXNamespaceManager_getDeclaredPrefix(This,nIndex,pwchPrefix,pcchPrefix) \ + (This)->lpVtbl -> getDeclaredPrefix(This,nIndex,pwchPrefix,pcchPrefix) + +#define IMXNamespaceManager_getPrefix(This,pwszNamespaceURI,nIndex,pwchPrefix,pcchPrefix) \ + (This)->lpVtbl -> getPrefix(This,pwszNamespaceURI,nIndex,pwchPrefix,pcchPrefix) + +#define IMXNamespaceManager_getURI(This,pwchPrefix,pContextNode,pwchUri,pcchUri) \ + (This)->lpVtbl -> getURI(This,pwchPrefix,pContextNode,pwchUri,pcchUri) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_putAllowOverride_Proxy( + IMXNamespaceManager * This, + /* [in] */ VARIANT_BOOL fOverride); + + +void __RPC_STUB IMXNamespaceManager_putAllowOverride_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getAllowOverride_Proxy( + IMXNamespaceManager * This, + /* [retval][out] */ VARIANT_BOOL *fOverride); + + +void __RPC_STUB IMXNamespaceManager_getAllowOverride_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_reset_Proxy( + IMXNamespaceManager * This); + + +void __RPC_STUB IMXNamespaceManager_reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_pushContext_Proxy( + IMXNamespaceManager * This); + + +void __RPC_STUB IMXNamespaceManager_pushContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_pushNodeContext_Proxy( + IMXNamespaceManager * This, + /* [in] */ IXMLDOMNode *contextNode, + /* [in] */ VARIANT_BOOL fDeep); + + +void __RPC_STUB IMXNamespaceManager_pushNodeContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_popContext_Proxy( + IMXNamespaceManager * This); + + +void __RPC_STUB IMXNamespaceManager_popContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_declarePrefix_Proxy( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *prefix, + /* [in] */ const wchar_t *namespaceURI); + + +void __RPC_STUB IMXNamespaceManager_declarePrefix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getDeclaredPrefix_Proxy( + IMXNamespaceManager * This, + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix); + + +void __RPC_STUB IMXNamespaceManager_getDeclaredPrefix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getPrefix_Proxy( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *pwszNamespaceURI, + /* [in] */ long nIndex, + /* [out][in] */ wchar_t *pwchPrefix, + /* [out][in] */ int *pcchPrefix); + + +void __RPC_STUB IMXNamespaceManager_getPrefix_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getURI_Proxy( + IMXNamespaceManager * This, + /* [in] */ const wchar_t *pwchPrefix, + /* [in] */ IXMLDOMNode *pContextNode, + /* [out][in] */ wchar_t *pwchUri, + /* [out][in] */ int *pcchUri); + + +void __RPC_STUB IMXNamespaceManager_getURI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IMXNamespaceManager_INTERFACE_DEFINED__ */ + + +EXTERN_C const CLSID CLSID_DOMDocument; + +#ifdef __cplusplus + +class DECLSPEC_UUID("F6D90F11-9C73-11D3-B32E-00C04F990BB4") +DOMDocument; +#endif + +EXTERN_C const CLSID CLSID_DOMDocument26; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f1b-c551-11d3-89b9-0000f81fe221") +DOMDocument26; +#endif + +EXTERN_C const CLSID CLSID_DOMDocument30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f32-c551-11d3-89b9-0000f81fe221") +DOMDocument30; +#endif + +EXTERN_C const CLSID CLSID_DOMDocument40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c0-f192-11d4-a65f-0040963251e5") +DOMDocument40; +#endif + +EXTERN_C const CLSID CLSID_DOMDocument60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a05-f192-11d4-a65f-0040963251e5") +DOMDocument60; +#endif + +EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument; + +#ifdef __cplusplus + +class DECLSPEC_UUID("F6D90F12-9C73-11D3-B32E-00C04F990BB4") +FreeThreadedDOMDocument; +#endif + +EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument26; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f1c-c551-11d3-89b9-0000f81fe221") +FreeThreadedDOMDocument26; +#endif + +EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f33-c551-11d3-89b9-0000f81fe221") +FreeThreadedDOMDocument30; +#endif + +EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c1-f192-11d4-a65f-0040963251e5") +FreeThreadedDOMDocument40; +#endif + +EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a06-f192-11d4-a65f-0040963251e5") +FreeThreadedDOMDocument60; +#endif + +EXTERN_C const CLSID CLSID_XMLSchemaCache; + +#ifdef __cplusplus + +class DECLSPEC_UUID("373984c9-b845-449b-91e7-45ac83036ade") +XMLSchemaCache; +#endif + +EXTERN_C const CLSID CLSID_XMLSchemaCache26; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f1d-c551-11d3-89b9-0000f81fe221") +XMLSchemaCache26; +#endif + +EXTERN_C const CLSID CLSID_XMLSchemaCache30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f34-c551-11d3-89b9-0000f81fe221") +XMLSchemaCache30; +#endif + +EXTERN_C const CLSID CLSID_XMLSchemaCache40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c2-f192-11d4-a65f-0040963251e5") +XMLSchemaCache40; +#endif + +EXTERN_C const CLSID CLSID_XMLSchemaCache60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a07-f192-11d4-a65f-0040963251e5") +XMLSchemaCache60; +#endif + +EXTERN_C const CLSID CLSID_XSLTemplate; + +#ifdef __cplusplus + +class DECLSPEC_UUID("2933BF94-7B36-11d2-B20E-00C04F983E60") +XSLTemplate; +#endif + +EXTERN_C const CLSID CLSID_XSLTemplate26; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f21-c551-11d3-89b9-0000f81fe221") +XSLTemplate26; +#endif + +EXTERN_C const CLSID CLSID_XSLTemplate30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f36-c551-11d3-89b9-0000f81fe221") +XSLTemplate30; +#endif + +EXTERN_C const CLSID CLSID_XSLTemplate40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c3-f192-11d4-a65f-0040963251e5") +XSLTemplate40; +#endif + +EXTERN_C const CLSID CLSID_XSLTemplate60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a08-f192-11d4-a65f-0040963251e5") +XSLTemplate60; +#endif + +EXTERN_C const CLSID CLSID_XMLHTTP; + +#ifdef __cplusplus + +class DECLSPEC_UUID("F6D90F16-9C73-11D3-B32E-00C04F990BB4") +XMLHTTP; +#endif + +EXTERN_C const CLSID CLSID_XMLHTTP26; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f1e-c551-11d3-89b9-0000f81fe221") +XMLHTTP26; +#endif + +EXTERN_C const CLSID CLSID_XMLHTTP30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("f5078f35-c551-11d3-89b9-0000f81fe221") +XMLHTTP30; +#endif + +EXTERN_C const CLSID CLSID_XMLHTTP40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c5-f192-11d4-a65f-0040963251e5") +XMLHTTP40; +#endif + +EXTERN_C const CLSID CLSID_XMLHTTP60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a0a-f192-11d4-a65f-0040963251e5") +XMLHTTP60; +#endif + +EXTERN_C const CLSID CLSID_ServerXMLHTTP; + +#ifdef __cplusplus + +class DECLSPEC_UUID("afba6b42-5692-48ea-8141-dc517dcf0ef1") +ServerXMLHTTP; +#endif + +EXTERN_C const CLSID CLSID_ServerXMLHTTP30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("afb40ffd-b609-40a3-9828-f88bbe11e4e3") +ServerXMLHTTP30; +#endif + +EXTERN_C const CLSID CLSID_ServerXMLHTTP40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c6-f192-11d4-a65f-0040963251e5") +ServerXMLHTTP40; +#endif + +EXTERN_C const CLSID CLSID_ServerXMLHTTP60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a0b-f192-11d4-a65f-0040963251e5") +ServerXMLHTTP60; +#endif + +EXTERN_C const CLSID CLSID_SAXXMLReader; + +#ifdef __cplusplus + +class DECLSPEC_UUID("079aa557-4a18-424a-8eee-e39f0a8d41b9") +SAXXMLReader; +#endif + +EXTERN_C const CLSID CLSID_SAXXMLReader30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("3124c396-fb13-4836-a6ad-1317f1713688") +SAXXMLReader30; +#endif + +EXTERN_C const CLSID CLSID_SAXXMLReader40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("7c6e29bc-8b8b-4c3d-859e-af6cd158be0f") +SAXXMLReader40; +#endif + +EXTERN_C const CLSID CLSID_SAXXMLReader60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a0c-f192-11d4-a65f-0040963251e5") +SAXXMLReader60; +#endif + +EXTERN_C const CLSID CLSID_MXXMLWriter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("fc220ad8-a72a-4ee8-926e-0b7ad152a020") +MXXMLWriter; +#endif + +EXTERN_C const CLSID CLSID_MXXMLWriter30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("3d813dfe-6c91-4a4e-8f41-04346a841d9c") +MXXMLWriter30; +#endif + +EXTERN_C const CLSID CLSID_MXXMLWriter40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c8-f192-11d4-a65f-0040963251e5") +MXXMLWriter40; +#endif + +EXTERN_C const CLSID CLSID_MXXMLWriter60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a0f-f192-11d4-a65f-0040963251e5") +MXXMLWriter60; +#endif + +EXTERN_C const CLSID CLSID_MXHTMLWriter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("a4c23ec3-6b70-4466-9127-550077239978") +MXHTMLWriter; +#endif + +EXTERN_C const CLSID CLSID_MXHTMLWriter30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("853d1540-c1a7-4aa9-a226-4d3bd301146d") +MXHTMLWriter30; +#endif + +EXTERN_C const CLSID CLSID_MXHTMLWriter40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969c9-f192-11d4-a65f-0040963251e5") +MXHTMLWriter40; +#endif + +EXTERN_C const CLSID CLSID_MXHTMLWriter60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a10-f192-11d4-a65f-0040963251e5") +MXHTMLWriter60; +#endif + +EXTERN_C const CLSID CLSID_SAXAttributes; + +#ifdef __cplusplus + +class DECLSPEC_UUID("4dd441ad-526d-4a77-9f1b-9841ed802fb0") +SAXAttributes; +#endif + +EXTERN_C const CLSID CLSID_SAXAttributes30; + +#ifdef __cplusplus + +class DECLSPEC_UUID("3e784a01-f3ae-4dc0-9354-9526b9370eba") +SAXAttributes30; +#endif + +EXTERN_C const CLSID CLSID_SAXAttributes40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969ca-f192-11d4-a65f-0040963251e5") +SAXAttributes40; +#endif + +EXTERN_C const CLSID CLSID_SAXAttributes60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a0e-f192-11d4-a65f-0040963251e5") +SAXAttributes60; +#endif + +EXTERN_C const CLSID CLSID_MXNamespaceManager; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969d5-f192-11d4-a65f-0040963251e5") +MXNamespaceManager; +#endif + +EXTERN_C const CLSID CLSID_MXNamespaceManager40; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d969d6-f192-11d4-a65f-0040963251e5") +MXNamespaceManager40; +#endif + +EXTERN_C const CLSID CLSID_MXNamespaceManager60; + +#ifdef __cplusplus + +class DECLSPEC_UUID("88d96a11-f192-11d4-a65f-0040963251e5") +MXNamespaceManager60; +#endif +#endif /* __MSXML2_LIBRARY_DEFINED__ */ + +/* interface __MIDL_itf_msxml6_0192 */ +/* [local] */ + +//---------------------------- +// MSXML SPECIFIC ERROR CODES +//---------------------------- +#define E_XML_NOTWF 0xC00CE223L // Validate failed because the document is not well formed. +#define E_XML_NODTD 0xC00CE224L // The node is neither Valid nor Invalid because no DTD/Schema declaration was found. +#define E_XML_INVALID 0xC00CE225L // Validate failed because of a DTD/Schema violation. +#define E_XML_BUFFERTOOSMALL 0xC00CE226L // Buffer passed in is too small to receive the data. +#ifdef __USE_MSXML6_NAMESPACE__ +} +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_msxml6_0192_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_msxml6_0192_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/cli/test/include/gtest/msxml6.idl b/cli/test/include/gtest/msxml6.idl new file mode 100644 index 0000000..eab3a05 --- /dev/null +++ b/cli/test/include/gtest/msxml6.idl @@ -0,0 +1,3934 @@ +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1997-2005. +// +// File: msxml6.idl +// +//-------------------------------------------------------------------------- + +cpp_quote("//+-------------------------------------------------------------------------") +cpp_quote("//") +cpp_quote("// Microsoft Windows") +cpp_quote("// Copyright (C) Microsoft Corporation, 1997-2005.") +cpp_quote("//") +cpp_quote("//--------------------------------------------------------------------------") + +#include "msxml6did.h" +#include + +#ifndef DO_NO_IMPORTS +import "unknwn.idl"; +import "wtypes.idl"; +import "objidl.idl"; +import "oaidl.idl"; +#endif + +// DOMDocument has a different guid in IE5. +// In msxml3 and above it is a version independent guid. +// To avoid compile errors define it to be DOMDocument2 +cpp_quote("#define DOMDocument DOMDocument2") +cpp_quote("#define CLSID_DOMDocument CLSID_DOMDocument2") +cpp_quote("") + +cpp_quote("#if !defined(_W64)") +cpp_quote("#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300") +cpp_quote("#define _W64 __w64") +cpp_quote("#else") +cpp_quote("#define _W64") +cpp_quote("#endif") +cpp_quote("#endif") +cpp_quote("#if defined(_WIN64)") +cpp_quote(" typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;") +cpp_quote("#else") +cpp_quote(" typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;") +cpp_quote("#endif") + + +cpp_quote("#ifdef __ISAXXMLReader_INTERFACE_DEFINED__") +cpp_quote("#undef __MSXML2_LIBRARY_DEFINED__") +cpp_quote("#endif") + +cpp_quote("#ifdef __USE_MSXML6_NAMESPACE__") +cpp_quote("namespace MSXML6 {") +cpp_quote("#endif") + +[ + uuid(f5078f18-c551-11d3-89b9-0000f81fe221), + version(6.0), + helpstring("Microsoft XML, v6.0"), + lcid(0x0000) +] + +library MSXML2 +{ + +importlib("stdole32.tlb"); +importlib("stdole2.tlb"); + +// XMLDOM +interface IXMLDOMImplementation; +interface IXMLDOMNode; +interface IXMLDOMDocumentFragment; +interface IXMLDOMDocument; +interface IXMLDOMDocument2; +interface IXMLDOMDocument3; +interface IXMLDOMNodeList; +interface IXMLDOMNamedNodeMap; +interface IXMLDOMCharacterData; +interface IXMLDOMAttribute; +interface IXMLDOMElement; +interface IXMLDOMText; +interface IXMLDOMComment; +interface IXMLDOMProcessingInstruction; +interface IXMLDOMCDATASection; +interface IXMLDOMDocumentType; +interface IXMLDOMNotation; +interface IXMLDOMEntity; +interface IXMLDOMEntityReference; +interface IXMLDOMParseError; +interface IXMLDOMParseError2; +interface IXMLDOMParseErrorCollection; +interface IXMLDOMSchemaCollection; +interface IXTLRuntime; +interface IXSLTemplate; +interface IXSLProcessor; + +// SAX +interface ISAXXMLReader; +interface ISAXXMLFilter; +interface ISAXLocator; +interface ISAXEntityResolver; +interface ISAXContentHandler; +interface ISAXDTDHandler; +interface ISAXErrorHandler; +interface ISAXLexicalHandler; +interface ISAXDeclHandler; +interface ISAXAttributes; + +interface IVBSAXXMLReader; +interface IVBSAXXMLFilter; +interface IVBSAXLocator; +interface IVBSAXEntityResolver; +interface IVBSAXContentHandler; +interface IVBSAXDTDHandler; +interface IVBSAXErrorHandler; +interface IVBSAXLexicalHandler; +interface IVBSAXDeclHandler; +interface IVBSAXAttributes; + +interface IMXWriter; +interface IMXAttributes; +interface IMXReaderControl; +interface IMXSchemaDeclHandler; +interface IMXXMLFilter; + +// SOM +interface IXMLDOMSchemaCollection2; +interface ISchemaStringCollection; +interface ISchemaItemCollection; +interface ISchemaItem; +interface ISchema; +interface ISchemaParticle; +interface ISchemaAttribute; +interface ISchemaElement; +interface ISchemaType; +interface ISchemaComplexType; +interface ISchemaAttributeGroup; +interface ISchemaModelGroup; +interface ISchemaAny; +interface ISchemaIdentityConstraint; +interface ISchemaNotation; + +/// This is needed to avoid having the (SAX) ParseURL method +/// become the ParseURLA method. +cpp_quote("#undef ParseURL") + +// IE4 msxml.h also defines __msxml_h__. The only way to tell the difference between IE4 msxml.h and IE5 msxml.h is the +// via the obsolete interface __IXMLElementNotificationSink_INTERFACE_DEFINED__ defined by IE4 +cpp_quote("#if !defined(__msxml_h__) || defined(__IXMLElementNotificationSink_INTERFACE_DEFINED__)") + +typedef [ +helpstring("Constants that define a node's type") +] enum tagDOMNodeType +{ + NODE_INVALID, // = 0 + NODE_ELEMENT, // = 1 + NODE_ATTRIBUTE, // = 2 + NODE_TEXT, // = 3 + NODE_CDATA_SECTION, // = 4 + NODE_ENTITY_REFERENCE, // = 5 + NODE_ENTITY, // = 6 + NODE_PROCESSING_INSTRUCTION, // = 7 + NODE_COMMENT, // = 8 + NODE_DOCUMENT, // = 9 + NODE_DOCUMENT_TYPE, // = 10 + NODE_DOCUMENT_FRAGMENT, // = 11 + NODE_NOTATION // = 12 +} DOMNodeType; + +cpp_quote("#endif") + +[ + local, object, + uuid(2933BF80-7B36-11d2-B20E-00C04F983E60), // IID_INode + odl, + dual, + oleautomation, + nonextensible, + helpstring("Core DOM node interface"), + pointer_default(unique) +] +interface IXMLDOMNode : IDispatch +{ + // readonly attribute wstring nodeName; + [propget, id(DISPID_DOM_NODE_NODENAME), + helpstring("name of the node")] + HRESULT nodeName( + [out, retval] BSTR * name); + + // attribute wstring nodeValue; + [propget, id(DISPID_DOM_NODE_NODEVALUE), + helpstring("value stored in the node")] + HRESULT nodeValue( + [out, retval] VARIANT * value); + + [propput, id(DISPID_DOM_NODE_NODEVALUE), + helpstring("value stored in the node")] + HRESULT nodeValue( + [in] VARIANT value); + + // readonly attribute unsigned short nodeType; + [propget, id(DISPID_DOM_NODE_NODETYPE), + helpstring("the node's type")] + HRESULT nodeType( + [out, retval] DOMNodeType * type); + + // readonly attribute Node parentNode; + [propget, id(DISPID_DOM_NODE_PARENTNODE), + helpstring("parent of the node")] + HRESULT parentNode( + [out, retval] IXMLDOMNode ** parent); + + // readonly attribute NodeList childNodes; + [propget, id(DISPID_DOM_NODE_CHILDNODES), + helpstring("the collection of the node's children")] + HRESULT childNodes( + [out, retval] IXMLDOMNodeList ** childList); + + // readonly attribute Node firstChild; + [propget,id(DISPID_DOM_NODE_FIRSTCHILD), + helpstring("first child of the node")] + HRESULT firstChild( + [out, retval] IXMLDOMNode ** firstChild); + + // readonly attribute Node lastChild; + [propget,id(DISPID_DOM_NODE_LASTCHILD), + helpstring("last child of the node")] + HRESULT lastChild( + [out, retval] IXMLDOMNode ** lastChild); + + // readonly attribute Node previousSibling; + [propget,id(DISPID_DOM_NODE_PREVIOUSSIBLING), + helpstring("left sibling of the node")] + HRESULT previousSibling( + [out, retval] IXMLDOMNode ** previousSibling); + + // readonly attribute Node nextSibling; + [propget,id(DISPID_DOM_NODE_NEXTSIBLING), + helpstring("right sibling of the node")] + HRESULT nextSibling( + [out, retval] IXMLDOMNode ** nextSibling); + + // readonly attribute NamedNodeMap attributes; + [propget, id(DISPID_DOM_NODE_ATTRIBUTES), + helpstring("the collection of the node's attributes")] + HRESULT attributes( + [out, retval] IXMLDOMNamedNodeMap ** attributeMap); + + + // Node insertBefore(in Node newChild, + // in Node refChild) + // raises(DOMException); + [id(DISPID_DOM_NODE_INSERTBEFORE), + helpstring("insert a child node")] + HRESULT insertBefore( + [in] IXMLDOMNode * newChild, + [in] VARIANT refChild, + [out, retval] IXMLDOMNode ** outNewChild); + + // Node replaceChild(in Node newChild, + // in Node oldChild) + // raises(DOMException); + [id(DISPID_DOM_NODE_REPLACECHILD), + helpstring("replace a child node")] + HRESULT replaceChild( + [in] IXMLDOMNode * newChild, + [in] IXMLDOMNode * oldChild, + [out, retval] IXMLDOMNode ** outOldChild); + + // Node removeChild(in Node childNode) + // raises(DOMException); + [id(DISPID_DOM_NODE_REMOVECHILD), + helpstring("remove a child node")] + HRESULT removeChild( + [in] IXMLDOMNode * childNode, + [out, retval] IXMLDOMNode ** oldChild); + + // Node appendChild(in Node newChild); + [id(DISPID_DOM_NODE_APPENDCHILD), + helpstring("append a child node")] + HRESULT appendChild( + [in] IXMLDOMNode * newChild, + [out, retval] IXMLDOMNode ** outNewChild); + + // boolean hasChildNodes(); + [id(DISPID_DOM_NODE_HASCHILDNODES), + helpstring("")] + HRESULT hasChildNodes( + [out, retval] VARIANT_BOOL * hasChild); + + // readonly attribute Node ownerDocument; + [propget, id(DISPID_DOM_NODE_OWNERDOC), + helpstring("document that contains the node")] + HRESULT ownerDocument( + [out, retval] IXMLDOMDocument ** DOMDocument); + + // Node cloneNode(in boolean deep); + [id(DISPID_DOM_NODE_CLONENODE), + helpstring("")] + HRESULT cloneNode( + [in] VARIANT_BOOL deep, + [out, retval] IXMLDOMNode ** cloneRoot); + + [propget, id(DISPID_XMLDOM_NODE_STRINGTYPE), + helpstring("the type of node in string form")] + HRESULT nodeTypeString( + [retval, out] BSTR * nodeType); + + [propget, id(DISPID_XMLDOM_NODE_TEXT), + helpstring("text content of the node and subtree")] + HRESULT text( + [retval, out] BSTR * text); + + [propput, id(DISPID_XMLDOM_NODE_TEXT), + helpstring("text content of the node and subtree")] + HRESULT text( + [in] BSTR text); + + [propget, id(DISPID_XMLDOM_NODE_SPECIFIED), + helpstring("indicates whether node is a default value")] + HRESULT specified( + [out, retval] VARIANT_BOOL * isSpecified); + + // DTD Navigation. + [propget, id(DISPID_XMLDOM_NODE_DEFINITION), + helpstring("pointer to the definition of the node in the DTD or schema")] + HRESULT definition( + [retval,out] IXMLDOMNode ** definitionNode); + + [propget, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE), + helpstring("get the strongly typed value of the node")] + HRESULT nodeTypedValue( + [retval, out] VARIANT * typedValue); + + [propput, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE), + helpstring("get the strongly typed value of the node")] + HRESULT nodeTypedValue( + [in] VARIANT typedValue); + + [propget, id(DISPID_XMLDOM_NODE_DATATYPE), + helpstring("the data type of the node")] + HRESULT dataType( + [retval, out] VARIANT * dataTypeName); // BSTR or VT_NULL + + [propput, id(DISPID_XMLDOM_NODE_DATATYPE), + helpstring("the data type of the node")] + HRESULT dataType( + [in] BSTR dataTypeName); + + [propget, id(DISPID_XMLDOM_NODE_XML), + helpstring("return the XML source for the node and each of its descendants")] + HRESULT xml( + [retval, out] BSTR * xmlString); + + [id(DISPID_XMLDOM_NODE_TRANSFORMNODE), + helpstring("apply the stylesheet to the subtree")] + HRESULT transformNode( + [in] IXMLDOMNode * stylesheet, + [retval, out] BSTR * xmlString); + + [id(DISPID_XMLDOM_NODE_SELECTNODES), + helpstring("execute query on the subtree")] + HRESULT selectNodes( + [in] BSTR queryString, + [retval, out] IXMLDOMNodeList** resultList); + + [id(DISPID_XMLDOM_NODE_SELECTSINGLENODE), + helpstring("execute query on the subtree")] + HRESULT selectSingleNode( + [in] BSTR queryString, + [retval, out] IXMLDOMNode** resultNode); + + [propget,id(DISPID_XMLDOM_NODE_PARSED), + helpstring("has sub-tree been completely parsed")] + HRESULT parsed( + [retval, out] VARIANT_BOOL * isParsed); + + [propget, id(DISPID_XMLDOM_NODE_NAMESPACE), + helpstring("the URI for the namespace applying to the node")] + HRESULT namespaceURI( + [retval, out] BSTR * namespaceURI); + + [propget, id(DISPID_XMLDOM_NODE_PREFIX), + helpstring("the prefix for the namespace applying to the node")] + HRESULT prefix( + [retval, out] BSTR * prefixString); + + [propget, id(DISPID_XMLDOM_NODE_BASENAME), + helpstring("the base name of the node (nodename with the prefix stripped off)")] + HRESULT baseName( + [retval, out] BSTR * nameString); + + [id(DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT), + helpstring("apply the stylesheet to the subtree, returning the result through a document or a stream")] + HRESULT transformNodeToObject( + [in] IXMLDOMNode * stylesheet, + [in] VARIANT outputObject); + +}; + +[ + local, object, + uuid(2933BF81-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique), + hidden +] +interface IXMLDOMDocument : IXMLDOMNode +{ + // readonly attribute DocumentType doctype; + [propget, id(DISPID_DOM_DOCUMENT_DOCTYPE), + helpstring("node corresponding to the DOCTYPE")] + HRESULT doctype( + [out, retval] IXMLDOMDocumentType ** documentType); + + // readonly attribute DOMImplementation implementation; + [propget, id(DISPID_DOM_DOCUMENT_IMPLEMENTATION), + helpstring("info on this DOM implementation")] + HRESULT implementation( + [out, retval] IXMLDOMImplementation ** impl); + + // attribute Element documentElement; + [propget, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT), + helpstring("the root of the tree")] + HRESULT documentElement( + [out, retval] IXMLDOMElement ** DOMElement); + + [propputref, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT), + helpstring("the root of the tree")] + HRESULT documentElement( + [in] IXMLDOMElement * DOMElement); + + // Element createElement(in wstring tagName); + [id(DISPID_DOM_DOCUMENT_CREATEELEMENT), + helpstring("create an Element node")] + HRESULT createElement( + [in] BSTR tagName, + [out, retval] IXMLDOMElement ** element); + + // DocumentFragment createDocumentFragment(); + [id(DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT), + helpstring("create a DocumentFragment node")] + HRESULT createDocumentFragment( + [out, retval] IXMLDOMDocumentFragment ** docFrag ); + + // Text createTextNode(in wstring data); + [id(DISPID_DOM_DOCUMENT_CREATETEXTNODE), + helpstring("create a text node")] + HRESULT createTextNode( + [in] BSTR data, + [out, retval] IXMLDOMText ** text); + + // Comment createComment(in wstring data); + [id(DISPID_DOM_DOCUMENT_CREATECOMMENT), + helpstring("create a comment node")] + HRESULT createComment( + [in] BSTR data, + [out, retval] IXMLDOMComment ** comment); + + // CDATASection createCDATASection(in wstring data); + [id(DISPID_DOM_DOCUMENT_CREATECDATASECTION), + helpstring("create a CDATA section node")] + HRESULT createCDATASection( + [in] BSTR data, + [out, retval] IXMLDOMCDATASection ** cdata); + + // ProcessingInstruction createProcessingInstruction(in wstring target, + // in wstring data); + [id(DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION), + helpstring("create a processing instruction node")] + HRESULT createProcessingInstruction( + [in] BSTR target, + [in] BSTR data, + [out, retval] IXMLDOMProcessingInstruction ** pi); + + // Attribute createAttribute(in wstring name); + [id(DISPID_DOM_DOCUMENT_CREATEATTRIBUTE), + helpstring("create an attribute node")] + HRESULT createAttribute( + [in] BSTR name, + [out, retval] IXMLDOMAttribute ** attribute); + + // EntityReference createEntityReference(in wstring name); + [id(DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE), + helpstring("create an entity reference node")] + HRESULT createEntityReference( + [in] BSTR name, + [out, retval] IXMLDOMEntityReference ** entityRef); + + // NodeList getElementsByTagName(in wstring tagname); + [id(DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME), + helpstring("build a list of elements by name")] + HRESULT getElementsByTagName( + [in] BSTR tagName, + [out, retval] IXMLDOMNodeList ** resultList); + + [id(DISPID_XMLDOM_DOCUMENT_CREATENODE), + helpstring("create a node of the specified node type and name")] + HRESULT createNode( + [in] VARIANT Type, + [in] BSTR name, + [in] BSTR namespaceURI, + [retval, out] IXMLDOMNode ** node); + + [id(DISPID_XMLDOM_DOCUMENT_NODEFROMID), + helpstring("retrieve node from it's ID")] + HRESULT nodeFromID( + [in] BSTR idString, + [retval, out] IXMLDOMNode ** node); + + [id(DISPID_XMLDOM_DOCUMENT_LOAD), + helpstring("load document from the specified XML source")] + HRESULT load( + [in] VARIANT xmlSource, + [out, retval] VARIANT_BOOL * isSuccessful); + + [propget, id(DISPID_READYSTATE), + helpstring("get the state of the XML document")] + HRESULT readyState( + [retval, out] long * value); + + [propget, id(DISPID_XMLDOM_DOCUMENT_PARSEERROR), + helpstring("get the last parser error")] + HRESULT parseError( + [retval, out] IXMLDOMParseError ** errorObj); + + [propget, id(DISPID_XMLDOM_DOCUMENT_URL), + helpstring("get the URL for the loaded XML document")] + HRESULT url( + [retval, out] BSTR * urlString); + + [propget, id(DISPID_XMLDOM_DOCUMENT_ASYNC), + helpstring("flag for asynchronous download")] + HRESULT async( + [retval, out] VARIANT_BOOL * isAsync); + + [propput, id(DISPID_XMLDOM_DOCUMENT_ASYNC), + helpstring("flag for asynchronous download")] + HRESULT async( + [in] VARIANT_BOOL isAsync); + + [id(DISPID_XMLDOM_DOCUMENT_ABORT), + helpstring("abort an asynchronous download")] + HRESULT abort(); + + [id(DISPID_XMLDOM_DOCUMENT_LOADXML), + helpstring("load the document from a string")] + HRESULT loadXML( + [in] BSTR bstrXML, + [out, retval] VARIANT_BOOL * isSuccessful); + + [id(DISPID_XMLDOM_DOCUMENT_SAVE), + helpstring("save the document to a specified destination")] + HRESULT save( + [in] VARIANT destination); + + [propget, id(DISPID_XMLDOM_DOCUMENT_VALIDATE), + helpstring("indicates whether the parser performs validation")] + HRESULT validateOnParse( + [retval, out] VARIANT_BOOL * isValidating); + + [propput, id(DISPID_XMLDOM_DOCUMENT_VALIDATE), + helpstring("indicates whether the parser performs validation")] + HRESULT validateOnParse( + [in] VARIANT_BOOL isValidating); + + [propget, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE), + helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")] + HRESULT resolveExternals( + [retval,out] VARIANT_BOOL * isResolving); + + [propput, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE), + helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")] + HRESULT resolveExternals( + [in] VARIANT_BOOL isResolving); + + [propget, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE), + helpstring("indicates whether the parser preserves whitespace")] + HRESULT preserveWhiteSpace( + [retval,out] VARIANT_BOOL * isPreserving); + + [propput, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE), + helpstring("indicates whether the parser preserves whitespace")] + HRESULT preserveWhiteSpace( + [in] VARIANT_BOOL isPreserving); + + [propput, id(DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE), + helpstring("register a readystatechange event handler")] + HRESULT onreadystatechange( + [in] VARIANT readystatechangeSink); + + [propput, id(DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE), + helpstring("register an ondataavailable event handler")] + HRESULT ondataavailable( + [in] VARIANT ondataavailableSink); + + [propput, id(DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE), + helpstring("register an ontransformnode event handler")] + HRESULT ontransformnode( + [in] VARIANT ontransformnodeSink); +}; + + +[ + local, object, + uuid(2933BF95-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument2 + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMDocument2 : IXMLDOMDocument +{ + [propget, id(DISPID_XMLDOM_DOCUMENT2_NAMESPACES), + helpstring("A collection of all namespaces for this document")] + HRESULT namespaces( + [out,retval] IXMLDOMSchemaCollection ** namespaceCollection); + + [propget, id(DISPID_XMLDOM_DOCUMENT2_SCHEMAS), + helpstring("The associated schema cache")] + HRESULT schemas( + [out,retval] VARIANT * otherCollection); + + [propputref, id(DISPID_XMLDOM_DOCUMENT2_SCHEMAS), + helpstring("The associated schema cache")] + HRESULT schemas( + [in] VARIANT otherCollection); + + [id(DISPID_XMLDOM_DOCUMENT2_VALIDATE), + helpstring("perform runtime validation on the currently loaded XML document")] + HRESULT validate( + [retval, out] IXMLDOMParseError ** errorObj); + + [id(DISPID_XMLDOM_DOCUMENT2_SETPROPERTY), + helpstring("set the value of the named property")] + HRESULT setProperty( + [in] BSTR name, + [in] VARIANT value); + + [id(DISPID_XMLDOM_DOCUMENT2_GETPROPERTY), + helpstring("get the value of the named property")] + HRESULT getProperty( + [in] BSTR name, + [out,retval] VARIANT * value); +}; + + +[ + local, object, + uuid(2933BF96-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument3 + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMDocument3 : IXMLDOMDocument2 +{ + [id(DISPID_XMLDOM_DOCUMENT3_VALIDATENODE), + helpstring("perform runtime validation on the currently loaded XML document node")] + HRESULT validateNode( + [in] IXMLDOMNode* node, + [out, retval] IXMLDOMParseError ** errorObj); + + [id(DISPID_XMLDOM_DOCUMENT3_IMPORTNODE), + helpstring("clone node such that clones ownerDocument is this document")] + HRESULT importNode( + [in] IXMLDOMNode* node, + [in] VARIANT_BOOL deep, + [out, retval] IXMLDOMNode** clone); +}; + +[ + local, object, + uuid(373984c8-b845-449b-91e7-45ac83036ade), + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schemas Collection"), + pointer_default(unique) +] +interface IXMLDOMSchemaCollection : IDispatch +{ + [id(DISPID_XMLDOM_SCHEMACOLLECTION_ADD), + helpstring("add a new schema")] + HRESULT add( + [in] BSTR namespaceURI, + [in] VARIANT var); + + [id(DISPID_XMLDOM_SCHEMACOLLECTION_GET), + helpstring("lookup schema by namespaceURI")] + HRESULT get( + [in] BSTR namespaceURI, + [out,retval] IXMLDOMNode ** schemaNode); + + [id(DISPID_XMLDOM_SCHEMACOLLECTION_REMOVE), + helpstring("remove schema by namespaceURI")] + HRESULT remove( + [in] BSTR namespaceURI); + + [id(DISPID_XMLDOM_SCHEMACOLLECTION_LENGTH), + helpstring("number of schemas in collection"), propget] + HRESULT length( + [out, retval] long * length); + + [propget, id(DISPID_VALUE), + helpstring("Get namespaceURI for schema by index")] + HRESULT namespaceURI( + [in] long index, + [out, retval] BSTR * length); + + [id(DISPID_XMLDOM_SCHEMACOLLECTION_ADDCOLLECTION), + helpstring("copy & merge other collection into this one")] + HRESULT addCollection( + [in] IXMLDOMSchemaCollection * otherCollection); + + [propget, restricted, hidden, + id(DISPID_NEWENUM)] + HRESULT _newEnum( + [retval, out] IUnknown ** ppUnk); +}; + +[ + local, object, + uuid(2933BF82-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNodeList + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMNodeList : IDispatch +{ + // Node item(in unsigned long index); + [propget, id(DISPID_VALUE), + helpstring("collection of nodes")] + HRESULT item( + [in] long index, + [out, retval] IXMLDOMNode ** listItem); + + // readonly attribute unsigned long length; + [propget, id(DISPID_DOM_NODELIST_LENGTH), + helpstring("number of nodes in the collection")] + HRESULT length( + [out, retval] long * listLength); + + [id(DISPID_XMLDOM_NODELIST_NEXTNODE), + helpstring("get next node from iterator")] + HRESULT nextNode( + [out, retval] IXMLDOMNode ** nextItem); + + [id(DISPID_XMLDOM_NODELIST_RESET), + helpstring("reset the position of iterator")] + HRESULT reset(); + + [propget, restricted, hidden, + id(DISPID_NEWENUM)] + HRESULT _newEnum( + [retval, out] IUnknown ** ppUnk); +}; + + +[ + local, object, + uuid(AA634FC7-5888-44a7-A257-3A47150D3A0E), // IID_IXMLDOMSelection + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMSelection : IXMLDOMNodeList +{ + [propget, id(DISPID_XMLDOM_SELECTION_EXPR), + helpstring("selection expression")] + HRESULT expr( + [out, retval] BSTR * expression); + + [propput, id(DISPID_XMLDOM_SELECTION_EXPR), + helpstring("selection expression")] + HRESULT expr( + [in] BSTR expression); + + [propget, id(DISPID_XMLDOM_SELECTION_CONTEXT), + helpstring("nodes to apply selection expression to")] + HRESULT context( + [out, retval] IXMLDOMNode ** ppNode); + + [propputref, id(DISPID_XMLDOM_SELECTION_CONTEXT), + helpstring("nodes to apply selection expression to")] + HRESULT context( + [in] IXMLDOMNode * pNode); + + [id(DISPID_XMLDOM_SELECTION_PEEKNODE), + helpstring("gets the next node without advancing the list position")] + HRESULT peekNode( + [out, retval] IXMLDOMNode ** ppNode); + + [id(DISPID_XMLDOM_SELECTION_MATCHES), + helpstring("checks to see if the node matches the pattern")] + HRESULT matches( + [in] IXMLDOMNode * pNode, + [out, retval] IXMLDOMNode ** ppNode); + + [id(DISPID_XMLDOM_SELECTION_REMOVENEXT), + helpstring("removes the next node")] + HRESULT removeNext( + [out, retval] IXMLDOMNode ** ppNode); + + [id(DISPID_XMLDOM_SELECTION_REMOVEALL), + helpstring("removes all the nodes that match the selection")] + HRESULT removeAll(); + + [id(DISPID_XMLDOM_SELECTION_CLONE), + helpstring("clone this object with the same position and context")] + HRESULT clone( + [out, retval] IXMLDOMSelection ** ppNode); + + [id(DISPID_XMLDOM_SELECTION_GETPROPERTY), + helpstring("get the value of the named property")] + HRESULT getProperty( + [in] BSTR name, + [out,retval] VARIANT * value); + + [id(DISPID_XMLDOM_SELECTION_SETPROPERTY), + helpstring("set the value of the named property")] + HRESULT setProperty( + [in] BSTR name, + [in] VARIANT value); +}; + + +[ + local, object, + uuid(2933BF83-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNamedNodeMap + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMNamedNodeMap : IDispatch +{ + // Node getNamedItem(in wstring name); + [id(DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM), + helpstring("lookup item by name")] + HRESULT getNamedItem( + [in] BSTR name, + [out, retval] IXMLDOMNode ** namedItem); + + // void setNamedItem(in Node arg); + [id(DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM), + helpstring("set item by name")] + HRESULT setNamedItem( + [in] IXMLDOMNode * newItem, + [out, retval] IXMLDOMNode ** nameItem); + + // Node removeNamedItem(in wstring name); + [id(DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM), + helpstring("remove item by name")] + HRESULT removeNamedItem( + [in] BSTR name, + [out, retval] IXMLDOMNode ** namedItem); + + // Node item(in unsigned long index); + [propget, id(DISPID_VALUE), + helpstring("collection of nodes")] + HRESULT item( + [in] long index, + [out, retval] IXMLDOMNode ** listItem); + + // readonly attribute unsigned long length; + [propget, id(DISPID_DOM_NODELIST_LENGTH), + helpstring("number of nodes in the collection")] + HRESULT length( + [out, retval] long * listLength); + + // Node getQualifiedItem(in wstring name,in Node namespace); + [id(DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM), + helpstring("lookup the item by name and namespace")] + HRESULT getQualifiedItem( + [in] BSTR baseName, + [in] BSTR namespaceURI, + [out, retval] IXMLDOMNode ** qualifiedItem); + + // Node removeQualifiedItem(in wstring name,in Node namespace); + [id(DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM), + helpstring("remove the item by name and namespace")] + HRESULT removeQualifiedItem( + [in] BSTR baseName, + [in] BSTR namespaceURI, + [out, retval] IXMLDOMNode ** qualifiedItem); + + [id(DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE), + helpstring("get next node from iterator")] + HRESULT nextNode( + [out, retval] IXMLDOMNode ** nextItem); + + [id(DISPID_XMLDOM_NAMEDNODEMAP_RESET), + helpstring("reset the position of iterator")] + HRESULT reset(); + + [propget, restricted, hidden, + id(DISPID_NEWENUM)] + HRESULT _newEnum( + [retval, out] IUnknown ** ppUnk); +}; + + +[ + local, object, + uuid(3efaa413-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMDocumentFragment + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMDocumentFragment : IXMLDOMNode +{ +}; + + +[ + local, object, + uuid(2933BF84-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCharacterData + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMCharacterData : IXMLDOMNode +{ + // attribute wstring data; + [propget, id(DISPID_DOM_DATA_DATA), + helpstring("value of the node")] + HRESULT data( + [out, retval] BSTR * data); + + [propput, id(DISPID_DOM_DATA_DATA), + helpstring("value of the node")] + HRESULT data( + [in] BSTR data); + + // readonly attribute unsigned long length; + [propget, id(DISPID_DOM_DATA_LENGTH), + helpstring("number of characters in value")] + HRESULT length( + [out, retval] long * dataLength); + + // wstring substring(in unsigned long offset, + // in unsigned long count) + // raises(DOMException); + [id(DISPID_DOM_DATA_SUBSTRING), + helpstring("retrieve substring of value")] + HRESULT substringData( + [in] long offset, + [in] long count, + [out, retval] BSTR * data); + + // void append(in wstring arg); + [id(DISPID_DOM_DATA_APPEND), + helpstring("append string to value")] + HRESULT appendData( + [in] BSTR data); + + // void insert(in unsigned long offset, + // in wstring arg) + // raises(DOMException); + [id(DISPID_DOM_DATA_INSERT), + helpstring("insert string into value")] + HRESULT insertData( + [in] long offset, + [in] BSTR data); + + // void delete(in unsigned long offset, + // in unsigned long count) + // raises(DOMException); + [id(DISPID_DOM_DATA_DELETE), + helpstring("delete string within the value")] + HRESULT deleteData( + [in] long offset, + [in] long count); + + // void replace(in unsigned long offset, + // in unsigned long count, + // in wstring arg) + // raises(DOMException); + [id(DISPID_DOM_DATA_REPLACE), + helpstring("replace string within the value")] + HRESULT replaceData( + [in] long offset, + [in] long count, + [in] BSTR data); +}; + + +[ + local, object, + uuid(2933BF85-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMAttribute + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMAttribute : IXMLDOMNode +{ + // wstring name; + [propget, id(DISPID_DOM_ATTRIBUTE_GETNAME), + helpstring("get name of the attribute")] + HRESULT name( + [out, retval] BSTR * attributeName); + + // attribute boolean specified; + // ! This is defined as an extended property on IXMLDOMNode + + // attribute wstring value; + [propget, id(DISPID_DOM_ATTRIBUTE_VALUE), + helpstring("string value of the attribute")] + HRESULT value( + [out, retval] VARIANT * attributeValue); + + [propput, id(DISPID_DOM_ATTRIBUTE_VALUE), + helpstring("string value of the attribute")] + HRESULT value( + [in] VARIANT attributeValue); +}; + + +[ + local, object, + uuid(2933BF86-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMElement + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMElement : IXMLDOMNode +{ + // readonly attribute wstring tagName; + [propget, id(DISPID_DOM_ELEMENT_GETTAGNAME), + helpstring("get the tagName of the element")] + HRESULT tagName( + [out, retval] BSTR * tagName); + + // wstring getAttribute(in wstring name); + [id(DISPID_DOM_ELEMENT_GETATTRIBUTE), + helpstring("look up the string value of an attribute by name")] + HRESULT getAttribute( + [in] BSTR name, + [out, retval] VARIANT * value); + + // void setAttribute(in string name, + // in string value); + [id(DISPID_DOM_ELEMENT_SETATTRIBUTE), + helpstring("set the string value of an attribute by name")] + HRESULT setAttribute( + [in] BSTR name, + [in] VARIANT value); + + // void removeAttribute(in wstring name); + [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTE), + helpstring("remove an attribute by name")] + HRESULT removeAttribute( + [in] BSTR name); + + // Attribute getAttributeNode(in wstring name); + [id(DISPID_DOM_ELEMENT_GETATTRIBUTENODE), + helpstring("look up the attribute node by name")] + HRESULT getAttributeNode( + [in] BSTR name, + [out, retval] IXMLDOMAttribute ** attributeNode); + + // void setAttributeNode(in Attribute newAttr); + [id(DISPID_DOM_ELEMENT_SETATTRIBUTENODE), + helpstring("set the specified attribute on the element")] + HRESULT setAttributeNode( + [in] IXMLDOMAttribute * DOMAttribute, + [out, retval] IXMLDOMAttribute ** attributeNode); + + // void removeAttributeNode(in Attribute oldAttr); + [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE), + helpstring("remove the specified attribute")] + HRESULT removeAttributeNode( + [in] IXMLDOMAttribute * DOMAttribute, + [out, retval] IXMLDOMAttribute ** attributeNode); + + // NodeList getElementsByTagName(in wstring tagname); + [id(DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME), + helpstring("build a list of elements by name")] + HRESULT getElementsByTagName( + [in] BSTR tagName, + [out, retval] IXMLDOMNodeList ** resultList); + + // void normalize(); + [id(DISPID_DOM_ELEMENT_NORMALIZE), + helpstring("collapse all adjacent text nodes in sub-tree")] + HRESULT normalize(); +}; + + +[ + local, object, + uuid(2933BF87-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMText + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMText : IXMLDOMCharacterData +{ + // Text splitText(in unsigned long offset); + [id(DISPID_DOM_TEXT_SPLITTEXT), + helpstring("split the text node into two text nodes at the position specified")] + HRESULT splitText( + [in] long offset, + [out, retval] IXMLDOMText ** rightHandTextNode); +}; + + +[ + local, object, + uuid(2933BF88-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMComment + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMComment : IXMLDOMCharacterData +{ +}; + + +[ + local, object, + uuid(2933BF89-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMProcessingInstruction + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMProcessingInstruction : IXMLDOMNode +{ + // read-only attribute wstring target; + [propget, id(DISPID_DOM_PI_TARGET), + helpstring("the target")] + HRESULT target( + [out, retval] BSTR * name); + + // attribute wstring data; + [propget, id(DISPID_DOM_PI_DATA), + helpstring("the data")] + HRESULT data( + [out, retval] BSTR * value); + + [propput, id(DISPID_DOM_PI_DATA), + helpstring("the data")] + HRESULT data( + [in] BSTR value); +}; + + +[ + local, object, + uuid(2933BF8A-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCDATASection + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMCDATASection : IXMLDOMText +{ +}; + + +[ + local, object, + uuid(2933BF8B-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocumentType + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMDocumentType : IXMLDOMNode +{ + // readonly attribute wstring name; + [propget, id(DISPID_DOM_DOCUMENTTYPE_NAME), + helpstring("name of the document type (root of the tree)")] + HRESULT name( + [out, retval] BSTR * rootName); + + // readonly attribute NamedNodeMap entities; + [propget, id(DISPID_DOM_DOCUMENTTYPE_ENTITIES), + helpstring("a list of entities in the document")] + HRESULT entities( + [out, retval] IXMLDOMNamedNodeMap ** entityMap); + + // readonly attribute NamedNodeMap notations; + [propget, id(DISPID_DOM_DOCUMENTTYPE_NOTATIONS), + helpstring("a list of notations in the document")] + HRESULT notations( + [out, retval] IXMLDOMNamedNodeMap ** notationMap); +}; + + +[ + local, object, + uuid(2933BF8C-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNotation + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMNotation : IXMLDOMNode +{ + // attribute wstring publicId; + [propget, id(DISPID_DOM_NOTATION_PUBLICID), + helpstring("the public ID")] + HRESULT publicId( + [out, retval] VARIANT * publicID); + + // attribute wstring systemId; + [propget, id(DISPID_DOM_NOTATION_SYSTEMID), + helpstring("the system ID")] + HRESULT systemId( + [out, retval] VARIANT * systemID); +}; + + +[ + local, object, + uuid(2933BF8D-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntity + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMEntity : IXMLDOMNode +{ + // attribute wstring publicId; + [propget, id(DISPID_DOM_ENTITY_PUBLICID), + helpstring("the public ID")] + HRESULT publicId( + [out, retval] VARIANT * publicID); + + // attribute wstring systemId; + [propget, id(DISPID_DOM_ENTITY_SYSTEMID), + helpstring("the system ID")] + HRESULT systemId( + [out, retval] VARIANT * systemID); + + // attribute wstring notationName; + [propget, id(DISPID_DOM_ENTITY_NOTATIONNAME), + helpstring("the name of the notation")] + HRESULT notationName( + [out, retval] BSTR * name); +}; + + +[ + local, object, + uuid(2933BF8E-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntityReference + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IXMLDOMEntityReference : IXMLDOMNode +{ +}; + +[ + local, object, + nonextensible, + pointer_default(unique), + odl, + oleautomation, + dual, + uuid(2933BF8F-7B36-11d2-B20E-00C04F983E60) // IID_IXMLDOMImplementation +] +interface IXMLDOMImplementation : IDispatch +{ + // boolean hasFeature(in wstring feature, + // in wstring version); + [id(DISPID_DOM_IMPLEMENTATION_HASFEATURE)] + HRESULT hasFeature( + [in] BSTR feature, + [in] BSTR version, + [out, retval] VARIANT_BOOL * hasFeature); +}; + + +[ + local, object, + uuid(3efaa425-272f-11d2-836f-0000f87a7782), // IID_IXTLRuntime + odl, + dual, + oleautomation, + nonextensible, + helpstring("XTL runtime object"), + pointer_default(unique) +] +interface IXTLRuntime : IXMLDOMNode +{ + [id(DISPID_XTLRUNTIME_UNIQUEID), + helpstring("")] + HRESULT uniqueID( + [in]IXMLDOMNode *pNode, + [out,retval]long *pID); + + [id(DISPID_XTLRUNTIME_DEPTH), + helpstring("")] + HRESULT depth( + [in] IXMLDOMNode *pNode, + [out,retval]long * pDepth); + + [id(DISPID_XTLRUNTIME_CHILDNUMBER), + helpstring("")] + HRESULT childNumber( + [in]IXMLDOMNode *pNode, + [out,retval] long *pNumber); + + [id(DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER), + helpstring("")] + HRESULT ancestorChildNumber( + [in]BSTR bstrNodeName, + [in]IXMLDOMNode *pNode, + [out,retval]long *pNumber); + + [id(DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER), + helpstring("")] + HRESULT absoluteChildNumber( + [in]IXMLDOMNode *pNode, + [out,retval]long *pNumber); + + [id(DISPID_XTLRUNTIME_FORMATINDEX), + helpstring("")] + HRESULT formatIndex( + [in] long lIndex, + [in] BSTR bstrFormat, + [out, retval]BSTR *pbstrFormattedString); + + [id(DISPID_XTLRUNTIME_FORMATNUMBER), + helpstring("")] + HRESULT formatNumber( + [in] double dblNumber, + [in] BSTR bstrFormat, + [out, retval]BSTR *pbstrFormattedString); + + [id(DISPID_XTLRUNTIME_FORMATDATE), + helpstring("")] + HRESULT formatDate( + [in] VARIANT varDate, + [in] BSTR bstrFormat, + [in,optional] VARIANT varDestLocale, + [out, retval]BSTR *pbstrFormattedString); + + [id(DISPID_XTLRUNTIME_FORMATTIME), + helpstring("")] + HRESULT formatTime( + [in] VARIANT varTime, + [in] BSTR bstrFormat, + [in,optional] VARIANT varDestLocale, + [out, retval]BSTR *pbstrFormattedString); +}; + +[ + local, object, + uuid(3efaa426-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseError + odl, + dual, + oleautomation, + nonextensible, + helpstring("structure for reporting parser errors"), + pointer_default(unique) +] +interface IXMLDOMParseError : IDispatch +{ + [propget, id(DISPID_VALUE), + helpstring("the error code")] + HRESULT errorCode( + [retval, out] long * errorCode); + + [propget, id(DISPID_DOM_ERROR_URL), + helpstring("the URL of the XML document containing the error")] + HRESULT url( + [retval, out] BSTR * urlString); + + [propget, id(DISPID_DOM_ERROR_REASON), + helpstring("the cause of the error")] + HRESULT reason( + [retval, out] BSTR * reasonString); + + [propget, id(DISPID_DOM_ERROR_SRCTEXT), + helpstring("the data where the error occurred")] + HRESULT srcText( + [retval, out] BSTR * sourceString); + + [propget, id(DISPID_DOM_ERROR_LINE), + helpstring("the line number in the XML document where the error occurred")] + HRESULT line( + [retval, out] long * lineNumber); + + [propget, id(DISPID_DOM_ERROR_LINEPOS), + helpstring("the character position in the line containing the error")] + HRESULT linepos( + [retval, out] long * linePosition); + + [propget, id(DISPID_DOM_ERROR_FILEPOS), + helpstring("the absolute file position in the XML document containing the error")] + HRESULT filepos( + [retval, out] long * filePosition); +}; + +[ + local, object, + uuid(3efaa428-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseError2 + odl, + dual, + oleautomation, + nonextensible, + helpstring("structure for reporting parser errors"), + pointer_default(unique) +] +interface IXMLDOMParseError2 : IXMLDOMParseError +{ + [propget, id(DISPID_DOM_ERROR2_ERRORXPATH)] + HRESULT errorXPath( + [out, retval] BSTR * xpathexpr); + + [propget, id(DISPID_DOM_ERROR2_ALLERRORS)] + HRESULT allErrors( + [out, retval] IXMLDOMParseErrorCollection ** allErrors); + + [id(DISPID_DOM_ERROR2_ERRORPARAMETERS)] + HRESULT errorParameters( + [in] long index, + [out,retval] BSTR* param); + + [propget, id(DISPID_DOM_ERROR2_ERRORPARAMETERSCOUNT)] + HRESULT errorParametersCount( + [out,retval] long* count); +}; + + +[ + local, object, + uuid(3efaa429-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseErrorCollection + odl, + dual, + oleautomation, + nonextensible, + helpstring("structure for reporting parser errors"), + pointer_default(unique) +] +interface IXMLDOMParseErrorCollection : IDispatch +{ + [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]IXMLDOMParseError2 ** error); + [id(DISPID_DOM_ERRORCOLLECTION_LENGTH), propget] HRESULT length([out,retval]long * length); + [id(DISPID_DOM_ERRORCOLLECTION_NEXT), propget] HRESULT next([out, retval] IXMLDOMParseError2 ** error); + [id(DISPID_DOM_ERRORCOLLECTION_RESET)] HRESULT reset(); + [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown ** ppunk); +}; + +// DOM event interface +[ + hidden, + uuid(3efaa427-272f-11d2-836f-0000f87a7782) // IID_IXMLDOMEvent +] +dispinterface XMLDOMDocumentEvents +{ + properties: + methods: + [id (DISPID_XMLDOMEVENT_ONDATAAVAILABLE)] + HRESULT ondataavailable(void); + + [id (DISPID_XMLDOMEVENT_ONREADYSTATECHANGE)] + HRESULT onreadystatechange(void); +}; + + +[ + local, object, + uuid(2933BF92-7B36-11d2-B20E-00C04F983E60), // IXSLProcessor + odl, + dual, + oleautomation, + nonextensible, + helpstring("IXSLProcessor Interface"), + pointer_default(unique) +] +interface IXSLProcessor : IDispatch +{ + [propput, id(DISPID_XMLDOM_PROCESSOR_INPUT), helpstring("XML input tree to transform")] + HRESULT input([in] VARIANT var); + + [propget, id(DISPID_XMLDOM_PROCESSOR_INPUT), helpstring("XML input tree to transform")] + HRESULT input([out,retval] VARIANT * pVar); + + [propget, id(DISPID_XMLDOM_PROCESSOR_XSLTEMPLATE), helpstring("template object used to create this processor object")] + HRESULT ownerTemplate([out,retval] IXSLTemplate** ppTemplate); + + [id(DISPID_XMLDOM_PROCESSOR_SETSTARTMODE), helpstring("set XSL mode and it's namespace")] + HRESULT setStartMode([in] BSTR mode, + [in, defaultvalue("")] BSTR namespaceURI); + + [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODE), helpstring("starting XSL mode")] + HRESULT startMode([out, retval] BSTR * mode); + + [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODEURI), helpstring("namespace of starting XSL mode")] + HRESULT startModeURI([out, retval] BSTR * namespaceURI); + + [propput, id(DISPID_XMLDOM_PROCESSOR_OUTPUT), helpstring("custom stream object for transform output")] + HRESULT output([in] VARIANT output); + + [propget, id(DISPID_XMLDOM_PROCESSOR_OUTPUT), helpstring("transform output")] + HRESULT output([out, retval] VARIANT* pOutput); + + [id(DISPID_XMLDOM_PROCESSOR_TRANSFORM), helpstring("start/resume the XSL transformation process")] + HRESULT transform([out,retval] VARIANT_BOOL* pDone); + + [id(DISPID_XMLDOM_PROCESSOR_RESET), helpstring("reset state of processor and abort current transform")] + HRESULT reset(); + + [propget, id(DISPID_XMLDOM_PROCESSOR_READYSTATE), helpstring("current state of the processor")] + HRESULT readyState([out, retval] long* pReadyState); + + [id(DISPID_XMLDOM_PROCESSOR_ADDPARAMETER), helpstring("set values")] + HRESULT addParameter([in] BSTR baseName, + [in] VARIANT parameter, + [in, defaultvalue("")] BSTR namespaceURI); + + [id(DISPID_XMLDOM_PROCESSOR_ADDOBJECT), helpstring("pass object to stylesheet")] + HRESULT addObject([in] IDispatch* obj, + [in] BSTR namespaceURI); + + [propget, id(DISPID_XMLDOM_PROCESSOR_STYLESHEET), helpstring("current stylesheet being used")] + HRESULT stylesheet([out,retval] IXMLDOMNode** stylesheet); +}; + + +[ + local, object, + uuid(2933BF93-7B36-11d2-B20E-00C04F983E60), // IID_IXSLTemplate + odl, + dual, + oleautomation, + nonextensible, + helpstring("IXSLTemplate Interface"), + pointer_default(unique) +] +interface IXSLTemplate : IDispatch +{ + [propputref, id(DISPID_XMLDOM_TEMPLATE_STYLESHEET), helpstring("stylesheet to use with processors")] + HRESULT stylesheet([in] IXMLDOMNode* stylesheet); + + [propget, id(DISPID_XMLDOM_TEMPLATE_STYLESHEET), helpstring("stylesheet to use with processors")] + HRESULT stylesheet([out, retval] IXMLDOMNode** stylesheet); + + [id(DISPID_XMLDOM_TEMPLATE_CREATEPROCESSOR), helpstring("create a new processor object")] + HRESULT createProcessor([out, retval] IXSLProcessor** ppProcessor); +}; + +[ + object, + uuid(ED8C108D-4349-11D2-91A4-00C04F7969E8), + odl, + dual, + oleautomation, + helpstring("IXMLHTTPRequest Interface"), + pointer_default(unique) +] +interface IXMLHTTPRequest : IDispatch +{ + [id(1), helpstring("Open HTTP connection")] HRESULT open([in] BSTR bstrMethod, [in] BSTR bstrUrl, [in,optional] VARIANT varAsync, [in,optional] VARIANT bstrUser, [in,optional] VARIANT bstrPassword); + [id(2), helpstring("Add HTTP request header")] HRESULT setRequestHeader([in] BSTR bstrHeader, [in] BSTR bstrValue); + [id(3), helpstring("Get HTTP response header")] HRESULT getResponseHeader([in] BSTR bstrHeader, [out, retval] BSTR * pbstrValue); + [id(4), helpstring("Get all HTTP response headers")] HRESULT getAllResponseHeaders([out, retval] BSTR * pbstrHeaders); + [id(5), helpstring("Send HTTP request")] HRESULT send([in, optional] VARIANT varBody); + [id(6), helpstring("Abort HTTP request")] HRESULT abort(); + [propget, id(7), helpstring("Get HTTP status code")] HRESULT status([out, retval] long * plStatus); + [propget, id(8), helpstring("Get HTTP status text")] HRESULT statusText([out, retval] BSTR * pbstrStatus); + [propget, id(9), helpstring("Get response body")] HRESULT responseXML([out, retval] IDispatch ** ppBody); + [propget, id(10), helpstring("Get response body")] HRESULT responseText([out, retval] BSTR * pbstrBody); + [propget, id(11), helpstring("Get response body")] HRESULT responseBody([out, retval] VARIANT * pvarBody); + [propget, id(12), helpstring("Get response body")] HRESULT responseStream([out, retval] VARIANT * pvarBody); + [propget, id(13), helpstring("Get ready state")] HRESULT readyState([out, retval] long * plState); + [propput, id(14), helpstring("Register a complete event handler")] HRESULT onreadystatechange([in] IDispatch * pReadyStateSink); +}; + +cpp_quote("#if !defined(__msxml_sxh_enums__)") +cpp_quote("#define __msxml_sxh_enums__") +typedef [ + helpstring("Options for ServerXMLHTTPRequest Option property") +] +enum _SERVERXMLHTTP_OPTION +{ + SXH_OPTION_URL = -1, + SXH_OPTION_URL_CODEPAGE, + SXH_OPTION_ESCAPE_PERCENT_IN_URL, + SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, + SXH_OPTION_SELECT_CLIENT_SSL_CERT +} SERVERXMLHTTP_OPTION; + +typedef [ + helpstring("Flags for SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS option") +] +enum _SXH_SERVER_CERT_OPTION +{ + SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x00000100, + SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x00000200, + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x00001000, + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x00002000, + SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = (SXH_SERVER_CERT_IGNORE_UNKNOWN_CA + + SXH_SERVER_CERT_IGNORE_WRONG_USAGE + + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID + + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID) +} SXH_SERVER_CERT_OPTION; + +typedef [ + helpstring("Settings for setProxy") +] +enum _SXH_PROXY_SETTING +{ + SXH_PROXY_SET_DEFAULT = 0x00000000, + SXH_PROXY_SET_PRECONFIG = 0x00000000, + SXH_PROXY_SET_DIRECT = 0x00000001, + SXH_PROXY_SET_PROXY = 0x00000002 +} SXH_PROXY_SETTING; +cpp_quote("#endif // !defined(__msxml_sxh_enums__)") + + +[ + object, + uuid(2e9196bf-13ba-4dd4-91ca-6c571f281495), + odl, + dual, + oleautomation, + helpstring("IServerXMLHTTPRequest Interface"), + pointer_default(unique) +] +interface IServerXMLHTTPRequest : IXMLHTTPRequest +{ + [id(15), helpstring("Specify timeout settings (in milliseconds)")] + HRESULT setTimeouts([in] long resolveTimeout, [in] long connectTimeout, [in] long sendTimeout, [in] long receiveTimeout); + + [id(16), helpstring("Wait for asynchronous send to complete, with optional timeout (in seconds)")] + HRESULT waitForResponse([in, optional] VARIANT timeoutInSeconds, [out, retval] VARIANT_BOOL * isSuccessful); + + [id(17), helpstring("Get an option value")] + HRESULT getOption([in] SERVERXMLHTTP_OPTION option, [out, retval] VARIANT * value); + + [id(18), helpstring("Set an option value")] + HRESULT setOption([in] SERVERXMLHTTP_OPTION option, [in] VARIANT value); +}; + +[ + object, + uuid(2e01311b-c322-4b0a-bd77-b90cfdc8dce7), + odl, + dual, + oleautomation, + helpstring("IServerXMLHTTPRequest2 Interface"), + pointer_default(unique) +] +interface IServerXMLHTTPRequest2 : IServerXMLHTTPRequest +{ + [id(19), helpstring("Specify proxy configuration")] + HRESULT setProxy( + [in] SXH_PROXY_SETTING proxySetting, + [in, optional] VARIANT varProxyServer, + [in, optional] VARIANT varBypassList); + + [id(20), helpstring("Specify proxy authentication credentials")] + HRESULT setProxyCredentials( + [in] BSTR bstrUserName, + [in] BSTR bstrPassword); +}; + +//+----------------------------------------------------------------------------- +// +// SAX interfaces +// +//------------------------------------------------------------------------------ + +[ + hidden, + object, + local, + uuid(a4f96ed0-f829-476e-81c0-cdc7bd2a0802), // IID_ISAXXMLReader + helpstring("ISAXXMLReader interface"), + pointer_default(unique) +] +interface ISAXXMLReader : IUnknown +{ + HRESULT getFeature( + [in] const wchar_t * pwchName, + [out, retval] VARIANT_BOOL * pvfValue); + HRESULT putFeature( + [in] const wchar_t * pwchName, + [in] VARIANT_BOOL vfValue); + + HRESULT getProperty( + [in] const wchar_t * pwchName, + [out, retval] VARIANT * pvarValue); + HRESULT putProperty( + [in] const wchar_t * pwchName, + [in] VARIANT varValue); + + HRESULT getEntityResolver( + [out, retval] ISAXEntityResolver ** ppResolver); + HRESULT putEntityResolver( + [in] ISAXEntityResolver * pResolver); + + HRESULT getContentHandler( + [out, retval] ISAXContentHandler ** ppHandler); + HRESULT putContentHandler( + [in] ISAXContentHandler * pHandler); + + HRESULT getDTDHandler( + [out, retval] ISAXDTDHandler ** ppHandler); + HRESULT putDTDHandler( + [in] ISAXDTDHandler * pHandler); + + HRESULT getErrorHandler( + [out, retval] ISAXErrorHandler ** ppHandler); + HRESULT putErrorHandler( + [in] ISAXErrorHandler * pHandler); + + HRESULT getBaseURL( + [out, retval] const wchar_t ** ppwchBaseUrl); + HRESULT putBaseURL( + [in] const wchar_t * pwchBaseUrl); + + HRESULT getSecureBaseURL( + [out, retval] const wchar_t ** ppwchSecureBaseUrl); + HRESULT putSecureBaseURL( + [in] const wchar_t * pwchSecureBaseUrl); + + HRESULT parse( + [in, optional] VARIANT varInput); + HRESULT parseURL( + [in] const wchar_t * pwchUrl); +}; + +[ + hidden, + object, + local, + uuid(70409222-ca09-4475-acb8-40312fe8d145), // IID_ISAXXMLFilter + helpstring("ISAXXMLFilter interface"), + pointer_default(unique) +] +interface ISAXXMLFilter : ISAXXMLReader +{ + HRESULT getParent( + [out, retval] ISAXXMLReader ** ppReader); + HRESULT putParent( + [in] ISAXXMLReader * pReader); +}; + +[ + hidden, + object, + local, + uuid(9b7e472a-0de4-4640-bff3-84d38a051c31), // IID_ISAXLocator + helpstring("ISAXLocator interface"), + pointer_default(unique) +] +interface ISAXLocator : IUnknown +{ + HRESULT getColumnNumber( + [out, retval] int * pnColumn); + + HRESULT getLineNumber( + [out, retval] int * pnLine); + + HRESULT getPublicId( + [out, retval] const wchar_t ** ppwchPublicId); + + HRESULT getSystemId( + [out, retval] const wchar_t ** ppwchSystemId); +}; + +[ + hidden, + object, + local, + uuid(99bca7bd-e8c4-4d5f-a0cf-6d907901ff07), // IID_ISAXEntityResolver + helpstring("ISAXEntityResolver interface"), + pointer_default(unique) +] +interface ISAXEntityResolver : IUnknown +{ + HRESULT resolveEntity( + [in] const wchar_t * pwchPublicId, + [in] const wchar_t * pwchSystemId, + [out, retval] VARIANT * pvarInput); +}; + +[ + hidden, + object, + local, + uuid(1545cdfa-9e4e-4497-a8a4-2bf7d0112c44), // IID_ISAXContentHandler + helpstring("ISAXContentHandler interface"), + pointer_default(unique) +] +interface ISAXContentHandler : IUnknown +{ + HRESULT putDocumentLocator( + [in] ISAXLocator * pLocator); + + HRESULT startDocument(); + + HRESULT endDocument(); + + HRESULT startPrefixMapping( + [in] const wchar_t * pwchPrefix, + [in] int cchPrefix, + [in] const wchar_t * pwchUri, + [in] int cchUri); + + HRESULT endPrefixMapping( + [in] const wchar_t * pwchPrefix, + [in] int cchPrefix); + + HRESULT startElement( + [in] const wchar_t * pwchNamespaceUri, + [in] int cchNamespaceUri, + [in] const wchar_t * pwchLocalName, + [in] int cchLocalName, + [in] const wchar_t * pwchQName, + [in] int cchQName, + [in] ISAXAttributes * pAttributes); + + HRESULT endElement( + [in] const wchar_t * pwchNamespaceUri, + [in] int cchNamespaceUri, + [in] const wchar_t * pwchLocalName, + [in] int cchLocalName, + [in] const wchar_t * pwchQName, + [in] int cchQName); + + HRESULT characters( + [in] const wchar_t * pwchChars, + [in] int cchChars); + + HRESULT ignorableWhitespace( + [in] const wchar_t * pwchChars, + [in] int cchChars); + + HRESULT processingInstruction( + [in] const wchar_t * pwchTarget, + [in] int cchTarget, + [in] const wchar_t * pwchData, + [in] int cchData); + + HRESULT skippedEntity( + [in] const wchar_t * pwchName, + [in] int cchName); +}; + +[ + hidden, + object, + local, + uuid(e15c1baf-afb3-4d60-8c36-19a8c45defed), // IID_ISAXDTDHandler + helpstring("ISAXDTDHandler interface"), + pointer_default(unique) +] +interface ISAXDTDHandler : IUnknown +{ + HRESULT notationDecl( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchPublicId, + [in] int cchPublicId, + [in] const wchar_t * pwchSystemId, + [in] int cchSystemId); + + HRESULT unparsedEntityDecl( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchPublicId, + [in] int cchPublicId, + [in] const wchar_t * pwchSystemId, + [in] int cchSystemId, + [in] const wchar_t * pwchNotationName, + [in] int cchNotationName); +}; + +[ + hidden, + object, + local, + uuid(a60511c4-ccf5-479e-98a3-dc8dc545b7d0), // IID_ISAXErrorHandler + helpstring("ISAXErrorHandler interface"), + pointer_default(unique) +] +interface ISAXErrorHandler : IUnknown +{ + HRESULT error( + [in] ISAXLocator * pLocator, + [in] const wchar_t * pwchErrorMessage, + [in] HRESULT hrErrorCode); + + HRESULT fatalError( + [in] ISAXLocator * pLocator, + [in] const wchar_t * pwchErrorMessage, + [in] HRESULT hrErrorCode); + + HRESULT ignorableWarning( + [in] ISAXLocator * pLocator, + [in] const wchar_t * pwchErrorMessage, + [in] HRESULT hrErrorCode); +}; + +[ + hidden, + object, + local, + uuid(7f85d5f5-47a8-4497-bda5-84ba04819ea6), // IID_ISAXLexicalHandler + helpstring("ISAXLexicalHandler interface"), + pointer_default(unique) +] +interface ISAXLexicalHandler : IUnknown +{ + HRESULT startDTD( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchPublicId, + [in] int cchPublicId, + [in] const wchar_t * pwchSystemId, + [in] int cchSystemId); + + HRESULT endDTD(); + + HRESULT startEntity( + [in] const wchar_t * pwchName, + [in] int cchName); + + HRESULT endEntity( + [in] const wchar_t * pwchName, + [in] int cchName); + + HRESULT startCDATA(); + + HRESULT endCDATA(); + + HRESULT comment( + [in] const wchar_t * pwchChars, + [in] int cchChars); +}; + +[ + hidden, + object, + local, + uuid(862629ac-771a-47b2-8337-4e6843c1be90), // IID_ISAXDeclHandler + helpstring("ISAXDeclHandler interface"), + pointer_default(unique) +] +interface ISAXDeclHandler : IUnknown +{ + HRESULT elementDecl( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchModel, + [in] int cchModel); + + HRESULT attributeDecl( + [in] const wchar_t * pwchElementName, + [in] int cchElementName, + [in] const wchar_t * pwchAttributeName, + [in] int cchAttributeName, + [in] const wchar_t * pwchType, + [in] int cchType, + [in] const wchar_t * pwchValueDefault, + [in] int cchValueDefault, + [in] const wchar_t * pwchValue, + [in] int cchValue); + + HRESULT internalEntityDecl( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchValue, + [in] int cchValue); + + HRESULT externalEntityDecl( + [in] const wchar_t * pwchName, + [in] int cchName, + [in] const wchar_t * pwchPublicId, + [in] int cchPublicId, + [in] const wchar_t * pwchSystemId, + [in] int cchSystemId); +}; + +[ + hidden, + object, + local, + uuid(f078abe1-45d2-4832-91ea-4466ce2f25c9), // IID_ISAXAttributes + helpstring("ISAXAttributes interface"), + pointer_default(unique) +] +interface ISAXAttributes : IUnknown +{ + HRESULT getLength( + [out, retval] int * pnLength); + + HRESULT getURI( + [in] int nIndex, + [out] const wchar_t ** ppwchUri, + [out] int * pcchUri); + + HRESULT getLocalName( + [in] int nIndex, + [out] const wchar_t ** ppwchLocalName, + [out] int * pcchLocalName); + + HRESULT getQName( + [in] int nIndex, + [out] const wchar_t ** ppwchQName, + [out] int * pcchQName); + + HRESULT getName( + [in] int nIndex, + [out] const wchar_t ** ppwchUri, + [out] int * pcchUri, + [out] const wchar_t ** ppwchLocalName, + [out] int * pcchLocalName, + [out] const wchar_t ** ppwchQName, + [out] int * pcchQName); + + HRESULT getIndexFromName( + [in] const wchar_t * pwchUri, + [in] int cchUri, + [in] const wchar_t * pwchLocalName, + [in] int cchLocalName, + [out, retval] int * pnIndex); + + HRESULT getIndexFromQName( + [in] const wchar_t * pwchQName, + [in] int cchQName, + [out, retval] int * pnIndex); + + HRESULT getType( + [in] int nIndex, + [out] const wchar_t ** ppwchType, + [out] int * pcchType); + + HRESULT getTypeFromName( + [in] const wchar_t * pwchUri, + [in] int cchUri, + [in] const wchar_t * pwchLocalName, + [in] int cchLocalName, + [out] const wchar_t ** ppwchType, + [out] int * pcchType); + + HRESULT getTypeFromQName( + [in] const wchar_t * pwchQName, + [in] int cchQName, + [out] const wchar_t ** ppwchType, + [out] int * pcchType); + + HRESULT getValue( + [in] int nIndex, + [out] const wchar_t ** ppwchValue, + [out] int * pcchValue); + + HRESULT getValueFromName( + [in] const wchar_t * pwchUri, + [in] int cchUri, + [in] const wchar_t * pwchLocalName, + [in] int cchLocalName, + [out] const wchar_t ** ppwchValue, + [out] int * pcchValue); + + HRESULT getValueFromQName( + [in] const wchar_t * pwchQName, + [in] int cchQName, + [out] const wchar_t ** ppwchValue, + [out] int * pcchValue); +}; + +//+----------------------------------------------------------------------------- +// +// SAX dispatch interfaces +// +//------------------------------------------------------------------------------ + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(8c033caa-6cd6-4f73-b728-4531af74945f), // IID_IVBSAXXMLReader + helpstring("IVBSAXXMLReader interface"), + pointer_default(unique) +] +interface IVBSAXXMLReader : IDispatch +{ + [id(DISPID_SAX_XMLREADER_GETFEATURE), helpstring("Look up the value of a feature.")] + HRESULT getFeature( + [in] BSTR strName, + [out, retval] VARIANT_BOOL * fValue); + [id(DISPID_SAX_XMLREADER_PUTFEATURE), helpstring("Set the state of a feature.")] + HRESULT putFeature( + [in] BSTR strName, + [in] VARIANT_BOOL fValue); + + [id(DISPID_SAX_XMLREADER_GETPROPERTY), helpstring("Look up the value of a property.")] + HRESULT getProperty( + [in] BSTR strName, + [out, retval] VARIANT * varValue); + [id(DISPID_SAX_XMLREADER_PUTPROPERTY), helpstring("Set the value of a property.")] + HRESULT putProperty( + [in] BSTR strName, + [in] VARIANT varValue); + + [propget, id(DISPID_SAX_XMLREADER_ENTITYRESOLVER), helpstring("Allow an application to register an entity resolver or look up the current entity resolver.")] + HRESULT entityResolver( + [out, retval] IVBSAXEntityResolver ** oResolver); + [propputref, id(DISPID_SAX_XMLREADER_ENTITYRESOLVER), helpstring("Allow an application to register an entity resolver or look up the current entity resolver.")] + HRESULT entityResolver( + [in] IVBSAXEntityResolver * oResolver); + + [propget, id(DISPID_SAX_XMLREADER_CONTENTHANDLER), helpstring("Allow an application to register a content event handler or look up the current content event handler.")] + HRESULT contentHandler( + [out, retval] IVBSAXContentHandler ** oHandler); + [propputref, id(DISPID_SAX_XMLREADER_CONTENTHANDLER), helpstring("Allow an application to register a content event handler or look up the current content event handler")] + HRESULT contentHandler( + [in] IVBSAXContentHandler * oHandler); + + [propget, id(DISPID_SAX_XMLREADER_DTDHANDLER), helpstring("Allow an application to register a DTD event handler or look up the current DTD event handler.")] + HRESULT dtdHandler( + [out, retval] IVBSAXDTDHandler ** oHandler); + [propputref, id(DISPID_SAX_XMLREADER_DTDHANDLER), helpstring("Allow an application to register a DTD event handler or look up the current DTD event handler.")] + HRESULT dtdHandler( + [in] IVBSAXDTDHandler * oHandler); + + [propget, id(DISPID_SAX_XMLREADER_ERRORHANDLER), helpstring("Allow an application to register an error event handler or look up the current error event handler.")] + HRESULT errorHandler( + [out, retval] IVBSAXErrorHandler ** oHandler); + [propputref, id(DISPID_SAX_XMLREADER_ERRORHANDLER), helpstring("Allow an application to register an error event handler or look up the current error event handler.")] + HRESULT errorHandler( + [in] IVBSAXErrorHandler * oHandler); + + [propget, id(DISPID_SAX_XMLREADER_BASEURL), helpstring("Set or get the base URL for the document.")] + HRESULT baseURL( + [out, retval] BSTR * strBaseURL); + [propput, id(DISPID_SAX_XMLREADER_BASEURL), helpstring("Set or get the base URL for the document.")] + HRESULT baseURL( + [in] BSTR strBaseURL); + + [propget, id(DISPID_SAX_XMLREADER_SECUREBASEURL), helpstring("Set or get the secure base URL for the document.")] + HRESULT secureBaseURL( + [out, retval] BSTR * strSecureBaseURL); + [propput, id(DISPID_SAX_XMLREADER_SECUREBASEURL), helpstring("Set or get the secure base URL for the document.")] + HRESULT secureBaseURL( + [in] BSTR strSecureBaseURL); + + [id(DISPID_SAX_XMLREADER_PARSE), helpstring("Parse an XML document.")] + HRESULT parse( + [in, optional] VARIANT varInput); + [id(DISPID_SAX_XMLREADER_PARSEURL), helpstring("Parse an XML document from a system identifier (URI).")] + HRESULT parseURL( + [in] BSTR strURL); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(1299eb1b-5b88-433e-82de-82ca75ad4e04), // IID_IVBSAXXMLFilter + helpstring("IVBSAXXMLFilter interface"), + pointer_default(unique) +] +interface IVBSAXXMLFilter : IDispatch +{ + [propget, id(DISPID_SAX_XMLFILTER_PARENT), helpstring("Set or get the parent reader")] + HRESULT parent( + [out, retval] IVBSAXXMLReader ** oReader); + [propputref, id(DISPID_SAX_XMLFILTER_PARENT), helpstring("Set or get the parent reader")] + HRESULT parent( + [in] IVBSAXXMLReader * oReader); + +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(796e7ac5-5aa2-4eff-acad-3faaf01a3288), // IID_IVBSAXLocator + helpstring("IVBSAXLocator interface"), + pointer_default(unique) +] +interface IVBSAXLocator : IDispatch +{ + [propget, id(DISPID_SAX_LOCATOR_COLUMNNUMBER), helpstring("Get the column number where the current document event ends.")] + HRESULT columnNumber( + [out, retval] int * nColumn); + + [propget, id(DISPID_SAX_LOCATOR_LINENUMBER), helpstring("Get the line number where the current document event ends.")] + HRESULT lineNumber( + [out, retval] int * nLine); + + [propget, id(DISPID_SAX_LOCATOR_PUBLICID), helpstring("Get the public identifier for the current document event.")] + HRESULT publicId( + [out, retval] BSTR * strPublicId); + + [propget, id(DISPID_SAX_LOCATOR_SYSTEMID), helpstring("Get the system identifier for the current document event.")] + HRESULT systemId( + [out, retval] BSTR * strSystemId); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(0c05d096-f45b-4aca-ad1a-aa0bc25518dc), // IID_IVBSAXEntityResolver + helpstring("IVBSAXEntityResolver interface"), + pointer_default(unique) +] +interface IVBSAXEntityResolver : IDispatch +{ + [id(DISPID_SAX_ENTITYRESOLVER_RESOLVEENTITY), helpstring("Allow the application to resolve external entities.")] + HRESULT resolveEntity( + [in, out] BSTR * strPublicId, + [in, out] BSTR * strSystemId, + [out, retval] VARIANT * varInput); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(2ed7290a-4dd5-4b46-bb26-4e4155e77faa), // IID_IVBSAXContentHandler + helpstring("IVBSAXContentHandler interface"), + pointer_default(unique) +] +interface IVBSAXContentHandler : IDispatch +{ + [propputref, id(DISPID_SAX_CONTENTHANDLER_DOCUMENTLOCATOR), helpstring("Receive an object for locating the origin of SAX document events.")] + HRESULT documentLocator( + [in] IVBSAXLocator * oLocator); + + [id(DISPID_SAX_CONTENTHANDLER_STARTDOCUMENT), helpstring("Receive notification of the beginning of a document.")] + HRESULT startDocument(); + + [id(DISPID_SAX_CONTENTHANDLER_ENDDOCUMENT), helpstring("Receive notification of the end of a document.")] + HRESULT endDocument(); + + [id(DISPID_SAX_CONTENTHANDLER_STARTPREFIXMAPPING), helpstring("Begin the scope of a prefix-URI Namespace mapping.")] + HRESULT startPrefixMapping( + [in, out] BSTR * strPrefix, + [in, out] BSTR * strURI); + + [id(DISPID_SAX_CONTENTHANDLER_ENDPREFIXMAPPING), helpstring("End the scope of a prefix-URI mapping.")] + HRESULT endPrefixMapping( + [in, out] BSTR * strPrefix); + + [id(DISPID_SAX_CONTENTHANDLER_STARTELEMENT), helpstring("Receive notification of the beginning of an element.")] + HRESULT startElement( + [in, out] BSTR * strNamespaceURI, + [in, out] BSTR * strLocalName, + [in, out] BSTR * strQName, + [in] IVBSAXAttributes * oAttributes); + + [id(DISPID_SAX_CONTENTHANDLER_ENDELEMENT), helpstring("Receive notification of the end of an element.")] + HRESULT endElement( + [in, out] BSTR * strNamespaceURI, + [in, out] BSTR * strLocalName, + [in, out] BSTR * strQName); + + [id(DISPID_SAX_CONTENTHANDLER_CHARACTERS), helpstring("Receive notification of character data.")] + HRESULT characters( + [in, out] BSTR * strChars); + + [id(DISPID_SAX_CONTENTHANDLER_IGNORABLEWHITESPACE), helpstring("Receive notification of ignorable whitespace in element content.")] + HRESULT ignorableWhitespace( + [in, out] BSTR * strChars); + + [id(DISPID_SAX_CONTENTHANDLER_PROCESSINGINSTRUCTION), helpstring("Receive notification of a processing instruction.")] + HRESULT processingInstruction( + [in, out] BSTR * strTarget, + [in, out] BSTR * strData); + + [id(DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY), helpstring("Receive notification of a skipped entity.")] + HRESULT skippedEntity( + [in, out] BSTR * strName); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(24fb3297-302d-4620-ba39-3a732d850558), // IID_IVBSAXDTDHandler + helpstring("IVBSAXDTDHandler interface"), + pointer_default(unique) +] +interface IVBSAXDTDHandler : IDispatch +{ + [id(DISPID_SAX_DTDHANDLER_NOTATIONDECL), helpstring("Receive notification of a notation declaration event.")] + HRESULT notationDecl( + [in, out] BSTR * strName, + [in, out] BSTR * strPublicId, + [in, out] BSTR * strSystemId); + + [id(DISPID_SAX_DTDHANDLER_UNPARSEDENTITYDECL), helpstring("Receive notification of an unparsed entity declaration event.")] + HRESULT unparsedEntityDecl( + [in, out] BSTR * strName, + [in, out] BSTR * strPublicId, + [in, out] BSTR * strSystemId, + [in, out] BSTR * strNotationName); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(d963d3fe-173c-4862-9095-b92f66995f52), // IID_IVBSAXErrorHandler + helpstring("IVBSAXErrorHandler interface"), + pointer_default(unique) +] +interface IVBSAXErrorHandler : IDispatch +{ + [id(DISPID_SAX_ERRORHANDLER_ERROR), helpstring("Receive notification of a recoverable error.")] + HRESULT error( + [in] IVBSAXLocator * oLocator, + [in, out] BSTR * strErrorMessage, + [in] long nErrorCode); + + [id(DISPID_SAX_ERRORHANDLER_FATALERROR), helpstring("Receive notification of a non-recoverable error.")] + HRESULT fatalError( + [in] IVBSAXLocator * oLocator, + [in, out] BSTR * strErrorMessage, + [in] long nErrorCode); + + [id(DISPID_SAX_ERRORHANDLER_IGNORABLEWARNING), helpstring("Receive notification of an ignorable warning.")] + HRESULT ignorableWarning( + [in] IVBSAXLocator * oLocator, + [in, out] BSTR * strErrorMessage, + [in] long nErrorCode); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(032aac35-8c0e-4d9d-979f-e3b702935576), // IID_IVBSAXLexicalHandler + helpstring("IVBSAXLexicalHandler interface"), + pointer_default(unique) +] +interface IVBSAXLexicalHandler : IDispatch +{ + [id(DISPID_SAX_LEXICALHANDLER_STARTDTD), helpstring("Report the start of DTD declarations, if any.")] + HRESULT startDTD( + [in, out] BSTR * strName, + [in, out] BSTR * strPublicId, + [in, out] BSTR * strSystemId); + [id(DISPID_SAX_LEXICALHANDLER_ENDDTD), helpstring("Report the end of DTD declarations.")] + HRESULT endDTD(); + + [id(DISPID_SAX_LEXICALHANDLER_STARTENTITY), helpstring("Report the beginning of some internal and external XML entities.")] + HRESULT startEntity( + [in, out] BSTR * strName); + [id(DISPID_SAX_LEXICALHANDLER_ENDENTITY), helpstring("Report the end of an entity.")] + HRESULT endEntity( + [in, out] BSTR * strName); + + [id(DISPID_SAX_LEXICALHANDLER_STARTCDATA), helpstring("Report the start of a CDATA section.")] + HRESULT startCDATA(); + [id(DISPID_SAX_LEXICALHANDLER_ENDCDATA), helpstring("Report the end of a CDATA section.")] + HRESULT endCDATA(); + + [id(DISPID_SAX_LEXICALHANDLER_COMMENT), helpstring("Report an XML comment anywhere in the document.")] + HRESULT comment( + [in, out] BSTR * strChars); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(e8917260-7579-4be1-b5dd-7afbfa6f077b), // IID_IVBSAXDeclHandler + helpstring("IVBSAXDeclHandler interface"), + pointer_default(unique) +] +interface IVBSAXDeclHandler : IDispatch +{ + [id(DISPID_SAX_DECLHANDLER_ELEMENTDECL), helpstring("Report an element type declaration.")] + HRESULT elementDecl( + [in, out] BSTR * strName, + [in, out] BSTR * strModel); + + [id(DISPID_SAX_DECLHANDLER_ATTRIBUTEDECL), helpstring("Report an attribute type declaration.")] + HRESULT attributeDecl( + [in, out] BSTR * strElementName, + [in, out] BSTR * strAttributeName, + [in, out] BSTR * strType, + [in, out] BSTR * strValueDefault, + [in, out] BSTR * strValue); + + [id(DISPID_SAX_DECLHANDLER_INTERNALENTITYDECL), helpstring("Report an internal entity declaration.")] + HRESULT internalEntityDecl( + [in, out] BSTR * strName, + [in, out] BSTR * strValue); + + [id(DISPID_SAX_DECLHANDLER_EXTERNALENTITYDECL), helpstring("Report a parsed external entity declaration.")] + HRESULT externalEntityDecl( + [in, out] BSTR * strName, + [in, out] BSTR * strPublicId, + [in, out] BSTR * strSystemId); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(10dc0586-132b-4cac-8bb3-db00ac8b7ee0), // IID_IVBSAXAttributes + helpstring("IVBSAXAttributes interface"), + pointer_default(unique) +] +interface IVBSAXAttributes : IDispatch +{ + [propget, id(DISPID_SAX_ATTRIBUTES_LENGTH), helpstring("Get the number of attributes in the list.")] + HRESULT length( + [out, retval] int * nLength); + + [id(DISPID_SAX_ATTRIBUTES_GETURI), helpstring("Look up an attribute's Namespace URI by index.")] + HRESULT getURI( + [in] int nIndex, + [out, retval] BSTR * strURI); + + [id(DISPID_SAX_ATTRIBUTES_GETLOCALNAME), helpstring("Look up an attribute's local name by index.")] + HRESULT getLocalName( + [in] int nIndex, + [out, retval] BSTR * strLocalName); + + [id(DISPID_SAX_ATTRIBUTES_GETQNAME), helpstring("Look up an attribute's XML 1.0 qualified name by index.")] + HRESULT getQName( + [in] int nIndex, + [out, retval] BSTR * strQName); + + [id(DISPID_SAX_ATTRIBUTES_GETINDEXFROMNAME), helpstring("Look up the index of an attribute by Namespace name.")] + HRESULT getIndexFromName( + [in] BSTR strURI, + [in] BSTR strLocalName, + [out, retval] int * nIndex); + + [id(DISPID_SAX_ATTRIBUTES_GETINDEXFROMQNAME), helpstring("Look up the index of an attribute by XML 1.0 qualified name.")] + HRESULT getIndexFromQName( + [in] BSTR strQName, + [out, retval] int * nIndex); + + [id(DISPID_SAX_ATTRIBUTES_GETTYPE), helpstring("Look up an attribute's type by index.")] + HRESULT getType( + [in] int nIndex, + [out, retval] BSTR * strType); + + [id(DISPID_SAX_ATTRIBUTES_GETTYPEFROMNAME), helpstring("Look up an attribute's type by Namespace name.")] + HRESULT getTypeFromName( + [in] BSTR strURI, + [in] BSTR strLocalName, + [out, retval] BSTR * strType); + + [id(DISPID_SAX_ATTRIBUTES_GETTYPEFROMQNAME), helpstring("Look up an attribute's type by XML 1.0 qualified name.")] + HRESULT getTypeFromQName( + [in] BSTR strQName, + [out, retval] BSTR * strType); + + [id(DISPID_SAX_ATTRIBUTES_GETVALUE), helpstring("Look up an attribute's value by index.")] + HRESULT getValue( + [in] int nIndex, + [out, retval] BSTR * strValue); + + [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMNAME), helpstring("Look up an attribute's value by Namespace name.")] + HRESULT getValueFromName( + [in] BSTR strURI, + [in] BSTR strLocalName, + [out, retval] BSTR * strValue); + + [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME), helpstring("Look up an attribute's value by XML 1.0 qualified name.")] + HRESULT getValueFromQName( + [in] BSTR strQName, + [out, retval] BSTR * strValue); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(4d7ff4ba-1565-4ea8-94e1-6e724a46f98d), // IID_IMXWriter + helpstring("IMXWriter interface"), + pointer_default(unique) +] +interface IMXWriter : IDispatch +{ + [propput, id(DISPID_MX_WRITER_OUTPUT), helpstring("Set or get the output.")] + HRESULT output ( + [in] VARIANT varDestination); + [propget, id(DISPID_MX_WRITER_OUTPUT), helpstring("Set or get the output.")] + HRESULT output ( + [out, retval] VARIANT * varDestination); + + [propput, id(DISPID_MX_WRITER_ENCODING), helpstring("Set or get the output encoding.")] + HRESULT encoding ( + [in] BSTR strEncoding); + [propget, id(DISPID_MX_WRITER_ENCODING), helpstring("Set or get the output encoding.")] + HRESULT encoding ( + [out, retval] BSTR * strEncoding); + + [propput, id(DISPID_MX_WRITER_BYTEORDERMARK), helpstring("Determine whether or not to write the byte order mark")] + HRESULT byteOrderMark ( + [in] VARIANT_BOOL fWriteByteOrderMark); + [propget, id(DISPID_MX_WRITER_BYTEORDERMARK), helpstring("Determine whether or not to write the byte order mark")] + HRESULT byteOrderMark ( + [out, retval] VARIANT_BOOL * fWriteByteOrderMark); + + [propput, id(DISPID_MX_WRITER_INDENT), helpstring("Enable or disable auto indent mode.")] + HRESULT indent ( + [in] VARIANT_BOOL fIndentMode); + [propget, id(DISPID_MX_WRITER_INDENT), helpstring("Enable or disable auto indent mode.")] + HRESULT indent ( + [out, retval] VARIANT_BOOL * fIndentMode); + + [propput, id(DISPID_MX_WRITER_STANDALONE), helpstring("Set or get the standalone document declaration.")] + HRESULT standalone ( + [in] VARIANT_BOOL fValue); + [propget, id(DISPID_MX_WRITER_STANDALONE), helpstring("Set or get the standalone document declaration.")] + HRESULT standalone ( + [out, retval] VARIANT_BOOL * fValue); + + [propput, id(DISPID_MX_WRITER_OMITXMLDECLARATION), helpstring("Determine whether or not to omit the XML declaration.")] + HRESULT omitXMLDeclaration ( + [in] VARIANT_BOOL fValue); + [propget, id(DISPID_MX_WRITER_OMITXMLDECLARATION), helpstring("Determine whether or not to omit the XML declaration.")] + HRESULT omitXMLDeclaration ( + [out, retval] VARIANT_BOOL * fValue); + + [propput, id(DISPID_MX_WRITER_VERSION), helpstring("Set or get the xml version info.")] + HRESULT version ( + [in] BSTR strVersion); + [propget, id(DISPID_MX_WRITER_VERSION), helpstring("Set or get the xml version info.")] + HRESULT version ( + [out, retval] BSTR * strVersion); + + [propput, id(DISPID_MX_WRITER_DISABLEOUTPUTESCAPING), helpstring("When enabled, the writer no longer escapes out its input when writing it out.")] + HRESULT disableOutputEscaping( + [in] VARIANT_BOOL fValue); + [propget, id(DISPID_MX_WRITER_DISABLEOUTPUTESCAPING), helpstring("When enabled, the writer no longer escapes out its input when writing it out.")] + HRESULT disableOutputEscaping( + [out, retval] VARIANT_BOOL * fValue); + + [id(DISPID_MX_WRITER_FLUSH), helpstring("Flushes all writer buffers forcing the writer to write to the underlying output object")] + HRESULT flush(); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(f10d27cc-3ec0-415c-8ed8-77ab1c5e7262), // IID_IMXAttributes + helpstring("IMXAttributes interface"), + pointer_default(unique) +] +interface IMXAttributes : IDispatch +{ + [id(DISPID_MX_ATTRIBUTES_ADDATTRIBUTE), helpstring("Add an attribute to the end of the list.")] + HRESULT addAttribute( + [in] BSTR strURI, + [in] BSTR strLocalName, + [in] BSTR strQName, + [in] BSTR strType, + [in] BSTR strValue); + + [id(DISPID_MX_ATTRIBUTES_ADDATTRIBUTEFROMINDEX), helpstring("Add an attribute, whose value is equal to the indexed attribute in the input attributes object, to the end of the list.")] + HRESULT addAttributeFromIndex( + [in] VARIANT varAtts, + [in] int nIndex); + + [id(DISPID_MX_ATTRIBUTES_CLEAR), helpstring("Clear the attribute list for reuse.")] + HRESULT clear(); + + [id(DISPID_MX_ATTRIBUTES_REMOVEATTRIBUTE), helpstring("Remove an attribute from the list.")] + HRESULT removeAttribute( + [in] int nIndex); + + [id(DISPID_MX_ATTRIBUTES_SETATTRIBUTE), helpstring("Set an attribute in the list.")] + HRESULT setAttribute( + [in] int nIndex, + [in] BSTR strURI, + [in] BSTR strLocalName, + [in] BSTR strQName, + [in] BSTR strType, + [in] BSTR strValue); + + [id(DISPID_MX_ATTRIBUTES_SETATTRIBUTES), helpstring("Copy an entire Attributes object.")] + HRESULT setAttributes( + [in] VARIANT varAtts); + + [id(DISPID_MX_ATTRIBUTES_SETLOCALNAME), helpstring("Set the local name of a specific attribute.")] + HRESULT setLocalName( + [in] int nIndex, + [in] BSTR strLocalName); + + [id(DISPID_MX_ATTRIBUTES_SETQNAME), helpstring("Set the qualified name of a specific attribute.")] + HRESULT setQName( + [in] int nIndex, + [in] BSTR strQName); + + [id(DISPID_MX_ATTRIBUTES_SETTYPE), helpstring("Set the type of a specific attribute.")] + HRESULT setType( + [in] int nIndex, + [in] BSTR strType); + + [id(DISPID_MX_ATTRIBUTES_SETURI), helpstring("Set the Namespace URI of a specific attribute.")] + HRESULT setURI( + [in] int nIndex, + [in] BSTR strURI); + + [id(DISPID_MX_ATTRIBUTES_SETVALUE), helpstring("Set the value of a specific attribute.")] + HRESULT setValue( + [in] int nIndex, + [in] BSTR strValue); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(808f4e35-8d5a-4fbe-8466-33a41279ed30), // IID_IMXReaderControl + helpstring("IMXReaderControl interface"), + pointer_default(unique) +] +interface IMXReaderControl : IDispatch +{ + [id(DISPID_MX_READER_CONTROL_ABORT), helpstring("Abort the reader")] + HRESULT abort(); + + [id(DISPID_MX_READER_CONTROL_RESUME), helpstring("Resume the reader")] + HRESULT resume(); + + [id(DISPID_MX_READER_CONTROL_SUSPEND), helpstring("Suspend the reader")] + HRESULT suspend(); +}; + +[ + object, + local, + odl, + dual, + oleautomation, + nonextensible, + uuid(fa4bb38c-faf9-4cca-9302-d1dd0fe520db), // IID_IMXSchemaDeclHandler + helpstring("IMXSchemaDeclHandler interface"), + pointer_default(unique) +] +interface IMXSchemaDeclHandler : IDispatch +{ + [id(DISPID_MX_SCHEMADECLHANDLER_SCHEMAELEMENTDECL), helpstring("Access schema element declaration")] + HRESULT schemaElementDecl( + [in] ISchemaElement * oSchemaElement); +}; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Namespace Manager +[ + local, object, + uuid(c90352f4-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXNamespacePrefixes + helpstring("IMXNamespacePrefixes interface"), + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IMXNamespacePrefixes : IDispatch +{ + [propget, id(DISPID_VALUE)] HRESULT item([in]long index, [out,retval]BSTR* prefix); + [propget, id(DISPID_MX_NSMGR_LENGTH)] HRESULT length([out,retval]long* length); + [propget, restricted, hidden, id(DISPID_NEWENUM)] HRESULT _newEnum([out,retval]IUnknown** ppUnk); +}; + +[ + local, object, + uuid(c90352f5-643c-4fbc-bb23-e996eb2d51fd), // IID_IVBMXNamespaceManager + helpstring("IVBMXNamespaceManager interface"), + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IVBMXNamespaceManager : IDispatch +{ + [propput, id(DISPID_MX_NSMGR_ALLOWOVERRIDE)] + HRESULT allowOverride([in] VARIANT_BOOL fOverride); + + [propget, id(DISPID_MX_NSMGR_ALLOWOVERRIDE)] + HRESULT allowOverride([out,retval] VARIANT_BOOL* fOverride); + + [id(DISPID_MX_NSMGR_RESET)] + HRESULT reset(); + + [id(DISPID_MX_NSMGR_PUSHCONTEXT)] + HRESULT pushContext(); + + [id(DISPID_MX_NSMGR_PUSHNODECONTEXT)] + HRESULT pushNodeContext( + [in] IXMLDOMNode* contextNode, + [in, defaultvalue(-1)] VARIANT_BOOL fDeep); + + [id(DISPID_MX_NSMGR_POPCONTEXT)] + HRESULT popContext(); + + [id(DISPID_MX_NSMGR_DECLAREPREFIX)] + HRESULT declarePrefix( + [in] BSTR prefix, + [in] BSTR namespaceURI); + + [id(DISPID_MX_NSMGR_GETDECLAREDPREFIXES)] + HRESULT getDeclaredPrefixes( + [out, retval] IMXNamespacePrefixes** prefixes); + + [id(DISPID_MX_NSMGR_GETPREFIXES)] + HRESULT getPrefixes( + [in] BSTR namespaceURI, + [out, retval] IMXNamespacePrefixes** prefixes); + + [id(DISPID_MX_NSMGR_GETURI)] + HRESULT getURI( + [in] BSTR prefix, + [out, retval] VARIANT* uri); + + [id(DISPID_MX_NSMGR_GETURIFROMNODE)] + HRESULT getURIFromNode( + [in] BSTR strPrefix, + [in] IXMLDOMNode* contextNode, + [out, retval] VARIANT* uri); +}; + +[ + hidden, + object, + local, + uuid(c90352f6-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXNamespaceManager + helpstring("IMXNamespaceManager interface"), + pointer_default(unique) +] +interface IMXNamespaceManager : IUnknown +{ + HRESULT putAllowOverride([in] VARIANT_BOOL fOverride); + + HRESULT getAllowOverride([out,retval] VARIANT_BOOL* fOverride); + + HRESULT reset(); + + HRESULT pushContext(); + + HRESULT pushNodeContext( + [in] IXMLDOMNode* contextNode, + [in] VARIANT_BOOL fDeep); + + HRESULT popContext(); + + HRESULT declarePrefix( + [in] const wchar_t* prefix, + [in] const wchar_t* namespaceURI); + + HRESULT getDeclaredPrefix( + [in] long nIndex, + [in, out] wchar_t* pwchPrefix, + [in, out] int* pcchPrefix); + + HRESULT getPrefix( + [in] const wchar_t* pwszNamespaceURI, + [in] long nIndex, + [in, out] wchar_t* pwchPrefix, + [in, out] int* pcchPrefix); + + HRESULT getURI( + [in] const wchar_t* pwchPrefix, + [in] IXMLDOMNode* pContextNode, + [in, out] wchar_t* pwchUri, + [in, out] int* pcchUri); +}; + +[ + local, object, + uuid(c90352f7-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXXMLFilter + helpstring("IMXXMLFilter interface"), + odl, + dual, + oleautomation, + nonextensible, + pointer_default(unique) +] +interface IMXXMLFilter : IDispatch +{ + [id(DISPID_MXXML_FILTER_GETFEATURE)] HRESULT getFeature( [in] BSTR strName, [out, retval] VARIANT_BOOL * fValue); + [id(DISPID_MXXML_FILTER_PUTFEATURE)] HRESULT putFeature( [in] BSTR strName, [in] VARIANT_BOOL fValue); + + [id(DISPID_MXXML_FILTER_GETPROPERTY)] HRESULT getProperty( [in] BSTR strName, [out, retval] VARIANT * varValue); + [id(DISPID_MXXML_FILTER_PUTPROPERTY)] HRESULT putProperty( [in] BSTR strName, [in] VARIANT varValue); + + [id(DISPID_MXXML_FILTER_ENTITYRESOLVER), propget] HRESULT entityResolver( [out, retval] IUnknown ** oResolver); + [id(DISPID_MXXML_FILTER_ENTITYRESOLVER), propputref] HRESULT entityResolver( [in] IUnknown * oResolver); + [id(DISPID_MXXML_FILTER_CONTENTHANDLER), propget] HRESULT contentHandler( [out, retval] IUnknown ** oHandler); + [id(DISPID_MXXML_FILTER_CONTENTHANDLER), propputref] HRESULT contentHandler( [in] IUnknown * oHandler); + [id(DISPID_MXXML_FILTER_DTDHANDLER), propget] HRESULT dtdHandler( [out, retval] IUnknown ** oHandler); + [id(DISPID_MXXML_FILTER_DTDHANDLER), propputref] HRESULT dtdHandler( [in] IUnknown * oHandler); + [id(DISPID_MXXML_FILTER_ERRORHANDLER), propget] HRESULT errorHandler( [out, retval] IUnknown ** oHandler); + [id(DISPID_MXXML_FILTER_ERRORHANDLER), propputref] HRESULT errorHandler( [in] IUnknown * oHandler); +}; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Schema Object Model +cpp_quote("#if !defined(__msxml_som_enums__)") +cpp_quote("#define __msxml_som_enums__") +typedef [ + helpstring("Schema Object Model Item Types") +] +enum _SOMITEMTYPE +{ + SOMITEM_SCHEMA = 0x1000, + SOMITEM_ATTRIBUTE = 0x1001, + SOMITEM_ATTRIBUTEGROUP = 0x1002, + SOMITEM_NOTATION = 0x1003, + SOMITEM_ANNOTATION = 0x1004, + + SOMITEM_IDENTITYCONSTRAINT = 0x1100, // identity constraints + SOMITEM_KEY = 0x1101, + SOMITEM_KEYREF = 0x1102, + SOMITEM_UNIQUE = 0x1103, + + SOMITEM_ANYTYPE = 0x2000, // Types + SOMITEM_DATATYPE = 0x2100, + SOMITEM_DATATYPE_ANYTYPE = 0x2101, + SOMITEM_DATATYPE_ANYURI = 0x2102, + SOMITEM_DATATYPE_BASE64BINARY = 0x2103, + SOMITEM_DATATYPE_BOOLEAN = 0x2104, + SOMITEM_DATATYPE_BYTE = 0x2105, + SOMITEM_DATATYPE_DATE = 0x2106, + SOMITEM_DATATYPE_DATETIME = 0x2107, + SOMITEM_DATATYPE_DAY = 0x2108, + SOMITEM_DATATYPE_DECIMAL = 0x2109, + SOMITEM_DATATYPE_DOUBLE = 0x210A, + SOMITEM_DATATYPE_DURATION = 0x210B, + SOMITEM_DATATYPE_ENTITIES = 0x210C, + SOMITEM_DATATYPE_ENTITY = 0x210D, + SOMITEM_DATATYPE_FLOAT = 0x210E, + SOMITEM_DATATYPE_HEXBINARY = 0x210F, + SOMITEM_DATATYPE_ID = 0x2110, + SOMITEM_DATATYPE_IDREF = 0x2111, + SOMITEM_DATATYPE_IDREFS = 0x2112, + SOMITEM_DATATYPE_INT = 0x2113, + SOMITEM_DATATYPE_INTEGER = 0x2114, + SOMITEM_DATATYPE_LANGUAGE = 0x2115, + SOMITEM_DATATYPE_LONG = 0x2116, + SOMITEM_DATATYPE_MONTH = 0x2117, + SOMITEM_DATATYPE_MONTHDAY = 0x2118, + SOMITEM_DATATYPE_NAME = 0x2119, + SOMITEM_DATATYPE_NCNAME = 0x211A, + SOMITEM_DATATYPE_NEGATIVEINTEGER = 0x211B, + SOMITEM_DATATYPE_NMTOKEN = 0x211C, + SOMITEM_DATATYPE_NMTOKENS = 0x211D, + SOMITEM_DATATYPE_NONNEGATIVEINTEGER = 0x211E, + SOMITEM_DATATYPE_NONPOSITIVEINTEGER = 0x211F, + SOMITEM_DATATYPE_NORMALIZEDSTRING = 0x2120, + SOMITEM_DATATYPE_NOTATION = 0x2121, + SOMITEM_DATATYPE_POSITIVEINTEGER = 0x2122, + SOMITEM_DATATYPE_QNAME = 0x2123, + SOMITEM_DATATYPE_SHORT = 0x2124, + SOMITEM_DATATYPE_STRING = 0x2125, + SOMITEM_DATATYPE_TIME = 0x2126, + SOMITEM_DATATYPE_TOKEN = 0x2127, + SOMITEM_DATATYPE_UNSIGNEDBYTE = 0x2128, + SOMITEM_DATATYPE_UNSIGNEDINT = 0x2129, + SOMITEM_DATATYPE_UNSIGNEDLONG = 0x212A, + SOMITEM_DATATYPE_UNSIGNEDSHORT = 0x212B, + SOMITEM_DATATYPE_YEAR = 0x212C, + SOMITEM_DATATYPE_YEARMONTH = 0x212D, + SOMITEM_DATATYPE_ANYSIMPLETYPE = 0x21FF, + + SOMITEM_SIMPLETYPE = 0x2200, + SOMITEM_COMPLEXTYPE = 0x2400, + + SOMITEM_PARTICLE = 0x4000, // particles + SOMITEM_ANY = 0x4001, + SOMITEM_ANYATTRIBUTE = 0x4002, + SOMITEM_ELEMENT = 0x4003, + + SOMITEM_GROUP = 0x4100, // groups : particles + SOMITEM_ALL = 0x4101, + SOMITEM_CHOICE = 0x4102, + SOMITEM_SEQUENCE = 0x4103, + SOMITEM_EMPTYPARTICLE = 0x4104, + + SOMITEM_NULL = 0x0800, // null items + SOMITEM_NULL_TYPE = 0x2800, + SOMITEM_NULL_ANY = 0x4801, + SOMITEM_NULL_ANYATTRIBUTE = 0x4802, + SOMITEM_NULL_ELEMENT = 0x4803, +} SOMITEMTYPE; + +typedef [ + helpstring("Schema Object Model Attribute Uses") +] +enum _SCHEMAUSE +{ + SCHEMAUSE_OPTIONAL, // 0 + SCHEMAUSE_PROHIBITED, // 1 + SCHEMAUSE_REQUIRED, // 2 +} SCHEMAUSE; + +typedef [ + helpstring("Schema Object Model Filters") +] enum _SCHEMADERIVATIONMETHOD +{ + SCHEMADERIVATIONMETHOD_EMPTY = 0x0000, + SCHEMADERIVATIONMETHOD_SUBSTITUTION = 0x0001, + SCHEMADERIVATIONMETHOD_EXTENSION = 0x0002, + SCHEMADERIVATIONMETHOD_RESTRICTION = 0x0004, + SCHEMADERIVATIONMETHOD_LIST = 0x0008, + SCHEMADERIVATIONMETHOD_UNION = 0x0010, + SCHEMADERIVATIONMETHOD_ALL = 0x00FF, + SCHEMADERIVATIONMETHOD_NONE = 0x0100, +} SCHEMADERIVATIONMETHOD; + +typedef [ + helpstring("Schema Object Model Content Types") +] enum _SCHEMACONTENTTYPE +{ + SCHEMACONTENTTYPE_EMPTY, + SCHEMACONTENTTYPE_TEXTONLY, + SCHEMACONTENTTYPE_ELEMENTONLY, + SCHEMACONTENTTYPE_MIXED, +} SCHEMACONTENTTYPE; + +typedef [ + helpstring("Schema Object Model Process Contents") +] enum _SCHEMAPROCESSCONTENTS +{ + SCHEMAPROCESSCONTENTS_NONE, + SCHEMAPROCESSCONTENTS_SKIP, + SCHEMAPROCESSCONTENTS_LAX, + SCHEMAPROCESSCONTENTS_STRICT, +} SCHEMAPROCESSCONTENTS; + +typedef [ + helpstring("Schema Object Model Whitespace facet values") +] enum _SCHEMAWHITESPACE +{ + SCHEMAWHITESPACE_NONE = -1, + SCHEMAWHITESPACE_PRESERVE = 0, + SCHEMAWHITESPACE_REPLACE = 1, + SCHEMAWHITESPACE_COLLAPSE = 2, +} SCHEMAWHITESPACE; + + +typedef [ + helpstring("Schema Object Model Type variety values") +] enum _SCHEMATYPEVARIETY +{ + SCHEMATYPEVARIETY_NONE = -1, + SCHEMATYPEVARIETY_ATOMIC = 0, + SCHEMATYPEVARIETY_LIST = 1, + SCHEMATYPEVARIETY_UNION = 2, +}SCHEMATYPEVARIETY; +cpp_quote("#endif // !defined(__msxml_som_enums__)") + +[ + local, object, + uuid(50ea08b0-dd1b-4664-9a50-c2f40f4bd79a), // IID_IXMLDOMSchemaCollection2 + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schemas Collection 2"), + pointer_default(unique) +] +interface IXMLDOMSchemaCollection2 : IXMLDOMSchemaCollection +{ + [id(DISPID_SOM_VALIDATE)] HRESULT validate(); + [id(DISPID_SOM_VALIDATEONLOAD), propput] HRESULT validateOnLoad([in]VARIANT_BOOL validateOnLoad); + [id(DISPID_SOM_VALIDATEONLOAD), propget] HRESULT validateOnLoad([out,retval]VARIANT_BOOL* validateOnLoad); + [id(DISPID_SOM_GETSCHEMA)] HRESULT getSchema([in]BSTR namespaceURI, [out,retval]ISchema** schema); + [id(DISPID_SOM_GETDECLARATION)] HRESULT getDeclaration([in]IXMLDOMNode* node, [out,retval]ISchemaItem** item); +}; + +[ + local, object, + uuid(50ea08b1-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaStringCollection + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema String Collection"), + pointer_default(unique) +] +interface ISchemaStringCollection : IDispatch +{ + [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]BSTR* bstr); + [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]long* length); + [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown** ppunk); +}; + +[ + local, object, + uuid(50ea08b2-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaItemCollection + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Item Collection"), + pointer_default(unique) +] +interface ISchemaItemCollection : IDispatch +{ + [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]ISchemaItem** item); + [id(DISPID_SOM_ITEMBYNAME)] HRESULT itemByName([in]BSTR name, [out,retval]ISchemaItem** item); + [id(DISPID_SOM_ITEMBYQNAME)] HRESULT itemByQName([in]BSTR name, [in]BSTR namespaceURI, [out,retval]ISchemaItem** item); + [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]long* length); + [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown** ppunk); +}; + +[ + local, object, + uuid(50ea08b3-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaItem + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Item"), + pointer_default(unique) +] +interface ISchemaItem : IDispatch +{ + [id(DISPID_SOM_NAME), propget] HRESULT name([out,retval]BSTR* name); + [id(DISPID_SOM_NAMESPACEURI), propget] HRESULT namespaceURI([out,retval]BSTR* namespaceURI); + [id(DISPID_SOM_SCHEMA), propget] HRESULT schema([out,retval]ISchema** schema); + [id(DISPID_SOM_ID), propget] HRESULT id([out,retval]BSTR* id); + [id(DISPID_SOM_ITEMTYPE), propget] HRESULT itemType([out,retval]SOMITEMTYPE* itemType); + [id(DISPID_SOM_UNHANDLEDATTRS), propget] HRESULT unhandledAttributes([out,retval]IVBSAXAttributes** attributes); + [id(DISPID_SOM_WRITEANNOTATION)] HRESULT writeAnnotation([in]IUnknown* annotationSink, [out,retval]VARIANT_BOOL* isWritten); +}; + +[ + local, object, + uuid(50ea08b4-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchema + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema"), + pointer_default(unique) +] +interface ISchema : ISchemaItem +{ + [id(DISPID_SOM_TARGETNAMESPACE), propget] HRESULT targetNamespace([out,retval]BSTR* targetNamespace); + [id(DISPID_SOM_VERSION), propget] HRESULT version([out,retval]BSTR* version); + [id(DISPID_SOM_TYPES), propget] HRESULT types([out,retval]ISchemaItemCollection** types); + [id(DISPID_SOM_ELEMENTS), propget] HRESULT elements([out,retval]ISchemaItemCollection** elements); + [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); + [id(DISPID_SOM_ATTRIBUTEGROUPS), propget] HRESULT attributeGroups([out,retval]ISchemaItemCollection** attributeGroups); + [id(DISPID_SOM_MODELGROUPS), propget] HRESULT modelGroups([out,retval]ISchemaItemCollection** modelGroups); + [id(DISPID_SOM_NOTATIONS), propget] HRESULT notations([out,retval]ISchemaItemCollection** notations); + [id(DISPID_SOM_SCHEMALOCATIONS), propget] HRESULT schemaLocations([out,retval]ISchemaStringCollection** schemaLocations); +}; + +[ + local, object, + uuid(50ea08b5-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaParticle + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Particle"), + pointer_default(unique) +] +interface ISchemaParticle : ISchemaItem +{ + [id(DISPID_SOM_MINOCCURS), propget] HRESULT minOccurs([out,retval]VARIANT* minOccurs); + [id(DISPID_SOM_MAXOCCURS), propget] HRESULT maxOccurs([out,retval]VARIANT* maxOccurs); +}; + +[ + local, object, + uuid(50ea08b6-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAttribute + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Attribute"), + pointer_default(unique) +] +interface ISchemaAttribute : ISchemaItem +{ + [id(DISPID_SOM_TYPE), propget] HRESULT type([out,retval]ISchemaType** type); + [id(DISPID_SOM_SCOPE), propget] HRESULT scope([out,retval]ISchemaComplexType** scope); + [id(DISPID_SOM_DEFAULTVALUE), propget] HRESULT defaultValue([out,retval]BSTR* defaultValue); + [id(DISPID_SOM_FIXEDVALUE), propget] HRESULT fixedValue([out,retval]BSTR* fixedValue); + [id(DISPID_SOM_USE), propget] HRESULT use([out,retval]SCHEMAUSE* use); + [id(DISPID_SOM_ISREFERENCE), propget] HRESULT isReference([out,retval]VARIANT_BOOL* reference); +}; + +[ + local, object, + uuid(50ea08b7-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaElement + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Element"), + pointer_default(unique) +] +interface ISchemaElement : ISchemaParticle +{ + [id(DISPID_SOM_TYPE), propget] HRESULT type([out,retval]ISchemaType** type); + [id(DISPID_SOM_SCOPE), propget] HRESULT scope([out,retval]ISchemaComplexType** scope); + [id(DISPID_SOM_DEFAULTVALUE), propget] HRESULT defaultValue([out,retval]BSTR* defaultValue); + [id(DISPID_SOM_FIXEDVALUE), propget] HRESULT fixedValue([out,retval]BSTR* fixedValue); + [id(DISPID_SOM_ISNILLABLE), propget] HRESULT isNillable([out,retval]VARIANT_BOOL* nillable); + [id(DISPID_SOM_IDCONSTRAINTS), propget] HRESULT identityConstraints([out,retval]ISchemaItemCollection** constraints); + [id(DISPID_SOM_SUBSTITUTIONGROUP), propget] HRESULT substitutionGroup([out,retval]ISchemaElement** element); + [id(DISPID_SOM_EXCLUSIONS), propget] HRESULT substitutionGroupExclusions([out,retval]SCHEMADERIVATIONMETHOD* exclusions); + [id(DISPID_SOM_DISALLOWED), propget] HRESULT disallowedSubstitutions([out,retval]SCHEMADERIVATIONMETHOD* disallowed); + [id(DISPID_SOM_ISABSTRACT), propget] HRESULT isAbstract([out,retval]VARIANT_BOOL* abstract); + [id(DISPID_SOM_ISREFERENCE), propget] HRESULT isReference([out,retval]VARIANT_BOOL* reference); +}; + +[ + local, object, + uuid(50ea08b8-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaType + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Type"), + pointer_default(unique) +] +interface ISchemaType : ISchemaItem +{ + [id(DISPID_SOM_BASETYPES), propget] HRESULT baseTypes([out,retval]ISchemaItemCollection** baseTypes); + [id(DISPID_SOM_FINAL), propget] HRESULT final([out,retval]SCHEMADERIVATIONMETHOD* final); + [id(DISPID_SOM_VARIETY), propget] HRESULT variety([out,retval]SCHEMATYPEVARIETY* variety); + [id(DISPID_SOM_DERIVEDBY), propget] HRESULT derivedBy([out,retval]SCHEMADERIVATIONMETHOD* derivedBy); + [id(DISPID_SOM_ISVALID)] HRESULT isValid([in]BSTR data, [out,retval]VARIANT_BOOL* valid); + // Facets + [id(DISPID_SOM_MINEXCLUSIVE), propget] HRESULT minExclusive([out,retval]BSTR* minExclusive); + [id(DISPID_SOM_MININCLUSIVE), propget] HRESULT minInclusive([out,retval]BSTR* minInclusive); + [id(DISPID_SOM_MAXEXCLUSIVE), propget] HRESULT maxExclusive([out,retval]BSTR* maxExclusive); + [id(DISPID_SOM_MAXINCLUSIVE), propget] HRESULT maxInclusive([out,retval]BSTR* maxInclusive); + [id(DISPID_SOM_TOTALDIGITS), propget] HRESULT totalDigits([out,retval]VARIANT* totalDigits); + [id(DISPID_SOM_FRACTIONDIGITS), propget] HRESULT fractionDigits([out,retval]VARIANT* fractionDigits); + [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]VARIANT* length); + [id(DISPID_SOM_MINLENGTH), propget] HRESULT minLength([out,retval]VARIANT* minLength); + [id(DISPID_SOM_MAXLENGTH), propget] HRESULT maxLength([out,retval]VARIANT* maxLength); + [id(DISPID_SOM_ENUMERATION), propget] HRESULT enumeration([out,retval]ISchemaStringCollection** enumeration); + [id(DISPID_SOM_WHITESPACE), propget] HRESULT whitespace([out,retval]SCHEMAWHITESPACE* whitespace); + [id(DISPID_SOM_PATTERNS), propget] HRESULT patterns([out,retval]ISchemaStringCollection** patterns); +}; + +[ + local, object, + uuid(50ea08b9-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaComplexType + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Complex Type"), + pointer_default(unique) +] +interface ISchemaComplexType : ISchemaType +{ + [id(DISPID_SOM_ISABSTRACT), propget] HRESULT isAbstract([out,retval]VARIANT_BOOL* abstract); + [id(DISPID_SOM_ANYATTRIBUTE), propget] HRESULT anyAttribute([out,retval]ISchemaAny** anyAttribute); + [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); + [id(DISPID_SOM_CONTENTTYPE), propget] HRESULT contentType([out,retval]SCHEMACONTENTTYPE* contentType); + [id(DISPID_SOM_CONTENTMODEL), propget] HRESULT contentModel([out,retval]ISchemaModelGroup** contentModel); + [id(DISPID_SOM_PROHIBITED), propget] HRESULT prohibitedSubstitutions([out,retval]SCHEMADERIVATIONMETHOD* prohibited); +}; + +[ + local, object, + uuid(50ea08ba-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAttributeGroup + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Attribute Group"), + pointer_default(unique) +] +interface ISchemaAttributeGroup : ISchemaItem +{ + [id(DISPID_SOM_ANYATTRIBUTE), propget] HRESULT anyAttribute([out,retval]ISchemaAny** anyAttribute); + [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); +}; + +[ + local, object, + uuid(50ea08bb-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaModelGroup + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Type"), + pointer_default(unique) +] +interface ISchemaModelGroup : ISchemaParticle +{ + [id(DISPID_SOM_PARTICLES), propget] HRESULT particles([out,retval]ISchemaItemCollection** particles); +}; + +[ + local, object, + uuid(50ea08bc-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAny + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Any"), + pointer_default(unique) +] +interface ISchemaAny : ISchemaParticle +{ + [id(DISPID_SOM_NAMESPACES), propget] HRESULT namespaces([out,retval]ISchemaStringCollection** namespaces); + [id(DISPID_SOM_PROCESSCONTENTS), propget] HRESULT processContents([out,retval]SCHEMAPROCESSCONTENTS* processContents); +}; + +[ + local, object, + uuid(50ea08bd-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaIdentityConstraint + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Any"), + pointer_default(unique) +] +interface ISchemaIdentityConstraint : ISchemaItem +{ + [id(DISPID_SOM_SELECTOR), propget] HRESULT selector([out,retval]BSTR* selector); + [id(DISPID_SOM_FIELDS), propget] HRESULT fields([out,retval]ISchemaStringCollection** fields); + [id(DISPID_SOM_REFERENCEDKEY), propget] HRESULT referencedKey([out,retval]ISchemaIdentityConstraint** key); +}; + +[ + local, object, + uuid(50ea08be-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaNotation + odl, + dual, + oleautomation, + nonextensible, + helpstring("XML Schema Notation"), + pointer_default(unique) +] +interface ISchemaNotation : ISchemaItem +{ + [id(DISPID_SOM_SYSTEMIDENTIFIER), propget] HRESULT systemIdentifier([out,retval]BSTR* uri); + [id(DISPID_SOM_PUBLICIDENTIFIER), propget] HRESULT publicIdentifier([out,retval]BSTR* uri); +}; + +//+------------------------------------------------------------------------- +// +// CoClasses +// +//-------------------------------------------------------------------------- + + +// DOM Document rental-model co-Class, version independent +[ + uuid(F6D90F11-9C73-11D3-B32E-00C04F990BB4), // CLSID_DOMDocument + helpstring("W3C-DOM XML Document (Apartment)") +] +coclass DOMDocument +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document rental-model co-Class, 2.6 version dependent +[ + uuid(f5078f1b-c551-11d3-89b9-0000f81fe221), // CLSID_DOMDocument26 + helpstring("W3C-DOM XML Document (Apartment)") +] +coclass DOMDocument26 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document rental-model co-Class, 3.0 version dependent +[ + uuid(f5078f32-c551-11d3-89b9-0000f81fe221), // CLSID_DOMDocument30 + helpstring("W3C-DOM XML Document (Apartment)") +] +coclass DOMDocument30 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document rental-model co-Class, 4.0 version dependent +[ + uuid(88d969c0-f192-11d4-a65f-0040963251e5), // CLSID_DOMDocument40 + helpstring("W3C-DOM XML Document (Apartment)") +] +coclass DOMDocument40 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +[ + uuid(88d96a05-f192-11d4-a65f-0040963251e5), // CLSID_DOMDocument60 + helpstring("W3C-DOM XML Document 6.0 (Apartment)") +] +coclass DOMDocument60 +{ + [default] interface IXMLDOMDocument3; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document free-threaded co-Class, version independent +[ + uuid(F6D90F12-9C73-11D3-B32E-00C04F990BB4), // CLSID_FreeThreadedDOMDocument + helpstring("W3C-DOM XML Document (Free threaded)") +] +coclass FreeThreadedDOMDocument +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document free-threaded co-Class, 2.6 version dependent +[ + uuid(f5078f1c-c551-11d3-89b9-0000f81fe221), // CLSID_FreeThreadedDOMDocument26 + helpstring("W3C-DOM XML Document (Free threaded)") +] +coclass FreeThreadedDOMDocument26 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document free-threaded co-Class, 3.0 version dependent +[ + uuid(f5078f33-c551-11d3-89b9-0000f81fe221), // CLSID_FreeThreadedDOMDocument30 + helpstring("W3C-DOM XML Document (Free threaded)") +] +coclass FreeThreadedDOMDocument30 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// DOM Document free-threaded co-Class, 4.0 version dependent +[ + uuid(88d969c1-f192-11d4-a65f-0040963251e5), // CLSID_FreeThreadedDOMDocument40 + helpstring("W3C-DOM XML Document (Free threaded)") +] +coclass FreeThreadedDOMDocument40 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +[ + uuid(88d96a06-f192-11d4-a65f-0040963251e5), // CLSID_FreeThreadedDOMDocument60 + helpstring("W3C-DOM XML Document 6.0 (Free threaded)") +] +coclass FreeThreadedDOMDocument60 +{ + [default] interface IXMLDOMDocument3; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +// XML Schema Cache, version independent +[ + uuid(373984c9-b845-449b-91e7-45ac83036ade), + helpstring("XML Schema Cache") +] +coclass XMLSchemaCache +{ + [default] interface IXMLDOMSchemaCollection; +}; + +// XML Schema Cache, version 2.6 dependent +[ + uuid(f5078f1d-c551-11d3-89b9-0000f81fe221), + helpstring("XML Schema Cache 2.6") +] +coclass XMLSchemaCache26 +{ + [default] interface IXMLDOMSchemaCollection; +}; + +// XML Schema Cache, version 3.0 dependent +[ + uuid(f5078f34-c551-11d3-89b9-0000f81fe221), + helpstring("XML Schema Cache 3.0") +] +coclass XMLSchemaCache30 +{ + [default] interface IXMLDOMSchemaCollection; +}; + +// XML Schema Cache, version 4.0 dependent +[ + uuid(88d969c2-f192-11d4-a65f-0040963251e5), + helpstring("XML Schema Cache 4.0") +] +coclass XMLSchemaCache40 +{ + [default] interface IXMLDOMSchemaCollection2; +}; + +[ + uuid(88d96a07-f192-11d4-a65f-0040963251e5), // CLSID_XMLSchemaCache60 + helpstring("XML Schema Cache 6.0") +] +coclass XMLSchemaCache60 +{ + [default] interface IXMLDOMSchemaCollection2; +}; + +// XSLTemplate, version independent +[ + uuid(2933BF94-7B36-11d2-B20E-00C04F983E60), // CLSID_XMLDOMXSLTemplate (Progid=Msxml2.XMLDOMXSLTemplate) + helpstring("Compiled XSL Stylesheet Cache") +] +coclass XSLTemplate +{ + [default] interface IXSLTemplate; +}; + +// XSLTemplate, 2.6 version dependent +[ + uuid(f5078f21-c551-11d3-89b9-0000f81fe221), // CLSID_XMLDOMXSLTemplate (Progid=Microsoft.XMLDOMXSLTemplate) + helpstring("Compiled XSL Stylesheet Cache 2.6") +] +coclass XSLTemplate26 +{ + [default] interface IXSLTemplate; +}; + +// XSLTemplate, 3.0 version dependent +[ + uuid(f5078f36-c551-11d3-89b9-0000f81fe221), // CLSID_XMLDOMXSLTemplate30 (Progid=Msxml2.XMLDOMXSLTemplate.3.0) + helpstring("Compiled XSL Stylesheet Cache 3.0") +] +coclass XSLTemplate30 +{ + [default] interface IXSLTemplate; +}; + +// XSLTemplate, 4.0 version dependent +[ + uuid(88d969c3-f192-11d4-a65f-0040963251e5), // CLSID_XMLDOMXSLTemplate40 (Progid=Msxml2.XMLDOMXSLTemplate.4.0) + helpstring("Compiled XSL Stylesheet Cache 4.0") +] +coclass XSLTemplate40 +{ + [default] interface IXSLTemplate; +}; + +[ + uuid(88d96a08-f192-11d4-a65f-0040963251e5), // CLSID_XSLTemplate60 + helpstring("XSL Stylesheet Cache 6.0") +] +coclass XSLTemplate60 +{ + [default] interface IXSLTemplate; +}; + +// XML HTTP Request Class, version independent +[ + uuid(F6D90F16-9C73-11D3-B32E-00C04F990BB4), // CLSID_XMLHTTP + helpstring("XML HTTP Request class.") +] +coclass XMLHTTP +{ + [default] interface IXMLHTTPRequest; +}; + +// XML HTTP Request Class, 2.6, version dependent +[ + uuid(f5078f1e-c551-11d3-89b9-0000f81fe221), // CLSID_XMLHTTP26 + helpstring("XML HTTP Request class.") +] +coclass XMLHTTP26 +{ + [default] interface IXMLHTTPRequest; +}; + +// XML HTTP Request Class, 3.0, version dependent +[ + uuid(f5078f35-c551-11d3-89b9-0000f81fe221), // CLSID_XMLHTTP30 + helpstring("XML HTTP Request class.") +] +coclass XMLHTTP30 +{ + [default] interface IXMLHTTPRequest; +}; + +// XML HTTP Request Class, 4.0, version dependent +[ + uuid(88d969c5-f192-11d4-a65f-0040963251e5), // CLSID_XMLHTTP40 + helpstring("XML HTTP Request class.") +] +coclass XMLHTTP40 +{ + [default] interface IXMLHTTPRequest; +}; + +[ + uuid(88d96a0a-f192-11d4-a65f-0040963251e5), // CLSID_XMLHTTP60 + helpstring("XML HTTP Request class 6.0") +] +coclass XMLHTTP60 +{ + [default] interface IXMLHTTPRequest; +}; + +// Server XML HTTP Request Class, version independent +[ + uuid(afba6b42-5692-48ea-8141-dc517dcf0ef1), // CLSID_ServerXMLHTTP + helpstring("Server XML HTTP Request class.") +] +coclass ServerXMLHTTP +{ + [default] interface IServerXMLHTTPRequest; +} + +// Server XML HTTP Request Class, 3.0, version dependent +[ + uuid(afb40ffd-b609-40a3-9828-f88bbe11e4e3), // CLSID_ServerXMLHTTP30 + helpstring("Server XML HTTP Request class.") +] +coclass ServerXMLHTTP30 +{ + [default] interface IServerXMLHTTPRequest; +} + +// Server XML HTTP Request Class, 4.0, version dependent +[ + uuid(88d969c6-f192-11d4-a65f-0040963251e5), // CLSID_ServerXMLHTTP40 + helpstring("Server XML HTTP Request class.") +] +coclass ServerXMLHTTP40 +{ + [default] interface IServerXMLHTTPRequest2; +} + +[ + uuid(88d96a0b-f192-11d4-a65f-0040963251e5), // CLSID_ServerXMLHTTP60 + helpstring("Server XML HTTP Request 6.0 ") +] +coclass ServerXMLHTTP60 +{ + [default] interface IServerXMLHTTPRequest2; +} + +// SAXXMLReader co-class, version independent +[ + uuid(079aa557-4a18-424a-8eee-e39f0a8d41b9), // CLSID_SAXXMLReader + helpstring("SAX XML Reader (version independent) coclass") +] +coclass SAXXMLReader +{ + [default] interface IVBSAXXMLReader; + interface ISAXXMLReader; + interface IMXReaderControl; +}; + +// SAXXMLReader co-class, 3.0 version dependent +[ + uuid(3124c396-fb13-4836-a6ad-1317f1713688), // CLSID_SAXXMLReader30 + helpstring("SAX XML Reader 3.0 coclass") +] +coclass SAXXMLReader30 +{ + [default] interface IVBSAXXMLReader; + interface ISAXXMLReader; + interface IMXReaderControl; +}; + +// SAXXMLReader co-class, 4.0 version dependent +[ + uuid(7c6e29bc-8b8b-4c3d-859e-af6cd158be0f), // CLSID_SAXXMLReader40 + helpstring("SAX XML Reader 4.0 coclass") +] +coclass SAXXMLReader40 +{ + [default] interface IVBSAXXMLReader; + interface ISAXXMLReader; +}; + +[ + uuid(88d96a0c-f192-11d4-a65f-0040963251e5), // CLSID_SAXXMLReader60 + helpstring("SAX XML Reader 6.0") +] +coclass SAXXMLReader60 +{ + [default] interface IVBSAXXMLReader; + interface ISAXXMLReader; +}; + +// MXXMLWriter co-class, version independent +[ + uuid(fc220ad8-a72a-4ee8-926e-0b7ad152a020), // CLSID_MXXMLWriter + helpstring("Microsoft XML Writer (version independent) coclass") +] +coclass MXXMLWriter +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXErrorHandler; + interface ISAXDTDHandler; + interface ISAXLexicalHandler; + interface ISAXDeclHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// MXXMLWriter co-class, 3.0 version dependent +[ + uuid(3d813dfe-6c91-4a4e-8f41-04346a841d9c), // CLSID_MXXMLWriter30 + helpstring("Microsoft XML Writer 3.0 coclass") +] +coclass MXXMLWriter30 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// MXXMLWriter co-class, 4.0 version dependent +[ + uuid(88d969c8-f192-11d4-a65f-0040963251e5), // CLSID_MXXMLWriter40 + helpstring("Microsoft XML Writer 4.0 coclass") +] +coclass MXXMLWriter40 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +[ + uuid(88d96a0f-f192-11d4-a65f-0040963251e5), // CLSID_MXXMLWriter60 + helpstring("Microsoft XML Writer 6.0") +] +coclass MXXMLWriter60 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// MXHTMLWriter co-class, version independent +[ + uuid(a4c23ec3-6b70-4466-9127-550077239978), // CLSID_MXHTMLWriter + helpstring("Microsoft HTML Writer (version independent) coclass") +] +coclass MXHTMLWriter +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXErrorHandler; + interface ISAXDTDHandler; + interface ISAXLexicalHandler; + interface ISAXDeclHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// MXHTMLWriter co-class, 3.0 version dependent +[ + uuid(853d1540-c1a7-4aa9-a226-4d3bd301146d), // CLSID_MXHTMLWriter30 + helpstring("Microsoft HTML Writer 3.0 coclass") +] +coclass MXHTMLWriter30 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// MXHTMLWriter co-class, 4.0 version dependent +[ + uuid(88d969c9-f192-11d4-a65f-0040963251e5), // CLSID_MXHTMLWriter40 + helpstring("Microsoft HTML Writer 4.0 coclass") +] +coclass MXHTMLWriter40 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +[ + uuid(88d96a10-f192-11d4-a65f-0040963251e5), // CLSID_MXHTMLWriter60 + helpstring("Microsoft HTML Writer 6.0") +] +coclass MXHTMLWriter60 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +// SAXAttributes co-class, version independent +[ + uuid(4dd441ad-526d-4a77-9f1b-9841ed802fb0), // CLSID_SAXAttributes + helpstring("SAX Attributes (version independent) coclass") +] +coclass SAXAttributes +{ + [default] interface IMXAttributes; + interface IVBSAXAttributes; + interface ISAXAttributes; +}; + +// SAXAttributes co-class, 3.0 version dependent +[ + uuid(3e784a01-f3ae-4dc0-9354-9526b9370eba), // CLSID_SAXAttributes30 + helpstring("SAX Attributes 3.0 coclass") +] +coclass SAXAttributes30 +{ + [default] interface IMXAttributes; + interface IVBSAXAttributes; + interface ISAXAttributes; +}; + +// SAXAttributes co-class, 4.0 version dependent +[ + uuid(88d969ca-f192-11d4-a65f-0040963251e5), // CLSID_SAXAttributes40 + helpstring("SAX Attributes 4.0 coclass") +] +coclass SAXAttributes40 +{ + [default] interface IMXAttributes; + interface IVBSAXAttributes; + interface ISAXAttributes; +}; + +[ + uuid(88d96a0e-f192-11d4-a65f-0040963251e5), // CLSID_SAXAttributes60 + helpstring("SAX Attributes 6.0") +] +coclass SAXAttributes60 +{ + [default] interface IMXAttributes; + interface IVBSAXAttributes; + interface ISAXAttributes; +}; + +// MXNamespaceManager co-class version independent +[ + uuid(88d969d5-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager + helpstring("MX Namespace Manager coclass") +] +coclass MXNamespaceManager +{ + [default] interface IVBMXNamespaceManager; + interface IMXNamespaceManager; +}; + +// MXNamespaceManager co-class, 4.0 version dependent +[ + uuid(88d969d6-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager40 + helpstring("MX Namespace Manager 4.0 coclass") +] +coclass MXNamespaceManager40 +{ + [default] interface IVBMXNamespaceManager; + interface IMXNamespaceManager; +}; + +[ + uuid(88d96a11-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager60 + helpstring("MX Namespace Manager 6.0") +] +coclass MXNamespaceManager60 +{ + [default] interface IVBMXNamespaceManager; + interface IMXNamespaceManager; +}; + +} + +cpp_quote("//----------------------------") +cpp_quote("// MSXML SPECIFIC ERROR CODES ") +cpp_quote("//----------------------------") +cpp_quote("#define E_XML_NOTWF 0xC00CE223L // Validate failed because the document is not well formed.") +cpp_quote("#define E_XML_NODTD 0xC00CE224L // The node is neither Valid nor Invalid because no DTD/Schema declaration was found.") +cpp_quote("#define E_XML_INVALID 0xC00CE225L // Validate failed because of a DTD/Schema violation.") +cpp_quote("#define E_XML_BUFFERTOOSMALL 0xC00CE226L // Buffer passed in is too small to receive the data.") + + +cpp_quote("#ifdef __USE_MSXML6_NAMESPACE__") +cpp_quote("}") +cpp_quote("#endif") + diff --git a/cli/test/include/gtest/msxml6did.h b/cli/test/include/gtest/msxml6did.h new file mode 100644 index 0000000..36b62f8 --- /dev/null +++ b/cli/test/include/gtest/msxml6did.h @@ -0,0 +1,660 @@ +//************************************************************************** +//* Microsoft Windows ** +//* Copyright (c) 1996 - 2001 Microsoft Corporation. All rights reserved. ** +//************************************************************************** + +//;begin_internal +/*********************************************************************************************** + + This is a distributed SDK component - do not put any #includes or other directives that rely + upon files not dropped. If in doubt - build iedev + + If you add comments please include either ;BUGBUG at the beginning of a single line OR + enclose in a ;begin_internal, ;end_internal block - such as this one! + + ***********************************************************************************************/ +//;end_internal + +//;begin_internal +#ifndef __MSXML2DID_H__ +#define __MSXML2DID_H__ +//;end_internal + +#define DISPID_XOBJ_MIN 0x00010000 +#define DISPID_XOBJ_MAX 0x0001FFFF +#define DISPID_XOBJ_BASE DISPID_XOBJ_MIN + + +#define DISPID_XMLELEMENTCOLLECTION DISPID_XOBJ_BASE + +#define DISPID_XMLELEMENTCOLLECTION_LENGTH DISPID_XMLELEMENTCOLLECTION + 1 +#define DISPID_XMLELEMENTCOLLECTION_NEWENUM DISPID_NEWENUM +#define DISPID_XMLELEMENTCOLLECTION_ITEM DISPID_XMLELEMENTCOLLECTION + 3 + + +#define DISPID_XMLDOCUMENT DISPID_XMLELEMENTCOLLECTION + 100 + +#define DISPID_XMLDOCUMENT_ROOT DISPID_XMLDOCUMENT + 1 +#define DISPID_XMLDOCUMENT_FILESIZE DISPID_XMLDOCUMENT + 2 +#define DISPID_XMLDOCUMENT_FILEMODIFIEDDATE DISPID_XMLDOCUMENT + 3 +#define DISPID_XMLDOCUMENT_FILEUPDATEDDATE DISPID_XMLDOCUMENT + 4 +#define DISPID_XMLDOCUMENT_URL DISPID_XMLDOCUMENT + 5 +#define DISPID_XMLDOCUMENT_MIMETYPE DISPID_XMLDOCUMENT + 6 +#define DISPID_XMLDOCUMENT_READYSTATE DISPID_XMLDOCUMENT + 7 +#define DISPID_XMLDOCUMENT_CREATEELEMENT DISPID_XMLDOCUMENT + 8 +#define DISPID_XMLDOCUMENT_CHARSET DISPID_XMLDOCUMENT + 9 +#define DISPID_XMLDOCUMENT_VERSION DISPID_XMLDOCUMENT + 10 +#define DISPID_XMLDOCUMENT_DOCTYPE DISPID_XMLDOCUMENT + 11 +#define DISPID_XMLDOCUMENT_DTDURL DISPID_XMLDOCUMENT + 12 +#define DISPID_XMLDOCUMENT_ASYNC DISPID_XMLDOCUMENT + 13 +#define DISPID_XMLDOCUMENT_CASEINSENSITIVE DISPID_XMLDOCUMENT + 14 +#define DISPID_XMLDOCUMENT_BASEURL DISPID_XMLDOCUMENT + 15 +#define DISPID_XMLDOCUMENT_XML DISPID_XMLDOCUMENT + 16 +#define DISPID_XMLDOCUMENT_LASTERROR DISPID_XMLDOCUMENT + 17 +#define DISPID_XMLDOCUMENT_TRIMWHITESPACE DISPID_XMLDOCUMENT + 18 +#define DISPID_XMLDOCUMENT_COMMIT DISPID_XMLDOCUMENT + 19 + +#define DISPID_XMLELEMENT DISPID_XMLDOCUMENT + 100 + +#define DISPID_XMLELEMENT_TAGNAME DISPID_XMLELEMENT + 1 +#define DISPID_XMLELEMENT_PARENT DISPID_XMLELEMENT + 2 +#define DISPID_XMLELEMENT_SETATTRIBUTE DISPID_XMLELEMENT + 3 +#define DISPID_XMLELEMENT_GETATTRIBUTE DISPID_XMLELEMENT + 4 +#define DISPID_XMLELEMENT_REMOVEATTRIBUTE DISPID_XMLELEMENT + 5 +#define DISPID_XMLELEMENT_CHILDREN DISPID_XMLELEMENT + 6 +#define DISPID_XMLELEMENT_TYPE DISPID_XMLELEMENT + 7 +#define DISPID_XMLELEMENT_TEXT DISPID_XMLELEMENT + 8 +#define DISPID_XMLELEMENT_ADDCHILD DISPID_XMLELEMENT + 9 +#define DISPID_XMLELEMENT_REMOVECHILD DISPID_XMLELEMENT + 10 +#define DISPID_XMLELEMENT_ATTRIBUTES DISPID_XMLELEMENT + 11 + +#define DISPID_XMLNOTIFSINK DISPID_XMLELEMENT + 100 + +#define DISPID_XMLNOTIFSINK_CHILDADDED DISPID_XMLNOTIFSINK + 1 + +#define DISPID_XMLATTRIBUTE DISPID_XMLNOTIFSINK + 100 + +#define DISPID_XMLATTRIBUTE_NAME DISPID_XMLATTRIBUTE + 1 +#define DISPID_XMLATTRIBUTE_VALUE DISPID_XMLATTRIBUTE + 2 + + +// IXMLError2 +#define DISPID_XMLERROR DISPID_XMLNOTIFSINK + 100 +#define DISPID_XMLERROR_REASON DISPID_XMLERROR + 1 +#define DISPID_XMLERROR_LINE DISPID_XMLERROR + 2 +#define DISPID_XMLERROR_POS DISPID_XMLERROR + 3 + +// INode +#define DISPID_NODE DISPID_XMLERROR + 100 +#define DISPID_NODE_NAME DISPID_NODE + 1 +#define DISPID_NODE_PARENT DISPID_NODE + 2 +#define DISPID_NODE_TYPE DISPID_NODE + 3 + +#define DISPID_NODE_VALUE DISPID_NODE + 4 + +#define DISPID_NODE_SETATTRIBUTE DISPID_NODE + 5 +#define DISPID_NODE_GETATTRIBUTE DISPID_NODE + 6 +#define DISPID_NODE_REMOVEATTRIBUTE DISPID_NODE + 7 +#define DISPID_NODE_ATTRIBUTES DISPID_NODE + 8 + +#define DISPID_NODE_ADD DISPID_NODE + 9 +#define DISPID_NODE_REMOVE DISPID_NODE + 10 +#define DISPID_NODE_CHILDREN DISPID_NODE + 11 + +// INodeList +#define DISPID_NODELIST DISPID_NODE + 100 +#define DISPID_NODELIST_NEWENUM DISPID_NODELIST + 1 +#define DISPID_NODELIST_NEXT DISPID_NODELIST + 2 +#define DISPID_NODELIST_CURRENT DISPID_NODELIST + 3 +#define DISPID_NODELIST_MOVE DISPID_NODELIST + 4 +#define DISPID_NODELIST_MOVETONODE DISPID_NODELIST + 5 + +#define DISPID_NODELIST_LENGTH DISPID_NODELIST + 6 +#define DISPID_NODELIST_ITEM DISPID_NODELIST + 7 + + +// Our dispids need to be mapped into the range 1..9999 to keep Trident happy +// specifically, to make the XML tag more efficient. (simonb, 09-18-1998) +#define DISPID_DOM_BASE 0x00000001 + +#define DISPID_DOM_COLLECTION_BASE 1000000 +#define DISPID_DOM_COLLECTION_MAX 2999999 + +#define DISPID_DOM_NODE (DISPID_DOM_BASE) +#define DISPID_DOM_NODE_NODENAME (DISPID_DOM_NODE + 1) +#define DISPID_DOM_NODE_NODEVALUE (DISPID_DOM_NODE + 2) +#define DISPID_DOM_NODE_NODETYPE (DISPID_DOM_NODE + 3) +#define DISPID_DOM_NODE_NODETYPEENUM (DISPID_DOM_NODE + 4) +#define DISPID_DOM_NODE_PARENTNODE (DISPID_DOM_NODE + 5) +#define DISPID_DOM_NODE_CHILDNODES (DISPID_DOM_NODE + 6) +#define DISPID_DOM_NODE_FIRSTCHILD (DISPID_DOM_NODE + 7) +#define DISPID_DOM_NODE_LASTCHILD (DISPID_DOM_NODE + 8) +#define DISPID_DOM_NODE_PREVIOUSSIBLING (DISPID_DOM_NODE + 9) +#define DISPID_DOM_NODE_NEXTSIBLING (DISPID_DOM_NODE + 10) +#define DISPID_DOM_NODE_ATTRIBUTES (DISPID_DOM_NODE + 11) +#define DISPID_DOM_NODE_INSERTBEFORE (DISPID_DOM_NODE + 12) +#define DISPID_DOM_NODE_REPLACECHILD (DISPID_DOM_NODE + 13) +#define DISPID_DOM_NODE_REMOVECHILD (DISPID_DOM_NODE + 14) +#define DISPID_DOM_NODE_APPENDCHILD (DISPID_DOM_NODE + 15) +#define DISPID_DOM_NODE_HASCHILDNODES (DISPID_DOM_NODE + 16) +#define DISPID_DOM_NODE_OWNERDOC (DISPID_DOM_NODE + 17) +#define DISPID_DOM_NODE_CLONENODE (DISPID_DOM_NODE + 18) +#define DISPID_XMLDOM_NODE (DISPID_DOM_NODE + 19) +#define DISPID_XMLDOM_NODE_STRINGTYPE (DISPID_XMLDOM_NODE + 1) +#define DISPID_XMLDOM_NODE_SPECIFIED (DISPID_XMLDOM_NODE + 2) +#define DISPID_XMLDOM_NODE_DEFINITION (DISPID_XMLDOM_NODE + 3) +#define DISPID_XMLDOM_NODE_TEXT (DISPID_XMLDOM_NODE + 4) +#define DISPID_XMLDOM_NODE_NODETYPEDVALUE (DISPID_XMLDOM_NODE + 5) +#define DISPID_XMLDOM_NODE_DATATYPE (DISPID_XMLDOM_NODE + 6) +#define DISPID_XMLDOM_NODE_XML (DISPID_XMLDOM_NODE + 7) +#define DISPID_XMLDOM_NODE_TRANSFORMNODE (DISPID_XMLDOM_NODE + 8) +#define DISPID_XMLDOM_NODE_SELECTNODES (DISPID_XMLDOM_NODE + 9) +#define DISPID_XMLDOM_NODE_SELECTSINGLENODE (DISPID_XMLDOM_NODE + 10) +#define DISPID_XMLDOM_NODE_PARSED (DISPID_XMLDOM_NODE + 11) +#define DISPID_XMLDOM_NODE_NAMESPACE (DISPID_XMLDOM_NODE + 12) +#define DISPID_XMLDOM_NODE_PREFIX (DISPID_XMLDOM_NODE + 13) +#define DISPID_XMLDOM_NODE_BASENAME (DISPID_XMLDOM_NODE + 14) +#define DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT (DISPID_XMLDOM_NODE + 15) +#define DISPID_XMLDOM_NODE__TOP (DISPID_XMLDOM_NODE + 16) + +#define DISPID_DOM_DOCUMENT (DISPID_XMLDOM_NODE__TOP + 1) +#define DISPID_DOM_DOCUMENT_DOCTYPE (DISPID_DOM_DOCUMENT + 1) +#define DISPID_DOM_DOCUMENT_IMPLEMENTATION (DISPID_DOM_DOCUMENT + 2) +#define DISPID_DOM_DOCUMENT_DOCUMENTELEMENT (DISPID_DOM_DOCUMENT + 3) +#define DISPID_DOM_DOCUMENT_CREATEELEMENT (DISPID_DOM_DOCUMENT + 4) +#define DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT (DISPID_DOM_DOCUMENT + 5) +#define DISPID_DOM_DOCUMENT_CREATETEXTNODE (DISPID_DOM_DOCUMENT + 6) +#define DISPID_DOM_DOCUMENT_CREATECOMMENT (DISPID_DOM_DOCUMENT + 7) +#define DISPID_DOM_DOCUMENT_CREATECDATASECTION (DISPID_DOM_DOCUMENT + 8) +#define DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION (DISPID_DOM_DOCUMENT + 9) +#define DISPID_DOM_DOCUMENT_CREATEATTRIBUTE (DISPID_DOM_DOCUMENT + 10) +#define DISPID_DOM_DOCUMENT_CREATEENTITY (DISPID_DOM_DOCUMENT + 11) +#define DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE (DISPID_DOM_DOCUMENT + 12) +#define DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME (DISPID_DOM_DOCUMENT + 13) +#define DISPID_DOM_DOCUMENT_TOP (DISPID_DOM_DOCUMENT + 14) +#define DISPID_XMLDOM_DOCUMENT (DISPID_DOM_DOCUMENT + 15) +#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNODE (DISPID_XMLDOM_DOCUMENT + 1) +#define DISPID_XMLDOM_DOCUMENT_CREATENODE (DISPID_XMLDOM_DOCUMENT + 2) +#define DISPID_XMLDOM_DOCUMENT_CREATENODEEX (DISPID_XMLDOM_DOCUMENT + 3) +#define DISPID_XMLDOM_DOCUMENT_NODEFROMID (DISPID_XMLDOM_DOCUMENT + 4) +#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNAMESPACES (DISPID_XMLDOM_DOCUMENT + 5) +#define DISPID_XMLDOM_DOCUMENT_LOAD (DISPID_XMLDOM_DOCUMENT + 6) +#define DISPID_XMLDOM_DOCUMENT_PARSEERROR (DISPID_XMLDOM_DOCUMENT + 7) +#define DISPID_XMLDOM_DOCUMENT_URL (DISPID_XMLDOM_DOCUMENT + 8) +#define DISPID_XMLDOM_DOCUMENT_ASYNC (DISPID_XMLDOM_DOCUMENT + 9) +#define DISPID_XMLDOM_DOCUMENT_ABORT (DISPID_XMLDOM_DOCUMENT + 10) +#define DISPID_XMLDOM_DOCUMENT_LOADXML (DISPID_XMLDOM_DOCUMENT + 11) +#define DISPID_XMLDOM_DOCUMENT_SAVE (DISPID_XMLDOM_DOCUMENT + 12) +#define DISPID_XMLDOM_DOCUMENT_VALIDATE (DISPID_XMLDOM_DOCUMENT + 13) +#define DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE (DISPID_XMLDOM_DOCUMENT + 14) +#define DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE (DISPID_XMLDOM_DOCUMENT + 15) +#define DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE (DISPID_XMLDOM_DOCUMENT + 16) +#define DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE (DISPID_XMLDOM_DOCUMENT + 17) +#define DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE (DISPID_XMLDOM_DOCUMENT + 18) +#define DISPID_XMLDOM_DOCUMENT__TOP (DISPID_XMLDOM_DOCUMENT + 19) + +#define DISPID_DOM_NODELIST (DISPID_XMLDOM_DOCUMENT__TOP + 1) +#define DISPID_DOM_NODELIST_ITEM (DISPID_DOM_NODELIST + 1) +#define DISPID_DOM_NODELIST_LENGTH (DISPID_DOM_NODELIST + 2) +#define DISPID_XMLDOM_NODELIST (DISPID_DOM_NODELIST + 3) +#define DISPID_XMLDOM_NODELIST_NEXTNODE (DISPID_XMLDOM_NODELIST + 1) +#define DISPID_XMLDOM_NODELIST_RESET (DISPID_XMLDOM_NODELIST + 2) +#define DISPID_XMLDOM_NODELIST_NEWENUM (DISPID_XMLDOM_NODELIST + 3) +#define DISPID_XMLDOM_NODELIST__TOP (DISPID_XMLDOM_NODELIST + 4) + + +#define DISPID_DOM_NAMEDNODEMAP (DISPID_XMLDOM_NODELIST__TOP + 1) +#define DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 3) +#define DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 4) +#define DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 5) +#define DISPID_XMLDOM_NAMEDNODEMAP (DISPID_DOM_NAMEDNODEMAP + 6) +#define DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM (DISPID_XMLDOM_NAMEDNODEMAP + 1) +#define DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM (DISPID_XMLDOM_NAMEDNODEMAP + 2) +#define DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE (DISPID_XMLDOM_NAMEDNODEMAP + 3) +#define DISPID_XMLDOM_NAMEDNODEMAP_RESET (DISPID_XMLDOM_NAMEDNODEMAP + 4) +#define DISPID_XMLDOM_NAMEDNODEMAP_NEWENUM (DISPID_XMLDOM_NAMEDNODEMAP + 5) +#define DISPID_XMLDOM_NAMEDNODEMAP__TOP (DISPID_XMLDOM_NAMEDNODEMAP + 6) + + +#define DISPID_DOM_W3CWRAPPERS (DISPID_XMLDOM_NAMEDNODEMAP__TOP + 1) + +#define DISPID_DOM_DOCUMENTFRAGMENT (DISPID_DOM_W3CWRAPPERS + 1) +#define DISPID_DOM_DOCUMENTFRAGMENT__TOP (DISPID_DOM_DOCUMENTFRAGMENT + 1) + +#define DISPID_DOM_ELEMENT (DISPID_DOM_DOCUMENTFRAGMENT__TOP + 1) +#define DISPID_DOM_ELEMENT_GETTAGNAME (DISPID_DOM_ELEMENT + 1) +#define DISPID_DOM_ELEMENT_GETATTRIBUTES (DISPID_DOM_ELEMENT + 2) +#define DISPID_DOM_ELEMENT_GETATTRIBUTE (DISPID_DOM_ELEMENT + 3) +#define DISPID_DOM_ELEMENT_SETATTRIBUTE (DISPID_DOM_ELEMENT + 4) +#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTE (DISPID_DOM_ELEMENT + 5) +#define DISPID_DOM_ELEMENT_GETATTRIBUTENODE (DISPID_DOM_ELEMENT + 6) +#define DISPID_DOM_ELEMENT_SETATTRIBUTENODE (DISPID_DOM_ELEMENT + 7) +#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE (DISPID_DOM_ELEMENT + 8) +#define DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME (DISPID_DOM_ELEMENT + 9) +#define DISPID_DOM_ELEMENT_NORMALIZE (DISPID_DOM_ELEMENT + 10) +#define DISPID_DOM_ELEMENT__TOP (DISPID_DOM_ELEMENT + 11) + +#define DISPID_DOM_DATA (DISPID_DOM_ELEMENT__TOP + 1) +#define DISPID_DOM_DATA_DATA (DISPID_DOM_DATA + 1) +#define DISPID_DOM_DATA_LENGTH (DISPID_DOM_DATA + 2) +#define DISPID_DOM_DATA_SUBSTRING (DISPID_DOM_DATA + 3) +#define DISPID_DOM_DATA_APPEND (DISPID_DOM_DATA + 4) +#define DISPID_DOM_DATA_INSERT (DISPID_DOM_DATA + 5) +#define DISPID_DOM_DATA_DELETE (DISPID_DOM_DATA + 6) +#define DISPID_DOM_DATA_REPLACE (DISPID_DOM_DATA + 7) +#define DISPID_DOM_DATA__TOP (DISPID_DOM_DATA + 8) + +#define DISPID_DOM_ATTRIBUTE (DISPID_DOM_DATA__TOP + 1) +#define DISPID_DOM_ATTRIBUTE_GETNAME (DISPID_DOM_ATTRIBUTE + 1) +#define DISPID_DOM_ATTRIBUTE_SPECIFIED (DISPID_DOM_ATTRIBUTE + 2) +#define DISPID_DOM_ATTRIBUTE_VALUE (DISPID_DOM_ATTRIBUTE + 3) +#define DISPID_DOM_ATTRIBUTE__TOP (DISPID_DOM_ATTRIBUTE + 4) + +#define DISPID_DOM_TEXT (DISPID_DOM_ATTRIBUTE__TOP + 1) +#define DISPID_DOM_TEXT_SPLITTEXT (DISPID_DOM_TEXT + 1) +#define DISPID_DOM_TEXT_JOINTEXT (DISPID_DOM_TEXT + 2) +#define DISPID_DOM_TEXT__TOP (DISPID_DOM_TEXT + 3) + +#define DISPID_DOM_PI (DISPID_DOM_TEXT__TOP + 1) +#define DISPID_DOM_PI_TARGET (DISPID_DOM_PI + 1) +#define DISPID_DOM_PI_DATA (DISPID_DOM_PI + 2) +#define DISPID_DOM_PI__TOP (DISPID_DOM_PI + 3) + +#define DISPID_DOM_DOCUMENTTYPE (DISPID_DOM_PI__TOP + 1) +#define DISPID_DOM_DOCUMENTTYPE_NAME (DISPID_DOM_DOCUMENTTYPE + 1) +#define DISPID_DOM_DOCUMENTTYPE_ENTITIES (DISPID_DOM_DOCUMENTTYPE + 2) +#define DISPID_DOM_DOCUMENTTYPE_NOTATIONS (DISPID_DOM_DOCUMENTTYPE + 3) +#define DISPID_DOM_DOCUMENTTYPE__TOP (DISPID_DOM_DOCUMENTTYPE + 4) + +#define DISPID_DOM_NOTATION (DISPID_DOM_DOCUMENTTYPE__TOP + 1) +#define DISPID_DOM_NOTATION_PUBLICID (DISPID_DOM_NOTATION + 1) +#define DISPID_DOM_NOTATION_SYSTEMID (DISPID_DOM_NOTATION + 2) +#define DISPID_DOM_NOTATION__TOP (DISPID_DOM_NOTATION + 3) + +#define DISPID_DOM_ENTITY (DISPID_DOM_NOTATION__TOP + 1) +#define DISPID_DOM_ENTITY_PUBLICID (DISPID_DOM_ENTITY + 1) +#define DISPID_DOM_ENTITY_SYSTEMID (DISPID_DOM_ENTITY + 2) +#define DISPID_DOM_ENTITY_NOTATIONNAME (DISPID_DOM_ENTITY + 3) +#define DISPID_DOM_ENTITY__TOP (DISPID_DOM_ENTITY + 4) + +//define DISPID_DOM_COMMENT +//define DISPID_DOM_CDATASECTION +//define DISPID_DOM_ENTITYREFERENCE + +#define DISPID_DOM_W3CWRAPPERS_TOP (DISPID_DOM_ENTITY__TOP) + + +#define DISPID_DOM_IMPLEMENTATION (DISPID_DOM_W3CWRAPPERS_TOP + 1) +#define DISPID_DOM_IMPLEMENTATION_HASFEATURE (DISPID_DOM_IMPLEMENTATION + 1) +#define DISPID_DOM_IMPLEMENTATION__TOP (DISPID_DOM_IMPLEMENTATION + 2) + +#define DISPID_DOM__TOP (DISPID_DOM_IMPLEMENTATION + 0x20) + + +#define DISPID_DOM_ERROR (DISPID_DOM__TOP + 1) +#define DISPID_DOM_ERROR_ERRORCODE (DISPID_DOM_ERROR + 1) +#define DISPID_DOM_ERROR_URL (DISPID_DOM_ERROR + 2) +#define DISPID_DOM_ERROR_REASON (DISPID_DOM_ERROR + 3) +#define DISPID_DOM_ERROR_SRCTEXT (DISPID_DOM_ERROR + 4) +#define DISPID_DOM_ERROR_LINE (DISPID_DOM_ERROR + 5) +#define DISPID_DOM_ERROR_LINEPOS (DISPID_DOM_ERROR + 6) +#define DISPID_DOM_ERROR_FILEPOS (DISPID_DOM_ERROR + 7) +#define DISPID_DOM_ERROR__TOP (DISPID_DOM_ERROR + 8) + +#define DISPID_DOM_ERROR2 (DISPID_DOM_ERROR__TOP + 1) +#define DISPID_DOM_ERROR2_ALLERRORS (DISPID_DOM_ERROR2 + 1) +#define DISPID_DOM_ERROR2_ERRORPARAMETERS (DISPID_DOM_ERROR2 + 2) +#define DISPID_DOM_ERROR2_ERRORPARAMETERSCOUNT (DISPID_DOM_ERROR2 + 3) +#define DISPID_DOM_ERROR2_ERRORXPATH (DISPID_DOM_ERROR2 + 4) +#define DISPID_DOM_ERROR2__TOP (DISPID_DOM_ERROR2 + 5) + +#define DISPID_DOM_ERRORCOLLECTION (DISPID_DOM_ERROR2__TOP + 1) +#define DISPID_DOM_ERRORCOLLECTION_LENGTH (DISPID_DOM_ERRORCOLLECTION + 1) +#define DISPID_DOM_ERRORCOLLECTION_NEXT (DISPID_DOM_ERRORCOLLECTION + 2) +#define DISPID_DOM_ERRORCOLLECTION_RESET (DISPID_DOM_ERRORCOLLECTION + 3) +#define DISPID_DOM_ERRORCOLLECTION__TOP (DISPID_DOM_ERRORCOLLECTION + 4) + +#define DISPID_XTLRUNTIME (DISPID_DOM_ERROR__TOP + 1) +#define DISPID_XTLRUNTIME_UNIQUEID (DISPID_XTLRUNTIME + 1) +#define DISPID_XTLRUNTIME_DEPTH (DISPID_XTLRUNTIME + 2) +#define DISPID_XTLRUNTIME_CHILDNUMBER (DISPID_XTLRUNTIME + 3) +#define DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER (DISPID_XTLRUNTIME + 4) +#define DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER (DISPID_XTLRUNTIME + 5) +#define DISPID_XTLRUNTIME_FORMATINDEX (DISPID_XTLRUNTIME + 6) +#define DISPID_XTLRUNTIME_FORMATNUMBER (DISPID_XTLRUNTIME + 7) +#define DISPID_XTLRUNTIME_FORMATDATE (DISPID_XTLRUNTIME + 8) +#define DISPID_XTLRUNTIME_FORMATTIME (DISPID_XTLRUNTIME + 9) +#define DISPID_XTLRUNTIME__TOP (DISPID_XTLRUNTIME + 10) + +#define DISPID_XMLDOMEVENT (DISPID_XTLRUNTIME__TOP + 1) +#define DISPID_XMLDOMEVENT_ONREADYSTATECHANGE (DISPID_READYSTATECHANGE) +#define DISPID_XMLDOMEVENT_ONDATAAVAILABLE (DISPID_XMLDOMEVENT + 1) +#define DISPID_XMLDOMEVENT__TOP (DISPID_XMLDOMEVENT + 2) + +#define DISPID_XMLDOM_DOCUMENT2 (DISPID_XMLDOMEVENT__TOP + 1) +#define DISPID_XMLDOM_DOCUMENT2_NAMESPACES (DISPID_XMLDOM_DOCUMENT2 + 1) +#define DISPID_XMLDOM_DOCUMENT2_SCHEMAS (DISPID_XMLDOM_DOCUMENT2 + 2) +#define DISPID_XMLDOM_DOCUMENT2_VALIDATE (DISPID_XMLDOM_DOCUMENT2 + 3) +#define DISPID_XMLDOM_DOCUMENT2_SETPROPERTY (DISPID_XMLDOM_DOCUMENT2 + 4) +#define DISPID_XMLDOM_DOCUMENT2_GETPROPERTY (DISPID_XMLDOM_DOCUMENT2 + 5) +#define DISPID_XMLDOM_DOCUMENT2__TOP (DISPID_XMLDOM_DOCUMENT2 + 6) + +#define DISPID_XMLDOM_DOCUMENT3 (DISPID_XMLDOM_DOCUMENT2__TOP + 1) +#define DISPID_XMLDOM_DOCUMENT3_VALIDATENODE (DISPID_XMLDOM_DOCUMENT3 + 1) +#define DISPID_XMLDOM_DOCUMENT3_IMPORTNODE (DISPID_XMLDOM_DOCUMENT3 + 2) +#define DISPID_XMLDOM_DOCUMENT3__TOP (DISPID_XMLDOM_DOCUMENT3 + 3) + +#define DISPID_XMLDOM_SCHEMACOLLECTION (DISPID_DOM_BASE + 1) +#define DISPID_XMLDOM_SCHEMACOLLECTION_ADD (DISPID_XMLDOM_SCHEMACOLLECTION + 1) +#define DISPID_XMLDOM_SCHEMACOLLECTION_GET (DISPID_XMLDOM_SCHEMACOLLECTION + 2) +#define DISPID_XMLDOM_SCHEMACOLLECTION_REMOVE (DISPID_XMLDOM_SCHEMACOLLECTION + 3) +#define DISPID_XMLDOM_SCHEMACOLLECTION_LENGTH (DISPID_XMLDOM_SCHEMACOLLECTION + 4) +#define DISPID_XMLDOM_SCHEMACOLLECTION_NAMESPACEURI (DISPID_XMLDOM_SCHEMACOLLECTION + 5) +#define DISPID_XMLDOM_SCHEMACOLLECTION_ADDCOLLECTION (DISPID_XMLDOM_SCHEMACOLLECTION + 6) +#define DISPID_XMLDOM_SCHEMACOLLECTION__TOP (DISPID_XMLDOM_SCHEMACOLLECTION + 7) + +#define DISPID_XMLDOM_SELECTION (DISPID_XMLDOM_NODELIST__TOP + 1) +#define DISPID_XMLDOM_SELECTION_EXPR (DISPID_XMLDOM_SELECTION + 1) +#define DISPID_XMLDOM_SELECTION_CONTEXT (DISPID_XMLDOM_SELECTION + 2) +#define DISPID_XMLDOM_SELECTION_PEEKNODE (DISPID_XMLDOM_SELECTION + 3) +#define DISPID_XMLDOM_SELECTION_MATCHES (DISPID_XMLDOM_SELECTION + 4) +#define DISPID_XMLDOM_SELECTION_REMOVENEXT (DISPID_XMLDOM_SELECTION + 5) +#define DISPID_XMLDOM_SELECTION_REMOVEALL (DISPID_XMLDOM_SELECTION + 6) +#define DISPID_XMLDOM_SELECTION_CLONE (DISPID_XMLDOM_SELECTION + 7) +#define DISPID_XMLDOM_SELECTION_GETPROPERTY (DISPID_XMLDOM_SELECTION + 8) +#define DISPID_XMLDOM_SELECTION_SETPROPERTY (DISPID_XMLDOM_SELECTION + 9) +#define DISPID_XMLDOM_SELECTION__TOP (DISPID_XMLDOM_SELECTION + 10) + +#define DISPID_XMLDOM_TEMPLATE (DISPID_DOM_BASE) +#define DISPID_XMLDOM_TEMPLATE_STYLESHEET (DISPID_XMLDOM_TEMPLATE + 1) +#define DISPID_XMLDOM_TEMPLATE_CREATEPROCESSOR (DISPID_XMLDOM_TEMPLATE + 2) +#define DISPID_XMLDOM_TEMPLATE__TOP (DISPID_XMLDOM_TEMPLATE + 3) + +#define DISPID_XMLDOM_PROCESSOR (DISPID_DOM_BASE) +#define DISPID_XMLDOM_PROCESSOR_INPUT (DISPID_XMLDOM_PROCESSOR + 1) +#define DISPID_XMLDOM_PROCESSOR_XSLTEMPLATE (DISPID_XMLDOM_PROCESSOR + 2) +#define DISPID_XMLDOM_PROCESSOR_SETSTARTMODE (DISPID_XMLDOM_PROCESSOR + 3) +#define DISPID_XMLDOM_PROCESSOR_STARTMODE (DISPID_XMLDOM_PROCESSOR + 4) +#define DISPID_XMLDOM_PROCESSOR_STARTMODEURI (DISPID_XMLDOM_PROCESSOR + 5) +#define DISPID_XMLDOM_PROCESSOR_OUTPUT (DISPID_XMLDOM_PROCESSOR + 6) +#define DISPID_XMLDOM_PROCESSOR_TRANSFORM (DISPID_XMLDOM_PROCESSOR + 7) +#define DISPID_XMLDOM_PROCESSOR_RESET (DISPID_XMLDOM_PROCESSOR + 8) +#define DISPID_XMLDOM_PROCESSOR_READYSTATE (DISPID_XMLDOM_PROCESSOR + 9) +#define DISPID_XMLDOM_PROCESSOR_ADDPARAMETER (DISPID_XMLDOM_PROCESSOR + 10) +#define DISPID_XMLDOM_PROCESSOR_ADDOBJECT (DISPID_XMLDOM_PROCESSOR + 11) +#define DISPID_XMLDOM_PROCESSOR_STYLESHEET (DISPID_XMLDOM_PROCESSOR + 12) +#define DISPID_XMLDOM_PROCESSOR__TOP (DISPID_XMLDOM_PROCESSOR + 13) + +#define DISPID_XMLDSO DISPID_XOBJ_BASE +#define DISPID_XMLDSO_DOCUMENT DISPID_XMLDSO + 1 +#define DISPID_XMLDSO_JAVADSOCOMPATIBLE DISPID_XMLDSO_DOCUMENT + 1 + + +#define DISPID_SAX_XMLREADER__MIN 0x00000501 +#define DISPID_SAX_XMLREADER__MAX 0x00010000 +#define DISPID_SAX_XMLREADER__BASE DISPID_SAX_XMLREADER__MIN + +#define DISPID_SAX_XMLREADER (DISPID_SAX_XMLREADER__BASE) +#define DISPID_SAX_XMLREADER_GETFEATURE (DISPID_SAX_XMLREADER + 1) +#define DISPID_SAX_XMLREADER_PUTFEATURE (DISPID_SAX_XMLREADER + 2) +#define DISPID_SAX_XMLREADER_GETPROPERTY (DISPID_SAX_XMLREADER + 3) +#define DISPID_SAX_XMLREADER_PUTPROPERTY (DISPID_SAX_XMLREADER + 4) +#define DISPID_SAX_XMLREADER_ENTITYRESOLVER (DISPID_SAX_XMLREADER + 5) +#define DISPID_SAX_XMLREADER_CONTENTHANDLER (DISPID_SAX_XMLREADER + 6) +#define DISPID_SAX_XMLREADER_DTDHANDLER (DISPID_SAX_XMLREADER + 7) +#define DISPID_SAX_XMLREADER_ERRORHANDLER (DISPID_SAX_XMLREADER + 8) +#define DISPID_SAX_XMLREADER_BASEURL (DISPID_SAX_XMLREADER + 9) +#define DISPID_SAX_XMLREADER_SECUREBASEURL (DISPID_SAX_XMLREADER + 10) +#define DISPID_SAX_XMLREADER_PARSE (DISPID_SAX_XMLREADER + 11) +#define DISPID_SAX_XMLREADER_PARSEURL (DISPID_SAX_XMLREADER + 12) +#define DISPID_SAX_XMLREADER_PARENT (DISPID_SAX_XMLREADER + 13) +#define DISPID_SAX_XMLREADER__TOP (DISPID_SAX_XMLREADER + 14) + +#define DISPID_SAX_XMLFILTER__BASE (DISPID_SAX_XMLREADER__TOP + 1) +#define DISPID_SAX_XMLFILTER (DISPID_SAX_XMLFILTER__BASE) +#define DISPID_SAX_XMLFILTER_GETFEATURE (DISPID_SAX_XMLFILTER + 1) +#define DISPID_SAX_XMLFILTER_PUTFEATURE (DISPID_SAX_XMLFILTER + 2) +#define DISPID_SAX_XMLFILTER_GETPROPERTY (DISPID_SAX_XMLFILTER + 3) +#define DISPID_SAX_XMLFILTER_PUTPROPERTY (DISPID_SAX_XMLFILTER + 4) +#define DISPID_SAX_XMLFILTER_ENTITYRESOLVER (DISPID_SAX_XMLFILTER + 5) +#define DISPID_SAX_XMLFILTER_CONTENTHANDLER (DISPID_SAX_XMLFILTER + 6) +#define DISPID_SAX_XMLFILTER_DTDHANDLER (DISPID_SAX_XMLFILTER + 7) +#define DISPID_SAX_XMLFILTER_ERRORHANDLER (DISPID_SAX_XMLFILTER + 8) +#define DISPID_SAX_XMLFILTER_BASEURL (DISPID_SAX_XMLFILTER + 9) +#define DISPID_SAX_XMLFILTER_SECUREBASEURL (DISPID_SAX_XMLFILTER + 10) +#define DISPID_SAX_XMLFILTER_PARSE (DISPID_SAX_XMLFILTER + 11) +#define DISPID_SAX_XMLFILTER_PARSEURL (DISPID_SAX_XMLFILTER + 12) +#define DISPID_SAX_XMLFILTER_PARENT (DISPID_SAX_XMLFILTER + 13) +#define DISPID_SAX_XMLFILTER__TOP (DISPID_SAX_XMLFILTER + 15) + +#define DISPID_SAX_LOCATOR__BASE (DISPID_SAX_XMLFILTER__TOP + 1) +#define DISPID_SAX_LOCATOR (DISPID_SAX_LOCATOR__BASE) +#define DISPID_SAX_LOCATOR_COLUMNNUMBER (DISPID_SAX_LOCATOR + 1) +#define DISPID_SAX_LOCATOR_LINENUMBER (DISPID_SAX_LOCATOR + 2) +#define DISPID_SAX_LOCATOR_PUBLICID (DISPID_SAX_LOCATOR + 3) +#define DISPID_SAX_LOCATOR_SYSTEMID (DISPID_SAX_LOCATOR + 4) +#define DISPID_SAX_LOCATOR__TOP (DISPID_SAX_LOCATOR + 5) + +#define DISPID_SAX_ENTITYRESOLVER__BASE (DISPID_SAX_LOCATOR__TOP + 1) +#define DISPID_SAX_ENTITYRESOLVER (DISPID_SAX_ENTITYRESOLVER__BASE) +#define DISPID_SAX_ENTITYRESOLVER_RESOLVEENTITY (DISPID_SAX_ENTITYRESOLVER + 1) +#define DISPID_SAX_ENTITYRESOLVER__TOP (DISPID_SAX_ENTITYRESOLVER + 2) + +#define DISPID_SAX_CONTENTHANDLER__BASE (DISPID_SAX_ENTITYRESOLVER__TOP + 1) +#define DISPID_SAX_CONTENTHANDLER (DISPID_SAX_CONTENTHANDLER__BASE) +#define DISPID_SAX_CONTENTHANDLER_DOCUMENTLOCATOR (DISPID_SAX_CONTENTHANDLER + 1) +#define DISPID_SAX_CONTENTHANDLER_STARTDOCUMENT (DISPID_SAX_CONTENTHANDLER + 2) +#define DISPID_SAX_CONTENTHANDLER_ENDDOCUMENT (DISPID_SAX_CONTENTHANDLER + 3) +#define DISPID_SAX_CONTENTHANDLER_STARTPREFIXMAPPING (DISPID_SAX_CONTENTHANDLER + 4) +#define DISPID_SAX_CONTENTHANDLER_ENDPREFIXMAPPING (DISPID_SAX_CONTENTHANDLER + 5) +#define DISPID_SAX_CONTENTHANDLER_STARTELEMENT (DISPID_SAX_CONTENTHANDLER + 6) +#define DISPID_SAX_CONTENTHANDLER_ENDELEMENT (DISPID_SAX_CONTENTHANDLER + 7) +#define DISPID_SAX_CONTENTHANDLER_CHARACTERS (DISPID_SAX_CONTENTHANDLER + 8) +#define DISPID_SAX_CONTENTHANDLER_IGNORABLEWHITESPACE (DISPID_SAX_CONTENTHANDLER + 9) +#define DISPID_SAX_CONTENTHANDLER_PROCESSINGINSTRUCTION (DISPID_SAX_CONTENTHANDLER + 10) +#define DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY (DISPID_SAX_CONTENTHANDLER + 11) +#define DISPID_SAX_CONTENTHANDLER__TOP (DISPID_SAX_CONTENTHANDLER + 12) + +#define DISPID_SAX_DTDHANDLER__BASE (DISPID_SAX_CONTENTHANDLER__TOP + 1) +#define DISPID_SAX_DTDHANDLER (DISPID_SAX_DTDHANDLER__BASE) +#define DISPID_SAX_DTDHANDLER_NOTATIONDECL (DISPID_SAX_DTDHANDLER + 1) +#define DISPID_SAX_DTDHANDLER_UNPARSEDENTITYDECL (DISPID_SAX_DTDHANDLER + 2) +#define DISPID_SAX_DTDHANDLER__TOP (DISPID_SAX_DTDHANDLER + 3) + +#define DISPID_SAX_ERRORHANDLER__BASE (DISPID_SAX_DTDHANDLER__TOP + 1) +#define DISPID_SAX_ERRORHANDLER (DISPID_SAX_ERRORHANDLER__BASE) +#define DISPID_SAX_ERRORHANDLER_ERROR (DISPID_SAX_ERRORHANDLER + 1) +#define DISPID_SAX_ERRORHANDLER_FATALERROR (DISPID_SAX_ERRORHANDLER + 2) +#define DISPID_SAX_ERRORHANDLER_IGNORABLEWARNING (DISPID_SAX_ERRORHANDLER + 3) +#define DISPID_SAX_ERRORHANDLER__TOP (DISPID_SAX_ERRORHANDLER + 4) + +#define DISPID_SAX_ATTRIBUTES__BASE (DISPID_SAX_ERRORHANDLER__TOP + 1) +#define DISPID_SAX_ATTRIBUTES (DISPID_SAX_ATTRIBUTES__BASE) +#define DISPID_SAX_ATTRIBUTES_LENGTH (DISPID_SAX_ATTRIBUTES + 1) +#define DISPID_SAX_ATTRIBUTES_GETURI (DISPID_SAX_ATTRIBUTES + 2) +#define DISPID_SAX_ATTRIBUTES_GETLOCALNAME (DISPID_SAX_ATTRIBUTES + 3) +#define DISPID_SAX_ATTRIBUTES_GETQNAME (DISPID_SAX_ATTRIBUTES + 4) +#define DISPID_SAX_ATTRIBUTES_GETINDEXFROMNAME (DISPID_SAX_ATTRIBUTES + 5) +#define DISPID_SAX_ATTRIBUTES_GETINDEXFROMQNAME (DISPID_SAX_ATTRIBUTES + 6) +#define DISPID_SAX_ATTRIBUTES_GETTYPE (DISPID_SAX_ATTRIBUTES + 7) +#define DISPID_SAX_ATTRIBUTES_GETTYPEFROMNAME (DISPID_SAX_ATTRIBUTES + 8) +#define DISPID_SAX_ATTRIBUTES_GETTYPEFROMQNAME (DISPID_SAX_ATTRIBUTES + 9) +#define DISPID_SAX_ATTRIBUTES_GETVALUE (DISPID_SAX_ATTRIBUTES + 10) +#define DISPID_SAX_ATTRIBUTES_GETVALUEFROMNAME (DISPID_SAX_ATTRIBUTES + 11) +#define DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME (DISPID_SAX_ATTRIBUTES + 12) +#define DISPID_SAX_ATTRIBUTES__TOP (DISPID_SAX_ATTRIBUTES + 13) + +#define DISPID_SAX_LEXICALHANDLER__BASE (DISPID_SAX_ATTRIBUTES__TOP + 1) +#define DISPID_SAX_LEXICALHANDLER (DISPID_SAX_LEXICALHANDLER__BASE) +#define DISPID_SAX_LEXICALHANDLER_STARTDTD (DISPID_SAX_LEXICALHANDLER + 1) +#define DISPID_SAX_LEXICALHANDLER_ENDDTD (DISPID_SAX_LEXICALHANDLER + 2) +#define DISPID_SAX_LEXICALHANDLER_STARTENTITY (DISPID_SAX_LEXICALHANDLER + 3) +#define DISPID_SAX_LEXICALHANDLER_ENDENTITY (DISPID_SAX_LEXICALHANDLER + 4) +#define DISPID_SAX_LEXICALHANDLER_STARTCDATA (DISPID_SAX_LEXICALHANDLER + 5) +#define DISPID_SAX_LEXICALHANDLER_ENDCDATA (DISPID_SAX_LEXICALHANDLER + 6) +#define DISPID_SAX_LEXICALHANDLER_COMMENT (DISPID_SAX_LEXICALHANDLER + 7) +#define DISPID_SAX_LEXICALHANDLER__TOP (DISPID_SAX_LEXICALHANDLER + 8) + +#define DISPID_SAX_DECLHANDLER__BASE (DISPID_SAX_LEXICALHANDLER__TOP + 1) +#define DISPID_SAX_DECLHANDLER (DISPID_SAX_DECLHANDLER__BASE) +#define DISPID_SAX_DECLHANDLER_ELEMENTDECL (DISPID_SAX_DECLHANDLER + 1) +#define DISPID_SAX_DECLHANDLER_ATTRIBUTEDECL (DISPID_SAX_DECLHANDLER + 2) +#define DISPID_SAX_DECLHANDLER_INTERNALENTITYDECL (DISPID_SAX_DECLHANDLER + 3) +#define DISPID_SAX_DECLHANDLER_EXTERNALENTITYDECL (DISPID_SAX_DECLHANDLER + 4) +#define DISPID_SAX_DECLHANDLER__TOP (DISPID_SAX_DECLHANDLER + 5) + +#define DISPID_MX_ATTRIBUTES__BASE (DISPID_SAX_DECLHANDLER__TOP + 1) +#define DISPID_MX_ATTRIBUTES (DISPID_MX_ATTRIBUTES__BASE) +#define DISPID_MX_ATTRIBUTES_ADDATTRIBUTE (DISPID_MX_ATTRIBUTES + 1) +#define DISPID_MX_ATTRIBUTES_CLEAR (DISPID_MX_ATTRIBUTES + 2) +#define DISPID_MX_ATTRIBUTES_REMOVEATTRIBUTE (DISPID_MX_ATTRIBUTES + 3) +#define DISPID_MX_ATTRIBUTES_SETATTRIBUTE (DISPID_MX_ATTRIBUTES + 4) +#define DISPID_MX_ATTRIBUTES_SETATTRIBUTES (DISPID_MX_ATTRIBUTES + 5) +#define DISPID_MX_ATTRIBUTES_SETLOCALNAME (DISPID_MX_ATTRIBUTES + 6) +#define DISPID_MX_ATTRIBUTES_SETQNAME (DISPID_MX_ATTRIBUTES + 7) +#define DISPID_MX_ATTRIBUTES_SETTYPE (DISPID_MX_ATTRIBUTES + 8) +#define DISPID_MX_ATTRIBUTES_SETURI (DISPID_MX_ATTRIBUTES + 9) +#define DISPID_MX_ATTRIBUTES_SETVALUE (DISPID_MX_ATTRIBUTES + 10) +#define DISPID_MX_ATTRIBUTES_ADDATTRIBUTEFROMINDEX (DISPID_MX_ATTRIBUTES + 11) +#define DISPID_MX_ATTRIBUTES__TOP (DISPID_MX_ATTRIBUTES + 11) + +#define DISPID_MX_WRITER__BASE (DISPID_MX_ATTRIBUTES__TOP + 1) +#define DISPID_MX_WRITER (DISPID_MX_WRITER__BASE) +#define DISPID_MX_WRITER_OUTPUT (DISPID_MX_WRITER + 1) +#define DISPID_MX_WRITER_DESTINATION (DISPID_MX_WRITER + 2) +#define DISPID_MX_WRITER_ENCODING (DISPID_MX_WRITER + 3) +#define DISPID_MX_WRITER_BYTEORDERMARK (DISPID_MX_WRITER + 4) +#define DISPID_MX_WRITER_INDENT (DISPID_MX_WRITER + 5) +#define DISPID_MX_WRITER_STANDALONE (DISPID_MX_WRITER + 6) +#define DISPID_MX_WRITER_OMITXMLDECLARATION (DISPID_MX_WRITER + 7) +#define DISPID_MX_WRITER_VERSION (DISPID_MX_WRITER + 8) +#define DISPID_MX_WRITER_DISABLEOUTPUTESCAPING (DISPID_MX_WRITER + 9) +#define DISPID_MX_WRITER_FLUSH (DISPID_MX_WRITER + 10) +#define DISPID_MX_WRITER_RESET (DISPID_MX_WRITER + 11) +#define DISPID_MX_WRITER__TOP (DISPID_MX_WRITER + 12) + +#define DISPID_MX_READER_CONTROL__BASE (DISPID_MX_WRITER__TOP + 1) +#define DISPID_MX_READER_CONTROL (DISPID_MX_READER_CONTROL__BASE) +#define DISPID_MX_READER_CONTROL_ABORT (DISPID_MX_READER_CONTROL + 1) +#define DISPID_MX_READER_CONTROL_RESUME (DISPID_MX_READER_CONTROL + 2) +#define DISPID_MX_READER_CONTROL_SUSPEND (DISPID_MX_READER_CONTROL + 3) +#define DISPID_MX_READER_CONTROL__TOP (DISPID_MX_READER_CONTROL + 4) + +#define DISPID_MX_SCHEMADECLHANDLER__BASE (DISPID_MX_READER_CONTROL__TOP + 1) +#define DISPID_MX_SCHEMADECLHANDLER (DISPID_MX_SCHEMADECLHANDLER__BASE) +#define DISPID_MX_SCHEMADECLHANDLER_SCHEMAELEMENTDECL (DISPID_MX_SCHEMADECLHANDLER + 1) +#define DISPID_MX_SCHEMADECLHANDLER__TOP (DISPID_MX_SCHEMADECLHANDLER + 2) + +#define DISPID_MX_NSMGR__BASE (DISPID_MX_SCHEMADECLHANDLER__TOP + 1) +#define DISPID_MX_NSMGR (DISPID_MX_NSMGR__BASE) +#define DISPID_MX_NSMGR_ALLOWOVERRIDE (DISPID_MX_NSMGR + 1) +#define DISPID_MX_NSMGR_RESET (DISPID_MX_NSMGR + 2) +#define DISPID_MX_NSMGR_PUSHCONTEXT (DISPID_MX_NSMGR + 3) +#define DISPID_MX_NSMGR_PUSHNODECONTEXT (DISPID_MX_NSMGR + 4) +#define DISPID_MX_NSMGR_POPCONTEXT (DISPID_MX_NSMGR + 5) +#define DISPID_MX_NSMGR_DECLAREPREFIX (DISPID_MX_NSMGR + 6) +#define DISPID_MX_NSMGR_GETDECLAREDPREFIXES (DISPID_MX_NSMGR + 7) +#define DISPID_MX_NSMGR_GETPREFIXES (DISPID_MX_NSMGR + 8) +#define DISPID_MX_NSMGR_GETURI (DISPID_MX_NSMGR + 9) +#define DISPID_MX_NSMGR_GETURIFROMNODE (DISPID_MX_NSMGR + 10) +#define DISPID_MX_NSMGR_LENGTH (DISPID_MX_NSMGR + 11) +#define DISPID_MX_NSMGR__TOP (DISPID_MX_NSMGR + 12) + +#define DISPID_MXXML_FILTER__BASE (DISPID_MX_NSMGR__TOP + 1) +#define DISPID_MXXML_FILTER (DISPID_MXXML_FILTER__BASE) +#define DISPID_MXXML_FILTER_CONTENTHANDLER (DISPID_MXXML_FILTER + 1) +#define DISPID_MXXML_FILTER_DTDHANDLER (DISPID_MXXML_FILTER + 2) +#define DISPID_MXXML_FILTER_ENTITYRESOLVER (DISPID_MXXML_FILTER + 3) +#define DISPID_MXXML_FILTER_ERRORHANDLER (DISPID_MXXML_FILTER + 4) +#define DISPID_MXXML_FILTER_GETFEATURE (DISPID_MXXML_FILTER + 5) +#define DISPID_MXXML_FILTER_GETPROPERTY (DISPID_MXXML_FILTER + 6) +#define DISPID_MXXML_FILTER_PUTFEATURE (DISPID_MXXML_FILTER + 7) +#define DISPID_MXXML_FILTER_PUTPROPERTY (DISPID_MXXML_FILTER + 8) +#define DISPID_MXXML_FILTER__TOP (DISPID_MXXML_FILTER + 9) + + +// Schema Object Model DISPIDs +#define DISPID_SOM (DISPID_MX_NSMGR__TOP + 1) +#define DISPID_SOM_VALIDATE (DISPID_SOM + 1) +#define DISPID_SOM_VALIDATEONLOAD (DISPID_SOM + 2) +#define DISPID_SOM_GETSCHEMA (DISPID_SOM + 3) +#define DISPID_SOM_GETDECLARATION (DISPID_SOM + 4) +#define DISPID_SOM_ITEMBYNAME (DISPID_SOM + 5) +#define DISPID_SOM_ITEMBYQNAME (DISPID_SOM + 6) +#define DISPID_SOM_ANYATTRIBUTE (DISPID_SOM + 7) +#define DISPID_SOM_ATTRIBUTEGROUPS (DISPID_SOM + 8) +#define DISPID_SOM_ATTRIBUTES (DISPID_SOM + 9) +#define DISPID_SOM_BASETYPES (DISPID_SOM + 10) +#define DISPID_SOM_CONTENTMODEL (DISPID_SOM + 11) +#define DISPID_SOM_CONTENTTYPE (DISPID_SOM + 12) +#define DISPID_SOM_DEFAULTVALUE (DISPID_SOM + 13) +#define DISPID_SOM_DERIVEDBY (DISPID_SOM + 14) +#define DISPID_SOM_DISALLOWED (DISPID_SOM + 15) +#define DISPID_SOM_ELEMENTS (DISPID_SOM + 16) +#define DISPID_SOM_ENUMERATION (DISPID_SOM + 17) +#define DISPID_SOM_FIELDS (DISPID_SOM + 18) +#define DISPID_SOM_FINAL (DISPID_SOM + 19) +#define DISPID_SOM_FIXEDVALUE (DISPID_SOM + 20) +#define DISPID_SOM_FRACTIONDIGITS (DISPID_SOM + 21) +#define DISPID_SOM_ID (DISPID_SOM + 22) +#define DISPID_SOM_IDCONSTRAINTS (DISPID_SOM + 23) +#define DISPID_SOM_ISABSTRACT (DISPID_SOM + 24) +#define DISPID_SOM_ISNILLABLE (DISPID_SOM + 25) +#define DISPID_SOM_ISREFERENCE (DISPID_SOM + 26) +#define DISPID_SOM_ISVALID (DISPID_SOM + 27) +#define DISPID_SOM_ITEMTYPE (DISPID_SOM + 28) +#define DISPID_SOM_LENGTH (DISPID_SOM + 29) +#define DISPID_SOM_MAXEXCLUSIVE (DISPID_SOM + 30) +#define DISPID_SOM_MAXINCLUSIVE (DISPID_SOM + 31) +#define DISPID_SOM_MAXLENGTH (DISPID_SOM + 32) +#define DISPID_SOM_MAXOCCURS (DISPID_SOM + 33) +#define DISPID_SOM_MINEXCLUSIVE (DISPID_SOM + 34) +#define DISPID_SOM_MININCLUSIVE (DISPID_SOM + 35) +#define DISPID_SOM_MINLENGTH (DISPID_SOM + 36) +#define DISPID_SOM_MINOCCURS (DISPID_SOM + 37) +#define DISPID_SOM_MODELGROUPS (DISPID_SOM + 38) +#define DISPID_SOM_NAME (DISPID_SOM + 39) +#define DISPID_SOM_NAMESPACES (DISPID_SOM + 40) +#define DISPID_SOM_NAMESPACEURI (DISPID_SOM + 41) +#define DISPID_SOM_NOTATIONS (DISPID_SOM + 42) +#define DISPID_SOM_PARTICLES (DISPID_SOM + 43) +#define DISPID_SOM_PATTERNS (DISPID_SOM + 44) +#define DISPID_SOM_PROCESSCONTENTS (DISPID_SOM + 45) +#define DISPID_SOM_PROHIBITED (DISPID_SOM + 46) +#define DISPID_SOM_PUBLICIDENTIFIER (DISPID_SOM + 47) +#define DISPID_SOM_REFERENCEDKEY (DISPID_SOM + 48) +#define DISPID_SOM_SCHEMA (DISPID_SOM + 49) +#define DISPID_SOM_SCHEMALOCATIONS (DISPID_SOM + 50) +#define DISPID_SOM_SCOPE (DISPID_SOM + 51) +#define DISPID_SOM_SELECTOR (DISPID_SOM + 52) +#define DISPID_SOM_SUBSTITUTIONGROUP (DISPID_SOM + 53) +#define DISPID_SOM_EXCLUSIONS (DISPID_SOM + 54) +#define DISPID_SOM_SYSTEMIDENTIFIER (DISPID_SOM + 55) +#define DISPID_SOM_TARGETNAMESPACE (DISPID_SOM + 56) +#define DISPID_SOM_TOTALDIGITS (DISPID_SOM + 57) +#define DISPID_SOM_TYPE (DISPID_SOM + 58) +#define DISPID_SOM_TYPES (DISPID_SOM + 59) +#define DISPID_SOM_UNHANDLEDATTRS (DISPID_SOM + 60) +#define DISPID_SOM_USE (DISPID_SOM + 61) +#define DISPID_SOM_VARIETY (DISPID_SOM + 62) +#define DISPID_SOM_VERSION (DISPID_SOM + 63) +#define DISPID_SOM_WHITESPACE (DISPID_SOM + 64) +#define DISPID_SOM_WRITEANNOTATION (DISPID_SOM + 65) +#define DISPID_SOM_TOP (DISPID_SOM + 66) + +// XML DigitalSignature DISPIDs +#define DISPID_XMLDSIG (0x00000001) +#define DISPID_XMLDSIG_CREATEKEYFROMCSP (DISPID_XMLDSIG + 0) +#define DISPID_XMLDSIG_CREATEKEYFROMHMACSECRET (DISPID_XMLDSIG + 1) +#define DISPID_XMLDSIG_CREATEKEYFROMNODE (DISPID_XMLDSIG + 2) +#define DISPID_XMLDSIG_CREATESAXPROXY (DISPID_XMLDSIG + 3) +#define DISPID_XMLDSIG_GETVERIFYINGCERTIFICATE (DISPID_XMLDSIG + 4) +#define DISPID_XMLDSIG_SETREFERENCEDATA (DISPID_XMLDSIG + 5) +#define DISPID_XMLDSIG_SIGN (DISPID_XMLDSIG + 6) +#define DISPID_XMLDSIG_SIGNATURE (DISPID_XMLDSIG + 7) +#define DISPID_XMLDSIG_STORE (DISPID_XMLDSIG + 8) +#define DISPID_XMLDSIG_VERIFY (DISPID_XMLDSIG + 9) + +//;begin_internal +#endif // __MSXMLDID_H__ +//;end_internal diff --git a/cli/test/include/gtest/tinystr.h b/cli/test/include/gtest/tinystr.h new file mode 100644 index 0000000..aedd2f9 --- /dev/null +++ b/cli/test/include/gtest/tinystr.h @@ -0,0 +1,294 @@ +/* +www.sourceforge.net/projects/tinyxml +Original file by Yves Berquin. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +/* + * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. + * + * - completely rewritten. compact, clean, and fast implementation. + * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) + * - fixed reserve() to work as per specification. + * - fixed buggy compares operator==(), operator<(), and operator>() + * - fixed operator+=() to take a const ref argument, following spec. + * - added "copy" constructor with length, and most compare operators. + * - added swap(), clear(), size(), capacity(), operator+(). + */ + +#ifndef TIXML_USE_STL + +#ifndef TIXML_STRING_INCLUDED +#define TIXML_STRING_INCLUDED + +#include +#include + +/* + TiXmlString is an emulation of a subset of the std::string template. + Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. + Only the member functions relevant to the TinyXML project have been implemented. + The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase + a string and there's no more room, we allocate a buffer twice as big as we need. +*/ +class TiXmlString +{ + public : + // The size type used + typedef unsigned int size_type; + + // Error value for find primitive + static const size_type npos; // = -1; + + + // TiXmlString empty constructor + TiXmlString () : rep_(&nullrep_) + { + } + + // TiXmlString copy constructor + TiXmlString (const TiXmlString & copy) + { + init(copy.length()); + memcpy(start(), copy.data(), length()); + } + + // TiXmlString constructor, based on a string + TiXmlString (const char * copy) + { + init( static_cast( strlen(copy) )); + memcpy(start(), copy, length()); + } + + // TiXmlString constructor, based on a string + TiXmlString (const char * str, size_type len) + { + init(len); + memcpy(start(), str, len); + } + + // TiXmlString destructor + ~TiXmlString () + { + quit(); + } + + // = operator + TiXmlString& operator = (const char * copy) + { + return assign( copy, (size_type)strlen(copy)); + } + + // = operator + TiXmlString& operator = (const TiXmlString & copy) + { + return assign(copy.start(), copy.length()); + } + + + // += operator. Maps to append + TiXmlString& operator += (const char * suffix) + { + return append(suffix, static_cast( strlen(suffix) )); + } + + // += operator. Maps to append + TiXmlString& operator += (char single) + { + return append(&single, 1); + } + + // += operator. Maps to append + TiXmlString& operator += (const TiXmlString & suffix) + { + return append(suffix.data(), suffix.length()); + } + + + // Convert a TiXmlString into a null-terminated char * + const char * c_str () const { return rep_->str; } + + // Convert a TiXmlString into a char * (need not be null terminated). + const char * data () const { return rep_->str; } + + // Return the length of a TiXmlString + size_type length () const { return rep_->size; } + + // Alias for length() + size_type size () const { return rep_->size; } + + // Checks if a TiXmlString is empty + bool empty () const { return rep_->size == 0; } + + // Return capacity of string + size_type capacity () const { return rep_->capacity; } + + + // single char extraction + const char& at (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // [] operator + char& operator [] (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // find a char in a string. Return TiXmlString::npos if not found + size_type find (char lookup) const + { + return find(lookup, 0); + } + + // find a char in a string from an offset. Return TiXmlString::npos if not found + size_type find (char tofind, size_type offset) const + { + if (offset >= length()) return npos; + + for (const char* p = c_str() + offset; *p != '\0'; ++p) + { + if (*p == tofind) return static_cast< size_type >( p - c_str() ); + } + return npos; + } + + void clear () + { + //Lee: + //The original was just too strange, though correct: + // TiXmlString().swap(*this); + //Instead use the quit & re-init: + quit(); + init(0,0); + } + + /* Function to reserve a big amount of data when we know we'll need it. Be aware that this + function DOES NOT clear the content of the TiXmlString if any exists. + */ + void reserve (size_type cap); + + TiXmlString& assign (const char* str, size_type len); + + TiXmlString& append (const char* str, size_type len); + + void swap (TiXmlString& other) + { + Rep* r = rep_; + rep_ = other.rep_; + other.rep_ = r; + } + + private: + + void init(size_type sz) { init(sz, sz); } + void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } + char* start() const { return rep_->str; } + char* finish() const { return rep_->str + rep_->size; } + + struct Rep + { + size_type size, capacity; + char str[1]; + }; + + void init(size_type sz, size_type cap) + { + if (cap) + { + rep_ = static_cast(operator new(sizeof(Rep) + cap)); + rep_->str[ rep_->size = sz ] = '\0'; + rep_->capacity = cap; + } + else + { + rep_ = &nullrep_; + } + } + + void quit() + { + if (rep_ != &nullrep_) + { + operator delete(rep_); + } + } + + Rep * rep_; + static Rep nullrep_; + +} ; + + +inline bool operator == (const TiXmlString & a, const TiXmlString & b) +{ + return ( a.length() == b.length() ) // optimization on some platforms + && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare +} +inline bool operator < (const TiXmlString & a, const TiXmlString & b) +{ + return strcmp(a.c_str(), b.c_str()) < 0; +} + +inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } +inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } +inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } +inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } + +inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } +inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } +inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } +inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); +TiXmlString operator + (const TiXmlString & a, const char* b); +TiXmlString operator + (const char* a, const TiXmlString & b); + + +/* + TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. + Only the operators that we need for TinyXML have been developped. +*/ +class TiXmlOutStream : public TiXmlString +{ +public : + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const TiXmlString & in) + { + *this += in; + return *this; + } + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const char * in) + { + *this += in; + return *this; + } + +} ; + +#endif // TIXML_STRING_INCLUDED +#endif // TIXML_USE_STL diff --git a/cli/test/include/gtest/tinyxml.h b/cli/test/include/gtest/tinyxml.h new file mode 100644 index 0000000..18cf94f --- /dev/null +++ b/cli/test/include/gtest/tinyxml.h @@ -0,0 +1,1511 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TINYXML_INCLUDED +#define TINYXML_INCLUDED + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4530 ) +#pragma warning( disable : 4786 ) +#endif + +#include +#include +#include +#include +#include + +// Help out windows: +#if defined( _DEBUG ) && !defined( DEBUG ) +#define DEBUG +#endif + +#if defined( DEBUG ) && defined( _MSC_VER ) +#include +#define TIXML_LOG OutputDebugString +#else +#define TIXML_LOG printf +#endif + +#ifdef TIXML_USE_STL + #include + #include + #define TIXML_STRING std::string + #define TIXML_ISTREAM std::istream + #define TIXML_OSTREAM std::ostream +#else + #include "tinystr.h" + #define TIXML_STRING TiXmlString + #define TIXML_OSTREAM TiXmlOutStream +#endif + +// Deprecated library function hell. Compilers want to use the +// new safe versions. This probably doesn't fully address the problem, +// but it gets closer. There are too many compilers for me to fully +// test. If you get compilation troubles, undefine TIXML_SAFE + +#define TIXML_SAFE // TinyXml isn't fully buffer overrun protected, safe code. This is work in progress. +#ifdef TIXML_SAFE + #if defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + //#pragma message( "Using _sn* functions." ) + #define TIXML_SNPRINTF _snprintf + #define TIXML_SNSCANF _snscanf + #elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + //#warning( "Using sn* functions." ) + #define TIXML_SNPRINTF snprintf + #define TIXML_SNSCANF snscanf + #endif +#endif + +class TiXmlDocument; +class TiXmlElement; +class TiXmlComment; +class TiXmlUnknown; +class TiXmlAttribute; +class TiXmlText; +class TiXmlDeclaration; +class TiXmlParsingData; + +const int TIXML_MAJOR_VERSION = 2; +const int TIXML_MINOR_VERSION = 4; +const int TIXML_PATCH_VERSION = 0; + +/* Internal structure for tracking location of items + in the XML file. +*/ +struct TiXmlCursor +{ + TiXmlCursor() { Clear(); } + void Clear() { row = col = -1; } + + int row; // 0 based. + int col; // 0 based. +}; + + +// Only used by Attribute::Query functions +enum +{ + TIXML_SUCCESS, + TIXML_NO_ATTRIBUTE, + TIXML_WRONG_TYPE +}; + + +// Used by the parsing routines. +enum TiXmlEncoding +{ + TIXML_ENCODING_UNKNOWN, + TIXML_ENCODING_UTF8, + TIXML_ENCODING_LEGACY +}; + +const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; + +/** TiXmlBase is a base class for every class in TinyXml. + It does little except to establish that TinyXml classes + can be printed and provide some utility functions. + + In XML, the document and elements can contain + other elements and other types of nodes. + + @verbatim + A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + A Decleration contains: Attributes (not on tree) + @endverbatim +*/ +class TiXmlBase +{ + friend class TiXmlNode; + friend class TiXmlElement; + friend class TiXmlDocument; + +public: + TiXmlBase() : userData(0) {} + virtual ~TiXmlBase() {} + + /** All TinyXml classes can print themselves to a filestream. + This is a formatted print, and will insert tabs and newlines. + + (For an unformatted stream, use the << operator.) + */ + virtual void Print( FILE* cfile, int depth ) const = 0; + + /** The world does not agree on whether white space should be kept or + not. In order to make everyone happy, these global, static functions + are provided to set whether or not TinyXml will condense all white space + into a single space or not. The default is to condense. Note changing this + values is not thread safe. + */ + static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } + + /// Return the current white space setting. + static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } + + /** Return the position, in the original source file, of this node or attribute. + The row and column are 1-based. (That is the first row and first column is + 1,1). If the returns values are 0 or less, then the parser does not have + a row and column value. + + Generally, the row and column value will be set when the TiXmlDocument::Load(), + TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set + when the DOM was created from operator>>. + + The values reflect the initial load. Once the DOM is modified programmatically + (by adding or changing nodes and attributes) the new values will NOT update to + reflect changes in the document. + + There is a minor performance cost to computing the row and column. Computation + can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. + + @sa TiXmlDocument::SetTabSize() + */ + int Row() const { return location.row + 1; } + int Column() const { return location.col + 1; } ///< See Row() + + void SetUserData( void* user ) { userData = user; } + void* GetUserData() { return userData; } + + // Table that returs, for a given lead byte, the total number of bytes + // in the UTF-8 sequence. + static const int utf8ByteTable[256]; + + virtual const char* Parse( const char* p, + TiXmlParsingData* data, + TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; + + enum + { + TIXML_NO_ERROR = 0, + TIXML_ERROR, + TIXML_ERROR_OPENING_FILE, + TIXML_ERROR_OUT_OF_MEMORY, + TIXML_ERROR_PARSING_ELEMENT, + TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, + TIXML_ERROR_READING_ELEMENT_VALUE, + TIXML_ERROR_READING_ATTRIBUTES, + TIXML_ERROR_PARSING_EMPTY, + TIXML_ERROR_READING_END_TAG, + TIXML_ERROR_PARSING_UNKNOWN, + TIXML_ERROR_PARSING_COMMENT, + TIXML_ERROR_PARSING_DECLARATION, + TIXML_ERROR_DOCUMENT_EMPTY, + TIXML_ERROR_EMBEDDED_NULL, + TIXML_ERROR_PARSING_CDATA, + + TIXML_ERROR_STRING_COUNT + }; + +protected: + + // See STL_STRING_BUG + // Utility class to overcome a bug. + class StringToBuffer + { + public: + StringToBuffer( const TIXML_STRING& str ); + ~StringToBuffer(); + char* buffer; + }; + + static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); + inline static bool IsWhiteSpace( char c ) + { + return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); + } + + virtual void StreamOut (TIXML_OSTREAM *) const = 0; + + #ifdef TIXML_USE_STL + static bool StreamWhiteSpace( TIXML_ISTREAM * in, TIXML_STRING * tag ); + static bool StreamTo( TIXML_ISTREAM * in, int character, TIXML_STRING * tag ); + #endif + + /* Reads an XML name into the string provided. Returns + a pointer just past the last character of the name, + or 0 if the function has an error. + */ + static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); + + /* Reads text. Returns a pointer past the given end tag. + Wickedly complex options, but it keeps the (sensitive) code in one place. + */ + static const char* ReadText( const char* in, // where to start + TIXML_STRING* text, // the string read + bool ignoreWhiteSpace, // whether to keep the white space + const char* endTag, // what ends this text + bool ignoreCase, // whether to ignore case in the end tag + TiXmlEncoding encoding ); // the current encoding + + // If an entity has been found, transform it into a character. + static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); + + // Get a character, while interpreting entities. + // The length can be from 0 to 4 bytes. + inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) + { + assert( p ); + if ( encoding == TIXML_ENCODING_UTF8 ) + { + *length = utf8ByteTable[ *((unsigned char*)p) ]; + assert( *length >= 0 && *length < 5 ); + } + else + { + *length = 1; + } + + if ( *length == 1 ) + { + if ( *p == '&' ) + return GetEntity( p, _value, length, encoding ); + *_value = *p; + return p+1; + } + else if ( *length ) + { + //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), + // and the null terminator isn't needed + for( int i=0; p[i] && i<*length; ++i ) { + _value[i] = p[i]; + } + return p + (*length); + } + else + { + // Not valid text. + return 0; + } + } + + // Puts a string to a stream, expanding entities as it goes. + // Note this should not contian the '<', '>', etc, or they will be transformed into entities! + static void PutString( const TIXML_STRING& str, TIXML_OSTREAM* out ); + + static void PutString( const TIXML_STRING& str, TIXML_STRING* out ); + + // Return true if the next characters in the stream are any of the endTag sequences. + // Ignore case only works for english, and should only be relied on when comparing + // to English words: StringEqual( p, "version", true ) is fine. + static bool StringEqual( const char* p, + const char* endTag, + bool ignoreCase, + TiXmlEncoding encoding ); + + static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; + + TiXmlCursor location; + + /// Field containing a generic user pointer + void* userData; + + // None of these methods are reliable for any language except English. + // Good for approximation, not great for accuracy. + static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); + static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); + inline static int ToLower( int v, TiXmlEncoding encoding ) + { + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( v < 128 ) return tolower( v ); + return v; + } + else + { + return tolower( v ); + } + } + static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); + +private: + TiXmlBase( const TiXmlBase& ); // not implemented. + void operator=( const TiXmlBase& base ); // not allowed. + + struct Entity + { + const char* str; + unsigned int strLength; + char chr; + }; + enum + { + NUM_ENTITY = 5, + MAX_ENTITY_LENGTH = 6 + + }; + static Entity entity[ NUM_ENTITY ]; + static bool condenseWhiteSpace; +}; + + +/** The parent class for everything in the Document Object Model. + (Except for attributes). + Nodes have siblings, a parent, and children. A node can be + in a document, or stand on its own. The type of a TiXmlNode + can be queried, and it can be cast to its more defined type. +*/ +class TiXmlNode : public TiXmlBase +{ + friend class TiXmlDocument; + friend class TiXmlElement; + +public: + #ifdef TIXML_USE_STL + + /** An input stream operator, for every class. Tolerant of newlines and + formatting, but doesn't expect them. + */ + friend std::istream& operator >> (std::istream& in, TiXmlNode& base); + + /** An output stream operator, for every class. Note that this outputs + without any newlines or formatting, as opposed to Print(), which + includes tabs and new lines. + + The operator<< and operator>> are not completely symmetric. Writing + a node to a stream is very well defined. You'll get a nice stream + of output, without any extra whitespace or newlines. + + But reading is not as well defined. (As it always is.) If you create + a TiXmlElement (for example) and read that from an input stream, + the text needs to define an element or junk will result. This is + true of all input streams, but it's worth keeping in mind. + + A TiXmlDocument will read nodes until it reads a root element, and + all the children of that root element. + */ + friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); + + /// Appends the XML node or attribute to a std::string. + friend std::string& operator<< (std::string& out, const TiXmlNode& base ); + + #else + // Used internally, not part of the public API. + friend TIXML_OSTREAM& operator<< (TIXML_OSTREAM& out, const TiXmlNode& base); + #endif + + /** The types of XML nodes supported by TinyXml. (All the + unsupported types are picked up by UNKNOWN.) + */ + enum NodeType + { + DOCUMENT, + ELEMENT, + COMMENT, + UNKNOWN, + TEXT, + DECLARATION, + TYPECOUNT + }; + + virtual ~TiXmlNode(); + + /** The meaning of 'value' changes for the specific type of + TiXmlNode. + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + + The subclasses will wrap this function. + */ + const char *Value() const { return value.c_str (); } + + #ifdef TIXML_USE_STL + /** Return Value() as a std::string. If you only use STL, + this is more efficient than calling Value(). + Only available in STL mode. + */ + const std::string& ValueStr() const { return value; } + #endif + + /** Changes the value of the node. Defined as: + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + */ + void SetValue(const char * _value) { value = _value;} + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetValue( const std::string& _value ) + { + StringToBuffer buf( _value ); + SetValue( buf.buffer ? buf.buffer : "" ); + } + #endif + + /// Delete all the children of this node. Does not affect 'this'. + void Clear(); + + /// One step up the DOM. + TiXmlNode* Parent() { return parent; } + const TiXmlNode* Parent() const { return parent; } + + const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. + TiXmlNode* FirstChild() { return firstChild; } + const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. + TiXmlNode* FirstChild( const char * value ); ///< The first child of this node with the matching 'value'. Will be null if none found. + + const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. + TiXmlNode* LastChild() { return lastChild; } + const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. + TiXmlNode* LastChild( const char * value ); + + #ifdef TIXML_USE_STL + const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. + #endif + + /** An alternate way to walk the children of a node. + One way to iterate over nodes is: + @verbatim + for( child = parent->FirstChild(); child; child = child->NextSibling() ) + @endverbatim + + IterateChildren does the same thing with the syntax: + @verbatim + child = 0; + while( child = parent->IterateChildren( child ) ) + @endverbatim + + IterateChildren takes the previous child as input and finds + the next one. If the previous child is null, it returns the + first. IterateChildren will return null when done. + */ + const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( TiXmlNode* previous ); + + /// This flavor of IterateChildren searches for children with a particular 'value' + const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const char * value, TiXmlNode* previous ); + + #ifdef TIXML_USE_STL + const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + TiXmlNode* IterateChildren( const std::string& _value, TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + #endif + + /** Add a new node related to this. Adds a child past the LastChild. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); + + + /** Add a new node related to this. Adds a child past the LastChild. + + NOTE: the node to be added is passed by pointer, and will be + henceforth owned (and deleted) by tinyXml. This method is efficient + and avoids an extra copy, but should be used with care as it + uses a different memory model than the other insert functions. + + @sa InsertEndChild + */ + TiXmlNode* LinkEndChild( TiXmlNode* addThis ); + + /** Add a new node related to this. Adds a child before the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); + + /** Add a new node related to this. Adds a child after the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); + + /** Replace a child of this node. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); + + /// Delete a child of this node. + bool RemoveChild( TiXmlNode* removeThis ); + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling() const { return prev; } + TiXmlNode* PreviousSibling() { return prev; } + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling( const char * ) const; + TiXmlNode* PreviousSibling( const char * ); + + #ifdef TIXML_USE_STL + const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Navigate to a sibling node. + const TiXmlNode* NextSibling() const { return next; } + TiXmlNode* NextSibling() { return next; } + + /// Navigate to a sibling node with the given 'value'. + const TiXmlNode* NextSibling( const char * ) const; + TiXmlNode* NextSibling( const char * ); + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement() const; + TiXmlElement* NextSiblingElement(); + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement( const char * ) const; + TiXmlElement* NextSiblingElement( const char * ); + + #ifdef TIXML_USE_STL + const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement() const; + TiXmlElement* FirstChildElement(); + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement( const char * value ) const; + TiXmlElement* FirstChildElement( const char * value ); + + #ifdef TIXML_USE_STL + const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /** Query the type (as an enumerated value, above) of this node. + The possible types are: DOCUMENT, ELEMENT, COMMENT, + UNKNOWN, TEXT, and DECLARATION. + */ + virtual int Type() const { return type; } + + /** Return a pointer to the Document this node lives in. + Returns null if not in a document. + */ + const TiXmlDocument* GetDocument() const; + TiXmlDocument* GetDocument(); + + /// Returns true if this node has no children. + bool NoChildren() const { return !firstChild; } + + const TiXmlDocument* ToDocument() const { return ( this && type == DOCUMENT ) ? (const TiXmlDocument*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + const TiXmlElement* ToElement() const { return ( this && type == ELEMENT ) ? (const TiXmlElement*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + const TiXmlComment* ToComment() const { return ( this && type == COMMENT ) ? (const TiXmlComment*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + const TiXmlUnknown* ToUnknown() const { return ( this && type == UNKNOWN ) ? (const TiXmlUnknown*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + const TiXmlText* ToText() const { return ( this && type == TEXT ) ? (const TiXmlText*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + const TiXmlDeclaration* ToDeclaration() const { return ( this && type == DECLARATION ) ? (const TiXmlDeclaration*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + + TiXmlDocument* ToDocument() { return ( this && type == DOCUMENT ) ? (TiXmlDocument*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + TiXmlElement* ToElement() { return ( this && type == ELEMENT ) ? (TiXmlElement*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + TiXmlComment* ToComment() { return ( this && type == COMMENT ) ? (TiXmlComment*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + TiXmlUnknown* ToUnknown() { return ( this && type == UNKNOWN ) ? (TiXmlUnknown*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + TiXmlText* ToText() { return ( this && type == TEXT ) ? (TiXmlText*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + TiXmlDeclaration* ToDeclaration() { return ( this && type == DECLARATION ) ? (TiXmlDeclaration*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Create an exact duplicate of this node and return it. The memory must be deleted + by the caller. + */ + virtual TiXmlNode* Clone() const = 0; + +protected: + TiXmlNode( NodeType _type ); + + // Copy to the allocated object. Shared functionality between Clone, Copy constructor, + // and the assignment operator. + void CopyTo( TiXmlNode* target ) const; + + #ifdef TIXML_USE_STL + // The real work of the input operator. + virtual void StreamIn( TIXML_ISTREAM* in, TIXML_STRING* tag ) = 0; + #endif + + // Figure out what is at *p, and parse it. Returns null if it is not an xml node. + TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); + + TiXmlNode* parent; + NodeType type; + + TiXmlNode* firstChild; + TiXmlNode* lastChild; + + TIXML_STRING value; + + TiXmlNode* prev; + TiXmlNode* next; + +private: + TiXmlNode( const TiXmlNode& ); // not implemented. + void operator=( const TiXmlNode& base ); // not allowed. +}; + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not TiXmlNodes, since they are not + part of the tinyXML document object model. There are other + suggested ways to look at this problem. +*/ +class TiXmlAttribute : public TiXmlBase +{ + friend class TiXmlAttributeSet; + +public: + /// Construct an empty attribute. + TiXmlAttribute() : TiXmlBase() + { + document = 0; + prev = next = 0; + } + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlAttribute( const std::string& _name, const std::string& _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + #endif + + /// Construct an attribute with a name and value. + TiXmlAttribute( const char * _name, const char * _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + + const char* Name() const { return name.c_str (); } ///< Return the name of this attribute. + const char* Value() const { return value.c_str (); } ///< Return the value of this attribute. + int IntValue() const; ///< Return the value of this attribute, converted to an integer. + double DoubleValue() const; ///< Return the value of this attribute, converted to a double. + + /** QueryIntValue examines the value string. It is an alternative to the + IntValue() method with richer error checking. + If the value is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. + + A specialized but useful call. Note that for success it returns 0, + which is the opposite of almost all other TinyXml calls. + */ + int QueryIntValue( int* _value ) const; + /// QueryDoubleValue examines the value string. See QueryIntValue(). + int QueryDoubleValue( double* _value ) const; + + void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. + void SetValue( const char* _value ) { value = _value; } ///< Set the value. + + void SetIntValue( int _value ); ///< Set the value from an integer. + void SetDoubleValue( double _value ); ///< Set the value from a double. + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetName( const std::string& _name ) + { + StringToBuffer buf( _name ); + SetName ( buf.buffer ? buf.buffer : "error" ); + } + /// STL std::string form. + void SetValue( const std::string& _value ) + { + StringToBuffer buf( _value ); + SetValue( buf.buffer ? buf.buffer : "error" ); + } + #endif + + /// Get the next sibling attribute in the DOM. Returns null at end. + const TiXmlAttribute* Next() const; + TiXmlAttribute* Next(); + /// Get the previous sibling attribute in the DOM. Returns null at beginning. + const TiXmlAttribute* Previous() const; + TiXmlAttribute* Previous(); + + bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } + bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } + bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } + + /* Attribute parsing starts: first letter of the name + returns: the next char after the value end quote + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + // Prints this Attribute to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + virtual void StreamOut( TIXML_OSTREAM * out ) const; + // [internal use] + // Set the document pointer so the attribute can report errors. + void SetDocument( TiXmlDocument* doc ) { document = doc; } + +private: + TiXmlAttribute( const TiXmlAttribute& ); // not implemented. + void operator=( const TiXmlAttribute& base ); // not allowed. + + TiXmlDocument* document; // A pointer back to a document, for error reporting. + TIXML_STRING name; + TIXML_STRING value; + TiXmlAttribute* prev; + TiXmlAttribute* next; +}; + + +/* A class used to manage a group of attributes. + It is only used internally, both by the ELEMENT and the DECLARATION. + + The set can be changed transparent to the Element and Declaration + classes that use it, but NOT transparent to the Attribute + which has to implement a next() and previous() method. Which makes + it a bit problematic and prevents the use of STL. + + This version is implemented with circular lists because: + - I like circular lists + - it demonstrates some independence from the (typical) doubly linked list. +*/ +class TiXmlAttributeSet +{ +public: + TiXmlAttributeSet(); + ~TiXmlAttributeSet(); + + void Add( TiXmlAttribute* attribute ); + void Remove( TiXmlAttribute* attribute ); + + const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + + const TiXmlAttribute* Find( const char * name ) const; + TiXmlAttribute* Find( const char * name ); + +private: + //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), + //*ME: this class must be also use a hidden/disabled copy-constructor !!! + TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed + void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) + + TiXmlAttribute sentinel; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class TiXmlElement : public TiXmlNode +{ +public: + /// Construct an element. + TiXmlElement (const char * in_value); + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlElement( const std::string& _value ); + #endif + + TiXmlElement( const TiXmlElement& ); + + void operator=( const TiXmlElement& base ); + + virtual ~TiXmlElement(); + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + */ + const char* Attribute( const char* name ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an integer, + the integer value will be put in the return 'i', if 'i' + is non-null. + */ + const char* Attribute( const char* name, int* i ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an double, + the double value will be put in the return 'd', if 'd' + is non-null. + */ + const char* Attribute( const char* name, double* d ) const; + + /** QueryIntAttribute examines the attribute - it is an alternative to the + Attribute() method with richer error checking. + If the attribute is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. If the attribute + does not exist, then TIXML_NO_ATTRIBUTE is returned. + */ + int QueryIntAttribute( const char* name, int* _value ) const; + /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). + int QueryDoubleAttribute( const char* name, double* _value ) const; + /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). + int QueryFloatAttribute( const char* name, float* _value ) const { + double d; + int result = QueryDoubleAttribute( name, &d ); + if ( result == TIXML_SUCCESS ) { + *_value = (float)d; + } + return result; + } + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char* name, const char * _value ); + + #ifdef TIXML_USE_STL + const char* Attribute( const std::string& name ) const { return Attribute( name.c_str() ); } + const char* Attribute( const std::string& name, int* i ) const { return Attribute( name.c_str(), i ); } + const char* Attribute( const std::string& name, double* d ) const { return Attribute( name.c_str(), d ); } + int QueryIntAttribute( const std::string& name, int* _value ) const { return QueryIntAttribute( name.c_str(), _value ); } + int QueryDoubleAttribute( const std::string& name, double* _value ) const { return QueryDoubleAttribute( name.c_str(), _value ); } + + /// STL std::string form. + void SetAttribute( const std::string& name, const std::string& _value ) + { + StringToBuffer n( name ); + StringToBuffer v( _value ); + if ( n.buffer && v.buffer ) + SetAttribute (n.buffer, v.buffer ); + } + ///< STL std::string form. + void SetAttribute( const std::string& name, int _value ) + { + StringToBuffer n( name ); + if ( n.buffer ) + SetAttribute (n.buffer, _value); + } + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char * name, int value ); + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetDoubleAttribute( const char * name, double value ); + + /** Deletes an attribute with the given name. + */ + void RemoveAttribute( const char * name ); + #ifdef TIXML_USE_STL + void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. + #endif + + const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. + TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } + const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. + TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the TiXmlText child + and accessing it directly. + + If the first child of 'this' is a TiXmlText, the GetText() + returs the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + This is text + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + This is text + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + This is text + @endverbatim + GetText() will return "This is ". + + WARNING: GetText() accesses a child node - don't become confused with the + similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are + safe type casts on the referenced node. + */ + const char* GetText() const; + + /// Creates a new Element and returns it - the returned element is a copy. + virtual TiXmlNode* Clone() const; + // Print the Element to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: next char past '<' + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + +protected: + + void CopyTo( TiXmlElement* target ) const; + void ClearThis(); // like clear, but initializes 'this' object as well + + // Used to be public [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + virtual void StreamOut( TIXML_OSTREAM * out ) const; + + /* [internal use] + Reads the "value" of the element -- another element, or text. + This should terminate with the current end tag. + */ + const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + +private: + + TiXmlAttributeSet attributeSet; +}; + + +/** An XML comment. +*/ +class TiXmlComment : public TiXmlNode +{ +public: + /// Constructs an empty comment. + TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} + TiXmlComment( const TiXmlComment& ); + void operator=( const TiXmlComment& base ); + + virtual ~TiXmlComment() {} + + /// Returns a copy of this Comment. + virtual TiXmlNode* Clone() const; + /// Write this Comment to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: at the ! of the !-- + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + +protected: + void CopyTo( TiXmlComment* target ) const; + + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + virtual void StreamOut( TIXML_OSTREAM * out ) const; + +private: + +}; + + +/** XML text. A text node can have 2 ways to output the next. "normal" output + and CDATA. It will default to the mode it was parsed from the XML file and + you generally want to leave it alone, but you can change the output mode with + SetCDATA() and query it with CDATA(). +*/ +class TiXmlText : public TiXmlNode +{ + friend class TiXmlElement; +public: + /** Constructor for text element. By default, it is treated as + normal, encoded text. If you want it be output as a CDATA text + element, set the parameter _cdata to 'true' + */ + TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) + { + SetValue( initValue ); + cdata = false; + } + virtual ~TiXmlText() {} + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) + { + SetValue( initValue ); + cdata = false; + } + #endif + + TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } + void operator=( const TiXmlText& base ) { base.CopyTo( this ); } + + /// Write this text object to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /// Queries whether this represents text using a CDATA section. + bool CDATA() { return cdata; } + /// Turns on or off a CDATA representation of text. + void SetCDATA( bool _cdata ) { cdata = _cdata; } + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + +protected : + /// [internal use] Creates a new Element and returns it. + virtual TiXmlNode* Clone() const; + void CopyTo( TiXmlText* target ) const; + + virtual void StreamOut ( TIXML_OSTREAM * out ) const; + bool Blank() const; // returns true if all white space and new lines + // [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + +private: + bool cdata; // true if this should be input and output as a CDATA style text element +}; + + +/** In correct XML the declaration is the first entry in the file. + @verbatim + + @endverbatim + + TinyXml will happily read or write files without a declaration, + however. There are 3 possible attributes to the declaration: + version, encoding, and standalone. + + Note: In this version of the code, the attributes are + handled as special cases, not generic attributes, simply + because there can only be at most 3 and they are always the same. +*/ +class TiXmlDeclaration : public TiXmlNode +{ +public: + /// Construct an empty declaration. + TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} + +#ifdef TIXML_USE_STL + /// Constructor. + TiXmlDeclaration( const std::string& _version, + const std::string& _encoding, + const std::string& _standalone ); +#endif + + /// Construct. + TiXmlDeclaration( const char* _version, + const char* _encoding, + const char* _standalone ); + + TiXmlDeclaration( const TiXmlDeclaration& copy ); + void operator=( const TiXmlDeclaration& copy ); + + virtual ~TiXmlDeclaration() {} + + /// Version. Will return an empty string if none was found. + const char *Version() const { return version.c_str (); } + /// Encoding. Will return an empty string if none was found. + const char *Encoding() const { return encoding.c_str (); } + /// Is this a standalone document? + const char *Standalone() const { return standalone.c_str (); } + + /// Creates a copy of this Declaration and returns it. + virtual TiXmlNode* Clone() const; + /// Print this declaration to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + +protected: + void CopyTo( TiXmlDeclaration* target ) const; + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + virtual void StreamOut ( TIXML_OSTREAM * out) const; + +private: + + TIXML_STRING version; + TIXML_STRING encoding; + TIXML_STRING standalone; +}; + + +/** Any tag that tinyXml doesn't recognize is saved as an + unknown. It is a tag of text, but should not be modified. + It will be written back to the XML, unchanged, when the file + is saved. + + DTD tags get thrown into TiXmlUnknowns. +*/ +class TiXmlUnknown : public TiXmlNode +{ +public: + TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} + virtual ~TiXmlUnknown() {} + + TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } + void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } + + /// Creates a copy of this Unknown and returns it. + virtual TiXmlNode* Clone() const; + /// Print this Unknown to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + +protected: + void CopyTo( TiXmlUnknown* target ) const; + + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + virtual void StreamOut ( TIXML_OSTREAM * out ) const; + +private: + +}; + + +/** Always the top level node. A document binds together all the + XML pieces. It can be saved, loaded, and printed to the screen. + The 'value' of a document node is the xml file name. +*/ +class TiXmlDocument : public TiXmlNode +{ +public: + /// Create an empty document, that has no name. + TiXmlDocument(); + /// Create a document with a name. The name of the document is also the filename of the xml. + TiXmlDocument( const char * documentName ); + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlDocument( const std::string& documentName ); + #endif + + TiXmlDocument( const TiXmlDocument& copy ); + void operator=( const TiXmlDocument& copy ); + + virtual ~TiXmlDocument() {} + + /** Load a file using the current document value. + Returns true if successful. Will delete any existing + document data before loading. + */ + bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the current document value. Returns true if successful. + bool SaveFile() const; + /// Load a file using the given filename. Returns true if successful. + bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the given filename. Returns true if successful. + bool SaveFile( const char * filename ) const; + + #ifdef TIXML_USE_STL + bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. + { + StringToBuffer f( filename ); + return ( f.buffer && LoadFile( f.buffer, encoding )); + } + bool SaveFile( const std::string& filename ) const ///< STL std::string version. + { + StringToBuffer f( filename ); + return ( f.buffer && SaveFile( f.buffer )); + } + #endif + + /** Parse the given null terminated block of xml data. Passing in an encoding to this + method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml + to use that encoding, regardless of what TinyXml might otherwise try to detect. + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + + /** Get the root element -- the only top level element -- of the document. + In well formed XML, there should only be one. TinyXml is tolerant of + multiple elements at the document level. + */ + const TiXmlElement* RootElement() const { return FirstChildElement(); } + TiXmlElement* RootElement() { return FirstChildElement(); } + + /** If an error occurs, Error will be set to true. Also, + - The ErrorId() will contain the integer identifier of the error (not generally useful) + - The ErrorDesc() method will return the name of the error. (very useful) + - The ErrorRow() and ErrorCol() will return the location of the error (if known) + */ + bool Error() const { return error; } + + /// Contains a textual (english) description of the error if one occurs. + const char * ErrorDesc() const { return errorDesc.c_str (); } + + /** Generally, you probably want the error string ( ErrorDesc() ). But if you + prefer the ErrorId, this function will fetch it. + */ + int ErrorId() const { return errorId; } + + /** Returns the location (if known) of the error. The first column is column 1, + and the first row is row 1. A value of 0 means the row and column wasn't applicable + (memory errors, for example, have no row/column) or the parser lost the error. (An + error in the error reporting, in that case.) + + @sa SetTabSize, Row, Column + */ + int ErrorRow() { return errorLocation.row+1; } + int ErrorCol() { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() + + /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) + to report the correct values for row and column. It does not change the output + or input in any way. + + By calling this method, with a tab size + greater than 0, the row and column of each node and attribute is stored + when the file is loaded. Very useful for tracking the DOM back in to + the source file. + + The tab size is required for calculating the location of nodes. If not + set, the default of 4 is used. The tabsize is set per document. Setting + the tabsize to 0 disables row/column tracking. + + Note that row and column tracking is not supported when using operator>>. + + The tab size needs to be enabled before the parse or load. Correct usage: + @verbatim + TiXmlDocument doc; + doc.SetTabSize( 8 ); + doc.Load( "myfile.xml" ); + @endverbatim + + @sa Row, Column + */ + void SetTabSize( int _tabsize ) { tabsize = _tabsize; } + + int TabSize() const { return tabsize; } + + /** If you have handled the error, it can be reset with this call. The error + state is automatically cleared if you Parse a new XML block. + */ + void ClearError() { error = false; + errorId = 0; + errorDesc = ""; + errorLocation.row = errorLocation.col = 0; + //errorLocation.last = 0; + } + + /** Dump the document to standard out. */ + void Print() const { Print( stdout, 0 ); } + + /// Print this Document to a FILE stream. + virtual void Print( FILE* cfile, int depth = 0 ) const; + // [internal use] + void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + +protected : + virtual void StreamOut ( TIXML_OSTREAM * out) const; + // [internal use] + virtual TiXmlNode* Clone() const; + #ifdef TIXML_USE_STL + virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); + #endif + +private: + void CopyTo( TiXmlDocument* target ) const; + + bool error; + int errorId; + TIXML_STRING errorDesc; + int tabsize; + TiXmlCursor errorLocation; + bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. +}; + + +/** + A TiXmlHandle is a class that wraps a node pointer with null checks; this is + an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml + DOM structure. It is a separate utility class. + + Take an example: + @verbatim + + + + + + + @endverbatim + + Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very + easy to write a *lot* of code that looks like: + + @verbatim + TiXmlElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + @endverbatim + + And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity + of such code. A TiXmlHandle checks for null pointers so it is perfectly safe + and correct to use: + + @verbatim + TiXmlHandle docHandle( &document ); + TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).Element(); + if ( child2 ) + { + // do something useful + @endverbatim + + Which is MUCH more concise and useful. + + It is also safe to copy handles - internally they are nothing more than node pointers. + @verbatim + TiXmlHandle handleCopy = handle; + @endverbatim + + What they should not be used for is iteration: + + @verbatim + int i=0; + while ( true ) + { + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).Element(); + if ( !child ) + break; + // do something + ++i; + } + @endverbatim + + It seems reasonable, but it is in fact two embedded while loops. The Child method is + a linear walk to find the element, so this code would iterate much more than it needs + to. Instead, prefer: + + @verbatim + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).Element(); + + for( child; child; child=child->NextSiblingElement() ) + { + // do something + } + @endverbatim +*/ +class TiXmlHandle +{ +public: + /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. + TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } + /// Copy constructor + TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } + TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } + + /// Return a handle to the first child node. + TiXmlHandle FirstChild() const; + /// Return a handle to the first child node with the given name. + TiXmlHandle FirstChild( const char * value ) const; + /// Return a handle to the first child element. + TiXmlHandle FirstChildElement() const; + /// Return a handle to the first child element with the given name. + TiXmlHandle FirstChildElement( const char * value ) const; + + /** Return a handle to the "index" child with the given name. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( const char* value, int index ) const; + /** Return a handle to the "index" child. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( int index ) const; + /** Return a handle to the "index" child element with the given name. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( const char* value, int index ) const; + /** Return a handle to the "index" child element. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( int index ) const; + + #ifdef TIXML_USE_STL + TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } + TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } + + TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } + TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } + #endif + + /// Return the handle as a TiXmlNode. This may return null. + TiXmlNode* Node() const { return node; } + /// Return the handle as a TiXmlElement. This may return null. + TiXmlElement* Element() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } + /// Return the handle as a TiXmlText. This may return null. + TiXmlText* Text() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } + /// Return the handle as a TiXmlUnknown. This may return null; + TiXmlUnknown* Unknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } + +private: + TiXmlNode* node; +}; + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + +#endif + diff --git a/cli/test/include/mockcpp/AfterMatchBuilder.h b/cli/test/include/mockcpp/AfterMatchBuilder.h new file mode 100644 index 0000000..8781865 --- /dev/null +++ b/cli/test/include/mockcpp/AfterMatchBuilder.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_AFTER_MATCH_BUILDER_H +#define __MOCKCPP_AFTER_MATCH_BUILDER_H + +#include + +#include + +MOCKCPP_NS_START + +struct InvocationMockerNamespace; +struct InvocationMocker; + +template +struct AfterMatchBuilder : public Builder +{ + AfterMatchBuilder& + after(const InvocationMockerNamespace& ns, const std::string& name); + + AfterMatchBuilder& + after(InvocationMockerNamespace* ns, const std::string& name); + + AfterMatchBuilder& + after(const std::string& name); + + virtual ~AfterMatchBuilder() {} + +private: + void + setupOrderingAfterMatchers(InvocationMocker* mocker); + +private: + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#include + +#endif + diff --git a/cli/test/include/mockcpp/AfterMatchBuilder.tcc b/cli/test/include/mockcpp/AfterMatchBuilder.tcc new file mode 100644 index 0000000..a0a40da --- /dev/null +++ b/cli/test/include/mockcpp/AfterMatchBuilder.tcc @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +////////////////////////////////////////////////////////////////////// +template +AfterMatchBuilder& +AfterMatchBuilder::after(const InvocationMockerNamespace& ns, const std::string& name) +{ + return after(&const_cast(ns), name); +} + +////////////////////////////////////////////////////////////////////// +template +AfterMatchBuilder& +AfterMatchBuilder::after(InvocationMockerNamespace* ns, const std::string& id) +{ + getMocker()->addMatcher( + new PendingMatcher( + new AfterMatcher(), ns, id, getMocker())); + return *this; +} + +////////////////////////////////////////////////////////////////////// +template +AfterMatchBuilder& +AfterMatchBuilder::after(const std::string& name) +{ + return after(getMocker()->getMethod()->getNamespace(), name); +} + +////////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + + diff --git a/cli/test/include/mockcpp/AfterMatcher.h b/cli/test/include/mockcpp/AfterMatcher.h new file mode 100644 index 0000000..e54b213 --- /dev/null +++ b/cli/test/include/mockcpp/AfterMatcher.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_AFTER_MATCHER_H +#define __MOCKCPP_AFTER_MATCHER_H + +#include + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Invocation; + +struct AfterMatcher : public OrderingMatcher +{ + AfterMatcher(); + + bool matches(const Invocation& inv) const; + + void increaseInvoked(const Invocation& inv); + + std::string toString() const; + + void verify(void); + + bool isCompleted(void) const; + + void setOrderingInvocationMocker(InvocationMocker* mocker); + +private: + + InvocationMocker* previousCall; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHook.h b/cli/test/include/mockcpp/ApiHook.h new file mode 100644 index 0000000..67a97d4 --- /dev/null +++ b/cli/test/include/mockcpp/ApiHook.h @@ -0,0 +1,24 @@ + +#ifndef __MOCKCPP_API_HOOK_H__ +#define __MOCKCPP_API_HOOK_H__ + +#include + +MOCKCPP_NS_START + +struct ApiHookImpl; + +struct ApiHook +{ + ApiHook ( const void* api + , const void* stub ); + + ~ApiHook(); + +private: + ApiHookImpl* This; +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/ApiHookFunctor.h b/cli/test/include/mockcpp/ApiHookFunctor.h new file mode 100644 index 0000000..befc257 --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookFunctor.h @@ -0,0 +1,167 @@ + +#ifndef __MOCKCPP_API_HOOK_FUNCTOR_H__ +#define __MOCKCPP_API_HOOK_FUNCTOR_H__ + +#include +#include +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////////////// +template +struct ApiHookFunctor +{ +}; + +const std::string empty_caller(""); + +#define __MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, CallingConvention) \ +template \ +struct ApiHookFunctor \ +{ \ +private: \ + typedef R (CallingConvention *F) (DECL_ARGS(n)); \ + \ + static R CallingConvention hook(DECL_PARAMS_LIST(n)) \ + { \ + return GlobalMockObject::instance.invoke(apiAddress) \ + (empty_caller, RefAny() DECL_REST_PARAMS(n)); \ + } \ + \ + static bool appliedBy(F api) \ + { return apiAddress == reinterpret_cast(api); } \ + \ + static void* getHook() \ + { return reinterpret_cast(hook); } \ + \ + static void freeHook() \ + { if(--refCount == 0) apiAddress = 0; } \ +public: \ + \ + static void* getApiHook(F api) \ + { \ + if(!appliedBy(api)) return 0; \ + ++refCount; \ + return getHook(); \ + } \ + \ + static void* applyApiHook(F api) \ + { \ + if(apiAddress != 0) return 0; \ + apiAddress = reinterpret_cast(api); \ + refCount = 1; \ + return getHook(); \ + } \ + \ + static bool freeApiHook(void* hook) \ + { \ + if(getHook() != hook) return false; \ + freeHook(); \ + return true; \ + } \ +private: \ + static void* apiAddress; \ + static unsigned int refCount; \ +}; \ +template \ +void* ApiHookFunctor::apiAddress = 0; \ +template \ +unsigned int ApiHookFunctor::refCount = 0 + +/* For C++ method */ +#define __MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, CallingConvention, ConstConvention) \ +template \ +struct ApiHookFunctor \ +{ \ +private: \ + typedef ApiHookFunctor ThisType; \ + typedef R (CallingConvention C::*F) (DECL_ARGS(n)) ConstConvention; \ + \ + R CallingConvention hook(DECL_PARAMS_LIST(n)) \ + { \ + C *This = reinterpret_cast(this); \ + return GlobalMockObject::instance.invoke(apiAddress) \ + (empty_caller, This DECL_REST_PARAMS(n)); \ + } \ + \ + static bool appliedBy(F api) \ + { return apiAddress == Details::methodToAddr(api); } \ + \ + static void* getHook() \ + { return Details::methodToAddr(&ThisType::hook); } \ + \ + static void freeHook() \ + { if(--refCount == 0) apiAddress = 0; } \ +public: \ + \ + static void* getApiHook(F api) \ + { \ + if(!appliedBy(api)) return 0; \ + ++refCount; \ + return getHook(); \ + } \ + \ + static void* applyApiHook(F api) \ + { \ + if(apiAddress != 0) return 0; \ + apiAddress = Details::methodToAddr(api); \ + refCount = 1; \ + return getHook(); \ + } \ + \ + static bool freeApiHook(void* hook) \ + { \ + if(getHook() != hook) return false; \ + freeHook(); \ + return true; \ + } \ +private: \ + static void* apiAddress; \ + static unsigned int refCount; \ +}; \ +template \ +void* ApiHookFunctor::apiAddress = 0; \ +template \ +unsigned int ApiHookFunctor::refCount = 0 + +#ifdef WIN32 +#if defined(_MSC_VER) && defined(BUILD_FOR_X86) +#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ +__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ +__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, __stdcall); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, __stdcall, ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, __stdcall, const) +#else +#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ +__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const) +#endif +#else +#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ +__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ +__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const) +#endif + +MOCKCPP_API_HOOK_FUNCTOR_DEF(0); +MOCKCPP_API_HOOK_FUNCTOR_DEF(1); +MOCKCPP_API_HOOK_FUNCTOR_DEF(2); +MOCKCPP_API_HOOK_FUNCTOR_DEF(3); +MOCKCPP_API_HOOK_FUNCTOR_DEF(4); +MOCKCPP_API_HOOK_FUNCTOR_DEF(5); +MOCKCPP_API_HOOK_FUNCTOR_DEF(6); +MOCKCPP_API_HOOK_FUNCTOR_DEF(7); +MOCKCPP_API_HOOK_FUNCTOR_DEF(8); +MOCKCPP_API_HOOK_FUNCTOR_DEF(9); +MOCKCPP_API_HOOK_FUNCTOR_DEF(10); +MOCKCPP_API_HOOK_FUNCTOR_DEF(11); +MOCKCPP_API_HOOK_FUNCTOR_DEF(12); + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHookGenerator.h b/cli/test/include/mockcpp/ApiHookGenerator.h new file mode 100644 index 0000000..8945813 --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookGenerator.h @@ -0,0 +1,75 @@ + +#ifndef __MOCKCPP_API_HOOK_GENERATOR_H__ +#define __MOCKCPP_API_HOOK_GENERATOR_H__ + +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////////////////////////// +template +struct ApiHookGenerator +{ + static void* findApiHook(F api) + { + void* hook; + + (hook = ApiHookFunctor::getApiHook(api)) || + (hook = ApiHookGenerator::findApiHook(api)); + + return hook; + } + + static void* appyApiHook(F api) + { + void* hook; + + (hook = ApiHookFunctor::applyApiHook(api)) || + (hook = ApiHookGenerator::appyApiHook(api)); + + return hook; + } + + static bool freeApiHook(void* hook) + { + return + (ApiHookFunctor::freeApiHook(hook)) || + (ApiHookGenerator::freeApiHook(hook)); + } + +private: + +}; + +///////////////////////////////////////////////////////////////// +template +struct ApiHookGenerator +{ + static void* findApiHook(F api) + { return 0; } + + static void* appyApiHook(F api) + { + oss_t oss; + + oss << "Did you define too many mockers in a testcase? " + << "Probably you should refine your design, " + << "or you can reconfig ParameterizedApiHookHolder::maxSeq bigger, " + << "it's the number of mockers in a testcase that with the same function prototype, " + << "the bigger it is, the slower compiling is."; + + MOCKCPP_REPORT_FAILURE(oss.str()); + + return 0; + } + + static bool freeApiHook(void* hook) + { return true; } +}; + +///////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHookHolder.h b/cli/test/include/mockcpp/ApiHookHolder.h new file mode 100644 index 0000000..ec1b866 --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookHolder.h @@ -0,0 +1,19 @@ + +#ifndef __MOCKCPP_API_HOOK_HOLDER_H__ +#define __MOCKCPP_API_HOOK_HOLDER_H__ + +#include + +MOCKCPP_NS_START + +struct ApiHookHolder +{ + virtual void * getApiHook() const = 0; + + virtual ~ApiHookHolder() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHookHolderFactory.h b/cli/test/include/mockcpp/ApiHookHolderFactory.h new file mode 100644 index 0000000..2ab9bf0 --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookHolderFactory.h @@ -0,0 +1,23 @@ + +#ifndef __MOCKCPP_API_HOOK_HOLDER_FACTORY_H__ +#define __MOCKCPP_API_HOOK_HOLDER_FACTORY_H__ + +#include + +MOCKCPP_NS_START + +struct ApiHookHolder; + +struct ApiHookHolderFactory +{ + template + static ApiHookHolder* create(F api) + { + return new ParameterizedApiHookHolder(api); + } +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHookKey.h b/cli/test/include/mockcpp/ApiHookKey.h new file mode 100644 index 0000000..4fa6b5b --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookKey.h @@ -0,0 +1,50 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_API_HOOK_KEY_H__ +#define __MOCKCPP_API_HOOK_KEY_H__ + +#include + +#include + +MOCKCPP_NS_START + +struct ApiHook; +struct ApiHookHolder; + +struct ApiHookKey + : public ChainableMockMethodKey +{ + explicit ApiHookKey(const void* api); + ApiHookKey(const void* api, ApiHookHolder* hookHolder); + + ~ApiHookKey(); + + bool equals(const ChainableMockMethodKey * const rhs) const; + +private: + ApiHook* hook; + ApiHookHolder* hookHolder; + const void* apiAddress; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ApiHookMocker.h b/cli/test/include/mockcpp/ApiHookMocker.h new file mode 100644 index 0000000..2b244ce --- /dev/null +++ b/cli/test/include/mockcpp/ApiHookMocker.h @@ -0,0 +1,125 @@ + +#ifndef __MOCKCPP_API_HOOK_MOCKER_H__ +#define __MOCKCPP_API_HOOK_MOCKER_H__ + +#include +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +struct mockAPIauto {}; +template struct mockAPI; + +template struct mockAPI +{ + static InvocationMockBuilderGetter get( + const std::string& name, const std::string& type, API api) + { + return MOCKCPP_NS::GlobalMockObject::instance.method + ( type.empty() ? name : name + " #" + type + "#" + , Details::methodToAddr(api) + , ApiHookHolderFactory::create(api)); + } + + template + static InvocationMockBuilderGetter get_virtual( + const std::string& name, const std::string& type, const C *c, API api) + { + void ***vtbl = (void ***)c; + std::pair indices = + getIndicesOfMethod(api); + union { void *_addr; API _api; }; + _addr = (*vtbl)[indices.second]; + return MOCKCPP_NS::GlobalMockObject::instance.method + ( type.empty() ? name : name + " #" + type + "#" + , _addr + , ApiHookHolderFactory::create(_api)); + } + + template + static InvocationMockBuilderGetter get_virtual( + const std::string& name, const std::string& type, const C &c, API api) + { + return get_virtual(name, type, &c, api); + } +}; // struct mockAPI + +template<> struct mockAPI +{ +#define __MOCKCPP_C_API_GET_FUNCTION_DEF(n, CallingConvention) \ + template \ + static InvocationMockBuilderGetter get( \ + const std::string& name, const std::string& type, R (CallingConvention *api)(DECL_ARGS(n))) \ + { \ + typedef R (CallingConvention *API)(DECL_ARGS(n)); \ + return mockAPI::get(name, type, api); \ + } + +#define __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, CallingConvention, ConstMethod) \ + template \ + static InvocationMockBuilderGetter get( \ + const std::string& name, const std::string& type, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ + { \ + typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ + return mockAPI::get(name, type, api); \ + } \ + template \ + static InvocationMockBuilderGetter get_virtual( \ + const std::string& name, const std::string& type, const C *c, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ + { \ + typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ + return mockAPI::get_virtual(name, type, c, api); \ + } \ + template \ + static InvocationMockBuilderGetter get_virtual( \ + const std::string& name, const std::string& type, const C &c, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ + { \ + typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ + return mockAPI::get_virtual(name, type, c, api); \ + } + +#ifdef WIN32 +#if defined(_MSC_VER) && defined(BUILD_FOR_X86) +#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ + __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ + __MOCKCPP_C_API_GET_FUNCTION_DEF(n, __stdcall); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, __stdcall, ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, __stdcall, const) +#else +#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ + __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const) +#endif +#else +#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ + __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ + __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const) +#endif + + MOCKCPP_API_GET_FUNCTION_DEF(0); + MOCKCPP_API_GET_FUNCTION_DEF(1); + MOCKCPP_API_GET_FUNCTION_DEF(2); + MOCKCPP_API_GET_FUNCTION_DEF(3); + MOCKCPP_API_GET_FUNCTION_DEF(4); + MOCKCPP_API_GET_FUNCTION_DEF(5); + MOCKCPP_API_GET_FUNCTION_DEF(6); + MOCKCPP_API_GET_FUNCTION_DEF(7); + MOCKCPP_API_GET_FUNCTION_DEF(8); + MOCKCPP_API_GET_FUNCTION_DEF(9); + MOCKCPP_API_GET_FUNCTION_DEF(10); + MOCKCPP_API_GET_FUNCTION_DEF(11); + MOCKCPP_API_GET_FUNCTION_DEF(12); +}; // struct mockAPI + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ArgumentsList.h b/cli/test/include/mockcpp/ArgumentsList.h new file mode 100644 index 0000000..36a3ec6 --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsList.h @@ -0,0 +1,43 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ARGUMENTS_LIST_H_ +#define __MOCKCPP_ARGUMENTS_LIST_H_ + +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////////// +struct UselessType {}; + +//////////////////////////////////////////////////// +template + > +struct ArgumentsList {}; + + +template + > +struct ArgumentsListConst {}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/ArgumentsListDef.h b/cli/test/include/mockcpp/ArgumentsListDef.h new file mode 100644 index 0000000..46ac85c --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsListDef.h @@ -0,0 +1,13 @@ +, typename P0 = UselessType +, typename P1 = UselessType +, typename P2 = UselessType +, typename P3 = UselessType +, typename P4 = UselessType +, typename P5 = UselessType +, typename P6 = UselessType +, typename P7 = UselessType +, typename P8 = UselessType +, typename P9 = UselessType +, typename P10 = UselessType +, typename P11 = UselessType +, typename P12 = UselessType diff --git a/cli/test/include/mockcpp/ArgumentsListDef.h.rule b/cli/test/include/mockcpp/ArgumentsListDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsListDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/ArgumentsMacroHelpers.h b/cli/test/include/mockcpp/ArgumentsMacroHelpers.h new file mode 100644 index 0000000..fb58532 --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsMacroHelpers.h @@ -0,0 +1,67 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ARGUMENTS_MACRO_HELPERS_H +#define __MOCKCPP_ARGUMENTS_MACRO_HELPERS_H + +#include + +#define __ARG(n) MOCKP ## n +#define END_ARGS(n) __ARG(n) +#define ARGS(n) __ARG(n) , +#define REST_ARGS(n) , __ARG(n) + +#define __PARAM(n) p ## n +#define END_PARAMS(n) __PARAM(n) +#define PARAMS(n) __PARAM(n) , +#define REST_PARAMS(n) , __PARAM(n) + +#define TEMPLATE_ARG(n) typename __ARG(n) +#define TEMPLATE_ARGS(n) , TEMPLATE_ARG(n) +#define VOID_TEMPLATE_ARGS(n) typename __ARG(n), + +#define __ARG_DECL(n) __ARG(n) __PARAM(n) +#define ARG_DECL(n) __ARG_DECL(n) , +#define END_ARG_DECL(n) __ARG_DECL(n) +#define REST_ARG_DECL(n) , __ARG_DECL(n) + +#define DECL_TEMPLATE_ARGS(n) SIMPLE_REPEAT(n, TEMPLATE_ARGS) +#define DECL_VARDIC_ARGS(n) SIMPLE_REPEAT(n, ARGS) +#define DECL_VARDIC_PARAM_LIST(n) SIMPLE_REPEAT(n, ARG_DECL) +#define DECL_VOID_TEMPLATE_ARGS(n) REPEAT(n, VOID_TEMPLATE_ARGS, TEMPLATE_ARG) +#define DECL_ARGS(n) REPEAT(n, ARGS, END_ARGS) +#define DECL_PARAMS(n) REPEAT(n, PARAMS, END_PARAMS) +#define DECL_PARAMS_LIST(n) REPEAT(n, ARG_DECL, END_ARG_DECL) + +#define DECL_REST_ARGS(n) SIMPLE_REPEAT(n, REST_ARGS) +#define DECL_REST_PARAMS(n) SIMPLE_REPEAT(n, REST_PARAMS) +#define DECL_REST_ARG_DECL(n) SIMPLE_REPEAT(n, REST_ARG_DECL) + +#define MOCKER_PP_CAT(a, b) MOCKER_PP_CAT_I(a, b) +#define MOCKER_PP_CAT_I(a, b) MOCKER_PP_CAT_II(~, a ## b) +#define MOCKER_PP_CAT_II(p, res) res + +#define MOCKER_PP_VARIADIC_SIZE(...) MOCKER_PP_VARIADIC_SIZE_I(__VA_ARGS__) +#define MOCKER_PP_VARIADIC_SIZE_I(...) MOCKER_PP_VARIADIC_SIZE_II(MOCKER_PP_VARIADIC_SIZE_S(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,)) +#define MOCKER_PP_VARIADIC_SIZE_II(res) res +#define MOCKER_PP_VARIADIC_SIZE_S(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, size, ...) size + +#define MOCKER_PP_OVERLOAD(prefix, ...) MOCKER_PP_CAT(prefix, MOCKER_PP_VARIADIC_SIZE(__VA_ARGS__)) + +#endif + diff --git a/cli/test/include/mockcpp/ArgumentsMatchBuilder.h b/cli/test/include/mockcpp/ArgumentsMatchBuilder.h new file mode 100644 index 0000000..f9ca673 --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsMatchBuilder.h @@ -0,0 +1,77 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ARGUMENTS_MATCH_BUILDER_H +#define __MOCKCPP_ARGUMENTS_MATCH_BUILDER_H + +#include +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Constraint; + +template +struct ArgumentsMatchBuilder : public Builder +{ + + Builder& with( const Any& c01 = any() + , const Any& c02 = any() + , const Any& c03 = any() + , const Any& c04 = any() + , const Any& c05 = any() + , const Any& c06 = any() + , const Any& c07 = any() + , const Any& c08 = any() + , const Any& c09 = any() + , const Any& c10 = any() + , const Any& c11 = any() + , const Any& c12 = any() + ); +#if 0 + Builder& with( Constraint* c01 = any() + , Constraint* c02 = any() + , Constraint* c03 = any() + , Constraint* c04 = any() + , Constraint* c05 = any() + , Constraint* c06 = any() + , Constraint* c07 = any() + , Constraint* c08 = any() + , Constraint* c09 = any() + , Constraint* c10 = any() + , Constraint* c11 = any() + , Constraint* c12 = any() + ); +#endif + + virtual ~ArgumentsMatchBuilder() {} + +private: + + virtual InvocationMocker* getMocker() const = 0; + +}; + +MOCKCPP_NS_END + +#include + +#endif + diff --git a/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc b/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc new file mode 100644 index 0000000..8f5135c --- /dev/null +++ b/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc @@ -0,0 +1,87 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include +#include +#include + +MOCKCPP_NS_START + +template +Builder& +ArgumentsMatchBuilder:: +with( const Any& c01 + , const Any& c02 + , const Any& c03 + , const Any& c04 + , const Any& c05 + , const Any& c06 + , const Any& c07 + , const Any& c08 + , const Any& c09 + , const Any& c10 + , const Any& c11 + , const Any& c12 +) +{ + getMocker()->addMatcher( + new ConstraintSet( c01.getConstraint() + , c02.getConstraint() + , c03.getConstraint() + , c04.getConstraint() + , c05.getConstraint() + , c06.getConstraint() + , c07.getConstraint() + , c08.getConstraint() + , c09.getConstraint() + , c10.getConstraint() + , c11.getConstraint() + , c12.getConstraint())); + return *this; +} + +#if 0 +template +Builder& +ArgumentsMatchBuilder:: +with( Constraint* c01 + , Constraint* c02 + , Constraint* c03 + , Constraint* c04 + , Constraint* c05 + , Constraint* c06 + , Constraint* c07 + , Constraint* c08 + , Constraint* c09 + , Constraint* c10 + , Constraint* c11 + , Constraint* c12 +) +{ + getMocker()->addMatcher( + new ConstraintSet(c01, c02, c03, c04, c05, c06, + c07, c08, c09, c10, c11, c12)); + return *this; +} + +#endif + +MOCKCPP_NS_END + + diff --git a/cli/test/include/mockcpp/Asserter.h b/cli/test/include/mockcpp/Asserter.h new file mode 100644 index 0000000..7243687 --- /dev/null +++ b/cli/test/include/mockcpp/Asserter.h @@ -0,0 +1,61 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ASSERTER_H +#define __MOCKCPP_ASSERTER_H + +#include + +#include + +MOCKCPP_NS_START + +void assertTrue( unsigned srcline, const char* srcfile + , const std::string &message, bool condition); + +void assertTrue( unsigned srcline, const char* srcfile + , bool condition); + +void assertFalse(unsigned srcline, const char* srcfile + , const std::string &message , bool condition); + +void assertFalse(unsigned srcline, const char* srcfile + , bool condition); + +void fail(unsigned srcline, const char* srcfile, + const std::string &message); + +void fail(unsigned srcline, const char* srcfile); + +void assertEquals(unsigned srcline, const char* srcfile, + const std::string& message, + const char *expected, const char *actual); + +void assertEquals(unsigned srcline, const char* srcfile, + const char *expected, const char *actual); + +#define MOCKCPP_ASSERT_EQUALS_MESSAGE(msg, a, b) MOCKCPP_NS::assertEquals(__LINE__, __FILE__, msg, a, b) +#define MOCKCPP_ASSERT_EQUALS(a, b) MOCKCPP_NS::assertEquals(__LINE__, __FILE__, "invalid: " #a " == " #b, a, b) +#define MOCKCPP_ASSERT_TRUE_MESSAGE(msg, cond) MOCKCPP_NS::assertTrue(__LINE__, __FILE__, msg, cond) +#define MOCKCPP_ASSERT_FALSE_MESSAGE(msg, cond) MOCKCPP_NS::assertFalse(__LINE__, __FILE__, msg, cond) +#define MOCKCPP_FAIL(msg) MOCKCPP_NS::fail(__LINE__, __FILE__, msg) + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/AssertionFailedError.h b/cli/test/include/mockcpp/AssertionFailedError.h new file mode 100644 index 0000000..80b693d --- /dev/null +++ b/cli/test/include/mockcpp/AssertionFailedError.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ASSERTION_FAILED_ERROR_H +#define __MOCKCPP_ASSERTION_FAILED_ERROR_H + +#include + +#include + +MOCKCPP_NS_START + +struct AssertionFailedError : public Exception +{ + AssertionFailedError (unsigned srcline, const char* srcfile, + const std::string& message); + + virtual ~AssertionFailedError() throw(); +}; + +void +assertionFailed + ( unsigned int line + , const char* file + , const std::string& message); + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/BeforeMatchBuilder.h b/cli/test/include/mockcpp/BeforeMatchBuilder.h new file mode 100644 index 0000000..919f6f0 --- /dev/null +++ b/cli/test/include/mockcpp/BeforeMatchBuilder.h @@ -0,0 +1,59 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_BEFORE_MATCH_BUILDER_H +#define __MOCKCPP_BEFORE_MATCH_BUILDER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMockerNamespace; +struct InvocationMocker; + +template +struct BeforeMatchBuilder : public Builder +{ + BeforeMatchBuilder& + before(const InvocationMockerNamespace& ns, const std::string& name); + + BeforeMatchBuilder& + before(InvocationMockerNamespace* ns, const std::string& name); + + BeforeMatchBuilder& + before(const std::string& name); + + virtual ~BeforeMatchBuilder() {} + +private: + + void + setupOrderingBeforeMatchers(InvocationMocker* mocker); + +private: + + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#include + +#endif + diff --git a/cli/test/include/mockcpp/BeforeMatchBuilder.tcc b/cli/test/include/mockcpp/BeforeMatchBuilder.tcc new file mode 100644 index 0000000..71ec9dd --- /dev/null +++ b/cli/test/include/mockcpp/BeforeMatchBuilder.tcc @@ -0,0 +1,59 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +////////////////////////////////////////////////////////////////////// +template +BeforeMatchBuilder& +BeforeMatchBuilder::before(const InvocationMockerNamespace& ns, const std::string& name) +{ + return before(&const_cast(ns), name); +} + +////////////////////////////////////////////////////////////////////// +template +BeforeMatchBuilder& +BeforeMatchBuilder::before(InvocationMockerNamespace* ns, const std::string& id) +{ + getMocker()->addMatcher( + new PendingMatcher( + new BeforeMatcher(), ns , id , getMocker())); + + return *this; +} + +////////////////////////////////////////////////////////////////////// +template +BeforeMatchBuilder& +BeforeMatchBuilder::before(const std::string& name) +{ + return before(getMocker()->getMethod()->getNamespace(), name); +} + +////////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + + diff --git a/cli/test/include/mockcpp/BeforeMatcher.h b/cli/test/include/mockcpp/BeforeMatcher.h new file mode 100644 index 0000000..caf292c --- /dev/null +++ b/cli/test/include/mockcpp/BeforeMatcher.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_BEFORE_MATCHER_H +#define __MOCKCPP_BEFORE_MATCHER_H + +#include +#include + +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Invocation; + +struct BeforeMatcher : public OrderingMatcher +{ + BeforeMatcher(); + + bool matches(const Invocation& inv) const; + + void increaseInvoked(const Invocation& inv); + + std::string toString() const; + + void verify(); + + bool isCompleted(void) const; + + void setOrderingInvocationMocker(InvocationMocker* mocker); + +private: + + InvocationMocker* previousCall; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/CallerMatchBuilder.h b/cli/test/include/mockcpp/CallerMatchBuilder.h new file mode 100644 index 0000000..fffdb6c --- /dev/null +++ b/cli/test/include/mockcpp/CallerMatchBuilder.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CALLER_MATCH_BUILDER_H +#define __MOCKCPP_CALLER_MATCH_BUILDER_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct InvocationMocker; + +template +struct CallerMatchBuilder : public Builder +{ + Builder& caller(const std::string& nameOfCaller); + + virtual ~CallerMatchBuilder() {} + +private: + + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#include + +#endif diff --git a/cli/test/include/mockcpp/CallerMatchBuilder.tcc b/cli/test/include/mockcpp/CallerMatchBuilder.tcc new file mode 100644 index 0000000..44992df --- /dev/null +++ b/cli/test/include/mockcpp/CallerMatchBuilder.tcc @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include + + +MOCKCPP_NS_START + + +////////////////////////////////////////////////////////////////////// +template +Builder& +CallerMatchBuilder::caller(const std::string& nameOfCaller) +{ + getMocker()->addMatcher(new CallerMatcher(nameOfCaller)); + return *this; +} + +////////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END diff --git a/cli/test/include/mockcpp/CallerMatcher.h b/cli/test/include/mockcpp/CallerMatcher.h new file mode 100644 index 0000000..f90cf21 --- /dev/null +++ b/cli/test/include/mockcpp/CallerMatcher.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CALLER_MATCHER_H +#define __MOCKCPP_CALLER_MATCHER_H + +#include +#include +#include + +MOCKCPP_NS_START + +struct Invocation; + +struct CallerMatcher : public Matcher +{ + CallerMatcher(const std::string& name); + + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + void verify() ; + std::string toString() const ; + +private: + std::string nameOfCaller; +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/ChainableMockMethod.h b/cli/test/include/mockcpp/ChainableMockMethod.h new file mode 100644 index 0000000..61ef647 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethod.h @@ -0,0 +1,133 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_H + +#include +#include +#include +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +struct SelfDescribe; + +template +struct ChainableMockMethodBase +{ + ChainableMockMethodBase(Invokable* invokable_) + : invokable(invokable_) + {} + + RT operator()(const std::string& nameOfCaller + , const RefAny& pThisPointer = RefAny() + , const RefAny& p01 = RefAny() + , const RefAny& p02 = RefAny() + , const RefAny& p03 = RefAny() + , const RefAny& p04 = RefAny() + , const RefAny& p05 = RefAny() + , const RefAny& p06 = RefAny() + , const RefAny& p07 = RefAny() + , const RefAny& p08 = RefAny() + , const RefAny& p09 = RefAny() + , const RefAny& p10 = RefAny() + , const RefAny& p11 = RefAny() + , const RefAny& p12 = RefAny() + ) + { + SelfDescribe* resultProvider = 0; + + try { + const Any& result = \ + invokable->invoke(nameOfCaller, pThisPointer + , p01, p02, p03, p04, p05, p06 + , p07, p08, p09, p10, p11, p12 + , resultProvider); + return getResult(result, resultProvider); + } catch (std::exception& ex) + { + MOCKCPP_REPORT_FAILURE(ex.what()); + } + const Any& dummyResult = Any(); + return getResult(dummyResult, resultProvider); + } + + virtual ~ChainableMockMethodBase() {} + +protected: + + virtual RT getResult(const Any& result, SelfDescribe*) = 0; + +private: + + Invokable* invokable; +}; + + +////////////////////////////////////////////////////////////////// +template +struct ChainableMockMethod : public ChainableMockMethodBase +{ + RT getResult(const Any& anyResult, SelfDescribe* resultProvider) + { + const Any& result = \ + Result(any_castable(anyResult) + , typeid(RT) + , TypeString::value() + , resultProvider).getResult(anyResult); + + MOCKCPP_ASSERT_FALSE_MESSAGE( + "The return value for a non-void method was not specified", + result.empty()); + + return any_cast(result); + } + +public: + + ChainableMockMethod(Invokable* invokable) + : ChainableMockMethodBase(invokable) + {} +}; + +////////////////////////////////////////////////////////////////// +template <> +struct ChainableMockMethod : public ChainableMockMethodBase +{ + void getResult(const Any& result, SelfDescribe*) + { + } + +public: + + ChainableMockMethod(Invokable* invokable) + : ChainableMockMethodBase(invokable) + {} +}; + +////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockMethodContainer.h b/cli/test/include/mockcpp/ChainableMockMethodContainer.h new file mode 100644 index 0000000..d9577e1 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethodContainer.h @@ -0,0 +1,54 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_CONTAINER_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_CONTAINER_H + +#include + +#include + +MOCKCPP_NS_START + +struct ChainableMockMethodContainerImpl; +struct ChainableMockMethodKey; +struct ChainableMockMethodCore; +struct InvocationMocker; + +/////////////////////////////////////////////////////////////// +struct ChainableMockMethodContainer +{ + ChainableMockMethodContainer(); + ~ChainableMockMethodContainer(); + + ChainableMockMethodCore* getMethod(ChainableMockMethodKey* key) const; + void addMethod(ChainableMockMethodKey* key, ChainableMockMethodCore* method); + + InvocationMocker* findInvocationMocker(const std::string& id) const; + + void reset(); + void reset(ChainableMockMethodKey* key); + void verify(); + +private: + ChainableMockMethodContainerImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockMethodCore.h b/cli/test/include/mockcpp/ChainableMockMethodCore.h new file mode 100644 index 0000000..d041a44 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethodCore.h @@ -0,0 +1,89 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_CORE_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_CORE_H + +#include + +#include +#include + +#include + +MOCKCPP_NS_START + +struct Stub; +struct ChainableMockMethodCoreImpl; +struct SelfDescribe; +struct InvokedRecorder; +struct InvocationMockerNamespace; + +struct ChainableMockMethodCore + : public Method, + public InvocationMockerContainer +{ +public: + + ChainableMockMethodCore(const std::string& name, + InvocationMockerNamespace* ns); + ~ChainableMockMethodCore(); + + // Method + const Any& + invoke( const std::string& nameOfCaller + , const RefAny& pThisPointer + , const RefAny& p1 + , const RefAny& p2 + , const RefAny& p3 + , const RefAny& p4 + , const RefAny& p5 + , const RefAny& p6 + , const RefAny& p7 + , const RefAny& p8 + , const RefAny& p9 + , const RefAny& p10 + , const RefAny& p11 + , const RefAny& p12 + , SelfDescribe* &resultProvider); + + std::string& getName(void) const; + + InvocationMockerNamespace* getNamespace() const; + +public: + + // InvocationMockContainer + InvocationMocker* getInvocationMocker(const std::string& id); + void addInvocationMocker(InvocationMocker* mocker); + void addDefaultInvocationMocker(InvocationMocker* mocker); + +public: + // Others + void reset(); + void verify(); + +private: + + ChainableMockMethodCoreImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h b/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h new file mode 100644 index 0000000..5a6c3e1 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_INDEX_KEY_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_INDEX_KEY_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct ChainableMockMethodIndexKey + : public ChainableMockMethodKey +{ + ChainableMockMethodIndexKey(unsigned int vptrIndex, unsigned int vtblIndex); + + bool equals(const ChainableMockMethodKey * const rhs) const; + + unsigned int getIndex() const; + +private: + unsigned int index; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockMethodKey.h b/cli/test/include/mockcpp/ChainableMockMethodKey.h new file mode 100644 index 0000000..0162ac7 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethodKey.h @@ -0,0 +1,36 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_KEY_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_KEY_H + +#include + +MOCKCPP_NS_START + +struct ChainableMockMethodKey +{ + virtual bool equals(const ChainableMockMethodKey * const rhs) const = 0; + + virtual ~ChainableMockMethodKey() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockMethodNameKey.h b/cli/test/include/mockcpp/ChainableMockMethodNameKey.h new file mode 100644 index 0000000..173a8f7 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockMethodNameKey.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_NAME_KEY_H +#define __MOCKCPP_CHAINABLE_MOCK_METHOD_NAME_KEY_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct ChainableMockMethodNameKey + : public ChainableMockMethodKey +{ + ChainableMockMethodNameKey(const std::string& name); + + bool equals(const ChainableMockMethodKey * const rhs) const; + + std::string& getMethodName() const; + +private: + std::string methodName; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockObject.h b/cli/test/include/mockcpp/ChainableMockObject.h new file mode 100644 index 0000000..a3ed846 --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockObject.h @@ -0,0 +1,69 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_OBJECT_H_ +#define __MOCKCPP_CHAINABLE_MOCK_OBJECT_H_ + +#include + +#include +#include +#include + +#include + +MOCKCPP_NS_START + +struct ChainableMockObjectImpl; +struct Invokable; + +struct ChainableMockObject + : public ChainableMockObjectBase +{ +public: + + ChainableMockObject(const std::string& name); + + ~ChainableMockObject(); + + // Building-invocation-mocker interface -- Used in test case + InvocationMockBuilderGetter method(const std::string& name); + + // Invoking interface -- Used in Functor + template + ChainableMockMethod invoke(const std::string& name) + { + return ChainableMockMethod(getInvokable(name)); + } + + void reset(); + +private: + + // It's only for template-method invoke. we have to make it visible. + Invokable* getInvokable(const std::string& name); + +private: + + ChainableMockObjectImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainableMockObjectBase.h b/cli/test/include/mockcpp/ChainableMockObjectBase.h new file mode 100644 index 0000000..ad9197d --- /dev/null +++ b/cli/test/include/mockcpp/ChainableMockObjectBase.h @@ -0,0 +1,75 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINABLE_MOCK_OBJECT_BASE_H +#define __MOCKCPP_CHAINABLE_MOCK_OBJECT_BASE_H + +#include + +#include +#include + +#include + +MOCKCPP_NS_START + +struct ChainableMockObjectBaseImpl; +struct InvocationMocker; + + +struct ChainableMockObjectBase + : public InvocationMockerNamespace +{ +public: + + ~ChainableMockObjectBase(); + + const std::string& getName(void) const; + + // InvocationMockerNamespace -- id("id"); + InvocationMocker* getInvocationMocker(const std::string& id) const; + + virtual void verify(); + +protected: + + ChainableMockMethodContainer* getMethodContainer() const; + +protected: + + explicit ChainableMockObjectBase(const std::string& name); + + ChainableMockObjectBase(const ChainableMockObjectBase&); + +private: + + ChainableMockObjectBase& operator=(const ChainableMockObjectBase&); + +protected: + + bool shared; + +private: + + ChainableMockObjectBaseImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ChainingMockHelper.h b/cli/test/include/mockcpp/ChainingMockHelper.h new file mode 100644 index 0000000..5adea69 --- /dev/null +++ b/cli/test/include/mockcpp/ChainingMockHelper.h @@ -0,0 +1,254 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHAINING_MOCK_HELPER_H +#define __MOCKCPP_CHAINING_MOCK_HELPER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +struct Matcher; +struct Stub; + +Matcher* once(); +Matcher* never(); +Matcher* atLeast(unsigned int times); +Matcher* atMost(unsigned int times); +Matcher* exactly(unsigned int times); + +template +Constraint* eq(const T& val) +{ + return new IsEqual(val); +} + +template +Constraint* neq(const T& val) +{ + return new IsNotEqual(val); +} + +template +Constraint* gt(const T& val) +{ + return new IsGreaterThan(val); +} + +template +Constraint* lt(const T& val) +{ + return new IsLessThan(val); +} + +//////////////////////////////////////////////////////////////// +#if 0 +static inline Constraint* eq(const char* s) +{ + return new IsEqual(s); +} +#endif + +template +Constraint* spy(T& val) +{ + return new Spy(val); +} + +template +struct PredictTypeTraits +{ +}; + +template +struct PredictTypeTraits +{ + typedef T ParaType; +}; + +template +Constraint* checkWith(Predict pred) +{ + typedef typename PredictTypeTraits::ParaType T; + return new CheckWith(pred); +} + +//////////////////////////////////////////////////////////////// +template +Constraint* checkWith(bool (*pred)(T)) +{ + return new CheckWith(pred); +} + +//////////////////////////////////////////////////////////////// +template +Constraint* processWith(Proc proc) +{ + typedef typename PredictTypeTraits::ParaType T; + return new ProcessWith(proc); +} + +//////////////////////////////////////////////////////////////// +template +Constraint* processWith(void (*proc)(T)) +{ + return new ProcessWith(proc); +} + +//////////////////////////////////////////////////////////////// +template +Constraint* outBound(const T& val, Constraint* constraint = 0) +{ + return new OutBound(val, constraint); +} + +//////////////////////////////////////////////////////////////// +// outBoundP +//////////////////////////////////////////////////////////////// +template +Constraint* outBoundP(T* p, size_t size, Constraint* constraint = 0) +{ + return new OutBoundPointer(p, size, constraint); +} + +//////////////////////////////////////////////////////////////// +Constraint* outBoundP(void* p, size_t size, Constraint* constraint = 0); + +//////////////////////////////////////////////////////////////// +template +Constraint* outBoundP(T* p, Constraint* constraint = 0) +{ + return new OutBoundPointer(p, sizeof(T), constraint); +} + +/////////////////////////////////////////////////////////////////// +// mirror +/////////////////////////////////////////////////////////////////// +#if defined(__GNUC__) && (__GNUC__ > 3) +template +Constraint* mirror(const T& obj) +{ + return new IsMirror(obj); +} +#endif + +/////////////////////////////////////////////////////////////////// +template +Constraint* mirror(T* p, size_t size = 0) +{ + return new IsMirror(p, size); +} + +/////////////////////////////////////////////////////////////////// +Constraint* mirror(void* p, size_t size); + +#if 0 +Constraint* startWith(char*); +Constraint* startWith(const char*); +Constraint* startWith(unsigned char*); +Constraint* startWith(unsigned const char*); +#endif +Constraint* startWith(const std::string&); + +#if 0 +Constraint* endWith(char*); +Constraint* endWith(const char*); +Constraint* endWith(unsigned char*); +Constraint* endWith(unsigned const char*); +#endif + +Constraint* endWith(const std::string&); + +#if 0 +Constraint* contains(char*); +Constraint* contains(const char*); +Constraint* contains(unsigned char*); +Constraint* contains(unsigned const char*); +#endif + +Constraint* contains(const std::string&); +/////////////////////////////////////////////////////////////////// +// smirror +/////////////////////////////////////////////////////////////////// +Constraint* smirror(char* s); +Constraint* smirror(const char* s); +Constraint* smirror(unsigned char* s); +Constraint* smirror(const unsigned char* s); +/////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////// +Stub* die(int code = 0); + +Stub* returnValue(const Any& val); + +Stub* repeat(const Any& val, unsigned int repeatTimes); + +Stub* ignoreReturnValue(); + +Stub* returnObjectList( const Any& o01 + , const Any& o02 = Any() + , const Any& o03 = Any() + , const Any& o04 = Any() + , const Any& o05 = Any() + , const Any& o06 = Any() + , const Any& o07 = Any() + , const Any& o08 = Any() + , const Any& o09 = Any() + , const Any& o10 = Any() + , const Any& o11 = Any() + , const Any& o12 = Any()); + + +template +Stub* increase(const T& from, const T& to) +{ + return new TypelessStubAdapter(new IncrementStub(from, to)); +} + +template +Stub* increase(const T& from) +{ + return new TypelessStubAdapter(new IncrementStub(from)); +} + +template +Stub* throws(const T& ex) +{ + return new TypelessStubAdapter(new ThrowExceptionStub(ex)); +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/CheckWith.h b/cli/test/include/mockcpp/CheckWith.h new file mode 100644 index 0000000..101b14f --- /dev/null +++ b/cli/test/include/mockcpp/CheckWith.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CHECK_WITH_H +#define __MOCKCPP_CHECK_WITH_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct CheckWith : public Constraint +{ + CheckWith(Predict pred) + : predict(pred) + {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + + return predict(any_cast(val)); + } + + std::string toString() const + { + return std::string("check(") + + MOCKCPP_NS::toTypeAndValueString(predict) + + std::string(")"); + } + +private: + + mutable Predict predict; +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/CodeModifier.h b/cli/test/include/mockcpp/CodeModifier.h new file mode 100644 index 0000000..212350b --- /dev/null +++ b/cli/test/include/mockcpp/CodeModifier.h @@ -0,0 +1,35 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2010> + + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CODEMODIFIER_H__ +#define __MOCKCPP_CODEMODIFIER_H__ + +#include + +MOCKCPP_NS_START + +struct CodeModifier +{ + // @TODO: 在modify里面加入Cache刷新 + static bool modify(void *dest, const void *src, size_t size); +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/Constraint.h b/cli/test/include/mockcpp/Constraint.h new file mode 100644 index 0000000..6e33961 --- /dev/null +++ b/cli/test/include/mockcpp/Constraint.h @@ -0,0 +1,40 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CONSTRAINT_H +#define __MOCKCPP_CONSTRAINT_H + +#include +#include + +MOCKCPP_NS_START + +struct RefAny; + +struct Constraint +{ + virtual ~Constraint() {} + + virtual bool eval(const RefAny& inv) const = 0; + virtual std::string toString() const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ConstraintSet.h b/cli/test/include/mockcpp/ConstraintSet.h new file mode 100644 index 0000000..4f65813 --- /dev/null +++ b/cli/test/include/mockcpp/ConstraintSet.h @@ -0,0 +1,64 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_CONSTRAINT_SET_H +#define __MOCKCPP_CONSTRAINT_SET_H + +#include +#include +#include + +MOCKCPP_NS_START + +struct Invocation; +struct Constraint; +struct ConstraintSetImpl; + +struct ConstraintSet: public StatelessMatcher +{ + ConstraintSet( Constraint* p01 = any() + , Constraint* p02 = any() + , Constraint* p03 = any() + , Constraint* p04 = any() + , Constraint* p05 = any() + , Constraint* p06 = any() + , Constraint* p07 = any() + , Constraint* p08 = any() + , Constraint* p09 = any() + , Constraint* p10 = any() + , Constraint* p11 = any() + , Constraint* p12 = any() + ); + + ~ConstraintSet(); + + virtual bool matches(const Invocation& inv) const; + + virtual std::string toString() const; + + virtual void verify(void); + +private: + + ConstraintSetImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DecoratedConstraint.h b/cli/test/include/mockcpp/DecoratedConstraint.h new file mode 100644 index 0000000..aa67e18 --- /dev/null +++ b/cli/test/include/mockcpp/DecoratedConstraint.h @@ -0,0 +1,57 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DECORATED_CONSTRAINT_H +#define __MOCKCPP_DECORATED_CONSTRAINT_H + +#include +#include + +MOCKCPP_NS_START + + +struct DecoratedConstraint : public Constraint +{ + DecoratedConstraint(Constraint* constraint); + + ~DecoratedConstraint(); + + bool eval(const RefAny& val) const; + std::string toString() const; + + virtual bool evalSelf(const RefAny& val) const = 0; + virtual std::string getName() const = 0; + virtual std::string getTypeAndValueString() const = 0; + +protected: + + bool hasDecoratedConstraint() const; + +private: + + std::string getDecoratedConstraintString() const; + +private: + + Constraint* decoratedConstraint; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DefaultBuilder.h b/cli/test/include/mockcpp/DefaultBuilder.h new file mode 100644 index 0000000..e056998 --- /dev/null +++ b/cli/test/include/mockcpp/DefaultBuilder.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DEFAULT_BUIDLER_H_ +#define __MOCKCPP_DEFAULT_BUIDLER_H_ + +#include + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +typedef InvocationMockBuilder< + CallerMatchBuilder< + ArgumentsMatchBuilder< + StubBuilder< + MoreStubBuilder<> + > + > + > + > DefaultBuilder; +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DefaultMatcher.h b/cli/test/include/mockcpp/DefaultMatcher.h new file mode 100644 index 0000000..bcd1236 --- /dev/null +++ b/cli/test/include/mockcpp/DefaultMatcher.h @@ -0,0 +1,40 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DEFAULT_MATCHER_H +#define __MOCKCPP_DEFAULT_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct Invocation; + +struct DefaultMatcher : public Matcher +{ + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + void verify(); + std::string toString() const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h new file mode 100644 index 0000000..f5bf5fd --- /dev/null +++ b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h @@ -0,0 +1,500 @@ +MOCKCPP_SET_DEFAULT_METHOD(0, 0); +MOCKCPP_SET_DEFAULT_METHOD(0, 1); +MOCKCPP_SET_DEFAULT_METHOD(0, 2); +MOCKCPP_SET_DEFAULT_METHOD(0, 3); +MOCKCPP_SET_DEFAULT_METHOD(0, 4); +MOCKCPP_SET_DEFAULT_METHOD(0, 5); +MOCKCPP_SET_DEFAULT_METHOD(0, 6); +MOCKCPP_SET_DEFAULT_METHOD(0, 7); +MOCKCPP_SET_DEFAULT_METHOD(0, 8); +MOCKCPP_SET_DEFAULT_METHOD(0, 9); +MOCKCPP_SET_DEFAULT_METHOD(0, 10); +MOCKCPP_SET_DEFAULT_METHOD(0, 11); +MOCKCPP_SET_DEFAULT_METHOD(0, 12); +MOCKCPP_SET_DEFAULT_METHOD(0, 13); +MOCKCPP_SET_DEFAULT_METHOD(0, 14); +MOCKCPP_SET_DEFAULT_METHOD(0, 15); +MOCKCPP_SET_DEFAULT_METHOD(0, 16); +MOCKCPP_SET_DEFAULT_METHOD(0, 17); +MOCKCPP_SET_DEFAULT_METHOD(0, 18); +MOCKCPP_SET_DEFAULT_METHOD(0, 19); +MOCKCPP_SET_DEFAULT_METHOD(0, 20); +MOCKCPP_SET_DEFAULT_METHOD(0, 21); +MOCKCPP_SET_DEFAULT_METHOD(0, 22); +MOCKCPP_SET_DEFAULT_METHOD(0, 23); +MOCKCPP_SET_DEFAULT_METHOD(0, 24); +MOCKCPP_SET_DEFAULT_METHOD(0, 25); +MOCKCPP_SET_DEFAULT_METHOD(0, 26); +MOCKCPP_SET_DEFAULT_METHOD(0, 27); +MOCKCPP_SET_DEFAULT_METHOD(0, 28); +MOCKCPP_SET_DEFAULT_METHOD(0, 29); +MOCKCPP_SET_DEFAULT_METHOD(0, 30); +MOCKCPP_SET_DEFAULT_METHOD(0, 31); +MOCKCPP_SET_DEFAULT_METHOD(0, 32); +MOCKCPP_SET_DEFAULT_METHOD(0, 33); +MOCKCPP_SET_DEFAULT_METHOD(0, 34); +MOCKCPP_SET_DEFAULT_METHOD(0, 35); +MOCKCPP_SET_DEFAULT_METHOD(0, 36); +MOCKCPP_SET_DEFAULT_METHOD(0, 37); +MOCKCPP_SET_DEFAULT_METHOD(0, 38); +MOCKCPP_SET_DEFAULT_METHOD(0, 39); +MOCKCPP_SET_DEFAULT_METHOD(0, 40); +MOCKCPP_SET_DEFAULT_METHOD(0, 41); +MOCKCPP_SET_DEFAULT_METHOD(0, 42); +MOCKCPP_SET_DEFAULT_METHOD(0, 43); +MOCKCPP_SET_DEFAULT_METHOD(0, 44); +MOCKCPP_SET_DEFAULT_METHOD(0, 45); +MOCKCPP_SET_DEFAULT_METHOD(0, 46); +MOCKCPP_SET_DEFAULT_METHOD(0, 47); +MOCKCPP_SET_DEFAULT_METHOD(0, 48); +MOCKCPP_SET_DEFAULT_METHOD(0, 49); +MOCKCPP_SET_DEFAULT_METHOD(0, 50); +MOCKCPP_SET_DEFAULT_METHOD(0, 51); +MOCKCPP_SET_DEFAULT_METHOD(0, 52); +MOCKCPP_SET_DEFAULT_METHOD(0, 53); +MOCKCPP_SET_DEFAULT_METHOD(0, 54); +MOCKCPP_SET_DEFAULT_METHOD(0, 55); +MOCKCPP_SET_DEFAULT_METHOD(0, 56); +MOCKCPP_SET_DEFAULT_METHOD(0, 57); +MOCKCPP_SET_DEFAULT_METHOD(0, 58); +MOCKCPP_SET_DEFAULT_METHOD(0, 59); +MOCKCPP_SET_DEFAULT_METHOD(0, 60); +MOCKCPP_SET_DEFAULT_METHOD(0, 61); +MOCKCPP_SET_DEFAULT_METHOD(0, 62); +MOCKCPP_SET_DEFAULT_METHOD(0, 63); +MOCKCPP_SET_DEFAULT_METHOD(0, 64); +MOCKCPP_SET_DEFAULT_METHOD(0, 65); +MOCKCPP_SET_DEFAULT_METHOD(0, 66); +MOCKCPP_SET_DEFAULT_METHOD(0, 67); +MOCKCPP_SET_DEFAULT_METHOD(0, 68); +MOCKCPP_SET_DEFAULT_METHOD(0, 69); +MOCKCPP_SET_DEFAULT_METHOD(0, 70); +MOCKCPP_SET_DEFAULT_METHOD(0, 71); +MOCKCPP_SET_DEFAULT_METHOD(0, 72); +MOCKCPP_SET_DEFAULT_METHOD(0, 73); +MOCKCPP_SET_DEFAULT_METHOD(0, 74); +MOCKCPP_SET_DEFAULT_METHOD(0, 75); +MOCKCPP_SET_DEFAULT_METHOD(0, 76); +MOCKCPP_SET_DEFAULT_METHOD(0, 77); +MOCKCPP_SET_DEFAULT_METHOD(0, 78); +MOCKCPP_SET_DEFAULT_METHOD(0, 79); +MOCKCPP_SET_DEFAULT_METHOD(0, 80); +MOCKCPP_SET_DEFAULT_METHOD(0, 81); +MOCKCPP_SET_DEFAULT_METHOD(0, 82); +MOCKCPP_SET_DEFAULT_METHOD(0, 83); +MOCKCPP_SET_DEFAULT_METHOD(0, 84); +MOCKCPP_SET_DEFAULT_METHOD(0, 85); +MOCKCPP_SET_DEFAULT_METHOD(0, 86); +MOCKCPP_SET_DEFAULT_METHOD(0, 87); +MOCKCPP_SET_DEFAULT_METHOD(0, 88); +MOCKCPP_SET_DEFAULT_METHOD(0, 89); +MOCKCPP_SET_DEFAULT_METHOD(0, 90); +MOCKCPP_SET_DEFAULT_METHOD(0, 91); +MOCKCPP_SET_DEFAULT_METHOD(0, 92); +MOCKCPP_SET_DEFAULT_METHOD(0, 93); +MOCKCPP_SET_DEFAULT_METHOD(0, 94); +MOCKCPP_SET_DEFAULT_METHOD(0, 95); +MOCKCPP_SET_DEFAULT_METHOD(0, 96); +MOCKCPP_SET_DEFAULT_METHOD(0, 97); +MOCKCPP_SET_DEFAULT_METHOD(0, 98); +MOCKCPP_SET_DEFAULT_METHOD(0, 99); +MOCKCPP_SET_DEFAULT_METHOD(1, 0); +MOCKCPP_SET_DEFAULT_METHOD(1, 1); +MOCKCPP_SET_DEFAULT_METHOD(1, 2); +MOCKCPP_SET_DEFAULT_METHOD(1, 3); +MOCKCPP_SET_DEFAULT_METHOD(1, 4); +MOCKCPP_SET_DEFAULT_METHOD(1, 5); +MOCKCPP_SET_DEFAULT_METHOD(1, 6); +MOCKCPP_SET_DEFAULT_METHOD(1, 7); +MOCKCPP_SET_DEFAULT_METHOD(1, 8); +MOCKCPP_SET_DEFAULT_METHOD(1, 9); +MOCKCPP_SET_DEFAULT_METHOD(1, 10); +MOCKCPP_SET_DEFAULT_METHOD(1, 11); +MOCKCPP_SET_DEFAULT_METHOD(1, 12); +MOCKCPP_SET_DEFAULT_METHOD(1, 13); +MOCKCPP_SET_DEFAULT_METHOD(1, 14); +MOCKCPP_SET_DEFAULT_METHOD(1, 15); +MOCKCPP_SET_DEFAULT_METHOD(1, 16); +MOCKCPP_SET_DEFAULT_METHOD(1, 17); +MOCKCPP_SET_DEFAULT_METHOD(1, 18); +MOCKCPP_SET_DEFAULT_METHOD(1, 19); +MOCKCPP_SET_DEFAULT_METHOD(1, 20); +MOCKCPP_SET_DEFAULT_METHOD(1, 21); +MOCKCPP_SET_DEFAULT_METHOD(1, 22); +MOCKCPP_SET_DEFAULT_METHOD(1, 23); +MOCKCPP_SET_DEFAULT_METHOD(1, 24); +MOCKCPP_SET_DEFAULT_METHOD(1, 25); +MOCKCPP_SET_DEFAULT_METHOD(1, 26); +MOCKCPP_SET_DEFAULT_METHOD(1, 27); +MOCKCPP_SET_DEFAULT_METHOD(1, 28); +MOCKCPP_SET_DEFAULT_METHOD(1, 29); +MOCKCPP_SET_DEFAULT_METHOD(1, 30); +MOCKCPP_SET_DEFAULT_METHOD(1, 31); +MOCKCPP_SET_DEFAULT_METHOD(1, 32); +MOCKCPP_SET_DEFAULT_METHOD(1, 33); +MOCKCPP_SET_DEFAULT_METHOD(1, 34); +MOCKCPP_SET_DEFAULT_METHOD(1, 35); +MOCKCPP_SET_DEFAULT_METHOD(1, 36); +MOCKCPP_SET_DEFAULT_METHOD(1, 37); +MOCKCPP_SET_DEFAULT_METHOD(1, 38); +MOCKCPP_SET_DEFAULT_METHOD(1, 39); +MOCKCPP_SET_DEFAULT_METHOD(1, 40); +MOCKCPP_SET_DEFAULT_METHOD(1, 41); +MOCKCPP_SET_DEFAULT_METHOD(1, 42); +MOCKCPP_SET_DEFAULT_METHOD(1, 43); +MOCKCPP_SET_DEFAULT_METHOD(1, 44); +MOCKCPP_SET_DEFAULT_METHOD(1, 45); +MOCKCPP_SET_DEFAULT_METHOD(1, 46); +MOCKCPP_SET_DEFAULT_METHOD(1, 47); +MOCKCPP_SET_DEFAULT_METHOD(1, 48); +MOCKCPP_SET_DEFAULT_METHOD(1, 49); +MOCKCPP_SET_DEFAULT_METHOD(1, 50); +MOCKCPP_SET_DEFAULT_METHOD(1, 51); +MOCKCPP_SET_DEFAULT_METHOD(1, 52); +MOCKCPP_SET_DEFAULT_METHOD(1, 53); +MOCKCPP_SET_DEFAULT_METHOD(1, 54); +MOCKCPP_SET_DEFAULT_METHOD(1, 55); +MOCKCPP_SET_DEFAULT_METHOD(1, 56); +MOCKCPP_SET_DEFAULT_METHOD(1, 57); +MOCKCPP_SET_DEFAULT_METHOD(1, 58); +MOCKCPP_SET_DEFAULT_METHOD(1, 59); +MOCKCPP_SET_DEFAULT_METHOD(1, 60); +MOCKCPP_SET_DEFAULT_METHOD(1, 61); +MOCKCPP_SET_DEFAULT_METHOD(1, 62); +MOCKCPP_SET_DEFAULT_METHOD(1, 63); +MOCKCPP_SET_DEFAULT_METHOD(1, 64); +MOCKCPP_SET_DEFAULT_METHOD(1, 65); +MOCKCPP_SET_DEFAULT_METHOD(1, 66); +MOCKCPP_SET_DEFAULT_METHOD(1, 67); +MOCKCPP_SET_DEFAULT_METHOD(1, 68); +MOCKCPP_SET_DEFAULT_METHOD(1, 69); +MOCKCPP_SET_DEFAULT_METHOD(1, 70); +MOCKCPP_SET_DEFAULT_METHOD(1, 71); +MOCKCPP_SET_DEFAULT_METHOD(1, 72); +MOCKCPP_SET_DEFAULT_METHOD(1, 73); +MOCKCPP_SET_DEFAULT_METHOD(1, 74); +MOCKCPP_SET_DEFAULT_METHOD(1, 75); +MOCKCPP_SET_DEFAULT_METHOD(1, 76); +MOCKCPP_SET_DEFAULT_METHOD(1, 77); +MOCKCPP_SET_DEFAULT_METHOD(1, 78); +MOCKCPP_SET_DEFAULT_METHOD(1, 79); +MOCKCPP_SET_DEFAULT_METHOD(1, 80); +MOCKCPP_SET_DEFAULT_METHOD(1, 81); +MOCKCPP_SET_DEFAULT_METHOD(1, 82); +MOCKCPP_SET_DEFAULT_METHOD(1, 83); +MOCKCPP_SET_DEFAULT_METHOD(1, 84); +MOCKCPP_SET_DEFAULT_METHOD(1, 85); +MOCKCPP_SET_DEFAULT_METHOD(1, 86); +MOCKCPP_SET_DEFAULT_METHOD(1, 87); +MOCKCPP_SET_DEFAULT_METHOD(1, 88); +MOCKCPP_SET_DEFAULT_METHOD(1, 89); +MOCKCPP_SET_DEFAULT_METHOD(1, 90); +MOCKCPP_SET_DEFAULT_METHOD(1, 91); +MOCKCPP_SET_DEFAULT_METHOD(1, 92); +MOCKCPP_SET_DEFAULT_METHOD(1, 93); +MOCKCPP_SET_DEFAULT_METHOD(1, 94); +MOCKCPP_SET_DEFAULT_METHOD(1, 95); +MOCKCPP_SET_DEFAULT_METHOD(1, 96); +MOCKCPP_SET_DEFAULT_METHOD(1, 97); +MOCKCPP_SET_DEFAULT_METHOD(1, 98); +MOCKCPP_SET_DEFAULT_METHOD(1, 99); +MOCKCPP_SET_DEFAULT_METHOD(2, 0); +MOCKCPP_SET_DEFAULT_METHOD(2, 1); +MOCKCPP_SET_DEFAULT_METHOD(2, 2); +MOCKCPP_SET_DEFAULT_METHOD(2, 3); +MOCKCPP_SET_DEFAULT_METHOD(2, 4); +MOCKCPP_SET_DEFAULT_METHOD(2, 5); +MOCKCPP_SET_DEFAULT_METHOD(2, 6); +MOCKCPP_SET_DEFAULT_METHOD(2, 7); +MOCKCPP_SET_DEFAULT_METHOD(2, 8); +MOCKCPP_SET_DEFAULT_METHOD(2, 9); +MOCKCPP_SET_DEFAULT_METHOD(2, 10); +MOCKCPP_SET_DEFAULT_METHOD(2, 11); +MOCKCPP_SET_DEFAULT_METHOD(2, 12); +MOCKCPP_SET_DEFAULT_METHOD(2, 13); +MOCKCPP_SET_DEFAULT_METHOD(2, 14); +MOCKCPP_SET_DEFAULT_METHOD(2, 15); +MOCKCPP_SET_DEFAULT_METHOD(2, 16); +MOCKCPP_SET_DEFAULT_METHOD(2, 17); +MOCKCPP_SET_DEFAULT_METHOD(2, 18); +MOCKCPP_SET_DEFAULT_METHOD(2, 19); +MOCKCPP_SET_DEFAULT_METHOD(2, 20); +MOCKCPP_SET_DEFAULT_METHOD(2, 21); +MOCKCPP_SET_DEFAULT_METHOD(2, 22); +MOCKCPP_SET_DEFAULT_METHOD(2, 23); +MOCKCPP_SET_DEFAULT_METHOD(2, 24); +MOCKCPP_SET_DEFAULT_METHOD(2, 25); +MOCKCPP_SET_DEFAULT_METHOD(2, 26); +MOCKCPP_SET_DEFAULT_METHOD(2, 27); +MOCKCPP_SET_DEFAULT_METHOD(2, 28); +MOCKCPP_SET_DEFAULT_METHOD(2, 29); +MOCKCPP_SET_DEFAULT_METHOD(2, 30); +MOCKCPP_SET_DEFAULT_METHOD(2, 31); +MOCKCPP_SET_DEFAULT_METHOD(2, 32); +MOCKCPP_SET_DEFAULT_METHOD(2, 33); +MOCKCPP_SET_DEFAULT_METHOD(2, 34); +MOCKCPP_SET_DEFAULT_METHOD(2, 35); +MOCKCPP_SET_DEFAULT_METHOD(2, 36); +MOCKCPP_SET_DEFAULT_METHOD(2, 37); +MOCKCPP_SET_DEFAULT_METHOD(2, 38); +MOCKCPP_SET_DEFAULT_METHOD(2, 39); +MOCKCPP_SET_DEFAULT_METHOD(2, 40); +MOCKCPP_SET_DEFAULT_METHOD(2, 41); +MOCKCPP_SET_DEFAULT_METHOD(2, 42); +MOCKCPP_SET_DEFAULT_METHOD(2, 43); +MOCKCPP_SET_DEFAULT_METHOD(2, 44); +MOCKCPP_SET_DEFAULT_METHOD(2, 45); +MOCKCPP_SET_DEFAULT_METHOD(2, 46); +MOCKCPP_SET_DEFAULT_METHOD(2, 47); +MOCKCPP_SET_DEFAULT_METHOD(2, 48); +MOCKCPP_SET_DEFAULT_METHOD(2, 49); +MOCKCPP_SET_DEFAULT_METHOD(2, 50); +MOCKCPP_SET_DEFAULT_METHOD(2, 51); +MOCKCPP_SET_DEFAULT_METHOD(2, 52); +MOCKCPP_SET_DEFAULT_METHOD(2, 53); +MOCKCPP_SET_DEFAULT_METHOD(2, 54); +MOCKCPP_SET_DEFAULT_METHOD(2, 55); +MOCKCPP_SET_DEFAULT_METHOD(2, 56); +MOCKCPP_SET_DEFAULT_METHOD(2, 57); +MOCKCPP_SET_DEFAULT_METHOD(2, 58); +MOCKCPP_SET_DEFAULT_METHOD(2, 59); +MOCKCPP_SET_DEFAULT_METHOD(2, 60); +MOCKCPP_SET_DEFAULT_METHOD(2, 61); +MOCKCPP_SET_DEFAULT_METHOD(2, 62); +MOCKCPP_SET_DEFAULT_METHOD(2, 63); +MOCKCPP_SET_DEFAULT_METHOD(2, 64); +MOCKCPP_SET_DEFAULT_METHOD(2, 65); +MOCKCPP_SET_DEFAULT_METHOD(2, 66); +MOCKCPP_SET_DEFAULT_METHOD(2, 67); +MOCKCPP_SET_DEFAULT_METHOD(2, 68); +MOCKCPP_SET_DEFAULT_METHOD(2, 69); +MOCKCPP_SET_DEFAULT_METHOD(2, 70); +MOCKCPP_SET_DEFAULT_METHOD(2, 71); +MOCKCPP_SET_DEFAULT_METHOD(2, 72); +MOCKCPP_SET_DEFAULT_METHOD(2, 73); +MOCKCPP_SET_DEFAULT_METHOD(2, 74); +MOCKCPP_SET_DEFAULT_METHOD(2, 75); +MOCKCPP_SET_DEFAULT_METHOD(2, 76); +MOCKCPP_SET_DEFAULT_METHOD(2, 77); +MOCKCPP_SET_DEFAULT_METHOD(2, 78); +MOCKCPP_SET_DEFAULT_METHOD(2, 79); +MOCKCPP_SET_DEFAULT_METHOD(2, 80); +MOCKCPP_SET_DEFAULT_METHOD(2, 81); +MOCKCPP_SET_DEFAULT_METHOD(2, 82); +MOCKCPP_SET_DEFAULT_METHOD(2, 83); +MOCKCPP_SET_DEFAULT_METHOD(2, 84); +MOCKCPP_SET_DEFAULT_METHOD(2, 85); +MOCKCPP_SET_DEFAULT_METHOD(2, 86); +MOCKCPP_SET_DEFAULT_METHOD(2, 87); +MOCKCPP_SET_DEFAULT_METHOD(2, 88); +MOCKCPP_SET_DEFAULT_METHOD(2, 89); +MOCKCPP_SET_DEFAULT_METHOD(2, 90); +MOCKCPP_SET_DEFAULT_METHOD(2, 91); +MOCKCPP_SET_DEFAULT_METHOD(2, 92); +MOCKCPP_SET_DEFAULT_METHOD(2, 93); +MOCKCPP_SET_DEFAULT_METHOD(2, 94); +MOCKCPP_SET_DEFAULT_METHOD(2, 95); +MOCKCPP_SET_DEFAULT_METHOD(2, 96); +MOCKCPP_SET_DEFAULT_METHOD(2, 97); +MOCKCPP_SET_DEFAULT_METHOD(2, 98); +MOCKCPP_SET_DEFAULT_METHOD(2, 99); +MOCKCPP_SET_DEFAULT_METHOD(3, 0); +MOCKCPP_SET_DEFAULT_METHOD(3, 1); +MOCKCPP_SET_DEFAULT_METHOD(3, 2); +MOCKCPP_SET_DEFAULT_METHOD(3, 3); +MOCKCPP_SET_DEFAULT_METHOD(3, 4); +MOCKCPP_SET_DEFAULT_METHOD(3, 5); +MOCKCPP_SET_DEFAULT_METHOD(3, 6); +MOCKCPP_SET_DEFAULT_METHOD(3, 7); +MOCKCPP_SET_DEFAULT_METHOD(3, 8); +MOCKCPP_SET_DEFAULT_METHOD(3, 9); +MOCKCPP_SET_DEFAULT_METHOD(3, 10); +MOCKCPP_SET_DEFAULT_METHOD(3, 11); +MOCKCPP_SET_DEFAULT_METHOD(3, 12); +MOCKCPP_SET_DEFAULT_METHOD(3, 13); +MOCKCPP_SET_DEFAULT_METHOD(3, 14); +MOCKCPP_SET_DEFAULT_METHOD(3, 15); +MOCKCPP_SET_DEFAULT_METHOD(3, 16); +MOCKCPP_SET_DEFAULT_METHOD(3, 17); +MOCKCPP_SET_DEFAULT_METHOD(3, 18); +MOCKCPP_SET_DEFAULT_METHOD(3, 19); +MOCKCPP_SET_DEFAULT_METHOD(3, 20); +MOCKCPP_SET_DEFAULT_METHOD(3, 21); +MOCKCPP_SET_DEFAULT_METHOD(3, 22); +MOCKCPP_SET_DEFAULT_METHOD(3, 23); +MOCKCPP_SET_DEFAULT_METHOD(3, 24); +MOCKCPP_SET_DEFAULT_METHOD(3, 25); +MOCKCPP_SET_DEFAULT_METHOD(3, 26); +MOCKCPP_SET_DEFAULT_METHOD(3, 27); +MOCKCPP_SET_DEFAULT_METHOD(3, 28); +MOCKCPP_SET_DEFAULT_METHOD(3, 29); +MOCKCPP_SET_DEFAULT_METHOD(3, 30); +MOCKCPP_SET_DEFAULT_METHOD(3, 31); +MOCKCPP_SET_DEFAULT_METHOD(3, 32); +MOCKCPP_SET_DEFAULT_METHOD(3, 33); +MOCKCPP_SET_DEFAULT_METHOD(3, 34); +MOCKCPP_SET_DEFAULT_METHOD(3, 35); +MOCKCPP_SET_DEFAULT_METHOD(3, 36); +MOCKCPP_SET_DEFAULT_METHOD(3, 37); +MOCKCPP_SET_DEFAULT_METHOD(3, 38); +MOCKCPP_SET_DEFAULT_METHOD(3, 39); +MOCKCPP_SET_DEFAULT_METHOD(3, 40); +MOCKCPP_SET_DEFAULT_METHOD(3, 41); +MOCKCPP_SET_DEFAULT_METHOD(3, 42); +MOCKCPP_SET_DEFAULT_METHOD(3, 43); +MOCKCPP_SET_DEFAULT_METHOD(3, 44); +MOCKCPP_SET_DEFAULT_METHOD(3, 45); +MOCKCPP_SET_DEFAULT_METHOD(3, 46); +MOCKCPP_SET_DEFAULT_METHOD(3, 47); +MOCKCPP_SET_DEFAULT_METHOD(3, 48); +MOCKCPP_SET_DEFAULT_METHOD(3, 49); +MOCKCPP_SET_DEFAULT_METHOD(3, 50); +MOCKCPP_SET_DEFAULT_METHOD(3, 51); +MOCKCPP_SET_DEFAULT_METHOD(3, 52); +MOCKCPP_SET_DEFAULT_METHOD(3, 53); +MOCKCPP_SET_DEFAULT_METHOD(3, 54); +MOCKCPP_SET_DEFAULT_METHOD(3, 55); +MOCKCPP_SET_DEFAULT_METHOD(3, 56); +MOCKCPP_SET_DEFAULT_METHOD(3, 57); +MOCKCPP_SET_DEFAULT_METHOD(3, 58); +MOCKCPP_SET_DEFAULT_METHOD(3, 59); +MOCKCPP_SET_DEFAULT_METHOD(3, 60); +MOCKCPP_SET_DEFAULT_METHOD(3, 61); +MOCKCPP_SET_DEFAULT_METHOD(3, 62); +MOCKCPP_SET_DEFAULT_METHOD(3, 63); +MOCKCPP_SET_DEFAULT_METHOD(3, 64); +MOCKCPP_SET_DEFAULT_METHOD(3, 65); +MOCKCPP_SET_DEFAULT_METHOD(3, 66); +MOCKCPP_SET_DEFAULT_METHOD(3, 67); +MOCKCPP_SET_DEFAULT_METHOD(3, 68); +MOCKCPP_SET_DEFAULT_METHOD(3, 69); +MOCKCPP_SET_DEFAULT_METHOD(3, 70); +MOCKCPP_SET_DEFAULT_METHOD(3, 71); +MOCKCPP_SET_DEFAULT_METHOD(3, 72); +MOCKCPP_SET_DEFAULT_METHOD(3, 73); +MOCKCPP_SET_DEFAULT_METHOD(3, 74); +MOCKCPP_SET_DEFAULT_METHOD(3, 75); +MOCKCPP_SET_DEFAULT_METHOD(3, 76); +MOCKCPP_SET_DEFAULT_METHOD(3, 77); +MOCKCPP_SET_DEFAULT_METHOD(3, 78); +MOCKCPP_SET_DEFAULT_METHOD(3, 79); +MOCKCPP_SET_DEFAULT_METHOD(3, 80); +MOCKCPP_SET_DEFAULT_METHOD(3, 81); +MOCKCPP_SET_DEFAULT_METHOD(3, 82); +MOCKCPP_SET_DEFAULT_METHOD(3, 83); +MOCKCPP_SET_DEFAULT_METHOD(3, 84); +MOCKCPP_SET_DEFAULT_METHOD(3, 85); +MOCKCPP_SET_DEFAULT_METHOD(3, 86); +MOCKCPP_SET_DEFAULT_METHOD(3, 87); +MOCKCPP_SET_DEFAULT_METHOD(3, 88); +MOCKCPP_SET_DEFAULT_METHOD(3, 89); +MOCKCPP_SET_DEFAULT_METHOD(3, 90); +MOCKCPP_SET_DEFAULT_METHOD(3, 91); +MOCKCPP_SET_DEFAULT_METHOD(3, 92); +MOCKCPP_SET_DEFAULT_METHOD(3, 93); +MOCKCPP_SET_DEFAULT_METHOD(3, 94); +MOCKCPP_SET_DEFAULT_METHOD(3, 95); +MOCKCPP_SET_DEFAULT_METHOD(3, 96); +MOCKCPP_SET_DEFAULT_METHOD(3, 97); +MOCKCPP_SET_DEFAULT_METHOD(3, 98); +MOCKCPP_SET_DEFAULT_METHOD(3, 99); +MOCKCPP_SET_DEFAULT_METHOD(4, 0); +MOCKCPP_SET_DEFAULT_METHOD(4, 1); +MOCKCPP_SET_DEFAULT_METHOD(4, 2); +MOCKCPP_SET_DEFAULT_METHOD(4, 3); +MOCKCPP_SET_DEFAULT_METHOD(4, 4); +MOCKCPP_SET_DEFAULT_METHOD(4, 5); +MOCKCPP_SET_DEFAULT_METHOD(4, 6); +MOCKCPP_SET_DEFAULT_METHOD(4, 7); +MOCKCPP_SET_DEFAULT_METHOD(4, 8); +MOCKCPP_SET_DEFAULT_METHOD(4, 9); +MOCKCPP_SET_DEFAULT_METHOD(4, 10); +MOCKCPP_SET_DEFAULT_METHOD(4, 11); +MOCKCPP_SET_DEFAULT_METHOD(4, 12); +MOCKCPP_SET_DEFAULT_METHOD(4, 13); +MOCKCPP_SET_DEFAULT_METHOD(4, 14); +MOCKCPP_SET_DEFAULT_METHOD(4, 15); +MOCKCPP_SET_DEFAULT_METHOD(4, 16); +MOCKCPP_SET_DEFAULT_METHOD(4, 17); +MOCKCPP_SET_DEFAULT_METHOD(4, 18); +MOCKCPP_SET_DEFAULT_METHOD(4, 19); +MOCKCPP_SET_DEFAULT_METHOD(4, 20); +MOCKCPP_SET_DEFAULT_METHOD(4, 21); +MOCKCPP_SET_DEFAULT_METHOD(4, 22); +MOCKCPP_SET_DEFAULT_METHOD(4, 23); +MOCKCPP_SET_DEFAULT_METHOD(4, 24); +MOCKCPP_SET_DEFAULT_METHOD(4, 25); +MOCKCPP_SET_DEFAULT_METHOD(4, 26); +MOCKCPP_SET_DEFAULT_METHOD(4, 27); +MOCKCPP_SET_DEFAULT_METHOD(4, 28); +MOCKCPP_SET_DEFAULT_METHOD(4, 29); +MOCKCPP_SET_DEFAULT_METHOD(4, 30); +MOCKCPP_SET_DEFAULT_METHOD(4, 31); +MOCKCPP_SET_DEFAULT_METHOD(4, 32); +MOCKCPP_SET_DEFAULT_METHOD(4, 33); +MOCKCPP_SET_DEFAULT_METHOD(4, 34); +MOCKCPP_SET_DEFAULT_METHOD(4, 35); +MOCKCPP_SET_DEFAULT_METHOD(4, 36); +MOCKCPP_SET_DEFAULT_METHOD(4, 37); +MOCKCPP_SET_DEFAULT_METHOD(4, 38); +MOCKCPP_SET_DEFAULT_METHOD(4, 39); +MOCKCPP_SET_DEFAULT_METHOD(4, 40); +MOCKCPP_SET_DEFAULT_METHOD(4, 41); +MOCKCPP_SET_DEFAULT_METHOD(4, 42); +MOCKCPP_SET_DEFAULT_METHOD(4, 43); +MOCKCPP_SET_DEFAULT_METHOD(4, 44); +MOCKCPP_SET_DEFAULT_METHOD(4, 45); +MOCKCPP_SET_DEFAULT_METHOD(4, 46); +MOCKCPP_SET_DEFAULT_METHOD(4, 47); +MOCKCPP_SET_DEFAULT_METHOD(4, 48); +MOCKCPP_SET_DEFAULT_METHOD(4, 49); +MOCKCPP_SET_DEFAULT_METHOD(4, 50); +MOCKCPP_SET_DEFAULT_METHOD(4, 51); +MOCKCPP_SET_DEFAULT_METHOD(4, 52); +MOCKCPP_SET_DEFAULT_METHOD(4, 53); +MOCKCPP_SET_DEFAULT_METHOD(4, 54); +MOCKCPP_SET_DEFAULT_METHOD(4, 55); +MOCKCPP_SET_DEFAULT_METHOD(4, 56); +MOCKCPP_SET_DEFAULT_METHOD(4, 57); +MOCKCPP_SET_DEFAULT_METHOD(4, 58); +MOCKCPP_SET_DEFAULT_METHOD(4, 59); +MOCKCPP_SET_DEFAULT_METHOD(4, 60); +MOCKCPP_SET_DEFAULT_METHOD(4, 61); +MOCKCPP_SET_DEFAULT_METHOD(4, 62); +MOCKCPP_SET_DEFAULT_METHOD(4, 63); +MOCKCPP_SET_DEFAULT_METHOD(4, 64); +MOCKCPP_SET_DEFAULT_METHOD(4, 65); +MOCKCPP_SET_DEFAULT_METHOD(4, 66); +MOCKCPP_SET_DEFAULT_METHOD(4, 67); +MOCKCPP_SET_DEFAULT_METHOD(4, 68); +MOCKCPP_SET_DEFAULT_METHOD(4, 69); +MOCKCPP_SET_DEFAULT_METHOD(4, 70); +MOCKCPP_SET_DEFAULT_METHOD(4, 71); +MOCKCPP_SET_DEFAULT_METHOD(4, 72); +MOCKCPP_SET_DEFAULT_METHOD(4, 73); +MOCKCPP_SET_DEFAULT_METHOD(4, 74); +MOCKCPP_SET_DEFAULT_METHOD(4, 75); +MOCKCPP_SET_DEFAULT_METHOD(4, 76); +MOCKCPP_SET_DEFAULT_METHOD(4, 77); +MOCKCPP_SET_DEFAULT_METHOD(4, 78); +MOCKCPP_SET_DEFAULT_METHOD(4, 79); +MOCKCPP_SET_DEFAULT_METHOD(4, 80); +MOCKCPP_SET_DEFAULT_METHOD(4, 81); +MOCKCPP_SET_DEFAULT_METHOD(4, 82); +MOCKCPP_SET_DEFAULT_METHOD(4, 83); +MOCKCPP_SET_DEFAULT_METHOD(4, 84); +MOCKCPP_SET_DEFAULT_METHOD(4, 85); +MOCKCPP_SET_DEFAULT_METHOD(4, 86); +MOCKCPP_SET_DEFAULT_METHOD(4, 87); +MOCKCPP_SET_DEFAULT_METHOD(4, 88); +MOCKCPP_SET_DEFAULT_METHOD(4, 89); +MOCKCPP_SET_DEFAULT_METHOD(4, 90); +MOCKCPP_SET_DEFAULT_METHOD(4, 91); +MOCKCPP_SET_DEFAULT_METHOD(4, 92); +MOCKCPP_SET_DEFAULT_METHOD(4, 93); +MOCKCPP_SET_DEFAULT_METHOD(4, 94); +MOCKCPP_SET_DEFAULT_METHOD(4, 95); +MOCKCPP_SET_DEFAULT_METHOD(4, 96); +MOCKCPP_SET_DEFAULT_METHOD(4, 97); +MOCKCPP_SET_DEFAULT_METHOD(4, 98); +MOCKCPP_SET_DEFAULT_METHOD(4, 99); diff --git a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DefaultStub.h b/cli/test/include/mockcpp/DefaultStub.h new file mode 100644 index 0000000..cbc2b75 --- /dev/null +++ b/cli/test/include/mockcpp/DefaultStub.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DEFAULT_STUB_H +#define __MOCKCPP_DEFAULT_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct Invocation; + +struct DefaultStub : public Stub +{ + DefaultStub(Stub* stub); + + ~DefaultStub(); + + Any& invoke(const Invocation& inv); + + std::string toString() const; + +private: + + Stub* defaultStub; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DelegatedMethod.h b/cli/test/include/mockcpp/DelegatedMethod.h new file mode 100644 index 0000000..5954afb --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethod.h @@ -0,0 +1,76 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DELEGATED_METHOD_H +#define __MOCKCPP_DELEGATED_METHOD_H + +#include + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////////////////////////// +template +struct DelegatedMethod; + +///////////////////////////////////////////////////////////////// +#define MOCKCPP_DELEGATED_METHOD_DEF(n) \ +template \ +struct DelegatedMethod > \ +{ \ + enum { IsConst = 0 }; \ + enum { NumberOfParameters = n }; \ + \ + R operator()(DECL_PARAMS_LIST(n)) \ + { \ + IndexInvokableGetter* getter = \ + VirtualTable::getInvokableGetter(this, VPTRIndex); \ + return ChainableMockMethod(getter->getInvokable(VPTRIndex, VTBLIndex)) \ + ("", RefAny() DECL_REST_PARAMS(n)); \ + } \ +} + +///////////////////////////////////////////////////////////////// +#define MOCKCPP_CONST_DELEGATED_METHOD_DEF(n) \ +template \ +struct DelegatedMethod > \ +{ \ + enum { IsConst = 1 }; \ + enum { NumberOfParameters = n }; \ + \ + R operator()(DECL_PARAMS_LIST(n)) \ + { \ + IndexInvokableGetter* getter = \ + VirtualTable::getInvokableGetter(this, VPTRIndex); \ + return ChainableMockMethod(getter->getInvokable(VPTRIndex, VTBLIndex)) \ + ("", RefAny() DECL_REST_PARAMS(n)); \ + } \ +} + +///////////////////////////////////////////////////////////////// +#include + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DelegatedMethodDef.h b/cli/test/include/mockcpp/DelegatedMethodDef.h new file mode 100644 index 0000000..a5c6bf6 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodDef.h @@ -0,0 +1,26 @@ +MOCKCPP_DELEGATED_METHOD_DEF(0); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(0); +MOCKCPP_DELEGATED_METHOD_DEF(1); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(1); +MOCKCPP_DELEGATED_METHOD_DEF(2); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(2); +MOCKCPP_DELEGATED_METHOD_DEF(3); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(3); +MOCKCPP_DELEGATED_METHOD_DEF(4); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(4); +MOCKCPP_DELEGATED_METHOD_DEF(5); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(5); +MOCKCPP_DELEGATED_METHOD_DEF(6); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(6); +MOCKCPP_DELEGATED_METHOD_DEF(7); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(7); +MOCKCPP_DELEGATED_METHOD_DEF(8); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(8); +MOCKCPP_DELEGATED_METHOD_DEF(9); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(9); +MOCKCPP_DELEGATED_METHOD_DEF(10); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(10); +MOCKCPP_DELEGATED_METHOD_DEF(11); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(11); +MOCKCPP_DELEGATED_METHOD_DEF(12); +MOCKCPP_CONST_DELEGATED_METHOD_DEF(12); diff --git a/cli/test/include/mockcpp/DelegatedMethodDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h new file mode 100644 index 0000000..3fe6dd0 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h @@ -0,0 +1,5 @@ +DELEGATED_METHOD_GET_BY_VPTR(0, vtblIndex) +DELEGATED_METHOD_GET_BY_VPTR(1, vtblIndex) +DELEGATED_METHOD_GET_BY_VPTR(2, vtblIndex) +DELEGATED_METHOD_GET_BY_VPTR(3, vtblIndex) +DELEGATED_METHOD_GET_BY_VPTR(4, vtblIndex) diff --git a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetDef.h b/cli/test/include/mockcpp/DelegatedMethodGetDef.h new file mode 100644 index 0000000..def5212 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodGetDef.h @@ -0,0 +1,100 @@ +DELEGATED_METHOD_GET(VPTRIndex, 0) +DELEGATED_METHOD_GET(VPTRIndex, 1) +DELEGATED_METHOD_GET(VPTRIndex, 2) +DELEGATED_METHOD_GET(VPTRIndex, 3) +DELEGATED_METHOD_GET(VPTRIndex, 4) +DELEGATED_METHOD_GET(VPTRIndex, 5) +DELEGATED_METHOD_GET(VPTRIndex, 6) +DELEGATED_METHOD_GET(VPTRIndex, 7) +DELEGATED_METHOD_GET(VPTRIndex, 8) +DELEGATED_METHOD_GET(VPTRIndex, 9) +DELEGATED_METHOD_GET(VPTRIndex, 10) +DELEGATED_METHOD_GET(VPTRIndex, 11) +DELEGATED_METHOD_GET(VPTRIndex, 12) +DELEGATED_METHOD_GET(VPTRIndex, 13) +DELEGATED_METHOD_GET(VPTRIndex, 14) +DELEGATED_METHOD_GET(VPTRIndex, 15) +DELEGATED_METHOD_GET(VPTRIndex, 16) +DELEGATED_METHOD_GET(VPTRIndex, 17) +DELEGATED_METHOD_GET(VPTRIndex, 18) +DELEGATED_METHOD_GET(VPTRIndex, 19) +DELEGATED_METHOD_GET(VPTRIndex, 20) +DELEGATED_METHOD_GET(VPTRIndex, 21) +DELEGATED_METHOD_GET(VPTRIndex, 22) +DELEGATED_METHOD_GET(VPTRIndex, 23) +DELEGATED_METHOD_GET(VPTRIndex, 24) +DELEGATED_METHOD_GET(VPTRIndex, 25) +DELEGATED_METHOD_GET(VPTRIndex, 26) +DELEGATED_METHOD_GET(VPTRIndex, 27) +DELEGATED_METHOD_GET(VPTRIndex, 28) +DELEGATED_METHOD_GET(VPTRIndex, 29) +DELEGATED_METHOD_GET(VPTRIndex, 30) +DELEGATED_METHOD_GET(VPTRIndex, 31) +DELEGATED_METHOD_GET(VPTRIndex, 32) +DELEGATED_METHOD_GET(VPTRIndex, 33) +DELEGATED_METHOD_GET(VPTRIndex, 34) +DELEGATED_METHOD_GET(VPTRIndex, 35) +DELEGATED_METHOD_GET(VPTRIndex, 36) +DELEGATED_METHOD_GET(VPTRIndex, 37) +DELEGATED_METHOD_GET(VPTRIndex, 38) +DELEGATED_METHOD_GET(VPTRIndex, 39) +DELEGATED_METHOD_GET(VPTRIndex, 40) +DELEGATED_METHOD_GET(VPTRIndex, 41) +DELEGATED_METHOD_GET(VPTRIndex, 42) +DELEGATED_METHOD_GET(VPTRIndex, 43) +DELEGATED_METHOD_GET(VPTRIndex, 44) +DELEGATED_METHOD_GET(VPTRIndex, 45) +DELEGATED_METHOD_GET(VPTRIndex, 46) +DELEGATED_METHOD_GET(VPTRIndex, 47) +DELEGATED_METHOD_GET(VPTRIndex, 48) +DELEGATED_METHOD_GET(VPTRIndex, 49) +DELEGATED_METHOD_GET(VPTRIndex, 50) +DELEGATED_METHOD_GET(VPTRIndex, 51) +DELEGATED_METHOD_GET(VPTRIndex, 52) +DELEGATED_METHOD_GET(VPTRIndex, 53) +DELEGATED_METHOD_GET(VPTRIndex, 54) +DELEGATED_METHOD_GET(VPTRIndex, 55) +DELEGATED_METHOD_GET(VPTRIndex, 56) +DELEGATED_METHOD_GET(VPTRIndex, 57) +DELEGATED_METHOD_GET(VPTRIndex, 58) +DELEGATED_METHOD_GET(VPTRIndex, 59) +DELEGATED_METHOD_GET(VPTRIndex, 60) +DELEGATED_METHOD_GET(VPTRIndex, 61) +DELEGATED_METHOD_GET(VPTRIndex, 62) +DELEGATED_METHOD_GET(VPTRIndex, 63) +DELEGATED_METHOD_GET(VPTRIndex, 64) +DELEGATED_METHOD_GET(VPTRIndex, 65) +DELEGATED_METHOD_GET(VPTRIndex, 66) +DELEGATED_METHOD_GET(VPTRIndex, 67) +DELEGATED_METHOD_GET(VPTRIndex, 68) +DELEGATED_METHOD_GET(VPTRIndex, 69) +DELEGATED_METHOD_GET(VPTRIndex, 70) +DELEGATED_METHOD_GET(VPTRIndex, 71) +DELEGATED_METHOD_GET(VPTRIndex, 72) +DELEGATED_METHOD_GET(VPTRIndex, 73) +DELEGATED_METHOD_GET(VPTRIndex, 74) +DELEGATED_METHOD_GET(VPTRIndex, 75) +DELEGATED_METHOD_GET(VPTRIndex, 76) +DELEGATED_METHOD_GET(VPTRIndex, 77) +DELEGATED_METHOD_GET(VPTRIndex, 78) +DELEGATED_METHOD_GET(VPTRIndex, 79) +DELEGATED_METHOD_GET(VPTRIndex, 80) +DELEGATED_METHOD_GET(VPTRIndex, 81) +DELEGATED_METHOD_GET(VPTRIndex, 82) +DELEGATED_METHOD_GET(VPTRIndex, 83) +DELEGATED_METHOD_GET(VPTRIndex, 84) +DELEGATED_METHOD_GET(VPTRIndex, 85) +DELEGATED_METHOD_GET(VPTRIndex, 86) +DELEGATED_METHOD_GET(VPTRIndex, 87) +DELEGATED_METHOD_GET(VPTRIndex, 88) +DELEGATED_METHOD_GET(VPTRIndex, 89) +DELEGATED_METHOD_GET(VPTRIndex, 90) +DELEGATED_METHOD_GET(VPTRIndex, 91) +DELEGATED_METHOD_GET(VPTRIndex, 92) +DELEGATED_METHOD_GET(VPTRIndex, 93) +DELEGATED_METHOD_GET(VPTRIndex, 94) +DELEGATED_METHOD_GET(VPTRIndex, 95) +DELEGATED_METHOD_GET(VPTRIndex, 96) +DELEGATED_METHOD_GET(VPTRIndex, 97) +DELEGATED_METHOD_GET(VPTRIndex, 98) +DELEGATED_METHOD_GET(VPTRIndex, 99) diff --git a/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetter.h b/cli/test/include/mockcpp/DelegatedMethodGetter.h new file mode 100644 index 0000000..9a8c388 --- /dev/null +++ b/cli/test/include/mockcpp/DelegatedMethodGetter.h @@ -0,0 +1,84 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DELEGATED_METHOD_GETTER_H +#define __MOCKCPP_DELEGATED_METHOD_GETTER_H + +#include + +#include +#include +#include + +MOCKCPP_NS_START + +#define DELEGATED_METHOD_GET(N, I) \ +case I: \ +{ \ + return getAddrOfMethod(&DelegatedMethod::operator()); \ +} \ + +void maxVtblSizeTooBigError(unsigned int index); + +template +struct DelegatedMethodGetter +{ + static void* get(unsigned int index) + { + switch(index) + { +# include + default: break; + } + + maxVtblSizeTooBigError(index); + + return 0; + } +}; + +//////////////////////////////////////////////// +#define DELEGATED_METHOD_GET_BY_VPTR(N, I) \ +case N: \ +{ \ + return DelegatedMethodGetter::get(I); \ +} + +void maxInheritanceTooBigError(unsigned int index); + +template +void* getDelegatedFunction(unsigned int vptrIndex, unsigned int vtblIndex, Method m) +{ + typedef typename MethodTypeTraits::MethodArgumentsList MethodArgumentsList; + + switch(vptrIndex) + { +# include + default: + break; + } + + maxInheritanceTooBigError(vptrIndex); + + return 0; +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DestructorAddrGetterDef.h b/cli/test/include/mockcpp/DestructorAddrGetterDef.h new file mode 100644 index 0000000..dfe68f6 --- /dev/null +++ b/cli/test/include/mockcpp/DestructorAddrGetterDef.h @@ -0,0 +1,5 @@ +MOCKCPP_GET_DESTRUCTOR_ADDR(0) +MOCKCPP_GET_DESTRUCTOR_ADDR(1) +MOCKCPP_GET_DESTRUCTOR_ADDR(2) +MOCKCPP_GET_DESTRUCTOR_ADDR(3) +MOCKCPP_GET_DESTRUCTOR_ADDR(4) diff --git a/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule b/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DestructorChecker.h b/cli/test/include/mockcpp/DestructorChecker.h new file mode 100644 index 0000000..b2fbd2d --- /dev/null +++ b/cli/test/include/mockcpp/DestructorChecker.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DESTRUCTOR_CHECKER_H +#define __MOCKCPP_DESTRUCTOR_CHECKER_H + +#include +#include + +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +template +std::pair getIndexOfDestructor() +{ + MethodIndiceChecker* checker = createMethodIndiceChecker(typeid(Original)); + + Interface* iface = (Original*) checker->getObject(); + + delete iface; + + unsigned int vptrIndex = 0; + unsigned int vtblIndex = 0; + + bool result = checker->getIndice(true, vptrIndex, vtblIndex); + delete checker; + + MOCKCPP_ASSERT_TRUE("You are trying to mock an interface without virtual destructor", result); + + return std::pair + (vptrIndex, vtblIndex); +}; + +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DieStub.h b/cli/test/include/mockcpp/DieStub.h new file mode 100644 index 0000000..38fd6a3 --- /dev/null +++ b/cli/test/include/mockcpp/DieStub.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DIE_STUB_H +#define __MOCKCPP_DIE_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct DieStub : public TypelessStub +{ + DieStub(int exitCode = 0); + + bool isCompleted() const; + + Any& invoke(void); + + std::string toString(void) const; + + const std::type_info& type() const; + +private: + + int code; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/DummyBuilder.h b/cli/test/include/mockcpp/DummyBuilder.h new file mode 100644 index 0000000..da935f9 --- /dev/null +++ b/cli/test/include/mockcpp/DummyBuilder.h @@ -0,0 +1,31 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_DUMMY_BUILDER_H +#define __MOCKCPP_DUMMY_BUILDER_H + +#include + +MOCKCPP_NS_START + +struct DummyBuilder {}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/EqualityUtil.h b/cli/test/include/mockcpp/EqualityUtil.h new file mode 100644 index 0000000..568707a --- /dev/null +++ b/cli/test/include/mockcpp/EqualityUtil.h @@ -0,0 +1,43 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_EQUALITY_UTIL_H +#define __MOCKCPP_EQUALITY_UTIL_H + +#include + +#include + +MOCKCPP_NS_START + +template +bool isEqualComparison(const T &left, const T &right) +{ + return left == right; +} + +inline +bool isEqualComparison(const char* left, const char* right) +{ + return !::strcmp(left, right); +} + +MOCKCPP_NS_END + +#endif // __MOCKCPP_EQUALITY_UTIL_H + diff --git a/cli/test/include/mockcpp/Exception.h b/cli/test/include/mockcpp/Exception.h new file mode 100644 index 0000000..814a36d --- /dev/null +++ b/cli/test/include/mockcpp/Exception.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_EXCEPTION_H +#define __MOCKCPP_EXCEPTION_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct Exception + : public std::exception +{ + Exception (unsigned srcline, const char* srcfile, const std::string &message); + + virtual ~Exception() throw(); + + virtual std::string getMessage() const; + + unsigned getSrcLine() const; + + std::string getSrcFile() const; + + virtual const char *what() const throw(); + +private: + + std::string message; + unsigned srcline; + std::string srcfile; + mutable std::string what_helper; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ExpectsMatcher.h b/cli/test/include/mockcpp/ExpectsMatcher.h new file mode 100644 index 0000000..5aa631b --- /dev/null +++ b/cli/test/include/mockcpp/ExpectsMatcher.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_EXPECTS_MATCHER_H +#define __MOCKCPP_EXPECTS_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct Invocation; +struct Matcher; + +struct ExpectsMatcher : public Matcher +{ + ExpectsMatcher(Matcher*); + ~ExpectsMatcher(); + + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + void verify(); + std::string toString() const; + +private: + + Matcher* matcher; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Formatter.h b/cli/test/include/mockcpp/Formatter.h new file mode 100644 index 0000000..5fa73bf --- /dev/null +++ b/cli/test/include/mockcpp/Formatter.h @@ -0,0 +1,92 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_FORMATTER_H +#define __MOCKCPP_FORMATTER_H + +#include + +#include + +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////// +std::string toBufferString(void* buf, size_t size); + +/////////////////////////////////////////////////////// +template +std::string toString(const T& val) +{ + return MOCKCPP_NS::toBufferString((void*)&val, sizeof(val)); +} + +/////////////////////////////////////////////////////// +std::string toPointerString(void*); + +/////////////////////////////////////////////////////// +template +std::string toString(T* p) +{ + return MOCKCPP_NS::toPointerString((void*)p); +} + +/////////////////////////////////////////////////////// +template +std::string toString(const T* s) +{ + return MOCKCPP_NS::toPointerString((void*)s); +} + +/////////////////////////////////////////////////////// +std::string toString(std::string s); +std::string toString(char* s); +std::string toString(const char* s); +std::string toString(float f); +std::string toString(double d); +std::string toString(bool b); +std::string toString(char c); +std::string toString(unsigned char c); +std::string toString(short s); +std::string toString(unsigned short s); +std::string toString(int i); +std::string toString(unsigned int i); +std::string toString(long l); +std::string toString(unsigned long l); + +#if (MOCKCPP_SUPPORT_LONG_LONG == 1) +std::string toString(long long ll); +std::string toString(unsigned long long ll); +#endif + +///////////////////////////////////////////////////////////////// +template +std::string toTypeAndValueString(const T& val) +{ + oss_t oss; + oss << "(" << MOCKCPP_NS::TypeString::value() << ")" + << MOCKCPP_NS::toString(val); + return oss.str(); +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Functor.h b/cli/test/include/mockcpp/Functor.h new file mode 100644 index 0000000..d7154d3 --- /dev/null +++ b/cli/test/include/mockcpp/Functor.h @@ -0,0 +1,124 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_FUNCTOR_H +#define __MOCKCPP_FUNCTOR_H + +#include + +#include + +#include +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////// +struct BaseFunctor +{ + BaseFunctor(const std::string& fName, const char* cName) + : name(fName), nameOfCaller(cName) {} + + std::string getName() const + { + return name; + } + + std::string getNameOfCaller() const + { + return nameOfCaller; + } + +private: + std::string name; + std::string nameOfCaller; +}; + +//////////////////////////////////////////// +template +struct Functor; + +#define FUNCTOR_CONS() \ + Functor(const std::string& name, const char* cName) \ + : BaseFunctor(name, cName) \ + {} + +//////////////////////////////////////////// +#define FUNCTOR_DEF(n) \ +template \ +struct Functor : public BaseFunctor \ +{ \ + FUNCTOR_CONS() \ + \ + R operator()(DECL_PARAMS_LIST(n)) \ + { \ + return GlobalMockObject::instance.invoke(getName()) \ + (getNameOfCaller() DECL_REST_PARAMS(n)); \ + } \ +} + + +FUNCTOR_DEF(0); +FUNCTOR_DEF(1); +FUNCTOR_DEF(2); +FUNCTOR_DEF(3); +FUNCTOR_DEF(4); +FUNCTOR_DEF(5); +FUNCTOR_DEF(6); +FUNCTOR_DEF(7); +FUNCTOR_DEF(8); +FUNCTOR_DEF(9); +FUNCTOR_DEF(10); +FUNCTOR_DEF(11); +FUNCTOR_DEF(12); + +/////////////////////////////////////////////////////// +#define VARDIC_FUNCTOR_DEF(n) \ +template \ +struct Functor : public BaseFunctor \ +{ \ + FUNCTOR_CONS() \ + \ + R operator()(const RefAny& p1 = RefAny(), const RefAny& p2 = RefAny(), \ + const RefAny& p3 = RefAny(), const RefAny& p4 = RefAny(), \ + const RefAny& p5 = RefAny(), const RefAny& p6 = RefAny(), \ + const RefAny& p7 = RefAny(), const RefAny& p8 = RefAny(), \ + const RefAny& p9 = RefAny(), const RefAny& p10 = RefAny(), \ + const RefAny& p11 = RefAny(), const RefAny& p12 = RefAny()) \ + { \ + return GlobalMockObject::instance.invoke(getName()) \ + (getNameOfCaller() DECL_REST_PARAMS(12)); \ + } \ +} + +VARDIC_FUNCTOR_DEF(0); +VARDIC_FUNCTOR_DEF(1); +VARDIC_FUNCTOR_DEF(2); +VARDIC_FUNCTOR_DEF(3); +VARDIC_FUNCTOR_DEF(4); +VARDIC_FUNCTOR_DEF(5); +VARDIC_FUNCTOR_DEF(6); +VARDIC_FUNCTOR_DEF(7); +VARDIC_FUNCTOR_DEF(8); + +///////////////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/GenericMethodIndicesChecker.h b/cli/test/include/mockcpp/GenericMethodIndicesChecker.h new file mode 100644 index 0000000..3e2e11c --- /dev/null +++ b/cli/test/include/mockcpp/GenericMethodIndicesChecker.h @@ -0,0 +1,65 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include + +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// +template +std::pair +getIndicesOfMethod(Method m) +{ + typedef typename MethodTypeTraits::MethodType ExpectedMethodType; + ExpectedMethodType expectedMethod = m; + + typedef void (Interface::*Checker)(void*); + + Checker check = \ + reinterpret_cast(expectedMethod); + + MethodIndiceChecker* checker = createMethodIndiceChecker(typeid(Interface)); + + Interface* iface = (Interface*)checker->getObject(); + + (iface->*check)(0); + + unsigned int vptrIndex = 0; + unsigned int vtblIndex = 0; + + bool result = checker->getIndice(false, vptrIndex, vtblIndex); + + delete checker; + + MOCKCPP_ASSERT_TRUE("You are trying to mock a non-pure-virtual object", result); + + return std::pair + (vptrIndex, vtblIndex); +}; + + +/////////////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + diff --git a/cli/test/include/mockcpp/GlobalMockObject.h b/cli/test/include/mockcpp/GlobalMockObject.h new file mode 100644 index 0000000..a98fb05 --- /dev/null +++ b/cli/test/include/mockcpp/GlobalMockObject.h @@ -0,0 +1,65 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_GLOBAL_MOCK_OBJECT_H +#define __MOCKCPP_GLOBAL_MOCK_OBJECT_H + +#include + +#if defined(MOCKCPP_USE_MOCKABLE) +# include +#else +# include +#endif + +MOCKCPP_NS_START + +#if defined(MOCKCPP_USE_MOCKABLE) +typedef ChainableMockObject MockObjectType; +#else +typedef HookMockObject MockObjectType; +#endif + +struct GlobalMockObject +{ + static void verify(); + static void reset(); + static void reset(const void* api); + + static MockObjectType instance; +}; + +namespace Details { + template + void *methodToAddr(Method m) + { + union + { + void *addr_; + Method m_; + }; + + m_ = m; + return addr_; + } +} // namespace Details + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/GnuMethodIndicesChecker.h b/cli/test/include/mockcpp/GnuMethodIndicesChecker.h new file mode 100644 index 0000000..0531a63 --- /dev/null +++ b/cli/test/include/mockcpp/GnuMethodIndicesChecker.h @@ -0,0 +1,40 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_GNU_METHOD_INDICES_CHECKER_H +#define __MOCKCPP_GNU_METHOD_INDICES_CHECKER_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +std::pair +getIndicesOfMethod(Method m) +{ + unsigned int vptrIndex = getDeltaOfMethod(m); + unsigned int vtblIndex = getIndexOfMethod(m); + return std::pair + (vptrIndex, vtblIndex); +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/GnuMethodInfoReader.h b/cli/test/include/mockcpp/GnuMethodInfoReader.h new file mode 100644 index 0000000..d79854f --- /dev/null +++ b/cli/test/include/mockcpp/GnuMethodInfoReader.h @@ -0,0 +1,105 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_GNU_METHOD_INFO_READER_H +#define __MOCKCPP_GNU_METHOD_INFO_READER_H + +#include +#include + +#include +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////////// +struct GnuMethodDescription +{ + union { + void* addr; + int index; + }u; + + int delta; +}; + +/////////////////////////////////////////////////////////// +template +union MethodDescriptionUnion +{ + GnuMethodDescription desc; + Method method; +}; + +/////////////////////////////////////////////////////////// +template +void* getAddrOfMethod(Method input) +{ + MethodDescriptionUnion m; + m.method = input; + + oss_t oss; + oss << "Method address should be even, please make sure the method " + << TypeString::value() << " is NOT a virtual method"; + + MOCKCPP_ASSERT_TRUE( + oss.str(), + !(m.desc.u.index%2)); + + + return m.desc.u.addr; +} + +/////////////////////////////////////////////////////////// +template +GnuMethodDescription getGnuDescOfVirtualMethod(Method input) +{ + typedef typename MethodTypeTraits::MethodType ExpectedMethodType; + MethodDescriptionUnion m; + m.method = input; + + oss_t oss; + oss << "Virtual method address should be odd, please make sure the method " + << TypeString::value() << " is a virtual method"; + + MOCKCPP_ASSERT_TRUE( + oss.str(), + (m.desc.u.index%2)); + + return m.desc; +} + +/////////////////////////////////////////////////////////// +template +unsigned int getIndexOfMethod(Method method) +{ + return (getGnuDescOfVirtualMethod(method).u.index - 1)/sizeof(void*); +} + +/////////////////////////////////////////////////////////// +template +unsigned int getDeltaOfMethod(Method method) +{ + return getGnuDescOfVirtualMethod(method).delta/sizeof(void*); +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/HookMockObject.h b/cli/test/include/mockcpp/HookMockObject.h new file mode 100644 index 0000000..6c240f4 --- /dev/null +++ b/cli/test/include/mockcpp/HookMockObject.h @@ -0,0 +1,64 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_HOOK_MOCK_OBJECT_H__ +#define __MOCKCPP_HOOK_MOCK_OBJECT_H__ + +#include +#include +#include +#include + +MOCKCPP_NS_START + +struct ApiHookHolder; +struct HookMockObjectImpl; + +struct HookMockObject : public ChainableMockObjectBase +{ + HookMockObject(const std::string& name); + ~HookMockObject(); + + // Building-invocation-mocker interface -- Used in test case + InvocationMockBuilderGetter method + ( const std::string& name + , const void* api + , ApiHookHolder* holder); + + // Invoking interface -- Used in Functor + template + ChainableMockMethod invoke(const void* api) + { + return ChainableMockMethod(getInvokable(api)); + } + + void reset(); + void reset(const void* api); + +private: + + // It's only for template-method invoke. we have to make it visible. + Invokable* getInvokable(const void* api); + +private: + HookMockObjectImpl* This; +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/IdentityBuilder.h b/cli/test/include/mockcpp/IdentityBuilder.h new file mode 100644 index 0000000..99deddf --- /dev/null +++ b/cli/test/include/mockcpp/IdentityBuilder.h @@ -0,0 +1,42 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IDENTITY_BUILDER_H +#define __MOCKCPP_IDENTITY_BUILDER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; + +struct IdentityBuilder +{ + void id(const std::string& id); + + virtual ~IdentityBuilder() {} + +private: + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Ignore.h b/cli/test/include/mockcpp/Ignore.h new file mode 100644 index 0000000..2eda4a2 --- /dev/null +++ b/cli/test/include/mockcpp/Ignore.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IGNORE_H +#define __MOCKCPP_IGNORE_H + +#include +#include + +MOCKCPP_NS_START + +struct Ignore +{ + bool operator==(const Ignore& rhs) const + { + return true; + } +}; + +const Any ignore = Any(Ignore()); + +inline static +Any& getIgnore() +{ + return const_cast(ignore); +} + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IgnoreHandler.h b/cli/test/include/mockcpp/IgnoreHandler.h new file mode 100644 index 0000000..c7a846e --- /dev/null +++ b/cli/test/include/mockcpp/IgnoreHandler.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RESULT_HANDLER_H +#define __MOCKCPP_RESULT_HANDLER_H + +#include +#include +#include + +MOCKCPP_NS_START + +struct Any; + +struct IgnoreHandler : public ResultHandler +{ + bool matches(const Any& val) const + { + return any_castable(val); + } + + Any& getResult() const + { + return getEmtpyHandler(); + } +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IgnoreResultHandler.h b/cli/test/include/mockcpp/IgnoreResultHandler.h new file mode 100644 index 0000000..5481851 --- /dev/null +++ b/cli/test/include/mockcpp/IgnoreResultHandler.h @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IGNORE_RESULT_HANDLER_H +#define __MOCKCPP_IGNORE_RESULT_HANDLER_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; + +struct IgnoreResultHandler : public ResultHandler +{ + bool matches(const Any& result) const; + + const Any& getResult(const Any& result) const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h b/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h new file mode 100644 index 0000000..5135560 --- /dev/null +++ b/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h @@ -0,0 +1,43 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IGNORE_RESULT_HANDLER_FACTORY_H +#define __MOCKCPP_IGNORE_RESULT_HANDLER_FACTORY_H + +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////////// +struct IgnoreResultHandlerFactory + : public ResultHandlerFactory +{ + ResultHandler* create( + bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber); +}; + +/////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IgnoreReturnStub.h b/cli/test/include/mockcpp/IgnoreReturnStub.h new file mode 100644 index 0000000..89d1d64 --- /dev/null +++ b/cli/test/include/mockcpp/IgnoreReturnStub.h @@ -0,0 +1,44 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IGNORE_RETURN_STUB_H +#define __MOCKCPP_IGNORE_RETURN_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct IgnoreReturnStub : public TypelessStub +{ + IgnoreReturnStub(); + + bool isCompleted(void) const; + Any& invoke(void); + + std::string toString(void) const; + + const std::type_info& type() const; +private: + bool hasBeenInvoked; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IncrementStub.h b/cli/test/include/mockcpp/IncrementStub.h new file mode 100644 index 0000000..83a37f2 --- /dev/null +++ b/cli/test/include/mockcpp/IncrementStub.h @@ -0,0 +1,110 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INCREAMENT_STUB_H +#define __MOCKCPP_INCREAMENT_STUB_H + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +template +struct IncrementStub : public TypelessStub +{ + IncrementStub(T startValue, T endValue) + : from(startValue), to(endValue), current(startValue), hasEnd(true) + {} + + IncrementStub(T startValue) + : from(startValue), current(startValue), hasEnd(false) + {} + + bool isCompleted() const + { + if(!hasEnd) + { + return false; + } + + return current > to; + } + + Any& invoke(void) + { + checkEnd(); + value = Any(current); + current++; + return value; + } + + std::string toString(void) const + { + oss_t oss; + + oss << "increase(" << from; + + if(hasEnd) + { + oss << " ," << to; + } + + oss << ")"; + + return oss.str(); + } + + const std::type_info& type() const + { + return typeid(T); + } + +private: + + void checkEnd() + { + if(!hasEnd) + { + return; + } + oss_t oss; + oss << "Returned value has increased to specified end value" + << "(" << to << ")"; + MOCKCPP_ASSERT_TRUE_MESSAGE( + oss.str(), + current <= to); + } + +private: + + Any value; + + bool hasEnd; + + T current; + T from; + T to; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IndexInvokableGetter.h b/cli/test/include/mockcpp/IndexInvokableGetter.h new file mode 100644 index 0000000..3272d16 --- /dev/null +++ b/cli/test/include/mockcpp/IndexInvokableGetter.h @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INDEX_INVOKABLE_GETTER_H +#define __MOCKCPP_INDEX_INVOKABLE_GETTER_H + +#include + +MOCKCPP_NS_START + +struct Invokable; + +struct IndexInvokableGetter +{ + virtual Invokable* getInvokable(unsigned int indexOfVtbl, \ + unsigned int indexOfVptr = 0) const = 0; + + virtual ~IndexInvokableGetter() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InterfaceInfo.h b/cli/test/include/mockcpp/InterfaceInfo.h new file mode 100644 index 0000000..08e53da --- /dev/null +++ b/cli/test/include/mockcpp/InterfaceInfo.h @@ -0,0 +1,39 @@ + +#ifndef __MOCKCPP_INTERFACE_INFO_H_ +#define __MOCKCPP_INTERFACE_INFO_H_ + +#if defined(__GNUC__) +#include +#endif + +#include + +MOCKCPP_NS_START + +#if defined(__GNUC__) + +////////////////////////////////////////////////////// +unsigned int +getNumberOfBaseClasses(const std::type_info& info); + +////////////////////////////////////////////////////// +template +unsigned int getNumberOfVtbls() +{ + return getNumberOfBaseClasses(typeid(Interface)); +} + +#else + +template +unsigned int getNumberOfVtbls() +{ + return sizeof(Interface)/sizeof(void*); +} + +#endif + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Invocation.h b/cli/test/include/mockcpp/Invocation.h new file mode 100644 index 0000000..96598f8 --- /dev/null +++ b/cli/test/include/mockcpp/Invocation.h @@ -0,0 +1,73 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_H +#define __MOCKCPP_INVOCATION_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct Stub; +struct InvocationImpl; + +struct Invocation +{ + Invocation(const std::string nameOfCaller + , const RefAny& pThisPointer = RefAny() + , const RefAny& p01 = RefAny() + , const RefAny& p02 = RefAny() + , const RefAny& p03 = RefAny() + , const RefAny& p04 = RefAny() + , const RefAny& p05 = RefAny() + , const RefAny& p06 = RefAny() + , const RefAny& p07 = RefAny() + , const RefAny& p08 = RefAny() + , const RefAny& p09 = RefAny() + , const RefAny& p10 = RefAny() + , const RefAny& p11 = RefAny() + , const RefAny& p12 = RefAny() + ); + + virtual ~Invocation(); + + RefAny& getThisPointer(void) const; + + // i is beginning with 1 + RefAny& getParameter(const unsigned int i) const; + + // return in follow order: + // 'this' pointer(if it is exist), p1, p2, p3, p4 ... pN + RefAny& getParameterWithThis(const unsigned int i) const; + + std::string getNameOfCaller() const; + + std::string toString(void) const; + +private: + InvocationImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationId.h b/cli/test/include/mockcpp/InvocationId.h new file mode 100644 index 0000000..bd44c78 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationId.h @@ -0,0 +1,41 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_ID_H +#define __MOCKCPP_INVOCATION_ID_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationId +{ + InvocationId(const std::string& identity); + std::string getId(void) const; + std::string toString(void) const; + +private: + std::string id; +}; + +MOCKCPP_NS_END + +#endif + + diff --git a/cli/test/include/mockcpp/InvocationMockBuilder.h b/cli/test/include/mockcpp/InvocationMockBuilder.h new file mode 100644 index 0000000..cf60bce --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockBuilder.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_MOCK_BUILDER_H +#define __MOCKCPP_INVOCATION_MOCK_BUILDER_H + +#include +#include + +MOCKCPP_NS_START + +struct Matcher; +struct InvocationMocker; + +template +struct InvocationMockBuilder : public Builder +{ + InvocationMockBuilder(InvocationMocker* mocker); + +private: + virtual InvocationMocker* getMocker() const; + +private: + InvocationMocker* invocationMocker; +}; + +MOCKCPP_NS_END + +#include + +#endif + diff --git a/cli/test/include/mockcpp/InvocationMockBuilder.tcc b/cli/test/include/mockcpp/InvocationMockBuilder.tcc new file mode 100644 index 0000000..cea53c3 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockBuilder.tcc @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include + +MOCKCPP_NS_START + +////////////////////////////////////////////////////// +template +InvocationMockBuilder::InvocationMockBuilder(InvocationMocker* mocker) + : invocationMocker(mocker) +{ +} + +////////////////////////////////////////////////////// +template +InvocationMocker* InvocationMockBuilder::getMocker() const +{ + return invocationMocker; +} + +MOCKCPP_NS_END + + diff --git a/cli/test/include/mockcpp/InvocationMockBuilderGetter.h b/cli/test/include/mockcpp/InvocationMockBuilderGetter.h new file mode 100644 index 0000000..70a0900 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockBuilderGetter.h @@ -0,0 +1,59 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_MOCK_BUILDER_GETTER_H +#define __MOCKCPP_INVOCATION_MOCK_BUILDER_GETTER_H + +#include + +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +struct Matcher; +struct InvocationMockerContainer; +struct Method; + +/////////////////////////////////////////////// +struct InvocationMockBuilderGetter +{ + InvocationMockBuilderGetter( + InvocationMockerContainer* container, Method* method, const void* addr); + ~InvocationMockBuilderGetter(); + + StubsBuilder stubs(); + MockBuilder expects(Matcher* matcher); + MockBuilder times(unsigned int n); // same as expects(exactly(n)) + DefaultBuilder defaults(); + InvocationMockBuilderGetter &reset(); + +private: + InvocationMockerContainer* invocationMockerContainer; + Method* method; + const void* addr; +}; + +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationMocker.h b/cli/test/include/mockcpp/InvocationMocker.h new file mode 100644 index 0000000..1e174f4 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMocker.h @@ -0,0 +1,63 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_MOCKER_H +#define __MOCKCPP_INVOCATION_MOCKER_H + +#include + +#include + +MOCKCPP_NS_START + +struct Method; +struct Matcher; +struct Stub; +struct InvocationMockerImpl; +struct Invocation; +struct InvocationId; +struct Any; + +struct InvocationMocker : public SelfDescribe +{ + InvocationMocker(Method* core); + ~InvocationMocker(); + + Method* getMethod() const; + void addStub(Stub* stub); + void addMatcher(Matcher* matcher); + bool hasBeenInvoked(void) const ; + + void setId(InvocationId* id); + const InvocationId* const getId(void) const; + + bool matches(const Invocation& inv) const; + Any& invoke(const Invocation& inv); + + void verify(); + + std::string toString() const; + +private: + InvocationMockerImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationMockerContainer.h b/cli/test/include/mockcpp/InvocationMockerContainer.h new file mode 100644 index 0000000..df5fc3f --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockerContainer.h @@ -0,0 +1,44 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_INVOCATION_MOCKER_CONTAINER_H +#define __MOCKPP_INVOCATION_MOCKER_CONTAINER_H + +#include + +#include + +MOCKCPP_NS_START + +struct InvocationMocker; + +struct InvocationMockerContainer +{ + virtual void addInvocationMocker(InvocationMocker* mocker) = 0; + virtual void addDefaultInvocationMocker(InvocationMocker* mocker) = 0; + virtual InvocationMocker* getInvocationMocker(const std::string& id) = 0; + + virtual ~InvocationMockerContainer() {} +}; + + +MOCKCPP_NS_END + + +#endif + diff --git a/cli/test/include/mockcpp/InvocationMockerNamespace.h b/cli/test/include/mockcpp/InvocationMockerNamespace.h new file mode 100644 index 0000000..ef57ad6 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockerNamespace.h @@ -0,0 +1,41 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_MOCKER_NAMESPACE_H +#define __MOCKCPP_INVOCATION_MOCKER_NAMESPACE_H + +#include + +#include + +MOCKCPP_NS_START + +struct InvocationMocker; + +struct InvocationMockerNamespace + : public ObjectNameGetter +{ + virtual InvocationMocker* getInvocationMocker(const std::string& id) const = 0; + + virtual ~InvocationMockerNamespace() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationMockerSet.h b/cli/test/include/mockcpp/InvocationMockerSet.h new file mode 100644 index 0000000..7b2f68b --- /dev/null +++ b/cli/test/include/mockcpp/InvocationMockerSet.h @@ -0,0 +1,61 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_MOCKER_SET_H +#define __MOCKCPP_INVOCATION_MOCKER_SET_H + +#include + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Invocation; +struct SelfDescribe; +struct Any; + +////////////////////////////////////////////////////////// +struct InvocationMockerSet +{ +private: + typedef std::list List; + typedef List::iterator Iterator; + typedef List::const_iterator ConstIterator; + +public: + InvocationMocker* getInvocationMocker(const std::string& id) const; + void addInvocationMocker(InvocationMocker* mocker); + + void reset(); + void verify(); + + const Any& invoke(const Invocation& inv, SelfDescribe* &resultProvider); + + std::string toString() const; + +private: + + List mockers; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationTimesMatcher.h b/cli/test/include/mockcpp/InvocationTimesMatcher.h new file mode 100644 index 0000000..cb17018 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationTimesMatcher.h @@ -0,0 +1,51 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_TIMES_MATCHER_H +#define __MOCKCPP_INVOCATION_TIMES_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedTimesReader; +struct Invocation; + +struct InvocationTimesMatcher : public Matcher +{ + InvocationTimesMatcher(); + ~InvocationTimesMatcher(); + + void increaseInvoked(const Invocation& inv); + + void setInvokedTimesReader(InvokedTimesReader* recorder); + +protected: + + unsigned int getInvokedTimes() const; + +private: + + InvokedTimesReader* invokedTimesReader; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvocationWithReturnType.h b/cli/test/include/mockcpp/InvocationWithReturnType.h new file mode 100644 index 0000000..1c81037 --- /dev/null +++ b/cli/test/include/mockcpp/InvocationWithReturnType.h @@ -0,0 +1,52 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOCATION_WITH_RETURN_TYPE_H +#define __MOCKCPP_INVOCATION_WITH_RETURN_TYPE_H + +#include + +#include + +MOCKCPP_NS_START + +template +struct InvocationWithReturnType : public Invocation +{ + InvocationWithReturnType( + const RefAny& p1 = RefAny() + , const RefAny& p2 = RefAny() + , const RefAny& p3 = RefAny() + , const RefAny& p4 = RefAny() + , const RefAny& p5 = RefAny() + , const RefAny& p6 = RefAny()) + : Invocation(p1, p2, p3, p4, p5, p6) + {} + + std::string toString(void) const; + + bool matches(Stub* stub) const + { + return stub->type() == typeid(RT); + } +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Invokable.h b/cli/test/include/mockcpp/Invokable.h new file mode 100644 index 0000000..92b65bf --- /dev/null +++ b/cli/test/include/mockcpp/Invokable.h @@ -0,0 +1,65 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKABLE_H +#define __MOCKCPP_INVOKABLE_H + +#include + +#include +#include + +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +struct SelfDescribe; + +/////////////////////////////////////////////// +struct Invokable +{ + // isMemberMethod used to sign the callee function is a C++ member method, + // if isMemberMethod is true, p01 is 'this' pointer + virtual const Any& + invoke( const std::string& nameOfCaller + , const RefAny& pThisPointer + , const RefAny& p1 + , const RefAny& p2 + , const RefAny& p3 + , const RefAny& p4 + , const RefAny& p5 + , const RefAny& p6 + , const RefAny& p7 + , const RefAny& p8 + , const RefAny& p9 + , const RefAny& p10 + , const RefAny& p11 + , const RefAny& p12 + , SelfDescribe* &resultProvider) = 0; + + + virtual ~Invokable() {} +}; + +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedAtLeast.h b/cli/test/include/mockcpp/InvokedAtLeast.h new file mode 100644 index 0000000..e29700c --- /dev/null +++ b/cli/test/include/mockcpp/InvokedAtLeast.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_ATLEAST_H +#define __MOCKCPP_INVOKED_ATLEAST_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedAtLeast : public InvocationTimesMatcher +{ + InvokedAtLeast(const unsigned int times); + + bool matches(const Invocation& inv) const; + + void verify(void); + + std::string toString() const; + +private: + + unsigned int lowLimit; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedAtMost.h b/cli/test/include/mockcpp/InvokedAtMost.h new file mode 100644 index 0000000..f118c94 --- /dev/null +++ b/cli/test/include/mockcpp/InvokedAtMost.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_ATMOST_H +#define __MOCKCPP_INVOKED_ATMOST_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedAtMost + : public InvocationTimesMatcher +{ + InvokedAtMost(const unsigned int times); + + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + + void verify(void); + + std::string toString(void) const; + +private: + + unsigned int highLimit; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedExactly.h b/cli/test/include/mockcpp/InvokedExactly.h new file mode 100644 index 0000000..dc5ed0f --- /dev/null +++ b/cli/test/include/mockcpp/InvokedExactly.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_EXACTLY_H +#define __MOCKCPP_INVOKED_EXACTLY_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedExactly : public InvocationTimesMatcher +{ + InvokedExactly(const unsigned int times); + + bool matches(const Invocation& inv) const; + + void verify(void); + + std::string toString(void) const; + +private: + + unsigned int expectedInvokedTimes; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedOnce.h b/cli/test/include/mockcpp/InvokedOnce.h new file mode 100644 index 0000000..c277eb3 --- /dev/null +++ b/cli/test/include/mockcpp/InvokedOnce.h @@ -0,0 +1,42 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_ONCE_H +#define __MOCKCPP_INVOKED_ONCE_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedOnce : public InvocationTimesMatcher +{ + InvokedOnce(); + + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + + void verify(void); + + std::string toString(void) const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedTimesMatcher.h b/cli/test/include/mockcpp/InvokedTimesMatcher.h new file mode 100644 index 0000000..be8ef16 --- /dev/null +++ b/cli/test/include/mockcpp/InvokedTimesMatcher.h @@ -0,0 +1,52 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_TIMES_MATCHER_H +#define __MOCKCPP_INVOKED_TIMES_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedTimesRecorder; +struct Invocation; + +struct InvokedTimesMatcher : public Matcher +{ + InvokedTimesMatcher(InvokedTimesRecorder* recorder); + + ~InvokedTimesMatcher(); + + bool matches(const Invocation& inv) const; + + void increaseInvoked(const Invocation& inv); + + std::string toString(void) const; + + void verify(); + +private: + + InvokedTimesRecorder* invokedTimesRecorder; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedTimesReader.h b/cli/test/include/mockcpp/InvokedTimesReader.h new file mode 100644 index 0000000..0818f60 --- /dev/null +++ b/cli/test/include/mockcpp/InvokedTimesReader.h @@ -0,0 +1,36 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_TIMES_READER_H +#define __MOCKCPP_INVOKED_TIMES_READER_H + +#include + +MOCKCPP_NS_START + +struct InvokedTimesReader +{ + virtual ~InvokedTimesReader() {} + + virtual unsigned int getInvokedTimes() const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/InvokedTimesRecorder.h b/cli/test/include/mockcpp/InvokedTimesRecorder.h new file mode 100644 index 0000000..7325ca6 --- /dev/null +++ b/cli/test/include/mockcpp/InvokedTimesRecorder.h @@ -0,0 +1,36 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_INVOKED_TIMES_RECORDER_H +#define __MOCKCPP_INVOKED_TIMES_RECORDER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvokedTimesRecorder : public InvokedTimesReader +{ + virtual ~InvokedTimesRecorder() {} + virtual void increaseInvoked() = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsAnything.h b/cli/test/include/mockcpp/IsAnything.h new file mode 100644 index 0000000..d4f3146 --- /dev/null +++ b/cli/test/include/mockcpp/IsAnything.h @@ -0,0 +1,42 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_ANYTHING_H +#define __MOCKCPP_IS_ANYTHING_H + +#include +#include + +MOCKCPP_NS_START + +struct IsAnything : public TypelessConstraint +{ + virtual bool eval(void) const + { return true; } + + virtual std::string toString() const + { + return std::string("any()"); + } +}; + + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsAnythingHelper.h b/cli/test/include/mockcpp/IsAnythingHelper.h new file mode 100644 index 0000000..80929d5 --- /dev/null +++ b/cli/test/include/mockcpp/IsAnythingHelper.h @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_ANYTHING_HELPER_H +#define __MOCKCPP_IS_ANYTHING_HELPER_H + +#include + +MOCKCPP_NS_START + +struct Constraint; + +Constraint* any(); + +static const Constraint* _ = 0; + +bool isAnyConstraint(Constraint* c); + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsConst.h b/cli/test/include/mockcpp/IsConst.h new file mode 100644 index 0000000..d7478d4 --- /dev/null +++ b/cli/test/include/mockcpp/IsConst.h @@ -0,0 +1,49 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef MOCKCPP_IS_CONST_H +#define MOCKCPP_IS_CONST_H + +#include + +MOCKCPP_NS_START + +///////////////////////////////////// +template +struct IsConst +{ + static const bool isTrue = false; +}; + +template +struct IsConst +{ + static const bool isTrue = true; +}; + +template +struct IsConst +{ + static const bool isTrue = true; +}; + +MOCKCPP_NS_END + + +#endif + diff --git a/cli/test/include/mockcpp/IsEqual.h b/cli/test/include/mockcpp/IsEqual.h new file mode 100644 index 0000000..694e51c --- /dev/null +++ b/cli/test/include/mockcpp/IsEqual.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_EQUAL_H +#define __MOCKCPP_IS_EQUAL_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct IsEqual : public Constraint +{ + IsEqual(const T& expected) + : expectedValue(expected) + {} + + ~IsEqual() {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + return any_cast(val) == expectedValue; + } + + std::string toString() const + { + return std::string("eq(") + + MOCKCPP_NS::toTypeAndValueString(expectedValue) + + std::string(")"); + } + +private: + + T expectedValue; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsGreaterThan.h b/cli/test/include/mockcpp/IsGreaterThan.h new file mode 100644 index 0000000..c1784bc --- /dev/null +++ b/cli/test/include/mockcpp/IsGreaterThan.h @@ -0,0 +1,59 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_GREATER_THAN_H +#define __MOCKCPP_IS_GREATER_THAN_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct IsGreaterThan : public Constraint +{ +public: + IsGreaterThan(const T& expected) + : expectedValue(expected) + {} + + ~IsGreaterThan() {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + return any_cast(val) > expectedValue; + } + + std::string toString() const + { + return std::string("gt(") + + MOCKCPP_NS::toTypeAndValueString(expectedValue) + + std::string(")"); + } + +private: + + T expectedValue; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsLessThan.h b/cli/test/include/mockcpp/IsLessThan.h new file mode 100644 index 0000000..beb9e6c --- /dev/null +++ b/cli/test/include/mockcpp/IsLessThan.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_LESS_THAN_H +#define __MOCKCPP_IS_LESS_THAN_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct IsLessThan : public Constraint +{ + IsLessThan(const T& expected) + : expectedValue(expected) + {} + + ~IsLessThan() {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + return any_cast(val) < expectedValue; + } + + std::string toString() const + { + return std::string("lt(") + + MOCKCPP_NS::toTypeAndValueString(expectedValue) + + std::string(")"); + } + +private: + + T expectedValue; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsMirror.h b/cli/test/include/mockcpp/IsMirror.h new file mode 100644 index 0000000..d8e7d06 --- /dev/null +++ b/cli/test/include/mockcpp/IsMirror.h @@ -0,0 +1,181 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_MIRROR_H +#define __MOCKCPP_IS_MIRROR_H + +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////// +template +struct IsMirrorBase +{ +}; + +/////////////////////////////////////////////////////// +template +struct IsMirrorBase: public Constraint +{ +public: + + IsMirrorBase(T* p, size_t size) + : pointer(0), sizeOfBuffer(size) + { + if (size != 0) + { + pointer = (T*)(new char [sizeOfBuffer+1]); + ::memset((void*)pointer, 0, sizeOfBuffer+1); + ::memcpy((void*)pointer, (void*)p, sizeOfBuffer); + } + } + + ~IsMirrorBase() + { + if (pointer != 0) + { + delete [] (char*)pointer; + } + } + + bool eval(const RefAny& val) const + { + if (!any_castable(val)) + { + return false; + } + + T* p = any_cast(val); + if (p == 0) + { + return false; + } + + return !memcmp((void*)p, (void*)pointer, sizeOfBuffer); + } + + std::string toString() const + { + oss_t oss; + + oss << "mirror(" + << MOCKCPP_NS::toTypeAndValueString(pointer) + << ", " << sizeOfBuffer + << ")"; + + return oss.str(); + } + +private: + + T* pointer; + + size_t sizeOfBuffer; +}; + +////////////////////////////////////////////////////////////////////// +template +struct IsMirror : public Constraint +{ + +#if defined(__GNUC__) && (__GNUC__ > 3) +public: + + IsMirror(const T& obj) + : object(obj) + { + } + + bool eval(const RefAny& val) const + { + if (!any_castable(val)) + { + return false; + } + + T p = any_cast(val); + return !memcmp((void*)&p, (void*)&object, sizeof(object)); + } + + std::string toString(void) const + { + oss_t oss; + + oss << "mirror(" + << MOCKCPP_NS::toTypeAndValueString(object) + << ")"; + + return oss.str(); + } + +private: + + T object; +#endif + +}; + +////////////////////////////////////////////////////////////////////// +template +struct IsMirror : public IsMirrorBase +{ +public: + + IsMirror(T* p, size_t size = 0) + : IsMirrorBase(p, size == 0 ? sizeof(T) : size) + { + } +}; + +////////////////////////////////////////////////////////////////////// +template <> +struct IsMirror : public IsMirrorBase +{ +public: + + IsMirror(void* p, size_t size) + : IsMirrorBase(p, size) + { + MOCKCPP_ASSERT_TRUE_MESSAGE( + "parameter \"size\" of IsMirror cannot be specified as 0", + size > 0); + } +}; + +////////////////////////////////////////////////////////////////////// +template <> +struct IsMirror : public IsMirrorBase +{ +public: + + IsMirror(const void* p, size_t size) + : IsMirrorBase(p, size) + { + MOCKCPP_ASSERT_TRUE_MESSAGE( + "parameter \"size\" of IsMirror cannot be specified as 0", + size > 0); + } +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsNotEqual.h b/cli/test/include/mockcpp/IsNotEqual.h new file mode 100644 index 0000000..f5fb1f0 --- /dev/null +++ b/cli/test/include/mockcpp/IsNotEqual.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_NOT_EQUAL_H +#define __MOCKCPP_IS_NOT_EQUAL_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct IsNotEqual : public Constraint +{ + IsNotEqual(const T& expected) + : expectedValue(expected) + {} + + ~IsNotEqual() {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + return !(any_cast(val) == expectedValue); + } + + std::string toString() const + { + return std::string("neq(") + + MOCKCPP_NS::toTypeAndValueString(expectedValue) + + std::string(")"); + } + +private: + + T expectedValue; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsRef.h b/cli/test/include/mockcpp/IsRef.h new file mode 100644 index 0000000..a1c6223 --- /dev/null +++ b/cli/test/include/mockcpp/IsRef.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef MOCKCPP_IS_REF_H +#define MOCKCPP_IS_REF_H + +#include + +MOCKCPP_NS_START + +////////////////////////////////////////// +template +struct IsRef +{ + static const bool isTrue = false; + static const bool outBoundable = false; +}; + +////////////////////////////////////////// +template +struct IsRef +{ + static const bool isTrue = true; + static const bool outBoundable = true; +}; + +////////////////////////////////////////// +template +struct IsRef +{ + static const bool isTrue = true; + static const bool outBoundable = false; +}; + +////////////////////////////////////////// + +MOCKCPP_NS_END + + +#endif + diff --git a/cli/test/include/mockcpp/IsStringContains.h b/cli/test/include/mockcpp/IsStringContains.h new file mode 100644 index 0000000..d937b36 --- /dev/null +++ b/cli/test/include/mockcpp/IsStringContains.h @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_STRING_CONTAINS_H +#define __MOCKCPP_IS_STRING_CONTAINS_H + +#include + +#include + +MOCKCPP_NS_START + +struct IsStringContains : public StringPredict +{ + bool predict(const std::string& input, const std::string& target) const; + std::string toString(const std::string& target) const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsStringEndWith.h b/cli/test/include/mockcpp/IsStringEndWith.h new file mode 100644 index 0000000..e75262f --- /dev/null +++ b/cli/test/include/mockcpp/IsStringEndWith.h @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_STRING_END_WITH_H +#define __MOCKCPP_IS_STRING_END_WITH_H + +#include + +#include + +MOCKCPP_NS_START + +struct IsStringEndWith : public StringPredict +{ + bool predict(const std::string& input, const std::string& target) const; + std::string toString(const std::string& target) const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/IsStringStartWith.h b/cli/test/include/mockcpp/IsStringStartWith.h new file mode 100644 index 0000000..1325e9e --- /dev/null +++ b/cli/test/include/mockcpp/IsStringStartWith.h @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_IS_STRING_START_WITH_H +#define __MOCKCPP_IS_STRING_START_WITH_H + +#include + +#include + +MOCKCPP_NS_START + +struct IsStringStartWith : public StringPredict +{ + bool predict(const std::string& input, const std::string& target) const; + std::string toString(const std::string& target) const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/JmpCode.h b/cli/test/include/mockcpp/JmpCode.h new file mode 100644 index 0000000..93164da --- /dev/null +++ b/cli/test/include/mockcpp/JmpCode.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_JMP_CODE_H__ +#define __MOCKCPP_JMP_CODE_H__ + +#include + +#include + +MOCKCPP_NS_START + +struct JmpCodeImpl; + +struct JmpCode +{ + JmpCode(const void* from, const void* to); + ~JmpCode(); + + void* getCodeData() const; + size_t getCodeSize() const; + void flushCache() const; +private: + JmpCodeImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Matcher.h b/cli/test/include/mockcpp/Matcher.h new file mode 100644 index 0000000..501b226 --- /dev/null +++ b/cli/test/include/mockcpp/Matcher.h @@ -0,0 +1,42 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MATCHER_H +#define __MOCKCPP_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct Invocation; + +struct Matcher +{ + virtual bool matches(const Invocation& inv) const = 0; + virtual void increaseInvoked(const Invocation& inv) = 0; + virtual void verify() = 0; + virtual std::string toString() const = 0; + + virtual ~Matcher() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Method.h b/cli/test/include/mockcpp/Method.h new file mode 100644 index 0000000..80ae0d0 --- /dev/null +++ b/cli/test/include/mockcpp/Method.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_METHOD_H +#define __MOCKCPP_METHOD_H + +#include + +#include + +#include + +MOCKCPP_NS_START + +struct SelfDescribe; +struct InvocationMockerNamespace; + +///////////////////////////////////////////// +struct Method + : public Invokable +{ + virtual std::string& getName() const = 0; + + virtual InvocationMockerNamespace* getNamespace() const = 0; + + virtual ~Method() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MethodIndiceChecker.h b/cli/test/include/mockcpp/MethodIndiceChecker.h new file mode 100644 index 0000000..013c3b1 --- /dev/null +++ b/cli/test/include/mockcpp/MethodIndiceChecker.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_METHOD_INDICE_CHECKER_H +#define __MOCKCPP_METHOD_INDICE_CHECKER_H + +#include + +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +struct MethodIndiceChecker +{ + virtual void* getObject() const = 0; + + virtual bool getIndice + ( bool objDeleted + , unsigned int& vptrIndex + , unsigned int& vtblIndex) = 0; + + virtual ~MethodIndiceChecker() {} +}; + +/////////////////////////////////////////////// +MethodIndiceChecker* +createMethodIndiceChecker(const std::type_info& info); + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h new file mode 100644 index 0000000..c29005a --- /dev/null +++ b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h @@ -0,0 +1,500 @@ +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 0); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 1); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 2); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 3); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 4); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 5); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 6); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 7); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 8); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 9); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 10); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 11); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 12); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 13); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 14); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 15); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 16); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 17); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 18); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 19); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 20); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 21); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 22); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 23); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 24); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 25); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 26); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 27); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 28); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 29); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 30); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 31); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 32); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 33); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 34); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 35); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 36); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 37); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 38); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 39); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 40); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 41); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 42); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 43); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 44); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 45); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 46); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 47); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 48); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 49); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 50); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 51); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 52); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 53); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 54); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 55); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 56); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 57); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 58); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 59); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 60); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 61); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 62); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 63); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 64); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 65); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 66); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 67); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 68); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 69); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 70); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 71); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 72); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 73); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 74); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 75); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 76); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 77); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 78); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 79); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 80); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 81); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 82); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 83); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 84); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 85); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 86); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 87); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 88); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 89); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 90); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 91); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 92); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 93); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 94); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 95); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 96); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 97); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 98); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 99); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 0); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 1); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 2); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 3); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 4); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 5); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 6); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 7); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 8); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 9); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 10); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 11); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 12); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 13); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 14); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 15); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 16); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 17); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 18); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 19); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 20); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 21); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 22); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 23); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 24); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 25); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 26); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 27); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 28); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 29); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 30); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 31); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 32); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 33); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 34); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 35); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 36); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 37); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 38); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 39); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 40); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 41); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 42); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 43); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 44); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 45); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 46); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 47); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 48); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 49); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 50); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 51); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 52); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 53); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 54); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 55); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 56); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 57); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 58); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 59); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 60); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 61); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 62); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 63); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 64); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 65); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 66); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 67); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 68); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 69); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 70); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 71); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 72); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 73); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 74); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 75); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 76); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 77); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 78); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 79); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 80); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 81); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 82); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 83); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 84); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 85); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 86); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 87); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 88); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 89); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 90); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 91); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 92); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 93); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 94); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 95); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 96); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 97); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 98); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 99); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 0); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 1); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 2); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 3); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 4); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 5); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 6); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 7); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 8); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 9); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 10); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 11); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 12); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 13); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 14); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 15); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 16); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 17); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 18); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 19); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 20); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 21); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 22); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 23); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 24); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 25); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 26); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 27); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 28); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 29); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 30); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 31); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 32); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 33); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 34); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 35); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 36); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 37); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 38); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 39); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 40); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 41); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 42); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 43); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 44); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 45); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 46); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 47); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 48); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 49); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 50); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 51); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 52); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 53); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 54); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 55); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 56); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 57); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 58); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 59); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 60); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 61); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 62); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 63); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 64); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 65); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 66); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 67); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 68); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 69); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 70); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 71); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 72); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 73); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 74); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 75); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 76); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 77); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 78); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 79); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 80); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 81); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 82); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 83); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 84); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 85); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 86); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 87); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 88); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 89); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 90); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 91); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 92); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 93); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 94); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 95); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 96); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 97); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 98); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 99); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 0); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 1); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 2); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 3); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 4); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 5); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 6); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 7); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 8); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 9); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 10); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 11); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 12); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 13); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 14); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 15); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 16); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 17); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 18); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 19); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 20); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 21); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 22); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 23); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 24); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 25); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 26); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 27); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 28); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 29); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 30); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 31); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 32); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 33); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 34); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 35); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 36); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 37); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 38); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 39); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 40); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 41); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 42); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 43); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 44); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 45); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 46); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 47); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 48); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 49); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 50); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 51); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 52); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 53); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 54); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 55); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 56); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 57); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 58); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 59); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 60); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 61); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 62); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 63); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 64); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 65); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 66); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 67); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 68); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 69); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 70); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 71); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 72); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 73); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 74); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 75); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 76); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 77); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 78); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 79); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 80); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 81); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 82); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 83); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 84); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 85); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 86); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 87); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 88); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 89); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 90); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 91); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 92); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 93); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 94); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 95); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 96); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 97); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 98); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 99); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 0); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 1); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 2); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 3); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 4); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 5); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 6); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 7); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 8); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 9); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 10); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 11); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 12); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 13); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 14); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 15); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 16); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 17); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 18); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 19); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 20); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 21); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 22); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 23); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 24); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 25); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 26); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 27); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 28); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 29); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 30); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 31); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 32); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 33); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 34); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 35); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 36); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 37); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 38); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 39); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 40); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 41); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 42); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 43); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 44); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 45); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 46); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 47); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 48); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 49); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 50); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 51); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 52); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 53); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 54); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 55); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 56); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 57); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 58); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 59); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 60); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 61); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 62); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 63); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 64); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 65); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 66); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 67); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 68); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 69); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 70); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 71); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 72); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 73); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 74); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 75); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 76); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 77); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 78); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 79); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 80); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 81); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 82); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 83); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 84); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 85); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 86); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 87); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 88); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 89); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 90); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 91); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 92); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 93); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 94); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 95); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 96); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 97); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 98); +MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 99); diff --git a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/MethodInfoReader.h b/cli/test/include/mockcpp/MethodInfoReader.h new file mode 100644 index 0000000..168b936 --- /dev/null +++ b/cli/test/include/mockcpp/MethodInfoReader.h @@ -0,0 +1,35 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_METHOD_INFO_READER_H +#define __MOCKCPP_METHOD_INFO_READER_H + +#if defined(__GNUC__) +#include +#include +#endif + +#if defined(_MSC_VER) +#include +#endif + +#if !defined(__GNUC__) +#include +#endif + +#endif + diff --git a/cli/test/include/mockcpp/MethodTypeTraits.h b/cli/test/include/mockcpp/MethodTypeTraits.h new file mode 100644 index 0000000..aef4828 --- /dev/null +++ b/cli/test/include/mockcpp/MethodTypeTraits.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_METHOD_TYPE_TRAITS_H +#define __MOCKCPP_METHOD_TYPE_TRAITS_H + +#include + +#include +#include + +MOCKCPP_NS_START + +template +struct MethodTypeTraits; + +#define MOCKCPP_METHOD_TYPE_TRAITS_DEF(n) \ +template \ +struct MethodTypeTraits \ +{ \ + typedef C1 OrignalClass; \ + typedef R (C::*MethodType)(DECL_ARGS(n)); \ + \ + typedef ArgumentsList MethodArgumentsList; \ +} + +#define MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(n) \ +template \ +struct MethodTypeTraits \ +{ \ + typedef C1 OrignalClass; \ + typedef R (C::*MethodType)(DECL_ARGS(n)) const; \ + \ + typedef ArgumentsListConst MethodArgumentsList; \ +} + +#include + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/MethodTypeTraitsDef.h b/cli/test/include/mockcpp/MethodTypeTraitsDef.h new file mode 100644 index 0000000..1c46b0d --- /dev/null +++ b/cli/test/include/mockcpp/MethodTypeTraitsDef.h @@ -0,0 +1,26 @@ +MOCKCPP_METHOD_TYPE_TRAITS_DEF(0); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(0); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(1); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(1); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(2); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(2); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(3); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(3); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(4); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(4); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(5); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(5); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(6); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(6); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(7); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(7); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(8); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(8); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(9); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(9); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(10); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(10); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(11); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(11); +MOCKCPP_METHOD_TYPE_TRAITS_DEF(12); +MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(12); diff --git a/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule b/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule new file mode 100644 index 0000000..4bbe599 --- /dev/null +++ b/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule @@ -0,0 +1 @@ +Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/MismatchResultHandler.h b/cli/test/include/mockcpp/MismatchResultHandler.h new file mode 100644 index 0000000..b98e8fc --- /dev/null +++ b/cli/test/include/mockcpp/MismatchResultHandler.h @@ -0,0 +1,51 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MISMATCH_RESULT_HANDLER_H +#define __MOCKCPP_MISMATCH_RESULT_HANDLER_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct SelfDescribe; + +struct MismatchResultHandler: public ResultHandler +{ + MismatchResultHandler( bool castable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* resultProvider); + + bool matches(const Any& result) const; + + const Any& getResult(const Any& result) const; + +private: + const bool isCastable; + const std::type_info& expectedTypeInfo; + const std::string expectedTypeString; + const SelfDescribe* resultProvider; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MismatchResultHandlerFactory.h b/cli/test/include/mockcpp/MismatchResultHandlerFactory.h new file mode 100644 index 0000000..1aaa140 --- /dev/null +++ b/cli/test/include/mockcpp/MismatchResultHandlerFactory.h @@ -0,0 +1,43 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MISMATCH_RESULT_HANDLER_FACTORY_H +#define __MOCKCPP_MISMATCH_RESULT_HANDLER_FACTORY_H + +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////////// +struct MismatchResultHandlerFactory + : public ResultHandlerFactory +{ + ResultHandler* create( + bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber); +}; + +/////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MockBuilder.h b/cli/test/include/mockcpp/MockBuilder.h new file mode 100644 index 0000000..d6bcd6e --- /dev/null +++ b/cli/test/include/mockcpp/MockBuilder.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOCK_BUILDER_H +#define __MOCKCPP_MOCK_BUILDER_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +typedef InvocationMockBuilder< + CallerMatchBuilder< + BeforeMatchBuilder< + ArgumentsMatchBuilder< + AfterMatchBuilder< + StubBuilder< + MoreStubBuilder< + IdentityBuilder + > + > + > + > + > + > + > MockBuilder; +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MockObject.h b/cli/test/include/mockcpp/MockObject.h new file mode 100644 index 0000000..cbf4956 --- /dev/null +++ b/cli/test/include/mockcpp/MockObject.h @@ -0,0 +1,181 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOCK_OBJECT_H +#define __MOCKCPP_MOCK_OBJECT_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +//////////////////////////////////////////////////////////////// +template +struct MockObject : public MockObjectBase +{ + typedef Interface MockedInterface; + + ///////////////////////////////////////////////////////////// + MockObject() + : MockObjectBase(TypeString::value() + , getNumberOfVtbls() + , typeid(Interface)) + { + identifyDestructor(); + } + + ///////////////////////////////////////////////////////////// + MockObject(const MockObject& obj) + : MockObjectBase(obj) + { + } + + MockObject& getObject() + { + return *this; + } + + Interface* getInterface() + { + return (Interface*)toPointerToInterface(); + } + + ///////////////////////////////////////////////////////////// + operator Interface* () + { + return (Interface*)toPointerToInterface(); + } + + ///////////////////////////////////////////////////////////// + Interface* operator->() + { + return (Interface*)toPointerToInterface(); + } + + ///////////////////////////////////////////////////////////// + template + void mightBeUsedAs() + { + TargetInterface* target = \ + dynamic_cast + ((Interface*)toPointerToInterface()); + if(target == 0) + { + oss_t oss; + oss << TypeString::value() + << " can not be used as " + << TypeString::value() + << "."; + + MOCKCPP_REPORT_FAILURE(oss.str()); + } + + identifyDestructor(); + } + + ///////////////////////////////////////////////////////////// + void willBeDeleted() + { + expectsBeingDeleted(); + } + + ///////////////////////////////////////////////////////////// + void willKeepAlive() + { + expectsKeepAlive(); + } + + void verify() + { + try + { + MockObjectBase::verify(); + } + catch(...) + { + __RUN_NOTHROW({ + reset(); + }); + throw; + } + + __RUN_THROW({ + reset(); + }); + } + + void reset() + { + MockObjectBase::reset(); + identifyDestructor(); + } + ///////////////////////////////////////////////////////////// + template + InvocationMockBuilderGetter method(Method m, const char* name = 0) + { + std::string methodName(name == 0 ? \ + TypeString::value():name); + + std::pair indices = \ + getIndicesOfMethod(m); + + void * addr = getDelegatedFunction( \ + indices.first, indices.second, m); + + return createInvocationMockerBuilderGetter( \ + methodName, addr, indices.first, indices.second); + } + +//////////////////////////////////////////////////////////////// +private: + + MockObject& operator=(const MockObject&); + +//////////////////////////////////////////////////////////////// +// Template methods: it's ugly, but we have to make them visible. +private: + + template + void identifyDestructor() + { + std::pair indices = \ + getIndexOfDestructor(); + + setDestructor(indices.first, indices.second); + } + + template + void* getAddrOfDelegatedMethod(Method m) + { return getAddrOfMethod(m); } + +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MockObjectBase.h b/cli/test/include/mockcpp/MockObjectBase.h new file mode 100644 index 0000000..b57e6b4 --- /dev/null +++ b/cli/test/include/mockcpp/MockObjectBase.h @@ -0,0 +1,72 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOCK_OBJECT_BASE_H +#define __MOCKCPP_MOCK_OBJECT_BASE_H + +#include + +#include +#include +#include + +MOCKCPP_NS_START + +struct MockObjectBaseImpl; + +struct MockObjectBase : public ChainableMockObjectBase +{ + ~MockObjectBase(); + + virtual void reset(); + virtual void verify(); + +protected: + + MockObjectBase( const std::string& objName + , unsigned int numberOfVptr + , const std::type_info& info); + + MockObjectBase(const MockObjectBase&); + +protected: + + InvocationMockBuilderGetter + createInvocationMockerBuilderGetter(const std::string& name, \ + void* addr, unsigned int vptrIndex, unsigned int vtblIndex); + + void* toPointerToInterface() const; + + void setDestructor(unsigned int vptrIndex, unsigned int vtblIndex); + + void expectsBeingDeleted(); + void expectsKeepAlive(); + +private: + + MockObjectBase& operator=(const MockObjectBase&); + +private: + + MockObjectBaseImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/MockObjectHelper.h b/cli/test/include/mockcpp/MockObjectHelper.h new file mode 100644 index 0000000..0b9dba9 --- /dev/null +++ b/cli/test/include/mockcpp/MockObjectHelper.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOCK_OBJECT_HELPER_H__ +#define __MOCKCPP_MOCK_OBJECT_HELPER_H__ + +#include +#include + +#include + +MOCKCPP_NS_START + +template +struct MockObjectTraits +{ + typedef typename MockObjectClass::MockedInterface TYPE; +}; + +MOCKCPP_NS_END + +#define METHOD(m) method(&m, #m) + +#define MOCK_METHOD(obj, m) \ + obj.method(&MOCKCPP_NS::MockObjectTraits::TYPE::m, \ + (MOCKCPP_NS::TypeString< \ + MOCKCPP_NS::MockObjectTraits::TYPE \ + >::value() + "::"#m).c_str()) + +#endif + diff --git a/cli/test/include/mockcpp/MoreStubBuilder.h b/cli/test/include/mockcpp/MoreStubBuilder.h new file mode 100644 index 0000000..2a72553 --- /dev/null +++ b/cli/test/include/mockcpp/MoreStubBuilder.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MORE_STUB_BUILDER_H +#define __MOCKCPP_MORE_STUB_BUILDER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Stub; + +template +struct MoreStubBuilder : public Builder +{ + MoreStubBuilder& then(Stub* stub); + + virtual ~MoreStubBuilder() {} + +private: + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#include + +#endif + + diff --git a/cli/test/include/mockcpp/MoreStubBuilder.tcc b/cli/test/include/mockcpp/MoreStubBuilder.tcc new file mode 100644 index 0000000..5ae8b45 --- /dev/null +++ b/cli/test/include/mockcpp/MoreStubBuilder.tcc @@ -0,0 +1,33 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include + +MOCKCPP_NS_START + +template +MoreStubBuilder& +MoreStubBuilder::then(Stub* stub) +{ + getMocker()->addStub(new ThenStub(stub)); + return *this; +} + +MOCKCPP_NS_END + diff --git a/cli/test/include/mockcpp/MsvcMethodInfoReader.h b/cli/test/include/mockcpp/MsvcMethodInfoReader.h new file mode 100644 index 0000000..4a7d92d --- /dev/null +++ b/cli/test/include/mockcpp/MsvcMethodInfoReader.h @@ -0,0 +1,85 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_MSVC_METHOD_INFO_READER_H +#define __MOCKCPP_MSVC_METHOD_INFO_READER_H + +#include +#include + +MOCKCPP_NS_START + +#ifdef MSVC_VMG_ENABLED + +struct MsvcVmgMFP +{ + void* m_func_address; + int m_delta; + int m_vtordisp; + int m_vtable_index; +}; + +template +union MsvcMethodUnion +{ + MsvcVmgMFP mfp; + Method method; +}; + +/////////////////////////////////////////////// +template +void* getAddrOfMethod(Method input) +{ + MsvcMethodUnion m; + m.method = input; + return m.mfp.m_func_address; +} + +/////////////////////////////////////////////////////////// + +#else + +// TODO +template +void* getAddrOfMethod(Method input) +{ + MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); + return 0; +} + +/////////////////////////////////////////////////////////// +// TODO +template +unsigned int getIndexOfMethod(Method method) +{ + MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); + return 0; +} + +/////////////////////////////////////////////////////////// +// TODO +template +unsigned int getDeltaOfMethod(Method method) +{ + MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); + return 0; +} +#endif + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/MsvcRtti.h b/cli/test/include/mockcpp/MsvcRtti.h new file mode 100644 index 0000000..c94f1ca --- /dev/null +++ b/cli/test/include/mockcpp/MsvcRtti.h @@ -0,0 +1,76 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_MSVC_RTTI_H_ +#define __MOCKCPP_MSVC_RTTI_H_ + +#ifdef _MSC_VER + +#include + +#include + +MOCKCPP_NS_START + +struct PMD +{ + int mdisp; //member displacement + int pdisp; //vbtable displacement + int vdisp; //displacement inside vbtable +}; + +struct RTTIBaseClassDescriptor +{ + std::type_info* typeInfo; //type descriptor of the class + unsigned int numContainedBases; //number of nested classes following in the Base Class Array + PMD where; //pointer-to-member displacement info + unsigned int attributes; //flags, usually 0 +}; + +struct RTTIClassHierarchyDescriptor +{ + unsigned int signature; //always zero? + unsigned int attributes; //bit 0 set = multiple inheritance, bit 1 set = virtual inheritance + unsigned int numBaseClasses; //number of classes in pBaseClassArray + RTTIBaseClassDescriptor** pBaseClassArray; + + RTTIClassHierarchyDescriptor(bool mi = false) + : signature(0),attributes(mi?1:0),numBaseClasses(0), pBaseClassArray(0) + { + } +}; + +struct RTTICompleteObjectLocator +{ + unsigned int signature; //always zero ? + unsigned int offset; //offset of this vtable in the complete class + unsigned int cdOffset; //constructor displacement offset + const std::type_info* typeInfo; //TypeDescriptor of the complete class + RTTIClassHierarchyDescriptor* pClassDescriptor; //describes inheritance hierarchy + + RTTICompleteObjectLocator(unsigned int index, + const std::type_info& info, RTTIClassHierarchyDescriptor* desc) + : signature(0), offset(index*sizeof(void*)), cdOffset(0) + , typeInfo(&info), pClassDescriptor(desc) + {} +}; + +MOCKCPP_NS_END + +#endif + +#endif diff --git a/cli/test/include/mockcpp/NormalResultHandler.h b/cli/test/include/mockcpp/NormalResultHandler.h new file mode 100644 index 0000000..a662bf1 --- /dev/null +++ b/cli/test/include/mockcpp/NormalResultHandler.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_NORMAL_RESULT_HANDLER_H +#define __MOCKCPP_NORMAL_RESULT_HANDLER_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; + +struct NormalResultHandler : public ResultHandler +{ + NormalResultHandler(bool castable); + + bool matches(const Any& result) const; + + const Any& getResult(const Any& result) const; + +private: + + const bool isCastable; + +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/NormalResultHandlerFactory.h b/cli/test/include/mockcpp/NormalResultHandlerFactory.h new file mode 100644 index 0000000..792b451 --- /dev/null +++ b/cli/test/include/mockcpp/NormalResultHandlerFactory.h @@ -0,0 +1,43 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_NORMAL_RESULT_HANDLER_FACTORY_H +#define __MOCKCPP_NORMAL_RESULT_HANDLER_FACTORY_H + +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////////////////// +struct NormalResultHandlerFactory + : public ResultHandlerFactory +{ + ResultHandler* create( + bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber); +}; + +/////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ObjNameGetter.h b/cli/test/include/mockcpp/ObjNameGetter.h new file mode 100644 index 0000000..9d3e9df --- /dev/null +++ b/cli/test/include/mockcpp/ObjNameGetter.h @@ -0,0 +1,38 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_OBJ_NAME_GETTER_H +#define __MOCKCPP_OBJ_NAME_GETTER_H + +#include + +#include + +MOCKCPP_NS_START + +struct ObjectNameGetter +{ + virtual const std::string& getName() const = 0; + + virtual ~ObjectNameGetter() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/OrderingMatcher.h b/cli/test/include/mockcpp/OrderingMatcher.h new file mode 100644 index 0000000..a4967dd --- /dev/null +++ b/cli/test/include/mockcpp/OrderingMatcher.h @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_ORDERING_MATCHER_H +#define __MOCKCPP_ORDERING_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; + +struct OrderingMatcher : public Matcher +{ + virtual ~OrderingMatcher() {} + virtual bool isCompleted(void) const = 0; + virtual void setOrderingInvocationMocker(InvocationMocker* mocker) = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/OutBound.h b/cli/test/include/mockcpp/OutBound.h new file mode 100644 index 0000000..bbc2729 --- /dev/null +++ b/cli/test/include/mockcpp/OutBound.h @@ -0,0 +1,60 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_OUTBOUND_H +#define __MOCKCPP_OUTBOUND_H + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +template +struct OutBound : public DecoratedConstraint +{ + OutBound(const T& val, Constraint* constraint = 0) + : ref(val), DecoratedConstraint(constraint) + {} + + bool evalSelf(const RefAny& val) const + { + return const_cast(val).changeValue(ref); + } + + std::string getName() const + { + return "outBound"; + } + + std::string getTypeAndValueString() const + { + return MOCKCPP_NS::toTypeAndValueString(ref); + } + +private: + + T ref; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/OutBoundPointer.h b/cli/test/include/mockcpp/OutBoundPointer.h new file mode 100644 index 0000000..93587d6 --- /dev/null +++ b/cli/test/include/mockcpp/OutBoundPointer.h @@ -0,0 +1,129 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_OUTBOUND_POINTER_H +#define __MOCKCPP_OUTBOUND_POINTER_H + +#include +#include +#include +#include + +MOCKCPP_NS_START + +void OutBoundPointerCheckConst(const std::string& typeString, bool isConst); + +/////////////////////////////////////////////////////// +template +struct OutBoundPointerBase +{ +}; + +/////////////////////////////////////////////////////// +template +struct OutBoundPointerBase: public DecoratedConstraint +{ +public: + OutBoundPointerBase(T* p, size_t size, Constraint* constraint) + : DecoratedConstraint(constraint), sizeOfBuffer(size) + { + if (size != 0) + { + pointer = (T*)(new char [size+1]); + ::memset((void*)pointer, 0, size+1); + ::memcpy((void*)pointer, (void*)p, size); + } + } + + ~OutBoundPointerBase() + { + if (pointer != 0) + { + delete [] (char*)pointer; + } + } + + bool evalSelf(const RefAny& val) const + { + T* p = any_cast(val); + if (p == 0) + { + return false; + } + + checkConst(); + + (void) memcpy((void*)p, (void*)pointer, sizeOfBuffer); + + return true; + } + + std::string getName() const + { + return "outBoundP"; + } + + std::string getTypeAndValueString() const + { + return MOCKCPP_NS::toTypeAndValueString(pointer); + } + +private: + + void checkConst() const + { + OutBoundPointerCheckConst(TypeString::value(), IsConst::isTrue); + } + +private: + + size_t sizeOfBuffer; + T* pointer; +}; + +////////////////////////////////////////////////////////////////////// +template +struct OutBoundPointer +{ +}; + +////////////////////////////////////////////////////////////////////// +template +struct OutBoundPointer : public OutBoundPointerBase +{ +public: + + OutBoundPointer(T* p, size_t size = 0, Constraint* constraint = 0) + : OutBoundPointerBase(p, size == 0 ? sizeof(T) : size, constraint) + { + } +}; + +////////////////////////////////////////////////////////////////////// +template <> +struct OutBoundPointer: public OutBoundPointerBase +{ +public: + + OutBoundPointer(void* p, size_t size, Constraint* constraint = 0); +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/OutputStringStream.h b/cli/test/include/mockcpp/OutputStringStream.h new file mode 100644 index 0000000..aac48eb --- /dev/null +++ b/cli/test/include/mockcpp/OutputStringStream.h @@ -0,0 +1,25 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ +#ifndef __MOCKCPP_OUTPUT_STRING_STREAM_H +#define __MOCKCPP_OUTPUT_STRING_STREAM_H + +#include + +typedef std::ostringstream oss_t; + +#endif diff --git a/cli/test/include/mockcpp/ParameterizedApiHookHolder.h b/cli/test/include/mockcpp/ParameterizedApiHookHolder.h new file mode 100644 index 0000000..3d418d9 --- /dev/null +++ b/cli/test/include/mockcpp/ParameterizedApiHookHolder.h @@ -0,0 +1,38 @@ + +#ifndef __MOCKCPP_PARAMETERIZED_API_HOOK_HOLDER_H__ +#define __MOCKCPP_PARAMETERIZED_API_HOOK_HOLDER_H__ + +#include +#include + +MOCKCPP_NS_START + +///////////////////////////////////////////////////// +template +struct ParameterizedApiHookHolder + : public ApiHookHolder +{ + const static unsigned int maxSeq = 25; + + ParameterizedApiHookHolder(F api) + { + (m_hook = ApiHookGenerator::findApiHook(api)) || + (m_hook = ApiHookGenerator::appyApiHook(api)); + } + + void * getApiHook() const + { return m_hook; } + + ~ParameterizedApiHookHolder() + { + ApiHookGenerator::freeApiHook(m_hook); + } + +private: + void* m_hook; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/PendingMatcher.h b/cli/test/include/mockcpp/PendingMatcher.h new file mode 100644 index 0000000..c1e3cd4 --- /dev/null +++ b/cli/test/include/mockcpp/PendingMatcher.h @@ -0,0 +1,66 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_PENDING_MATCHER_H +#define __MOCKCPP_PENDING_MATCHER_H + +#include +#include + +#include + +MOCKCPP_NS_START + +struct Invocation; +struct OrderingMatcher; +struct InvocationMockerNamespace; +struct InvocationMocker; + +struct PendingMatcher : public Matcher +{ + PendingMatcher(OrderingMatcher* orderingMatcher + , InvocationMockerNamespace* ns + , const std::string& identity + , InvocationMocker* ThisMocker); + + ~PendingMatcher(); + + bool matches(const Invocation& inv) const; + + void increaseInvoked(const Invocation& inv); + + std::string toString() const; + + void verify(); + +private: + + void setUpOrderingMatcher() const; + +private: + + mutable OrderingMatcher* matcher; + InvocationMockerNamespace* scope; + std::string id; + InvocationMocker* mocker; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ProcStub.h b/cli/test/include/mockcpp/ProcStub.h new file mode 100644 index 0000000..75b060a --- /dev/null +++ b/cli/test/include/mockcpp/ProcStub.h @@ -0,0 +1,196 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_PROC_STUB_H +#define __MOCKCPP_PROC_STUB_H + +#include +#include + +#include +#include +#include +#include + +MOCKCPP_NS_START + +template +struct ProcStub; + +struct ProcStubBaseImpl; + +struct ProcStubBase : public Stub +{ + ProcStubBase(const std::string& name, void* addr); + + ~ProcStubBase(); + + bool isCompleted() const; + + std::string toString() const; + +private: + + ProcStubBaseImpl* This; +}; + +//////////////////////////////////////////////////// +std::string getParameterMismatchString(int n + , std::string p + , const Invocation& inv); + +//////////////////////////////////////////////////// +#define MOCKCPP_CHECK_AND_ASSIGN_PARAMETER(N) \ + MOCKCPP_ASSERT_TRUE_MESSAGE( \ + getParameterMismatchString(N, TypeString::value(), inv) \ + , any_castable(inv.getParameterWithThis(N))); \ + MOCKP##N p##N = any_cast(inv.getParameterWithThis(N)); + +#define PROC_STUB_CONS() \ + ProcStub(Func f, std::string name) \ + : ProcStubBase(name, (void*)f), func(f) \ + {} + + +/////////////////////////////////////////////////////////// +#define PROC_STUB_DEF(n) \ +template \ +struct ProcStub : public ProcStubBase \ +{ \ + typedef R (*Func)(DECL_ARGS(n)); \ + \ + PROC_STUB_CONS() \ + \ + Any& invoke(const Invocation& inv) \ + { \ + SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ + \ + result = func(DECL_PARAMS(n)); \ + return result; \ + } \ + \ +private: \ + Func func; \ + Any result; \ +}; \ +template \ +Stub* invoke(R(*f)(DECL_ARGS(n)), const char* name = 0) \ +{ \ + return new ProcStub(f, name?name:""); \ +} \ +template \ +struct ProcStub : public ProcStubBase \ +{ \ + typedef void (*Func)(DECL_ARGS(n)); \ + \ + PROC_STUB_CONS() \ + \ + Any& invoke(const Invocation& inv) \ + { \ + SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ + \ + func(DECL_PARAMS(n)); \ + return getVoidAny(); \ + } \ + \ +private: \ + Func func; \ +} + +///////////////////////////////////////////////////// + +PROC_STUB_DEF(0); +PROC_STUB_DEF(1); +PROC_STUB_DEF(2); +PROC_STUB_DEF(3); +PROC_STUB_DEF(4); +PROC_STUB_DEF(5); +PROC_STUB_DEF(6); +PROC_STUB_DEF(7); +PROC_STUB_DEF(8); +PROC_STUB_DEF(9); +PROC_STUB_DEF(10); +PROC_STUB_DEF(11); +PROC_STUB_DEF(12); +// one more for C++ Member Method(1 'this' pointer + 12 parameters = 13) +PROC_STUB_DEF(13); + +#define VARDIC_PROC_STUB_DEF(n) \ +template \ +struct ProcStub : public ProcStubBase \ +{ \ + typedef R (*Func)(DECL_VARDIC_ARGS(n) ...); \ + \ + PROC_STUB_CONS() \ + \ + Any& invoke(const Invocation& inv) \ + { \ + SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ + \ + result = func(DECL_PARAMS(n)); \ + return result; \ + } \ + \ +private: \ + Func func; \ + Any result; \ +}; \ +template \ +Stub* invoke(R(*f)(DECL_VARDIC_ARGS(n) ...), const char* name = 0) \ +{ \ + return new ProcStub(f, name?name:""); \ +} \ +template \ +struct ProcStub : public ProcStubBase \ +{ \ + typedef void (*Func)(DECL_VARDIC_ARGS(n) ...); \ + \ + PROC_STUB_CONS() \ + \ + Any& invoke(const Invocation& inv) \ + { \ + SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ + \ + func(DECL_PARAMS(n)); \ + return getVoidAny(); \ + } \ + \ +private: \ + Func func; \ +} +///////////////////////////////////////////////////// +VARDIC_PROC_STUB_DEF(0); +VARDIC_PROC_STUB_DEF(1); +VARDIC_PROC_STUB_DEF(2); +VARDIC_PROC_STUB_DEF(3); +VARDIC_PROC_STUB_DEF(4); +VARDIC_PROC_STUB_DEF(5); +VARDIC_PROC_STUB_DEF(6); +VARDIC_PROC_STUB_DEF(7); +VARDIC_PROC_STUB_DEF(8); + +///////////////////////////////////////////////////// + +#define PROC(function) function, #function + +///////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ProcessWith.h b/cli/test/include/mockcpp/ProcessWith.h new file mode 100644 index 0000000..e123fc6 --- /dev/null +++ b/cli/test/include/mockcpp/ProcessWith.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_PROCESS_WITH_H +#define __MOCKCPP_PROCESS_WITH_H + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct ProcessWith: public Constraint +{ + ProcessWith(Proc proc) + : proc(proc) + {} + + bool eval(const RefAny& val) const + { + if(!any_castable(val)) return false; + + proc(any_cast(val)); + + return true; + } + + std::string toString() const + { + return std::string("operate(") + + MOCKCPP_NS::toTypeAndValueString(proc) + + std::string(")"); + } + +private: + + mutable Proc proc; +}; + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/RepeatMacros.h b/cli/test/include/mockcpp/RepeatMacros.h new file mode 100644 index 0000000..4a5397d --- /dev/null +++ b/cli/test/include/mockcpp/RepeatMacros.h @@ -0,0 +1,70 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_REPEAT_MACROS_H +#define __MOCKCPP_REPEAT_MACROS_H + +#define REPEAT_0(macro) +#define REPEAT_1(macro) REPEAT_0(macro) +#define REPEAT_2(macro) REPEAT_1(macro) macro(1) +#define REPEAT_3(macro) REPEAT_2(macro) macro(2) +#define REPEAT_4(macro) REPEAT_3(macro) macro(3) +#define REPEAT_5(macro) REPEAT_4(macro) macro(4) +#define REPEAT_6(macro) REPEAT_5(macro) macro(5) +#define REPEAT_7(macro) REPEAT_6(macro) macro(6) +#define REPEAT_8(macro) REPEAT_7(macro) macro(7) +#define REPEAT_9(macro) REPEAT_8(macro) macro(8) +#define REPEAT_10(macro) REPEAT_9(macro) macro(9) +#define REPEAT_11(macro) REPEAT_10(macro) macro(10) +#define REPEAT_12(macro) REPEAT_11(macro) macro(11) +#define REPEAT_13(macro) REPEAT_12(macro) macro(12) +#define REPEAT_14(macro) REPEAT_13(macro) macro(13) +#define REPEAT_15(macro) REPEAT_14(macro) macro(14) +#define REPEAT_16(macro) REPEAT_15(macro) macro(15) +#define REPEAT_17(macro) REPEAT_16(macro) macro(16) +#define REPEAT_18(macro) REPEAT_17(macro) macro(17) +#define REPEAT_19(macro) REPEAT_18(macro) macro(18) +#define REPEAT_20(macro) REPEAT_19(macro) macro(19) + +#define END_MACRO_0(macro) +#define END_MACRO_1(macro) macro(1) +#define END_MACRO_2(macro) macro(2) +#define END_MACRO_3(macro) macro(3) +#define END_MACRO_4(macro) macro(4) +#define END_MACRO_5(macro) macro(5) +#define END_MACRO_6(macro) macro(6) +#define END_MACRO_7(macro) macro(7) +#define END_MACRO_8(macro) macro(8) +#define END_MACRO_9(macro) macro(9) +#define END_MACRO_10(macro) macro(10) +#define END_MACRO_11(macro) macro(11) +#define END_MACRO_12(macro) macro(12) +#define END_MACRO_13(macro) macro(13) +#define END_MACRO_14(macro) macro(14) +#define END_MACRO_15(macro) macro(15) +#define END_MACRO_16(macro) macro(16) +#define END_MACRO_17(macro) macro(17) +#define END_MACRO_18(macro) macro(18) +#define END_MACRO_19(macro) macro(19) +#define END_MACRO_20(macro) macro(20) + +#define REPEAT(n, macro, end_macro) REPEAT_##n (macro) END_MACRO_##n(end_macro) +#define SIMPLE_REPEAT(n, macro) REPEAT(n, macro, macro) + +#endif + diff --git a/cli/test/include/mockcpp/RepeatStub.h b/cli/test/include/mockcpp/RepeatStub.h new file mode 100644 index 0000000..63e35df --- /dev/null +++ b/cli/test/include/mockcpp/RepeatStub.h @@ -0,0 +1,49 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_REPEAT_STUB_H +#define __MOCKCPP_REPEAT_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct RepeatStub : public TypelessStub +{ + RepeatStub(const Any& value, unsigned int times); + + bool isCompleted() const; + + Any& invoke(void); + + std::string toString(void) const; + + const std::type_info& type() const; + +private: + + Any returnValue; + unsigned int repeatedTimes; + const unsigned int repeatTimes; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ReportFailure.h b/cli/test/include/mockcpp/ReportFailure.h new file mode 100644 index 0000000..c5bf030 --- /dev/null +++ b/cli/test/include/mockcpp/ReportFailure.h @@ -0,0 +1,51 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_REPORT_FAILURE_H +#define __MOCKCPP_REPORT_FAILURE_H + +#include +#include + +MOCKCPP_NS_START + +void +reportFailure + ( unsigned int line + , const char* file + , const std::string& message); + +#define MOCKCPP_REPORT_FAILURE(msg) \ + MOCKCPP_NS::reportFailure(__LINE__, __FILE__, msg) + +#define MOCKCPP_ASSERT_FALSE(msg, expr) do {\ + if(expr) { \ + MOCKCPP_REPORT_FAILURE(msg); \ + } \ +} while(0) + +#define MOCKCPP_ASSERT_TRUE(msg, expr) do {\ + if(!(expr)) { \ + MOCKCPP_REPORT_FAILURE(msg); \ + } \ +} while(0) + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Result.h b/cli/test/include/mockcpp/Result.h new file mode 100644 index 0000000..40cc6c5 --- /dev/null +++ b/cli/test/include/mockcpp/Result.h @@ -0,0 +1,50 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RESULT_H +#define __MOCKCPP_RESULT_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct SelfDescribe; +struct ResultImpl; + +struct Result +{ + Result( bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber); + + ~Result(); + + const Any& getResult(const Any& result) const; + +private: + + ResultImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ResultHandler.h b/cli/test/include/mockcpp/ResultHandler.h new file mode 100644 index 0000000..a047349 --- /dev/null +++ b/cli/test/include/mockcpp/ResultHandler.h @@ -0,0 +1,40 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RESULT_HANDLER_H +#define __MOCKCPP_RESULT_HANDLER_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; + +struct ResultHandler +{ + virtual ~ResultHandler() {} + + virtual bool matches(const Any& val) const = 0; + virtual const Any& getResult(const Any& val) const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ResultHandlerFactory.h b/cli/test/include/mockcpp/ResultHandlerFactory.h new file mode 100644 index 0000000..88a0df0 --- /dev/null +++ b/cli/test/include/mockcpp/ResultHandlerFactory.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RESULT_HANDLER_FACTORY_H +#define __MOCKCPP_RESULT_HANDLER_FACTORY_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct SelfDescribe; +struct ResultHandler; +struct ResultImpl; + +struct ResultHandlerFactory +{ + virtual ResultHandler* create( + bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber) = 0; + + virtual ~ResultHandlerFactory() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ReturnObjectList.h b/cli/test/include/mockcpp/ReturnObjectList.h new file mode 100644 index 0000000..c101dba --- /dev/null +++ b/cli/test/include/mockcpp/ReturnObjectList.h @@ -0,0 +1,64 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RETURN_OBJECT_LIST_H +#define __MOCKCPP_RETURN_OBJECT_LIST_H + +#include +#include + +MOCKCPP_NS_START + +struct ReturnObjectListImpl; + +struct ReturnObjectList : public TypelessStub +{ +public: + + ReturnObjectList( const Any& o01 = Any() + , const Any& o02 = Any() + , const Any& o03 = Any() + , const Any& o04 = Any() + , const Any& o05 = Any() + , const Any& o06 = Any() + , const Any& o07 = Any() + , const Any& o08 = Any() + , const Any& o09 = Any() + , const Any& o10 = Any() + , const Any& o11 = Any() + , const Any& o12 = Any() + ); + + ~ReturnObjectList(); + + bool isCompleted(void) const; + Any& invoke(void); + + std::string toString(void) const; + + const std::type_info& type() const; + +private: + + ReturnObjectListImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ReturnStub.h b/cli/test/include/mockcpp/ReturnStub.h new file mode 100644 index 0000000..06b88a1 --- /dev/null +++ b/cli/test/include/mockcpp/ReturnStub.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_RETURN_STUB_H +#define __MOCKCPP_RETURN_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct ReturnStub : public TypelessStub +{ + ReturnStub(const Any& value); + + bool isCompleted() const; + + Any& invoke(void); + + std::string toString(void) const; + + const std::type_info& type() const; + +private: + Any returnValue; + bool hasBeenInvoked; + +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/SelfDescribe.h b/cli/test/include/mockcpp/SelfDescribe.h new file mode 100644 index 0000000..1a222e9 --- /dev/null +++ b/cli/test/include/mockcpp/SelfDescribe.h @@ -0,0 +1,36 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_SELF_DESCRIBE_H +#define __MOCKCPP_SELF_DESCRIBE_H + +#include +#include + +MOCKCPP_NS_START + +struct SelfDescribe +{ + virtual ~SelfDescribe() {} + virtual std::string toString() const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/SimpleInvocationRecorder.h b/cli/test/include/mockcpp/SimpleInvocationRecorder.h new file mode 100644 index 0000000..a5ac8a1 --- /dev/null +++ b/cli/test/include/mockcpp/SimpleInvocationRecorder.h @@ -0,0 +1,44 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_SIMPLE_INVOCATION_RECORDER_H +#define __MOCKCPP_SIMPLE_INVOCATION_RECORDER_H + +#include +#include + +MOCKCPP_NS_START + +struct SimpleInvocationRecorder + : public InvokedTimesRecorder +{ + SimpleInvocationRecorder(); + + unsigned int getInvokedTimes() const; + + void increaseInvoked(); + +protected: + + unsigned int invokedTimes; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/Spy.h b/cli/test/include/mockcpp/Spy.h new file mode 100644 index 0000000..250cffb --- /dev/null +++ b/cli/test/include/mockcpp/Spy.h @@ -0,0 +1,55 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_SPY_H +#define __MOCKCPP_SPY_H + +#include +#include + +MOCKCPP_NS_START + +struct RefAny; + +template +struct Spy : public Constraint +{ + Spy(T& reference) + : ref(reference) + {} + + bool eval(const RefAny& inv) const + { + if(!any_castable(inv)) return false; + ref = any_cast(inv); + return true; + } + + std::string toString() const + { + return "spy(" + toTypeAndValueString(ref) + ")"; + } + +private: + T& ref; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/StatelessMatcher.h b/cli/test/include/mockcpp/StatelessMatcher.h new file mode 100644 index 0000000..02ec5cb --- /dev/null +++ b/cli/test/include/mockcpp/StatelessMatcher.h @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STATELESS_MATCHER_H +#define __MOCKCPP_STATELESS_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct Invocation; + +struct StatelessMatcher : public Matcher +{ + virtual ~StatelessMatcher() {} + virtual bool matches(const Invocation& inv) const = 0; + virtual void increaseInvoked(const Invocation& inv) {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/StringConstraint.h b/cli/test/include/mockcpp/StringConstraint.h new file mode 100644 index 0000000..dfc6c27 --- /dev/null +++ b/cli/test/include/mockcpp/StringConstraint.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STRING_CONSTRAINT_H +#define __MOCKCPP_STRING_CONSTRAINT_H + +#include +#include + +MOCKCPP_NS_START + +struct StringPredict; + +struct StringConstraint: public Constraint +{ + StringConstraint(const std::string& s, StringPredict* pred); + ~StringConstraint(); + + bool eval(const RefAny& val) const; + + std::string toString() const; + +private: + std::string str; + StringPredict* predict; +}; + +MOCKCPP_NS_END + +#endif + + diff --git a/cli/test/include/mockcpp/StringPredict.h b/cli/test/include/mockcpp/StringPredict.h new file mode 100644 index 0000000..a7a11ea --- /dev/null +++ b/cli/test/include/mockcpp/StringPredict.h @@ -0,0 +1,39 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STRING_PREDICT_H +#define __MOCKCPP_STRING_PREDICT_H + +#include +#include + +MOCKCPP_NS_START + +struct StringPredict +{ + virtual bool predict(const std::string& input, const std::string& target) const = 0; + virtual std::string toString(const std::string& target) const = 0; + + virtual ~StringPredict() {} +}; + +MOCKCPP_NS_END + +#endif + + diff --git a/cli/test/include/mockcpp/Stub.h b/cli/test/include/mockcpp/Stub.h new file mode 100644 index 0000000..038c04c --- /dev/null +++ b/cli/test/include/mockcpp/Stub.h @@ -0,0 +1,41 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STUB_H +#define __MOCKCPP_STUB_H + +#include + +#include + +MOCKCPP_NS_START + +struct Any; +struct Invocation; + +struct Stub : public SelfDescribe +{ + virtual ~Stub() {} + virtual bool isCompleted() const = 0; + virtual Any& invoke(const Invocation& inv) = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/StubBuilder.h b/cli/test/include/mockcpp/StubBuilder.h new file mode 100644 index 0000000..c9aaabf --- /dev/null +++ b/cli/test/include/mockcpp/StubBuilder.h @@ -0,0 +1,47 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STUB_BUILDER_H +#define __MOCKCPP_STUB_BUILDER_H + +#include +#include + +MOCKCPP_NS_START + +struct InvocationMocker; +struct Stub; + +template +struct StubBuilder : public Builder +{ + Builder& will(Stub* stub); + + virtual ~StubBuilder() {} + +private: + + virtual InvocationMocker* getMocker() const = 0; +}; + +MOCKCPP_NS_END + +#include + +#endif + diff --git a/cli/test/include/mockcpp/StubBuilder.tcc b/cli/test/include/mockcpp/StubBuilder.tcc new file mode 100644 index 0000000..3c8cc2c --- /dev/null +++ b/cli/test/include/mockcpp/StubBuilder.tcc @@ -0,0 +1,33 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#include +#include + +MOCKCPP_NS_START + +template +Builder& StubBuilder::will(Stub* stub) +{ + getMocker()->addStub(new WillStub(stub)); + return *this; +} + +MOCKCPP_NS_END + + diff --git a/cli/test/include/mockcpp/StubContainer.h b/cli/test/include/mockcpp/StubContainer.h new file mode 100644 index 0000000..d0f3786 --- /dev/null +++ b/cli/test/include/mockcpp/StubContainer.h @@ -0,0 +1,52 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STUB_CONTAINER_H +#define __MOCKCPP_STUB_CONTAINER_H + +#include + +#include + +MOCKCPP_NS_START + +struct Stub; +struct StubContainerImpl; + +struct StubContainer +{ + StubContainer(const std::string& space); + ~StubContainer(); + + void addStub(Stub* stub); + + Stub* getStub() const; + + void reset(); + + std::string toString() const; + +private: + + StubContainerImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/StubsBuilder.h b/cli/test/include/mockcpp/StubsBuilder.h new file mode 100644 index 0000000..5baaf36 --- /dev/null +++ b/cli/test/include/mockcpp/StubsBuilder.h @@ -0,0 +1,44 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STUBS_BUILDER_H +#define __MOCKCPP_STUBS_BUILDER_H + +#include + +#include +#include +#include +#include + +MOCKCPP_NS_START + +/////////////////////////////////////////////// +typedef InvocationMockBuilder< + ArgumentsMatchBuilder< + StubBuilder< + MoreStubBuilder<> + > + > + > StubsBuilder; +/////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/StubsMatcher.h b/cli/test/include/mockcpp/StubsMatcher.h new file mode 100644 index 0000000..d88a904 --- /dev/null +++ b/cli/test/include/mockcpp/StubsMatcher.h @@ -0,0 +1,40 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_STUBS_MATCHER_H +#define __MOCKCPP_STUBS_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct Invocation; + +struct StubsMatcher : public Matcher +{ + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + void verify(); + std::string toString() const; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TestFailureMatcher.h b/cli/test/include/mockcpp/TestFailureMatcher.h new file mode 100644 index 0000000..e631288 --- /dev/null +++ b/cli/test/include/mockcpp/TestFailureMatcher.h @@ -0,0 +1,45 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TEST_FAILURE_MATCHER_H +#define __MOCKCPP_TEST_FAILURE_MATCHER_H + +#include +#include + +MOCKCPP_NS_START + +struct TestFailureMatcher : public Matcher +{ + TestFailureMatcher(const std::string& msg + ,const std::string& str); + + bool matches(const Invocation& inv) const; + void increaseInvoked(const Invocation& inv); + std::string toString(void) const; + void verify(void); + +private: + std::string msg; + std::string str; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ThenStub.h b/cli/test/include/mockcpp/ThenStub.h new file mode 100644 index 0000000..151e08f --- /dev/null +++ b/cli/test/include/mockcpp/ThenStub.h @@ -0,0 +1,49 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_THEN_STUB_H +#define __MOCKCPP_THEN_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct Invocation; + +struct ThenStub : public Stub +{ + ThenStub(Stub* stub); + + ~ThenStub(); + + bool isCompleted(void) const; + Any& invoke(const Invocation& inv); + + std::string toString() const; + +private: + + Stub* expectedStub; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/ThrowExceptionStub.h b/cli/test/include/mockcpp/ThrowExceptionStub.h new file mode 100644 index 0000000..510a195 --- /dev/null +++ b/cli/test/include/mockcpp/ThrowExceptionStub.h @@ -0,0 +1,74 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_THROW_EXCEPTION_STUB_H +#define __MOCKCPP_THROW_EXCEPTION_STUB_H + +#include +#include +#include +#include + +MOCKCPP_NS_START + +template +struct ThrowExceptionStub : public TypelessStub +{ + ThrowExceptionStub(T ex) + : excep(ex), hasBeenInvoked(false) + {} + + bool isCompleted() const + { + return hasBeenInvoked; + } + + Any& invoke(void) + { + hasBeenInvoked = true; + + throw excep; + + return getEmptyAny(); + } + + std::string toString(void) const + { + oss_t oss; + + oss << "throws(" << MOCKCPP_NS::toString(excep) << ")"; + + return oss.str(); + } + + const std::type_info& type() const + { + return typeid(T); + } + +private: + + bool hasBeenInvoked; + + T excep; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TypeString.h b/cli/test/include/mockcpp/TypeString.h new file mode 100644 index 0000000..bf838b3 --- /dev/null +++ b/cli/test/include/mockcpp/TypeString.h @@ -0,0 +1,53 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TYPE_STRING_H +#define __MOCKCPP_TYPE_STRING_H + +#include + +#include + +#include +#include + +MOCKCPP_NS_START + +std::string getDemangledName(const std::type_info& typeInfo); + +template struct TypeString +{ + static std::string value() + { + return getDemangledName(typeid(T)); + } +}; + +template <> +struct TypeString +{ + static std::string value() + { + return "std::string"; + } +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TypeTraits.h b/cli/test/include/mockcpp/TypeTraits.h new file mode 100644 index 0000000..ba79b8e --- /dev/null +++ b/cli/test/include/mockcpp/TypeTraits.h @@ -0,0 +1,108 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + + +#ifndef __MOCKCPP_TYPE_TRAITS_H +#define __MOCKCPP_TYPE_TRAITS_H + +#include + +MOCKCPP_NS_START + +/* + * For non-reference type + */ +template +struct TypeTraits +{ + typedef T Raw; + typedef T& RefRaw; + + typedef T Type; + typedef T& Ref; +}; + +/* + * For non-reference type + */ +template +struct TypeTraits +{ + typedef T Raw; + typedef T& RefRaw; + + typedef T Type; + typedef const T& Ref; +}; + +/* + * For non-reference type + */ +template +struct TypeTraits +{ + typedef T* Raw; + typedef T*& RefRaw; + + typedef const T* Type; + typedef const T*& Ref; +}; + +/* + * For reference type + */ +template +struct TypeTraits +{ + typedef T Raw; + typedef T& RefRawx; + + typedef T Type; + typedef T& Ref; +}; + +/* + * For reference type + */ +template +struct TypeTraits +{ + typedef T Raw; + typedef T& RefRaw; + + typedef T Type; + typedef const T& Ref; +}; + +/* + * For non-reference type + */ +template <> +struct TypeTraits +{ + typedef void Raw; + typedef void RefRaw; + + typedef void Type; + typedef void Ref; +}; + +MOCKCPP_NS_END + +#endif // __MOCKCPP_TYPE_TRAITS_H + diff --git a/cli/test/include/mockcpp/TypelessConstraint.h b/cli/test/include/mockcpp/TypelessConstraint.h new file mode 100644 index 0000000..bf89ae1 --- /dev/null +++ b/cli/test/include/mockcpp/TypelessConstraint.h @@ -0,0 +1,37 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TYPELESS_CONSTRAINT_H +#define __MOCKCPP_TYPELESS_CONSTRAINT_H + +#include +#include + +MOCKCPP_NS_START + +struct TypelessConstraint +{ + virtual ~TypelessConstraint() {} + virtual bool eval(void) const = 0; + virtual std::string toString() const = 0; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TypelessConstraintAdapter.h b/cli/test/include/mockcpp/TypelessConstraintAdapter.h new file mode 100644 index 0000000..901540f --- /dev/null +++ b/cli/test/include/mockcpp/TypelessConstraintAdapter.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TYPELESS_CONSTRAINT_ADAPTER_H +#define __MOCKCPP_TYPELESS_CONSTRAINT_ADAPTER_H + +#include +#include + +MOCKCPP_NS_START + +struct RefAny; +struct TypelessConstraint; +struct TypelessConstraintAdapterImpl; + +struct TypelessConstraintAdapter : public Constraint +{ + TypelessConstraintAdapter(TypelessConstraint* tc); + ~TypelessConstraintAdapter(); + + virtual bool eval(const RefAny& p) const; + virtual std::string toString() const; + + TypelessConstraint* getAdaptedConstraint() const; + +private: + TypelessConstraintAdapterImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TypelessStub.h b/cli/test/include/mockcpp/TypelessStub.h new file mode 100644 index 0000000..6d4cbb8 --- /dev/null +++ b/cli/test/include/mockcpp/TypelessStub.h @@ -0,0 +1,42 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TYPELESS_STUB_H +#define __MOCKCPP_TYPELESS_STUB_H + +#include +#include +#include + +MOCKCPP_NS_START + +struct Any; + +struct TypelessStub +{ + virtual bool isCompleted() const = 0; + virtual Any& invoke(void) = 0; + virtual std::string toString(void) const = 0; + + virtual ~TypelessStub() {} +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/TypelessStubAdapter.h b/cli/test/include/mockcpp/TypelessStubAdapter.h new file mode 100644 index 0000000..6703025 --- /dev/null +++ b/cli/test/include/mockcpp/TypelessStubAdapter.h @@ -0,0 +1,50 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_TYPELESS_STUB_ADAPTER_H +#define __MOCKCPP_TYPELESS_STUB_ADAPTER_H + +#include +#include + +MOCKCPP_NS_START + +struct TypelessStub; +struct Invocation; + +struct TypelessStubAdapter : public Stub +{ + TypelessStubAdapter(TypelessStub* ts); + + ~TypelessStubAdapter(); + + bool isCompleted() const; + + Any& invoke(const Invocation& inv); + + std::string toString(void) const; + +private: + + TypelessStub* stub; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/VirtualTable.h b/cli/test/include/mockcpp/VirtualTable.h new file mode 100644 index 0000000..ab85970 --- /dev/null +++ b/cli/test/include/mockcpp/VirtualTable.h @@ -0,0 +1,61 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_VIRTUAL_TABLE_H +#define __MOCKCPP_VIRTUAL_TABLE_H + +#include + +#include + +MOCKCPP_NS_START + +struct ObjectNameGetter; +struct IndexInvokableGetter; +struct VirtualTableImpl; + +struct VirtualTable +{ + VirtualTable( IndexInvokableGetter* getter + , ObjectNameGetter* nameGetter + , unsigned int numberOfVptr + , const std::type_info&); + + ~VirtualTable(); + + void* toPointerToInterface() const; + + void addMethod(void* methodAddr, unsigned int indexOfVtbl, unsigned int indexofVptr = 0); + void setDestructor(unsigned int vptrIndex, unsigned int vtblIndex); + + void expectsBeingDeleted(); + void expectsKeepAlive(); + + void verify(); + void reset(); + + static IndexInvokableGetter* getInvokableGetter(void* Caller, unsigned int indexOfVptr); + +private: + VirtualTableImpl* This; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/VirtualTableUtils.h b/cli/test/include/mockcpp/VirtualTableUtils.h new file mode 100644 index 0000000..e7f8fb9 --- /dev/null +++ b/cli/test/include/mockcpp/VirtualTableUtils.h @@ -0,0 +1,34 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_VIRTUAL_TABLE_UTILS_H +#define __MOCKCPP_VIRTUAL_TABLE_UTILS_H + +#include +#include + +MOCKCPP_NS_START + +void** createVtbls(unsigned int numberOfVptr); +void freeVtbls(void** vtbl, unsigned int numberOfVtpr); +unsigned int getRealVtblIndex(unsigned int indexOfVptr, unsigned int indexOfVtbl); +void initializeVtbls(void** vptr, void**vtbl, unsigned int numberOfVtpr, const std::type_info& info, bool hasRtti); + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/Void.h b/cli/test/include/mockcpp/Void.h new file mode 100644 index 0000000..89951dc --- /dev/null +++ b/cli/test/include/mockcpp/Void.h @@ -0,0 +1,31 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_VOID_H +#define __MOCKCPP_VOID_H + +#include + +MOCKCPP_NS_START + +struct Void {}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/VoidResultHandler.h b/cli/test/include/mockcpp/VoidResultHandler.h new file mode 100644 index 0000000..5e3c30f --- /dev/null +++ b/cli/test/include/mockcpp/VoidResultHandler.h @@ -0,0 +1,56 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_VOID_RESULT_HANDLER_H +#define __MOCKCPP_VOID_RESULT_HANDLER_H + +#include +#include + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct SelfDescribe; + +/////////////////////////////////////////////////////////// +struct VoidResultHandler: public ResultHandler +{ + VoidResultHandler( const std::type_info& typeInfo + , const std::string& expectedTypeString + , const SelfDescribe* resultProvider); + + bool matches(const Any& val) const; + + const Any& getResult(const Any& val) const; + +private: + + const std::type_info& expectedTypeInfo; + const std::string expectedTypeString; + const SelfDescribe* resultProvider; +}; + +/////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/VoidResultHandlerFactory.h b/cli/test/include/mockcpp/VoidResultHandlerFactory.h new file mode 100644 index 0000000..ecfb508 --- /dev/null +++ b/cli/test/include/mockcpp/VoidResultHandlerFactory.h @@ -0,0 +1,46 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_VOID_RESULT_HANDLER_FACTORY_H +#define __MOCKCPP_VOID_RESULT_HANDLER_FACTORY_H + +#include +#include + +MOCKCPP_NS_START + +struct ResultHandler; + +/////////////////////////////////////////////////////////// +struct VoidResultHandlerFactory + : public ResultHandlerFactory +{ +public: + ResultHandler* create( + bool isCastable + , const std::type_info& expectedTypeInfo + , const std::string& expectedTypeString + , const SelfDescribe* selfDescriber); +}; + +/////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/WillStub.h b/cli/test/include/mockcpp/WillStub.h new file mode 100644 index 0000000..67b8175 --- /dev/null +++ b/cli/test/include/mockcpp/WillStub.h @@ -0,0 +1,49 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_WILL_STUB_H +#define __MOCKCPP_WILL_STUB_H + +#include +#include + +MOCKCPP_NS_START + +struct Any; +struct Invocation; + +struct WillStub : public Stub +{ + WillStub(Stub* stub); + + ~WillStub(); + + bool isCompleted(void) const; + Any& invoke(const Invocation& inv); + + std::string toString() const; + +private: + + Stub* expectedStub; +}; + +MOCKCPP_NS_END + +#endif + diff --git a/cli/test/include/mockcpp/WinCodeModifier.h b/cli/test/include/mockcpp/WinCodeModifier.h new file mode 100644 index 0000000..144b605 --- /dev/null +++ b/cli/test/include/mockcpp/WinCodeModifier.h @@ -0,0 +1,35 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2010> + + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_WINCODEMODIFIER_H__ +#define __MOCKCPP_WINCODEMODIFIER_H__ + +#include + +MOCKCPP_NS_START + +struct WinCodeModifier : public CodeModifier +{ + bool modify(void *dest, void *src, size_t size); +}; + + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/include/mockcpp/mockable.h b/cli/test/include/mockcpp/mockable.h new file mode 100644 index 0000000..25d6ae9 --- /dev/null +++ b/cli/test/include/mockcpp/mockable.h @@ -0,0 +1,33 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOCKABLE_H +#define __MOCKCPP_MOCKABLE_H + +#if defined(__cplusplus) && defined(MOCKCPP_USE_MOCKABLE) +# include +# include +# define MOCKABLE(function) MOCKER(function).defaults().will(invoke(function)); \ + MOCKCPP_NS::Functor function(#function, __FUNCTION__) +# define MCALL(function) MOCKCPP_NS::Functor(#function, __FUNCTION__) +#else +# define MOCKABLE(function) +# define MCALL(function) function +#endif + +#endif diff --git a/cli/test/include/mockcpp/mockcpp.h b/cli/test/include/mockcpp/mockcpp.h new file mode 100644 index 0000000..badf31f --- /dev/null +++ b/cli/test/include/mockcpp/mockcpp.h @@ -0,0 +1,92 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_H +#define __MOCKCPP_H + +#ifdef _MSC_VER +#define _MOCKCPP_COMPILER_MSVC _MSC_VER +#elif defined(__GNUC__) +#define _MOCKCPP_COMPILER_GNUC +#else +#error "Unknown compiler!" +#endif + +#if !defined(MOCKCPP_NO_NAMESPACE) || (MOCKCPP_NO_NAMESPACE == 0) +# define MOCKCPP_NS mockcpp +# define MOCKCPP_NS_START namespace MOCKCPP_NS { +# define MOCKCPP_NS_END } +# define USING_MOCKCPP_NS using namespace MOCKCPP_NS; +#else +# define MOCKCPP_NS +# define MOCKCPP_NS_START +# define MOCKCPP_NS_END +# define USING_MOCKCPP_NS +#endif + +#ifdef _MSC_VER +# define MOCKCPP_EXPORT __declspec(dllexport) +#else +# define MOCKCPP_EXPORT +#endif + +#if ( defined (__aarch64__)) + +#define BUILD_FOR_AARCH64 + +#elif ( defined (__arm__)) + +#define BUILD_FOR_AARCH32 + +#elif ( defined (__LP64__) \ + || defined (__64BIT__) \ + || defined (_LP64) \ + || ((defined(__WORDSIZE)) && (__WORDSIZE == 64)) \ + || defined(_WIN64)) + +#define BUILD_FOR_X64 + +#else + +#define BUILD_FOR_X86 + +#endif + +MOCKCPP_NS_START + +namespace __CHECK { + + template + struct STATIC_ASSERT_FAILURE; + + template<> struct STATIC_ASSERT_FAILURE + { + enum { value = 1 }; + }; + + template struct STATIC_ASSERT_TEST; + +#define MOCKCPP_STATIC_ASSERT(C) \ + typedef MOCKCPP_NS::__CHECK::STATIC_ASSERT_TEST< \ + sizeof(MOCKCPP_NS::__CHECK::STATIC_ASSERT_FAILURE)> \ + mockcpp_static_assert_typedef +} + +MOCKCPP_NS_END +#endif // __MOCKCPP_H + diff --git a/cli/test/include/mockcpp/mockcpp.hpp b/cli/test/include/mockcpp/mockcpp.hpp new file mode 100644 index 0000000..f71155b --- /dev/null +++ b/cli/test/include/mockcpp/mockcpp.hpp @@ -0,0 +1,29 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_HPP_ +#define __MOCKCPP_HPP_ + +#define MSVC_VMG_ENABLED +#include +#include +#include +#include + +#endif + diff --git a/cli/test/include/mockcpp/mokc.h b/cli/test/include/mockcpp/mokc.h new file mode 100644 index 0000000..1ec966a --- /dev/null +++ b/cli/test/include/mockcpp/mokc.h @@ -0,0 +1,52 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKCPP_MOKC_H +#define __MOCKCPP_MOKC_H + +#ifdef __cplusplus +# include +# include + +# if defined(MOCKCPP_USE_MOCKABLE) +# include +# define MOCKER(api) MOCKCPP_NS::GlobalMockObject::instance.method(#api) +# else +# include +// @TODO : write instructions +// @TODO : update mockcpp +//# define __MOCKER_MODE_1(api) MOCKCPP_NS::mockAPI<>::get(#api, "", api) +//# define __MOCKER_MODE_2(api, API) MOCKCPP_NS::mockAPI::get(#api, #API, api) +//# define __MOCKER_CPP_MODE_1(api) MOCKCPP_NS::mockAPI<>::get(#api, "", api) +//# define __MOCKER_CPP_MODE_2(api, API) MOCKCPP_NS::mockAPI::get(#api, #API, api) +//# define __MOCKER_CPP_VIRTUAL_MODE_1(obj, api) MOCKCPP_NS::mockAPI<>::get_virtual(#api, "", obj, api) +//# define __MOCKER_CPP_VIRTUAL_MODE_2(obj, api, API) MOCKCPP_NS::mockAPI::get_virtual(#api, #API, obj, api) +# define MOCKER(api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get(#api, ""#__VA_ARGS__, api) +# define MOCKER_CPP(api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get(#api, ""#__VA_ARGS__, api) +# define MOCKER_CPP_VIRTUAL(obj, api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get_virtual(#api, ""#__VA_ARGS__, obj, api) +// adapter for amock +# define AMOCKER MOCKER +# define LLT_GLOBALOBJMOCKER GlobalMockObject +# endif + +USING_MOCKCPP_NS + +#endif + +#endif + diff --git a/cli/test/include/mockcpp/types/Any.h b/cli/test/include/mockcpp/types/Any.h new file mode 100644 index 0000000..5ac918a --- /dev/null +++ b/cli/test/include/mockcpp/types/Any.h @@ -0,0 +1,75 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_ANY_H +#define __MOCKPP_ANY_H + +#include + +#include +#include + +MOCKCPP_NS_START + +struct Any : public AnyBase +{ + Any(); + + template + Any(const ValueType& value) + : AnyBase(new ValueHolder(value)) + {} + +#if 0 + Any(const char* value); +#endif + + Any(const Any & other); + +public: + + template + Any& operator=(const ValueType & rhs) + { + Any(rhs).swap(*this); + return *this; + } + + Any& operator=(const Any & rhs); + + Constraint* getConstraint() const + { return getContent()->getConstraint(); } +}; + +///////////////////////////////////////////////////////////////// +const Any EmptyAny; + +const Any VoidAny = Any(Void()); + +Any& getEmptyAny(); +Any& getVoidAny(); +bool isVoidAny(const Any& val); + +///////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + + +#endif // __MOCKPP_ANY_H + + diff --git a/cli/test/include/mockcpp/types/AnyBase.h b/cli/test/include/mockcpp/types/AnyBase.h new file mode 100644 index 0000000..8e88cd6 --- /dev/null +++ b/cli/test/include/mockcpp/types/AnyBase.h @@ -0,0 +1,71 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_ANY_BASE_H +#define __MOCKPP_ANY_BASE_H + +#include + +#include + +MOCKCPP_NS_START + +struct AnyBase +{ +public: + + AnyBase(void); + + AnyBase(PlaceHolder* holder); + + ~AnyBase(); + +public: + + bool empty() const; + + const std::type_info & type() const; + + std::string toString() const; + + std::string toTypeString() const; + + std::string toTypeAndValueString() const; + +protected: + + AnyBase& swap(AnyBase& rhs); + + PlaceHolder* getContent() const; + +private: + + PlaceHolder* content; + +private: + + template + friend ValueType * __any_cast(AnyBase *); +}; + +MOCKCPP_NS_END + + +#endif // __MOCKPP_ANY_BASE_H + + diff --git a/cli/test/include/mockcpp/types/AnyCast.h b/cli/test/include/mockcpp/types/AnyCast.h new file mode 100644 index 0000000..b769d48 --- /dev/null +++ b/cli/test/include/mockcpp/types/AnyCast.h @@ -0,0 +1,166 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_ANY_CAST_H +#define __MOCKPP_ANY_CAST_H + +#include + +#include + +#include +#include + +#include +#define MOCKCPP_ASSERT(expr) assert(expr) + +MOCKCPP_NS_START + +///////////////////////////////////////////////////////////////// +template +ValueType* __any_cast(AnyBase* operand) +{ + typedef typename TypeTraits::Type nonref; + typedef Holder holder; + + if (operand == 0 || operand->type() != typeid(ValueType)) + { + return 0; + } + + holder* p = dynamic_cast(operand->getContent()); + + return p ? &const_cast(p->getValue()) : 0; +} + +///////////////////////////////////////////////////////////////// +template +struct AnyCast +{ + static ValueType* cast(AnyBase* operand) + { + return __any_cast(operand); + } +}; + +///////////////////////////////////////////////////////////////// +template +struct AnyCast +{ + static ValueType* cast(AnyBase* operand) + { + ValueType* p = 0; + ( p = __any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) || \ + ( p = (ValueType*)__any_cast(operand)) ; + return p; + } +}; + +///////////////////////////////////////////////////////////////// +template +ValueType* any_cast(AnyBase* operand) +{ + return AnyCast::value>::cast(operand); +} + +///////////////////////////////////////////////////////////////// +template <> +char* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +short* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +int* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +long* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +unsigned char* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +unsigned short* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +unsigned int* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template <> +unsigned long* any_cast(AnyBase* op); + +///////////////////////////////////////////////////////////////// +template +const ValueType * any_cast(const AnyBase* operand) +{ + return any_cast(const_cast(operand)); +} + +///////////////////////////////////////////////////////////////// +template +ValueType any_cast(const AnyBase& operand) +{ + typedef typename TypeTraits::Type nonref; + + const nonref * result = any_cast(&operand); + MOCKCPP_ASSERT(result != 0); + + return *const_cast(result); +} + +///////////////////////////////////////////////////////////////// +template +ValueType any_cast(AnyBase& operand) +{ + typedef typename TypeTraits::Type nonref; + + nonref * result = any_cast(&operand); + MOCKCPP_ASSERT(result != 0); + + return *result; +} + +///////////////////////////////////////////////////////////////// +template +bool any_castable(const AnyBase& val) +{ + typedef typename TypeTraits::Type nonref; + + return (!val.empty()) && (any_cast(&val) != 0); +} + +///////////////////////////////////////////////////////////////// + +MOCKCPP_NS_END + +#endif + + diff --git a/cli/test/include/mockcpp/types/Holder.h b/cli/test/include/mockcpp/types/Holder.h new file mode 100644 index 0000000..0226d1e --- /dev/null +++ b/cli/test/include/mockcpp/types/Holder.h @@ -0,0 +1,65 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_HOLDER_H +#define __MOCKPP_HOLDER_H + +#include + +#include + +#include +#include +#include + +MOCKCPP_NS_START + +template +struct Holder : public PlaceHolder +{ + typedef ValueType Type; + + const std::type_info & type() const + { + return typeid(ValueType) == typeid(Void) ? typeid(void) : typeid(ValueType); + } + + std::string toString() const + { + return MOCKCPP_NS::toString(getValue()); + } + + std::string toTypeString() const + { + return TypeString::value(); + } + + std::string toTypeAndValueString() const + { + return MOCKCPP_NS::toTypeAndValueString(getValue()); + } + + virtual const ValueType& getValue() const = 0; +}; + +MOCKCPP_NS_END + + +#endif // __MOCKPP_VALUEHOLDER_H + + diff --git a/cli/test/include/mockcpp/types/PlaceHolder.h b/cli/test/include/mockcpp/types/PlaceHolder.h new file mode 100644 index 0000000..8abd284 --- /dev/null +++ b/cli/test/include/mockcpp/types/PlaceHolder.h @@ -0,0 +1,48 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_PLACEHOLDER_H +#define __MOCKPP_PLACEHOLDER_H + +#include +#include + +#include +#include + +MOCKCPP_NS_START + +struct Constraint; + +struct PlaceHolder +{ + virtual ~PlaceHolder() {} + virtual const std::type_info & type() const = 0; + virtual PlaceHolder* clone() const = 0; + virtual std::string toString(void) const = 0; + virtual std::string toTypeString(void) const = 0; + virtual std::string toTypeAndValueString(void) const = 0; + virtual Constraint* getConstraint() const { return NULL; } +}; + +MOCKCPP_NS_END + + +#endif // __MOCKPP_PLACEHOLDER_H + + diff --git a/cli/test/include/mockcpp/types/RefAny.h b/cli/test/include/mockcpp/types/RefAny.h new file mode 100644 index 0000000..041b21e --- /dev/null +++ b/cli/test/include/mockcpp/types/RefAny.h @@ -0,0 +1,81 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_REF_ANY_H +#define __MOCKPP_REF_ANY_H + +#include +#include + +MOCKCPP_NS_START + +struct RefAny : public AnyBase +{ + RefAny(); + + template + RefAny(const ValueType& value) + : AnyBase(new RefHolder(value)) + {} + +#if 0 + RefAny(const char* value); + RefAny(char* value); +#endif + + RefAny(const RefAny & other); + +public: + + template + RefAny& operator=(const ValueType & rhs) + { + RefAny(rhs).swap(*this); + return *this; + } + + RefAny& operator=(const RefAny & rhs); + + template + bool changeValue(const ValueType& val) + { + RefHolder* p = dynamic_cast*>(getContent()); + if (p == 0) + { + return false; + } + + p->changeValue(val); + + return true; + } +}; + +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +const RefAny EmptyRefAny; + +RefAny& getEmptyRefAny(); +///////////////////////////////////////////////////// + +MOCKCPP_NS_END + + +#endif // __MOCKPP_REF_ANY_H + + diff --git a/cli/test/include/mockcpp/types/RefHolder.h b/cli/test/include/mockcpp/types/RefHolder.h new file mode 100644 index 0000000..83e13cd --- /dev/null +++ b/cli/test/include/mockcpp/types/RefHolder.h @@ -0,0 +1,58 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_REFHOLDER_H +#define __MOCKPP_REFHOLDER_H + +#include + +MOCKCPP_NS_START + +template +struct RefHolder : public Holder +{ + RefHolder(const ValueType& value) + : ref(value) + { + } + + PlaceHolder * clone() const + { return new RefHolder(ref); } + + const ValueType& getValue() const + { + return ref; + } + + void changeValue(const ValueType& val) + { + ValueType* addr = &const_cast(ref); + (*addr) = val; + } + +private: + + const ValueType& ref; +}; + +MOCKCPP_NS_END + + +#endif // __MOCKPP_REFHOLDER_H + + diff --git a/cli/test/include/mockcpp/types/ValueHolder.h b/cli/test/include/mockcpp/types/ValueHolder.h new file mode 100644 index 0000000..1c4b375 --- /dev/null +++ b/cli/test/include/mockcpp/types/ValueHolder.h @@ -0,0 +1,298 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + +#ifndef __MOCKPP_VALUEHOLDER_H +#define __MOCKPP_VALUEHOLDER_H + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +MOCKCPP_NS_START + +namespace { + +template +Constraint* constraint(const T& value) +{ + return new IsEqual(value); +} + +Constraint* constraint(Constraint* c) +{ + return c == 0 ? any() : c; +} + +Constraint* constraint(const Constraint* c) +{ + return constraint(const_cast(c)); +} + +Constraint* constraint(const Void& v) +{ + return any(); +} + +} + +template +struct ValueHolderBase : public Holder +{ + Constraint* getConstraint() const + { + return constraint(getValue()); + } + + virtual const ValueType& getValue() const = 0; +}; + +template +struct ValueHolder : public ValueHolderBase +{ + ValueHolder(const ValueType& value) + : held(value) + { + } + + PlaceHolder * clone() const + { return new ValueHolder(held); } + + const ValueType& getValue() const + { + return held; + } + +private: + + ValueType held; +}; + +/////////////////////////////////////////////// +template +struct UnsignedLongHolder : public ValueHolderBase +{ +protected: + union Held{ + unsigned long ul; + unsigned int ui; + unsigned short us; + unsigned char uc; + Held(const unsigned long value) : ul(value) {} + Held(const unsigned int value) : ui(value) {} + Held(const unsigned short value) : us(value) {} + Held(const unsigned char value) : uc(value) {} + } held; +public: + + UnsignedLongHolder(const ValueType& value) + : held(value) + { + } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public UnsignedLongHolder +{ + ValueHolder(unsigned long value) + : UnsignedLongHolder(value) + { + } + + const unsigned long& getValue() const + { + return held.ul; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.ul); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public UnsignedLongHolder +{ + ValueHolder(unsigned int value) + : UnsignedLongHolder(value) + { + } + + const unsigned int& getValue() const + { + return held.ui; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.ui); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public UnsignedLongHolder +{ + ValueHolder(unsigned short value) + : UnsignedLongHolder(value) + { + } + + const unsigned short& getValue() const + { + return held.us; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.us); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public UnsignedLongHolder +{ + ValueHolder(unsigned char value) + : UnsignedLongHolder(value) + { + } + + const unsigned char& getValue() const + { + return held.uc; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.uc); } +}; + +/////////////////////////////////////////////// +template +struct SignedLongHolder : public ValueHolderBase +{ +protected: + union Held{ + long sl; + int si; + short ss; + char sc; + Held(const long value) : sl(value) {} + Held(const int value) : si(value) {} + Held(const short value) : ss(value) {} + Held(const char value) : sc(value) {} + } held; +public: + + SignedLongHolder(const ValueType& value) + : held(value) + { + } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public SignedLongHolder +{ + ValueHolder(const long& value) + : SignedLongHolder(value) + { + } + + const long& getValue() const + { + return held.sl; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.sl); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public SignedLongHolder +{ + ValueHolder(const int& value) + : SignedLongHolder(value) + { + } + + const int& getValue() const + { + return held.si; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.si); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public SignedLongHolder +{ + ValueHolder(const short& value) + : SignedLongHolder(value) + { + } + + const short& getValue() const + { + return held.ss; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.ss); } +}; + +/////////////////////////////////////////////// +template <> +struct ValueHolder + : public SignedLongHolder +{ + ValueHolder(const char& value) + : SignedLongHolder(value) + { + } + + const char& getValue() const + { + return held.sc; + } + + PlaceHolder * clone() const + { return new ValueHolder(held.sc); } +}; + +/////////////////////////////////////////////// + +MOCKCPP_NS_END + + +#endif // __MOCKPP_VALUEHOLDER_H + + diff --git a/cli/test/include/mockcpp/utils.h b/cli/test/include/mockcpp/utils.h new file mode 100644 index 0000000..da2ad6f --- /dev/null +++ b/cli/test/include/mockcpp/utils.h @@ -0,0 +1,59 @@ +/*** + mockcpp is a generic C/C++ mock framework. + Copyright (C) <2009> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +***/ + + +#ifndef __MOCKCPP_UTILS_H +#define __MOCKCPP_UTILS_H + +#include +#include +#include +#include + +MOCKCPP_NS_START + +inline std::string getFileName(std::string file) +{ + if (file == "") + { + return "NULL"; + } + + return file.substr(file.find_last_of("/\\") + 1); +} + +#define __RUN_NOTHROW(block) try block \ + catch (std::exception &e) \ + { \ + std::cout << "(" << getFileName(__FILE__) << ", " << __LINE__ << ") exception : " << e.what() << std::endl; \ + } \ + catch (...) \ + { \ + std::cout << "(" << getFileName(__FILE__) << ", " << __LINE__ << ") exception : Unknown" << std::endl; \ + } + +#define __RUN_THROW(block) try block \ + catch (...) \ + { \ + throw; \ + } + + +MOCKCPP_NS_END + +#endif diff --git a/cli/test/testcase/CMakeCache.txt b/cli/test/testcase/CMakeCache.txt new file mode 100644 index 0000000..7032d9d --- /dev/null +++ b/cli/test/testcase/CMakeCache.txt @@ -0,0 +1,304 @@ +# This is the CMakeCache file. +# For build in directory: /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=demo + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +demo_BINARY_DIR:STATIC=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase + +//Value Computed by CMake +demo_SOURCE_DIR:STATIC=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/cli/test/testcase/Makefile b/cli/test/testcase/Makefile new file mode 100644 index 0000000..5ab3be8 --- /dev/null +++ b/cli/test/testcase/Makefile @@ -0,0 +1,208 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/zhouhongyu/DTTestNew/ascend-docker-cli/test + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." + /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named ut_demo + +# Build rule for target. +ut_demo: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ut_demo +.PHONY : ut_demo + +# fast build rule for target. +ut_demo/fast: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/build +.PHONY : ut_demo/fast + +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o + +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o + +# target to build an object file +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o + +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i + +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i + +# target to preprocess a source file +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i + +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s + +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s + +# target to generate assembly for a file +home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s +.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s + +main.o: main.cpp.o + +.PHONY : main.o + +# target to build an object file +main.cpp.o: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.o +.PHONY : main.cpp.o + +main.i: main.cpp.i + +.PHONY : main.i + +# target to preprocess a source file +main.cpp.i: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.i +.PHONY : main.cpp.i + +main.s: main.cpp.s + +.PHONY : main.s + +# target to generate assembly for a file +main.cpp.s: + $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.s +.PHONY : main.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... ut_demo" + @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o" + @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i" + @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s" + @echo "... main.o" + @echo "... main.i" + @echo "... main.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp new file mode 100644 index 0000000..fe65da8 --- /dev/null +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -0,0 +1,70 @@ +// Demo.cpp : Defines the entry point for the console application. +// +#include +#include +#include "gtest/gtest.h" +#include "mockcpp/mockcpp.hpp" + +using namespace std; +//建议这样引用,避免下面用关键字时需要加前缀 testing:: +using namespace testing; + +extern "C" int IsStrEqual(const char *s1, const char *s2); +extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); +extern "C" int setns(int fd, int nstype); +extern "C" int EnterNsByFd(int fd, int nsType); + +int stub_setns(int fd, int nstype) +{ + return 0; +} + +class Test_Fhho : public Test +{ +protected: + static void SetUpTestCase() + { + cout << "TestSuite测试套事件:在第一个testcase之前执行" << endl; + } + static void TearDownTestCase() + { + cout << "TestSuite测试套事件:在最后一个testcase之后执行" << endl; + } + //如果想在相同的测试套中设置两种事件,那么可以写在一起,运行就看到效果了 + virtual void SetUp() + { + cout << "TestSuite测试用例事件:在每个testcase之前执行" << endl; + } + virtual void TearDown() + { + cout << "TestSuite测试用例事件:在每个testcase之后执行" << endl; + } +}; + +TEST_F(Test_Fhho, ClassEQ1) +{ + EXPECT_EQ(1, IsStrEqual("", "")); +} + +#if 0 +TEST_F(Test_Fhho, ClassEQ2) +{ + int pid = 1; + char* nsType = "mnt"; + char buf[100] = {0x0}; + int bufSize = 100; + int ret = GetNsPath(pid, nsType, buf, 100); + EXPECT_EQ(1, ret); +} + +TEST_F(Test_Fhho, ClassEQ3) +{ + int pid = 1; + int nsType = 1; + MOCKER(setns) + .stubs() + .will(invoke(stub_setns)); + int ret = EnterNsByFd(pid, nsType); + EXPECT_EQ(1, ret); +} +#endif diff --git a/cli/test/testcase/main.cpp b/cli/test/testcase/main.cpp new file mode 100644 index 0000000..aff34d8 --- /dev/null +++ b/cli/test/testcase/main.cpp @@ -0,0 +1,40 @@ +#include +#include +#include "gtest/gtest.h" +#include "mockcpp/mockcpp.hpp" + +//#include "gtest_testcase.cpp" +//#include "mockcpp_testcase.cpp" + +using namespace std; +//建议这样引用,避免下面用关键字时需要加前缀 testing:: +using namespace testing; + + +int main(int argc, char* argv[], char* evn[]) +{ + //std::vector g_func1 = GET_FUNC_CTOR_LIST(); + //全局事件:设置执行全局事件 + //ddGlobalTestEnvironment(new FooEnvironment); + + //输出 用例列表,用例不执行了~ + //testing::GTEST_FLAG(list_tests) = " "; + //设置过滤功能后,参数化功能失效~~~~//执行列出来的测试套的用例 + //testing::GTEST_FLAG(filter) = "EXEPath.*";//"FooTest.*:TestCase.*:TestSuite.*:TestCaseTest.*:IsPrimeParamTest.*"; + + //测试套排序,下面两种情况不能同时使用,否则排序就无作用 + //GTEST_FLAG(list_order) = "Test_Fhho;UT_DEMO;TestSuitName;FuncFoo;TestSuitEvent"; + //测试套模糊匹配排序,注:只以开头进行精确匹配,遇到 * 后模糊匹配 + //如UT_*;IT_*,先执行所有UT_开头的用例再执行IT_开头的用例 + /*GTEST_FLAG(dark_list_order) = "UT_*;\ + IT_*";*/ + // Returns 0 if all tests passed, or 1 other wise. + int ret = Init_UT(argc, argv, true); + if (1 == ret) + { + printf("有用例错误,请按任意键继续。。。"); + //getchar(); + } + + return ret; +} -- Gitee From e2a45ef42b06a1196923ae42c5ff69c37dbcbebf Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 27 May 2020 14:35:07 +0800 Subject: [PATCH 004/296] Match-id-b6110f0a9545d2b9b48c9db37084dafe2f9bba35 --- runtime/.gitignore | 3 + runtime/glide.lock | 8 + runtime/glide.yaml | 6 + runtime/main.go | 159 +++ .../runtime-spec/.gitattributes | 2 + .../opencontainers/runtime-spec/.gitignore | 3 + .../opencontainers/runtime-spec/.mailmap | 21 + .../runtime-spec/.pullapprove.yml | 27 + .../runtime-spec/.tool/version-doc.go | 25 + .../opencontainers/runtime-spec/.travis.yml | 26 + .../opencontainers/runtime-spec/ChangeLog | 748 ++++++++++++++ .../opencontainers/runtime-spec/GOVERNANCE.md | 70 ++ .../opencontainers/runtime-spec/LICENSE | 191 ++++ .../opencontainers/runtime-spec/MAINTAINERS | 6 + .../opencontainers/runtime-spec/Makefile | 95 ++ .../opencontainers/runtime-spec/README.md | 150 +++ .../opencontainers/runtime-spec/RELEASES.md | 96 ++ .../opencontainers/runtime-spec/bundle.md | 22 + .../runtime-spec/config-linux.md | 766 ++++++++++++++ .../runtime-spec/config-solaris.md | 120 +++ .../opencontainers/runtime-spec/config-vm.md | 68 ++ .../runtime-spec/config-windows.md | 207 ++++ .../opencontainers/runtime-spec/config.md | 975 ++++++++++++++++++ .../opencontainers/runtime-spec/glossary.md | 38 + .../runtime-spec/implementations.md | 37 + .../opencontainers/runtime-spec/meeting.ics | 41 + .../opencontainers/runtime-spec/principles.md | 46 + .../runtime-spec/runtime-linux.md | 21 + .../opencontainers/runtime-spec/runtime.md | 146 +++ .../runtime-spec/schema/Makefile | 50 + .../runtime-spec/schema/README.md | 48 + .../runtime-spec/schema/config-linux.json | 259 +++++ .../runtime-spec/schema/config-schema.json | 188 ++++ .../runtime-spec/schema/config-solaris.json | 65 ++ .../runtime-spec/schema/config-vm.json | 60 ++ .../runtime-spec/schema/config-windows.json | 102 ++ .../runtime-spec/schema/defs-linux.json | 308 ++++++ .../runtime-spec/schema/defs-vm.json | 14 + .../runtime-spec/schema/defs-windows.json | 22 + .../runtime-spec/schema/defs.json | 158 +++ .../runtime-spec/schema/state-schema.json | 39 + .../schema/test/config/bad/invalid-json.json | 1 + .../test/config/bad/linux-hugepage.json | 16 + .../schema/test/config/bad/linux-rdma.json | 15 + .../schema/test/config/good/linux-rdma.json | 22 + .../test/config/good/minimal-for-start.json | 16 + .../schema/test/config/good/minimal.json | 6 + .../schema/test/config/good/spec-example.json | 395 +++++++ .../schema/test/state/bad/invalid-json.json | 1 + .../schema/test/state/good/spec-example.json | 10 + .../runtime-spec/schema/validate.go | 100 ++ .../opencontainers/runtime-spec/spec.md | 48 + .../runtime-spec/specs-go/config.go | 689 +++++++++++++ .../runtime-spec/specs-go/state.go | 17 + .../runtime-spec/specs-go/version.go | 18 + .../opencontainers/runtime-spec/style.md | 131 +++ 56 files changed, 6921 insertions(+) create mode 100644 runtime/.gitignore create mode 100644 runtime/glide.lock create mode 100644 runtime/glide.yaml create mode 100644 runtime/main.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/Makefile create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/README.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/principles.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/spec.md create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go create mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/style.md diff --git a/runtime/.gitignore b/runtime/.gitignore new file mode 100644 index 0000000..eba7e90 --- /dev/null +++ b/runtime/.gitignore @@ -0,0 +1,3 @@ +.vscode +.idea +ascend-docker-runtime \ No newline at end of file diff --git a/runtime/glide.lock b/runtime/glide.lock new file mode 100644 index 0000000..66e8c78 --- /dev/null +++ b/runtime/glide.lock @@ -0,0 +1,8 @@ +hash: d3b9b531d49a72a645375d0bd70076ca2ae3dd3d9efc48d3b5307f960433fcd3 +updated: 2020-05-18T10:46:31.7320902+08:00 +imports: +- name: github.com/opencontainers/runtime-spec + version: c4ee7d12c742ffe806cd9350b6af3b4b19faed6f + subpackages: + - specs-go +testImports: [] diff --git a/runtime/glide.yaml b/runtime/glide.yaml new file mode 100644 index 0000000..df34969 --- /dev/null +++ b/runtime/glide.yaml @@ -0,0 +1,6 @@ +package: ascend-docker-runtime +import: +- package: github.com/opencontainers/runtime-spec + version: ^1.0.2 + subpackages: + - specs-go diff --git a/runtime/main.go b/runtime/main.go new file mode 100644 index 0000000..bfa452c --- /dev/null +++ b/runtime/main.go @@ -0,0 +1,159 @@ +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "strings" + "syscall" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +const ( + loggingPrefix = "ascend-docker-runtime" + hookCli = "ascend-docker-hook" + hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" +) + +type args struct { + bundleDirPath string + cmd string +} + +func getArgs() (*args, error) { + args := &args{} + + for i, param := range os.Args { + if param == "--bundle" || param == "-b" { + if len(os.Args)-i <= 1 { + return nil, fmt.Errorf("bundle option needs an argument\n") + } + args.bundleDirPath = os.Args[i+1] + } else if param == "create" { + args.cmd = param + } + } + + return args, nil +} + +func execRunc() error { + runcPath, err := exec.LookPath("docker-runc") + if err != nil { + runcPath, err = exec.LookPath("runc") + if err != nil { + return fmt.Errorf("failed to find the path of runc: %w\n", err) + } + } + + if err = syscall.Exec(runcPath, append([]string{runcPath}, os.Args[1:]...), os.Environ()); err != nil { + return fmt.Errorf("failed to exec runc: %w\n", err) + } + + return nil +} + +func addHook(spec *specs.Spec) error { + path, err := exec.LookPath(hookCli) + if err != nil { + path = hookDefaultFilePath + if _, err = os.Stat(path); err != nil { + return fmt.Errorf("cannot find the hook\n") + } + } + + if spec.Hooks == nil { + spec.Hooks = &specs.Hooks{} + } else if len(spec.Hooks.Prestart) != 0 { + for _, hook := range spec.Hooks.Prestart { + if !strings.Contains(hook.Path, hookCli) { + continue + } + return nil + } + } + + spec.Hooks.Prestart = append(spec.Hooks.Prestart, specs.Hook{ + Path: path, + Args: []string{path}, + }) + + return nil +} + +func modifySpecFile(path string) error { + stat, err := os.Stat(path) + if err != nil { + return fmt.Errorf("spec file doesnt exist %s: %w", path, err) + } + + jsonFile, err := os.OpenFile(path, os.O_RDWR, stat.Mode()) + if err != nil { + return fmt.Errorf("cannot open oci spec file %s: %w\n", path, err) + } + + defer jsonFile.Close() + + jsonContent, err := ioutil.ReadAll(jsonFile) + if err != nil { + return fmt.Errorf("failed to read oci spec file %s: %w\n", path, err) + } + + var spec specs.Spec + if err := json.Unmarshal(jsonContent, &spec); err != nil { + return fmt.Errorf("failed to unmarshal oci spec file %s: %w\n", path, err) + } + + if err := addHook(&spec); err != nil { + return fmt.Errorf("failed to inject hook: %w\n", err) + } + + jsonOutput, err := json.Marshal(spec) + if err != nil { + return fmt.Errorf("failed to marshal OCI spec file: %w\n", err) + } + + if _, err := jsonFile.WriteAt(jsonOutput, 0); err != nil { + return fmt.Errorf("failed to write OCI spec file: %w\n", err) + } + + return nil +} + +func doProcess() error { + args, err := getArgs() + if err != nil { + return fmt.Errorf("failed to get args: %w\n", err) + } + + if args.cmd != "create" { + return execRunc() + } + + if args.bundleDirPath == "" { + args.bundleDirPath, err = os.Getwd() + if err != nil { + return fmt.Errorf("failed to get current working dir: %w\n", err) + } + } + + specFilePath := args.bundleDirPath + "/config.json" + + if err := modifySpecFile(specFilePath); err != nil { + return fmt.Errorf("failed to modify spec file %s: %w\n", specFilePath, err) + } + + return execRunc() +} + +func main() { + log.SetPrefix(loggingPrefix) + + if err := doProcess(); err != nil { + log.Fatal(err) + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes new file mode 100644 index 0000000..558b67f --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes @@ -0,0 +1,2 @@ +# https://tools.ietf.org/html/rfc5545#section-3.1 +*.ics text eol=crlf diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore new file mode 100644 index 0000000..f9663c9 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore @@ -0,0 +1,3 @@ +output +schema/validate +version.md diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap b/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap new file mode 100644 index 0000000..346194c --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap @@ -0,0 +1,21 @@ +Aleksa Sarai +Alexander Morozov +Amit Saha +Antonio Murdaca +Brandon Philips +Brandon Philips +ChengTiesheng +Daniel, Dao Quang Minh +Doug Davis +James O. D. Hunt +John Howard +LinZhinan(Zen Lin) +Mrunal Patel +Mrunal Patel +Mrunal Patel +Vincent Batts +Vincent Batts +Vishnu Kannan +Vishnu Kannan +Zefan Li +梁辰晔 (Liang Chenye) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml b/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml new file mode 100644 index 0000000..ce688e2 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml @@ -0,0 +1,27 @@ +version: 2 + +requirements: + signed_off_by: + required: false + +group_defaults: + required: 2 + approve_by_comment: + enabled: true + approve_regex: ^LGTM + reject_regex: ^Rejected + reset_on_push: + enabled: true + author_approval: + ignored: true + always_pending: + title_regex: ^WIP + explanation: 'Work in progress...' + conditions: + branches: + - master + +groups: + runtime-spec: + teams: + - runtime-spec-maintainers diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go b/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go new file mode 100644 index 0000000..f36bfe4 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go @@ -0,0 +1,25 @@ +// +build ignore + +package main + +import ( + "fmt" + "html/template" + "os" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +var markdownTemplateString = ` + +**Specification Version:** *{{.}}* + +` + +var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString)) + +func main() { + if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil { + fmt.Fprintln(os.Stderr, err) + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml b/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml new file mode 100644 index 0000000..82e03a2 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml @@ -0,0 +1,26 @@ +language: go +go: + - "1.11.x" + - "1.10.x" + - "1.9.x" + +sudo: required + +services: + - docker + +before_install: + - make install.tools + - docker pull vbatts/pandoc + - go get -d ./schema/... + +install: true + +script: + - env | grep TRAVIS_ + - make .govet + - make .golint + - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" + - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation + - make docs + - make -C schema test diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog b/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog new file mode 100644 index 0000000..e257f80 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog @@ -0,0 +1,748 @@ +OpenContainers Specifications + +Changes with v1.0.2: + + Additions: + + * Add create-container, create-runtime and start-container hooks (#1008) + * config-linux: add Intel RDT CLOS name sharing support (#988) + * config-linux: Add Intel RDT/MBA Linux support (#932) + * config-linux: Add Memory cgroup's use_hierarchy (#985) + * Add Linux personality support (#1012) + * config: Add Windows Devices to Schema (#976) + * Add support for SCMP_ACT_LOG (#1019) + * config-linux: support seccomp flags (#1018) + + Minor fixes and documentation: + + * Makefile: avoid SELinux for making docs + * Clarify case with pre-configured Intel RDT closID (#1034) + * config-linux: describe more about rootfs mount propagation (#1035) + * config-linux: add SHOULD to linux.namespaces.type (#1025) + * Reduce DCO checks per PR from 3 to 1 (#1029) + * Fix typo in RELEASES.md (#1033) + * Remove some unneeded indent (#1031) + * Add documentation how to do releases (#1027) + * Removed Vishnu Kannan & Brandon Philips from maintainers (#1030 & #1028) + * schema: drop id from umask (#1024) + * implementations.md: fix repository for crun (#1017) + * Update meeting info section to point to "org" repo (#1016) + * Fix markdown escape in config-linux (#1013) + * config-linux: add more info about hugetlb page size (#1011) + * Fix ociVersion of Configuration Schema Example to support ambient capability (#1009) + * Fix Namespaces to use LinuxNamespaceType (#1007) + * change new pid namespace description (#1006) + * updating link to code of conduct in org repository (#1001) + * Update Windows LayerFolder docs (#999) + * Windows:Have native CommandLine in Process (#998) + * vm: fix parameters field (#994) + * config-linux: documentation change for Intel RDT/MBA Software Controller support (#992) + * Bump Go versions (#993) + * Support for network namespace in windows (#989) + * config: clarify source mount (#981) + * Fix camelCasing on idType to align with other Windows spec conventions (#976) + * meeting: Bump July meeting from the 4th to the 11th (#977) + * docs: Added kata-runtime to implementations (#969) + * Add gVisor to the implementations list (#970) + * .travis.yml: Get schema dependencies in before_install (#968) + * config: Clarify execution environment for hooks (#953) + * config-linux: Drop console(4) reference (#965) + * Linux devices: uid/gid relative to container (#959) + * config: Add VM-based container configuration section (#949) + * uidMappings: change order of fields for clarity (#956) + * specs-go/config: Define RDMA cgroup (#942) + * schema/Makefile: fix test (#947) + * config: Fix Linux mount options links (#952) + * glossary: Bump JSON spec to RFC 8259 (#951) + * schema: Completely drop our JSON Schema 'id' properties (#945) + * meeting: Bump January meeting from the 3rd to the 10th (#943) + * config: add "umask" field to POSIX "user" section (#941) + * schema: add allowed values for defaultAction (#940) + * config: Dedent root paragraphs, since they aren't a list entry (#936) + * fix the link to hook (#933) + * config: Collapse extensibility to a single MUST (#916) + * schema/defs-linux: change weight type to uint16 (#898) + * runtime: Clarify ociVersion as based on the state schema (#903) + +Changes with v1.0.1: + + Minor fixes and documentation: + + * spec: Expand "OCI" in spec-title reference and add "Initiative" + (#900) + * config: Simplify title to "Configuration" (#901) + * config: Fix "procfs_2" -> "proc_2" link label (#906) + * config: Fix IEEE Std 1003.1-2008 exec link markup (#913) + * config: Add a trailing period to the "cannot be mapped" rlimits + line (#915) + * config-linux: RFC 2119 MUST for absolute linux.namespaces[].path + (#925). This is technically a breaking change, because a config + with a relative namespace path would have been compliant before, + but will be non compliant with this change. However, the previous + "an absolute path to namespace file" wording was clear enough that + config authors are unlikely to be relying on relative namespace + paths in configs. + * config-linux: More specific documentation for weightDevice and + throttle* (#825) + * config-linux: Modify procfs to proc (#905) + * config-linux: Fix "psuedo" -> "pseudo" typo (#921) + * config-windows: Make maximum a uint16 (was a uint) (#891) + * runtime: Change "process in the container" -> "container + process" (#907) + * schema/config-schema: Use ArrayOfStrings in capabilities + properties. (#886) + * schema/config-linux: + s/throttleWriteIopsDevice/throttleWriteIOPSDevice/ (#899) + * schema/config-linux: add intelRdt field (#889) + * schema/config-solaris: Replaced refs with some fields + (cappedCPU.ncpus, etc.) (#892) + +Changes with v1.0.0: + + Breaking changes: + + * config: Shift disableOOMKiller from linux.resources to + linux.resources.memory (#896) + + Decreased restrictions: + + * runtime: Make the state JSON's pid optional on non-Linux platforms + (#897) + + Minor fixes and documentation: + + * schema/defs-linux: Require Syscall.action (#885) + * specs-go/config: Fix 'omiempty' -> 'omitempty' typo for + LinuxSeccompArg.ValueTwo (#884) + * ROAMAP: remove the pre-v1.0.0 roadmap (#890) + +Changes with v1.0.0-rc6: + + Breaking changes: + + * config: Shift oomScoreAdj to process and add RFC 2119 requirements + for the runtime (#781, #789, #836) + * config: Forbid 'root' on Hyper-V (#820, #838). + * config: process.capabilities and process.noNewPrivileges are + Linux-only again (#880). This partially reverses #673, which had + landed in v1.0.0-rc5. + * config: Remove process.rlimits from Windows (#880). It is now + POSIX-only, while in v1.0.0-rc5 it was cross-platform (because of + #673). Before #673 (in v1.0.0-rc4 and earlier), it was + Linux-only. + * config-linux: Drop redundant 'blkio' prefix from blockIO + properties (#860) + * config-linux: Make memory limits int64 instead of uint64 (#876). + This partially reverses #704, which had landed in v1.0.0-rc5. + * config-windows: Change CPU 'percent' to 'maximum' (#777) + * config-windows: Remove memory 'reservation' (#788) + * config-windows: Remove 'resources.network' and add 'network' (#801) + + Additions: + + * config: Windows runtimes MUST support the 'ro' mount option (#868) + * config-linux: Add Intel RDT/CAT Linux support (#630, #787) + * config-linux: Add Markdown specification for syscalls (#706) + * config-linux: Add 'unbindable' rootfsPropagation value (#770, #775) + * config-windows: Add 'credentialSpec' (#814, #859) + * config-windows: Add 'servicing' (#815) + * config-windows: Add 'ignoreFlushesDuringBoot' (#816, #859) + * config-windows: Add 'hyperv' (#818, #849, #859) + * config-windows: Add 'layerFolders' (#828) + + Removals and increased restrictions: + + * config: Remove 'platform' (#850) + * config: Require strictly-postitive 'timeout' values (#764) + * config: Strengthen punt to kernel for valid capabilities strings + (#766, #790) + * config: Require volume GUID paths for root.path (#849) + * config: Forbid setting 'readonly' true on Windows (#819) + * config: Forbid setting mount 'type' entirely on Windows and forbid + UNC paths and mapped drives in 'source' on Windows (#821) + * config: Remove 'hooks' from Windows spec (#855, #869, #870) + * config-linux: Clearly require absolute path for namespace (#720) + * config-linux: RFC 2119 tightening for namespaces (#767) + * config-linux: Require at least one entry in + linux.seccomp.syscalls[].names (#769) + * config-linux: Remove syscall.comment (#714) + * config-linux: Use MUST and MAY for weight and leafWeight (#751) + * config-linux: Remove explicit 'null' from device cgroup values + (#804) + * runtime: Remove "features the runtime chooses to support" (#732) + * runtime: Drop "not supported by the base OS" loophole (#733) + * runtime-linux: Condition /proc/self/fd symlinks on source + existence (#736) + + Decreased restrictions: + + * config: Make 'process' optional (#701, #805) + * config-linux: Make linux.seccomp.syscalls optional (#768) + * config-linux: valueTwo is now optional in + `linux.seccomp.syscalls[].args` entries (#877) + * config-linux: Remove local range restrictions for blkioWeight, + blkioLeafWeight, weight, leafWeight, and shares (#780) + * config-linux: Explicitly allow symlinks for providing devices (#873) + + Minor fixes and documentation: + + * config: Remove "MAY support any valid values" sentence (#851) + * config: Remove the previously-forbidden mounts[].type from the + Windows spec (#854) + * config: Clarify mounts[].source relative path anchor (#735) + * config: Explicitly make consoleSize ignored if terminal is false or + unset (#863) + * config: Specify height/width units (characters) for consoleSize (#761) + * config: Use "POSIX platforms" instead of "Linux and Solaris" (#838) + * config-linux: Explicit namespace for interface names (#713) + * config-linux: Explicitly list cgroupsPath as optional (#823) + * runtime: Clarify valid container states for 'start', 'kill', and + 'delete' (#875) + * runtime: Explicitly make process.* timing implementation-defined (#700) + * specs-go/config: Remove range restrictions from Windows comments (#783) + * specs-go/config: Add omitempty to LinuxSyscall.Args (#763) + * specs-go/config: Use a pointer for Process.ConsoleSize (#792) + * schema/README: Use v1.0.0 URL in examples to prepare for the 1.0.0 + release (#881) + * schema/Makefile: Make 'validate' the default target (#750) + * schema/Makefile: Add 'clean' target (#774) + * schema: Add 'test' target to the Makefile (#785) + * *: Remove unnecessary .PHONY entries (#750, #778, #802) + * *: Typo fixes and polishing (#681, #708, #702, #703, #709, #711, + #712, #721, #722, #723, #724, #730, #737, #738, #741, #744, #749, + #753, #756, #765, #773, #776, #784, #786, #793, #794, #796, #798, + #799, #800, #803, #807, #809, #811, #812, #822, #824, #826, #827, + #832, #839, #840, #846, #847, #848, #852, #856, #858, #862, #865, + #871, #874) + +Changes with v1.0.0-rc5: + + Breaking changes: + + * config: Explicitly require `platform` (#695). + * config: The platform-specific sections (`linux`, `solaris`, and + `windows`) MUST NOT be set unless they match `platform.os` (#673). + * config: `process.capabilities` is now an object instead of an + array of strings (#675). + * config-linux: No longer allow negative values for some resources, + partially reversing #648 from v1.0.0-rc4 (#704). + * config-linux: `linux.seccomp.syscalls` entries have `names` + instead of `name` (#657). + * runtime: Rename the state `bundlePath` property to `bundle` + (#674). + + Additions: + + * config: `process.capabilities` is no longer Linux-only (#673). + * config-linux: `linux.seccomp.syscalls` entries have a new + `comment` property (#657). + * config-linux: Add new architectures from libseccomp 2.3.2 (#705) + * runtime: Add a `creating` state `status` (#507, #694). + + Removals and increased restrictions: + + * runtime: Document hook timing and exit code handling (#532). + * schema/config-linux: Explicit `null` values are no longer + compliant (#662). + + Decreased restrictions: + + * config: `type` and `source` properties are now optional for + `mounts` entries (#699). + * config: `args` property is now optional for hooks (#685). + * config-linux: Runtimes no longer need to provide `/proc` and + other filesystems unless they are explicitly requested in the + configuration JSON (#666). + + Minor fixes and documentation: + + * spec: Add OCI Runtime Abstract (#691). + * config: Document the Go `platform` tag (#570). + * config-linux: Remove local uid/gid mapping limit and punt to the + kernel (#693). + * schema: Fix broken `string` and similar `$ref`s (#684). + * schema: Remove `mounts` from required properties (#696). + * schema: Remove `major` and `minor` from `linux.devices` entries + (#688). + * schema: Check for the required `type`, `hard`, and `soft` in + `process.rlimits` entries (#696). + * schema/validate: Gained usage documentation and fixed + `schemaPath` logic when the argument did not contain `://` (#552). + * *: Add anchor tags to a number of spec locations (#707). + * *: Consistent link syntax (#687). + * *: Minor cleanup and rewording (#697). + +Changes with v1.0.0-rc4: + Additions: + + * config-linux: Allow negative values for some resources (#648) + * config-linux: Lift no-tweaking namespace restriction (#649) + + Removals and increased restrictions: + + * config: Rlimit types must be unique (#607) + * config: Forbid empty-string keys in 'annotations' (#645, #654) + * config-linux: Require runtime errors for pre-existing devices + (#647) + * runtime: Only require 'pid' in the state for created/running + statuses (#664) + * schema: Add 'consoleSize' and update requirements (#646) + * schema: Remove string pointers (#656) + * schema/config-linux: Remove blockIODeviceThrottle and other + pointers (#545) + + Breaking Go changes: + + * specs-go/config: Remove string pointers (#653) + * specs-go/config: Make Spec.Hooks a pointer (#427) + * specs-go/config: Convert some resources from unsigned integers + to signed integers (#648) + + Minor fixes and documentation: + + * config: Explicitly list 'hooks' as optional and cite POSIX for + 'env' and 'args' (#427) + * runtime: Replace "process is stopped" with "process exits" + (#465) + * schema/config-linux: Add missing kernelTCP (#655) + * schema/validate: Allow schema identifiers to contain a URL + scheme (#490) + * .travis: Fix git-validation commit ranges (#216) + * *: Add anchor tags to a number of spec locations (#612, #636, + #637, #638, #639, #640) + * *: Typo fixes and polishing (#643, #650, #652, #656, #660, #665) + +Changes with v1.0.0-rc3: + Additions: + + * config: Add support for Windows-based containers (#565, #573) + * config: Add process.consoleSize (#563) + * config: Explicitly allow unknown extensions and document + annotations key conventions (#510) + * config: Define mounts entries for Solaris (#588) + + Removals and increased restrictions: + + * config: Require absolute paths for mount destinations (#609) + * config-linux: Require absolute path for maskedPaths and + readonlyPaths (#587) + * config-linux: Only require /dev/console when process.terminal is + true. Also require /dev/console to be provided by a bind mount + (#518) + * runtime: Require runtimes to generate errors when the container + specified in config.json cannot be created (#559) + + Breaking Go changes: + + * specs-go/config: Aggressive namespacing (#567) + * specs-go/config: Remove pointers from LinuxHugepageLimit, + LinuxInterfacePriority, and LinuxPids properties (#586) + * specs-go/state: Rename version to ociVersion (#633) + LinuxInterfacePriority, and LinuxPids properties (#586) + + Minor fixes and documentation: + + * spec: Separate the spec from project scaffolding (#626) + * README: Define "unspecified", "undefined", and + "implementation-defined" (#575) + * config: Clarify absolue and relative values for root.path (#558) + * config: Clarify ociVersion covering the configuration <-> + runtime API (#523) + * config-linux: Forbid duplicated namespaces with same `type` + (#597) + * glossary: Make objects explicitly unordered and forbid duplicate + names (#584) + * specs-go/config: Add platform tags to Rlimits and + NoNewPRivileges (#564) + * schema/defs-linux: Use int64 for major/minor types (#610) + * Makefile: Add support for Go 1.7 (#547) + * Makefile: Require Go >= 1.6 for golint (#589) + * Makefile: Use a POSIX-compatible test ('==' -> '=') (#542) + * implementations: Rename ocitools -> runtime-tools (#585) + * *: Typo fixes and polishing (#556, #566, #568, #569, #571, #572, + #574, #595, #596, #599, #600, #601, #603, #605, #608, #613, #617, + #619, #621, #622, #623, #624, #625, #627, #629) + +Changes with v1.0.0-rc2: + Additions: + + * config-linux: Add new architectures from libseccomp 2.3.0 (#505) + * schema: Add JSON Schema for state JSON and move schema.json to + config-schema.json and similar (#481, #498, #519) + + Minor fixes and documentation: + + * Add compliance language for platforms and architectures (#527) + * Remove "unconditionally compliant" language (#553) + * bundle: Remove distribution references (#487) + * runtime: Fix sub-bullet indentation (#495) + * config: Replace Arch fstab reference with mount(8) (#443) + * config: Synchronize comments between Markdown and Go (#525) + * config: Drop v0.x compatibility statement (#488) + * config-linux: RFC 2119 wording for cgroupsPath (#493) + * config-linux: Make linux.devices and linux.resources.devices + optional (#526) + * config-linux: Extend no-tweak requirement to runtime namespaces (#538) + * schema: Add hook.timeout (#544) + * schema: Add missing '"type": "object"' (#528) + * schema: Run 'make fmt' and remove duplicates (#546, #551) + * schema/config: Make 'hostname' optional (#491) + * schema/config-linux: Add linux.resources.devices (#550) + * specs-go/config: Add Solaris tags to User properties (#496) + * specs-go/config: Make Linux and Solaris omitempty again (#502) + * specs-go/config: Make KernelTCP and ClassID omitempty (#531) + * specs-go/config: Fix "specified" typo for ApparmorProfile (#503) + * Makefile: Remove code-of-conduct.md and version.md when clean (#541) + * implementations: Mention cc-oci-runtime (#539) + * Use filesystem instead of file system (#529) + * .pullapprove: Add DCO check via PullApprove + * GOVERNANCE: Add governance and release process docs (#521) + * README: Change meeting time from 10am to 2pm Pacific (#524) + * README: Update conference-call phone number (#512, #515) + +Changes with v1.0.0-rc1: + Breaking changes: + + * runtime: Split create and start, #384, #450, #463, #464, #467, + #468 + * runtime: Remove exec, #388 + * runtime: Enviroment MUST match the configuration, #397 + * config: Runtime MUST generate errors for unsupported platforms, + #441 + * config: Windows mount destinations MUST NOT be nested, #437 + + Additions: + + * solaris: Added platform-specific configuration, #411, #424, #431, + #436 + * runtime: Add 'annotations' and 'status' to the state structure, + #462, #484, #485 + * runtime: State no longer needs to be serialized as JSON, #446 + * runtime-linux: Add /dev symbolic links, #449 + * config: Allow absolute paths for root.path (which previously + required relative paths), #394 + * config-linux: Add linux.mountLabel, #393 + * config-linux: Add suport for cgroup namespace, #397 + * config-linux: Runtime SHOULD NOT modify ownership of any + referenced filesystem (previously the restriction only applied to + the root filesystem), #452 + * specs-go/seccomp: Add ppc and s390x to specs-go/config.go, #475 + + Minor fixes and documentation: + + * README: Add project.md to the Table of Contents, #376 + * README: Consistenly indent the Table of Contents, #400 + * README: Link to LICENSE, #442 + * README: Weekly call is OCI-wide, #378 + * config: Explicit runtime namespace for hooks, #415 + * config: Explicit container namespace for uid, gid, and + additionalGids, #412 + * config: Fix 'string' -> 'array of strings' typo for process.args, + #416 + * runtime: The runtime MAY validate config.json, #418 + * runtime: Move errors section out of operations, #445 + * runtime: MAY -> SHOULD for post-stop error logging, #410 + * schema/README: Document JSON Schema usage, #360, #385 + * schema: Minor description updates, #456, #461 + * schema/validate: Support reading documents via stdin, #482 + * .pullapprove: Automate review approval, #458, #474 + * .gitignore: Hide more auto-generated files, #386, #392 + * .travis: git-validation detects Travis now, #366 + * .travis: Regress on failure to produce docs, #479 + * Makefile: Filename docs.* -> oci-runtime-spec.*, #478 + * Makefile: Add install.tools target, #349 + * Makefile: Allow native pandoc implementations, #428, #448 + * Makefile: Prefer Bash, #455 + * Makefile: Travis support for .gitvalidation, #422 + * specs-go/config: Add missing omitempties for Process.Terminal, + Root.Readonly, Spec.Linux, and Spec.Mounts, #408, #429, #430, #431 + * specs-go/config: Remove incorrect omitempties for User.UID and + User.GID, #425 + * specs-go/config: Drop platform-independent comment, #451 + * version: Include version in generated documentation, #406 + * *: Anchor examples, #348 + * *: Fix remnants from SelinuxProcessLabel to SelinuxLabel rename, + #396 + * *: Outsource code-of-conduct to TOB repository, #375, #413 + * *: RFC 2119 consistency, #407, #409, #438, #444, #449 + * *: Typo fixes, #390, #401 + * *: Whitespace fixes and validation, #380, #381, #426 + * ROADMAP: Remove stale targets, #435 + +Changes with v0.5.0: + Breaking changes: + + * specs-go: Renamed the repository from opencontainers/specs to + opencontainers/runtime-spec, #365 + + Additions: + + * config: Add 'timeout' for hooks, #346 + * config-linux: Add 'maskedPaths' and 'readonlyPaths', #364 + + Minor fixes and documentation: + + * JSON Schema bug-fixes and improved examples, #370 + * README: Define "unconditionally compliant", #374 + * config: Make Markdown canonical, #342 + * config: Explicitly list mapping from symbolic names to UID/GIDs as + out-of-scope, #347 + * config-linux: Require the runtime mount namespace for namespace + 'path' values, #275 + * config-linux: Reword kernelTCP docs, #377 + * specs-go: Add omitempty to 'Device' and 'Namespace', #340 + * .travis.yml: Use built-in 'go vet' and current 'go lint', dropping + Go < 1.5, #372, #352 + * implementations: Expand ocitools scope to include testing, #328 + * style: Move one-sentence-per-line rule from the README, #369 + * style: Remove dangling parenthesis, #359 + * README: Add a link to the IRC logs, #358 + * Fix "manadate", "exmaple", "paramters", and "preferrably" typos, + #353, #354 + +Changes with v0.4.0: + Breaking changes: + + * config: Move capabilities, selinuxProcessLabel, apparmorProfile, + and noNewPrivileges from the linux setting to the process setting + and make them optional, renaming selinuxProcessLabel to + selinuxLabel, #329, #330, #339 + * runtime: Rename version to ociVerison in the state JSON, #225 + * runtime: Remove the directory requirement for storing state, now + that there is a 'state' operation, #225, #334 + * go: Shift *.go to specs-go/*.go, #276 + * config: Move rlimits to process, #341 + * go: Move config_linux.go content into config.go, removing + LinuxSpec, #310 + + Additions: + + * schema: Add JSON Schema (and validator) for `config.json`, #313 + * config: Add annotations for opaque-to-the-runtime data, #331 + * config-linux: Make seccomp optional, #333 + * runtime: Added additional operations: state, stop, and exec. + #225 + + Minor fixes and documentation: + + * config-linux: Change mount type from *rune to *string and fix + octal fileMode examples, #323 + * runtime: RFC 2119 phrasing for the lifecycle, #225 + * README: Add a full example of config.json, #276 + * README: Replace BlueJeans with UberConference, #326, #338 + * style: Document Go-pointer exceptions, #317 + +Changes with v0.3.0: + Breaking changes: + + * config: Single, unified config file, #284 + * config: cwd is a required default, and must be absolute, #286, + #307, #308, #312 + * config: qualify the name of the version field, #309 + * config-linux: Convert classID from hex to uint32, #296 + * config-linux: Separate mknod from cgroups, #298 + + Additions: + + * config-linux: Add NoNewPrivileges setting for linux, #290 + + Minor fixes and documentation: + + * config-linux: clarify oom_score_adj, #236, #292 + * config-linux: Update links to cgroups documentation, #318 + * config-linux: Remove pointers for slices preferring omitempty + tag instead, #316 + * README: add runtime, bundle, and hook author user, #280 + * ROADMAP: reshuffled and split into GitHub issues, #300, #301, + #304, #306 + * style: Collect established styles in a discoverable location, #287, #311 + +Changes with v0.2.0: + * Add Apparmor, Selinux and Seccomp + * Add Apparmor, Selinux and Seccomp sections + * Add bind mount example + * Add fd section for linux container process + * Add Go types for specification + * *: adding a code of conduct + * Adding cgroups path to the Spec. + * .: Adding listing of implementations + * .: adding travis file for future CI + * Add license and DCO information for contributions + * Add linux spec description + * Add MAINTAINERS file + * Add memory swappiness to linux spec + * Add runtime state configuration and structs + * Adds a section for user namespace mappings + * Adds link to kernel cgroups documentation + * Adds section for Linux Rlimits + * Adds section for Linux Sysctl. + * Adds user namespace to the list of namespaces + * bundle: add initial run use case + * bundle: Fix 'and any number of and other related' typo + * bundle.md: clarify arbitrary/conventional dirnames + * bundle.md: fix link formatting + * bundle.md: fix off-by-one error + * bundle.md: various updates to latest spec + * bundle: Move 'Linux sysctl' header to its own line + * Change commiter to committer + * Change Device field order in spec_linux.go, 'Path' should be top of the 'Type' field, according to the different of the config-linux.md, 'Path' field is the unique key. + * Change layout of mountpoints and mounts + * Change the rlimit type to string instead of int + * Clarify behavior around namespaces paths. + * config: Add example additionalGids + * config: Add example cwd + * config: cleanup language on readonly parameter + * config: fix links to go files + * config-linux: specify the default devices/filesystems available + * config.md: clarify destination for mounts + * config.md: make the version a semver + * config.md: make the version field example a semver + * config.md: minor clean up of process specification + * config.md: reformat into a standard style + * config.md: update links to spec schema code + * config.md: various cleanup/consistency fixes + * config: minor cleanup + * Deduplicate the field of RootfsPropagation + * Define constants for Linux Namespace names + * Fix LinuxRuntime field + * Fix root object keys + * Fix typos in config.md + * Fix typos in the "Namespace types" section + * Fix typos in the rlimits section + * Fix Windows path escaping in example mount JSON + * JSON objects are easier to parse/manipulate + * made repo public. Added warning in README + * Make namespaces match runc + * make rootfs mount propagation mode settable + * Makes namespaces description linux specific + * *.md: markdown formatting + * Modify the capabilities constants to match header files like other constants + * Move linux specific options to linux spec + * README: add a rule for paragraph formatting in markdown + * README: Document BlueJeans and wiki archive for meetings + * README: Document pre-meeting agenda alteration + * README: Document YouTube and IRC backchannel for meetings + * README: Focus on local runtime (create/start/stop) + * README.md: Add a git commit style guide + * README.md: contribution about discussion + * README: releases section + * README: Remove blank line from infrastructure-agnostic paragraph + * removed boilerplate file + * *: remove superfluous comma in code-of-conduct + * Remove trailing whitespace + * Rename SystemProperties to Sysctl + * Rename the header "Access to devices" to "Devices" to fit with the config + * *: re-org the spec + * Replace Linux.Device with more specific config + * restore formatting + * Return golang compliant names for UID and GID in User + * Return golint-compliant naming for mappings + * runtime: Add prestart/poststop hooks + * runtime_config: comments for golint + * runtime-config-linux: Drop 'Linux' from headers + * runtime_config_linux: Fix 'LinuxSpec' -> 'LinuxRuntimeSpec' in comment + * runtime-config-linux: One sentence per line for opening two paragraphs + * runtime-config: Remove blank lines from the end of files + * runtime-config: Remove 'destination' docs from mounts + * runtime.md: convert oc to runc + * runtime: use opencontainer vs oci + * *: small spelling fixes + * Specific platform specific user struct for spec + * spec: linux: add support for the PIDs cgroup + * spec_linux: conform to `golint` + * spec_linux.go: Rename IDMapping fields to follow syscall.SysProcIDMap + * spec_linux: remove ending periods on one-line comments + * spec: rename ocp to oci and add a link + * specs: add json notation + * specs: align the ascii graph + * specs: fix the description for the [ug]idMappings + * specs: introduce the concept of a runtime.json + * .tools: cleanup the commit entry + * .tools: repo validation tool + * travis: fix DCO validation for merges + * typo: containers -> container's + * typo: the -> for + * Update config-linux for better formatting on values + * Update README.md + * Update readme with weekly call and mailing list + * Update runtime.md + * Update runtime.md + * Update runtime.md + * version: more explicit version for comparison + +Changes with v0.1.0: + * Add Architecture field to Seccomp configuration in Linux runtime + * Add @hqhq as maintainer + * Add hyphen for host specific + * Adding Vishnu Kannan as a Maintainer. + * Add initial roadmap + * Add lifecycle for containers + * Add oom_score_adj to the runtime Spec. + * Add post-start hooks + * Add Seccomp constants to description of Linux runtime spec + * Add Seccomp constants to Linux runtime config + * Add some clarity around the state.json file + * adds text describing the upper-case keywords used in the spec + * add testing framework to ROADMAP + * Appropriately mark optional fields as omitempty + * cgroup: Add support for memory.kmem.tcp.limit_in_bytes + * Change HugepageLimit.Limit type to uint64 + * Change the behavior when cgroupsPath is absent + * Change version from 0.1.0 to 0.2.0 + * Clarify the semantics of hook elements + * Cleanup bundle.md + * Cleanup principles + * config: linux: update description of PidsLimit + * config: Require a new UTS namespace for config.json's hostname + * config: Require the runtime to mount Spec.Mounts in order + * convert **name** to **`name`** + * Example lists "root' but text mentions "bundlePath" + * Fix an extra space in VersionMinor + * Fix golint warnings + * Fix typo in BlockIO struct comment + * Fix typo in Filesystem Bundle + * Fix value of swappiness + * glossary: Provide a quick overview of important terms + * glossary: Specify UTF-8 for all our JSON + * hooks: deduplicate the hooks docs + * implementations: Link to kunalkushwaha/octool + * implementations: Link to mrunalp/ocitools + * lifecycle: Don't require /run/opencontainer//containers + * lifecycle: Mention runtime.json + * lifecycle: no hypens + * MAINTAINERS: add tianon per the charter + * MAINTAINERS: correct Vish's github account + * Makefile: Add glossary to DOC_FILES + * Make optional Cgroup related config params pointers along with `omitempty` json tag. + * Mark RootfsPropagation as omitempty + * *.md: update TOC and links + * move the description of Rlimits before example + * move the description of user ns mapping to proper file + * principles: Give principles their own home + * *: printable documents + * Project: document release process + * README: Fix some headers + * README: make header more concise + * remove blank char from blank line + * Remove the unneeded build tag from the config_linux.go + * Remove trailing comma in hooks json example + * Rename State's Root to Bundle + * ROADMAP.md: remove the tail spaces + * roadmap: update links and add wiki reference + * runtime: Add 'version' to the state.json example + * runtime-config: add example label before json example + * runtime-config: add section about Hooks + * runtime: config: linux: add cgroups information + * runtime: config: linux: Edit BlockIO struct + * runtime: config: linux: Fix typo and trailing commas in json example + * runtime_config_linux.go: add missing pointer + * runtime-config-linux.md: fix the type of cpus and mems + * runtime.md: fix spacing + * Talk about host specific/independent instead of mutability + * .tools: commit validator is a separate project + * .tools: make GetFetchHeadCommit do what it says + * .travis.yml: add go 1.5.1, update from 1.4.2 to 1.4.3 + * Update readme with wiki link to minutes + * Update Typo in ROADMAP.md + * Use unsigned for IDs + * version: introduce a string for dev indication diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md b/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md new file mode 100644 index 0000000..92c8609 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md @@ -0,0 +1,70 @@ +# Project governance + +The [OCI charter][charter] §5.b.viii tasks an OCI Project's maintainers (listed in the repository's MAINTAINERS file and sometimes referred to as "the TDC", [§5.e][charter]) with: + +> Creating, maintaining and enforcing governance guidelines for the TDC, approved by the maintainers, and which shall be posted visibly for the TDC. + +This section describes generic rules and procedures for fulfilling that mandate. + +## Proposing a motion + +A maintainer SHOULD propose a motion on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with another maintainer as a co-sponsor. + +## Voting + +Voting on a proposed motion SHOULD happen on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with maintainers posting LGTM or REJECT. +Maintainers MAY also explicitly not vote by posting ABSTAIN (which is useful to revert a previous vote). +Maintainers MAY post multiple times (e.g. as they revise their position based on feedback), but only their final post counts in the tally. +A proposed motion is adopted if two-thirds of votes cast, a quorum having voted, are in favor of the release. + +Voting SHOULD remain open for a week to collect feedback from the wider community and allow the maintainers to digest the proposed motion. +Under exceptional conditions (e.g. non-major security fix releases) proposals which reach quorum with unanimous support MAY be adopted earlier. + +A maintainer MAY choose to reply with REJECT. +A maintainer posting a REJECT MUST include a list of concerns or links to written documentation for those concerns (e.g. GitHub issues or mailing-list threads). +The maintainers SHOULD try to resolve the concerns and wait for the rejecting maintainer to change their opinion to LGTM. +However, a motion MAY be adopted with REJECTs, as outlined in the previous paragraphs. + +## Quorum + +A quorum is established when at least two-thirds of maintainers have voted. + +For projects that are not specifications, a [motion to release](#release-approval) MAY be adopted if the tally is at least three LGTMs and no REJECTs, even if three votes does not meet the usual two-thirds quorum. + +## Security issues + +Motions with sensitive security implications MUST be proposed on the security@opencontainers.org mailing list instead of dev@opencontainers.org, but should otherwise follow the standard [proposal](#proposing-a-motion) process. +The security@opencontainers.org mailing list includes all members of the TOB. +The TOB will contact the project maintainers and provide a channel for discussing and voting on the motion, but voting will otherwise follow the standard [voting](#voting) and [quorum](#quorum) rules. +The TOB and project maintainers will work together to notify affected parties before making an adopted motion public. + +## Amendments + +The [project governance](#project-governance) rules and procedures MAY be amended or replaced using the procedures themselves. +The MAINTAINERS of this project governance document is the total set of MAINTAINERS from all Open Containers projects (runC, runtime-spec, and image-spec). + +## Subject templates + +Maintainers are busy and get lots of email. +To make project proposals recognizable, proposed motions SHOULD use the following subject templates. + +### Proposing a motion + +> [{project} VOTE]: {motion description} (closes {end of voting window}) + +For example: + +> [runtime-spec VOTE]: Tag 0647920 as 1.0.0-rc (closes 2016-06-03 20:00 UTC) + +### Tallying results + +After voting closes, a maintainer SHOULD post a tally to the motion thread with a subject template like: + +> [{project} {status}]: {motion description} (+{LGTMs} -{REJECTs} #{ABSTAINs}) + +Where `{status}` is either `adopted` or `rejected`. +For example: + +> [runtime-spec adopted]: Tag 0647920 as 1.0.0-rc (+6 -0 #3) + +[charter]: https://www.opencontainers.org/about/governance diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE b/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE new file mode 100644 index 0000000..bdc4036 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2015 The Linux Foundation. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS b/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS new file mode 100644 index 0000000..f559c5b --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS @@ -0,0 +1,6 @@ +Michael Crosby (@crosbymichael) +Mrunal Patel (@mrunalp) +Vincent Batts (@vbatts) +Daniel, Dao Quang Minh (@dqminh) +Tianon Gravi (@tianon) +Qiang Huang (@hqhq) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile b/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile new file mode 100644 index 0000000..16051b3 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile @@ -0,0 +1,95 @@ + +EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667 +OUTPUT_DIRNAME ?= output +DOC_FILENAME ?= oci-runtime-spec +DOCKER ?= $(shell command -v docker 2>/dev/null) +PANDOC ?= $(shell command -v pandoc 2>/dev/null) +ifeq "$(strip $(PANDOC))" '' + ifneq "$(strip $(DOCKER))" '' + PANDOC = $(DOCKER) run \ + --security-opt label=disable \ + -it \ + --rm \ + -v $(shell pwd)/:/input/:ro \ + -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \ + -u $(shell id -u) \ + vbatts/pandoc + PANDOC_SRC := /input/ + PANDOC_DST := / + endif +endif + +# These docs are in an order that determines how they show up in the PDF/HTML docs. +DOC_FILES := \ + version.md \ + spec.md \ + principles.md \ + bundle.md \ + runtime.md \ + runtime-linux.md \ + config.md \ + config-linux.md \ + config-solaris.md \ + glossary.md + +default: docs + +docs: $(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html + +ifeq "$(strip $(PANDOC))" '' +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: + $(error cannot build $@ without either pandoc or docker) +else +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) + mkdir -p $(OUTPUT_DIRNAME)/ && \ + $(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) + +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) + mkdir -p $(OUTPUT_DIRNAME)/ && \ + $(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) +endif + +version.md: ./specs-go/version.go + go run ./.tool/version-doc.go > $@ + +HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-) +# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked. +ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true') + +test: .govet .golint .gitvalidation + +.govet: + go vet -x ./... + +# `go get github.com/golang/lint/golint` +.golint: +ifeq ($(call ALLOWED_GO_VERSION,1.7,$(HOST_GOLANG_VERSION)),true) + @which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false) + golint ./... +endif + + +# When this is running in travis, it will only check the travis commit range +.gitvalidation: + @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) +ifdef TRAVIS_COMMIT_RANGE + git-validation -q -run short-subject,dangling-whitespace +else + git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD +endif + +install.tools: .install.golint .install.gitvalidation + +# golint does not even build for + +using your real name (sorry, no pseudonyms or anonymous contributions.) + +You can add the sign off when creating the git commit via `git commit -s`. + +#### Commit Style + +Simple house-keeping for clean git history. +Read more on [How to Write a Git Commit Message][how-to-git-commit] or the Discussion section of [git-commit(1)][git-commit.1]. + +1. Separate the subject from body with a blank line +2. Limit the subject line to 50 characters +3. Capitalize the subject line +4. Do not end the subject line with a period +5. Use the imperative mood in the subject line +6. Wrap the body at 72 characters +7. Use the body to explain what and why vs. how + * If there was important/useful/essential conversation or information, copy or include a reference +8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") + + +[charter]: https://www.opencontainers.org/about/governance +[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md +[dev-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev +[how-to-git-commit]: http://chris.beams.io/posts/git-commit +[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ +[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date +[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ +[oci]: https://www.opencontainers.org +[rfc5545]: https://tools.ietf.org/html/rfc5545 +[runtime-wiki]: https://github.com/opencontainers/runtime-spec/wiki +[uberconference]: https://www.uberconference.com/opencontainers + +[git-commit.1]: http://git-scm.com/docs/git-commit diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md b/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md new file mode 100644 index 0000000..cd48def --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md @@ -0,0 +1,96 @@ +# Releases + +The release process hopes to encourage early, consistent consensus-building during project development. +The mechanisms used are regular community communication on the mailing list about progress, scheduled meetings for issue resolution and release triage, and regularly paced and communicated releases. +Releases are proposed and adopted or rejected using the usual [project governance](GOVERNANCE.md) rules and procedures. + +An anti-pattern that we want to avoid is heavy development or discussions "late cycle" around major releases. +We want to build a community that is involved and communicates consistently through all releases instead of relying on "silent periods" as a judge of stability. + +## Parallel releases + +A single project MAY consider several motions to release in parallel. +However each motion to release after the initial 0.1.0 MUST be based on a previous release that has already landed. + +For example, runtime-spec maintainers may propose a v1.0.0-rc2 on the 1st of the month and a v0.9.1 bugfix on the 2nd of the month. +They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th if the vote initiated on the 1st passes). + +## Specifications + +The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools. +However, specification releases have special restrictions in the [OCI charter][charter]: + +* They are the target of backwards compatibility (§7.g), and +* They are subject to the OFWa patent grant (§8.d and e). + +To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases: + +### Planning a release + +Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases. +This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC. +Maintainers MUST send updates to the dev@opencontainers.org with results of these meetings. + +Before the specification reaches v1.0.0, the meetings SHOULD be weekly. +Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting. + +The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones). +GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures. + +### Timelines + +Specifications have a variety of different timelines in their lifecycle. + +* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback. +* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart. + This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself. + Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced. + For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0. +* Minor and patch releases SHOULD be made on an as-needed basis. + +[charter]: https://www.opencontainers.org/about/governance + +## Checklist + +Releases usually follow a few steps: + +* [ ] prepare a pull-request for the release + * [ ] a commit updating `./ChangeLog` + * [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -` + * [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting + * [ ] review `(^M|^A|^D)` for impact of the commit + * [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:` + * [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'` + * [ ] merge multi-commit PRs (so each line has a `(#num)` suffix) + * [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /` + * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable + * [ ] a commit adding back the "-dev" to `VersionDev` +* [ ] send email to dev@opencontainers.org + * [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev") + * [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l` + * [ ] get the date for a week from now, like `TZ=UTC date --date='next week'` + * [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description + * [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)` + * [ ] email body like +``` +Hey everyone, + +There have been $numPRs PRs merged since $priorTag release (https://github.com/opencontainers/runtime-spec/compare/$priorTag...$versionBumpCommit). + +$linkToPullRequest + +Please respond LGTM or REJECT (with reasoning). + +$sig +``` +* [ ] edit/update the pull-request to link to the VOTE thread, from https://groups.google.com/a/opencontainers.org/forum/#!forum/dev +* [ ] a week later, if the vote passes, merge the PR + * [ ] `git tag -s $version $versionBumpCommit` + * [ ] `git push --tags` +* [ ] produce release documents + * [ ] git checkout the release tag, like `git checkout $version` + * [ ] `make docs` + * [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf`` + * [ ] attach these docs to the release on https://github.com/opencontainers/runtime-spec/releases + * [ ] link to the the VOTE thread and include the passing vote count + * [ ] link to the pull request that merged the release diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md b/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md new file mode 100644 index 0000000..0924ad9 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md @@ -0,0 +1,22 @@ +# Filesystem Bundle + +## Container Format + +This section defines a format for encoding a container as a *filesystem bundle* - a set of files organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it. +See also [MacOS application bundles][macos_bundle] for a similar use of the term *bundle*. + +The definition of a bundle is only concerned with how a container, and its configuration data, are stored on a local filesystem so that it can be consumed by a compliant runtime. + +A Standard Container bundle contains all the information needed to load and run a container. +This includes the following artifacts: + +1. `config.json`: contains configuration data. + This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`. + See [`config.json`](config.md) for more details. + +2. container's root filesystem: the directory referenced by [`root.path`](config.md#root), if that property is set in `config.json`. + +When supplied, while these artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle. +In other words, a tar archive of a *bundle* will have these artifacts at the root of the archive, not nested within a top-level directory. + +[macos_bundle]: https://en.wikipedia.org/wiki/Bundle_%28macOS%29 diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md new file mode 100644 index 0000000..368bf28 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md @@ -0,0 +1,766 @@ +# Linux Container Configuration + +This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. + +## Default Filesystems + +The Linux ABI includes both syscalls and several special file paths. +Applications expecting a Linux environment will very likely expect these file paths to be set up correctly. + +The following filesystems SHOULD be made available in each container's filesystem: + +| Path | Type | +| -------- | ------ | +| /proc | [proc][] | +| /sys | [sysfs][] | +| /dev/pts | [devpts][] | +| /dev/shm | [tmpfs][] | + +## Namespaces + +A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. +Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. +For more information, see the [namespaces(7)][namespaces.7_2] man page. + +Namespaces are specified as an array of entries inside the `namespaces` root field. +The following parameters can be specified to set up namespaces: + +* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types SHOULD be supported: + * **`pid`** processes inside the container will only be able to see other processes inside the same container or inside the same pid namespace. + * **`network`** the container will have its own network stack. + * **`mount`** the container will have an isolated mount table. + * **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC. + * **`uts`** the container will be able to have its own hostname and domain name. + * **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container. + * **`cgroup`** the container will have an isolated view of the cgroup hierarchy. +* **`path`** *(string, OPTIONAL)* - namespace file. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). + The runtime MUST place the container process in the namespace associated with that `path`. + The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`. + + If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`. + +If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type. +If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors). + +### Example + +```json +"namespaces": [ + { + "type": "pid", + "path": "/proc/1234/ns/pid" + }, + { + "type": "network", + "path": "/var/run/netns/neta" + }, + { + "type": "mount" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } +] +``` + +## User namespace mappings + +**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container. +**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container. + +Each entry has the following structure: + +* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container. +* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*. +* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped. + +The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping. +Note that the number of mapping entries MAY be limited by the [kernel][user-namespaces]. + +### Example + +```json +"uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } +], +"gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } +] +``` + +## Devices + +**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. +The runtime MAY supply them however it likes (with [`mknod`][mknod.2], by bind mounting from the runtime mount namespace, using symlinks, etc.). + +Each entry has the following structure: + +* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`. + More info in [mknod(1)][mknod.1]. +* **`path`** *(string, REQUIRED)* - full path to device inside container. + If a [file][] already exists at `path` that does not match the requested device, the runtime MUST generate an error. +* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device. +* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. + You can also control access to devices [with cgroups](#device-whitelist). +* **`uid`** *(uint32, OPTIONAL)* - id of device owner in the [container namespace](glossary.md#container-namespace). +* **`gid`** *(uint32, OPTIONAL)* - id of device group in the [container namespace](glossary.md#container-namespace). + +The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices. + +### Example + +```json +"devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } +] +``` + +### Default Devices + +In addition to any devices configured with this setting, the runtime MUST also supply: + +* [`/dev/null`][null.4] +* [`/dev/zero`][zero.4] +* [`/dev/full`][full.4] +* [`/dev/random`][random.4] +* [`/dev/urandom`][random.4] +* [`/dev/tty`][tty.4] +* `/dev/console` is set up if [`terminal`](config.md#process) is enabled in the config by bind mounting the pseudoterminal slave to `/dev/console`. +* [`/dev/ptmx`][pts.4]. + A [bind-mount or symlink of the container's `/dev/pts/ptmx`][devpts]. + +## Control groups + +Also known as cgroups, they are used to restrict resource usage for a container and handle device access. +cgroups provide controls (through controllers) to restrict cpu, memory, IO, pids, network and RDMA resources for the container. +For more information, see the [kernel cgroups documentation][cgroup-v1]. + +### Cgroups Path + +**`cgroupsPath`** (string, OPTIONAL) path to the cgroups. +It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container. + +The value of `cgroupsPath` MUST be either an absolute path or a relative path. + +* In the case of an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point. +* In the case of a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy. + +If the value is specified, the runtime MUST consistently attach to the same place in the cgroups hierarchy given the same value of `cgroupsPath`. +If the value is not specified, the runtime MAY define the default cgroups path. +Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case. + +Implementations of the Spec can choose to name cgroups in any manner. +The Spec does not include naming schema for cgroups. +The Spec does not support per-controller paths for the reasons discussed in the [cgroupv2 documentation][cgroup-v2]. +The cgroups will be created if they don't exist. + +You can configure a container's cgroups via the `resources` field of the Linux configuration. +Do not specify `resources` unless limits have to be updated. +For example, to run a new process in an existing container without updating limits, `resources` need not be specified. + +Runtimes MAY attach the container process to additional cgroup controllers beyond those necessary to fulfill the `resources` settings. + +### Example + +```json +"cgroupsPath": "/myRuntime/myContainer", +"resources": { + "memory": { + "limit": 100000, + "reservation": 200000 + }, + "devices": [ + { + "allow": false, + "access": "rwm" + } + ] +} +``` + +### Device whitelist + +**`devices`** (array of objects, OPTIONAL) configures the [device whitelist][cgroup-v1-devices]. +The runtime MUST apply entries in the listed order. + +Each entry has the following structure: + +* **`allow`** *(boolean, REQUIRED)* - whether the entry is allowed or denied. +* **`type`** *(string, OPTIONAL)* - type of device: `a` (all), `c` (char), or `b` (block). + Unset values mean "all", mapping to `a`. +* **`major, minor`** *(int64, OPTIONAL)* - [major, minor numbers][devices] for the device. + Unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices]. +* **`access`** *(string, OPTIONAL)* - cgroup permissions for device. + A composition of `r` (read), `w` (write), and `m` (mknod). + +#### Example + +```json +"devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } +] +``` + +### Memory + +**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage. +For more information, see the kernel cgroups documentation about [memory][cgroup-v1-memory]. + +Values for memory specify the limit in bytes, or `-1` for unlimited memory. + +* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage +* **`reservation`** *(int64, OPTIONAL)* - sets soft limit of memory usage +* **`swap`** *(int64, OPTIONAL)* - sets limit of memory+Swap usage +* **`kernel`** *(int64, OPTIONAL)* - sets hard limit for kernel memory +* **`kernelTCP`** *(int64, OPTIONAL)* - sets hard limit for kernel TCP buffer memory + +The following properties do not specify memory limits, but are covered by the `memory` controller: + +* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness) + The values are from 0 to 100. Higher means more swappy. +* **`disableOOMKiller`** *(bool, OPTIONAL)* - enables or disables the OOM killer. + If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. + The OOM killer is enabled by default in every cgroup using the `memory` subsystem. + To disable it, specify a value of `true`. +* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting. + If enabled (`true`), child cgroups will share the memory limits of this cgroup. + +#### Example + +```json +"memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false +} +``` + +### CPU + +**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets`. +For more information, see the kernel cgroups documentation about [cpusets][cgroup-v1-cpusets]. + +The following parameters can be specified to set up the controller: + +* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup +* **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by **`period`** below) +* **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only) +* **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources +* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only +* **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in +* **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in + +#### Example + +```json +"cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" +} +``` + +### Block IO + +**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller. +For more information, see the kernel cgroups documentation about [blkio][cgroup-v1-blkio]. + +The following parameters can be specified to set up the controller: + +* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. +* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. +* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`weight`** *(uint16, OPTIONAL)* - bandwidth weight for the device. + * **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth weight for the device while competing with the cgroup's child cgroups, CFQ scheduler only + + You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. + +* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth rate limits. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device + +* **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - an array of per-device IO rate limits. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device + +#### Example + +```json +"blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] +} +``` + +### Huge page limits + +**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the +HugeTLB usage per control group and enforces the controller limit during page fault. +For more information, see the kernel cgroups documentation about [HugeTLB][cgroup-v1-hugetlb]. + +Each entry has the following structure: + +* **`pageSize`** *(string, REQUIRED)* - hugepage size + The value has the format `B` (64KB, 2MB, 1GB), and must match the `` of the + corresponding control file found in `/sys/fs/cgroup/hugetlb/hugetlb..limit_in_bytes`. + Values of `` are intended to be parsed using base 1024 ("1KB" = 1024, "1MB" = 1048576, etc). +* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage + +#### Example + +```json +"hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 209715200 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } +] +``` + +### Network + +**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio`. +For more information, see the kernel cgroups documentations about [net\_cls cgroup][cgroup-v1-net-cls] and [net\_prio cgroup][cgroup-v1-net-prio]. + +The following parameters can be specified to set up the controller: + +* **`classID`** *(uint32, OPTIONAL)* - is the network class identifier the cgroup's network packets will be tagged with +* **`priorities`** *(array of objects, OPTIONAL)* - specifies a list of objects of the priorities assigned to traffic originating from processes in the group and egressing the system on various interfaces. + The following parameters can be specified per-priority: + * **`name`** *(string, REQUIRED)* - interface name in [runtime network namespace](glossary.md#runtime-namespace) + * **`priority`** *(uint32, REQUIRED)* - priority applied to the interface + +#### Example + +```json +"network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] +} +``` + +### PIDs + +**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids`. +For more information, see the kernel cgroups documentation about [pids][cgroup-v1-pids]. + +The following parameters can be specified to set up the controller: + +* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup + +#### Example + +```json +"pids": { + "limit": 32771 +} +``` + +### RDMA + +**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`. +For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma]. + +The name of the device to limit is the entry key. +Entry values are objects with the following properties: + +* **`hcaHandles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup +* **`hcaObjects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup + +You MUST specify at least one of the `hcaHandles` or `hcaObjects` in a given entry, and MAY specify both. + +#### Example + +```json +"rdma": { + "mlx5_1": { + "hcaHandles": 3, + "hcaObjects": 10000 + }, + "mlx4_0": { + "hcaObjects": 1000 + }, + "rxe3": { + "hcaObjects": 10000 + } +} +``` + +## IntelRdt + +**`intelRdt`** (object, OPTIONAL) represents the [Intel Resource Director Technology][intel-rdt-cat-kernel-interface]. +If `intelRdt` is set, the runtime MUST write the container process ID to the `tasks` file in a proper sub-directory in a mounted `resctrl` pseudo-filesystem. That sub-directory name is specified by `closID` parameter. +If no mounted `resctrl` pseudo-filesystem is available in the [runtime mount namespace](glossary.md#runtime-namespace), the runtime MUST [generate an error](runtime.md#errors). + +If `intelRdt` is not set, the runtime MUST NOT manipulate any `resctrl` pseudo-filesystems. + +The following parameters can be specified for the container: + +* **`closID`** *(string, OPTIONAL)* - specifies the identity for RDT Class of Service (CLOS). + If `closID` is set, runtimes MUST create `closID` directory in a mounted `resctrl` pseudo-filesystem if it doesn't exist. If not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `` directory. + +* **`l3CacheSchema`** *(string, OPTIONAL)* - specifies the schema for L3 cache id and capacity bitmask (CBM). + The value SHOULD start with `L3:` and SHOULD NOT contain newlines. +* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id. + * The value MUST start with `MB:` and MUST NOT contain newlines. + + * If both `l3CacheSchema` and `memBwSchema` are set, runtimes MUST write the combined value to the `schemata` file in that sub-directory discussed in `closID`. + + * If `l3CacheSchema` contains a line beginning with `MB:`, the value written to `schemata` file MUST be the non-`MB:` line(s) from `l3CacheSchema` and the line from `memBWSchema`. + + * If either `l3CacheSchema` or `memBwSchema` is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`. + + * If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. + + * If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match. + + * If `closID` is set, and neither of `l3CacheSchema` and `memBwSchema` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist. + + +### Example + +Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits, +and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%. + +Tasks inside the container only have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1, +and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1. + +```json +"linux": { + "intelRdt": { + "closID": "guaranteed_group", + "l3CacheSchema": "L3:0=7f0;1=1f", + "memBwSchema": "MB:0=20;1=70" + } +} +``` + +## Sysctl + +**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container. +For more information, see the [sysctl(8)][sysctl.8] man page. + +### Example + +```json +"sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" +} +``` + +## Seccomp + +Seccomp provides application sandboxing mechanism in the Linux kernel. +Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls. +For more information about Seccomp, see [Seccomp][seccomp] kernel documentation. +The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp][] and are translated to corresponding values. + +**`seccomp`** (object, OPTIONAL) + +The following parameters can be specified to set up seccomp: + +* **`defaultAction`** *(string, REQUIRED)* - the default action for seccomp. Allowed values are the same as `syscalls[].action`. +* **`architectures`** *(array of strings, OPTIONAL)* - the architecture used for system calls. + A valid list of constants as of libseccomp v2.3.2 is shown below. + + * `SCMP_ARCH_X86` + * `SCMP_ARCH_X86_64` + * `SCMP_ARCH_X32` + * `SCMP_ARCH_ARM` + * `SCMP_ARCH_AARCH64` + * `SCMP_ARCH_MIPS` + * `SCMP_ARCH_MIPS64` + * `SCMP_ARCH_MIPS64N32` + * `SCMP_ARCH_MIPSEL` + * `SCMP_ARCH_MIPSEL64` + * `SCMP_ARCH_MIPSEL64N32` + * `SCMP_ARCH_PPC` + * `SCMP_ARCH_PPC64` + * `SCMP_ARCH_PPC64LE` + * `SCMP_ARCH_S390` + * `SCMP_ARCH_S390X` + * `SCMP_ARCH_PARISC` + * `SCMP_ARCH_PARISC64` + +* **`flags`** *(array of strings, OPTIONAL)* - list of flags to use with seccomp(2). + + A valid list of constants is shown below. + + * `SECCOMP_FILTER_FLAG_TSYNC` + * `SECCOMP_FILTER_FLAG_LOG` + * `SECCOMP_FILTER_FLAG_SPEC_ALLOW` + +* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp. + While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries. + For example, if `defaultAction` is `SCMP_ACT_KILL` and `syscalls` is empty or unset, the kernel will kill the container process on its first syscall. + Each entry has the following structure: + + * **`names`** *(array of strings, REQUIRED)* - the names of the syscalls. + `names` MUST contain at least one entry. + * **`action`** *(string, REQUIRED)* - the action for seccomp rules. + A valid list of constants as of libseccomp v2.4.0 is shown below. + + * `SCMP_ACT_KILL` + * `SCMP_ACT_TRAP` + * `SCMP_ACT_ERRNO` + * `SCMP_ACT_TRACE` + * `SCMP_ACT_ALLOW` + * `SCMP_ACT_LOG` + + * **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp. + Each entry has the following structure: + + * **`index`** *(uint, REQUIRED)* - the index for syscall arguments in seccomp. + * **`value`** *(uint64, REQUIRED)* - the value for syscall arguments in seccomp. + * **`valueTwo`** *(uint64, OPTIONAL)* - the value for syscall arguments in seccomp. + * **`op`** *(string, REQUIRED)* - the operator for syscall arguments in seccomp. + A valid list of constants as of libseccomp v2.3.2 is shown below. + + * `SCMP_CMP_NE` + * `SCMP_CMP_LT` + * `SCMP_CMP_LE` + * `SCMP_CMP_EQ` + * `SCMP_CMP_GE` + * `SCMP_CMP_GT` + * `SCMP_CMP_MASKED_EQ` + +### Example + +```json +"seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] +} +``` + +## Rootfs Mount Propagation + +**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation. +Its value is either `shared`, `slave`, `private` or `unbindable`. +It's worth noting that a peer group is defined as a group of VFS mounts that propagate events to each other. +A nested container is defined as a container launched inside an existing container. + +* **`shared`**: the rootfs mount belongs to a new peer group. + This means that further mounts (e.g. nested containers) will also belong to that peer group and will propagate events to the rootfs. + Note this does not mean that it's shared with the host. +* **`slave`**: the rootfs mount receives propagation events from the host (e.g. if something is mounted on the host it will also appear in the container) but not the other way around. +* **`private`**: the rootfs mount doesn't receive mount propagation events from the host and further mounts in nested containers will be isolated from the host and from the rootfs (even if the nested container `rootfsPropagation` option is shared). +* **`unbindable`**: the rootfs mount is a private mount that cannot be bind-mounted. + +The [Shared Subtrees][sharedsubtree] article in the kernel documentation has more information about mount propagation. + +### Example + +```json +"rootfsPropagation": "slave", +``` + +## Masked Paths + +**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read. +The values MUST be absolute paths in the [container namespace](glossary.md#container_namespace). + +### Example + +```json +"maskedPaths": [ + "/proc/kcore" +] +``` + +## Readonly Paths + +**`readonlyPaths`** (array of strings, OPTIONAL) will set the provided paths as readonly inside the container. +The values MUST be absolute paths in the [container namespace](glossary.md#container-namespace). + +### Example + +```json +"readonlyPaths": [ + "/proc/sys" +] +``` + +## Mount Label + +**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container. + +### Example + +```json +"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" +``` + +## Personality + +**`personality`** (object, OPTIONAL) sets the Linux execution personality. For more information +see the [personality](personality.2) syscall documentation. As most of the options are +obsolete and rarely used, and some reduce security, the currently supported set is a small +subset of the available options. + +* **`domain`** *(string, REQUIRED)* - the execution domain. + The valid list of constants is shown below. `LINUX32` will set the `uname` system call to show + a 32 bit CPU type, such as `i686`. + + * `LINUX` + * `LINUX32` + +* **`flags`** *(array of strings, OPTIONAL)* - the additional flags to apply. + Currently no flag values are supported. + + +[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt +[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt +[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt +[cgroup-v1-devices]: https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt +[cgroup-v1-hugetlb]: https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt +[cgroup-v1-memory]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt +[cgroup-v1-net-cls]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_cls.txt +[cgroup-v1-net-prio]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_prio.txt +[cgroup-v1-pids]: https://www.kernel.org/doc/Documentation/cgroup-v1/pids.txt +[cgroup-v1-rdma]: https://www.kernel.org/doc/Documentation/cgroup-v1/rdma.txt +[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt +[devices]: https://www.kernel.org/doc/Documentation/admin-guide/devices.txt +[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt +[file]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164 +[libseccomp]: https://github.com/seccomp/libseccomp +[proc]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt +[seccomp]: https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt +[sharedsubtree]: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt +[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt +[tmpfs]: https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt + +[full.4]: http://man7.org/linux/man-pages/man4/full.4.html +[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html +[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html +[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html +[null.4]: http://man7.org/linux/man-pages/man4/null.4.html +[personality.2]: http://man7.org/linux/man-pages/man2/personality.2.html +[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html +[random.4]: http://man7.org/linux/man-pages/man4/random.4.html +[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html +[tty.4]: http://man7.org/linux/man-pages/man4/tty.4.html +[zero.4]: http://man7.org/linux/man-pages/man4/zero.4.html +[user-namespaces]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html +[intel-rdt-cat-kernel-interface]: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md new file mode 100644 index 0000000..ee375d6 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md @@ -0,0 +1,120 @@ +# Solaris Application Container Configuration + +Solaris application containers can be configured using the following properties, all of the below properties have mappings to properties specified under [zonecfg(1M)][zonecfg.1m_2] man page, except milestone. + +## milestone +The SMF(Service Management Facility) FMRI which should go to "online" state before we start the desired process within the container. + +**`milestone`** *(string, OPTIONAL)* + +### Example +```json +"milestone": "svc:/milestone/container:default" +``` + +## limitpriv +The maximum set of privileges any process in this container can obtain. +The property should consist of a comma-separated privilege set specification as described in [priv_str_to_set(3C)][priv-str-to-set.3c] man page for the respective release of Solaris. + +**`limitpriv`** *(string, OPTIONAL)* + +### Example +```json +"limitpriv": "default" +``` + +## maxShmMemory +The maximum amount of shared memory allowed for this application container. +A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). +Mapped to `max-shm-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. + +**`maxShmMemory`** *(string, OPTIONAL)* + +### Example +```json +"maxShmMemory": "512m" +``` + +## cappedCPU +Sets a limit on the amount of CPU time that can be used by a container. +The unit used translates to the percentage of a single CPU that can be used by all user threads in a container, expressed as a fraction (for example, .75) or a mixed number (whole number and fraction, for example, 1.25). +An ncpu value of 1 means 100% of a CPU, a value of 1.25 means 125%, .75 mean 75%, and so forth. +When projects within a capped container have their own caps, the minimum value takes precedence. +cappedCPU is mapped to `capped-cpu` in [zonecfg(1M)][zonecfg.1m_2] man page. + +* **`ncpus`** *(string, OPTIONAL)* + +### Example +```json +"cappedCPU": { + "ncpus": "8" +} +``` + +## cappedMemory +The physical and swap caps on the memory that can be used by this application container. +A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). +cappedMemory is mapped to `capped-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. + +* **`physical`** *(string, OPTIONAL)* +* **`swap`** *(string, OPTIONAL)* + +### Example +```json +"cappedMemory": { + "physical": "512m", + "swap": "512m" +} +``` + +## Network + +### Automatic Network (anet) +anet is specified as an array that is used to set up networking for Solaris application containers. +The anet resource represents the automatic creation of a network resource for an application container. +The zones administration daemon, zoneadmd, is the primary process for managing the container's virtual platform. +One of the daemon's responsibilities is creation and teardown of the networks for the container. +For more information on the daemon see the [zoneadmd(1M)][zoneadmd.1m] man page. +When such a container is started, a temporary VNIC(Virtual NIC) is automatically created for the container. +The VNIC is deleted when the container is torn down. +The following properties can be used to set up automatic networks. +For additional information on properties, check the [zonecfg(1M)][zonecfg.1m_2] man page for the respective release of Solaris. + +* **`linkname`** *(string, OPTIONAL)* Specify a name for the automatically created VNIC datalink. +* **`lowerLink`** *(string, OPTIONAL)* Specify the link over which the VNIC will be created. +Mapped to `lower-link` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`allowedAddress`** *(string, OPTIONAL)* The set of IP addresses that the container can use might be constrained by specifying the `allowedAddress` property. + If `allowedAddress` has not been specified, then they can use any IP address on the associated physical interface for the network resource. + Otherwise, when `allowedAddress` is specified, the container cannot use IP addresses that are not in the `allowedAddress` list for the physical address. + Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`configureAllowedAddress`** *(string, OPTIONAL)* If `configureAllowedAddress` is set to true, the addresses specified by `allowedAddress` are automatically configured on the interface each time the container starts. + When it is set to false, the `allowedAddress` will not be configured on container start. + Mapped to `configure-allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`defrouter`** *(string, OPTIONAL)* The value for the OPTIONAL default router. +* **`macAddress`** *(string, OPTIONAL)* Set the VNIC's MAC addresses based on the specified value or keyword. + If not a keyword, it is interpreted as a unicast MAC address. + For a list of the supported keywords please refer to the [zonecfg(1M)][zonecfg.1m_2] man page of the respective Solaris release. + Mapped to `mac-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`linkProtection`** *(string, OPTIONAL)* Enables one or more types of link protection using comma-separated values. + See the protection property in dladm(8) for supported values in respective release of Solaris. + Mapped to `link-protection` in the [zonecfg(1M)][zonecfg.1m_2] man page. + +#### Example +```json +"anet": [ + { + "allowedAddress": "172.17.0.2/16", + "configureAllowedAddress": "true", + "defrouter": "172.17.0.1/16", + "linkProtection": "mac-nospoof, ip-nospoof", + "linkname": "net0", + "lowerLink": "net2", + "macAddress": "02:42:f8:52:c7:16" + } +] +``` + + +[priv-str-to-set.3c]: http://docs.oracle.com/cd/E86824_01/html/E54766/priv-str-to-set-3c.html +[zoneadmd.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zoneadmd-1m.html +[zonecfg.1m_2]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md new file mode 100644 index 0000000..ff551d3 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md @@ -0,0 +1,68 @@ +# Virtual-machine-specific Container Configuration + +This section describes the schema for the [virtual-machine-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The virtual-machine container specification provides additional configuration for the hypervisor, kernel, and image. + +## Hypervisor Object + +**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine. +* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor. + +### Example + +```json + "hypervisor": { + "path": "/path/to/vmm", + "parameters": ["opts1=foo", "opts2=bar"] + } +``` + +## Kernel Object + +**`kernel`** (object, REQUIRED) specifies details of the kernel to boot the container virtual machine with. +* **`path`** (string, REQUIRED) path to the kernel used to boot the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the kernel. +* **`initrd`** (string, OPTIONAL) path to an initial ramdisk to be used by the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). + +### Example + +```json + "kernel": { + "path": "/path/to/vmlinuz", + "parameters": ["foo=bar", "hello world"], + "initrd": "/path/to/initrd.img" + } +``` + +## Image Object + +**`image`** (object, OPTIONAL) specifies details of the image that contains the root filesystem for the container virtual machine. +* **`path`** (string, REQUIRED) path to the container virtual machine root image. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`format`** (string, REQUIRED) format of the container virtual machine root image. Commonly supported formats are: + * **`raw`** [raw disk image format][raw-image-format]. Unset values for `format` will default to that format. + * **`qcow2`** [QEMU image format][qcow2-image-format]. + * **`vdi`** [VirtualBox 1.1 compatible image format][vdi-image-format]. + * **`vmdk`** [VMware compatible image format][vmdk-image-format]. + * **`vhd`** [Virtual Hard Disk image format][vhd-image-format]. + +This image contains the root filesystem that the virtual machine **`kernel`** will boot into, not to be confused with the container root filesystem itself. The latter, as specified by **`path`** from the [Root Configuration](config.md#Root-Configuration) section, will be mounted inside the virtual machine at a location chosen by the virtual-machine-based runtime. + +### Example + +```json + "image": { + "path": "/path/to/vm/rootfs.img", + "format": "raw" + } +``` + +[raw-image-format]: https://en.wikipedia.org/wiki/IMG_(file_format) +[qcow2-image-format]: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qcow2.txt;hb=HEAD +[vdi-image-format]: https://forensicswiki.org/wiki/Virtual_Disk_Image_(VDI) +[vmdk-image-format]: http://www.vmware.com/app/vmdk/?src=vmdk +[vhd-image-format]: https://github.com/libyal/libvhdi/blob/master/documentation/Virtual%20Hard%20Disk%20(VHD)%20image%20format.asciidoc diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md new file mode 100644 index 0000000..5a95782 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md @@ -0,0 +1,207 @@ +# Windows-specific Container Configuration + +This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. + +## LayerFolders + +**`layerFolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer with the last entry being the scratch. +`layerFolders` MUST contain at least one entry. + +### Example + +```json +"windows": { + "layerFolders": [ + "C:\\Layers\\layer2", + "C:\\Layers\\layer1", + "C:\\Layers\\layer-base", + "C:\\scratch", + ] +} +``` + +## Devices + +**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. + +Each entry has the following structure: + +* **`id`** *(string, REQUIRED)* - specifies the device which the runtime MUST make available in the container. +* **`idType`** *(string, REQUIRED)* - tells the runtime how to interpret `id`. Today, Windows only supports a value of `class`, which identifies `id` as a [device interface class GUID][interfaceGUID]. + +[interfaceGUID]: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/overview-of-device-interface-classes + +### Example + +```json +"windows": { + "devices": [ + { + "id": "24E552D7-6523-47F7-A647-D3465BF1F5CA", + "idType": "class" + }, + { + "id": "5175d334-c371-4806-b3ba-71fd53c9258d", + "idType": "class" + } + ] +} +``` + +## Resources + +You can configure a container's resource limits via the OPTIONAL `resources` field of the Windows configuration. + +### Memory + +`memory` is an OPTIONAL configuration for the container's memory usage. + +The following parameters can be specified: + +* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes. + +#### Example + +```json +"windows": { + "resources": { + "memory": { + "limit": 2097152 + } + } +} +``` + +### CPU + +`cpu` is an OPTIONAL configuration for the container's CPU usage. + +The following parameters can be specified: + +* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. +* **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. +* **`maximum`** *(uint16, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. + +#### Example + +```json +"windows": { + "resources": { + "cpu": { + "maximum": 5000 + } + } +} +``` + +### Storage + +`storage` is an OPTIONAL configuration for the container's storage usage. + +The following parameters can be specified: + +* **`iops`** *(uint64, OPTIONAL)* - specifies the maximum IO operations per second for the system drive of the container. +* **`bps`** *(uint64, OPTIONAL)* - specifies the maximum bytes per second for the system drive of the container. +* **`sandboxSize`** *(uint64, OPTIONAL)* - specifies the minimum size of the system drive in bytes. + +#### Example + +```json +"windows": { + "resources": { + "storage": { + "iops": 50 + } + } +} +``` + +## Network + +You can configure a container's networking options via the OPTIONAL `network` field of the Windows configuration. + +The following parameters can be specified: + +* **`endpointList`** *(array of strings, OPTIONAL)* - list of HNS (Host Network Service) endpoints that the container should connect to. +* **`allowUnqualifiedDNSQuery`** *(bool, OPTIONAL)* - specifies if unqualified DNS name resolution is allowed. +* **`DNSSearchList`** *(array of strings, OPTIONAL)* - comma separated list of DNS suffixes to use for name resolution. +* **`networkSharedContainerName`** *(string, OPTIONAL)* - name (ID) of the container that we will share with the network stack. +* **`networkNamespace`** *(string, OPTIONAL)* - name (ID) of the network namespace that will be used for the container. If a network namespace is specified no other parameter must be specified. + +### Example + +```json +"windows": { + "network": { + "endpointList": [ + "7a010682-17e0-4455-a838-02e5d9655fe6" + ], + "allowUnqualifiedDNSQuery": true, + "DNSSearchList": [ + "a.com", + "b.com" + ], + "networkSharedContainerName": "containerName", + "networkNamespace": "168f3daf-efc6-4377-b20a-2c86764ba892" + } +} +``` + +## Credential Spec + +You can configure a container's group Managed Service Account (gMSA) via the OPTIONAL `credentialSpec` field of the Windows configuration. +The `credentialSpec` is a JSON object whose properties are implementation-defined. +For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. +For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling]. + + +[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts +[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools + +## Servicing + +When a container terminates, the Host Compute Service indicates if a Windows update servicing operation is pending. +You can indicate that a container should be started in a mode to apply pending servicing operations via the OPTIONAL `servicing` field of the Windows configuration. + +### Example + +```json +"windows": { + "servicing": true +} +``` + +## IgnoreFlushesDuringBoot + +You can indicate that a container should be started in an a mode where disk flushes are not performed during container boot via the OPTIONAL `ignoreFlushesDuringBoot` field of the Windows configuration. + +### Example + +```json +"windows": { + "ignoreFlushesDuringBoot": true +} +``` + +## HyperV + +`hyperv` is an OPTIONAL field of the Windows configuration. +If present, the container MUST be run with Hyper-V isolation. +If omitted, the container MUST be run as a Windows Server container. + +The following parameters can be specified: + +* **`utilityVMPath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. + This would be specified if using a base image which does not contain a utility VM image. + If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path. + +### Example + +```json +"windows": { + "hyperv": { + "utilityVMPath": "C:\\path\\to\\utilityvm" + } +} +``` diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config.md new file mode 100644 index 0000000..667bbba --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/config.md @@ -0,0 +1,975 @@ +# Configuration + +This configuration file contains metadata necessary to implement [standard operations](runtime.md#operations) against the container. +This includes the process to run, environment variables to inject, sandboxing features to use, etc. + +The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go). +[Platform](spec.md#platforms)-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below. +For properties that are only defined for some [platforms](spec.md#platforms), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`). + +Below is a detailed description of each field defined in the configuration format and valid values are specified. +Platform-specific fields are identified as such. +For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies. + + +## Specification version + +* **`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0][semver-v2.0.0] format and specifies the version of the Open Container Initiative Runtime Specification with which the bundle complies. + The Open Container Initiative Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions. + For example, if a configuration is compliant with version 1.1 of this specification, it is compatible with all runtimes that support any 1.1 or later release of this specification, but is not compatible with a runtime that supports 1.0 and not 1.1. + +### Example + +```json +"ociVersion": "0.1.0" +``` + +## Root + +**`root`** (object, OPTIONAL) specifies the container's root filesystem. +On Windows, for Windows Server Containers, this field is REQUIRED. +For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set. + +On all other platforms, this field is REQUIRED. + +* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container. + * On Windows, `path` MUST be a [volume GUID path][naming-a-volume]. + * On POSIX platforms, `path` is either an absolute path or a relative path to the bundle. + For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`. + The value SHOULD be the conventional `rootfs`. + + A directory MUST exist at the path declared by the field. + +* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false. + * On Windows, this field MUST be omitted or false. + +### Example (POSIX platforms) + +```json +"root": { + "path": "rootfs", + "readonly": true +} +``` + +### Example (Windows) + +```json +"root": { + "path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\" +} +``` + +## Mounts + +**`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root). +The runtime MUST mount entries in the listed order. +For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page. +For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page. + +* **`destination`** (string, REQUIRED) Destination of mount point: path inside container. + This value MUST be an absolute path. + * Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar). + * Solaris: corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m]. +* **`source`** (string, OPTIONAL) A device name, but can also be a file or directory name for bind mounts or a dummy. + Path values for bind mounts are either absolute or relative to the bundle. + A mount is a bind mount if it has either `bind` or `rbind` in the options. + * Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported. + * Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m]. +* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used. + * Linux: supported options are listed in the [mount(8)][mount.8] man page. + Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed. + * Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m]. + * Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given. + +### Example (Windows) + +```json +"mounts": [ + { + "destination": "C:\\folder-inside-container", + "source": "C:\\folder-on-host", + "options": ["ro"] + } +] +``` + +### POSIX-platform Mounts + +For POSIX platforms the `mounts` structure has the following fields: + +* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted. + * Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*). + * Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m]. + +### Example (Linux) + +```json +"mounts": [ + { + "destination": "/tmp", + "type": "tmpfs", + "source": "tmpfs", + "options": ["nosuid","strictatime","mode=755","size=65536k"] + }, + { + "destination": "/data", + "type": "none", + "source": "/volumes/testing", + "options": ["rbind","rw"] + } +] +``` + +### Example (Solaris) + +```json +"mounts": [ + { + "destination": "/opt/local", + "type": "lofs", + "source": "/usr/local", + "options": ["ro","nodevices"] + }, + { + "destination": "/opt/sfw", + "type": "lofs", + "source": "/opt/sfw" + } +] +``` + +## Process + +**`process`** (object, OPTIONAL) specifies the container process. +This property is REQUIRED when [`start`](runtime.md#start) is called. + +* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false. + As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal slave is duplicated on the process's [standard streams][stdin.3]. +* **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal. + Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset. + * **`height`** (uint, REQUIRED) + * **`width`** (uint, REQUIRED) +* **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable. + This value MUST be an absolute path. +* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. +* **`args`** (array of strings, OPTIONAL) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that at least one entry is REQUIRED (non-Windows), and that entry is used with the same semantics as `execvp`'s *file*. This field is OPTIONAL on Windows, and `commandLine` is REQUIRED if this field is omitted. +* **`commandLine`** (string, OPTIONAL) specifies the full command line to be executed on Windows. + This is the preferred means of supplying the command line on Windows. If omitted, the runtime will fall back to escaping and concatenating fields from `args` before making the system call into Windows. + + +### POSIX process + +For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties: + +* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process. + Each entry has the following structure: + + * **`type`** (string, REQUIRED) the platform resource being limited. + * Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`. + * Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`. + + The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface. + For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed. + For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call. + + * **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource. + `rlim.rlim_cur` MUST match the configured value. + * **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process. + `rlim.rlim_max` MUST match the configured value. + Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit. + + If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors). + +### Linux Process + +For Linux-based systems, the `process` object supports the following process-specific properties. + +* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process. + For more information about AppArmor, see [AppArmor documentation][apparmor]. +* **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process. + Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`. + Any value which cannot be mapped to a relevant kernel interface MUST cause an error. + `capabilities` contains the following properties: + + * **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process. + * **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process. + * **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process. + * **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process. + * **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process. +* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges. + As an example, the [`no_new_privs`][no-new-privs] article in the kernel documentation has information on how this is achieved using a `prctl` system call on Linux. +* **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][proc_2]. + If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value. + If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`. + + This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#memory) is scoped for a memory cgroup. + For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2]. +* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process. + For more information about SELinux, see [SELinux documentation][selinux]. + +### User + +The user for the process is a platform-specific structure that allows specific control over which user the process runs as. + +#### POSIX-platform User + +For POSIX platforms the `user` structure has the following fields: + +* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace). +* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace). +* **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask. +* **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process. + +_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_ + +### Example (Linux) + +```json +"process": { + "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, + "user": { + "uid": 1, + "gid": 1, + "umask": 63, + "additionalGids": [5, 6] + }, + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/root", + "args": [ + "sh" + ], + "apparmorProfile": "acme_secure_profile", + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true, + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ] +} +``` +### Example (Solaris) + +```json +"process": { + "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, + "user": { + "uid": 1, + "gid": 1, + "umask": 7, + "additionalGids": [2, 8] + }, + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/root", + "args": [ + "/usr/bin/bash" + ] +} +``` + +#### Windows User + +For Windows based systems the user structure has the following fields: + +* **`username`** (string, OPTIONAL) specifies the user name for the process. + +### Example (Windows) + +```json +"process": { + "terminal": true, + "user": { + "username": "containeradministrator" + }, + "env": [ + "VARIABLE=1" + ], + "cwd": "c:\\foo", + "args": [ + "someapp.exe", + ] +} +``` + + +## Hostname + +* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container. + On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7]. + Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7]. + +### Example + +```json +"hostname": "mrsdalloway" +``` + +## Platform-specific configuration + +* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md). + This MAY be set if the target platform of this spec is `linux`. +* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md). + This MUST be set if the target platform of this spec is `windows`. +* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md). + This MAY be set if the target platform of this spec is `solaris`. +* **`vm`** (object, OPTIONAL) [Virtual-machine-specific configuration](config-vm.md). + This MAY be set if the target platform and architecture of this spec support hardware virtualization. + +### Example (Linux) + +```json +{ + "linux": { + "namespaces": [ + { + "type": "pid" + } + ] + } +} +``` + +## POSIX-platform Hooks + +For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container. + +* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties: + * **`prestart`** (array of objects, OPTIONAL, **DEPRECATED**) is an array of [`prestart` hooks](#prestart). + * Entries in the array contain the following properties: + * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that **`path`** MUST be absolute. + * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. + * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. + * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. + If set, `timeout` MUST be greater than zero. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`createRuntime`** (array of objects, OPTIONAL) is an array of [`createRuntime` hooks](#createRuntime-hooks). + * Entries in the array contain the following properties (the entries are identical to the entries in the deprecated `prestart` hooks): + * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that **`path`** MUST be absolute. + * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. + * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. + * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. + If set, `timeout` MUST be greater than zero. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`createContainer`** (array of objects, OPTIONAL) is an array of [`createContainer` hooks](#createContainer-hooks). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + * **`startContainer`** (array of objects, OPTIONAL) is an array of [`startContainer` hooks](#startContainer-hooks). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [container namespace](glossary.md#container-namespace). + * The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + * **`poststart`** (array of objects, OPTIONAL) is an array of [`poststart` hooks](#poststart). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`poststop`** (array of objects, OPTIONAL) is an array of [`poststop` hooks](#poststop). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +Hooks allow users to specify programs to run before or after various lifecycle events. +Hooks MUST be called in the listed order. +The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container. + +### Prestart + +The `prestart` hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle). +On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). + +Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase. + +The `prestart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### CreateRuntime Hooks + +The `createRuntime` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. + +The `createRuntime` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). + +The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. + +Note: `runc` originally implemented `prestart` hooks contrary to the spec, namely as part of the `create` operation (instead of during the `start` operation). This incorrect implementation actually corresponds to `createRuntime` hooks. For runtimes that implement the deprecated `prestart` hooks as `createRuntime` hooks, `createRuntime` hooks MUST be called after the `prestart` hooks. + +### CreateContainer Hooks + +The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. +The `createContainer` hooks MUST be called after the `createRuntime` hooks. + +The `createContainer` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + +For example, on Linux this would happen before the `pivot_root` operation is executed but after the mount namespace was created and setup. + +The definition of `createContainer` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace and different mounts will be setup. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. + +### StartContainer Hooks + +The `startContainer` hooks MUST be called [before the user-specified process is executed](runtime.md#lifecycle) as part of the [`start`](runtime.md#start) operation. +This hook can be used to execute some operations in the container, for example running the `ldconfig` binary on linux before the container process is spawned. + +The `startContainer` hooks' path MUST resolve in the [container namespace](glossary.md#container-namespace). +The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + +### Poststart + +The `poststart` hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns. +For example, this hook can notify the user that the container process is spawned. + +The `poststart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### Poststop + +The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns. +Cleanup or debugging functions are examples of such a hook. + +The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### Summary + +See the below table for a summary of hooks and when they are called: + +| Name | Namespace | When | +| ----------------------- | --------- | -----------------------------------------------------------------------------------------------------------------------------------| +| `prestart` (Deprecated) | runtime | After the start operation is called but before the user-specified program command is executed. | +| `createRuntime` | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | +| `createContainer` | container | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | +| `startContainer` | container | After the start operation is called but before the user-specified program command is executed. | +| `poststart` | runtime | After the user-specified process is executed but before the start operation returns. | +| `poststop` | runtime | After the container is deleted but before the delete operation returns. | + +### Example + +```json +"hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createRuntime": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createContainer": [ + { + "path": "/usr/bin/mount-hook", + "args": ["-mount", "arg1", "arg2"], + "env": [ "key1=value1"] + } + ], + "startContainer": [ + { + "path": "/usr/bin/refresh-ldcache" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": ["cleanup.sh", "-f"] + } + ] +} +``` + +## Annotations + +**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container. +This information MAY be structured or unstructured. +Annotations MUST be a key-value map. +If there are no annotations then this property MAY either be absent or an empty map. + +Keys MUST be strings. +Keys MUST NOT be an empty string. +Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`. +Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications. +Runtimes MUST handle unknown annotation keys like any other [unknown property](#extensibility). + +Values MUST be strings. +Values MAY be an empty string. + +```json +"annotations": { + "com.example.gpu-cores": "2" +} +``` + +## Extensibility + +Runtimes MAY [log](runtime.md#warnings) unknown properties but MUST otherwise ignore them. +That includes not [generating errors](runtime.md#errors) if they encounter an unknown property. + +## Valid values + +Runtimes MUST generate an error when invalid or unsupported values are encountered. +Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support. + +## Configuration Schema Example + +Here is a full example `config.json` for reference. + +```json +{ + "ociVersion": "1.0.1", + "process": { + "terminal": true, + "user": { + "uid": 1, + "gid": 1, + "additionalGids": [ + 5, + 6 + ] + }, + "args": [ + "sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_CORE", + "hard": 1024, + "soft": 1024 + }, + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ], + "apparmorProfile": "acme_secure_profile", + "oomScoreAdj": 100, + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "hostname": "slartibartfast", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + } + ], + "hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": [ + "fix-mounts", + "arg1", + "arg2" + ], + "env": [ + "key1=value1" + ] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": [ + "cleanup.sh", + "-f" + ] + } + ] + }, + "linux": { + "devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } + ], + "uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" + }, + "cgroupsPath": "/myRuntime/myContainer", + "resources": { + "network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] + }, + "pids": { + "limit": 32771 + }, + "hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 9223372036854772000 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } + ], + "memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false + }, + "cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" + }, + "devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } + ], + "blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] + } + }, + "rootfsPropagation": "slave", + "seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "network" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } + ], + "maskedPaths": [ + "/proc/kcore", + "/proc/latency_stats", + "/proc/timer_stats", + "/proc/sched_debug" + ], + "readonlyPaths": [ + "/proc/asound", + "/proc/bus", + "/proc/fs", + "/proc/irq", + "/proc/sys", + "/proc/sysrq-trigger" + ], + "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" + }, + "annotations": { + "com.example.key1": "value1", + "com.example.key2": "value2" + } +} +``` + + +[apparmor]: https://wiki.ubuntu.com/AppArmor +[cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt +[selinux]:http://selinuxproject.org/page/Main_Page +[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt +[proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt +[umask.2]: http://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html +[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html +[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01 +[ieee-1003.1-2008-functions-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html +[naming-a-volume]: https://aka.ms/nb3hqb + +[capabilities.7]: http://man7.org/linux/man-pages/man7/capabilities.7.html +[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html +[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html +[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS +[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS +[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html +[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html +[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html +[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html +[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md b/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md new file mode 100644 index 0000000..0c81fad --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md @@ -0,0 +1,38 @@ +# Glossary + +## Bundle + +A [directory structure](bundle.md) that is written ahead of time, distributed, and used to seed the runtime for creating a [container](#container) and launching a process within it. + +## Configuration + +The [`config.json`](config.md) file in a [bundle](#bundle) which defines the intended [container](#container) and container process. + +## Container + +An environment for executing processes with configurable isolation and resource limitations. +For example, namespaces, resource limits, and mounts are all part of the container environment. + +## Container namespace + +On Linux,the [namespaces][namespaces.7] in which the [configured process](config.md#process) executes. + +## JSON + +All configuration [JSON][] MUST be encoded in [UTF-8][]. +JSON objects MUST NOT include duplicate names. +The order of entries in JSON objects is not significant. + +## Runtime + +An implementation of this specification. +It reads the [configuration files](#configuration) from a [bundle](#bundle), uses that information to create a [container](#container), launches a process inside the container, and performs other [lifecycle actions](runtime.md). + +## Runtime namespace + +On Linux, the namespaces from which new [container namespaces](#container-namespace) are [created](config-linux.md#namespaces) and from which some configured resources are accessed. + +[JSON]: https://tools.ietf.org/html/rfc8259 +[UTF-8]: http://www.unicode.org/versions/Unicode8.0.0/ch03.pdf + +[namespaces.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md b/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md new file mode 100644 index 0000000..921383a --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md @@ -0,0 +1,37 @@ +# Implementations + +The following sections link to associated projects, some of which are maintained by the OCI and some of which are maintained by external organizations. +If you know of any associated projects that are not listed here, please file a pull request adding a link to that project. + +## Runtime (Container) + +* [opencontainers/runc][runc] - Reference implementation of OCI runtime +* [projectatomic/bwrap-oci][bwrap-oci] - Convert the OCI spec file to a command line for [bubblewrap][bubblewrap] +* [containers/crun][crun] - Runtime implementation in C + +## Runtime (Virtual Machine) + +* [hyperhq/runv][runv] - Hypervisor-based runtime for OCI +* [clearcontainers/runtime][cc-runtime] - Hypervisor-based OCI runtime utilising [virtcontainers][virtcontainers] by Intel®. +* [google/gvisor][gvisor] - gVisor is a user-space kernel, contains runsc to run sandboxed containers. +* [kata-containers/runtime][kata-runtime] - Hypervisor-based OCI runtime combining technology from [clearcontainers/runtime][cc-runtime] and [hyperhq/runv][runv]. + +## Testing & Tools + +* [kunalkushwaha/octool][octool] - A config linter and validator. +* [huawei-openlab/oct][oct] - Open Container Testing framework for OCI configuration and runtime +* [opencontainers/runtime-tools][runtime-tools] - A config generator and runtime/bundle testing framework. + + +[runc]: https://github.com/opencontainers/runc +[runv]: https://github.com/hyperhq/runv +[cc-runtime]: https://github.com/clearcontainers/runtime +[kata-runtime]: https://github.com/kata-containers/runtime +[virtcontainers]: https://github.com/containers/virtcontainers +[octool]: https://github.com/kunalkushwaha/octool +[oct]: https://github.com/huawei-openlab/oct +[runtime-tools]: https://github.com/opencontainers/runtime-tools +[bwrap-oci]: https://github.com/projectatomic/bwrap-oci +[bubblewrap]: https://github.com/projectatomic/bubblewrap +[crun]: https://github.com/containers/crun +[gvisor]: https://github.com/google/gvisor diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics b/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics new file mode 100644 index 0000000..e8c4bc7 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics @@ -0,0 +1,41 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//Open Containers Initiative//Developer Meeting//EN +BEGIN:VTIMEZONE +TZID:America/Los_Angeles +LAST-MODIFIED:20050809T050000Z +BEGIN:STANDARD +DTSTART:20071104T020000 +RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU +TZOFFSETFROM:-0700 +TZOFFSETTO:-0800 +TZNAME:PST +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:20070311T020000 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU +TZOFFSETFROM:-0800 +TZOFFSETTO:-0700 +TZNAME:PDT +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +UID:tdc-meeting@opencontainers.org +DTSTAMP:20180628T170000Z +DTSTART;TZID=America/Los_Angeles:20170906T140000 +RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE +RDATE;TZID=America/Los_Angeles:20180110T140000 +EXDATE;TZIP=America/Los_Angeles:20180103T140000 +RDATE;TZID=America/Los_Angeles:20180711T140000 +EXDATE;TZIP=America/Los_Angeles:20180704T140000 +DURATION:PT1H +SUMMARY:OCI TDC Meeting +DESCRIPTION;ALTREP="https://github.com/opencontainers/runtime-spec# + meetings":Open Containers Initiative Developer Meeting\n + https://github.com/opencontainers/runtime-spec#meetings\n + Web: https://www.uberconference.com/opencontainers\n + Audio-only: +1 415 968 0849 (no PIN needed) +LOCATION:https://www.uberconference.com/opencontainers +URL:https://github.com/opencontainers/runtime-spec/blob/master/meeting.ics +END:VEVENT +END:VCALENDAR diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md b/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md new file mode 100644 index 0000000..6c76963 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md @@ -0,0 +1,46 @@ +# The 5 principles of Standard Containers + +Define a unit of software delivery called a Standard Container. +The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container. + +The specification for Standard Containers defines: + +1. configuration file formats +2. a set of standard operations +3. an execution environment. + +A great analogy for this is the physical shipping container used by the transportation industry. +Shipping containers are a fundamental unit of delivery, they can be lifted, stacked, locked, loaded, unloaded and labelled. +Irrespective of their contents, by standardizing the container itself it allowed for a consistent, more streamlined and efficient set of processes to be defined. +For software Standard Containers offer similar functionality by being the fundamental, standardized, unit of delivery for a software package. + +## 1. Standard operations + +Standard Containers define a set of STANDARD OPERATIONS. +They can be created, started, and stopped using standard container tools; copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools. + +## 2. Content-agnostic + +Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. +They are started in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts. + +## 3. Infrastructure-agnostic + +Standard Containers are INFRASTRUCTURE-AGNOSTIC: they can be run in any OCI supported infrastructure. +For example, a standard container can be bundled on a laptop, uploaded to cloud storage, downloaded, run and snapshotted by a build server at a fiber hotel in Virginia, uploaded to 10 staging servers in a home-made private cloud cluster, then sent to 30 production instances across 3 public cloud regions. + +## 4. Designed for automation + +Standard Containers are DESIGNED FOR AUTOMATION: because they offer the same standard operations regardless of content and infrastructure, Standard Containers, are extremely well-suited for automation. +In fact, you could say automation is their secret weapon. + +Many things that once required time-consuming and error-prone human effort can now be programmed. +Before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. +Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. +The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider. + +## 5. Industrial-grade delivery + +Standard Containers make INDUSTRIAL-GRADE DELIVERY of software a reality. +Leveraging all of the properties listed above, Standard Containers are enabling large and small enterprises to streamline and automate their software delivery pipelines. +Whether it is in-house devOps flows, or external customer-based software delivery mechanisms, Standard Containers are changing the way the community thinks about software packaging and delivery. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md new file mode 100644 index 0000000..16c6dbe --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md @@ -0,0 +1,21 @@ +# Linux Runtime + +## File descriptors + +By default, only the `stdin`, `stdout` and `stderr` file descriptors are kept open for the application by the runtime. +The runtime MAY pass additional file descriptors to the application to support features such as [socket activation][socket-activated-containers]. +Some of the file descriptors MAY be redirected to `/dev/null` even though they are open. + +## Dev symbolic links + +While creating the container (step 2 in the [lifecycle](runtime.md#lifecycle)), runtimes MUST create the following symlinks if the source file exists after processing [`mounts`](config.md#mounts): + +| Source | Destination | +| --------------- | ----------- | +| /proc/self/fd | /dev/fd | +| /proc/self/fd/0 | /dev/stdin | +| /proc/self/fd/1 | /dev/stdout | +| /proc/self/fd/2 | /dev/stderr | + + +[socket-activated-containers]: http://0pointer.de/blog/projects/socket-activated-containers.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md new file mode 100644 index 0000000..c45046b --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md @@ -0,0 +1,146 @@ +# Runtime and Lifecycle + +## Scope of a Container + +The entity using a runtime to create a container MUST be able to use the operations defined in this specification against that same container. +Whether other entities using the same, or other, instance of the runtime can see that container is out of scope of this specification. + +## State + +The state of a container includes the following properties: + +* **`ociVersion`** (string, REQUIRED) is version of the Open Container Initiative Runtime Specification with which the state complies. +* **`id`** (string, REQUIRED) is the container's ID. + This MUST be unique across all containers on this host. + There is no requirement that it be unique across hosts. +* **`status`** (string, REQUIRED) is the runtime state of the container. + The value MAY be one of: + + * `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle)) + * `created`: the runtime has finished the [create operation](#create) (after step 2 in the [lifecycle](#lifecycle)), and the container process has neither exited nor executed the user-specified program + * `running`: the container process has executed the user-specified program but has not exited (after step 5 in the [lifecycle](#lifecycle)) + * `stopped`: the container process has exited (step 7 in the [lifecycle](#lifecycle)) + + Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. +* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host. +* **`bundle`** (string, REQUIRED) is the absolute path to the container's bundle directory. + This is provided so that consumers can find the container's configuration and root filesystem on the host. +* **`annotations`** (map, OPTIONAL) contains the list of annotations associated with the container. + If no annotations were provided then this property MAY either be absent or an empty map. + +The state MAY include additional properties. + +When serialized in JSON, the format MUST adhere to the following pattern: + +```json +{ + "ociVersion": "0.2.0", + "id": "oci-container1", + "status": "running", + "pid": 4422, + "bundle": "/containers/redis", + "annotations": { + "myKey": "myValue" + } +} +``` + +See [Query State](#query-state) for information on retrieving the state of a container. + +## Lifecycle +The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist. + +1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. +2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). + If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST [generate an error](#errors). + While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified program (from [`process`](config.md#process)) MUST NOT be run at this time. + Any updates to [`config.json`](config.md) after this step MUST NOT affect the container. +3. The [`prestart` hooks](config.md#prestart) MUST be invoked by the runtime. + If any `prestart` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +4. The [`createRuntime` hooks](config.md#createRuntime-hooks) MUST be invoked by the runtime. + If any `createRuntime` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +5. The [`createContainer` hooks](config.md#createContainer-hooks) MUST be invoked by the runtime. + If any `createContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +6. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. +7. The [`startContainer` hooks](config.md#startContainer-hooks) MUST be invoked by the runtime. + If any `startContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +8. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process). +9. The [`poststart` hooks](config.md#poststart) MUST be invoked by the runtime. + If any `poststart` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. +10. The container process exits. + This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked. +11. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. +12. The container MUST be destroyed by undoing the steps performed during create phase (step 2). +13. The [`poststop` hooks](config.md#poststop) MUST be invoked by the runtime. + If any `poststop` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. + +## Errors + +In cases where the specified operation generates an error, this specification does not mandate how, or even if, that error is returned or exposed to the user of an implementation. +Unless otherwise stated, generating an error MUST leave the state of the environment as if the operation were never attempted - modulo any possible trivial ancillary changes such as logging. + +## Warnings + +In cases where the specified operation logs a warning, this specification does not mandate how, or even if, that warning is returned or exposed to the user of an implementation. +Unless otherwise stated, logging a warning does not change the flow of the operation; it MUST continue as if the warning had not been logged. + +## Operations + +Unless otherwise stated, runtimes MUST support the following operations. + +Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations. + +### Query State + +`state ` + +This operation MUST [generate an error](#errors) if it is not provided the ID of a container. +Attempting to query a container that does not exist MUST [generate an error](#errors). +This operation MUST return the state of a container as specified in the [State](#state) section. + +### Create + +`create ` + +This operation MUST [generate an error](#errors) if it is not provided a path to the bundle and the container ID to associate with the container. +If the ID provided is not unique across all containers within the scope of the runtime, or is not valid in any other way, the implementation MUST [generate an error](#errors) and a new container MUST NOT be created. +This operation MUST create a new container. + +All of the properties configured in [`config.json`](config.md) except for [`process`](config.md#process) MUST be applied. +[`process.args`](config.md#process) MUST NOT be applied until triggered by the [`start`](#start) operation. +The remaining `process` properties MAY be applied by this operation. +If the runtime cannot apply a property as specified in the [configuration](config.md), it MUST [generate an error](#errors) and a new container MUST NOT be created. + +The runtime MAY validate `config.json` against this spec, either generically or with respect to the local system capabilities, before creating the container ([step 2](#lifecycle)). +Runtime callers who are interested in pre-create validation can run [bundle-validation tools](implementations.md#testing--tools) before invoking the create operation. + +Any changes made to the [`config.json`](config.md) file after this operation will not have an effect on the container. + +### Start +`start ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to `start` a container that is not [`created`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +This operation MUST run the user-specified program as specified by [`process`](config.md#process). +This operation MUST generate an error if `process` was not set. + +### Kill +`kill ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +This operation MUST send the specified signal to the container process. + +### Delete +`delete ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +Deleting a container MUST delete the resources that were created during the `create` step. +Note that resources associated with the container, but not created by this container, MUST NOT be deleted. +Once a container is deleted its ID MAY be used by a subsequent container. + + +## Hooks +Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation. +See [runtime configuration for hooks](./config.md#posix-platform-hooks) for more information. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile new file mode 100644 index 0000000..ac8c8d2 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile @@ -0,0 +1,50 @@ +GOOD_TESTS = $(wildcard test/good/*.json) +BAD_TESTS = $(wildcard test/bad/*.json) + +default: validate + +help: + @echo "Usage: make [target]" + @echo + @echo " * 'fmt' - format the json with indentation" + @echo " * 'help' - show this help information" + @echo " * 'validate' - build the validation tool" + +fmt: + find . -name '*.json' -exec bash -c 'jq --indent 4 -M . {} > xx && mv xx {} || echo "skipping invalid {}"' \; + +.PHONY: validate +validate: validate.go + go get -d ./... + go build ./validate.go + +test: validate $(TESTS) + for TYPE in $$(ls test); \ + do \ + echo "testing $${TYPE}"; \ + for FILE in $$(ls "test/$${TYPE}/good"); \ + do \ + echo " testing test/$${TYPE}/good/$${FILE}"; \ + if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/good/$${FILE}" ; \ + then \ + echo " received expected validation success" ; \ + else \ + echo " received unexpected validation failure" ; \ + exit 1; \ + fi \ + done; \ + for FILE in $$(ls "test/$${TYPE}/bad"); \ + do \ + echo " testing test/$${TYPE}/bad/$${FILE}"; \ + if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/bad/$${FILE}" ; \ + then \ + echo " received unexpected validation success" ; \ + exit 1; \ + else \ + echo " received expected validation failure" ; \ + fi \ + done; \ + done + +clean: + rm -f validate diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md new file mode 100644 index 0000000..fecc467 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md @@ -0,0 +1,48 @@ +# JSON schema + +## Overview + +This directory contains the [JSON Schema](http://json-schema.org/) for validating JSON covered by this specification. + +The layout of the files is as follows: + +* [config-schema.json](config-schema.json) - the primary entrypoint for the [configuration](../config.md) schema +* [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md) +* [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md) +* [config-windows.json](config-windows.json) - the [Windows-specific configuration sub-structure](../config-windows.md) +* [state-schema.json](state-schema.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema +* [defs.json](defs.json) - definitions for general types +* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types +* [defs-windows.json](defs-windows.json) - definitions for Windows-specific types +* [validate.go](validate.go) - validation utility source code + + +## Utility + +There is also included a simple utility for facilitating validation. +To build it: + +```bash +export GOPATH=`mktemp -d` +go get -d ./... +go build ./validate.go +rm -rf $GOPATH +``` + +Or you can just use make command to create the utility: + +```bash +make validate +``` + +Then use it like: + +```bash +./validate config-schema.json /config.json +``` + +Or like: + +```bash +./validate https://raw.githubusercontent.com/opencontainers/runtime-spec/v1.0.0/schema/schema.json /config.json +``` diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json new file mode 100644 index 0000000..98295c4 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json @@ -0,0 +1,259 @@ +{ + "linux": { + "description": "Linux platform-specific configurations", + "type": "object", + "properties": { + "devices": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/Device" + } + }, + "uidMappings": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/IDMapping" + } + }, + "gidMappings": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/IDMapping" + } + }, + "namespaces": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "defs-linux.json#/definitions/NamespaceReference" + } + ] + } + }, + "resources": { + "type": "object", + "properties": { + "devices": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/DeviceCgroup" + } + }, + "pids": { + "type": "object", + "properties": { + "limit": { + "$ref": "defs.json#/definitions/int64" + } + }, + "required": [ + "limit" + ] + }, + "blockIO": { + "type": "object", + "properties": { + "weight": { + "$ref": "defs-linux.json#/definitions/weight" + }, + "leafWeight": { + "$ref": "defs-linux.json#/definitions/weight" + }, + "throttleReadBpsDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleWriteBpsDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleReadIOPSDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleWriteIOPSDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "weightDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceWeight" + } + } + } + }, + "cpu": { + "type": "object", + "properties": { + "cpus": { + "type": "string" + }, + "mems": { + "type": "string" + }, + "period": { + "$ref": "defs.json#/definitions/uint64" + }, + "quota": { + "$ref": "defs.json#/definitions/int64" + }, + "realtimePeriod": { + "$ref": "defs.json#/definitions/uint64" + }, + "realtimeRuntime": { + "$ref": "defs.json#/definitions/int64" + }, + "shares": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "hugepageLimits": { + "type": "array", + "items": { + "type": "object", + "properties": { + "pageSize": { + "type": "string", + "pattern": "^[1-9][0-9]*[KMG]B$" + }, + "limit": { + "$ref": "defs.json#/definitions/uint64" + } + }, + "required": [ + "pageSize", + "limit" + ] + } + }, + "memory": { + "type": "object", + "properties": { + "kernel": { + "$ref": "defs.json#/definitions/int64" + }, + "kernelTCP": { + "$ref": "defs.json#/definitions/int64" + }, + "limit": { + "$ref": "defs.json#/definitions/int64" + }, + "reservation": { + "$ref": "defs.json#/definitions/int64" + }, + "swap": { + "$ref": "defs.json#/definitions/int64" + }, + "swappiness": { + "$ref": "defs.json#/definitions/uint64" + }, + "disableOOMKiller": { + "type": "boolean" + }, + "useHierarchy": { + "type": "boolean" + } + } + }, + "network": { + "type": "object", + "properties": { + "classID": { + "$ref": "defs.json#/definitions/uint32" + }, + "priorities": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/NetworkInterfacePriority" + } + } + } + }, + "rdma": { + "type": "object", + "additionalProperties": { + "$ref": "defs-linux.json#/definitions/Rdma" + } + } + } + }, + "cgroupsPath": { + "type": "string" + }, + "rootfsPropagation": { + "$ref": "defs-linux.json#/definitions/RootfsPropagation" + }, + "seccomp": { + "type": "object", + "properties": { + "defaultAction": { + "$ref": "defs-linux.json#/definitions/SeccompAction" + }, + "flags": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/SeccompFlag" + } + }, + "architectures": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/SeccompArch" + } + }, + "syscalls": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/Syscall" + } + } + }, + "required": [ + "defaultAction" + ] + }, + "sysctl": { + "$ref": "defs.json#/definitions/mapStringString" + }, + "maskedPaths": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "readonlyPaths": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "mountLabel": { + "type": "string" + }, + "intelRdt": { + "type": "object", + "properties": { + "closID": { + "type": "string" + }, + "l3CacheSchema": { + "type": "string" + }, + "memBwSchema": { + "type": "string", + "pattern": "^MB:[^\\n]*$" + } + } + }, + "personality": { + "type": "object", + "$ref": "defs-linux.json#/definitions/Personality" + } + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json new file mode 100644 index 0000000..94923b3 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json @@ -0,0 +1,188 @@ +{ + "description": "Open Container Initiative Runtime Specification Container Configuration Schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "ociVersion": { + "$ref": "defs.json#/definitions/ociVersion" + }, + "hooks": { + "type": "object", + "properties": { + "prestart": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "createRuntime": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "createContainer": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "startContainer": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "poststart": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "poststop": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + } + } + }, + "annotations": { + "$ref": "defs.json#/definitions/annotations" + }, + "hostname": { + "type": "string" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/Mount" + } + }, + "root": { + "description": "Configures the container's root filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "readonly": { + "type": "boolean" + } + } + }, + "process": { + "type": "object", + "required": [ + "cwd" + ], + "properties": { + "args": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "commandLine": { + "type": "string" + }, + "consoleSize": { + "type": "object", + "required": [ + "height", + "width" + ], + "properties": { + "height": { + "$ref": "defs.json#/definitions/uint64" + }, + "width": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "cwd": { + "type": "string" + }, + "env": { + "$ref": "defs.json#/definitions/Env" + }, + "terminal": { + "type": "boolean" + }, + "user": { + "type": "object", + "properties": { + "uid": { + "$ref": "defs.json#/definitions/UID" + }, + "gid": { + "$ref": "defs.json#/definitions/GID" + }, + "umask": { + "$ref": "defs.json#/definitions/Umask" + }, + "additionalGids": { + "$ref": "defs.json#/definitions/ArrayOfGIDs" + }, + "username": { + "type": "string" + } + } + }, + "capabilities": { + "type": "object", + "properties": { + "bounding": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "permitted": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "effective": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "inheritable": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "ambient": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "apparmorProfile": { + "type": "string" + }, + "oomScoreAdj": { + "type": "integer" + }, + "selinuxLabel": { + "type": "string" + }, + "noNewPrivileges": { + "type": "boolean" + }, + "rlimits": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "soft", + "hard" + ], + "properties": { + "hard": { + "$ref": "defs.json#/definitions/uint64" + }, + "soft": { + "$ref": "defs.json#/definitions/uint64" + }, + "type": { + "type": "string", + "pattern": "^RLIMIT_[A-Z]+$" + } + } + } + } + } + }, + "linux": { + "$ref": "config-linux.json#/linux" + }, + "solaris": { + "$ref": "config-solaris.json#/solaris" + }, + "windows": { + "$ref": "config-windows.json#/windows" + }, + "vm": { + "$ref": "config-vm.json#/vm" + } + }, + "required": [ + "ociVersion" + ] +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json new file mode 100644 index 0000000..be9f4d2 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json @@ -0,0 +1,65 @@ +{ + "solaris": { + "description": "Solaris platform-specific configurations", + "type": "object", + "properties": { + "milestone": { + "type": "string" + }, + "limitpriv": { + "type": "string" + }, + "maxShmMemory": { + "type": "string" + }, + "cappedCPU": { + "type": "object", + "properties": { + "ncpus": { + "type": "string" + } + } + }, + "cappedMemory": { + "type": "object", + "properties": { + "physical": { + "type": "string" + }, + "swap": { + "type": "string" + } + } + }, + "anet": { + "type": "array", + "items": { + "type": "object", + "properties": { + "linkname": { + "type": "string" + }, + "lowerLink": { + "type": "string" + }, + "allowedAddress": { + "type": "string" + }, + "configureAllowedAddress": { + "type": "string" + }, + "defrouter": { + "type": "string" + }, + "macAddress": { + "type": "string" + }, + "linkProtection": { + "type": "string" + } + } + } + } + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json new file mode 100644 index 0000000..6b1fb4b --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json @@ -0,0 +1,60 @@ +{ + "vm": { + "description": "configuration for virtual-machine-based containers", + "type": "object", + "required": [ + "kernel" + ], + "properties": { + "hypervisor": { + "description": "hypervisor config used by VM-based containers", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "parameters": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "kernel": { + "description": "kernel config used by VM-based containers", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "parameters": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "initrd": { + "$ref": "defs.json#/definitions/FilePath" + } + } + }, + "image": { + "description": "root image config used by VM-based containers", + "type": "object", + "required": [ + "path", + "format" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "format": { + "$ref": "defs-vm.json#/definitions/RootImageFormat" + } + } + } + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json new file mode 100644 index 0000000..68b51e9 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json @@ -0,0 +1,102 @@ +{ + "windows": { + "description": "Windows platform-specific configurations", + "type": "object", + "properties": { + "layerFolders": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/FilePath" + }, + "minItems": 1 + }, + "devices": { + "type": "array", + "items": { + "$ref": "defs-windows.json#/definitions/Device" + } + }, + "resources": { + "type": "object", + "properties": { + "memory": { + "type": "object", + "properties": { + "limit": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "cpu": { + "type": "object", + "properties": { + "count": { + "$ref": "defs.json#/definitions/uint64" + }, + "shares": { + "$ref": "defs.json#/definitions/uint16" + }, + "maximum": { + "$ref": "defs.json#/definitions/uint16" + } + } + }, + "storage": { + "type": "object", + "properties": { + "iops": { + "$ref": "defs.json#/definitions/uint64" + }, + "bps": { + "$ref": "defs.json#/definitions/uint64" + }, + "sandboxSize": { + "$ref": "defs.json#/definitions/uint64" + } + } + } + } + }, + "network": { + "type": "object", + "properties": { + "endpointList": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "allowUnqualifiedDNSQuery": { + "type": "boolean" + }, + "DNSSearchList": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "networkSharedContainerName": { + "type": "string" + }, + "networkNamespace": { + "type": "string" + } + } + }, + "credentialSpec": { + "type": "object" + }, + "servicing": { + "type": "boolean" + }, + "ignoreFlushesDuringBoot": { + "type": "boolean" + }, + "hyperv": { + "type": "object", + "properties": { + "utilityVMPath": { + "type": "string" + } + } + } + }, + "required": [ + "layerFolders" + ] + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json new file mode 100644 index 0000000..f011b72 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json @@ -0,0 +1,308 @@ +{ + "definitions": { + "PersonalityDomain": { + "type": "string", + "enum": [ + "LINUX", + "LINUX32" + ] + }, + "Personality": { + "type": "object", + "properties": { + "domain": { + "$ref": "#/definitions/PersonalityDomain" + }, + "flags": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "RootfsPropagation": { + "type": "string", + "enum": [ + "private", + "shared", + "slave", + "unbindable" + ] + }, + "SeccompArch": { + "type": "string", + "enum": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X86_64", + "SCMP_ARCH_X32", + "SCMP_ARCH_ARM", + "SCMP_ARCH_AARCH64", + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64", + "SCMP_ARCH_MIPS64N32", + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64", + "SCMP_ARCH_MIPSEL64N32", + "SCMP_ARCH_PPC", + "SCMP_ARCH_PPC64", + "SCMP_ARCH_PPC64LE", + "SCMP_ARCH_S390", + "SCMP_ARCH_S390X", + "SCMP_ARCH_PARISC", + "SCMP_ARCH_PARISC64" + ] + }, + "SeccompAction": { + "type": "string", + "enum": [ + "SCMP_ACT_KILL", + "SCMP_ACT_TRAP", + "SCMP_ACT_ERRNO", + "SCMP_ACT_TRACE", + "SCMP_ACT_ALLOW", + "SCMP_ACT_LOG" + ] + }, + "SeccompFlag": { + "type": "string", + "enum": [ + "SECCOMP_FILTER_FLAG_TSYNC", + "SECCOMP_FILTER_FLAG_LOG", + "SECCOMP_FILTER_FLAG_SPEC_ALLOW" + ] + }, + "SeccompOperators": { + "type": "string", + "enum": [ + "SCMP_CMP_NE", + "SCMP_CMP_LT", + "SCMP_CMP_LE", + "SCMP_CMP_EQ", + "SCMP_CMP_GE", + "SCMP_CMP_GT", + "SCMP_CMP_MASKED_EQ" + ] + }, + "SyscallArg": { + "type": "object", + "properties": { + "index": { + "$ref": "defs.json#/definitions/uint32" + }, + "value": { + "$ref": "defs.json#/definitions/uint64" + }, + "valueTwo": { + "$ref": "defs.json#/definitions/uint64" + }, + "op": { + "$ref": "#/definitions/SeccompOperators" + } + }, + "required": [ + "index", + "value", + "op" + ] + }, + "Syscall": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "action": { + "$ref": "#/definitions/SeccompAction" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SyscallArg" + } + } + }, + "required": [ + "names", + "action" + ] + }, + "Major": { + "description": "major device number", + "$ref": "defs.json#/definitions/int64" + }, + "Minor": { + "description": "minor device number", + "$ref": "defs.json#/definitions/int64" + }, + "FileMode": { + "description": "File permissions mode (typically an octal value)", + "type": "integer", + "minimum": 0, + "maximum": 512 + }, + "FileType": { + "description": "Type of a block or special character device", + "type": "string", + "pattern": "^[cbup]$" + }, + "Device": { + "type": "object", + "required": [ + "type", + "path" + ], + "properties": { + "type": { + "$ref": "#/definitions/FileType" + }, + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "fileMode": { + "$ref": "#/definitions/FileMode" + }, + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + }, + "uid": { + "$ref": "defs.json#/definitions/UID" + }, + "gid": { + "$ref": "defs.json#/definitions/GID" + } + } + }, + "weight": { + "$ref": "defs.json#/definitions/uint16" + }, + "blockIODevice": { + "type": "object", + "properties": { + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + } + }, + "required": [ + "major", + "minor" + ] + }, + "blockIODeviceWeight": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/blockIODevice" + }, + { + "type": "object", + "properties": { + "weight": { + "$ref": "#/definitions/weight" + }, + "leafWeight": { + "$ref": "#/definitions/weight" + } + } + } + ] + }, + "blockIODeviceThrottle": { + "allOf": [ + { + "$ref": "#/definitions/blockIODevice" + }, + { + "type": "object", + "properties": { + "rate": { + "$ref": "defs.json#/definitions/uint64" + } + } + } + ] + }, + "DeviceCgroup": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + }, + "access": { + "type": "string" + } + }, + "required": [ + "allow" + ] + }, + "NetworkInterfacePriority": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "priority": { + "$ref": "defs.json#/definitions/uint32" + } + }, + "required": [ + "name", + "priority" + ] + }, + "Rdma": { + "type": "object", + "properties": { + "hcaHandles": { + "$ref": "defs.json#/definitions/uint32" + }, + "hcaObjects": { + "$ref": "defs.json#/definitions/uint32" + } + } + }, + "NamespaceType": { + "type": "string", + "enum": [ + "mount", + "pid", + "network", + "uts", + "ipc", + "user", + "cgroup" + ] + }, + "NamespaceReference": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/NamespaceType" + }, + "path": { + "$ref": "defs.json#/definitions/FilePath" + } + }, + "required": [ + "type" + ] + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json new file mode 100644 index 0000000..4dae915 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json @@ -0,0 +1,14 @@ +{ + "definitions": { + "RootImageFormat": { + "type": "string", + "enum": [ + "raw", + "qcow2", + "vdi", + "vmdk", + "vhd" + ] + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json new file mode 100644 index 0000000..63e0ac3 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json @@ -0,0 +1,22 @@ +{ + "definitions": { + "Device": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "idType": { + "type": "string", + "enum": [ + "class" + ] + } + }, + "required": [ + "id", + "idType" + ] + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json new file mode 100644 index 0000000..58b07e6 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json @@ -0,0 +1,158 @@ +{ + "description": "Definitions used throughout the Open Container Initiative Runtime Specification", + "definitions": { + "int8": { + "type": "integer", + "minimum": -128, + "maximum": 127 + }, + "int16": { + "type": "integer", + "minimum": -32768, + "maximum": 32767 + }, + "int32": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "int64": { + "type": "integer", + "minimum": -9223372036854776000, + "maximum": 9223372036854776000 + }, + "uint8": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "uint16": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "uint32": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "uint64": { + "type": "integer", + "minimum": 0, + "maximum": 18446744073709552000 + }, + "percent": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "mapStringString": { + "type": "object", + "patternProperties": { + ".{1,}": { + "type": "string" + } + } + }, + "UID": { + "$ref": "#/definitions/uint32" + }, + "GID": { + "$ref": "#/definitions/uint32" + }, + "Umask": { + "$ref": "#/definitions/uint32" + }, + "ArrayOfGIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/GID" + } + }, + "ArrayOfStrings": { + "type": "array", + "items": { + "type": "string" + } + }, + "FilePath": { + "type": "string" + }, + "Env": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "Hook": { + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/FilePath" + }, + "args": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "env": { + "$ref": "#/definitions/Env" + }, + "timeout": { + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "path" + ] + }, + "ArrayOfHooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + } + }, + "IDMapping": { + "type": "object", + "properties": { + "containerID": { + "$ref": "#/definitions/uint32" + }, + "hostID": { + "$ref": "#/definitions/uint32" + }, + "size": { + "$ref": "#/definitions/uint32" + } + }, + "required": [ + "containerID", + "hostID", + "size" + ] + }, + "Mount": { + "type": "object", + "properties": { + "source": { + "$ref": "#/definitions/FilePath" + }, + "destination": { + "$ref": "#/definitions/FilePath" + }, + "options": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "type": { + "type": "string" + } + }, + "required": [ + "destination" + ] + }, + "ociVersion": { + "description": "The version of Open Container Initiative Runtime Specification that the document complies with", + "type": "string" + }, + "annotations": { + "$ref": "#/definitions/mapStringString" + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json new file mode 100644 index 0000000..8f82429 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json @@ -0,0 +1,39 @@ +{ + "description": "Open Container Runtime State Schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "ociVersion": { + "$ref": "defs.json#/definitions/ociVersion" + }, + "id": { + "description": "the container's ID", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "creating", + "created", + "running", + "stopped" + ] + }, + "pid": { + "type": "integer", + "minimum": 0 + }, + "bundle": { + "type": "string" + }, + "annotations": { + "$ref": "defs.json#/definitions/annotations" + } + }, + "required": [ + "ociVersion", + "id", + "status", + "bundle" + ] +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json new file mode 100644 index 0000000..8e93528 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json @@ -0,0 +1 @@ +{] diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json new file mode 100644 index 0000000..aea35eb --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json @@ -0,0 +1,16 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "hugepageLimits": [ + { + "limit": 1234123, + "pageSize": "64kB" + } + ] + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json new file mode 100644 index 0000000..5a7ac69 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json @@ -0,0 +1,15 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "rdma": { + "mlx5_1": { + "hcaHandles": "not a uint32" + } + } + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json new file mode 100644 index 0000000..e70ed53 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json @@ -0,0 +1,22 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "rdma": { + "mlx5_1": { + "hcaHandles": 3, + "hcaObjects": 10000 + }, + "mlx4_0": { + "hcaObjects": 1000 + }, + "rxe3": { + "hcaObjects": 10000 + } + } + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json new file mode 100644 index 0000000..766d2d3 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json @@ -0,0 +1,16 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "process": { + "cwd": "/", + "args": [ + "sh" + ], + "user": { + "uid": 0, + "gid": 0 + } + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json new file mode 100644 index 0000000..e26e9d7 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json @@ -0,0 +1,6 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json new file mode 100644 index 0000000..a784d1d --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json @@ -0,0 +1,395 @@ +{ + "ociVersion": "0.5.0-dev", + "process": { + "terminal": true, + "user": { + "uid": 1, + "gid": 1, + "additionalGids": [ + 5, + 6 + ] + }, + "args": [ + "sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_CORE", + "hard": 1024, + "soft": 1024 + }, + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ], + "apparmorProfile": "acme_secure_profile", + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "hostname": "slartibartfast", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + } + ], + "hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": [ + "fix-mounts", + "arg1", + "arg2" + ], + "env": [ + "key1=value1" + ] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createRuntime": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createContainer": [ + { + "path": "/usr/bin/mount-hook", + "args": ["-mount", "arg1", "arg2"], + "env": [ "key1=value1"] + } + ], + "startContainer": [ + { + "path": "/usr/bin/refresh-ldcache" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": [ + "cleanup.sh", + "-f" + ] + } + ] + }, + "linux": { + "devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } + ], + "uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" + }, + "cgroupsPath": "/myRuntime/myContainer", + "resources": { + "network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] + }, + "pids": { + "limit": 32771 + }, + "hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 9223372036854772000 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } + ], + "oomScoreAdj": 100, + "memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false, + "useHierarchy": false + }, + "cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" + }, + "devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } + ], + "blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] + } + }, + "rootfsPropagation": "slave", + "seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "network" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } + ], + "maskedPaths": [ + "/proc/kcore", + "/proc/latency_stats", + "/proc/timer_stats", + "/proc/sched_debug" + ], + "readonlyPaths": [ + "/proc/asound", + "/proc/bus", + "/proc/fs", + "/proc/irq", + "/proc/sys", + "/proc/sysrq-trigger" + ], + "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" + }, + "annotations": { + "com.example.key1": "value1", + "com.example.key2": "value2" + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json new file mode 100644 index 0000000..8e93528 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json @@ -0,0 +1 @@ +{] diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json new file mode 100644 index 0000000..a49faee --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json @@ -0,0 +1,10 @@ +{ + "ociVersion": "0.2.0", + "id": "oci-container1", + "status": "running", + "pid": 4422, + "bundle": "/containers/redis", + "annotations": { + "myKey": "myValue" + } +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go new file mode 100644 index 0000000..847d205 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go @@ -0,0 +1,100 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "github.com/xeipuuv/gojsonschema" +) + +const usage = `Validate is used to check document with specified schema. +You can use validate in following ways: + + 1.specify document file as an argument + validate + + 2.pass document content through a pipe + cat | validate + + 3.input document content manually, ended with ctrl+d(or your self-defined EOF keys) + validate + [INPUT DOCUMENT CONTENT HERE] +` + +func main() { + nargs := len(os.Args[1:]) + if nargs == 0 || nargs > 2 { + fmt.Printf("ERROR: invalid arguments number\n\n%s\n", usage) + os.Exit(1) + } + + if os.Args[1] == "help" || + os.Args[1] == "--help" || + os.Args[1] == "-h" { + fmt.Printf("%s\n", usage) + os.Exit(1) + } + + schemaPath := os.Args[1] + if !strings.Contains(schemaPath, "://") { + var err error + schemaPath, err = formatFilePath(schemaPath) + if err != nil { + fmt.Printf("ERROR: invalid schema-file path: %s\n", err) + os.Exit(1) + } + schemaPath = "file://" + schemaPath + } + + schemaLoader := gojsonschema.NewReferenceLoader(schemaPath) + + var documentLoader gojsonschema.JSONLoader + + if nargs > 1 { + documentPath, err := formatFilePath(os.Args[2]) + if err != nil { + fmt.Printf("ERROR: invalid document-file path: %s\n", err) + os.Exit(1) + } + documentLoader = gojsonschema.NewReferenceLoader("file://" + documentPath) + } else { + documentBytes, err := ioutil.ReadAll(os.Stdin) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + documentString := string(documentBytes) + documentLoader = gojsonschema.NewStringLoader(documentString) + } + + result, err := gojsonschema.Validate(schemaLoader, documentLoader) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + if result.Valid() { + fmt.Printf("The document is valid\n") + } else { + fmt.Printf("The document is not valid. see errors :\n") + for _, desc := range result.Errors() { + fmt.Printf("- %s\n", desc) + } + os.Exit(1) + } +} + +func formatFilePath(path string) (string, error) { + if _, err := os.Stat(path); err != nil { + return "", err + } + + absPath, err := filepath.Abs(path) + if err != nil { + return "", err + } + return absPath, nil +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md b/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md new file mode 100644 index 0000000..684713a --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md @@ -0,0 +1,48 @@ +# Open Container Initiative Runtime Specification + +The [Open Container Initiative][oci] develops specifications for standards on Operating System process and application containers. + +# Abstract + +The Open Container Initiative Runtime Specification aims to specify the configuration, execution environment, and lifecycle of a container. + +A container's configuration is specified as the `config.json` for the supported platforms and details the fields that enable the creation of a container. +The execution environment is specified to ensure that applications running inside a container have a consistent environment between runtimes along with common actions defined for the container's lifecycle. + +# Platforms + +Platforms defined by this specification are: + +* `linux`: [runtime.md](runtime.md), [config.md](config.md), [config-linux.md](config-linux.md), and [runtime-linux.md](runtime-linux.md). +* `solaris`: [runtime.md](runtime.md), [config.md](config.md), and [config-solaris.md](config-solaris.md). +* `windows`: [runtime.md](runtime.md), [config.md](config.md), and [config-windows.md](config-windows.md). +* `vm`: [runtime.md](runtime.md), [config.md](config.md), and [config-vm.md](config-vm.md). + +# Table of Contents + +- [Introduction](spec.md) + - [Notational Conventions](#notational-conventions) + - [Container Principles](principles.md) +- [Filesystem Bundle](bundle.md) +- [Runtime and Lifecycle](runtime.md) + - [Linux-specific Runtime and Lifecycle](runtime-linux.md) +- [Configuration](config.md) + - [Linux-specific Configuration](config-linux.md) + - [Solaris-specific Configuration](config-solaris.md) + - [Windows-specific Configuration](config-windows.md) + - [Virtual-Machine-specific Configuration](config-vm.md) +- [Glossary](glossary.md) + +# Notational Conventions + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC 2119][rfc2119]. + +The key words "unspecified", "undefined", and "implementation-defined" are to be interpreted as described in the [rationale for the C99 standard][c99-unspecified]. + +An implementation is not compliant for a given CPU architecture if it fails to satisfy one or more of the MUST, REQUIRED, or SHALL requirements for the [platforms](#platforms) it implements. +An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the [platforms](#platforms) it implements. + + +[c99-unspecified]: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf#page=18 +[oci]: http://www.opencontainers.org +[rfc2119]: http://tools.ietf.org/html/rfc2119 diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go new file mode 100644 index 0000000..c7c7c3d --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -0,0 +1,689 @@ +package specs + +import "os" + +// Spec is the base configuration for the container. +type Spec struct { + // Version of the Open Container Initiative Runtime Specification with which the bundle complies. + Version string `json:"ociVersion"` + // Process configures the container process. + Process *Process `json:"process,omitempty"` + // Root configures the container's root filesystem. + Root *Root `json:"root,omitempty"` + // Hostname configures the container's hostname. + Hostname string `json:"hostname,omitempty"` + // Mounts configures additional mounts (on top of Root). + Mounts []Mount `json:"mounts,omitempty"` + // Hooks configures callbacks for container lifecycle events. + Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"` + // Annotations contains arbitrary metadata for the container. + Annotations map[string]string `json:"annotations,omitempty"` + + // Linux is platform-specific configuration for Linux based containers. + Linux *Linux `json:"linux,omitempty" platform:"linux"` + // Solaris is platform-specific configuration for Solaris based containers. + Solaris *Solaris `json:"solaris,omitempty" platform:"solaris"` + // Windows is platform-specific configuration for Windows based containers. + Windows *Windows `json:"windows,omitempty" platform:"windows"` + // VM specifies configuration for virtual-machine-based containers. + VM *VM `json:"vm,omitempty" platform:"vm"` +} + +// Process contains information to start a specific application inside the container. +type Process struct { + // Terminal creates an interactive terminal for the container. + Terminal bool `json:"terminal,omitempty"` + // ConsoleSize specifies the size of the console. + ConsoleSize *Box `json:"consoleSize,omitempty"` + // User specifies user information for the process. + User User `json:"user"` + // Args specifies the binary and arguments for the application to execute. + Args []string `json:"args,omitempty"` + // CommandLine specifies the full command line for the application to execute on Windows. + CommandLine string `json:"commandLine,omitempty" platform:"windows"` + // Env populates the process environment for the process. + Env []string `json:"env,omitempty"` + // Cwd is the current working directory for the process and must be + // relative to the container's root. + Cwd string `json:"cwd"` + // Capabilities are Linux capabilities that are kept for the process. + Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"` + // Rlimits specifies rlimit options to apply to the process. + Rlimits []POSIXRlimit `json:"rlimits,omitempty" platform:"linux,solaris"` + // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. + NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"` + // ApparmorProfile specifies the apparmor profile for the container. + ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` + // Specify an oom_score_adj for the container. + OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"` + // SelinuxLabel specifies the selinux context that the container process is run as. + SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` +} + +// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. +// http://man7.org/linux/man-pages/man7/capabilities.7.html +type LinuxCapabilities struct { + // Bounding is the set of capabilities checked by the kernel. + Bounding []string `json:"bounding,omitempty" platform:"linux"` + // Effective is the set of capabilities checked by the kernel. + Effective []string `json:"effective,omitempty" platform:"linux"` + // Inheritable is the capabilities preserved across execve. + Inheritable []string `json:"inheritable,omitempty" platform:"linux"` + // Permitted is the limiting superset for effective capabilities. + Permitted []string `json:"permitted,omitempty" platform:"linux"` + // Ambient is the ambient set of capabilities that are kept. + Ambient []string `json:"ambient,omitempty" platform:"linux"` +} + +// Box specifies dimensions of a rectangle. Used for specifying the size of a console. +type Box struct { + // Height is the vertical dimension of a box. + Height uint `json:"height"` + // Width is the horizontal dimension of a box. + Width uint `json:"width"` +} + +// User specifies specific user (and group) information for the container process. +type User struct { + // UID is the user id. + UID uint32 `json:"uid" platform:"linux,solaris"` + // GID is the group id. + GID uint32 `json:"gid" platform:"linux,solaris"` + // Umask is the umask for the init process. + Umask uint32 `json:"umask,omitempty" platform:"linux,solaris"` + // AdditionalGids are additional group ids set for the container's process. + AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` + // Username is the user name. + Username string `json:"username,omitempty" platform:"windows"` +} + +// Root contains information about the container's root filesystem on the host. +type Root struct { + // Path is the absolute path to the container's root filesystem. + Path string `json:"path"` + // Readonly makes the root filesystem for the container readonly before the process is executed. + Readonly bool `json:"readonly,omitempty"` +} + +// Mount specifies a mount for a container. +type Mount struct { + // Destination is the absolute path where the mount will be placed in the container. + Destination string `json:"destination"` + // Type specifies the mount kind. + Type string `json:"type,omitempty" platform:"linux,solaris"` + // Source specifies the source path of the mount. + Source string `json:"source,omitempty"` + // Options are fstab style mount options. + Options []string `json:"options,omitempty"` +} + +// Hook specifies a command that is run at a particular event in the lifecycle of a container +type Hook struct { + Path string `json:"path"` + Args []string `json:"args,omitempty"` + Env []string `json:"env,omitempty"` + Timeout *int `json:"timeout,omitempty"` +} + +// Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container +// Hooks for container setup and teardown +type Hooks struct { + // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed. + // It is called in the Runtime Namespace + Prestart []Hook `json:"prestart,omitempty"` + // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called + // It is called in the Runtime Namespace + CreateRuntime []Hook `json:"createRuntime,omitempty"` + // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called + // It is called in the Container Namespace + CreateContainer []Hook `json:"createContainer,omitempty"` + // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started + // It is called in the Container Namespace + StartContainer []Hook `json:"startContainer,omitempty"` + // Poststart is a list of hooks to be run after the container process is started. + // It is called in the Runtime Namespace + Poststart []Hook `json:"poststart,omitempty"` + // Poststop is a list of hooks to be run after the container process exits. + // It is called in the Runtime Namespace + Poststop []Hook `json:"poststop,omitempty"` +} + +// Linux contains platform-specific configuration for Linux based containers. +type Linux struct { + // UIDMapping specifies user mappings for supporting user namespaces. + UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"` + // GIDMapping specifies group mappings for supporting user namespaces. + GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"` + // Sysctl are a set of key value pairs that are set for the container on start + Sysctl map[string]string `json:"sysctl,omitempty"` + // Resources contain cgroup information for handling resource constraints + // for the container + Resources *LinuxResources `json:"resources,omitempty"` + // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. + // The path is expected to be relative to the cgroups mountpoint. + // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. + CgroupsPath string `json:"cgroupsPath,omitempty"` + // Namespaces contains the namespaces that are created and/or joined by the container + Namespaces []LinuxNamespace `json:"namespaces,omitempty"` + // Devices are a list of device nodes that are created for the container + Devices []LinuxDevice `json:"devices,omitempty"` + // Seccomp specifies the seccomp security settings for the container. + Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` + // RootfsPropagation is the rootfs mount propagation mode for the container. + RootfsPropagation string `json:"rootfsPropagation,omitempty"` + // MaskedPaths masks over the provided paths inside the container. + MaskedPaths []string `json:"maskedPaths,omitempty"` + // ReadonlyPaths sets the provided paths as RO inside the container. + ReadonlyPaths []string `json:"readonlyPaths,omitempty"` + // MountLabel specifies the selinux context for the mounts in the container. + MountLabel string `json:"mountLabel,omitempty"` + // IntelRdt contains Intel Resource Director Technology (RDT) information for + // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container + IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` + // Personality contains configuration for the Linux personality syscall + Personality *LinuxPersonality `json:"personality,omitempty"` +} + +// LinuxNamespace is the configuration for a Linux namespace +type LinuxNamespace struct { + // Type is the type of namespace + Type LinuxNamespaceType `json:"type"` + // Path is a path to an existing namespace persisted on disk that can be joined + // and is of the same type + Path string `json:"path,omitempty"` +} + +// LinuxNamespaceType is one of the Linux namespaces +type LinuxNamespaceType string + +const ( + // PIDNamespace for isolating process IDs + PIDNamespace LinuxNamespaceType = "pid" + // NetworkNamespace for isolating network devices, stacks, ports, etc + NetworkNamespace LinuxNamespaceType = "network" + // MountNamespace for isolating mount points + MountNamespace LinuxNamespaceType = "mount" + // IPCNamespace for isolating System V IPC, POSIX message queues + IPCNamespace LinuxNamespaceType = "ipc" + // UTSNamespace for isolating hostname and NIS domain name + UTSNamespace LinuxNamespaceType = "uts" + // UserNamespace for isolating user and group IDs + UserNamespace LinuxNamespaceType = "user" + // CgroupNamespace for isolating cgroup hierarchies + CgroupNamespace LinuxNamespaceType = "cgroup" +) + +// LinuxIDMapping specifies UID/GID mappings +type LinuxIDMapping struct { + // ContainerID is the starting UID/GID in the container + ContainerID uint32 `json:"containerID"` + // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' + HostID uint32 `json:"hostID"` + // Size is the number of IDs to be mapped + Size uint32 `json:"size"` +} + +// POSIXRlimit type and restrictions +type POSIXRlimit struct { + // Type of the rlimit to set + Type string `json:"type"` + // Hard is the hard limit for the specified type + Hard uint64 `json:"hard"` + // Soft is the soft limit for the specified type + Soft uint64 `json:"soft"` +} + +// LinuxHugepageLimit structure corresponds to limiting kernel hugepages +type LinuxHugepageLimit struct { + // Pagesize is the hugepage size + // Format: "B' (e.g. 64KB, 2MB, 1GB, etc.) + Pagesize string `json:"pageSize"` + // Limit is the limit of "hugepagesize" hugetlb usage + Limit uint64 `json:"limit"` +} + +// LinuxInterfacePriority for network interfaces +type LinuxInterfacePriority struct { + // Name is the name of the network interface + Name string `json:"name"` + // Priority for the interface + Priority uint32 `json:"priority"` +} + +// linuxBlockIODevice holds major:minor format supported in blkio cgroup +type linuxBlockIODevice struct { + // Major is the device's major number. + Major int64 `json:"major"` + // Minor is the device's minor number. + Minor int64 `json:"minor"` +} + +// LinuxWeightDevice struct holds a `major:minor weight` pair for weightDevice +type LinuxWeightDevice struct { + linuxBlockIODevice + // Weight is the bandwidth rate for the device. + Weight *uint16 `json:"weight,omitempty"` + // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight *uint16 `json:"leafWeight,omitempty"` +} + +// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair +type LinuxThrottleDevice struct { + linuxBlockIODevice + // Rate is the IO rate limit per cgroup per device + Rate uint64 `json:"rate"` +} + +// LinuxBlockIO for Linux cgroup 'blkio' resource management +type LinuxBlockIO struct { + // Specifies per cgroup weight + Weight *uint16 `json:"weight,omitempty"` + // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight *uint16 `json:"leafWeight,omitempty"` + // Weight per cgroup per device, can override BlkioWeight + WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` + // IO read rate limit per cgroup per device, bytes per second + ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` + // IO write rate limit per cgroup per device, bytes per second + ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` + // IO read rate limit per cgroup per device, IO per second + ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` + // IO write rate limit per cgroup per device, IO per second + ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` +} + +// LinuxMemory for Linux cgroup 'memory' resource management +type LinuxMemory struct { + // Memory limit (in bytes). + Limit *int64 `json:"limit,omitempty"` + // Memory reservation or soft_limit (in bytes). + Reservation *int64 `json:"reservation,omitempty"` + // Total memory limit (memory + swap). + Swap *int64 `json:"swap,omitempty"` + // Kernel memory limit (in bytes). + Kernel *int64 `json:"kernel,omitempty"` + // Kernel memory limit for tcp (in bytes) + KernelTCP *int64 `json:"kernelTCP,omitempty"` + // How aggressive the kernel will swap memory pages. + Swappiness *uint64 `json:"swappiness,omitempty"` + // DisableOOMKiller disables the OOM killer for out of memory conditions + DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` + // Enables hierarchical memory accounting + UseHierarchy *bool `json:"useHierarchy,omitempty"` +} + +// LinuxCPU for Linux cgroup 'cpu' resource management +type LinuxCPU struct { + // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). + Shares *uint64 `json:"shares,omitempty"` + // CPU hardcap limit (in usecs). Allowed cpu time in a given period. + Quota *int64 `json:"quota,omitempty"` + // CPU period to be used for hardcapping (in usecs). + Period *uint64 `json:"period,omitempty"` + // How much time realtime scheduling may use (in usecs). + RealtimeRuntime *int64 `json:"realtimeRuntime,omitempty"` + // CPU period to be used for realtime scheduling (in usecs). + RealtimePeriod *uint64 `json:"realtimePeriod,omitempty"` + // CPUs to use within the cpuset. Default is to use any CPU available. + Cpus string `json:"cpus,omitempty"` + // List of memory nodes in the cpuset. Default is to use any available memory node. + Mems string `json:"mems,omitempty"` +} + +// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) +type LinuxPids struct { + // Maximum number of PIDs. Default is "no limit". + Limit int64 `json:"limit"` +} + +// LinuxNetwork identification and priority configuration +type LinuxNetwork struct { + // Set class identifier for container's network packets + ClassID *uint32 `json:"classID,omitempty"` + // Set priority of network traffic for container + Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` +} + +// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) +type LinuxRdma struct { + // Maximum number of HCA handles that can be opened. Default is "no limit". + HcaHandles *uint32 `json:"hcaHandles,omitempty"` + // Maximum number of HCA objects that can be created. Default is "no limit". + HcaObjects *uint32 `json:"hcaObjects,omitempty"` +} + +// LinuxResources has container runtime resource constraints +type LinuxResources struct { + // Devices configures the device whitelist. + Devices []LinuxDeviceCgroup `json:"devices,omitempty"` + // Memory restriction configuration + Memory *LinuxMemory `json:"memory,omitempty"` + // CPU resource restriction configuration + CPU *LinuxCPU `json:"cpu,omitempty"` + // Task resource restriction configuration. + Pids *LinuxPids `json:"pids,omitempty"` + // BlockIO restriction configuration + BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` + // Hugetlb limit (in bytes) + HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` + // Network restriction configuration + Network *LinuxNetwork `json:"network,omitempty"` + // Rdma resource restriction configuration. + // Limits are a set of key value pairs that define RDMA resource limits, + // where the key is device name and value is resource limits. + Rdma map[string]LinuxRdma `json:"rdma,omitempty"` +} + +// LinuxDevice represents the mknod information for a Linux special device file +type LinuxDevice struct { + // Path to the device. + Path string `json:"path"` + // Device type, block, char, etc. + Type string `json:"type"` + // Major is the device's major number. + Major int64 `json:"major"` + // Minor is the device's minor number. + Minor int64 `json:"minor"` + // FileMode permission bits for the device. + FileMode *os.FileMode `json:"fileMode,omitempty"` + // UID of the device. + UID *uint32 `json:"uid,omitempty"` + // Gid of the device. + GID *uint32 `json:"gid,omitempty"` +} + +// LinuxDeviceCgroup represents a device rule for the whitelist controller +type LinuxDeviceCgroup struct { + // Allow or deny + Allow bool `json:"allow"` + // Device type, block, char, etc. + Type string `json:"type,omitempty"` + // Major is the device's major number. + Major *int64 `json:"major,omitempty"` + // Minor is the device's minor number. + Minor *int64 `json:"minor,omitempty"` + // Cgroup access permissions format, rwm. + Access string `json:"access,omitempty"` +} + +// LinuxPersonalityDomain refers to a personality domain. +type LinuxPersonalityDomain string + +// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined. +type LinuxPersonalityFlag string + +// Define domain and flags for Personality +const ( + // PerLinux is the standard Linux personality + PerLinux LinuxPersonalityDomain = "LINUX" + // PerLinux32 sets personality to 32 bit + PerLinux32 LinuxPersonalityDomain = "LINUX32" +) + +// LinuxPersonality represents the Linux personality syscall input +type LinuxPersonality struct { + // Domain for the personality + Domain LinuxPersonalityDomain `json:"domain"` + // Additional flags + Flags []LinuxPersonalityFlag `json:"flags,omitempty"` +} + +// Solaris contains platform-specific configuration for Solaris application containers. +type Solaris struct { + // SMF FMRI which should go "online" before we start the container process. + Milestone string `json:"milestone,omitempty"` + // Maximum set of privileges any process in this container can obtain. + LimitPriv string `json:"limitpriv,omitempty"` + // The maximum amount of shared memory allowed for this container. + MaxShmMemory string `json:"maxShmMemory,omitempty"` + // Specification for automatic creation of network resources for this container. + Anet []SolarisAnet `json:"anet,omitempty"` + // Set limit on the amount of CPU time that can be used by container. + CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"` + // The physical and swap caps on the memory that can be used by this container. + CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"` +} + +// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container. +type SolarisCappedCPU struct { + Ncpus string `json:"ncpus,omitempty"` +} + +// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container. +type SolarisCappedMemory struct { + Physical string `json:"physical,omitempty"` + Swap string `json:"swap,omitempty"` +} + +// SolarisAnet provides the specification for automatic creation of network resources for this container. +type SolarisAnet struct { + // Specify a name for the automatically created VNIC datalink. + Linkname string `json:"linkname,omitempty"` + // Specify the link over which the VNIC will be created. + Lowerlink string `json:"lowerLink,omitempty"` + // The set of IP addresses that the container can use. + Allowedaddr string `json:"allowedAddress,omitempty"` + // Specifies whether allowedAddress limitation is to be applied to the VNIC. + Configallowedaddr string `json:"configureAllowedAddress,omitempty"` + // The value of the optional default router. + Defrouter string `json:"defrouter,omitempty"` + // Enable one or more types of link protection. + Linkprotection string `json:"linkProtection,omitempty"` + // Set the VNIC's macAddress + Macaddress string `json:"macAddress,omitempty"` +} + +// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. +type Windows struct { + // LayerFolders contains a list of absolute paths to directories containing image layers. + LayerFolders []string `json:"layerFolders"` + // Devices are the list of devices to be mapped into the container. + Devices []WindowsDevice `json:"devices,omitempty"` + // Resources contains information for handling resource constraints for the container. + Resources *WindowsResources `json:"resources,omitempty"` + // CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification. + CredentialSpec interface{} `json:"credentialSpec,omitempty"` + // Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation. + Servicing bool `json:"servicing,omitempty"` + // IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process. + IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` + // HyperV contains information for running a container with Hyper-V isolation. + HyperV *WindowsHyperV `json:"hyperv,omitempty"` + // Network restriction configuration. + Network *WindowsNetwork `json:"network,omitempty"` +} + +// WindowsDevice represents information about a host device to be mapped into the container. +type WindowsDevice struct { + // Device identifier: interface class GUID, etc. + ID string `json:"id"` + // Device identifier type: "class", etc. + IDType string `json:"idType"` +} + +// WindowsResources has container runtime resource constraints for containers running on Windows. +type WindowsResources struct { + // Memory restriction configuration. + Memory *WindowsMemoryResources `json:"memory,omitempty"` + // CPU resource restriction configuration. + CPU *WindowsCPUResources `json:"cpu,omitempty"` + // Storage restriction configuration. + Storage *WindowsStorageResources `json:"storage,omitempty"` +} + +// WindowsMemoryResources contains memory resource management settings. +type WindowsMemoryResources struct { + // Memory limit in bytes. + Limit *uint64 `json:"limit,omitempty"` +} + +// WindowsCPUResources contains CPU resource management settings. +type WindowsCPUResources struct { + // Number of CPUs available to the container. + Count *uint64 `json:"count,omitempty"` + // CPU shares (relative weight to other containers with cpu shares). + Shares *uint16 `json:"shares,omitempty"` + // Specifies the portion of processor cycles that this container can use as a percentage times 100. + Maximum *uint16 `json:"maximum,omitempty"` +} + +// WindowsStorageResources contains storage resource management settings. +type WindowsStorageResources struct { + // Specifies maximum Iops for the system drive. + Iops *uint64 `json:"iops,omitempty"` + // Specifies maximum bytes per second for the system drive. + Bps *uint64 `json:"bps,omitempty"` + // Sandbox size specifies the minimum size of the system drive in bytes. + SandboxSize *uint64 `json:"sandboxSize,omitempty"` +} + +// WindowsNetwork contains network settings for Windows containers. +type WindowsNetwork struct { + // List of HNS endpoints that the container should connect to. + EndpointList []string `json:"endpointList,omitempty"` + // Specifies if unqualified DNS name resolution is allowed. + AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` + // Comma separated list of DNS suffixes to use for name resolution. + DNSSearchList []string `json:"DNSSearchList,omitempty"` + // Name (ID) of the container that we will share with the network stack. + NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` + // name (ID) of the network namespace that will be used for the container. + NetworkNamespace string `json:"networkNamespace,omitempty"` +} + +// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. +type WindowsHyperV struct { + // UtilityVMPath is an optional path to the image used for the Utility VM. + UtilityVMPath string `json:"utilityVMPath,omitempty"` +} + +// VM contains information for virtual-machine-based containers. +type VM struct { + // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers. + Hypervisor VMHypervisor `json:"hypervisor,omitempty"` + // Kernel specifies kernel-related configuration for virtual-machine-based containers. + Kernel VMKernel `json:"kernel"` + // Image specifies guest image related configuration for virtual-machine-based containers. + Image VMImage `json:"image,omitempty"` +} + +// VMHypervisor contains information about the hypervisor to use for a virtual machine. +type VMHypervisor struct { + // Path is the host path to the hypervisor used to manage the virtual machine. + Path string `json:"path"` + // Parameters specifies parameters to pass to the hypervisor. + Parameters []string `json:"parameters,omitempty"` +} + +// VMKernel contains information about the kernel to use for a virtual machine. +type VMKernel struct { + // Path is the host path to the kernel used to boot the virtual machine. + Path string `json:"path"` + // Parameters specifies parameters to pass to the kernel. + Parameters []string `json:"parameters,omitempty"` + // InitRD is the host path to an initial ramdisk to be used by the kernel. + InitRD string `json:"initrd,omitempty"` +} + +// VMImage contains information about the virtual machine root image. +type VMImage struct { + // Path is the host path to the root image that the VM kernel would boot into. + Path string `json:"path"` + // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc). + Format string `json:"format"` +} + +// LinuxSeccomp represents syscall restrictions +type LinuxSeccomp struct { + DefaultAction LinuxSeccompAction `json:"defaultAction"` + Architectures []Arch `json:"architectures,omitempty"` + Flags []LinuxSeccompFlag `json:"flags,omitempty"` + Syscalls []LinuxSyscall `json:"syscalls,omitempty"` +} + +// Arch used for additional architectures +type Arch string + +// LinuxSeccompFlag is a flag to pass to seccomp(2). +type LinuxSeccompFlag string + +// Additional architectures permitted to be used for system calls +// By default only the native architecture of the kernel is permitted +const ( + ArchX86 Arch = "SCMP_ARCH_X86" + ArchX86_64 Arch = "SCMP_ARCH_X86_64" + ArchX32 Arch = "SCMP_ARCH_X32" + ArchARM Arch = "SCMP_ARCH_ARM" + ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" + ArchMIPS Arch = "SCMP_ARCH_MIPS" + ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" + ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" + ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" + ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" + ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" + ArchPPC Arch = "SCMP_ARCH_PPC" + ArchPPC64 Arch = "SCMP_ARCH_PPC64" + ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" + ArchS390 Arch = "SCMP_ARCH_S390" + ArchS390X Arch = "SCMP_ARCH_S390X" + ArchPARISC Arch = "SCMP_ARCH_PARISC" + ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" +) + +// LinuxSeccompAction taken upon Seccomp rule match +type LinuxSeccompAction string + +// Define actions for Seccomp rules +const ( + ActKill LinuxSeccompAction = "SCMP_ACT_KILL" + ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" + ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" + ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" + ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" + ActLog LinuxSeccompAction = "SCMP_ACT_LOG" +) + +// LinuxSeccompOperator used to match syscall arguments in Seccomp +type LinuxSeccompOperator string + +// Define operators for syscall arguments in Seccomp +const ( + OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE" + OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT" + OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE" + OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ" + OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE" + OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT" + OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ" +) + +// LinuxSeccompArg used for matching specific syscall arguments in Seccomp +type LinuxSeccompArg struct { + Index uint `json:"index"` + Value uint64 `json:"value"` + ValueTwo uint64 `json:"valueTwo,omitempty"` + Op LinuxSeccompOperator `json:"op"` +} + +// LinuxSyscall is used to match a syscall in Seccomp +type LinuxSyscall struct { + Names []string `json:"names"` + Action LinuxSeccompAction `json:"action"` + Args []LinuxSeccompArg `json:"args,omitempty"` +} + +// LinuxIntelRdt has container runtime resource constraints for Intel RDT +// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel +type LinuxIntelRdt struct { + // The identity for RDT Class of Service + ClosID string `json:"closID,omitempty"` + // The schema for L3 cache id and capacity bitmask (CBM) + // Format: "L3:=;=;..." + L3CacheSchema string `json:"l3CacheSchema,omitempty"` + + // The schema of memory bandwidth per L3 cache id + // Format: "MB:=bandwidth0;=bandwidth1;..." + // The unit of memory bandwidth is specified in "percentages" by + // default, and in "MBps" if MBA Software Controller is enabled. + MemBwSchema string `json:"memBwSchema,omitempty"` +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go new file mode 100644 index 0000000..89dce34 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go @@ -0,0 +1,17 @@ +package specs + +// State holds information about the runtime state of the container. +type State struct { + // Version is the version of the specification that is supported. + Version string `json:"ociVersion"` + // ID is the container ID + ID string `json:"id"` + // Status is the runtime status of the container. + Status string `json:"status"` + // Pid is the process ID for the container process. + Pid int `json:"pid,omitempty"` + // Bundle is the path to the container's bundle directory. + Bundle string `json:"bundle"` + // Annotations are key values associated with the container. + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go new file mode 100644 index 0000000..bda7e1c --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go @@ -0,0 +1,18 @@ +package specs + +import "fmt" + +const ( + // VersionMajor is for an API incompatible changes + VersionMajor = 1 + // VersionMinor is for functionality in a backwards-compatible manner + VersionMinor = 0 + // VersionPatch is for backwards-compatible bug fixes + VersionPatch = 2 + + // VersionDev indicates development branch. Releases will be empty string. + VersionDev = "" +) + +// Version is the specification version that the package types support. +var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/style.md b/runtime/vendor/github.com/opencontainers/runtime-spec/style.md new file mode 100644 index 0000000..1d42043 --- /dev/null +++ b/runtime/vendor/github.com/opencontainers/runtime-spec/style.md @@ -0,0 +1,131 @@ +# Style and conventions + +## One sentence per line + +To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line. +This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length. +For example, this paragraph will span three lines in the Markdown source. + +## Traditionally hex settings should use JSON integers, not JSON strings + +For example, [`"classID": 1048577`](config-linux.md#network) instead of `"classID": "0x100001"`. +The config JSON isn't enough of a UI to be worth jumping through string <-> integer hoops to support an 0x… form ([source][integer-over-hex]). + +## Constant names should keep redundant prefixes + +For example, `CAP_KILL` instead of `KILL` in [**`process.capabilities`**](config.md#process). +The redundancy reduction from removing the namespacing prefix is not useful enough to be worth trimming the upstream identifier ([source][keep-prefix]). + +## Optional settings should not have pointer Go types + +Because in many cases the Go default for the type is a no-op in the spec (sources [here][no-pointer-for-strings], [here][no-pointer-for-slices], and [here][no-pointer-for-boolean]). +The exceptions are entries where we need to distinguish between “not set” and “set to the Go default for that type” ([source][pointer-when-updates-require-changes]), and this decision should be made on a per-setting case. + +## Links + +Internal links should be [relative links][markdown-relative-links] when linking to content within the repository. +Internal links should be used inline. + +External links should be collected at the bottom of a markdown file and used as referenced links. +See 'Referenced Links' in this [markdown quick reference][markdown-quick-reference]. +The use of referenced links in the markdown body helps to keep files clean and organized. +This also facilitates updates of external link targets on a per-file basis. + +Referenced links should be kept in two alphabetically sorted sets, a general reference section followed by a man page section. +To keep Pandoc happy, duplicate naming of links within pages listed in the Makefile's `DOC_FILES` variable should be avoided by appending an `_N` to the link tagname, where `N` is some number not currently in use. +The organization and style of an existing reference section should be maintained unless it violates these style guidelines. + +An exception to these rules is when a URL is needed contextually, for example when showing an explicit link to the reader. + +## Examples + +### Anchoring + +For any given section that provides a notable example, it is ideal to have it denoted with [markdown headers][markdown-headers]. +The level of header should be such that it is a subheader of the header it is an example of. + +#### Example + +```markdown +## Some Topic + +### Some Subheader + +#### Further Subheader + +##### Example + +To use Further Subheader, ... + +### Example + +To use Some Topic, ... + +``` + +### Content + +Where necessary, the values in the example can be empty or unset, but accommodate with comments regarding this intention. + +Where feasible, the content and values used in an example should convey the fullest use of the data structures concerned. +Most commonly onlookers will intend to copy-and-paste a "working example". +If the intention of the example is to be a fully utilized example, rather than a copy-and-paste example, perhaps add a comment as such. + +```markdown +### Example +``` +```json +{ + "foo": null, + "bar": "" +} +``` + +**vs.** + +```markdown +### Example + +Following is a fully populated example (not necessarily for copy/paste use) +``` +```json +{ + "foo": [ + 1, + 2, + 3 + ], + "bar": "waffles", + "bif": { + "baz": "potatoes" + } +} +``` + +### Links + +The following is an example of different types of links. +This is shown as a complete markdown file, where the referenced links are at the bottom. + +```markdown +The specification repository's [glossary](glossary.md) is where readers can find definitions of commonly used terms. + +Readers may click through to the [Open Containers namespace][open-containers] on [GitHub][github]. + +The URL for the Open Containers link above is: https://github.com/opencontainers + + +[github]: https://github.com +[open-containers]: https://github.com/opencontainers +``` + + +[integer-over-hex]: https://github.com/opencontainers/runtime-spec/pull/267#r48360013 +[keep-prefix]: https://github.com/opencontainers/runtime-spec/pull/159#issuecomment-138728337 +[no-pointer-for-boolean]: https://github.com/opencontainers/runtime-spec/pull/290#r50296396 +[no-pointer-for-slices]: https://github.com/opencontainers/runtime-spec/pull/316#r50782982 +[no-pointer-for-strings]: https://github.com/opencontainers/runtime-spec/pull/653#issue-200439192 +[pointer-when-updates-require-changes]: https://github.com/opencontainers/runtime-spec/pull/317#r50932706 +[markdown-headers]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#headings +[markdown-quick-reference]: https://en.support.wordpress.com/markdown-quick-reference +[markdown-relative-links]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#relative-links -- Gitee From 3da01d1f5e523cf7e5503c853cb32460dc374516 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 27 May 2020 14:46:33 +0800 Subject: [PATCH 005/296] Match-id-080f6ca948df8c7228aa4e7f2ff186c579ca37d1 --- hook/.gitignore | 3 + hook/glide.lock | 8 + hook/glide.yaml | 6 + hook/main.go | 199 ++++ hook/main_test.go | 15 + .../runtime-spec/.gitattributes | 2 + .../opencontainers/runtime-spec/.gitignore | 3 + .../opencontainers/runtime-spec/.mailmap | 21 + .../runtime-spec/.pullapprove.yml | 27 + .../runtime-spec/.tool/version-doc.go | 25 + .../opencontainers/runtime-spec/.travis.yml | 26 + .../opencontainers/runtime-spec/ChangeLog | 748 ++++++++++++++ .../opencontainers/runtime-spec/GOVERNANCE.md | 70 ++ .../opencontainers/runtime-spec/LICENSE | 191 ++++ .../opencontainers/runtime-spec/MAINTAINERS | 6 + .../opencontainers/runtime-spec/Makefile | 95 ++ .../opencontainers/runtime-spec/README.md | 150 +++ .../opencontainers/runtime-spec/RELEASES.md | 96 ++ .../opencontainers/runtime-spec/bundle.md | 22 + .../runtime-spec/config-linux.md | 766 ++++++++++++++ .../runtime-spec/config-solaris.md | 120 +++ .../opencontainers/runtime-spec/config-vm.md | 68 ++ .../runtime-spec/config-windows.md | 207 ++++ .../opencontainers/runtime-spec/config.md | 975 ++++++++++++++++++ .../opencontainers/runtime-spec/glossary.md | 38 + .../runtime-spec/implementations.md | 37 + .../opencontainers/runtime-spec/meeting.ics | 41 + .../opencontainers/runtime-spec/principles.md | 46 + .../runtime-spec/runtime-linux.md | 21 + .../opencontainers/runtime-spec/runtime.md | 146 +++ .../runtime-spec/schema/Makefile | 50 + .../runtime-spec/schema/README.md | 48 + .../runtime-spec/schema/config-linux.json | 259 +++++ .../runtime-spec/schema/config-schema.json | 188 ++++ .../runtime-spec/schema/config-solaris.json | 65 ++ .../runtime-spec/schema/config-vm.json | 60 ++ .../runtime-spec/schema/config-windows.json | 102 ++ .../runtime-spec/schema/defs-linux.json | 308 ++++++ .../runtime-spec/schema/defs-vm.json | 14 + .../runtime-spec/schema/defs-windows.json | 22 + .../runtime-spec/schema/defs.json | 158 +++ .../runtime-spec/schema/state-schema.json | 39 + .../schema/test/config/bad/invalid-json.json | 1 + .../test/config/bad/linux-hugepage.json | 16 + .../schema/test/config/bad/linux-rdma.json | 15 + .../schema/test/config/good/linux-rdma.json | 22 + .../test/config/good/minimal-for-start.json | 16 + .../schema/test/config/good/minimal.json | 6 + .../schema/test/config/good/spec-example.json | 395 +++++++ .../schema/test/state/bad/invalid-json.json | 1 + .../schema/test/state/good/spec-example.json | 10 + .../runtime-spec/schema/validate.go | 100 ++ .../opencontainers/runtime-spec/spec.md | 48 + .../runtime-spec/specs-go/config.go | 689 +++++++++++++ .../runtime-spec/specs-go/state.go | 17 + .../runtime-spec/specs-go/version.go | 18 + .../opencontainers/runtime-spec/style.md | 131 +++ 57 files changed, 6976 insertions(+) create mode 100644 hook/.gitignore create mode 100644 hook/glide.lock create mode 100644 hook/glide.yaml create mode 100644 hook/main.go create mode 100644 hook/main_test.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.gitignore create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.mailmap create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/LICENSE create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/Makefile create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/README.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/bundle.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/glossary.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/implementations.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/principles.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/runtime.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/spec.md create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go create mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/style.md diff --git a/hook/.gitignore b/hook/.gitignore new file mode 100644 index 0000000..0feb4a1 --- /dev/null +++ b/hook/.gitignore @@ -0,0 +1,3 @@ +.vscode +.idea +ascend-docker-hook diff --git a/hook/glide.lock b/hook/glide.lock new file mode 100644 index 0000000..24929cd --- /dev/null +++ b/hook/glide.lock @@ -0,0 +1,8 @@ +hash: 2e6cc5f93b02ceb464215129229dab3c94e03effb60af73d3bc3e808db6573dc +updated: 2020-05-18T17:43:37.4199572+08:00 +imports: +- name: github.com/opencontainers/runtime-spec + version: c4ee7d12c742ffe806cd9350b6af3b4b19faed6f + subpackages: + - specs-go +testImports: [] diff --git a/hook/glide.yaml b/hook/glide.yaml new file mode 100644 index 0000000..6ae118f --- /dev/null +++ b/hook/glide.yaml @@ -0,0 +1,6 @@ +package: ascend-docker-hook +import: +- package: github.com/opencontainers/runtime-spec + version: 1.0.2 + subpackages: + - specs-go diff --git a/hook/main.go b/hook/main.go new file mode 100644 index 0000000..01a0ebf --- /dev/null +++ b/hook/main.go @@ -0,0 +1,199 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "log" + "os" + "os/exec" + "path" + "sort" + "strconv" + "strings" + "syscall" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +const ( + loggingPrefix = "ascend-docker-hook" + ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" + ascendDockerCli = "ascend-docker-cli" + defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli" +) + +type containerConfig struct { + Pid int + Rootfs string + Env []string +} + +func removeDuplication(devices []int) []int { + list := make([]int, 0, len(devices)) + prev := -1 + + for _, device := range devices { + if device == prev { + continue + } + + list = append(list, device) + prev = device + } + + return list +} + +func parseDevices(visibleDevices string) ([]int, error) { + devices := make([]int, 0) + + for _, d := range strings.Split(visibleDevices, ",") { + d = strings.TrimSpace(d) + if strings.Contains(d, "-") { + borders := strings.Split(d, "-") + if len(borders) < 2 { + return nil, fmt.Errorf("invalid device range: %s", d) + } + + borders[0] = strings.TrimSpace(borders[0]) + borders[1] = strings.TrimSpace(borders[1]) + + left, err := strconv.Atoi(borders[0]) + if err != nil { + return nil, fmt.Errorf("invalid left boarder range parameter: %s", borders[0]) + } + + right, err := strconv.Atoi(borders[1]) + if err != nil { + return nil, fmt.Errorf("invalid right boarder range parameter: %s", borders[1]) + } + + if left > right { + return nil, fmt.Errorf("left boarder (%d) should not be larger than the right one(%d)", left, right) + } + + for n := left; n <= right; n++ { + devices = append(devices, n) + } + } else { + n, err := strconv.Atoi(d) + if err != nil { + return nil, fmt.Errorf("invalid single device parameter: %s", d) + } + + devices = append(devices, n) + } + } + + sort.Slice(devices, func(i, j int) bool { return i < j }) + return removeDuplication(devices), nil +} + +func parseOciSpecFile(file string) (*specs.Spec, error) { + f, err := os.Open(file) + if err != nil { + return nil, fmt.Errorf("failed to open the OCI config file: %s", file) + } + defer f.Close() + + spec := new(specs.Spec) + if err := json.NewDecoder(f).Decode(spec); err != nil { + return nil, fmt.Errorf("failed to parse OCI config file: %s, caused by: %w", file, err) + } + + if spec.Process == nil { + return nil, fmt.Errorf("invalid OCI spec for empty process") + } + + if spec.Root == nil { + return nil, fmt.Errorf("invalid OCI spec for empty root") + } + + return spec, nil +} + +func getContainerConfig() (*containerConfig, error) { + state := new(specs.State) + decoder := json.NewDecoder(os.Stdin) + + if err := decoder.Decode(state); err != nil { + return nil, fmt.Errorf("failed to parse the container's state") + } + + configPath := path.Join(state.Bundle, "config.json") + ociSpec, err := parseOciSpecFile(configPath) + if err != nil { + return nil, fmt.Errorf("failed to parse OCI spec: %w", err) + } + + ret := &containerConfig{ + Pid: state.Pid, + Rootfs: ociSpec.Root.Path, + Env: ociSpec.Process.Env, + } + + return ret, nil +} + +func getValueByKey(data []string, key string) string { + for _, s := range data { + p := strings.SplitN(s, "=", 2) + if len(p) != 2 { + log.Panicln("environment error") + } + + if p[0] == key { + return p[1] + } + } + + return "" +} + +func doPrestartHook() error { + containerConfig, err := getContainerConfig() + if err != nil { + return fmt.Errorf("failed to get container config: %w", err) + } + + visibleDevices := getValueByKey(containerConfig.Env, ascendVisibleDevices) + if visibleDevices == "" { + return fmt.Errorf("failed to get device setting") + } + + devices, err := parseDevices(visibleDevices) + if err != nil { + return fmt.Errorf("failed to parse device setting: %w", err) + } + + cliPath, err := exec.LookPath(ascendDockerCli) + if err != nil { + _, err = os.Stat(defaultAscendDockerCli) + if err != nil { + return fmt.Errorf("could not found ascend docker cli\n") + } + + cliPath = defaultAscendDockerCli + } + + args := append([]string{cliPath}, + "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), + "--pid", fmt.Sprintf("%d", containerConfig.Pid), + "--rootfs", containerConfig.Rootfs) + + if err := syscall.Exec(cliPath, args, os.Environ()); err != nil { + return fmt.Errorf("failed to exec ascend-docker-cli %v: %w\n", args, err) + } + + return nil +} + +func main() { + log.SetPrefix(loggingPrefix) + flag.Parse() + + if err := doPrestartHook(); err != nil { + log.Fatal(err) + } +} diff --git a/hook/main_test.go b/hook/main_test.go new file mode 100644 index 0000000..4957840 --- /dev/null +++ b/hook/main_test.go @@ -0,0 +1,15 @@ +package main + +import ( + "reflect" + "testing" +) + +func TestRemoveDuplication(t *testing.T) { + originList := []int {1,2,2,4,5,5,5,6,8,8} + resultList := removeDuplication(originList) + + if !reflect.DeepEqual(resultList, []int {1,2,4,5,6,8}) { + t.Fail() + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes b/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes new file mode 100644 index 0000000..558b67f --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes @@ -0,0 +1,2 @@ +# https://tools.ietf.org/html/rfc5545#section-3.1 +*.ics text eol=crlf diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore b/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore new file mode 100644 index 0000000..f9663c9 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore @@ -0,0 +1,3 @@ +output +schema/validate +version.md diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap b/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap new file mode 100644 index 0000000..346194c --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap @@ -0,0 +1,21 @@ +Aleksa Sarai +Alexander Morozov +Amit Saha +Antonio Murdaca +Brandon Philips +Brandon Philips +ChengTiesheng +Daniel, Dao Quang Minh +Doug Davis +James O. D. Hunt +John Howard +LinZhinan(Zen Lin) +Mrunal Patel +Mrunal Patel +Mrunal Patel +Vincent Batts +Vincent Batts +Vishnu Kannan +Vishnu Kannan +Zefan Li +梁辰晔 (Liang Chenye) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml b/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml new file mode 100644 index 0000000..ce688e2 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml @@ -0,0 +1,27 @@ +version: 2 + +requirements: + signed_off_by: + required: false + +group_defaults: + required: 2 + approve_by_comment: + enabled: true + approve_regex: ^LGTM + reject_regex: ^Rejected + reset_on_push: + enabled: true + author_approval: + ignored: true + always_pending: + title_regex: ^WIP + explanation: 'Work in progress...' + conditions: + branches: + - master + +groups: + runtime-spec: + teams: + - runtime-spec-maintainers diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go b/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go new file mode 100644 index 0000000..f36bfe4 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go @@ -0,0 +1,25 @@ +// +build ignore + +package main + +import ( + "fmt" + "html/template" + "os" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +var markdownTemplateString = ` + +**Specification Version:** *{{.}}* + +` + +var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString)) + +func main() { + if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil { + fmt.Fprintln(os.Stderr, err) + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml b/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml new file mode 100644 index 0000000..82e03a2 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml @@ -0,0 +1,26 @@ +language: go +go: + - "1.11.x" + - "1.10.x" + - "1.9.x" + +sudo: required + +services: + - docker + +before_install: + - make install.tools + - docker pull vbatts/pandoc + - go get -d ./schema/... + +install: true + +script: + - env | grep TRAVIS_ + - make .govet + - make .golint + - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" + - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation + - make docs + - make -C schema test diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog b/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog new file mode 100644 index 0000000..e257f80 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog @@ -0,0 +1,748 @@ +OpenContainers Specifications + +Changes with v1.0.2: + + Additions: + + * Add create-container, create-runtime and start-container hooks (#1008) + * config-linux: add Intel RDT CLOS name sharing support (#988) + * config-linux: Add Intel RDT/MBA Linux support (#932) + * config-linux: Add Memory cgroup's use_hierarchy (#985) + * Add Linux personality support (#1012) + * config: Add Windows Devices to Schema (#976) + * Add support for SCMP_ACT_LOG (#1019) + * config-linux: support seccomp flags (#1018) + + Minor fixes and documentation: + + * Makefile: avoid SELinux for making docs + * Clarify case with pre-configured Intel RDT closID (#1034) + * config-linux: describe more about rootfs mount propagation (#1035) + * config-linux: add SHOULD to linux.namespaces.type (#1025) + * Reduce DCO checks per PR from 3 to 1 (#1029) + * Fix typo in RELEASES.md (#1033) + * Remove some unneeded indent (#1031) + * Add documentation how to do releases (#1027) + * Removed Vishnu Kannan & Brandon Philips from maintainers (#1030 & #1028) + * schema: drop id from umask (#1024) + * implementations.md: fix repository for crun (#1017) + * Update meeting info section to point to "org" repo (#1016) + * Fix markdown escape in config-linux (#1013) + * config-linux: add more info about hugetlb page size (#1011) + * Fix ociVersion of Configuration Schema Example to support ambient capability (#1009) + * Fix Namespaces to use LinuxNamespaceType (#1007) + * change new pid namespace description (#1006) + * updating link to code of conduct in org repository (#1001) + * Update Windows LayerFolder docs (#999) + * Windows:Have native CommandLine in Process (#998) + * vm: fix parameters field (#994) + * config-linux: documentation change for Intel RDT/MBA Software Controller support (#992) + * Bump Go versions (#993) + * Support for network namespace in windows (#989) + * config: clarify source mount (#981) + * Fix camelCasing on idType to align with other Windows spec conventions (#976) + * meeting: Bump July meeting from the 4th to the 11th (#977) + * docs: Added kata-runtime to implementations (#969) + * Add gVisor to the implementations list (#970) + * .travis.yml: Get schema dependencies in before_install (#968) + * config: Clarify execution environment for hooks (#953) + * config-linux: Drop console(4) reference (#965) + * Linux devices: uid/gid relative to container (#959) + * config: Add VM-based container configuration section (#949) + * uidMappings: change order of fields for clarity (#956) + * specs-go/config: Define RDMA cgroup (#942) + * schema/Makefile: fix test (#947) + * config: Fix Linux mount options links (#952) + * glossary: Bump JSON spec to RFC 8259 (#951) + * schema: Completely drop our JSON Schema 'id' properties (#945) + * meeting: Bump January meeting from the 3rd to the 10th (#943) + * config: add "umask" field to POSIX "user" section (#941) + * schema: add allowed values for defaultAction (#940) + * config: Dedent root paragraphs, since they aren't a list entry (#936) + * fix the link to hook (#933) + * config: Collapse extensibility to a single MUST (#916) + * schema/defs-linux: change weight type to uint16 (#898) + * runtime: Clarify ociVersion as based on the state schema (#903) + +Changes with v1.0.1: + + Minor fixes and documentation: + + * spec: Expand "OCI" in spec-title reference and add "Initiative" + (#900) + * config: Simplify title to "Configuration" (#901) + * config: Fix "procfs_2" -> "proc_2" link label (#906) + * config: Fix IEEE Std 1003.1-2008 exec link markup (#913) + * config: Add a trailing period to the "cannot be mapped" rlimits + line (#915) + * config-linux: RFC 2119 MUST for absolute linux.namespaces[].path + (#925). This is technically a breaking change, because a config + with a relative namespace path would have been compliant before, + but will be non compliant with this change. However, the previous + "an absolute path to namespace file" wording was clear enough that + config authors are unlikely to be relying on relative namespace + paths in configs. + * config-linux: More specific documentation for weightDevice and + throttle* (#825) + * config-linux: Modify procfs to proc (#905) + * config-linux: Fix "psuedo" -> "pseudo" typo (#921) + * config-windows: Make maximum a uint16 (was a uint) (#891) + * runtime: Change "process in the container" -> "container + process" (#907) + * schema/config-schema: Use ArrayOfStrings in capabilities + properties. (#886) + * schema/config-linux: + s/throttleWriteIopsDevice/throttleWriteIOPSDevice/ (#899) + * schema/config-linux: add intelRdt field (#889) + * schema/config-solaris: Replaced refs with some fields + (cappedCPU.ncpus, etc.) (#892) + +Changes with v1.0.0: + + Breaking changes: + + * config: Shift disableOOMKiller from linux.resources to + linux.resources.memory (#896) + + Decreased restrictions: + + * runtime: Make the state JSON's pid optional on non-Linux platforms + (#897) + + Minor fixes and documentation: + + * schema/defs-linux: Require Syscall.action (#885) + * specs-go/config: Fix 'omiempty' -> 'omitempty' typo for + LinuxSeccompArg.ValueTwo (#884) + * ROAMAP: remove the pre-v1.0.0 roadmap (#890) + +Changes with v1.0.0-rc6: + + Breaking changes: + + * config: Shift oomScoreAdj to process and add RFC 2119 requirements + for the runtime (#781, #789, #836) + * config: Forbid 'root' on Hyper-V (#820, #838). + * config: process.capabilities and process.noNewPrivileges are + Linux-only again (#880). This partially reverses #673, which had + landed in v1.0.0-rc5. + * config: Remove process.rlimits from Windows (#880). It is now + POSIX-only, while in v1.0.0-rc5 it was cross-platform (because of + #673). Before #673 (in v1.0.0-rc4 and earlier), it was + Linux-only. + * config-linux: Drop redundant 'blkio' prefix from blockIO + properties (#860) + * config-linux: Make memory limits int64 instead of uint64 (#876). + This partially reverses #704, which had landed in v1.0.0-rc5. + * config-windows: Change CPU 'percent' to 'maximum' (#777) + * config-windows: Remove memory 'reservation' (#788) + * config-windows: Remove 'resources.network' and add 'network' (#801) + + Additions: + + * config: Windows runtimes MUST support the 'ro' mount option (#868) + * config-linux: Add Intel RDT/CAT Linux support (#630, #787) + * config-linux: Add Markdown specification for syscalls (#706) + * config-linux: Add 'unbindable' rootfsPropagation value (#770, #775) + * config-windows: Add 'credentialSpec' (#814, #859) + * config-windows: Add 'servicing' (#815) + * config-windows: Add 'ignoreFlushesDuringBoot' (#816, #859) + * config-windows: Add 'hyperv' (#818, #849, #859) + * config-windows: Add 'layerFolders' (#828) + + Removals and increased restrictions: + + * config: Remove 'platform' (#850) + * config: Require strictly-postitive 'timeout' values (#764) + * config: Strengthen punt to kernel for valid capabilities strings + (#766, #790) + * config: Require volume GUID paths for root.path (#849) + * config: Forbid setting 'readonly' true on Windows (#819) + * config: Forbid setting mount 'type' entirely on Windows and forbid + UNC paths and mapped drives in 'source' on Windows (#821) + * config: Remove 'hooks' from Windows spec (#855, #869, #870) + * config-linux: Clearly require absolute path for namespace (#720) + * config-linux: RFC 2119 tightening for namespaces (#767) + * config-linux: Require at least one entry in + linux.seccomp.syscalls[].names (#769) + * config-linux: Remove syscall.comment (#714) + * config-linux: Use MUST and MAY for weight and leafWeight (#751) + * config-linux: Remove explicit 'null' from device cgroup values + (#804) + * runtime: Remove "features the runtime chooses to support" (#732) + * runtime: Drop "not supported by the base OS" loophole (#733) + * runtime-linux: Condition /proc/self/fd symlinks on source + existence (#736) + + Decreased restrictions: + + * config: Make 'process' optional (#701, #805) + * config-linux: Make linux.seccomp.syscalls optional (#768) + * config-linux: valueTwo is now optional in + `linux.seccomp.syscalls[].args` entries (#877) + * config-linux: Remove local range restrictions for blkioWeight, + blkioLeafWeight, weight, leafWeight, and shares (#780) + * config-linux: Explicitly allow symlinks for providing devices (#873) + + Minor fixes and documentation: + + * config: Remove "MAY support any valid values" sentence (#851) + * config: Remove the previously-forbidden mounts[].type from the + Windows spec (#854) + * config: Clarify mounts[].source relative path anchor (#735) + * config: Explicitly make consoleSize ignored if terminal is false or + unset (#863) + * config: Specify height/width units (characters) for consoleSize (#761) + * config: Use "POSIX platforms" instead of "Linux and Solaris" (#838) + * config-linux: Explicit namespace for interface names (#713) + * config-linux: Explicitly list cgroupsPath as optional (#823) + * runtime: Clarify valid container states for 'start', 'kill', and + 'delete' (#875) + * runtime: Explicitly make process.* timing implementation-defined (#700) + * specs-go/config: Remove range restrictions from Windows comments (#783) + * specs-go/config: Add omitempty to LinuxSyscall.Args (#763) + * specs-go/config: Use a pointer for Process.ConsoleSize (#792) + * schema/README: Use v1.0.0 URL in examples to prepare for the 1.0.0 + release (#881) + * schema/Makefile: Make 'validate' the default target (#750) + * schema/Makefile: Add 'clean' target (#774) + * schema: Add 'test' target to the Makefile (#785) + * *: Remove unnecessary .PHONY entries (#750, #778, #802) + * *: Typo fixes and polishing (#681, #708, #702, #703, #709, #711, + #712, #721, #722, #723, #724, #730, #737, #738, #741, #744, #749, + #753, #756, #765, #773, #776, #784, #786, #793, #794, #796, #798, + #799, #800, #803, #807, #809, #811, #812, #822, #824, #826, #827, + #832, #839, #840, #846, #847, #848, #852, #856, #858, #862, #865, + #871, #874) + +Changes with v1.0.0-rc5: + + Breaking changes: + + * config: Explicitly require `platform` (#695). + * config: The platform-specific sections (`linux`, `solaris`, and + `windows`) MUST NOT be set unless they match `platform.os` (#673). + * config: `process.capabilities` is now an object instead of an + array of strings (#675). + * config-linux: No longer allow negative values for some resources, + partially reversing #648 from v1.0.0-rc4 (#704). + * config-linux: `linux.seccomp.syscalls` entries have `names` + instead of `name` (#657). + * runtime: Rename the state `bundlePath` property to `bundle` + (#674). + + Additions: + + * config: `process.capabilities` is no longer Linux-only (#673). + * config-linux: `linux.seccomp.syscalls` entries have a new + `comment` property (#657). + * config-linux: Add new architectures from libseccomp 2.3.2 (#705) + * runtime: Add a `creating` state `status` (#507, #694). + + Removals and increased restrictions: + + * runtime: Document hook timing and exit code handling (#532). + * schema/config-linux: Explicit `null` values are no longer + compliant (#662). + + Decreased restrictions: + + * config: `type` and `source` properties are now optional for + `mounts` entries (#699). + * config: `args` property is now optional for hooks (#685). + * config-linux: Runtimes no longer need to provide `/proc` and + other filesystems unless they are explicitly requested in the + configuration JSON (#666). + + Minor fixes and documentation: + + * spec: Add OCI Runtime Abstract (#691). + * config: Document the Go `platform` tag (#570). + * config-linux: Remove local uid/gid mapping limit and punt to the + kernel (#693). + * schema: Fix broken `string` and similar `$ref`s (#684). + * schema: Remove `mounts` from required properties (#696). + * schema: Remove `major` and `minor` from `linux.devices` entries + (#688). + * schema: Check for the required `type`, `hard`, and `soft` in + `process.rlimits` entries (#696). + * schema/validate: Gained usage documentation and fixed + `schemaPath` logic when the argument did not contain `://` (#552). + * *: Add anchor tags to a number of spec locations (#707). + * *: Consistent link syntax (#687). + * *: Minor cleanup and rewording (#697). + +Changes with v1.0.0-rc4: + Additions: + + * config-linux: Allow negative values for some resources (#648) + * config-linux: Lift no-tweaking namespace restriction (#649) + + Removals and increased restrictions: + + * config: Rlimit types must be unique (#607) + * config: Forbid empty-string keys in 'annotations' (#645, #654) + * config-linux: Require runtime errors for pre-existing devices + (#647) + * runtime: Only require 'pid' in the state for created/running + statuses (#664) + * schema: Add 'consoleSize' and update requirements (#646) + * schema: Remove string pointers (#656) + * schema/config-linux: Remove blockIODeviceThrottle and other + pointers (#545) + + Breaking Go changes: + + * specs-go/config: Remove string pointers (#653) + * specs-go/config: Make Spec.Hooks a pointer (#427) + * specs-go/config: Convert some resources from unsigned integers + to signed integers (#648) + + Minor fixes and documentation: + + * config: Explicitly list 'hooks' as optional and cite POSIX for + 'env' and 'args' (#427) + * runtime: Replace "process is stopped" with "process exits" + (#465) + * schema/config-linux: Add missing kernelTCP (#655) + * schema/validate: Allow schema identifiers to contain a URL + scheme (#490) + * .travis: Fix git-validation commit ranges (#216) + * *: Add anchor tags to a number of spec locations (#612, #636, + #637, #638, #639, #640) + * *: Typo fixes and polishing (#643, #650, #652, #656, #660, #665) + +Changes with v1.0.0-rc3: + Additions: + + * config: Add support for Windows-based containers (#565, #573) + * config: Add process.consoleSize (#563) + * config: Explicitly allow unknown extensions and document + annotations key conventions (#510) + * config: Define mounts entries for Solaris (#588) + + Removals and increased restrictions: + + * config: Require absolute paths for mount destinations (#609) + * config-linux: Require absolute path for maskedPaths and + readonlyPaths (#587) + * config-linux: Only require /dev/console when process.terminal is + true. Also require /dev/console to be provided by a bind mount + (#518) + * runtime: Require runtimes to generate errors when the container + specified in config.json cannot be created (#559) + + Breaking Go changes: + + * specs-go/config: Aggressive namespacing (#567) + * specs-go/config: Remove pointers from LinuxHugepageLimit, + LinuxInterfacePriority, and LinuxPids properties (#586) + * specs-go/state: Rename version to ociVersion (#633) + LinuxInterfacePriority, and LinuxPids properties (#586) + + Minor fixes and documentation: + + * spec: Separate the spec from project scaffolding (#626) + * README: Define "unspecified", "undefined", and + "implementation-defined" (#575) + * config: Clarify absolue and relative values for root.path (#558) + * config: Clarify ociVersion covering the configuration <-> + runtime API (#523) + * config-linux: Forbid duplicated namespaces with same `type` + (#597) + * glossary: Make objects explicitly unordered and forbid duplicate + names (#584) + * specs-go/config: Add platform tags to Rlimits and + NoNewPRivileges (#564) + * schema/defs-linux: Use int64 for major/minor types (#610) + * Makefile: Add support for Go 1.7 (#547) + * Makefile: Require Go >= 1.6 for golint (#589) + * Makefile: Use a POSIX-compatible test ('==' -> '=') (#542) + * implementations: Rename ocitools -> runtime-tools (#585) + * *: Typo fixes and polishing (#556, #566, #568, #569, #571, #572, + #574, #595, #596, #599, #600, #601, #603, #605, #608, #613, #617, + #619, #621, #622, #623, #624, #625, #627, #629) + +Changes with v1.0.0-rc2: + Additions: + + * config-linux: Add new architectures from libseccomp 2.3.0 (#505) + * schema: Add JSON Schema for state JSON and move schema.json to + config-schema.json and similar (#481, #498, #519) + + Minor fixes and documentation: + + * Add compliance language for platforms and architectures (#527) + * Remove "unconditionally compliant" language (#553) + * bundle: Remove distribution references (#487) + * runtime: Fix sub-bullet indentation (#495) + * config: Replace Arch fstab reference with mount(8) (#443) + * config: Synchronize comments between Markdown and Go (#525) + * config: Drop v0.x compatibility statement (#488) + * config-linux: RFC 2119 wording for cgroupsPath (#493) + * config-linux: Make linux.devices and linux.resources.devices + optional (#526) + * config-linux: Extend no-tweak requirement to runtime namespaces (#538) + * schema: Add hook.timeout (#544) + * schema: Add missing '"type": "object"' (#528) + * schema: Run 'make fmt' and remove duplicates (#546, #551) + * schema/config: Make 'hostname' optional (#491) + * schema/config-linux: Add linux.resources.devices (#550) + * specs-go/config: Add Solaris tags to User properties (#496) + * specs-go/config: Make Linux and Solaris omitempty again (#502) + * specs-go/config: Make KernelTCP and ClassID omitempty (#531) + * specs-go/config: Fix "specified" typo for ApparmorProfile (#503) + * Makefile: Remove code-of-conduct.md and version.md when clean (#541) + * implementations: Mention cc-oci-runtime (#539) + * Use filesystem instead of file system (#529) + * .pullapprove: Add DCO check via PullApprove + * GOVERNANCE: Add governance and release process docs (#521) + * README: Change meeting time from 10am to 2pm Pacific (#524) + * README: Update conference-call phone number (#512, #515) + +Changes with v1.0.0-rc1: + Breaking changes: + + * runtime: Split create and start, #384, #450, #463, #464, #467, + #468 + * runtime: Remove exec, #388 + * runtime: Enviroment MUST match the configuration, #397 + * config: Runtime MUST generate errors for unsupported platforms, + #441 + * config: Windows mount destinations MUST NOT be nested, #437 + + Additions: + + * solaris: Added platform-specific configuration, #411, #424, #431, + #436 + * runtime: Add 'annotations' and 'status' to the state structure, + #462, #484, #485 + * runtime: State no longer needs to be serialized as JSON, #446 + * runtime-linux: Add /dev symbolic links, #449 + * config: Allow absolute paths for root.path (which previously + required relative paths), #394 + * config-linux: Add linux.mountLabel, #393 + * config-linux: Add suport for cgroup namespace, #397 + * config-linux: Runtime SHOULD NOT modify ownership of any + referenced filesystem (previously the restriction only applied to + the root filesystem), #452 + * specs-go/seccomp: Add ppc and s390x to specs-go/config.go, #475 + + Minor fixes and documentation: + + * README: Add project.md to the Table of Contents, #376 + * README: Consistenly indent the Table of Contents, #400 + * README: Link to LICENSE, #442 + * README: Weekly call is OCI-wide, #378 + * config: Explicit runtime namespace for hooks, #415 + * config: Explicit container namespace for uid, gid, and + additionalGids, #412 + * config: Fix 'string' -> 'array of strings' typo for process.args, + #416 + * runtime: The runtime MAY validate config.json, #418 + * runtime: Move errors section out of operations, #445 + * runtime: MAY -> SHOULD for post-stop error logging, #410 + * schema/README: Document JSON Schema usage, #360, #385 + * schema: Minor description updates, #456, #461 + * schema/validate: Support reading documents via stdin, #482 + * .pullapprove: Automate review approval, #458, #474 + * .gitignore: Hide more auto-generated files, #386, #392 + * .travis: git-validation detects Travis now, #366 + * .travis: Regress on failure to produce docs, #479 + * Makefile: Filename docs.* -> oci-runtime-spec.*, #478 + * Makefile: Add install.tools target, #349 + * Makefile: Allow native pandoc implementations, #428, #448 + * Makefile: Prefer Bash, #455 + * Makefile: Travis support for .gitvalidation, #422 + * specs-go/config: Add missing omitempties for Process.Terminal, + Root.Readonly, Spec.Linux, and Spec.Mounts, #408, #429, #430, #431 + * specs-go/config: Remove incorrect omitempties for User.UID and + User.GID, #425 + * specs-go/config: Drop platform-independent comment, #451 + * version: Include version in generated documentation, #406 + * *: Anchor examples, #348 + * *: Fix remnants from SelinuxProcessLabel to SelinuxLabel rename, + #396 + * *: Outsource code-of-conduct to TOB repository, #375, #413 + * *: RFC 2119 consistency, #407, #409, #438, #444, #449 + * *: Typo fixes, #390, #401 + * *: Whitespace fixes and validation, #380, #381, #426 + * ROADMAP: Remove stale targets, #435 + +Changes with v0.5.0: + Breaking changes: + + * specs-go: Renamed the repository from opencontainers/specs to + opencontainers/runtime-spec, #365 + + Additions: + + * config: Add 'timeout' for hooks, #346 + * config-linux: Add 'maskedPaths' and 'readonlyPaths', #364 + + Minor fixes and documentation: + + * JSON Schema bug-fixes and improved examples, #370 + * README: Define "unconditionally compliant", #374 + * config: Make Markdown canonical, #342 + * config: Explicitly list mapping from symbolic names to UID/GIDs as + out-of-scope, #347 + * config-linux: Require the runtime mount namespace for namespace + 'path' values, #275 + * config-linux: Reword kernelTCP docs, #377 + * specs-go: Add omitempty to 'Device' and 'Namespace', #340 + * .travis.yml: Use built-in 'go vet' and current 'go lint', dropping + Go < 1.5, #372, #352 + * implementations: Expand ocitools scope to include testing, #328 + * style: Move one-sentence-per-line rule from the README, #369 + * style: Remove dangling parenthesis, #359 + * README: Add a link to the IRC logs, #358 + * Fix "manadate", "exmaple", "paramters", and "preferrably" typos, + #353, #354 + +Changes with v0.4.0: + Breaking changes: + + * config: Move capabilities, selinuxProcessLabel, apparmorProfile, + and noNewPrivileges from the linux setting to the process setting + and make them optional, renaming selinuxProcessLabel to + selinuxLabel, #329, #330, #339 + * runtime: Rename version to ociVerison in the state JSON, #225 + * runtime: Remove the directory requirement for storing state, now + that there is a 'state' operation, #225, #334 + * go: Shift *.go to specs-go/*.go, #276 + * config: Move rlimits to process, #341 + * go: Move config_linux.go content into config.go, removing + LinuxSpec, #310 + + Additions: + + * schema: Add JSON Schema (and validator) for `config.json`, #313 + * config: Add annotations for opaque-to-the-runtime data, #331 + * config-linux: Make seccomp optional, #333 + * runtime: Added additional operations: state, stop, and exec. + #225 + + Minor fixes and documentation: + + * config-linux: Change mount type from *rune to *string and fix + octal fileMode examples, #323 + * runtime: RFC 2119 phrasing for the lifecycle, #225 + * README: Add a full example of config.json, #276 + * README: Replace BlueJeans with UberConference, #326, #338 + * style: Document Go-pointer exceptions, #317 + +Changes with v0.3.0: + Breaking changes: + + * config: Single, unified config file, #284 + * config: cwd is a required default, and must be absolute, #286, + #307, #308, #312 + * config: qualify the name of the version field, #309 + * config-linux: Convert classID from hex to uint32, #296 + * config-linux: Separate mknod from cgroups, #298 + + Additions: + + * config-linux: Add NoNewPrivileges setting for linux, #290 + + Minor fixes and documentation: + + * config-linux: clarify oom_score_adj, #236, #292 + * config-linux: Update links to cgroups documentation, #318 + * config-linux: Remove pointers for slices preferring omitempty + tag instead, #316 + * README: add runtime, bundle, and hook author user, #280 + * ROADMAP: reshuffled and split into GitHub issues, #300, #301, + #304, #306 + * style: Collect established styles in a discoverable location, #287, #311 + +Changes with v0.2.0: + * Add Apparmor, Selinux and Seccomp + * Add Apparmor, Selinux and Seccomp sections + * Add bind mount example + * Add fd section for linux container process + * Add Go types for specification + * *: adding a code of conduct + * Adding cgroups path to the Spec. + * .: Adding listing of implementations + * .: adding travis file for future CI + * Add license and DCO information for contributions + * Add linux spec description + * Add MAINTAINERS file + * Add memory swappiness to linux spec + * Add runtime state configuration and structs + * Adds a section for user namespace mappings + * Adds link to kernel cgroups documentation + * Adds section for Linux Rlimits + * Adds section for Linux Sysctl. + * Adds user namespace to the list of namespaces + * bundle: add initial run use case + * bundle: Fix 'and any number of and other related' typo + * bundle.md: clarify arbitrary/conventional dirnames + * bundle.md: fix link formatting + * bundle.md: fix off-by-one error + * bundle.md: various updates to latest spec + * bundle: Move 'Linux sysctl' header to its own line + * Change commiter to committer + * Change Device field order in spec_linux.go, 'Path' should be top of the 'Type' field, according to the different of the config-linux.md, 'Path' field is the unique key. + * Change layout of mountpoints and mounts + * Change the rlimit type to string instead of int + * Clarify behavior around namespaces paths. + * config: Add example additionalGids + * config: Add example cwd + * config: cleanup language on readonly parameter + * config: fix links to go files + * config-linux: specify the default devices/filesystems available + * config.md: clarify destination for mounts + * config.md: make the version a semver + * config.md: make the version field example a semver + * config.md: minor clean up of process specification + * config.md: reformat into a standard style + * config.md: update links to spec schema code + * config.md: various cleanup/consistency fixes + * config: minor cleanup + * Deduplicate the field of RootfsPropagation + * Define constants for Linux Namespace names + * Fix LinuxRuntime field + * Fix root object keys + * Fix typos in config.md + * Fix typos in the "Namespace types" section + * Fix typos in the rlimits section + * Fix Windows path escaping in example mount JSON + * JSON objects are easier to parse/manipulate + * made repo public. Added warning in README + * Make namespaces match runc + * make rootfs mount propagation mode settable + * Makes namespaces description linux specific + * *.md: markdown formatting + * Modify the capabilities constants to match header files like other constants + * Move linux specific options to linux spec + * README: add a rule for paragraph formatting in markdown + * README: Document BlueJeans and wiki archive for meetings + * README: Document pre-meeting agenda alteration + * README: Document YouTube and IRC backchannel for meetings + * README: Focus on local runtime (create/start/stop) + * README.md: Add a git commit style guide + * README.md: contribution about discussion + * README: releases section + * README: Remove blank line from infrastructure-agnostic paragraph + * removed boilerplate file + * *: remove superfluous comma in code-of-conduct + * Remove trailing whitespace + * Rename SystemProperties to Sysctl + * Rename the header "Access to devices" to "Devices" to fit with the config + * *: re-org the spec + * Replace Linux.Device with more specific config + * restore formatting + * Return golang compliant names for UID and GID in User + * Return golint-compliant naming for mappings + * runtime: Add prestart/poststop hooks + * runtime_config: comments for golint + * runtime-config-linux: Drop 'Linux' from headers + * runtime_config_linux: Fix 'LinuxSpec' -> 'LinuxRuntimeSpec' in comment + * runtime-config-linux: One sentence per line for opening two paragraphs + * runtime-config: Remove blank lines from the end of files + * runtime-config: Remove 'destination' docs from mounts + * runtime.md: convert oc to runc + * runtime: use opencontainer vs oci + * *: small spelling fixes + * Specific platform specific user struct for spec + * spec: linux: add support for the PIDs cgroup + * spec_linux: conform to `golint` + * spec_linux.go: Rename IDMapping fields to follow syscall.SysProcIDMap + * spec_linux: remove ending periods on one-line comments + * spec: rename ocp to oci and add a link + * specs: add json notation + * specs: align the ascii graph + * specs: fix the description for the [ug]idMappings + * specs: introduce the concept of a runtime.json + * .tools: cleanup the commit entry + * .tools: repo validation tool + * travis: fix DCO validation for merges + * typo: containers -> container's + * typo: the -> for + * Update config-linux for better formatting on values + * Update README.md + * Update readme with weekly call and mailing list + * Update runtime.md + * Update runtime.md + * Update runtime.md + * version: more explicit version for comparison + +Changes with v0.1.0: + * Add Architecture field to Seccomp configuration in Linux runtime + * Add @hqhq as maintainer + * Add hyphen for host specific + * Adding Vishnu Kannan as a Maintainer. + * Add initial roadmap + * Add lifecycle for containers + * Add oom_score_adj to the runtime Spec. + * Add post-start hooks + * Add Seccomp constants to description of Linux runtime spec + * Add Seccomp constants to Linux runtime config + * Add some clarity around the state.json file + * adds text describing the upper-case keywords used in the spec + * add testing framework to ROADMAP + * Appropriately mark optional fields as omitempty + * cgroup: Add support for memory.kmem.tcp.limit_in_bytes + * Change HugepageLimit.Limit type to uint64 + * Change the behavior when cgroupsPath is absent + * Change version from 0.1.0 to 0.2.0 + * Clarify the semantics of hook elements + * Cleanup bundle.md + * Cleanup principles + * config: linux: update description of PidsLimit + * config: Require a new UTS namespace for config.json's hostname + * config: Require the runtime to mount Spec.Mounts in order + * convert **name** to **`name`** + * Example lists "root' but text mentions "bundlePath" + * Fix an extra space in VersionMinor + * Fix golint warnings + * Fix typo in BlockIO struct comment + * Fix typo in Filesystem Bundle + * Fix value of swappiness + * glossary: Provide a quick overview of important terms + * glossary: Specify UTF-8 for all our JSON + * hooks: deduplicate the hooks docs + * implementations: Link to kunalkushwaha/octool + * implementations: Link to mrunalp/ocitools + * lifecycle: Don't require /run/opencontainer//containers + * lifecycle: Mention runtime.json + * lifecycle: no hypens + * MAINTAINERS: add tianon per the charter + * MAINTAINERS: correct Vish's github account + * Makefile: Add glossary to DOC_FILES + * Make optional Cgroup related config params pointers along with `omitempty` json tag. + * Mark RootfsPropagation as omitempty + * *.md: update TOC and links + * move the description of Rlimits before example + * move the description of user ns mapping to proper file + * principles: Give principles their own home + * *: printable documents + * Project: document release process + * README: Fix some headers + * README: make header more concise + * remove blank char from blank line + * Remove the unneeded build tag from the config_linux.go + * Remove trailing comma in hooks json example + * Rename State's Root to Bundle + * ROADMAP.md: remove the tail spaces + * roadmap: update links and add wiki reference + * runtime: Add 'version' to the state.json example + * runtime-config: add example label before json example + * runtime-config: add section about Hooks + * runtime: config: linux: add cgroups information + * runtime: config: linux: Edit BlockIO struct + * runtime: config: linux: Fix typo and trailing commas in json example + * runtime_config_linux.go: add missing pointer + * runtime-config-linux.md: fix the type of cpus and mems + * runtime.md: fix spacing + * Talk about host specific/independent instead of mutability + * .tools: commit validator is a separate project + * .tools: make GetFetchHeadCommit do what it says + * .travis.yml: add go 1.5.1, update from 1.4.2 to 1.4.3 + * Update readme with wiki link to minutes + * Update Typo in ROADMAP.md + * Use unsigned for IDs + * version: introduce a string for dev indication diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md b/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md new file mode 100644 index 0000000..92c8609 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md @@ -0,0 +1,70 @@ +# Project governance + +The [OCI charter][charter] §5.b.viii tasks an OCI Project's maintainers (listed in the repository's MAINTAINERS file and sometimes referred to as "the TDC", [§5.e][charter]) with: + +> Creating, maintaining and enforcing governance guidelines for the TDC, approved by the maintainers, and which shall be posted visibly for the TDC. + +This section describes generic rules and procedures for fulfilling that mandate. + +## Proposing a motion + +A maintainer SHOULD propose a motion on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with another maintainer as a co-sponsor. + +## Voting + +Voting on a proposed motion SHOULD happen on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with maintainers posting LGTM or REJECT. +Maintainers MAY also explicitly not vote by posting ABSTAIN (which is useful to revert a previous vote). +Maintainers MAY post multiple times (e.g. as they revise their position based on feedback), but only their final post counts in the tally. +A proposed motion is adopted if two-thirds of votes cast, a quorum having voted, are in favor of the release. + +Voting SHOULD remain open for a week to collect feedback from the wider community and allow the maintainers to digest the proposed motion. +Under exceptional conditions (e.g. non-major security fix releases) proposals which reach quorum with unanimous support MAY be adopted earlier. + +A maintainer MAY choose to reply with REJECT. +A maintainer posting a REJECT MUST include a list of concerns or links to written documentation for those concerns (e.g. GitHub issues or mailing-list threads). +The maintainers SHOULD try to resolve the concerns and wait for the rejecting maintainer to change their opinion to LGTM. +However, a motion MAY be adopted with REJECTs, as outlined in the previous paragraphs. + +## Quorum + +A quorum is established when at least two-thirds of maintainers have voted. + +For projects that are not specifications, a [motion to release](#release-approval) MAY be adopted if the tally is at least three LGTMs and no REJECTs, even if three votes does not meet the usual two-thirds quorum. + +## Security issues + +Motions with sensitive security implications MUST be proposed on the security@opencontainers.org mailing list instead of dev@opencontainers.org, but should otherwise follow the standard [proposal](#proposing-a-motion) process. +The security@opencontainers.org mailing list includes all members of the TOB. +The TOB will contact the project maintainers and provide a channel for discussing and voting on the motion, but voting will otherwise follow the standard [voting](#voting) and [quorum](#quorum) rules. +The TOB and project maintainers will work together to notify affected parties before making an adopted motion public. + +## Amendments + +The [project governance](#project-governance) rules and procedures MAY be amended or replaced using the procedures themselves. +The MAINTAINERS of this project governance document is the total set of MAINTAINERS from all Open Containers projects (runC, runtime-spec, and image-spec). + +## Subject templates + +Maintainers are busy and get lots of email. +To make project proposals recognizable, proposed motions SHOULD use the following subject templates. + +### Proposing a motion + +> [{project} VOTE]: {motion description} (closes {end of voting window}) + +For example: + +> [runtime-spec VOTE]: Tag 0647920 as 1.0.0-rc (closes 2016-06-03 20:00 UTC) + +### Tallying results + +After voting closes, a maintainer SHOULD post a tally to the motion thread with a subject template like: + +> [{project} {status}]: {motion description} (+{LGTMs} -{REJECTs} #{ABSTAINs}) + +Where `{status}` is either `adopted` or `rejected`. +For example: + +> [runtime-spec adopted]: Tag 0647920 as 1.0.0-rc (+6 -0 #3) + +[charter]: https://www.opencontainers.org/about/governance diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE b/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE new file mode 100644 index 0000000..bdc4036 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2015 The Linux Foundation. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS b/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS new file mode 100644 index 0000000..f559c5b --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS @@ -0,0 +1,6 @@ +Michael Crosby (@crosbymichael) +Mrunal Patel (@mrunalp) +Vincent Batts (@vbatts) +Daniel, Dao Quang Minh (@dqminh) +Tianon Gravi (@tianon) +Qiang Huang (@hqhq) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/Makefile b/hook/vendor/github.com/opencontainers/runtime-spec/Makefile new file mode 100644 index 0000000..16051b3 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/Makefile @@ -0,0 +1,95 @@ + +EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667 +OUTPUT_DIRNAME ?= output +DOC_FILENAME ?= oci-runtime-spec +DOCKER ?= $(shell command -v docker 2>/dev/null) +PANDOC ?= $(shell command -v pandoc 2>/dev/null) +ifeq "$(strip $(PANDOC))" '' + ifneq "$(strip $(DOCKER))" '' + PANDOC = $(DOCKER) run \ + --security-opt label=disable \ + -it \ + --rm \ + -v $(shell pwd)/:/input/:ro \ + -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \ + -u $(shell id -u) \ + vbatts/pandoc + PANDOC_SRC := /input/ + PANDOC_DST := / + endif +endif + +# These docs are in an order that determines how they show up in the PDF/HTML docs. +DOC_FILES := \ + version.md \ + spec.md \ + principles.md \ + bundle.md \ + runtime.md \ + runtime-linux.md \ + config.md \ + config-linux.md \ + config-solaris.md \ + glossary.md + +default: docs + +docs: $(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html + +ifeq "$(strip $(PANDOC))" '' +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: + $(error cannot build $@ without either pandoc or docker) +else +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) + mkdir -p $(OUTPUT_DIRNAME)/ && \ + $(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) + +$(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) + mkdir -p $(OUTPUT_DIRNAME)/ && \ + $(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) +endif + +version.md: ./specs-go/version.go + go run ./.tool/version-doc.go > $@ + +HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-) +# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked. +ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true') + +test: .govet .golint .gitvalidation + +.govet: + go vet -x ./... + +# `go get github.com/golang/lint/golint` +.golint: +ifeq ($(call ALLOWED_GO_VERSION,1.7,$(HOST_GOLANG_VERSION)),true) + @which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false) + golint ./... +endif + + +# When this is running in travis, it will only check the travis commit range +.gitvalidation: + @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) +ifdef TRAVIS_COMMIT_RANGE + git-validation -q -run short-subject,dangling-whitespace +else + git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD +endif + +install.tools: .install.golint .install.gitvalidation + +# golint does not even build for + +using your real name (sorry, no pseudonyms or anonymous contributions.) + +You can add the sign off when creating the git commit via `git commit -s`. + +#### Commit Style + +Simple house-keeping for clean git history. +Read more on [How to Write a Git Commit Message][how-to-git-commit] or the Discussion section of [git-commit(1)][git-commit.1]. + +1. Separate the subject from body with a blank line +2. Limit the subject line to 50 characters +3. Capitalize the subject line +4. Do not end the subject line with a period +5. Use the imperative mood in the subject line +6. Wrap the body at 72 characters +7. Use the body to explain what and why vs. how + * If there was important/useful/essential conversation or information, copy or include a reference +8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") + + +[charter]: https://www.opencontainers.org/about/governance +[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md +[dev-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev +[how-to-git-commit]: http://chris.beams.io/posts/git-commit +[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ +[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date +[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ +[oci]: https://www.opencontainers.org +[rfc5545]: https://tools.ietf.org/html/rfc5545 +[runtime-wiki]: https://github.com/opencontainers/runtime-spec/wiki +[uberconference]: https://www.uberconference.com/opencontainers + +[git-commit.1]: http://git-scm.com/docs/git-commit diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md b/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md new file mode 100644 index 0000000..cd48def --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md @@ -0,0 +1,96 @@ +# Releases + +The release process hopes to encourage early, consistent consensus-building during project development. +The mechanisms used are regular community communication on the mailing list about progress, scheduled meetings for issue resolution and release triage, and regularly paced and communicated releases. +Releases are proposed and adopted or rejected using the usual [project governance](GOVERNANCE.md) rules and procedures. + +An anti-pattern that we want to avoid is heavy development or discussions "late cycle" around major releases. +We want to build a community that is involved and communicates consistently through all releases instead of relying on "silent periods" as a judge of stability. + +## Parallel releases + +A single project MAY consider several motions to release in parallel. +However each motion to release after the initial 0.1.0 MUST be based on a previous release that has already landed. + +For example, runtime-spec maintainers may propose a v1.0.0-rc2 on the 1st of the month and a v0.9.1 bugfix on the 2nd of the month. +They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th if the vote initiated on the 1st passes). + +## Specifications + +The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools. +However, specification releases have special restrictions in the [OCI charter][charter]: + +* They are the target of backwards compatibility (§7.g), and +* They are subject to the OFWa patent grant (§8.d and e). + +To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases: + +### Planning a release + +Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases. +This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC. +Maintainers MUST send updates to the dev@opencontainers.org with results of these meetings. + +Before the specification reaches v1.0.0, the meetings SHOULD be weekly. +Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting. + +The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones). +GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures. + +### Timelines + +Specifications have a variety of different timelines in their lifecycle. + +* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback. +* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart. + This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself. + Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced. + For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0. +* Minor and patch releases SHOULD be made on an as-needed basis. + +[charter]: https://www.opencontainers.org/about/governance + +## Checklist + +Releases usually follow a few steps: + +* [ ] prepare a pull-request for the release + * [ ] a commit updating `./ChangeLog` + * [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -` + * [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting + * [ ] review `(^M|^A|^D)` for impact of the commit + * [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:` + * [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'` + * [ ] merge multi-commit PRs (so each line has a `(#num)` suffix) + * [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /` + * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable + * [ ] a commit adding back the "-dev" to `VersionDev` +* [ ] send email to dev@opencontainers.org + * [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev") + * [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l` + * [ ] get the date for a week from now, like `TZ=UTC date --date='next week'` + * [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description + * [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)` + * [ ] email body like +``` +Hey everyone, + +There have been $numPRs PRs merged since $priorTag release (https://github.com/opencontainers/runtime-spec/compare/$priorTag...$versionBumpCommit). + +$linkToPullRequest + +Please respond LGTM or REJECT (with reasoning). + +$sig +``` +* [ ] edit/update the pull-request to link to the VOTE thread, from https://groups.google.com/a/opencontainers.org/forum/#!forum/dev +* [ ] a week later, if the vote passes, merge the PR + * [ ] `git tag -s $version $versionBumpCommit` + * [ ] `git push --tags` +* [ ] produce release documents + * [ ] git checkout the release tag, like `git checkout $version` + * [ ] `make docs` + * [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf`` + * [ ] attach these docs to the release on https://github.com/opencontainers/runtime-spec/releases + * [ ] link to the the VOTE thread and include the passing vote count + * [ ] link to the pull request that merged the release diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md b/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md new file mode 100644 index 0000000..0924ad9 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md @@ -0,0 +1,22 @@ +# Filesystem Bundle + +## Container Format + +This section defines a format for encoding a container as a *filesystem bundle* - a set of files organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it. +See also [MacOS application bundles][macos_bundle] for a similar use of the term *bundle*. + +The definition of a bundle is only concerned with how a container, and its configuration data, are stored on a local filesystem so that it can be consumed by a compliant runtime. + +A Standard Container bundle contains all the information needed to load and run a container. +This includes the following artifacts: + +1. `config.json`: contains configuration data. + This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`. + See [`config.json`](config.md) for more details. + +2. container's root filesystem: the directory referenced by [`root.path`](config.md#root), if that property is set in `config.json`. + +When supplied, while these artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle. +In other words, a tar archive of a *bundle* will have these artifacts at the root of the archive, not nested within a top-level directory. + +[macos_bundle]: https://en.wikipedia.org/wiki/Bundle_%28macOS%29 diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md new file mode 100644 index 0000000..368bf28 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md @@ -0,0 +1,766 @@ +# Linux Container Configuration + +This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. + +## Default Filesystems + +The Linux ABI includes both syscalls and several special file paths. +Applications expecting a Linux environment will very likely expect these file paths to be set up correctly. + +The following filesystems SHOULD be made available in each container's filesystem: + +| Path | Type | +| -------- | ------ | +| /proc | [proc][] | +| /sys | [sysfs][] | +| /dev/pts | [devpts][] | +| /dev/shm | [tmpfs][] | + +## Namespaces + +A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. +Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. +For more information, see the [namespaces(7)][namespaces.7_2] man page. + +Namespaces are specified as an array of entries inside the `namespaces` root field. +The following parameters can be specified to set up namespaces: + +* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types SHOULD be supported: + * **`pid`** processes inside the container will only be able to see other processes inside the same container or inside the same pid namespace. + * **`network`** the container will have its own network stack. + * **`mount`** the container will have an isolated mount table. + * **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC. + * **`uts`** the container will be able to have its own hostname and domain name. + * **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container. + * **`cgroup`** the container will have an isolated view of the cgroup hierarchy. +* **`path`** *(string, OPTIONAL)* - namespace file. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). + The runtime MUST place the container process in the namespace associated with that `path`. + The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`. + + If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`. + +If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type. +If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors). + +### Example + +```json +"namespaces": [ + { + "type": "pid", + "path": "/proc/1234/ns/pid" + }, + { + "type": "network", + "path": "/var/run/netns/neta" + }, + { + "type": "mount" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } +] +``` + +## User namespace mappings + +**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container. +**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container. + +Each entry has the following structure: + +* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container. +* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*. +* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped. + +The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping. +Note that the number of mapping entries MAY be limited by the [kernel][user-namespaces]. + +### Example + +```json +"uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } +], +"gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } +] +``` + +## Devices + +**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. +The runtime MAY supply them however it likes (with [`mknod`][mknod.2], by bind mounting from the runtime mount namespace, using symlinks, etc.). + +Each entry has the following structure: + +* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`. + More info in [mknod(1)][mknod.1]. +* **`path`** *(string, REQUIRED)* - full path to device inside container. + If a [file][] already exists at `path` that does not match the requested device, the runtime MUST generate an error. +* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device. +* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. + You can also control access to devices [with cgroups](#device-whitelist). +* **`uid`** *(uint32, OPTIONAL)* - id of device owner in the [container namespace](glossary.md#container-namespace). +* **`gid`** *(uint32, OPTIONAL)* - id of device group in the [container namespace](glossary.md#container-namespace). + +The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices. + +### Example + +```json +"devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } +] +``` + +### Default Devices + +In addition to any devices configured with this setting, the runtime MUST also supply: + +* [`/dev/null`][null.4] +* [`/dev/zero`][zero.4] +* [`/dev/full`][full.4] +* [`/dev/random`][random.4] +* [`/dev/urandom`][random.4] +* [`/dev/tty`][tty.4] +* `/dev/console` is set up if [`terminal`](config.md#process) is enabled in the config by bind mounting the pseudoterminal slave to `/dev/console`. +* [`/dev/ptmx`][pts.4]. + A [bind-mount or symlink of the container's `/dev/pts/ptmx`][devpts]. + +## Control groups + +Also known as cgroups, they are used to restrict resource usage for a container and handle device access. +cgroups provide controls (through controllers) to restrict cpu, memory, IO, pids, network and RDMA resources for the container. +For more information, see the [kernel cgroups documentation][cgroup-v1]. + +### Cgroups Path + +**`cgroupsPath`** (string, OPTIONAL) path to the cgroups. +It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container. + +The value of `cgroupsPath` MUST be either an absolute path or a relative path. + +* In the case of an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point. +* In the case of a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy. + +If the value is specified, the runtime MUST consistently attach to the same place in the cgroups hierarchy given the same value of `cgroupsPath`. +If the value is not specified, the runtime MAY define the default cgroups path. +Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case. + +Implementations of the Spec can choose to name cgroups in any manner. +The Spec does not include naming schema for cgroups. +The Spec does not support per-controller paths for the reasons discussed in the [cgroupv2 documentation][cgroup-v2]. +The cgroups will be created if they don't exist. + +You can configure a container's cgroups via the `resources` field of the Linux configuration. +Do not specify `resources` unless limits have to be updated. +For example, to run a new process in an existing container without updating limits, `resources` need not be specified. + +Runtimes MAY attach the container process to additional cgroup controllers beyond those necessary to fulfill the `resources` settings. + +### Example + +```json +"cgroupsPath": "/myRuntime/myContainer", +"resources": { + "memory": { + "limit": 100000, + "reservation": 200000 + }, + "devices": [ + { + "allow": false, + "access": "rwm" + } + ] +} +``` + +### Device whitelist + +**`devices`** (array of objects, OPTIONAL) configures the [device whitelist][cgroup-v1-devices]. +The runtime MUST apply entries in the listed order. + +Each entry has the following structure: + +* **`allow`** *(boolean, REQUIRED)* - whether the entry is allowed or denied. +* **`type`** *(string, OPTIONAL)* - type of device: `a` (all), `c` (char), or `b` (block). + Unset values mean "all", mapping to `a`. +* **`major, minor`** *(int64, OPTIONAL)* - [major, minor numbers][devices] for the device. + Unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices]. +* **`access`** *(string, OPTIONAL)* - cgroup permissions for device. + A composition of `r` (read), `w` (write), and `m` (mknod). + +#### Example + +```json +"devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } +] +``` + +### Memory + +**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage. +For more information, see the kernel cgroups documentation about [memory][cgroup-v1-memory]. + +Values for memory specify the limit in bytes, or `-1` for unlimited memory. + +* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage +* **`reservation`** *(int64, OPTIONAL)* - sets soft limit of memory usage +* **`swap`** *(int64, OPTIONAL)* - sets limit of memory+Swap usage +* **`kernel`** *(int64, OPTIONAL)* - sets hard limit for kernel memory +* **`kernelTCP`** *(int64, OPTIONAL)* - sets hard limit for kernel TCP buffer memory + +The following properties do not specify memory limits, but are covered by the `memory` controller: + +* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness) + The values are from 0 to 100. Higher means more swappy. +* **`disableOOMKiller`** *(bool, OPTIONAL)* - enables or disables the OOM killer. + If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. + The OOM killer is enabled by default in every cgroup using the `memory` subsystem. + To disable it, specify a value of `true`. +* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting. + If enabled (`true`), child cgroups will share the memory limits of this cgroup. + +#### Example + +```json +"memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false +} +``` + +### CPU + +**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets`. +For more information, see the kernel cgroups documentation about [cpusets][cgroup-v1-cpusets]. + +The following parameters can be specified to set up the controller: + +* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup +* **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by **`period`** below) +* **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only) +* **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources +* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only +* **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in +* **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in + +#### Example + +```json +"cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" +} +``` + +### Block IO + +**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller. +For more information, see the kernel cgroups documentation about [blkio][cgroup-v1-blkio]. + +The following parameters can be specified to set up the controller: + +* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. +* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. +* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`weight`** *(uint16, OPTIONAL)* - bandwidth weight for the device. + * **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth weight for the device while competing with the cgroup's child cgroups, CFQ scheduler only + + You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. + +* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth rate limits. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device + +* **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - an array of per-device IO rate limits. + Each entry has the following structure: + * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. + For more information, see the [mknod(1)][mknod.1] man page. + * **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device + +#### Example + +```json +"blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] +} +``` + +### Huge page limits + +**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the +HugeTLB usage per control group and enforces the controller limit during page fault. +For more information, see the kernel cgroups documentation about [HugeTLB][cgroup-v1-hugetlb]. + +Each entry has the following structure: + +* **`pageSize`** *(string, REQUIRED)* - hugepage size + The value has the format `B` (64KB, 2MB, 1GB), and must match the `` of the + corresponding control file found in `/sys/fs/cgroup/hugetlb/hugetlb..limit_in_bytes`. + Values of `` are intended to be parsed using base 1024 ("1KB" = 1024, "1MB" = 1048576, etc). +* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage + +#### Example + +```json +"hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 209715200 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } +] +``` + +### Network + +**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio`. +For more information, see the kernel cgroups documentations about [net\_cls cgroup][cgroup-v1-net-cls] and [net\_prio cgroup][cgroup-v1-net-prio]. + +The following parameters can be specified to set up the controller: + +* **`classID`** *(uint32, OPTIONAL)* - is the network class identifier the cgroup's network packets will be tagged with +* **`priorities`** *(array of objects, OPTIONAL)* - specifies a list of objects of the priorities assigned to traffic originating from processes in the group and egressing the system on various interfaces. + The following parameters can be specified per-priority: + * **`name`** *(string, REQUIRED)* - interface name in [runtime network namespace](glossary.md#runtime-namespace) + * **`priority`** *(uint32, REQUIRED)* - priority applied to the interface + +#### Example + +```json +"network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] +} +``` + +### PIDs + +**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids`. +For more information, see the kernel cgroups documentation about [pids][cgroup-v1-pids]. + +The following parameters can be specified to set up the controller: + +* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup + +#### Example + +```json +"pids": { + "limit": 32771 +} +``` + +### RDMA + +**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`. +For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma]. + +The name of the device to limit is the entry key. +Entry values are objects with the following properties: + +* **`hcaHandles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup +* **`hcaObjects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup + +You MUST specify at least one of the `hcaHandles` or `hcaObjects` in a given entry, and MAY specify both. + +#### Example + +```json +"rdma": { + "mlx5_1": { + "hcaHandles": 3, + "hcaObjects": 10000 + }, + "mlx4_0": { + "hcaObjects": 1000 + }, + "rxe3": { + "hcaObjects": 10000 + } +} +``` + +## IntelRdt + +**`intelRdt`** (object, OPTIONAL) represents the [Intel Resource Director Technology][intel-rdt-cat-kernel-interface]. +If `intelRdt` is set, the runtime MUST write the container process ID to the `tasks` file in a proper sub-directory in a mounted `resctrl` pseudo-filesystem. That sub-directory name is specified by `closID` parameter. +If no mounted `resctrl` pseudo-filesystem is available in the [runtime mount namespace](glossary.md#runtime-namespace), the runtime MUST [generate an error](runtime.md#errors). + +If `intelRdt` is not set, the runtime MUST NOT manipulate any `resctrl` pseudo-filesystems. + +The following parameters can be specified for the container: + +* **`closID`** *(string, OPTIONAL)* - specifies the identity for RDT Class of Service (CLOS). + If `closID` is set, runtimes MUST create `closID` directory in a mounted `resctrl` pseudo-filesystem if it doesn't exist. If not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `` directory. + +* **`l3CacheSchema`** *(string, OPTIONAL)* - specifies the schema for L3 cache id and capacity bitmask (CBM). + The value SHOULD start with `L3:` and SHOULD NOT contain newlines. +* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id. + * The value MUST start with `MB:` and MUST NOT contain newlines. + + * If both `l3CacheSchema` and `memBwSchema` are set, runtimes MUST write the combined value to the `schemata` file in that sub-directory discussed in `closID`. + + * If `l3CacheSchema` contains a line beginning with `MB:`, the value written to `schemata` file MUST be the non-`MB:` line(s) from `l3CacheSchema` and the line from `memBWSchema`. + + * If either `l3CacheSchema` or `memBwSchema` is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`. + + * If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. + + * If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match. + + * If `closID` is set, and neither of `l3CacheSchema` and `memBwSchema` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist. + + +### Example + +Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits, +and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%. + +Tasks inside the container only have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1, +and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1. + +```json +"linux": { + "intelRdt": { + "closID": "guaranteed_group", + "l3CacheSchema": "L3:0=7f0;1=1f", + "memBwSchema": "MB:0=20;1=70" + } +} +``` + +## Sysctl + +**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container. +For more information, see the [sysctl(8)][sysctl.8] man page. + +### Example + +```json +"sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" +} +``` + +## Seccomp + +Seccomp provides application sandboxing mechanism in the Linux kernel. +Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls. +For more information about Seccomp, see [Seccomp][seccomp] kernel documentation. +The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp][] and are translated to corresponding values. + +**`seccomp`** (object, OPTIONAL) + +The following parameters can be specified to set up seccomp: + +* **`defaultAction`** *(string, REQUIRED)* - the default action for seccomp. Allowed values are the same as `syscalls[].action`. +* **`architectures`** *(array of strings, OPTIONAL)* - the architecture used for system calls. + A valid list of constants as of libseccomp v2.3.2 is shown below. + + * `SCMP_ARCH_X86` + * `SCMP_ARCH_X86_64` + * `SCMP_ARCH_X32` + * `SCMP_ARCH_ARM` + * `SCMP_ARCH_AARCH64` + * `SCMP_ARCH_MIPS` + * `SCMP_ARCH_MIPS64` + * `SCMP_ARCH_MIPS64N32` + * `SCMP_ARCH_MIPSEL` + * `SCMP_ARCH_MIPSEL64` + * `SCMP_ARCH_MIPSEL64N32` + * `SCMP_ARCH_PPC` + * `SCMP_ARCH_PPC64` + * `SCMP_ARCH_PPC64LE` + * `SCMP_ARCH_S390` + * `SCMP_ARCH_S390X` + * `SCMP_ARCH_PARISC` + * `SCMP_ARCH_PARISC64` + +* **`flags`** *(array of strings, OPTIONAL)* - list of flags to use with seccomp(2). + + A valid list of constants is shown below. + + * `SECCOMP_FILTER_FLAG_TSYNC` + * `SECCOMP_FILTER_FLAG_LOG` + * `SECCOMP_FILTER_FLAG_SPEC_ALLOW` + +* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp. + While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries. + For example, if `defaultAction` is `SCMP_ACT_KILL` and `syscalls` is empty or unset, the kernel will kill the container process on its first syscall. + Each entry has the following structure: + + * **`names`** *(array of strings, REQUIRED)* - the names of the syscalls. + `names` MUST contain at least one entry. + * **`action`** *(string, REQUIRED)* - the action for seccomp rules. + A valid list of constants as of libseccomp v2.4.0 is shown below. + + * `SCMP_ACT_KILL` + * `SCMP_ACT_TRAP` + * `SCMP_ACT_ERRNO` + * `SCMP_ACT_TRACE` + * `SCMP_ACT_ALLOW` + * `SCMP_ACT_LOG` + + * **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp. + Each entry has the following structure: + + * **`index`** *(uint, REQUIRED)* - the index for syscall arguments in seccomp. + * **`value`** *(uint64, REQUIRED)* - the value for syscall arguments in seccomp. + * **`valueTwo`** *(uint64, OPTIONAL)* - the value for syscall arguments in seccomp. + * **`op`** *(string, REQUIRED)* - the operator for syscall arguments in seccomp. + A valid list of constants as of libseccomp v2.3.2 is shown below. + + * `SCMP_CMP_NE` + * `SCMP_CMP_LT` + * `SCMP_CMP_LE` + * `SCMP_CMP_EQ` + * `SCMP_CMP_GE` + * `SCMP_CMP_GT` + * `SCMP_CMP_MASKED_EQ` + +### Example + +```json +"seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] +} +``` + +## Rootfs Mount Propagation + +**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation. +Its value is either `shared`, `slave`, `private` or `unbindable`. +It's worth noting that a peer group is defined as a group of VFS mounts that propagate events to each other. +A nested container is defined as a container launched inside an existing container. + +* **`shared`**: the rootfs mount belongs to a new peer group. + This means that further mounts (e.g. nested containers) will also belong to that peer group and will propagate events to the rootfs. + Note this does not mean that it's shared with the host. +* **`slave`**: the rootfs mount receives propagation events from the host (e.g. if something is mounted on the host it will also appear in the container) but not the other way around. +* **`private`**: the rootfs mount doesn't receive mount propagation events from the host and further mounts in nested containers will be isolated from the host and from the rootfs (even if the nested container `rootfsPropagation` option is shared). +* **`unbindable`**: the rootfs mount is a private mount that cannot be bind-mounted. + +The [Shared Subtrees][sharedsubtree] article in the kernel documentation has more information about mount propagation. + +### Example + +```json +"rootfsPropagation": "slave", +``` + +## Masked Paths + +**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read. +The values MUST be absolute paths in the [container namespace](glossary.md#container_namespace). + +### Example + +```json +"maskedPaths": [ + "/proc/kcore" +] +``` + +## Readonly Paths + +**`readonlyPaths`** (array of strings, OPTIONAL) will set the provided paths as readonly inside the container. +The values MUST be absolute paths in the [container namespace](glossary.md#container-namespace). + +### Example + +```json +"readonlyPaths": [ + "/proc/sys" +] +``` + +## Mount Label + +**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container. + +### Example + +```json +"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" +``` + +## Personality + +**`personality`** (object, OPTIONAL) sets the Linux execution personality. For more information +see the [personality](personality.2) syscall documentation. As most of the options are +obsolete and rarely used, and some reduce security, the currently supported set is a small +subset of the available options. + +* **`domain`** *(string, REQUIRED)* - the execution domain. + The valid list of constants is shown below. `LINUX32` will set the `uname` system call to show + a 32 bit CPU type, such as `i686`. + + * `LINUX` + * `LINUX32` + +* **`flags`** *(array of strings, OPTIONAL)* - the additional flags to apply. + Currently no flag values are supported. + + +[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt +[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt +[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt +[cgroup-v1-devices]: https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt +[cgroup-v1-hugetlb]: https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt +[cgroup-v1-memory]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt +[cgroup-v1-net-cls]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_cls.txt +[cgroup-v1-net-prio]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_prio.txt +[cgroup-v1-pids]: https://www.kernel.org/doc/Documentation/cgroup-v1/pids.txt +[cgroup-v1-rdma]: https://www.kernel.org/doc/Documentation/cgroup-v1/rdma.txt +[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt +[devices]: https://www.kernel.org/doc/Documentation/admin-guide/devices.txt +[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt +[file]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164 +[libseccomp]: https://github.com/seccomp/libseccomp +[proc]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt +[seccomp]: https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt +[sharedsubtree]: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt +[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt +[tmpfs]: https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt + +[full.4]: http://man7.org/linux/man-pages/man4/full.4.html +[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html +[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html +[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html +[null.4]: http://man7.org/linux/man-pages/man4/null.4.html +[personality.2]: http://man7.org/linux/man-pages/man2/personality.2.html +[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html +[random.4]: http://man7.org/linux/man-pages/man4/random.4.html +[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html +[tty.4]: http://man7.org/linux/man-pages/man4/tty.4.html +[zero.4]: http://man7.org/linux/man-pages/man4/zero.4.html +[user-namespaces]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html +[intel-rdt-cat-kernel-interface]: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md new file mode 100644 index 0000000..ee375d6 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md @@ -0,0 +1,120 @@ +# Solaris Application Container Configuration + +Solaris application containers can be configured using the following properties, all of the below properties have mappings to properties specified under [zonecfg(1M)][zonecfg.1m_2] man page, except milestone. + +## milestone +The SMF(Service Management Facility) FMRI which should go to "online" state before we start the desired process within the container. + +**`milestone`** *(string, OPTIONAL)* + +### Example +```json +"milestone": "svc:/milestone/container:default" +``` + +## limitpriv +The maximum set of privileges any process in this container can obtain. +The property should consist of a comma-separated privilege set specification as described in [priv_str_to_set(3C)][priv-str-to-set.3c] man page for the respective release of Solaris. + +**`limitpriv`** *(string, OPTIONAL)* + +### Example +```json +"limitpriv": "default" +``` + +## maxShmMemory +The maximum amount of shared memory allowed for this application container. +A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). +Mapped to `max-shm-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. + +**`maxShmMemory`** *(string, OPTIONAL)* + +### Example +```json +"maxShmMemory": "512m" +``` + +## cappedCPU +Sets a limit on the amount of CPU time that can be used by a container. +The unit used translates to the percentage of a single CPU that can be used by all user threads in a container, expressed as a fraction (for example, .75) or a mixed number (whole number and fraction, for example, 1.25). +An ncpu value of 1 means 100% of a CPU, a value of 1.25 means 125%, .75 mean 75%, and so forth. +When projects within a capped container have their own caps, the minimum value takes precedence. +cappedCPU is mapped to `capped-cpu` in [zonecfg(1M)][zonecfg.1m_2] man page. + +* **`ncpus`** *(string, OPTIONAL)* + +### Example +```json +"cappedCPU": { + "ncpus": "8" +} +``` + +## cappedMemory +The physical and swap caps on the memory that can be used by this application container. +A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). +cappedMemory is mapped to `capped-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. + +* **`physical`** *(string, OPTIONAL)* +* **`swap`** *(string, OPTIONAL)* + +### Example +```json +"cappedMemory": { + "physical": "512m", + "swap": "512m" +} +``` + +## Network + +### Automatic Network (anet) +anet is specified as an array that is used to set up networking for Solaris application containers. +The anet resource represents the automatic creation of a network resource for an application container. +The zones administration daemon, zoneadmd, is the primary process for managing the container's virtual platform. +One of the daemon's responsibilities is creation and teardown of the networks for the container. +For more information on the daemon see the [zoneadmd(1M)][zoneadmd.1m] man page. +When such a container is started, a temporary VNIC(Virtual NIC) is automatically created for the container. +The VNIC is deleted when the container is torn down. +The following properties can be used to set up automatic networks. +For additional information on properties, check the [zonecfg(1M)][zonecfg.1m_2] man page for the respective release of Solaris. + +* **`linkname`** *(string, OPTIONAL)* Specify a name for the automatically created VNIC datalink. +* **`lowerLink`** *(string, OPTIONAL)* Specify the link over which the VNIC will be created. +Mapped to `lower-link` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`allowedAddress`** *(string, OPTIONAL)* The set of IP addresses that the container can use might be constrained by specifying the `allowedAddress` property. + If `allowedAddress` has not been specified, then they can use any IP address on the associated physical interface for the network resource. + Otherwise, when `allowedAddress` is specified, the container cannot use IP addresses that are not in the `allowedAddress` list for the physical address. + Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`configureAllowedAddress`** *(string, OPTIONAL)* If `configureAllowedAddress` is set to true, the addresses specified by `allowedAddress` are automatically configured on the interface each time the container starts. + When it is set to false, the `allowedAddress` will not be configured on container start. + Mapped to `configure-allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`defrouter`** *(string, OPTIONAL)* The value for the OPTIONAL default router. +* **`macAddress`** *(string, OPTIONAL)* Set the VNIC's MAC addresses based on the specified value or keyword. + If not a keyword, it is interpreted as a unicast MAC address. + For a list of the supported keywords please refer to the [zonecfg(1M)][zonecfg.1m_2] man page of the respective Solaris release. + Mapped to `mac-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. +* **`linkProtection`** *(string, OPTIONAL)* Enables one or more types of link protection using comma-separated values. + See the protection property in dladm(8) for supported values in respective release of Solaris. + Mapped to `link-protection` in the [zonecfg(1M)][zonecfg.1m_2] man page. + +#### Example +```json +"anet": [ + { + "allowedAddress": "172.17.0.2/16", + "configureAllowedAddress": "true", + "defrouter": "172.17.0.1/16", + "linkProtection": "mac-nospoof, ip-nospoof", + "linkname": "net0", + "lowerLink": "net2", + "macAddress": "02:42:f8:52:c7:16" + } +] +``` + + +[priv-str-to-set.3c]: http://docs.oracle.com/cd/E86824_01/html/E54766/priv-str-to-set-3c.html +[zoneadmd.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zoneadmd-1m.html +[zonecfg.1m_2]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md new file mode 100644 index 0000000..ff551d3 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md @@ -0,0 +1,68 @@ +# Virtual-machine-specific Container Configuration + +This section describes the schema for the [virtual-machine-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The virtual-machine container specification provides additional configuration for the hypervisor, kernel, and image. + +## Hypervisor Object + +**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine. +* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor. + +### Example + +```json + "hypervisor": { + "path": "/path/to/vmm", + "parameters": ["opts1=foo", "opts2=bar"] + } +``` + +## Kernel Object + +**`kernel`** (object, REQUIRED) specifies details of the kernel to boot the container virtual machine with. +* **`path`** (string, REQUIRED) path to the kernel used to boot the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the kernel. +* **`initrd`** (string, OPTIONAL) path to an initial ramdisk to be used by the container virtual machine. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). + +### Example + +```json + "kernel": { + "path": "/path/to/vmlinuz", + "parameters": ["foo=bar", "hello world"], + "initrd": "/path/to/initrd.img" + } +``` + +## Image Object + +**`image`** (object, OPTIONAL) specifies details of the image that contains the root filesystem for the container virtual machine. +* **`path`** (string, REQUIRED) path to the container virtual machine root image. + This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). +* **`format`** (string, REQUIRED) format of the container virtual machine root image. Commonly supported formats are: + * **`raw`** [raw disk image format][raw-image-format]. Unset values for `format` will default to that format. + * **`qcow2`** [QEMU image format][qcow2-image-format]. + * **`vdi`** [VirtualBox 1.1 compatible image format][vdi-image-format]. + * **`vmdk`** [VMware compatible image format][vmdk-image-format]. + * **`vhd`** [Virtual Hard Disk image format][vhd-image-format]. + +This image contains the root filesystem that the virtual machine **`kernel`** will boot into, not to be confused with the container root filesystem itself. The latter, as specified by **`path`** from the [Root Configuration](config.md#Root-Configuration) section, will be mounted inside the virtual machine at a location chosen by the virtual-machine-based runtime. + +### Example + +```json + "image": { + "path": "/path/to/vm/rootfs.img", + "format": "raw" + } +``` + +[raw-image-format]: https://en.wikipedia.org/wiki/IMG_(file_format) +[qcow2-image-format]: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qcow2.txt;hb=HEAD +[vdi-image-format]: https://forensicswiki.org/wiki/Virtual_Disk_Image_(VDI) +[vmdk-image-format]: http://www.vmware.com/app/vmdk/?src=vmdk +[vhd-image-format]: https://github.com/libyal/libvhdi/blob/master/documentation/Virtual%20Hard%20Disk%20(VHD)%20image%20format.asciidoc diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md new file mode 100644 index 0000000..5a95782 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md @@ -0,0 +1,207 @@ +# Windows-specific Container Configuration + +This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). +The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. + +## LayerFolders + +**`layerFolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer with the last entry being the scratch. +`layerFolders` MUST contain at least one entry. + +### Example + +```json +"windows": { + "layerFolders": [ + "C:\\Layers\\layer2", + "C:\\Layers\\layer1", + "C:\\Layers\\layer-base", + "C:\\scratch", + ] +} +``` + +## Devices + +**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. + +Each entry has the following structure: + +* **`id`** *(string, REQUIRED)* - specifies the device which the runtime MUST make available in the container. +* **`idType`** *(string, REQUIRED)* - tells the runtime how to interpret `id`. Today, Windows only supports a value of `class`, which identifies `id` as a [device interface class GUID][interfaceGUID]. + +[interfaceGUID]: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/overview-of-device-interface-classes + +### Example + +```json +"windows": { + "devices": [ + { + "id": "24E552D7-6523-47F7-A647-D3465BF1F5CA", + "idType": "class" + }, + { + "id": "5175d334-c371-4806-b3ba-71fd53c9258d", + "idType": "class" + } + ] +} +``` + +## Resources + +You can configure a container's resource limits via the OPTIONAL `resources` field of the Windows configuration. + +### Memory + +`memory` is an OPTIONAL configuration for the container's memory usage. + +The following parameters can be specified: + +* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes. + +#### Example + +```json +"windows": { + "resources": { + "memory": { + "limit": 2097152 + } + } +} +``` + +### CPU + +`cpu` is an OPTIONAL configuration for the container's CPU usage. + +The following parameters can be specified: + +* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. +* **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. +* **`maximum`** *(uint16, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. + +#### Example + +```json +"windows": { + "resources": { + "cpu": { + "maximum": 5000 + } + } +} +``` + +### Storage + +`storage` is an OPTIONAL configuration for the container's storage usage. + +The following parameters can be specified: + +* **`iops`** *(uint64, OPTIONAL)* - specifies the maximum IO operations per second for the system drive of the container. +* **`bps`** *(uint64, OPTIONAL)* - specifies the maximum bytes per second for the system drive of the container. +* **`sandboxSize`** *(uint64, OPTIONAL)* - specifies the minimum size of the system drive in bytes. + +#### Example + +```json +"windows": { + "resources": { + "storage": { + "iops": 50 + } + } +} +``` + +## Network + +You can configure a container's networking options via the OPTIONAL `network` field of the Windows configuration. + +The following parameters can be specified: + +* **`endpointList`** *(array of strings, OPTIONAL)* - list of HNS (Host Network Service) endpoints that the container should connect to. +* **`allowUnqualifiedDNSQuery`** *(bool, OPTIONAL)* - specifies if unqualified DNS name resolution is allowed. +* **`DNSSearchList`** *(array of strings, OPTIONAL)* - comma separated list of DNS suffixes to use for name resolution. +* **`networkSharedContainerName`** *(string, OPTIONAL)* - name (ID) of the container that we will share with the network stack. +* **`networkNamespace`** *(string, OPTIONAL)* - name (ID) of the network namespace that will be used for the container. If a network namespace is specified no other parameter must be specified. + +### Example + +```json +"windows": { + "network": { + "endpointList": [ + "7a010682-17e0-4455-a838-02e5d9655fe6" + ], + "allowUnqualifiedDNSQuery": true, + "DNSSearchList": [ + "a.com", + "b.com" + ], + "networkSharedContainerName": "containerName", + "networkNamespace": "168f3daf-efc6-4377-b20a-2c86764ba892" + } +} +``` + +## Credential Spec + +You can configure a container's group Managed Service Account (gMSA) via the OPTIONAL `credentialSpec` field of the Windows configuration. +The `credentialSpec` is a JSON object whose properties are implementation-defined. +For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. +For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling]. + + +[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts +[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools + +## Servicing + +When a container terminates, the Host Compute Service indicates if a Windows update servicing operation is pending. +You can indicate that a container should be started in a mode to apply pending servicing operations via the OPTIONAL `servicing` field of the Windows configuration. + +### Example + +```json +"windows": { + "servicing": true +} +``` + +## IgnoreFlushesDuringBoot + +You can indicate that a container should be started in an a mode where disk flushes are not performed during container boot via the OPTIONAL `ignoreFlushesDuringBoot` field of the Windows configuration. + +### Example + +```json +"windows": { + "ignoreFlushesDuringBoot": true +} +``` + +## HyperV + +`hyperv` is an OPTIONAL field of the Windows configuration. +If present, the container MUST be run with Hyper-V isolation. +If omitted, the container MUST be run as a Windows Server container. + +The following parameters can be specified: + +* **`utilityVMPath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. + This would be specified if using a base image which does not contain a utility VM image. + If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path. + +### Example + +```json +"windows": { + "hyperv": { + "utilityVMPath": "C:\\path\\to\\utilityvm" + } +} +``` diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config.md b/hook/vendor/github.com/opencontainers/runtime-spec/config.md new file mode 100644 index 0000000..667bbba --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/config.md @@ -0,0 +1,975 @@ +# Configuration + +This configuration file contains metadata necessary to implement [standard operations](runtime.md#operations) against the container. +This includes the process to run, environment variables to inject, sandboxing features to use, etc. + +The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go). +[Platform](spec.md#platforms)-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below. +For properties that are only defined for some [platforms](spec.md#platforms), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`). + +Below is a detailed description of each field defined in the configuration format and valid values are specified. +Platform-specific fields are identified as such. +For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies. + + +## Specification version + +* **`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0][semver-v2.0.0] format and specifies the version of the Open Container Initiative Runtime Specification with which the bundle complies. + The Open Container Initiative Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions. + For example, if a configuration is compliant with version 1.1 of this specification, it is compatible with all runtimes that support any 1.1 or later release of this specification, but is not compatible with a runtime that supports 1.0 and not 1.1. + +### Example + +```json +"ociVersion": "0.1.0" +``` + +## Root + +**`root`** (object, OPTIONAL) specifies the container's root filesystem. +On Windows, for Windows Server Containers, this field is REQUIRED. +For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set. + +On all other platforms, this field is REQUIRED. + +* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container. + * On Windows, `path` MUST be a [volume GUID path][naming-a-volume]. + * On POSIX platforms, `path` is either an absolute path or a relative path to the bundle. + For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`. + The value SHOULD be the conventional `rootfs`. + + A directory MUST exist at the path declared by the field. + +* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false. + * On Windows, this field MUST be omitted or false. + +### Example (POSIX platforms) + +```json +"root": { + "path": "rootfs", + "readonly": true +} +``` + +### Example (Windows) + +```json +"root": { + "path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\" +} +``` + +## Mounts + +**`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root). +The runtime MUST mount entries in the listed order. +For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page. +For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page. + +* **`destination`** (string, REQUIRED) Destination of mount point: path inside container. + This value MUST be an absolute path. + * Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar). + * Solaris: corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m]. +* **`source`** (string, OPTIONAL) A device name, but can also be a file or directory name for bind mounts or a dummy. + Path values for bind mounts are either absolute or relative to the bundle. + A mount is a bind mount if it has either `bind` or `rbind` in the options. + * Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported. + * Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m]. +* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used. + * Linux: supported options are listed in the [mount(8)][mount.8] man page. + Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed. + * Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m]. + * Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given. + +### Example (Windows) + +```json +"mounts": [ + { + "destination": "C:\\folder-inside-container", + "source": "C:\\folder-on-host", + "options": ["ro"] + } +] +``` + +### POSIX-platform Mounts + +For POSIX platforms the `mounts` structure has the following fields: + +* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted. + * Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*). + * Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m]. + +### Example (Linux) + +```json +"mounts": [ + { + "destination": "/tmp", + "type": "tmpfs", + "source": "tmpfs", + "options": ["nosuid","strictatime","mode=755","size=65536k"] + }, + { + "destination": "/data", + "type": "none", + "source": "/volumes/testing", + "options": ["rbind","rw"] + } +] +``` + +### Example (Solaris) + +```json +"mounts": [ + { + "destination": "/opt/local", + "type": "lofs", + "source": "/usr/local", + "options": ["ro","nodevices"] + }, + { + "destination": "/opt/sfw", + "type": "lofs", + "source": "/opt/sfw" + } +] +``` + +## Process + +**`process`** (object, OPTIONAL) specifies the container process. +This property is REQUIRED when [`start`](runtime.md#start) is called. + +* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false. + As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal slave is duplicated on the process's [standard streams][stdin.3]. +* **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal. + Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset. + * **`height`** (uint, REQUIRED) + * **`width`** (uint, REQUIRED) +* **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable. + This value MUST be an absolute path. +* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. +* **`args`** (array of strings, OPTIONAL) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that at least one entry is REQUIRED (non-Windows), and that entry is used with the same semantics as `execvp`'s *file*. This field is OPTIONAL on Windows, and `commandLine` is REQUIRED if this field is omitted. +* **`commandLine`** (string, OPTIONAL) specifies the full command line to be executed on Windows. + This is the preferred means of supplying the command line on Windows. If omitted, the runtime will fall back to escaping and concatenating fields from `args` before making the system call into Windows. + + +### POSIX process + +For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties: + +* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process. + Each entry has the following structure: + + * **`type`** (string, REQUIRED) the platform resource being limited. + * Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`. + * Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`. + + The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface. + For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed. + For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call. + + * **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource. + `rlim.rlim_cur` MUST match the configured value. + * **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process. + `rlim.rlim_max` MUST match the configured value. + Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit. + + If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors). + +### Linux Process + +For Linux-based systems, the `process` object supports the following process-specific properties. + +* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process. + For more information about AppArmor, see [AppArmor documentation][apparmor]. +* **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process. + Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`. + Any value which cannot be mapped to a relevant kernel interface MUST cause an error. + `capabilities` contains the following properties: + + * **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process. + * **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process. + * **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process. + * **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process. + * **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process. +* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges. + As an example, the [`no_new_privs`][no-new-privs] article in the kernel documentation has information on how this is achieved using a `prctl` system call on Linux. +* **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][proc_2]. + If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value. + If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`. + + This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#memory) is scoped for a memory cgroup. + For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2]. +* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process. + For more information about SELinux, see [SELinux documentation][selinux]. + +### User + +The user for the process is a platform-specific structure that allows specific control over which user the process runs as. + +#### POSIX-platform User + +For POSIX platforms the `user` structure has the following fields: + +* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace). +* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace). +* **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask. +* **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process. + +_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_ + +### Example (Linux) + +```json +"process": { + "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, + "user": { + "uid": 1, + "gid": 1, + "umask": 63, + "additionalGids": [5, 6] + }, + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/root", + "args": [ + "sh" + ], + "apparmorProfile": "acme_secure_profile", + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true, + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ] +} +``` +### Example (Solaris) + +```json +"process": { + "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, + "user": { + "uid": 1, + "gid": 1, + "umask": 7, + "additionalGids": [2, 8] + }, + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/root", + "args": [ + "/usr/bin/bash" + ] +} +``` + +#### Windows User + +For Windows based systems the user structure has the following fields: + +* **`username`** (string, OPTIONAL) specifies the user name for the process. + +### Example (Windows) + +```json +"process": { + "terminal": true, + "user": { + "username": "containeradministrator" + }, + "env": [ + "VARIABLE=1" + ], + "cwd": "c:\\foo", + "args": [ + "someapp.exe", + ] +} +``` + + +## Hostname + +* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container. + On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7]. + Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7]. + +### Example + +```json +"hostname": "mrsdalloway" +``` + +## Platform-specific configuration + +* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md). + This MAY be set if the target platform of this spec is `linux`. +* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md). + This MUST be set if the target platform of this spec is `windows`. +* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md). + This MAY be set if the target platform of this spec is `solaris`. +* **`vm`** (object, OPTIONAL) [Virtual-machine-specific configuration](config-vm.md). + This MAY be set if the target platform and architecture of this spec support hardware virtualization. + +### Example (Linux) + +```json +{ + "linux": { + "namespaces": [ + { + "type": "pid" + } + ] + } +} +``` + +## POSIX-platform Hooks + +For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container. + +* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties: + * **`prestart`** (array of objects, OPTIONAL, **DEPRECATED**) is an array of [`prestart` hooks](#prestart). + * Entries in the array contain the following properties: + * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that **`path`** MUST be absolute. + * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. + * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. + * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. + If set, `timeout` MUST be greater than zero. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`createRuntime`** (array of objects, OPTIONAL) is an array of [`createRuntime` hooks](#createRuntime-hooks). + * Entries in the array contain the following properties (the entries are identical to the entries in the deprecated `prestart` hooks): + * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. + This specification extends the IEEE standard in that **`path`** MUST be absolute. + * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. + * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. + * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. + If set, `timeout` MUST be greater than zero. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`createContainer`** (array of objects, OPTIONAL) is an array of [`createContainer` hooks](#createContainer-hooks). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + * **`startContainer`** (array of objects, OPTIONAL) is an array of [`startContainer` hooks](#startContainer-hooks). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [container namespace](glossary.md#container-namespace). + * The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + * **`poststart`** (array of objects, OPTIONAL) is an array of [`poststart` hooks](#poststart). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + * **`poststop`** (array of objects, OPTIONAL) is an array of [`poststop` hooks](#poststop). + * Entries in the array have the same schema as `createRuntime` entries. + * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). + * The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +Hooks allow users to specify programs to run before or after various lifecycle events. +Hooks MUST be called in the listed order. +The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container. + +### Prestart + +The `prestart` hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle). +On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). + +Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase. + +The `prestart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### CreateRuntime Hooks + +The `createRuntime` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. + +The `createRuntime` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). + +The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. + +Note: `runc` originally implemented `prestart` hooks contrary to the spec, namely as part of the `create` operation (instead of during the `start` operation). This incorrect implementation actually corresponds to `createRuntime` hooks. For runtimes that implement the deprecated `prestart` hooks as `createRuntime` hooks, `createRuntime` hooks MUST be called after the `prestart` hooks. + +### CreateContainer Hooks + +The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. +The `createContainer` hooks MUST be called after the `createRuntime` hooks. + +The `createContainer` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + +For example, on Linux this would happen before the `pivot_root` operation is executed but after the mount namespace was created and setup. + +The definition of `createContainer` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace and different mounts will be setup. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. + +### StartContainer Hooks + +The `startContainer` hooks MUST be called [before the user-specified process is executed](runtime.md#lifecycle) as part of the [`start`](runtime.md#start) operation. +This hook can be used to execute some operations in the container, for example running the `ldconfig` binary on linux before the container process is spawned. + +The `startContainer` hooks' path MUST resolve in the [container namespace](glossary.md#container-namespace). +The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). + +### Poststart + +The `poststart` hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns. +For example, this hook can notify the user that the container process is spawned. + +The `poststart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### Poststop + +The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns. +Cleanup or debugging functions are examples of such a hook. + +The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). +The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). + +### Summary + +See the below table for a summary of hooks and when they are called: + +| Name | Namespace | When | +| ----------------------- | --------- | -----------------------------------------------------------------------------------------------------------------------------------| +| `prestart` (Deprecated) | runtime | After the start operation is called but before the user-specified program command is executed. | +| `createRuntime` | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | +| `createContainer` | container | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | +| `startContainer` | container | After the start operation is called but before the user-specified program command is executed. | +| `poststart` | runtime | After the user-specified process is executed but before the start operation returns. | +| `poststop` | runtime | After the container is deleted but before the delete operation returns. | + +### Example + +```json +"hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createRuntime": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createContainer": [ + { + "path": "/usr/bin/mount-hook", + "args": ["-mount", "arg1", "arg2"], + "env": [ "key1=value1"] + } + ], + "startContainer": [ + { + "path": "/usr/bin/refresh-ldcache" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": ["cleanup.sh", "-f"] + } + ] +} +``` + +## Annotations + +**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container. +This information MAY be structured or unstructured. +Annotations MUST be a key-value map. +If there are no annotations then this property MAY either be absent or an empty map. + +Keys MUST be strings. +Keys MUST NOT be an empty string. +Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`. +Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications. +Runtimes MUST handle unknown annotation keys like any other [unknown property](#extensibility). + +Values MUST be strings. +Values MAY be an empty string. + +```json +"annotations": { + "com.example.gpu-cores": "2" +} +``` + +## Extensibility + +Runtimes MAY [log](runtime.md#warnings) unknown properties but MUST otherwise ignore them. +That includes not [generating errors](runtime.md#errors) if they encounter an unknown property. + +## Valid values + +Runtimes MUST generate an error when invalid or unsupported values are encountered. +Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support. + +## Configuration Schema Example + +Here is a full example `config.json` for reference. + +```json +{ + "ociVersion": "1.0.1", + "process": { + "terminal": true, + "user": { + "uid": 1, + "gid": 1, + "additionalGids": [ + 5, + 6 + ] + }, + "args": [ + "sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_CORE", + "hard": 1024, + "soft": 1024 + }, + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ], + "apparmorProfile": "acme_secure_profile", + "oomScoreAdj": 100, + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "hostname": "slartibartfast", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + } + ], + "hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": [ + "fix-mounts", + "arg1", + "arg2" + ], + "env": [ + "key1=value1" + ] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": [ + "cleanup.sh", + "-f" + ] + } + ] + }, + "linux": { + "devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } + ], + "uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" + }, + "cgroupsPath": "/myRuntime/myContainer", + "resources": { + "network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] + }, + "pids": { + "limit": 32771 + }, + "hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 9223372036854772000 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } + ], + "memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false + }, + "cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" + }, + "devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } + ], + "blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] + } + }, + "rootfsPropagation": "slave", + "seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "network" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } + ], + "maskedPaths": [ + "/proc/kcore", + "/proc/latency_stats", + "/proc/timer_stats", + "/proc/sched_debug" + ], + "readonlyPaths": [ + "/proc/asound", + "/proc/bus", + "/proc/fs", + "/proc/irq", + "/proc/sys", + "/proc/sysrq-trigger" + ], + "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" + }, + "annotations": { + "com.example.key1": "value1", + "com.example.key2": "value2" + } +} +``` + + +[apparmor]: https://wiki.ubuntu.com/AppArmor +[cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt +[selinux]:http://selinuxproject.org/page/Main_Page +[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt +[proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt +[umask.2]: http://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html +[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html +[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01 +[ieee-1003.1-2008-functions-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html +[naming-a-volume]: https://aka.ms/nb3hqb + +[capabilities.7]: http://man7.org/linux/man-pages/man7/capabilities.7.html +[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html +[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html +[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS +[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS +[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html +[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html +[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html +[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html +[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md b/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md new file mode 100644 index 0000000..0c81fad --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md @@ -0,0 +1,38 @@ +# Glossary + +## Bundle + +A [directory structure](bundle.md) that is written ahead of time, distributed, and used to seed the runtime for creating a [container](#container) and launching a process within it. + +## Configuration + +The [`config.json`](config.md) file in a [bundle](#bundle) which defines the intended [container](#container) and container process. + +## Container + +An environment for executing processes with configurable isolation and resource limitations. +For example, namespaces, resource limits, and mounts are all part of the container environment. + +## Container namespace + +On Linux,the [namespaces][namespaces.7] in which the [configured process](config.md#process) executes. + +## JSON + +All configuration [JSON][] MUST be encoded in [UTF-8][]. +JSON objects MUST NOT include duplicate names. +The order of entries in JSON objects is not significant. + +## Runtime + +An implementation of this specification. +It reads the [configuration files](#configuration) from a [bundle](#bundle), uses that information to create a [container](#container), launches a process inside the container, and performs other [lifecycle actions](runtime.md). + +## Runtime namespace + +On Linux, the namespaces from which new [container namespaces](#container-namespace) are [created](config-linux.md#namespaces) and from which some configured resources are accessed. + +[JSON]: https://tools.ietf.org/html/rfc8259 +[UTF-8]: http://www.unicode.org/versions/Unicode8.0.0/ch03.pdf + +[namespaces.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md b/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md new file mode 100644 index 0000000..921383a --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md @@ -0,0 +1,37 @@ +# Implementations + +The following sections link to associated projects, some of which are maintained by the OCI and some of which are maintained by external organizations. +If you know of any associated projects that are not listed here, please file a pull request adding a link to that project. + +## Runtime (Container) + +* [opencontainers/runc][runc] - Reference implementation of OCI runtime +* [projectatomic/bwrap-oci][bwrap-oci] - Convert the OCI spec file to a command line for [bubblewrap][bubblewrap] +* [containers/crun][crun] - Runtime implementation in C + +## Runtime (Virtual Machine) + +* [hyperhq/runv][runv] - Hypervisor-based runtime for OCI +* [clearcontainers/runtime][cc-runtime] - Hypervisor-based OCI runtime utilising [virtcontainers][virtcontainers] by Intel®. +* [google/gvisor][gvisor] - gVisor is a user-space kernel, contains runsc to run sandboxed containers. +* [kata-containers/runtime][kata-runtime] - Hypervisor-based OCI runtime combining technology from [clearcontainers/runtime][cc-runtime] and [hyperhq/runv][runv]. + +## Testing & Tools + +* [kunalkushwaha/octool][octool] - A config linter and validator. +* [huawei-openlab/oct][oct] - Open Container Testing framework for OCI configuration and runtime +* [opencontainers/runtime-tools][runtime-tools] - A config generator and runtime/bundle testing framework. + + +[runc]: https://github.com/opencontainers/runc +[runv]: https://github.com/hyperhq/runv +[cc-runtime]: https://github.com/clearcontainers/runtime +[kata-runtime]: https://github.com/kata-containers/runtime +[virtcontainers]: https://github.com/containers/virtcontainers +[octool]: https://github.com/kunalkushwaha/octool +[oct]: https://github.com/huawei-openlab/oct +[runtime-tools]: https://github.com/opencontainers/runtime-tools +[bwrap-oci]: https://github.com/projectatomic/bwrap-oci +[bubblewrap]: https://github.com/projectatomic/bubblewrap +[crun]: https://github.com/containers/crun +[gvisor]: https://github.com/google/gvisor diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics b/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics new file mode 100644 index 0000000..e8c4bc7 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics @@ -0,0 +1,41 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//Open Containers Initiative//Developer Meeting//EN +BEGIN:VTIMEZONE +TZID:America/Los_Angeles +LAST-MODIFIED:20050809T050000Z +BEGIN:STANDARD +DTSTART:20071104T020000 +RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU +TZOFFSETFROM:-0700 +TZOFFSETTO:-0800 +TZNAME:PST +END:STANDARD +BEGIN:DAYLIGHT +DTSTART:20070311T020000 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU +TZOFFSETFROM:-0800 +TZOFFSETTO:-0700 +TZNAME:PDT +END:DAYLIGHT +END:VTIMEZONE +BEGIN:VEVENT +UID:tdc-meeting@opencontainers.org +DTSTAMP:20180628T170000Z +DTSTART;TZID=America/Los_Angeles:20170906T140000 +RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE +RDATE;TZID=America/Los_Angeles:20180110T140000 +EXDATE;TZIP=America/Los_Angeles:20180103T140000 +RDATE;TZID=America/Los_Angeles:20180711T140000 +EXDATE;TZIP=America/Los_Angeles:20180704T140000 +DURATION:PT1H +SUMMARY:OCI TDC Meeting +DESCRIPTION;ALTREP="https://github.com/opencontainers/runtime-spec# + meetings":Open Containers Initiative Developer Meeting\n + https://github.com/opencontainers/runtime-spec#meetings\n + Web: https://www.uberconference.com/opencontainers\n + Audio-only: +1 415 968 0849 (no PIN needed) +LOCATION:https://www.uberconference.com/opencontainers +URL:https://github.com/opencontainers/runtime-spec/blob/master/meeting.ics +END:VEVENT +END:VCALENDAR diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/principles.md b/hook/vendor/github.com/opencontainers/runtime-spec/principles.md new file mode 100644 index 0000000..6c76963 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/principles.md @@ -0,0 +1,46 @@ +# The 5 principles of Standard Containers + +Define a unit of software delivery called a Standard Container. +The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container. + +The specification for Standard Containers defines: + +1. configuration file formats +2. a set of standard operations +3. an execution environment. + +A great analogy for this is the physical shipping container used by the transportation industry. +Shipping containers are a fundamental unit of delivery, they can be lifted, stacked, locked, loaded, unloaded and labelled. +Irrespective of their contents, by standardizing the container itself it allowed for a consistent, more streamlined and efficient set of processes to be defined. +For software Standard Containers offer similar functionality by being the fundamental, standardized, unit of delivery for a software package. + +## 1. Standard operations + +Standard Containers define a set of STANDARD OPERATIONS. +They can be created, started, and stopped using standard container tools; copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools. + +## 2. Content-agnostic + +Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. +They are started in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts. + +## 3. Infrastructure-agnostic + +Standard Containers are INFRASTRUCTURE-AGNOSTIC: they can be run in any OCI supported infrastructure. +For example, a standard container can be bundled on a laptop, uploaded to cloud storage, downloaded, run and snapshotted by a build server at a fiber hotel in Virginia, uploaded to 10 staging servers in a home-made private cloud cluster, then sent to 30 production instances across 3 public cloud regions. + +## 4. Designed for automation + +Standard Containers are DESIGNED FOR AUTOMATION: because they offer the same standard operations regardless of content and infrastructure, Standard Containers, are extremely well-suited for automation. +In fact, you could say automation is their secret weapon. + +Many things that once required time-consuming and error-prone human effort can now be programmed. +Before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. +Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. +The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider. + +## 5. Industrial-grade delivery + +Standard Containers make INDUSTRIAL-GRADE DELIVERY of software a reality. +Leveraging all of the properties listed above, Standard Containers are enabling large and small enterprises to streamline and automate their software delivery pipelines. +Whether it is in-house devOps flows, or external customer-based software delivery mechanisms, Standard Containers are changing the way the community thinks about software packaging and delivery. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md b/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md new file mode 100644 index 0000000..16c6dbe --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md @@ -0,0 +1,21 @@ +# Linux Runtime + +## File descriptors + +By default, only the `stdin`, `stdout` and `stderr` file descriptors are kept open for the application by the runtime. +The runtime MAY pass additional file descriptors to the application to support features such as [socket activation][socket-activated-containers]. +Some of the file descriptors MAY be redirected to `/dev/null` even though they are open. + +## Dev symbolic links + +While creating the container (step 2 in the [lifecycle](runtime.md#lifecycle)), runtimes MUST create the following symlinks if the source file exists after processing [`mounts`](config.md#mounts): + +| Source | Destination | +| --------------- | ----------- | +| /proc/self/fd | /dev/fd | +| /proc/self/fd/0 | /dev/stdin | +| /proc/self/fd/1 | /dev/stdout | +| /proc/self/fd/2 | /dev/stderr | + + +[socket-activated-containers]: http://0pointer.de/blog/projects/socket-activated-containers.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md b/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md new file mode 100644 index 0000000..c45046b --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md @@ -0,0 +1,146 @@ +# Runtime and Lifecycle + +## Scope of a Container + +The entity using a runtime to create a container MUST be able to use the operations defined in this specification against that same container. +Whether other entities using the same, or other, instance of the runtime can see that container is out of scope of this specification. + +## State + +The state of a container includes the following properties: + +* **`ociVersion`** (string, REQUIRED) is version of the Open Container Initiative Runtime Specification with which the state complies. +* **`id`** (string, REQUIRED) is the container's ID. + This MUST be unique across all containers on this host. + There is no requirement that it be unique across hosts. +* **`status`** (string, REQUIRED) is the runtime state of the container. + The value MAY be one of: + + * `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle)) + * `created`: the runtime has finished the [create operation](#create) (after step 2 in the [lifecycle](#lifecycle)), and the container process has neither exited nor executed the user-specified program + * `running`: the container process has executed the user-specified program but has not exited (after step 5 in the [lifecycle](#lifecycle)) + * `stopped`: the container process has exited (step 7 in the [lifecycle](#lifecycle)) + + Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. +* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host. +* **`bundle`** (string, REQUIRED) is the absolute path to the container's bundle directory. + This is provided so that consumers can find the container's configuration and root filesystem on the host. +* **`annotations`** (map, OPTIONAL) contains the list of annotations associated with the container. + If no annotations were provided then this property MAY either be absent or an empty map. + +The state MAY include additional properties. + +When serialized in JSON, the format MUST adhere to the following pattern: + +```json +{ + "ociVersion": "0.2.0", + "id": "oci-container1", + "status": "running", + "pid": 4422, + "bundle": "/containers/redis", + "annotations": { + "myKey": "myValue" + } +} +``` + +See [Query State](#query-state) for information on retrieving the state of a container. + +## Lifecycle +The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist. + +1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. +2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). + If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST [generate an error](#errors). + While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified program (from [`process`](config.md#process)) MUST NOT be run at this time. + Any updates to [`config.json`](config.md) after this step MUST NOT affect the container. +3. The [`prestart` hooks](config.md#prestart) MUST be invoked by the runtime. + If any `prestart` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +4. The [`createRuntime` hooks](config.md#createRuntime-hooks) MUST be invoked by the runtime. + If any `createRuntime` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +5. The [`createContainer` hooks](config.md#createContainer-hooks) MUST be invoked by the runtime. + If any `createContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +6. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. +7. The [`startContainer` hooks](config.md#startContainer-hooks) MUST be invoked by the runtime. + If any `startContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. +8. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process). +9. The [`poststart` hooks](config.md#poststart) MUST be invoked by the runtime. + If any `poststart` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. +10. The container process exits. + This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked. +11. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. +12. The container MUST be destroyed by undoing the steps performed during create phase (step 2). +13. The [`poststop` hooks](config.md#poststop) MUST be invoked by the runtime. + If any `poststop` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. + +## Errors + +In cases where the specified operation generates an error, this specification does not mandate how, or even if, that error is returned or exposed to the user of an implementation. +Unless otherwise stated, generating an error MUST leave the state of the environment as if the operation were never attempted - modulo any possible trivial ancillary changes such as logging. + +## Warnings + +In cases where the specified operation logs a warning, this specification does not mandate how, or even if, that warning is returned or exposed to the user of an implementation. +Unless otherwise stated, logging a warning does not change the flow of the operation; it MUST continue as if the warning had not been logged. + +## Operations + +Unless otherwise stated, runtimes MUST support the following operations. + +Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations. + +### Query State + +`state ` + +This operation MUST [generate an error](#errors) if it is not provided the ID of a container. +Attempting to query a container that does not exist MUST [generate an error](#errors). +This operation MUST return the state of a container as specified in the [State](#state) section. + +### Create + +`create ` + +This operation MUST [generate an error](#errors) if it is not provided a path to the bundle and the container ID to associate with the container. +If the ID provided is not unique across all containers within the scope of the runtime, or is not valid in any other way, the implementation MUST [generate an error](#errors) and a new container MUST NOT be created. +This operation MUST create a new container. + +All of the properties configured in [`config.json`](config.md) except for [`process`](config.md#process) MUST be applied. +[`process.args`](config.md#process) MUST NOT be applied until triggered by the [`start`](#start) operation. +The remaining `process` properties MAY be applied by this operation. +If the runtime cannot apply a property as specified in the [configuration](config.md), it MUST [generate an error](#errors) and a new container MUST NOT be created. + +The runtime MAY validate `config.json` against this spec, either generically or with respect to the local system capabilities, before creating the container ([step 2](#lifecycle)). +Runtime callers who are interested in pre-create validation can run [bundle-validation tools](implementations.md#testing--tools) before invoking the create operation. + +Any changes made to the [`config.json`](config.md) file after this operation will not have an effect on the container. + +### Start +`start ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to `start` a container that is not [`created`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +This operation MUST run the user-specified program as specified by [`process`](config.md#process). +This operation MUST generate an error if `process` was not set. + +### Kill +`kill ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +This operation MUST send the specified signal to the container process. + +### Delete +`delete ` + +This operation MUST [generate an error](#errors) if it is not provided the container ID. +Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +Deleting a container MUST delete the resources that were created during the `create` step. +Note that resources associated with the container, but not created by this container, MUST NOT be deleted. +Once a container is deleted its ID MAY be used by a subsequent container. + + +## Hooks +Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation. +See [runtime configuration for hooks](./config.md#posix-platform-hooks) for more information. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile b/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile new file mode 100644 index 0000000..ac8c8d2 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile @@ -0,0 +1,50 @@ +GOOD_TESTS = $(wildcard test/good/*.json) +BAD_TESTS = $(wildcard test/bad/*.json) + +default: validate + +help: + @echo "Usage: make [target]" + @echo + @echo " * 'fmt' - format the json with indentation" + @echo " * 'help' - show this help information" + @echo " * 'validate' - build the validation tool" + +fmt: + find . -name '*.json' -exec bash -c 'jq --indent 4 -M . {} > xx && mv xx {} || echo "skipping invalid {}"' \; + +.PHONY: validate +validate: validate.go + go get -d ./... + go build ./validate.go + +test: validate $(TESTS) + for TYPE in $$(ls test); \ + do \ + echo "testing $${TYPE}"; \ + for FILE in $$(ls "test/$${TYPE}/good"); \ + do \ + echo " testing test/$${TYPE}/good/$${FILE}"; \ + if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/good/$${FILE}" ; \ + then \ + echo " received expected validation success" ; \ + else \ + echo " received unexpected validation failure" ; \ + exit 1; \ + fi \ + done; \ + for FILE in $$(ls "test/$${TYPE}/bad"); \ + do \ + echo " testing test/$${TYPE}/bad/$${FILE}"; \ + if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/bad/$${FILE}" ; \ + then \ + echo " received unexpected validation success" ; \ + exit 1; \ + else \ + echo " received expected validation failure" ; \ + fi \ + done; \ + done + +clean: + rm -f validate diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md b/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md new file mode 100644 index 0000000..fecc467 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md @@ -0,0 +1,48 @@ +# JSON schema + +## Overview + +This directory contains the [JSON Schema](http://json-schema.org/) for validating JSON covered by this specification. + +The layout of the files is as follows: + +* [config-schema.json](config-schema.json) - the primary entrypoint for the [configuration](../config.md) schema +* [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md) +* [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md) +* [config-windows.json](config-windows.json) - the [Windows-specific configuration sub-structure](../config-windows.md) +* [state-schema.json](state-schema.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema +* [defs.json](defs.json) - definitions for general types +* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types +* [defs-windows.json](defs-windows.json) - definitions for Windows-specific types +* [validate.go](validate.go) - validation utility source code + + +## Utility + +There is also included a simple utility for facilitating validation. +To build it: + +```bash +export GOPATH=`mktemp -d` +go get -d ./... +go build ./validate.go +rm -rf $GOPATH +``` + +Or you can just use make command to create the utility: + +```bash +make validate +``` + +Then use it like: + +```bash +./validate config-schema.json /config.json +``` + +Or like: + +```bash +./validate https://raw.githubusercontent.com/opencontainers/runtime-spec/v1.0.0/schema/schema.json /config.json +``` diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json new file mode 100644 index 0000000..98295c4 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json @@ -0,0 +1,259 @@ +{ + "linux": { + "description": "Linux platform-specific configurations", + "type": "object", + "properties": { + "devices": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/Device" + } + }, + "uidMappings": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/IDMapping" + } + }, + "gidMappings": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/IDMapping" + } + }, + "namespaces": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "defs-linux.json#/definitions/NamespaceReference" + } + ] + } + }, + "resources": { + "type": "object", + "properties": { + "devices": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/DeviceCgroup" + } + }, + "pids": { + "type": "object", + "properties": { + "limit": { + "$ref": "defs.json#/definitions/int64" + } + }, + "required": [ + "limit" + ] + }, + "blockIO": { + "type": "object", + "properties": { + "weight": { + "$ref": "defs-linux.json#/definitions/weight" + }, + "leafWeight": { + "$ref": "defs-linux.json#/definitions/weight" + }, + "throttleReadBpsDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleWriteBpsDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleReadIOPSDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "throttleWriteIOPSDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" + } + }, + "weightDevice": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/blockIODeviceWeight" + } + } + } + }, + "cpu": { + "type": "object", + "properties": { + "cpus": { + "type": "string" + }, + "mems": { + "type": "string" + }, + "period": { + "$ref": "defs.json#/definitions/uint64" + }, + "quota": { + "$ref": "defs.json#/definitions/int64" + }, + "realtimePeriod": { + "$ref": "defs.json#/definitions/uint64" + }, + "realtimeRuntime": { + "$ref": "defs.json#/definitions/int64" + }, + "shares": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "hugepageLimits": { + "type": "array", + "items": { + "type": "object", + "properties": { + "pageSize": { + "type": "string", + "pattern": "^[1-9][0-9]*[KMG]B$" + }, + "limit": { + "$ref": "defs.json#/definitions/uint64" + } + }, + "required": [ + "pageSize", + "limit" + ] + } + }, + "memory": { + "type": "object", + "properties": { + "kernel": { + "$ref": "defs.json#/definitions/int64" + }, + "kernelTCP": { + "$ref": "defs.json#/definitions/int64" + }, + "limit": { + "$ref": "defs.json#/definitions/int64" + }, + "reservation": { + "$ref": "defs.json#/definitions/int64" + }, + "swap": { + "$ref": "defs.json#/definitions/int64" + }, + "swappiness": { + "$ref": "defs.json#/definitions/uint64" + }, + "disableOOMKiller": { + "type": "boolean" + }, + "useHierarchy": { + "type": "boolean" + } + } + }, + "network": { + "type": "object", + "properties": { + "classID": { + "$ref": "defs.json#/definitions/uint32" + }, + "priorities": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/NetworkInterfacePriority" + } + } + } + }, + "rdma": { + "type": "object", + "additionalProperties": { + "$ref": "defs-linux.json#/definitions/Rdma" + } + } + } + }, + "cgroupsPath": { + "type": "string" + }, + "rootfsPropagation": { + "$ref": "defs-linux.json#/definitions/RootfsPropagation" + }, + "seccomp": { + "type": "object", + "properties": { + "defaultAction": { + "$ref": "defs-linux.json#/definitions/SeccompAction" + }, + "flags": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/SeccompFlag" + } + }, + "architectures": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/SeccompArch" + } + }, + "syscalls": { + "type": "array", + "items": { + "$ref": "defs-linux.json#/definitions/Syscall" + } + } + }, + "required": [ + "defaultAction" + ] + }, + "sysctl": { + "$ref": "defs.json#/definitions/mapStringString" + }, + "maskedPaths": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "readonlyPaths": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "mountLabel": { + "type": "string" + }, + "intelRdt": { + "type": "object", + "properties": { + "closID": { + "type": "string" + }, + "l3CacheSchema": { + "type": "string" + }, + "memBwSchema": { + "type": "string", + "pattern": "^MB:[^\\n]*$" + } + } + }, + "personality": { + "type": "object", + "$ref": "defs-linux.json#/definitions/Personality" + } + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json new file mode 100644 index 0000000..94923b3 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json @@ -0,0 +1,188 @@ +{ + "description": "Open Container Initiative Runtime Specification Container Configuration Schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "ociVersion": { + "$ref": "defs.json#/definitions/ociVersion" + }, + "hooks": { + "type": "object", + "properties": { + "prestart": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "createRuntime": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "createContainer": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "startContainer": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "poststart": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + }, + "poststop": { + "$ref": "defs.json#/definitions/ArrayOfHooks" + } + } + }, + "annotations": { + "$ref": "defs.json#/definitions/annotations" + }, + "hostname": { + "type": "string" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/Mount" + } + }, + "root": { + "description": "Configures the container's root filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "readonly": { + "type": "boolean" + } + } + }, + "process": { + "type": "object", + "required": [ + "cwd" + ], + "properties": { + "args": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "commandLine": { + "type": "string" + }, + "consoleSize": { + "type": "object", + "required": [ + "height", + "width" + ], + "properties": { + "height": { + "$ref": "defs.json#/definitions/uint64" + }, + "width": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "cwd": { + "type": "string" + }, + "env": { + "$ref": "defs.json#/definitions/Env" + }, + "terminal": { + "type": "boolean" + }, + "user": { + "type": "object", + "properties": { + "uid": { + "$ref": "defs.json#/definitions/UID" + }, + "gid": { + "$ref": "defs.json#/definitions/GID" + }, + "umask": { + "$ref": "defs.json#/definitions/Umask" + }, + "additionalGids": { + "$ref": "defs.json#/definitions/ArrayOfGIDs" + }, + "username": { + "type": "string" + } + } + }, + "capabilities": { + "type": "object", + "properties": { + "bounding": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "permitted": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "effective": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "inheritable": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "ambient": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "apparmorProfile": { + "type": "string" + }, + "oomScoreAdj": { + "type": "integer" + }, + "selinuxLabel": { + "type": "string" + }, + "noNewPrivileges": { + "type": "boolean" + }, + "rlimits": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type", + "soft", + "hard" + ], + "properties": { + "hard": { + "$ref": "defs.json#/definitions/uint64" + }, + "soft": { + "$ref": "defs.json#/definitions/uint64" + }, + "type": { + "type": "string", + "pattern": "^RLIMIT_[A-Z]+$" + } + } + } + } + } + }, + "linux": { + "$ref": "config-linux.json#/linux" + }, + "solaris": { + "$ref": "config-solaris.json#/solaris" + }, + "windows": { + "$ref": "config-windows.json#/windows" + }, + "vm": { + "$ref": "config-vm.json#/vm" + } + }, + "required": [ + "ociVersion" + ] +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json new file mode 100644 index 0000000..be9f4d2 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json @@ -0,0 +1,65 @@ +{ + "solaris": { + "description": "Solaris platform-specific configurations", + "type": "object", + "properties": { + "milestone": { + "type": "string" + }, + "limitpriv": { + "type": "string" + }, + "maxShmMemory": { + "type": "string" + }, + "cappedCPU": { + "type": "object", + "properties": { + "ncpus": { + "type": "string" + } + } + }, + "cappedMemory": { + "type": "object", + "properties": { + "physical": { + "type": "string" + }, + "swap": { + "type": "string" + } + } + }, + "anet": { + "type": "array", + "items": { + "type": "object", + "properties": { + "linkname": { + "type": "string" + }, + "lowerLink": { + "type": "string" + }, + "allowedAddress": { + "type": "string" + }, + "configureAllowedAddress": { + "type": "string" + }, + "defrouter": { + "type": "string" + }, + "macAddress": { + "type": "string" + }, + "linkProtection": { + "type": "string" + } + } + } + } + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json new file mode 100644 index 0000000..6b1fb4b --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json @@ -0,0 +1,60 @@ +{ + "vm": { + "description": "configuration for virtual-machine-based containers", + "type": "object", + "required": [ + "kernel" + ], + "properties": { + "hypervisor": { + "description": "hypervisor config used by VM-based containers", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "parameters": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "kernel": { + "description": "kernel config used by VM-based containers", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "parameters": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "initrd": { + "$ref": "defs.json#/definitions/FilePath" + } + } + }, + "image": { + "description": "root image config used by VM-based containers", + "type": "object", + "required": [ + "path", + "format" + ], + "properties": { + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "format": { + "$ref": "defs-vm.json#/definitions/RootImageFormat" + } + } + } + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json new file mode 100644 index 0000000..68b51e9 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json @@ -0,0 +1,102 @@ +{ + "windows": { + "description": "Windows platform-specific configurations", + "type": "object", + "properties": { + "layerFolders": { + "type": "array", + "items": { + "$ref": "defs.json#/definitions/FilePath" + }, + "minItems": 1 + }, + "devices": { + "type": "array", + "items": { + "$ref": "defs-windows.json#/definitions/Device" + } + }, + "resources": { + "type": "object", + "properties": { + "memory": { + "type": "object", + "properties": { + "limit": { + "$ref": "defs.json#/definitions/uint64" + } + } + }, + "cpu": { + "type": "object", + "properties": { + "count": { + "$ref": "defs.json#/definitions/uint64" + }, + "shares": { + "$ref": "defs.json#/definitions/uint16" + }, + "maximum": { + "$ref": "defs.json#/definitions/uint16" + } + } + }, + "storage": { + "type": "object", + "properties": { + "iops": { + "$ref": "defs.json#/definitions/uint64" + }, + "bps": { + "$ref": "defs.json#/definitions/uint64" + }, + "sandboxSize": { + "$ref": "defs.json#/definitions/uint64" + } + } + } + } + }, + "network": { + "type": "object", + "properties": { + "endpointList": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "allowUnqualifiedDNSQuery": { + "type": "boolean" + }, + "DNSSearchList": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + }, + "networkSharedContainerName": { + "type": "string" + }, + "networkNamespace": { + "type": "string" + } + } + }, + "credentialSpec": { + "type": "object" + }, + "servicing": { + "type": "boolean" + }, + "ignoreFlushesDuringBoot": { + "type": "boolean" + }, + "hyperv": { + "type": "object", + "properties": { + "utilityVMPath": { + "type": "string" + } + } + } + }, + "required": [ + "layerFolders" + ] + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json new file mode 100644 index 0000000..f011b72 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json @@ -0,0 +1,308 @@ +{ + "definitions": { + "PersonalityDomain": { + "type": "string", + "enum": [ + "LINUX", + "LINUX32" + ] + }, + "Personality": { + "type": "object", + "properties": { + "domain": { + "$ref": "#/definitions/PersonalityDomain" + }, + "flags": { + "$ref": "defs.json#/definitions/ArrayOfStrings" + } + } + }, + "RootfsPropagation": { + "type": "string", + "enum": [ + "private", + "shared", + "slave", + "unbindable" + ] + }, + "SeccompArch": { + "type": "string", + "enum": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X86_64", + "SCMP_ARCH_X32", + "SCMP_ARCH_ARM", + "SCMP_ARCH_AARCH64", + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64", + "SCMP_ARCH_MIPS64N32", + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64", + "SCMP_ARCH_MIPSEL64N32", + "SCMP_ARCH_PPC", + "SCMP_ARCH_PPC64", + "SCMP_ARCH_PPC64LE", + "SCMP_ARCH_S390", + "SCMP_ARCH_S390X", + "SCMP_ARCH_PARISC", + "SCMP_ARCH_PARISC64" + ] + }, + "SeccompAction": { + "type": "string", + "enum": [ + "SCMP_ACT_KILL", + "SCMP_ACT_TRAP", + "SCMP_ACT_ERRNO", + "SCMP_ACT_TRACE", + "SCMP_ACT_ALLOW", + "SCMP_ACT_LOG" + ] + }, + "SeccompFlag": { + "type": "string", + "enum": [ + "SECCOMP_FILTER_FLAG_TSYNC", + "SECCOMP_FILTER_FLAG_LOG", + "SECCOMP_FILTER_FLAG_SPEC_ALLOW" + ] + }, + "SeccompOperators": { + "type": "string", + "enum": [ + "SCMP_CMP_NE", + "SCMP_CMP_LT", + "SCMP_CMP_LE", + "SCMP_CMP_EQ", + "SCMP_CMP_GE", + "SCMP_CMP_GT", + "SCMP_CMP_MASKED_EQ" + ] + }, + "SyscallArg": { + "type": "object", + "properties": { + "index": { + "$ref": "defs.json#/definitions/uint32" + }, + "value": { + "$ref": "defs.json#/definitions/uint64" + }, + "valueTwo": { + "$ref": "defs.json#/definitions/uint64" + }, + "op": { + "$ref": "#/definitions/SeccompOperators" + } + }, + "required": [ + "index", + "value", + "op" + ] + }, + "Syscall": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "action": { + "$ref": "#/definitions/SeccompAction" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SyscallArg" + } + } + }, + "required": [ + "names", + "action" + ] + }, + "Major": { + "description": "major device number", + "$ref": "defs.json#/definitions/int64" + }, + "Minor": { + "description": "minor device number", + "$ref": "defs.json#/definitions/int64" + }, + "FileMode": { + "description": "File permissions mode (typically an octal value)", + "type": "integer", + "minimum": 0, + "maximum": 512 + }, + "FileType": { + "description": "Type of a block or special character device", + "type": "string", + "pattern": "^[cbup]$" + }, + "Device": { + "type": "object", + "required": [ + "type", + "path" + ], + "properties": { + "type": { + "$ref": "#/definitions/FileType" + }, + "path": { + "$ref": "defs.json#/definitions/FilePath" + }, + "fileMode": { + "$ref": "#/definitions/FileMode" + }, + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + }, + "uid": { + "$ref": "defs.json#/definitions/UID" + }, + "gid": { + "$ref": "defs.json#/definitions/GID" + } + } + }, + "weight": { + "$ref": "defs.json#/definitions/uint16" + }, + "blockIODevice": { + "type": "object", + "properties": { + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + } + }, + "required": [ + "major", + "minor" + ] + }, + "blockIODeviceWeight": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/blockIODevice" + }, + { + "type": "object", + "properties": { + "weight": { + "$ref": "#/definitions/weight" + }, + "leafWeight": { + "$ref": "#/definitions/weight" + } + } + } + ] + }, + "blockIODeviceThrottle": { + "allOf": [ + { + "$ref": "#/definitions/blockIODevice" + }, + { + "type": "object", + "properties": { + "rate": { + "$ref": "defs.json#/definitions/uint64" + } + } + } + ] + }, + "DeviceCgroup": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "major": { + "$ref": "#/definitions/Major" + }, + "minor": { + "$ref": "#/definitions/Minor" + }, + "access": { + "type": "string" + } + }, + "required": [ + "allow" + ] + }, + "NetworkInterfacePriority": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "priority": { + "$ref": "defs.json#/definitions/uint32" + } + }, + "required": [ + "name", + "priority" + ] + }, + "Rdma": { + "type": "object", + "properties": { + "hcaHandles": { + "$ref": "defs.json#/definitions/uint32" + }, + "hcaObjects": { + "$ref": "defs.json#/definitions/uint32" + } + } + }, + "NamespaceType": { + "type": "string", + "enum": [ + "mount", + "pid", + "network", + "uts", + "ipc", + "user", + "cgroup" + ] + }, + "NamespaceReference": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/NamespaceType" + }, + "path": { + "$ref": "defs.json#/definitions/FilePath" + } + }, + "required": [ + "type" + ] + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json new file mode 100644 index 0000000..4dae915 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json @@ -0,0 +1,14 @@ +{ + "definitions": { + "RootImageFormat": { + "type": "string", + "enum": [ + "raw", + "qcow2", + "vdi", + "vmdk", + "vhd" + ] + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json new file mode 100644 index 0000000..63e0ac3 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json @@ -0,0 +1,22 @@ +{ + "definitions": { + "Device": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "idType": { + "type": "string", + "enum": [ + "class" + ] + } + }, + "required": [ + "id", + "idType" + ] + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json new file mode 100644 index 0000000..58b07e6 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json @@ -0,0 +1,158 @@ +{ + "description": "Definitions used throughout the Open Container Initiative Runtime Specification", + "definitions": { + "int8": { + "type": "integer", + "minimum": -128, + "maximum": 127 + }, + "int16": { + "type": "integer", + "minimum": -32768, + "maximum": 32767 + }, + "int32": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "int64": { + "type": "integer", + "minimum": -9223372036854776000, + "maximum": 9223372036854776000 + }, + "uint8": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "uint16": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "uint32": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "uint64": { + "type": "integer", + "minimum": 0, + "maximum": 18446744073709552000 + }, + "percent": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "mapStringString": { + "type": "object", + "patternProperties": { + ".{1,}": { + "type": "string" + } + } + }, + "UID": { + "$ref": "#/definitions/uint32" + }, + "GID": { + "$ref": "#/definitions/uint32" + }, + "Umask": { + "$ref": "#/definitions/uint32" + }, + "ArrayOfGIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/GID" + } + }, + "ArrayOfStrings": { + "type": "array", + "items": { + "type": "string" + } + }, + "FilePath": { + "type": "string" + }, + "Env": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "Hook": { + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/FilePath" + }, + "args": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "env": { + "$ref": "#/definitions/Env" + }, + "timeout": { + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "path" + ] + }, + "ArrayOfHooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + } + }, + "IDMapping": { + "type": "object", + "properties": { + "containerID": { + "$ref": "#/definitions/uint32" + }, + "hostID": { + "$ref": "#/definitions/uint32" + }, + "size": { + "$ref": "#/definitions/uint32" + } + }, + "required": [ + "containerID", + "hostID", + "size" + ] + }, + "Mount": { + "type": "object", + "properties": { + "source": { + "$ref": "#/definitions/FilePath" + }, + "destination": { + "$ref": "#/definitions/FilePath" + }, + "options": { + "$ref": "#/definitions/ArrayOfStrings" + }, + "type": { + "type": "string" + } + }, + "required": [ + "destination" + ] + }, + "ociVersion": { + "description": "The version of Open Container Initiative Runtime Specification that the document complies with", + "type": "string" + }, + "annotations": { + "$ref": "#/definitions/mapStringString" + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json new file mode 100644 index 0000000..8f82429 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json @@ -0,0 +1,39 @@ +{ + "description": "Open Container Runtime State Schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "ociVersion": { + "$ref": "defs.json#/definitions/ociVersion" + }, + "id": { + "description": "the container's ID", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "creating", + "created", + "running", + "stopped" + ] + }, + "pid": { + "type": "integer", + "minimum": 0 + }, + "bundle": { + "type": "string" + }, + "annotations": { + "$ref": "defs.json#/definitions/annotations" + } + }, + "required": [ + "ociVersion", + "id", + "status", + "bundle" + ] +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json new file mode 100644 index 0000000..8e93528 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json @@ -0,0 +1 @@ +{] diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json new file mode 100644 index 0000000..aea35eb --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json @@ -0,0 +1,16 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "hugepageLimits": [ + { + "limit": 1234123, + "pageSize": "64kB" + } + ] + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json new file mode 100644 index 0000000..5a7ac69 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json @@ -0,0 +1,15 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "rdma": { + "mlx5_1": { + "hcaHandles": "not a uint32" + } + } + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json new file mode 100644 index 0000000..e70ed53 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json @@ -0,0 +1,22 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "linux": { + "resources": { + "rdma": { + "mlx5_1": { + "hcaHandles": 3, + "hcaObjects": 10000 + }, + "mlx4_0": { + "hcaObjects": 1000 + }, + "rxe3": { + "hcaObjects": 10000 + } + } + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json new file mode 100644 index 0000000..766d2d3 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json @@ -0,0 +1,16 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + }, + "process": { + "cwd": "/", + "args": [ + "sh" + ], + "user": { + "uid": 0, + "gid": 0 + } + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json new file mode 100644 index 0000000..e26e9d7 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json @@ -0,0 +1,6 @@ +{ + "ociVersion": "1.0.0", + "root": { + "path": "rootfs" + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json new file mode 100644 index 0000000..a784d1d --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json @@ -0,0 +1,395 @@ +{ + "ociVersion": "0.5.0-dev", + "process": { + "terminal": true, + "user": { + "uid": 1, + "gid": 1, + "additionalGids": [ + 5, + 6 + ] + }, + "args": [ + "sh" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": { + "bounding": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "permitted": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "inheritable": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "effective": [ + "CAP_AUDIT_WRITE", + "CAP_KILL" + ], + "ambient": [ + "CAP_NET_BIND_SERVICE" + ] + }, + "rlimits": [ + { + "type": "RLIMIT_CORE", + "hard": 1024, + "soft": 1024 + }, + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ], + "apparmorProfile": "acme_secure_profile", + "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", + "noNewPrivileges": true + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "hostname": "slartibartfast", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + } + ], + "hooks": { + "prestart": [ + { + "path": "/usr/bin/fix-mounts", + "args": [ + "fix-mounts", + "arg1", + "arg2" + ], + "env": [ + "key1=value1" + ] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createRuntime": [ + { + "path": "/usr/bin/fix-mounts", + "args": ["fix-mounts", "arg1", "arg2"], + "env": [ "key1=value1"] + }, + { + "path": "/usr/bin/setup-network" + } + ], + "createContainer": [ + { + "path": "/usr/bin/mount-hook", + "args": ["-mount", "arg1", "arg2"], + "env": [ "key1=value1"] + } + ], + "startContainer": [ + { + "path": "/usr/bin/refresh-ldcache" + } + ], + "poststart": [ + { + "path": "/usr/bin/notify-start", + "timeout": 5 + } + ], + "poststop": [ + { + "path": "/usr/sbin/cleanup.sh", + "args": [ + "cleanup.sh", + "-f" + ] + } + ] + }, + "linux": { + "devices": [ + { + "path": "/dev/fuse", + "type": "c", + "major": 10, + "minor": 229, + "fileMode": 438, + "uid": 0, + "gid": 0 + }, + { + "path": "/dev/sda", + "type": "b", + "major": 8, + "minor": 0, + "fileMode": 432, + "uid": 0, + "gid": 0 + } + ], + "uidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "gidMappings": [ + { + "containerID": 0, + "hostID": 1000, + "size": 32000 + } + ], + "sysctl": { + "net.ipv4.ip_forward": "1", + "net.core.somaxconn": "256" + }, + "cgroupsPath": "/myRuntime/myContainer", + "resources": { + "network": { + "classID": 1048577, + "priorities": [ + { + "name": "eth0", + "priority": 500 + }, + { + "name": "eth1", + "priority": 1000 + } + ] + }, + "pids": { + "limit": 32771 + }, + "hugepageLimits": [ + { + "pageSize": "2MB", + "limit": 9223372036854772000 + }, + { + "pageSize": "64KB", + "limit": 1000000 + } + ], + "oomScoreAdj": 100, + "memory": { + "limit": 536870912, + "reservation": 536870912, + "swap": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false, + "useHierarchy": false + }, + "cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000, + "cpus": "2-3", + "mems": "0-7" + }, + "devices": [ + { + "allow": false, + "access": "rwm" + }, + { + "allow": true, + "type": "c", + "major": 10, + "minor": 229, + "access": "rw" + }, + { + "allow": true, + "type": "b", + "major": 8, + "minor": 0, + "access": "r" + } + ], + "blockIO": { + "weight": 10, + "leafWeight": 10, + "weightDevice": [ + { + "major": 8, + "minor": 0, + "weight": 500, + "leafWeight": 300 + }, + { + "major": 8, + "minor": 16, + "weight": 500 + } + ], + "throttleReadBpsDevice": [ + { + "major": 8, + "minor": 0, + "rate": 600 + } + ], + "throttleWriteIOPSDevice": [ + { + "major": 8, + "minor": 16, + "rate": 300 + } + ] + } + }, + "rootfsPropagation": "slave", + "seccomp": { + "defaultAction": "SCMP_ACT_ALLOW", + "architectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ], + "syscalls": [ + { + "names": [ + "getcwd", + "chmod" + ], + "action": "SCMP_ACT_ERRNO" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "network" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + }, + { + "type": "user" + }, + { + "type": "cgroup" + } + ], + "maskedPaths": [ + "/proc/kcore", + "/proc/latency_stats", + "/proc/timer_stats", + "/proc/sched_debug" + ], + "readonlyPaths": [ + "/proc/asound", + "/proc/bus", + "/proc/fs", + "/proc/irq", + "/proc/sys", + "/proc/sysrq-trigger" + ], + "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" + }, + "annotations": { + "com.example.key1": "value1", + "com.example.key2": "value2" + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json new file mode 100644 index 0000000..8e93528 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json @@ -0,0 +1 @@ +{] diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json new file mode 100644 index 0000000..a49faee --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json @@ -0,0 +1,10 @@ +{ + "ociVersion": "0.2.0", + "id": "oci-container1", + "status": "running", + "pid": 4422, + "bundle": "/containers/redis", + "annotations": { + "myKey": "myValue" + } +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go b/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go new file mode 100644 index 0000000..847d205 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go @@ -0,0 +1,100 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "github.com/xeipuuv/gojsonschema" +) + +const usage = `Validate is used to check document with specified schema. +You can use validate in following ways: + + 1.specify document file as an argument + validate + + 2.pass document content through a pipe + cat | validate + + 3.input document content manually, ended with ctrl+d(or your self-defined EOF keys) + validate + [INPUT DOCUMENT CONTENT HERE] +` + +func main() { + nargs := len(os.Args[1:]) + if nargs == 0 || nargs > 2 { + fmt.Printf("ERROR: invalid arguments number\n\n%s\n", usage) + os.Exit(1) + } + + if os.Args[1] == "help" || + os.Args[1] == "--help" || + os.Args[1] == "-h" { + fmt.Printf("%s\n", usage) + os.Exit(1) + } + + schemaPath := os.Args[1] + if !strings.Contains(schemaPath, "://") { + var err error + schemaPath, err = formatFilePath(schemaPath) + if err != nil { + fmt.Printf("ERROR: invalid schema-file path: %s\n", err) + os.Exit(1) + } + schemaPath = "file://" + schemaPath + } + + schemaLoader := gojsonschema.NewReferenceLoader(schemaPath) + + var documentLoader gojsonschema.JSONLoader + + if nargs > 1 { + documentPath, err := formatFilePath(os.Args[2]) + if err != nil { + fmt.Printf("ERROR: invalid document-file path: %s\n", err) + os.Exit(1) + } + documentLoader = gojsonschema.NewReferenceLoader("file://" + documentPath) + } else { + documentBytes, err := ioutil.ReadAll(os.Stdin) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + documentString := string(documentBytes) + documentLoader = gojsonschema.NewStringLoader(documentString) + } + + result, err := gojsonschema.Validate(schemaLoader, documentLoader) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + + if result.Valid() { + fmt.Printf("The document is valid\n") + } else { + fmt.Printf("The document is not valid. see errors :\n") + for _, desc := range result.Errors() { + fmt.Printf("- %s\n", desc) + } + os.Exit(1) + } +} + +func formatFilePath(path string) (string, error) { + if _, err := os.Stat(path); err != nil { + return "", err + } + + absPath, err := filepath.Abs(path) + if err != nil { + return "", err + } + return absPath, nil +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/spec.md b/hook/vendor/github.com/opencontainers/runtime-spec/spec.md new file mode 100644 index 0000000..684713a --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/spec.md @@ -0,0 +1,48 @@ +# Open Container Initiative Runtime Specification + +The [Open Container Initiative][oci] develops specifications for standards on Operating System process and application containers. + +# Abstract + +The Open Container Initiative Runtime Specification aims to specify the configuration, execution environment, and lifecycle of a container. + +A container's configuration is specified as the `config.json` for the supported platforms and details the fields that enable the creation of a container. +The execution environment is specified to ensure that applications running inside a container have a consistent environment between runtimes along with common actions defined for the container's lifecycle. + +# Platforms + +Platforms defined by this specification are: + +* `linux`: [runtime.md](runtime.md), [config.md](config.md), [config-linux.md](config-linux.md), and [runtime-linux.md](runtime-linux.md). +* `solaris`: [runtime.md](runtime.md), [config.md](config.md), and [config-solaris.md](config-solaris.md). +* `windows`: [runtime.md](runtime.md), [config.md](config.md), and [config-windows.md](config-windows.md). +* `vm`: [runtime.md](runtime.md), [config.md](config.md), and [config-vm.md](config-vm.md). + +# Table of Contents + +- [Introduction](spec.md) + - [Notational Conventions](#notational-conventions) + - [Container Principles](principles.md) +- [Filesystem Bundle](bundle.md) +- [Runtime and Lifecycle](runtime.md) + - [Linux-specific Runtime and Lifecycle](runtime-linux.md) +- [Configuration](config.md) + - [Linux-specific Configuration](config-linux.md) + - [Solaris-specific Configuration](config-solaris.md) + - [Windows-specific Configuration](config-windows.md) + - [Virtual-Machine-specific Configuration](config-vm.md) +- [Glossary](glossary.md) + +# Notational Conventions + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC 2119][rfc2119]. + +The key words "unspecified", "undefined", and "implementation-defined" are to be interpreted as described in the [rationale for the C99 standard][c99-unspecified]. + +An implementation is not compliant for a given CPU architecture if it fails to satisfy one or more of the MUST, REQUIRED, or SHALL requirements for the [platforms](#platforms) it implements. +An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the [platforms](#platforms) it implements. + + +[c99-unspecified]: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf#page=18 +[oci]: http://www.opencontainers.org +[rfc2119]: http://tools.ietf.org/html/rfc2119 diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go new file mode 100644 index 0000000..c7c7c3d --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go @@ -0,0 +1,689 @@ +package specs + +import "os" + +// Spec is the base configuration for the container. +type Spec struct { + // Version of the Open Container Initiative Runtime Specification with which the bundle complies. + Version string `json:"ociVersion"` + // Process configures the container process. + Process *Process `json:"process,omitempty"` + // Root configures the container's root filesystem. + Root *Root `json:"root,omitempty"` + // Hostname configures the container's hostname. + Hostname string `json:"hostname,omitempty"` + // Mounts configures additional mounts (on top of Root). + Mounts []Mount `json:"mounts,omitempty"` + // Hooks configures callbacks for container lifecycle events. + Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"` + // Annotations contains arbitrary metadata for the container. + Annotations map[string]string `json:"annotations,omitempty"` + + // Linux is platform-specific configuration for Linux based containers. + Linux *Linux `json:"linux,omitempty" platform:"linux"` + // Solaris is platform-specific configuration for Solaris based containers. + Solaris *Solaris `json:"solaris,omitempty" platform:"solaris"` + // Windows is platform-specific configuration for Windows based containers. + Windows *Windows `json:"windows,omitempty" platform:"windows"` + // VM specifies configuration for virtual-machine-based containers. + VM *VM `json:"vm,omitempty" platform:"vm"` +} + +// Process contains information to start a specific application inside the container. +type Process struct { + // Terminal creates an interactive terminal for the container. + Terminal bool `json:"terminal,omitempty"` + // ConsoleSize specifies the size of the console. + ConsoleSize *Box `json:"consoleSize,omitempty"` + // User specifies user information for the process. + User User `json:"user"` + // Args specifies the binary and arguments for the application to execute. + Args []string `json:"args,omitempty"` + // CommandLine specifies the full command line for the application to execute on Windows. + CommandLine string `json:"commandLine,omitempty" platform:"windows"` + // Env populates the process environment for the process. + Env []string `json:"env,omitempty"` + // Cwd is the current working directory for the process and must be + // relative to the container's root. + Cwd string `json:"cwd"` + // Capabilities are Linux capabilities that are kept for the process. + Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"` + // Rlimits specifies rlimit options to apply to the process. + Rlimits []POSIXRlimit `json:"rlimits,omitempty" platform:"linux,solaris"` + // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. + NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"` + // ApparmorProfile specifies the apparmor profile for the container. + ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` + // Specify an oom_score_adj for the container. + OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"` + // SelinuxLabel specifies the selinux context that the container process is run as. + SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` +} + +// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. +// http://man7.org/linux/man-pages/man7/capabilities.7.html +type LinuxCapabilities struct { + // Bounding is the set of capabilities checked by the kernel. + Bounding []string `json:"bounding,omitempty" platform:"linux"` + // Effective is the set of capabilities checked by the kernel. + Effective []string `json:"effective,omitempty" platform:"linux"` + // Inheritable is the capabilities preserved across execve. + Inheritable []string `json:"inheritable,omitempty" platform:"linux"` + // Permitted is the limiting superset for effective capabilities. + Permitted []string `json:"permitted,omitempty" platform:"linux"` + // Ambient is the ambient set of capabilities that are kept. + Ambient []string `json:"ambient,omitempty" platform:"linux"` +} + +// Box specifies dimensions of a rectangle. Used for specifying the size of a console. +type Box struct { + // Height is the vertical dimension of a box. + Height uint `json:"height"` + // Width is the horizontal dimension of a box. + Width uint `json:"width"` +} + +// User specifies specific user (and group) information for the container process. +type User struct { + // UID is the user id. + UID uint32 `json:"uid" platform:"linux,solaris"` + // GID is the group id. + GID uint32 `json:"gid" platform:"linux,solaris"` + // Umask is the umask for the init process. + Umask uint32 `json:"umask,omitempty" platform:"linux,solaris"` + // AdditionalGids are additional group ids set for the container's process. + AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` + // Username is the user name. + Username string `json:"username,omitempty" platform:"windows"` +} + +// Root contains information about the container's root filesystem on the host. +type Root struct { + // Path is the absolute path to the container's root filesystem. + Path string `json:"path"` + // Readonly makes the root filesystem for the container readonly before the process is executed. + Readonly bool `json:"readonly,omitempty"` +} + +// Mount specifies a mount for a container. +type Mount struct { + // Destination is the absolute path where the mount will be placed in the container. + Destination string `json:"destination"` + // Type specifies the mount kind. + Type string `json:"type,omitempty" platform:"linux,solaris"` + // Source specifies the source path of the mount. + Source string `json:"source,omitempty"` + // Options are fstab style mount options. + Options []string `json:"options,omitempty"` +} + +// Hook specifies a command that is run at a particular event in the lifecycle of a container +type Hook struct { + Path string `json:"path"` + Args []string `json:"args,omitempty"` + Env []string `json:"env,omitempty"` + Timeout *int `json:"timeout,omitempty"` +} + +// Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container +// Hooks for container setup and teardown +type Hooks struct { + // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed. + // It is called in the Runtime Namespace + Prestart []Hook `json:"prestart,omitempty"` + // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called + // It is called in the Runtime Namespace + CreateRuntime []Hook `json:"createRuntime,omitempty"` + // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called + // It is called in the Container Namespace + CreateContainer []Hook `json:"createContainer,omitempty"` + // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started + // It is called in the Container Namespace + StartContainer []Hook `json:"startContainer,omitempty"` + // Poststart is a list of hooks to be run after the container process is started. + // It is called in the Runtime Namespace + Poststart []Hook `json:"poststart,omitempty"` + // Poststop is a list of hooks to be run after the container process exits. + // It is called in the Runtime Namespace + Poststop []Hook `json:"poststop,omitempty"` +} + +// Linux contains platform-specific configuration for Linux based containers. +type Linux struct { + // UIDMapping specifies user mappings for supporting user namespaces. + UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"` + // GIDMapping specifies group mappings for supporting user namespaces. + GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"` + // Sysctl are a set of key value pairs that are set for the container on start + Sysctl map[string]string `json:"sysctl,omitempty"` + // Resources contain cgroup information for handling resource constraints + // for the container + Resources *LinuxResources `json:"resources,omitempty"` + // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. + // The path is expected to be relative to the cgroups mountpoint. + // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. + CgroupsPath string `json:"cgroupsPath,omitempty"` + // Namespaces contains the namespaces that are created and/or joined by the container + Namespaces []LinuxNamespace `json:"namespaces,omitempty"` + // Devices are a list of device nodes that are created for the container + Devices []LinuxDevice `json:"devices,omitempty"` + // Seccomp specifies the seccomp security settings for the container. + Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` + // RootfsPropagation is the rootfs mount propagation mode for the container. + RootfsPropagation string `json:"rootfsPropagation,omitempty"` + // MaskedPaths masks over the provided paths inside the container. + MaskedPaths []string `json:"maskedPaths,omitempty"` + // ReadonlyPaths sets the provided paths as RO inside the container. + ReadonlyPaths []string `json:"readonlyPaths,omitempty"` + // MountLabel specifies the selinux context for the mounts in the container. + MountLabel string `json:"mountLabel,omitempty"` + // IntelRdt contains Intel Resource Director Technology (RDT) information for + // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container + IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` + // Personality contains configuration for the Linux personality syscall + Personality *LinuxPersonality `json:"personality,omitempty"` +} + +// LinuxNamespace is the configuration for a Linux namespace +type LinuxNamespace struct { + // Type is the type of namespace + Type LinuxNamespaceType `json:"type"` + // Path is a path to an existing namespace persisted on disk that can be joined + // and is of the same type + Path string `json:"path,omitempty"` +} + +// LinuxNamespaceType is one of the Linux namespaces +type LinuxNamespaceType string + +const ( + // PIDNamespace for isolating process IDs + PIDNamespace LinuxNamespaceType = "pid" + // NetworkNamespace for isolating network devices, stacks, ports, etc + NetworkNamespace LinuxNamespaceType = "network" + // MountNamespace for isolating mount points + MountNamespace LinuxNamespaceType = "mount" + // IPCNamespace for isolating System V IPC, POSIX message queues + IPCNamespace LinuxNamespaceType = "ipc" + // UTSNamespace for isolating hostname and NIS domain name + UTSNamespace LinuxNamespaceType = "uts" + // UserNamespace for isolating user and group IDs + UserNamespace LinuxNamespaceType = "user" + // CgroupNamespace for isolating cgroup hierarchies + CgroupNamespace LinuxNamespaceType = "cgroup" +) + +// LinuxIDMapping specifies UID/GID mappings +type LinuxIDMapping struct { + // ContainerID is the starting UID/GID in the container + ContainerID uint32 `json:"containerID"` + // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' + HostID uint32 `json:"hostID"` + // Size is the number of IDs to be mapped + Size uint32 `json:"size"` +} + +// POSIXRlimit type and restrictions +type POSIXRlimit struct { + // Type of the rlimit to set + Type string `json:"type"` + // Hard is the hard limit for the specified type + Hard uint64 `json:"hard"` + // Soft is the soft limit for the specified type + Soft uint64 `json:"soft"` +} + +// LinuxHugepageLimit structure corresponds to limiting kernel hugepages +type LinuxHugepageLimit struct { + // Pagesize is the hugepage size + // Format: "B' (e.g. 64KB, 2MB, 1GB, etc.) + Pagesize string `json:"pageSize"` + // Limit is the limit of "hugepagesize" hugetlb usage + Limit uint64 `json:"limit"` +} + +// LinuxInterfacePriority for network interfaces +type LinuxInterfacePriority struct { + // Name is the name of the network interface + Name string `json:"name"` + // Priority for the interface + Priority uint32 `json:"priority"` +} + +// linuxBlockIODevice holds major:minor format supported in blkio cgroup +type linuxBlockIODevice struct { + // Major is the device's major number. + Major int64 `json:"major"` + // Minor is the device's minor number. + Minor int64 `json:"minor"` +} + +// LinuxWeightDevice struct holds a `major:minor weight` pair for weightDevice +type LinuxWeightDevice struct { + linuxBlockIODevice + // Weight is the bandwidth rate for the device. + Weight *uint16 `json:"weight,omitempty"` + // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight *uint16 `json:"leafWeight,omitempty"` +} + +// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair +type LinuxThrottleDevice struct { + linuxBlockIODevice + // Rate is the IO rate limit per cgroup per device + Rate uint64 `json:"rate"` +} + +// LinuxBlockIO for Linux cgroup 'blkio' resource management +type LinuxBlockIO struct { + // Specifies per cgroup weight + Weight *uint16 `json:"weight,omitempty"` + // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only + LeafWeight *uint16 `json:"leafWeight,omitempty"` + // Weight per cgroup per device, can override BlkioWeight + WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` + // IO read rate limit per cgroup per device, bytes per second + ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` + // IO write rate limit per cgroup per device, bytes per second + ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` + // IO read rate limit per cgroup per device, IO per second + ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` + // IO write rate limit per cgroup per device, IO per second + ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` +} + +// LinuxMemory for Linux cgroup 'memory' resource management +type LinuxMemory struct { + // Memory limit (in bytes). + Limit *int64 `json:"limit,omitempty"` + // Memory reservation or soft_limit (in bytes). + Reservation *int64 `json:"reservation,omitempty"` + // Total memory limit (memory + swap). + Swap *int64 `json:"swap,omitempty"` + // Kernel memory limit (in bytes). + Kernel *int64 `json:"kernel,omitempty"` + // Kernel memory limit for tcp (in bytes) + KernelTCP *int64 `json:"kernelTCP,omitempty"` + // How aggressive the kernel will swap memory pages. + Swappiness *uint64 `json:"swappiness,omitempty"` + // DisableOOMKiller disables the OOM killer for out of memory conditions + DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` + // Enables hierarchical memory accounting + UseHierarchy *bool `json:"useHierarchy,omitempty"` +} + +// LinuxCPU for Linux cgroup 'cpu' resource management +type LinuxCPU struct { + // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). + Shares *uint64 `json:"shares,omitempty"` + // CPU hardcap limit (in usecs). Allowed cpu time in a given period. + Quota *int64 `json:"quota,omitempty"` + // CPU period to be used for hardcapping (in usecs). + Period *uint64 `json:"period,omitempty"` + // How much time realtime scheduling may use (in usecs). + RealtimeRuntime *int64 `json:"realtimeRuntime,omitempty"` + // CPU period to be used for realtime scheduling (in usecs). + RealtimePeriod *uint64 `json:"realtimePeriod,omitempty"` + // CPUs to use within the cpuset. Default is to use any CPU available. + Cpus string `json:"cpus,omitempty"` + // List of memory nodes in the cpuset. Default is to use any available memory node. + Mems string `json:"mems,omitempty"` +} + +// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) +type LinuxPids struct { + // Maximum number of PIDs. Default is "no limit". + Limit int64 `json:"limit"` +} + +// LinuxNetwork identification and priority configuration +type LinuxNetwork struct { + // Set class identifier for container's network packets + ClassID *uint32 `json:"classID,omitempty"` + // Set priority of network traffic for container + Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` +} + +// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) +type LinuxRdma struct { + // Maximum number of HCA handles that can be opened. Default is "no limit". + HcaHandles *uint32 `json:"hcaHandles,omitempty"` + // Maximum number of HCA objects that can be created. Default is "no limit". + HcaObjects *uint32 `json:"hcaObjects,omitempty"` +} + +// LinuxResources has container runtime resource constraints +type LinuxResources struct { + // Devices configures the device whitelist. + Devices []LinuxDeviceCgroup `json:"devices,omitempty"` + // Memory restriction configuration + Memory *LinuxMemory `json:"memory,omitempty"` + // CPU resource restriction configuration + CPU *LinuxCPU `json:"cpu,omitempty"` + // Task resource restriction configuration. + Pids *LinuxPids `json:"pids,omitempty"` + // BlockIO restriction configuration + BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` + // Hugetlb limit (in bytes) + HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` + // Network restriction configuration + Network *LinuxNetwork `json:"network,omitempty"` + // Rdma resource restriction configuration. + // Limits are a set of key value pairs that define RDMA resource limits, + // where the key is device name and value is resource limits. + Rdma map[string]LinuxRdma `json:"rdma,omitempty"` +} + +// LinuxDevice represents the mknod information for a Linux special device file +type LinuxDevice struct { + // Path to the device. + Path string `json:"path"` + // Device type, block, char, etc. + Type string `json:"type"` + // Major is the device's major number. + Major int64 `json:"major"` + // Minor is the device's minor number. + Minor int64 `json:"minor"` + // FileMode permission bits for the device. + FileMode *os.FileMode `json:"fileMode,omitempty"` + // UID of the device. + UID *uint32 `json:"uid,omitempty"` + // Gid of the device. + GID *uint32 `json:"gid,omitempty"` +} + +// LinuxDeviceCgroup represents a device rule for the whitelist controller +type LinuxDeviceCgroup struct { + // Allow or deny + Allow bool `json:"allow"` + // Device type, block, char, etc. + Type string `json:"type,omitempty"` + // Major is the device's major number. + Major *int64 `json:"major,omitempty"` + // Minor is the device's minor number. + Minor *int64 `json:"minor,omitempty"` + // Cgroup access permissions format, rwm. + Access string `json:"access,omitempty"` +} + +// LinuxPersonalityDomain refers to a personality domain. +type LinuxPersonalityDomain string + +// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined. +type LinuxPersonalityFlag string + +// Define domain and flags for Personality +const ( + // PerLinux is the standard Linux personality + PerLinux LinuxPersonalityDomain = "LINUX" + // PerLinux32 sets personality to 32 bit + PerLinux32 LinuxPersonalityDomain = "LINUX32" +) + +// LinuxPersonality represents the Linux personality syscall input +type LinuxPersonality struct { + // Domain for the personality + Domain LinuxPersonalityDomain `json:"domain"` + // Additional flags + Flags []LinuxPersonalityFlag `json:"flags,omitempty"` +} + +// Solaris contains platform-specific configuration for Solaris application containers. +type Solaris struct { + // SMF FMRI which should go "online" before we start the container process. + Milestone string `json:"milestone,omitempty"` + // Maximum set of privileges any process in this container can obtain. + LimitPriv string `json:"limitpriv,omitempty"` + // The maximum amount of shared memory allowed for this container. + MaxShmMemory string `json:"maxShmMemory,omitempty"` + // Specification for automatic creation of network resources for this container. + Anet []SolarisAnet `json:"anet,omitempty"` + // Set limit on the amount of CPU time that can be used by container. + CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"` + // The physical and swap caps on the memory that can be used by this container. + CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"` +} + +// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container. +type SolarisCappedCPU struct { + Ncpus string `json:"ncpus,omitempty"` +} + +// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container. +type SolarisCappedMemory struct { + Physical string `json:"physical,omitempty"` + Swap string `json:"swap,omitempty"` +} + +// SolarisAnet provides the specification for automatic creation of network resources for this container. +type SolarisAnet struct { + // Specify a name for the automatically created VNIC datalink. + Linkname string `json:"linkname,omitempty"` + // Specify the link over which the VNIC will be created. + Lowerlink string `json:"lowerLink,omitempty"` + // The set of IP addresses that the container can use. + Allowedaddr string `json:"allowedAddress,omitempty"` + // Specifies whether allowedAddress limitation is to be applied to the VNIC. + Configallowedaddr string `json:"configureAllowedAddress,omitempty"` + // The value of the optional default router. + Defrouter string `json:"defrouter,omitempty"` + // Enable one or more types of link protection. + Linkprotection string `json:"linkProtection,omitempty"` + // Set the VNIC's macAddress + Macaddress string `json:"macAddress,omitempty"` +} + +// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. +type Windows struct { + // LayerFolders contains a list of absolute paths to directories containing image layers. + LayerFolders []string `json:"layerFolders"` + // Devices are the list of devices to be mapped into the container. + Devices []WindowsDevice `json:"devices,omitempty"` + // Resources contains information for handling resource constraints for the container. + Resources *WindowsResources `json:"resources,omitempty"` + // CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification. + CredentialSpec interface{} `json:"credentialSpec,omitempty"` + // Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation. + Servicing bool `json:"servicing,omitempty"` + // IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process. + IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` + // HyperV contains information for running a container with Hyper-V isolation. + HyperV *WindowsHyperV `json:"hyperv,omitempty"` + // Network restriction configuration. + Network *WindowsNetwork `json:"network,omitempty"` +} + +// WindowsDevice represents information about a host device to be mapped into the container. +type WindowsDevice struct { + // Device identifier: interface class GUID, etc. + ID string `json:"id"` + // Device identifier type: "class", etc. + IDType string `json:"idType"` +} + +// WindowsResources has container runtime resource constraints for containers running on Windows. +type WindowsResources struct { + // Memory restriction configuration. + Memory *WindowsMemoryResources `json:"memory,omitempty"` + // CPU resource restriction configuration. + CPU *WindowsCPUResources `json:"cpu,omitempty"` + // Storage restriction configuration. + Storage *WindowsStorageResources `json:"storage,omitempty"` +} + +// WindowsMemoryResources contains memory resource management settings. +type WindowsMemoryResources struct { + // Memory limit in bytes. + Limit *uint64 `json:"limit,omitempty"` +} + +// WindowsCPUResources contains CPU resource management settings. +type WindowsCPUResources struct { + // Number of CPUs available to the container. + Count *uint64 `json:"count,omitempty"` + // CPU shares (relative weight to other containers with cpu shares). + Shares *uint16 `json:"shares,omitempty"` + // Specifies the portion of processor cycles that this container can use as a percentage times 100. + Maximum *uint16 `json:"maximum,omitempty"` +} + +// WindowsStorageResources contains storage resource management settings. +type WindowsStorageResources struct { + // Specifies maximum Iops for the system drive. + Iops *uint64 `json:"iops,omitempty"` + // Specifies maximum bytes per second for the system drive. + Bps *uint64 `json:"bps,omitempty"` + // Sandbox size specifies the minimum size of the system drive in bytes. + SandboxSize *uint64 `json:"sandboxSize,omitempty"` +} + +// WindowsNetwork contains network settings for Windows containers. +type WindowsNetwork struct { + // List of HNS endpoints that the container should connect to. + EndpointList []string `json:"endpointList,omitempty"` + // Specifies if unqualified DNS name resolution is allowed. + AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` + // Comma separated list of DNS suffixes to use for name resolution. + DNSSearchList []string `json:"DNSSearchList,omitempty"` + // Name (ID) of the container that we will share with the network stack. + NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` + // name (ID) of the network namespace that will be used for the container. + NetworkNamespace string `json:"networkNamespace,omitempty"` +} + +// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. +type WindowsHyperV struct { + // UtilityVMPath is an optional path to the image used for the Utility VM. + UtilityVMPath string `json:"utilityVMPath,omitempty"` +} + +// VM contains information for virtual-machine-based containers. +type VM struct { + // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers. + Hypervisor VMHypervisor `json:"hypervisor,omitempty"` + // Kernel specifies kernel-related configuration for virtual-machine-based containers. + Kernel VMKernel `json:"kernel"` + // Image specifies guest image related configuration for virtual-machine-based containers. + Image VMImage `json:"image,omitempty"` +} + +// VMHypervisor contains information about the hypervisor to use for a virtual machine. +type VMHypervisor struct { + // Path is the host path to the hypervisor used to manage the virtual machine. + Path string `json:"path"` + // Parameters specifies parameters to pass to the hypervisor. + Parameters []string `json:"parameters,omitempty"` +} + +// VMKernel contains information about the kernel to use for a virtual machine. +type VMKernel struct { + // Path is the host path to the kernel used to boot the virtual machine. + Path string `json:"path"` + // Parameters specifies parameters to pass to the kernel. + Parameters []string `json:"parameters,omitempty"` + // InitRD is the host path to an initial ramdisk to be used by the kernel. + InitRD string `json:"initrd,omitempty"` +} + +// VMImage contains information about the virtual machine root image. +type VMImage struct { + // Path is the host path to the root image that the VM kernel would boot into. + Path string `json:"path"` + // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc). + Format string `json:"format"` +} + +// LinuxSeccomp represents syscall restrictions +type LinuxSeccomp struct { + DefaultAction LinuxSeccompAction `json:"defaultAction"` + Architectures []Arch `json:"architectures,omitempty"` + Flags []LinuxSeccompFlag `json:"flags,omitempty"` + Syscalls []LinuxSyscall `json:"syscalls,omitempty"` +} + +// Arch used for additional architectures +type Arch string + +// LinuxSeccompFlag is a flag to pass to seccomp(2). +type LinuxSeccompFlag string + +// Additional architectures permitted to be used for system calls +// By default only the native architecture of the kernel is permitted +const ( + ArchX86 Arch = "SCMP_ARCH_X86" + ArchX86_64 Arch = "SCMP_ARCH_X86_64" + ArchX32 Arch = "SCMP_ARCH_X32" + ArchARM Arch = "SCMP_ARCH_ARM" + ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" + ArchMIPS Arch = "SCMP_ARCH_MIPS" + ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" + ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" + ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" + ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" + ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" + ArchPPC Arch = "SCMP_ARCH_PPC" + ArchPPC64 Arch = "SCMP_ARCH_PPC64" + ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" + ArchS390 Arch = "SCMP_ARCH_S390" + ArchS390X Arch = "SCMP_ARCH_S390X" + ArchPARISC Arch = "SCMP_ARCH_PARISC" + ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" +) + +// LinuxSeccompAction taken upon Seccomp rule match +type LinuxSeccompAction string + +// Define actions for Seccomp rules +const ( + ActKill LinuxSeccompAction = "SCMP_ACT_KILL" + ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" + ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" + ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" + ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" + ActLog LinuxSeccompAction = "SCMP_ACT_LOG" +) + +// LinuxSeccompOperator used to match syscall arguments in Seccomp +type LinuxSeccompOperator string + +// Define operators for syscall arguments in Seccomp +const ( + OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE" + OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT" + OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE" + OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ" + OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE" + OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT" + OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ" +) + +// LinuxSeccompArg used for matching specific syscall arguments in Seccomp +type LinuxSeccompArg struct { + Index uint `json:"index"` + Value uint64 `json:"value"` + ValueTwo uint64 `json:"valueTwo,omitempty"` + Op LinuxSeccompOperator `json:"op"` +} + +// LinuxSyscall is used to match a syscall in Seccomp +type LinuxSyscall struct { + Names []string `json:"names"` + Action LinuxSeccompAction `json:"action"` + Args []LinuxSeccompArg `json:"args,omitempty"` +} + +// LinuxIntelRdt has container runtime resource constraints for Intel RDT +// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel +type LinuxIntelRdt struct { + // The identity for RDT Class of Service + ClosID string `json:"closID,omitempty"` + // The schema for L3 cache id and capacity bitmask (CBM) + // Format: "L3:=;=;..." + L3CacheSchema string `json:"l3CacheSchema,omitempty"` + + // The schema of memory bandwidth per L3 cache id + // Format: "MB:=bandwidth0;=bandwidth1;..." + // The unit of memory bandwidth is specified in "percentages" by + // default, and in "MBps" if MBA Software Controller is enabled. + MemBwSchema string `json:"memBwSchema,omitempty"` +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go new file mode 100644 index 0000000..89dce34 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go @@ -0,0 +1,17 @@ +package specs + +// State holds information about the runtime state of the container. +type State struct { + // Version is the version of the specification that is supported. + Version string `json:"ociVersion"` + // ID is the container ID + ID string `json:"id"` + // Status is the runtime status of the container. + Status string `json:"status"` + // Pid is the process ID for the container process. + Pid int `json:"pid,omitempty"` + // Bundle is the path to the container's bundle directory. + Bundle string `json:"bundle"` + // Annotations are key values associated with the container. + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go new file mode 100644 index 0000000..bda7e1c --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go @@ -0,0 +1,18 @@ +package specs + +import "fmt" + +const ( + // VersionMajor is for an API incompatible changes + VersionMajor = 1 + // VersionMinor is for functionality in a backwards-compatible manner + VersionMinor = 0 + // VersionPatch is for backwards-compatible bug fixes + VersionPatch = 2 + + // VersionDev indicates development branch. Releases will be empty string. + VersionDev = "" +) + +// Version is the specification version that the package types support. +var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/style.md b/hook/vendor/github.com/opencontainers/runtime-spec/style.md new file mode 100644 index 0000000..1d42043 --- /dev/null +++ b/hook/vendor/github.com/opencontainers/runtime-spec/style.md @@ -0,0 +1,131 @@ +# Style and conventions + +## One sentence per line + +To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line. +This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length. +For example, this paragraph will span three lines in the Markdown source. + +## Traditionally hex settings should use JSON integers, not JSON strings + +For example, [`"classID": 1048577`](config-linux.md#network) instead of `"classID": "0x100001"`. +The config JSON isn't enough of a UI to be worth jumping through string <-> integer hoops to support an 0x… form ([source][integer-over-hex]). + +## Constant names should keep redundant prefixes + +For example, `CAP_KILL` instead of `KILL` in [**`process.capabilities`**](config.md#process). +The redundancy reduction from removing the namespacing prefix is not useful enough to be worth trimming the upstream identifier ([source][keep-prefix]). + +## Optional settings should not have pointer Go types + +Because in many cases the Go default for the type is a no-op in the spec (sources [here][no-pointer-for-strings], [here][no-pointer-for-slices], and [here][no-pointer-for-boolean]). +The exceptions are entries where we need to distinguish between “not set” and “set to the Go default for that type” ([source][pointer-when-updates-require-changes]), and this decision should be made on a per-setting case. + +## Links + +Internal links should be [relative links][markdown-relative-links] when linking to content within the repository. +Internal links should be used inline. + +External links should be collected at the bottom of a markdown file and used as referenced links. +See 'Referenced Links' in this [markdown quick reference][markdown-quick-reference]. +The use of referenced links in the markdown body helps to keep files clean and organized. +This also facilitates updates of external link targets on a per-file basis. + +Referenced links should be kept in two alphabetically sorted sets, a general reference section followed by a man page section. +To keep Pandoc happy, duplicate naming of links within pages listed in the Makefile's `DOC_FILES` variable should be avoided by appending an `_N` to the link tagname, where `N` is some number not currently in use. +The organization and style of an existing reference section should be maintained unless it violates these style guidelines. + +An exception to these rules is when a URL is needed contextually, for example when showing an explicit link to the reader. + +## Examples + +### Anchoring + +For any given section that provides a notable example, it is ideal to have it denoted with [markdown headers][markdown-headers]. +The level of header should be such that it is a subheader of the header it is an example of. + +#### Example + +```markdown +## Some Topic + +### Some Subheader + +#### Further Subheader + +##### Example + +To use Further Subheader, ... + +### Example + +To use Some Topic, ... + +``` + +### Content + +Where necessary, the values in the example can be empty or unset, but accommodate with comments regarding this intention. + +Where feasible, the content and values used in an example should convey the fullest use of the data structures concerned. +Most commonly onlookers will intend to copy-and-paste a "working example". +If the intention of the example is to be a fully utilized example, rather than a copy-and-paste example, perhaps add a comment as such. + +```markdown +### Example +``` +```json +{ + "foo": null, + "bar": "" +} +``` + +**vs.** + +```markdown +### Example + +Following is a fully populated example (not necessarily for copy/paste use) +``` +```json +{ + "foo": [ + 1, + 2, + 3 + ], + "bar": "waffles", + "bif": { + "baz": "potatoes" + } +} +``` + +### Links + +The following is an example of different types of links. +This is shown as a complete markdown file, where the referenced links are at the bottom. + +```markdown +The specification repository's [glossary](glossary.md) is where readers can find definitions of commonly used terms. + +Readers may click through to the [Open Containers namespace][open-containers] on [GitHub][github]. + +The URL for the Open Containers link above is: https://github.com/opencontainers + + +[github]: https://github.com +[open-containers]: https://github.com/opencontainers +``` + + +[integer-over-hex]: https://github.com/opencontainers/runtime-spec/pull/267#r48360013 +[keep-prefix]: https://github.com/opencontainers/runtime-spec/pull/159#issuecomment-138728337 +[no-pointer-for-boolean]: https://github.com/opencontainers/runtime-spec/pull/290#r50296396 +[no-pointer-for-slices]: https://github.com/opencontainers/runtime-spec/pull/316#r50782982 +[no-pointer-for-strings]: https://github.com/opencontainers/runtime-spec/pull/653#issue-200439192 +[pointer-when-updates-require-changes]: https://github.com/opencontainers/runtime-spec/pull/317#r50932706 +[markdown-headers]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#headings +[markdown-quick-reference]: https://en.support.wordpress.com/markdown-quick-reference +[markdown-relative-links]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#relative-links -- Gitee From 2eae91a9c5e4466ab54e9711590f58744010cd06 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 27 May 2020 18:15:11 +0800 Subject: [PATCH 006/296] Match-id-374184c3304523c3a57d1f8f6c4360ff45940b06 --- cli/src/main.c | 127 ++++++++++++++++--------- cli/test/testcase/gtest_mytestcase.cpp | 28 +++--- cli/test/testcase/main.cpp | 33 ++----- hook/main.go | 19 ++-- hook/main_test.go | 7 +- runtime/main.go | 30 +++--- 6 files changed, 138 insertions(+), 106 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 686cb2f..03c5a36 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -41,6 +41,12 @@ struct CmdArgs { int pid; }; +struct ParsedConfig { + char containerNsPath[BUF_SIZE]; + char cgroupPath[BUF_SIZE]; + int originNsFd; +}; + static inline bool IsCmdArgsValid(struct CmdArgs *args) { return (args->devices != NULL) && (args->rootfs != NULL) && (args->pid > 0); @@ -148,7 +154,7 @@ static int MountDevice(const char *rootfs, const int serialNumber) return 0; } -static int DoMount(const char *rootfs, const char *devicesList) +static int DoDeviceMounting(const char *rootfs, const char *devicesList) { static const char *sep = ","; char list[BUF_SIZE] = {0}; @@ -281,7 +287,7 @@ static int MountFiles(const char *rootfs, const char *file, unsigned long reMoun return 0; } -static int DoMountFiles(const char *rootfs) +static int DoCtrlDeviceMounting(const char *rootfs) { /* device */ unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; @@ -303,6 +309,25 @@ static int DoMountFiles(const char *rootfs) return 0; } +static int DoMounting(const struct CmdArgs *args) +{ + int ret; + + ret = DoDeviceMounting(args->rootfs, args->devices); + if (ret < 0) { + fprintf(stderr, "error: failed to do mounts\n"); + return -1; + } + + ret = DoCtrlDeviceMounting(args->rootfs); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount files\n"); + return -1; + } + + return 0; +} + typedef char *(*ParseFileLine)(char *, const char *); int IsStrEqual(const char *s1, const char *s2) @@ -315,11 +340,17 @@ int StrHasPrefix(const char *str, const char *prefix) return (!strncmp(str, prefix, strlen(prefix))); } +static bool IsCgroupLineArgsValid(const char *rootDir, const char *mountPoint, const char* fsType, const char* substr) +{ + return ((rootDir != NULL && mountPoint != NULL && fsType != NULL && substr != NULL) && + (*rootDir != '\0' && *mountPoint != '\0' && *fsType != '\0' && *substr != '\0')); +} + char *GetCgroupMount(char *line, const char *subsys) { int i; - char *rootDir = NULL; + char *rootDir = NULL; for (i = 0; i < ROOT_GAP; ++i) { /* root is substr before gap, line is substr after gap */ rootDir = strsep(&line, " "); @@ -328,6 +359,7 @@ char *GetCgroupMount(char *line, const char *subsys) char *mountPoint = NULL; mountPoint = strsep(&line, " "); line = strchr(line, '-'); + char* fsType = NULL; for (i = 0; i < FSTYPE_GAP; ++i) { fsType = strsep(&line, " "); @@ -338,27 +370,23 @@ char *GetCgroupMount(char *line, const char *subsys) substr = strsep(&line, " "); } - if (rootDir == NULL || mountPoint == NULL || fsType == NULL || substr == NULL) { - return (NULL); - } - - if (*rootDir == '\0' || *mountPoint == '\0' || *fsType == '\0' || *substr == '\0') { - return (NULL); + if (!IsCgroupLineArgsValid(rootDir, mountPoint, fsType, substr)) { + return NULL; } if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { - return (NULL); + return NULL; } if (strstr(substr, subsys) == NULL) { - return (NULL); + return NULL; } if (!IsStrEqual(fsType, "cgroup")) { - return (NULL); + return NULL; } - return (mountPoint); + return mountPoint; } char *GetCgroupRoot(char *line, const char *subSystem) @@ -548,89 +576,96 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) return 0; } -static int SetupMounts(struct CmdArgs *args) +static int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; - char cgroupPath[BUF_SIZE] = {0}; - char containerNsPath[BUF_SIZE] = {0}; - ret = GetNsPath(args->pid, "mnt", containerNsPath, BUF_SIZE); + ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { fprintf(stderr, "error: failed to get container mnt ns path: pid(%d)\n", args->pid); - return ret; + return -1; + } + + ret = GetCgroupPath(args, config->cgroupPath, BUF_SIZE); + if (ret < 0) { + fprintf(stderr, "error: failed to get cgroup path\n"); + return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { fprintf(stderr, "error: failed to get self ns path\n"); - return ret; + return -1; } - int originNsFd = open((const char *)originNsPath, O_RDONLY); - if (originNsFd < 0) { + config->originNsFd = open((const char *)originNsPath, O_RDONLY); + if (config->originNsFd < 0) { fprintf(stderr, "error: failed to get self ns fd: %s\n", originNsPath); return -1; } - ret = GetCgroupPath(args, cgroupPath, BUF_SIZE); - if (ret < 0) { - fprintf(stderr, "error: failed to get cgroup path\n"); - return -1; - } + return 0; +} - // enter container's mount namespace - ret = EnterNsByPath((const char *) containerNsPath, CLONE_NEWNS); +static int SetupMounts(struct CmdArgs *args) +{ + int ret; + struct ParsedConfig config; + + ret = DoPrepare(args, &config); if (ret < 0) { - fprintf(stderr, "error: failed to set to container ns: %s\n", containerNsPath); - close(originNsFd); + fprintf(stderr, "error: failed to prepare nesessary config\n"); return -1; } - ret = DoMount(args->rootfs, args->devices); + // enter container's mount namespace + ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - fprintf(stderr, "error: failed to do mounts\n"); - close(originNsFd); + fprintf(stderr, "error: failed to set to container ns: %s\n", config.containerNsPath); + close(config.originNsFd); return -1; } - ret = DoMountFiles(args->rootfs); + ret = DoMounting(args); if (ret < 0) { - fprintf(stderr, "error: failed to do mount files\n"); - close(originNsFd); + fprintf(stderr, "error: failed to do mounting\n"); + close(config.originNsFd); return -1; } - ret = SetupCgroup(args, (const char *)cgroupPath); + ret = SetupCgroup(args, (const char *)config.cgroupPath); if (ret < 0) { fprintf(stderr, "error: failed to set up cgroup\n"); - close(originNsFd); + close(config.originNsFd); return -1; } // back to original namespace - ret = EnterNsByFd(originNsFd, CLONE_NEWNS); + ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { fprintf(stderr, "error: failed to set ns back\n"); - close(originNsFd); + close(config.originNsFd); return -1; } - close(originNsFd); + close(config.originNsFd); return 0; } #ifdef gtest -int _main(int argc, char **argv) { +int _main(int argc, char **argv) +{ #else -int main(int argc, char **argv) { +int main(int argc, char **argv) +{ #endif int c; int optionIndex; struct CmdArgs args = { - .devices = NULL, - .rootfs = NULL, - .pid = -1 + .devices = NULL, + .rootfs = NULL, + .pid = -1 }; while ((c = getopt_long(argc, argv, "d:p:r", g_opts, &optionIndex)) != -1) { diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index fe65da8..119140e 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -1,12 +1,13 @@ -// Demo.cpp : Defines the entry point for the console application. -// +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: 测试集 +*/ #include #include #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" using namespace std; -//建议这样引用,避免下面用关键字时需要加前缀 testing:: using namespace testing; extern "C" int IsStrEqual(const char *s1, const char *s2); @@ -16,11 +17,10 @@ extern "C" int EnterNsByFd(int fd, int nsType); int stub_setns(int fd, int nstype) { - return 0; + return 0; } -class Test_Fhho : public Test -{ +class Test_Fhho : public Test { protected: static void SetUpTestCase() { @@ -40,7 +40,7 @@ protected: cout << "TestSuite测试用例事件:在每个testcase之后执行" << endl; } }; - + TEST_F(Test_Fhho, ClassEQ1) { EXPECT_EQ(1, IsStrEqual("", "")); @@ -48,13 +48,13 @@ TEST_F(Test_Fhho, ClassEQ1) #if 0 TEST_F(Test_Fhho, ClassEQ2) -{ - int pid = 1; - char* nsType = "mnt"; - char buf[100] = {0x0}; - int bufSize = 100; - int ret = GetNsPath(pid, nsType, buf, 100); - EXPECT_EQ(1, ret); +{ + int pid = 1; + char* nsType = "mnt"; + char buf[100] = {0x0}; + int bufSize = 100; + int ret = GetNsPath(pid, nsType, buf, 100); + EXPECT_EQ(1, ret); } TEST_F(Test_Fhho, ClassEQ3) diff --git a/cli/test/testcase/main.cpp b/cli/test/testcase/main.cpp index aff34d8..2dd952f 100644 --- a/cli/test/testcase/main.cpp +++ b/cli/test/testcase/main.cpp @@ -1,40 +1,21 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: 测试框架主函数 +*/ #include #include #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" -//#include "gtest_testcase.cpp" -//#include "mockcpp_testcase.cpp" - using namespace std; -//建议这样引用,避免下面用关键字时需要加前缀 testing:: using namespace testing; - int main(int argc, char* argv[], char* evn[]) { - //std::vector g_func1 = GET_FUNC_CTOR_LIST(); - //全局事件:设置执行全局事件 - //ddGlobalTestEnvironment(new FooEnvironment); - - //输出 用例列表,用例不执行了~ - //testing::GTEST_FLAG(list_tests) = " "; - //设置过滤功能后,参数化功能失效~~~~//执行列出来的测试套的用例 - //testing::GTEST_FLAG(filter) = "EXEPath.*";//"FooTest.*:TestCase.*:TestSuite.*:TestCaseTest.*:IsPrimeParamTest.*"; - - //测试套排序,下面两种情况不能同时使用,否则排序就无作用 - //GTEST_FLAG(list_order) = "Test_Fhho;UT_DEMO;TestSuitName;FuncFoo;TestSuitEvent"; - //测试套模糊匹配排序,注:只以开头进行精确匹配,遇到 * 后模糊匹配 - //如UT_*;IT_*,先执行所有UT_开头的用例再执行IT_开头的用例 - /*GTEST_FLAG(dark_list_order) = "UT_*;\ - IT_*";*/ - // Returns 0 if all tests passed, or 1 other wise. - int ret = Init_UT(argc, argv, true); - if (1 == ret) - { + int ret = Init_UT(argc, argv, true); + if (1 == ret) { printf("有用例错误,请按任意键继续。。。"); - //getchar(); } - return ret; + return ret; } diff --git a/hook/main.go b/hook/main.go index 01a0ebf..8b9b606 100644 --- a/hook/main.go +++ b/hook/main.go @@ -1,3 +1,7 @@ +/** + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-hook工具,配置容器挂载Ascend NPU设备 + */ package main import ( @@ -21,12 +25,15 @@ const ( ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" ascendDockerCli = "ascend-docker-cli" defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli" + + borderNum = 2 + kvPairSize = 2 ) type containerConfig struct { Pid int Rootfs string - Env []string + Env []string } func removeDuplication(devices []int) []int { @@ -52,7 +59,7 @@ func parseDevices(visibleDevices string) ([]int, error) { d = strings.TrimSpace(d) if strings.Contains(d, "-") { borders := strings.Split(d, "-") - if len(borders) < 2 { + if len(borders) < borderNum { return nil, fmt.Errorf("invalid device range: %s", d) } @@ -130,7 +137,7 @@ func getContainerConfig() (*containerConfig, error) { ret := &containerConfig{ Pid: state.Pid, Rootfs: ociSpec.Root.Path, - Env: ociSpec.Process.Env, + Env: ociSpec.Process.Env, } return ret, nil @@ -139,7 +146,7 @@ func getContainerConfig() (*containerConfig, error) { func getValueByKey(data []string, key string) string { for _, s := range data { p := strings.SplitN(s, "=", 2) - if len(p) != 2 { + if len(p) != kvPairSize { log.Panicln("environment error") } @@ -171,7 +178,7 @@ func doPrestartHook() error { if err != nil { _, err = os.Stat(defaultAscendDockerCli) if err != nil { - return fmt.Errorf("could not found ascend docker cli\n") + return fmt.Errorf("could not found ascend docker cli") } cliPath = defaultAscendDockerCli @@ -183,7 +190,7 @@ func doPrestartHook() error { "--rootfs", containerConfig.Rootfs) if err := syscall.Exec(cliPath, args, os.Environ()); err != nil { - return fmt.Errorf("failed to exec ascend-docker-cli %v: %w\n", args, err) + return fmt.Errorf("failed to exec ascend-docker-cli %v: %w", args, err) } return nil diff --git a/hook/main_test.go b/hook/main_test.go index 4957840..a5e982d 100644 --- a/hook/main_test.go +++ b/hook/main_test.go @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: hook main 函数单元测试 +*/ package main import ( @@ -7,9 +11,10 @@ import ( func TestRemoveDuplication(t *testing.T) { originList := []int {1,2,2,4,5,5,5,6,8,8} + targetList := []int {1,2,4,5,6,8} resultList := removeDuplication(originList) - if !reflect.DeepEqual(resultList, []int {1,2,4,5,6,8}) { + if !reflect.DeepEqual(resultList, targetList) { t.Fail() } } diff --git a/runtime/main.go b/runtime/main.go index bfa452c..5330647 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -1,3 +1,7 @@ +/** + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-runtime工具,配置容器挂载Ascend NPU设备 + */ package main import ( @@ -30,7 +34,7 @@ func getArgs() (*args, error) { for i, param := range os.Args { if param == "--bundle" || param == "-b" { if len(os.Args)-i <= 1 { - return nil, fmt.Errorf("bundle option needs an argument\n") + return nil, fmt.Errorf("bundle option needs an argument") } args.bundleDirPath = os.Args[i+1] } else if param == "create" { @@ -46,12 +50,12 @@ func execRunc() error { if err != nil { runcPath, err = exec.LookPath("runc") if err != nil { - return fmt.Errorf("failed to find the path of runc: %w\n", err) + return fmt.Errorf("failed to find the path of runc: %w", err) } } if err = syscall.Exec(runcPath, append([]string{runcPath}, os.Args[1:]...), os.Environ()); err != nil { - return fmt.Errorf("failed to exec runc: %w\n", err) + return fmt.Errorf("failed to exec runc: %w", err) } return nil @@ -62,7 +66,7 @@ func addHook(spec *specs.Spec) error { if err != nil { path = hookDefaultFilePath if _, err = os.Stat(path); err != nil { - return fmt.Errorf("cannot find the hook\n") + return fmt.Errorf("cannot find the hook") } } @@ -93,32 +97,32 @@ func modifySpecFile(path string) error { jsonFile, err := os.OpenFile(path, os.O_RDWR, stat.Mode()) if err != nil { - return fmt.Errorf("cannot open oci spec file %s: %w\n", path, err) + return fmt.Errorf("cannot open oci spec file %s: %w", path, err) } defer jsonFile.Close() jsonContent, err := ioutil.ReadAll(jsonFile) if err != nil { - return fmt.Errorf("failed to read oci spec file %s: %w\n", path, err) + return fmt.Errorf("failed to read oci spec file %s: %w", path, err) } var spec specs.Spec if err := json.Unmarshal(jsonContent, &spec); err != nil { - return fmt.Errorf("failed to unmarshal oci spec file %s: %w\n", path, err) + return fmt.Errorf("failed to unmarshal oci spec file %s: %w", path, err) } if err := addHook(&spec); err != nil { - return fmt.Errorf("failed to inject hook: %w\n", err) + return fmt.Errorf("failed to inject hook: %w", err) } jsonOutput, err := json.Marshal(spec) if err != nil { - return fmt.Errorf("failed to marshal OCI spec file: %w\n", err) + return fmt.Errorf("failed to marshal OCI spec file: %w", err) } if _, err := jsonFile.WriteAt(jsonOutput, 0); err != nil { - return fmt.Errorf("failed to write OCI spec file: %w\n", err) + return fmt.Errorf("failed to write OCI spec file: %w", err) } return nil @@ -127,7 +131,7 @@ func modifySpecFile(path string) error { func doProcess() error { args, err := getArgs() if err != nil { - return fmt.Errorf("failed to get args: %w\n", err) + return fmt.Errorf("failed to get args: %w", err) } if args.cmd != "create" { @@ -137,14 +141,14 @@ func doProcess() error { if args.bundleDirPath == "" { args.bundleDirPath, err = os.Getwd() if err != nil { - return fmt.Errorf("failed to get current working dir: %w\n", err) + return fmt.Errorf("failed to get current working dir: %w", err) } } specFilePath := args.bundleDirPath + "/config.json" if err := modifySpecFile(specFilePath); err != nil { - return fmt.Errorf("failed to modify spec file %s: %w\n", specFilePath, err) + return fmt.Errorf("failed to modify spec file %s: %w", specFilePath, err) } return execRunc() -- Gitee From 17dac41280acdbb984ed55ffe0c1d8da139934d2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 28 May 2020 15:35:53 +0800 Subject: [PATCH 007/296] Match-id-a3b458b461f8ce21fd2d8e39d327aaadcd606687 --- runtime/config.json | 141 ++++++++++++++++++ runtime/glide.lock | 6 +- runtime/glide.yaml | 2 + runtime/main.go | 2 +- runtime/main_test.go | 29 ++++ .../github.com/prashantv/gostub/.gitignore | 24 +++ .../github.com/prashantv/gostub/.travis.yml | 15 ++ .../github.com/prashantv/gostub/CHANGELOG.md | 10 ++ .../github.com/prashantv/gostub/LICENSE.md | 21 +++ .../github.com/prashantv/gostub/README.md | 114 ++++++++++++++ .../prashantv/gostub/README.md.tmpl | 18 +++ .../prashantv/gostub/assignable_test.go | 34 +++++ .../vendor/github.com/prashantv/gostub/doc.go | 78 ++++++++++ .../vendor/github.com/prashantv/gostub/env.go | 36 +++++ .../github.com/prashantv/gostub/env_test.go | 34 +++++ .../prashantv/gostub/examples_test.go | 28 ++++ .../gostub/examples_time_const_test.go | 1 + .../gostub/examples_time_func_test.go | 43 ++++++ .../github.com/prashantv/gostub/func_test.go | 118 +++++++++++++++ .../github.com/prashantv/gostub/gostub.go | 126 ++++++++++++++++ .../prashantv/gostub/gostub_test.go | 109 ++++++++++++++ .../prashantv/gostub/utils_for_test.go | 26 ++++ .../github.com/prashantv/gostub/version.go | 4 + 23 files changed, 1016 insertions(+), 3 deletions(-) create mode 100644 runtime/config.json create mode 100644 runtime/main_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/.gitignore create mode 100644 runtime/vendor/github.com/prashantv/gostub/.travis.yml create mode 100644 runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md create mode 100644 runtime/vendor/github.com/prashantv/gostub/LICENSE.md create mode 100644 runtime/vendor/github.com/prashantv/gostub/README.md create mode 100644 runtime/vendor/github.com/prashantv/gostub/README.md.tmpl create mode 100644 runtime/vendor/github.com/prashantv/gostub/assignable_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/doc.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/env.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/env_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/func_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/gostub.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/gostub_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/utils_for_test.go create mode 100644 runtime/vendor/github.com/prashantv/gostub/version.go diff --git a/runtime/config.json b/runtime/config.json new file mode 100644 index 0000000..f3a79d8 --- /dev/null +++ b/runtime/config.json @@ -0,0 +1,141 @@ +{ + "ociVersion": "0.4.0", + "platform": { + "os": "linux", + "arch": "amd64" + }, + "process": { + "terminal": true, + "user": {}, + "args": [ + "redis-server", + "--bind", + "0.0.0.0" + ], + "env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "TERM=xterm" + ], + "cwd": "/", + "capabilities": [ + "CAP_AUDIT_WRITE", + "CAP_KILL", + "CAP_NET_BIND_SERVICE" + ], + "rlimits": [ + { + "type": "RLIMIT_NOFILE", + "hard": 1024, + "soft": 1024 + } + ], + "noNewPrivileges": true + }, + "root": { + "path": "rootfs", + "readonly": true + }, + "hostname": "runc", + "mounts": [ + { + "destination": "/proc", + "type": "proc", + "source": "proc" + }, + { + "destination": "/dev", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "nosuid", + "strictatime", + "mode=755", + "size=65536k" + ] + }, + { + "destination": "/dev/pts", + "type": "devpts", + "source": "devpts", + "options": [ + "nosuid", + "noexec", + "newinstance", + "ptmxmode=0666", + "mode=0620", + "gid=5" + ] + }, + { + "destination": "/dev/shm", + "type": "tmpfs", + "source": "shm", + "options": [ + "nosuid", + "noexec", + "nodev", + "mode=1777", + "size=65536k" + ] + }, + { + "destination": "/dev/mqueue", + "type": "mqueue", + "source": "mqueue", + "options": [ + "nosuid", + "noexec", + "nodev" + ] + }, + { + "destination": "/sys", + "type": "sysfs", + "source": "sysfs", + "options": [ + "nosuid", + "noexec", + "nodev", + "ro" + ] + }, + { + "destination": "/sys/fs/cgroup", + "type": "cgroup", + "source": "cgroup", + "options": [ + "nosuid", + "noexec", + "nodev", + "relatime", + "ro" + ] + } + ], + "hooks": {}, + "linux": { + "resources": { + "devices": [ + { + "allow": false, + "access": "rwm" + } + ] + }, + "namespaces": [ + { + "type": "pid" + }, + { + "type": "ipc" + }, + { + "type": "uts" + }, + { + "type": "mount" + } + ], + "devices": null + } +} \ No newline at end of file diff --git a/runtime/glide.lock b/runtime/glide.lock index 66e8c78..9756eec 100644 --- a/runtime/glide.lock +++ b/runtime/glide.lock @@ -1,8 +1,10 @@ -hash: d3b9b531d49a72a645375d0bd70076ca2ae3dd3d9efc48d3b5307f960433fcd3 -updated: 2020-05-18T10:46:31.7320902+08:00 +hash: a46c3790a0bd1e9a947dbc2b99b121124f0fa20ced6c16cb92be7c37fa397ed9 +updated: 2020-05-28T16:15:29.2965911+08:00 imports: - name: github.com/opencontainers/runtime-spec version: c4ee7d12c742ffe806cd9350b6af3b4b19faed6f subpackages: - specs-go +- name: github.com/prashantv/gostub + version: 24ed9cdea43de1d52ea20cab2b7a38e7ed6886b3 testImports: [] diff --git a/runtime/glide.yaml b/runtime/glide.yaml index df34969..f731cf9 100644 --- a/runtime/glide.yaml +++ b/runtime/glide.yaml @@ -4,3 +4,5 @@ import: version: ^1.0.2 subpackages: - specs-go +- package: github.com/prashantv/gostub + version: ^1.0.0 diff --git a/runtime/main.go b/runtime/main.go index 5330647..f257bd8 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -45,7 +45,7 @@ func getArgs() (*args, error) { return args, nil } -func execRunc() error { +var execRunc = func() error { runcPath, err := exec.LookPath("docker-runc") if err != nil { runcPath, err = exec.LookPath("runc") diff --git a/runtime/main_test.go b/runtime/main_test.go new file mode 100644 index 0000000..c585028 --- /dev/null +++ b/runtime/main_test.go @@ -0,0 +1,29 @@ +/** + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: Runtime DT测试 + */ +package main + +import ( + "os" + "testing" + + "github.com/prashantv/gostub" +) + +func TestArgsIsCreate(t *testing.T) { + t.Log("进入测试用例") + + testArgs := []string{"create", "--bundle", "."} + stub := gostub.Stub(&os.Args, testArgs) + defer stub.Reset() + + stub.Stub(&execRunc, func() error { + t.Log("execute stub") + return nil + }) + + if err := doProcess(); err != nil { + t.Fatalf("%v", err) + } +} diff --git a/runtime/vendor/github.com/prashantv/gostub/.gitignore b/runtime/vendor/github.com/prashantv/gostub/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/runtime/vendor/github.com/prashantv/gostub/.travis.yml b/runtime/vendor/github.com/prashantv/gostub/.travis.yml new file mode 100644 index 0000000..6b212a1 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/.travis.yml @@ -0,0 +1,15 @@ +language: go +sudo: false + +go: + - 1.9.x + - 1.10.x + - 1.11.x + +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi +script: + - $HOME/gopath/bin/goveralls -service=travis-ci + diff --git a/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md b/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md new file mode 100644 index 0000000..4ff448b --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 1.0.0 - 2018-11-09 +### Added +- Initial release with APIs to stub and reset values for testing. +- Supports stubbing Go variables, and environment variables. diff --git a/runtime/vendor/github.com/prashantv/gostub/LICENSE.md b/runtime/vendor/github.com/prashantv/gostub/LICENSE.md new file mode 100644 index 0000000..528318b --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Prashant Varanasi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/runtime/vendor/github.com/prashantv/gostub/README.md b/runtime/vendor/github.com/prashantv/gostub/README.md new file mode 100644 index 0000000..b4ae77f --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/README.md @@ -0,0 +1,114 @@ +# gostub + +[![Build Status](https://travis-ci.org/prashantv/gostub.svg?branch=master)](https://travis-ci.org/prashantv/gostub) +[![GoDoc](https://godoc.org/github.com/prashantv/gostub?status.svg)](https://godoc.org/github.com/prashantv/gostub) +[![Coverage Status](https://coveralls.io/repos/github/prashantv/gostub/badge.svg?branch=master)](https://coveralls.io/github/prashantv/gostub?branch=master) + +gostub is a library to make stubbing in unit tests easy. + +## Getting started + +Import the following package: +`github.com/prashantv/gostub` + +Click [here](https://godoc.org/github.com/prashantv/gostub) to read the [API documentation](https://godoc.org/github.com/prashantv/gostub). + +## Package overview + +Package gostub is used for stubbing variables in tests, and resetting the +original value once the test has been run. + +This can be used to stub static variables as well as static functions. To stub a +static variable, use the Stub function: + +```go +var configFile = "config.json" + +func GetConfig() ([]byte, error) { + return ioutil.ReadFile(configFile) +} + +// Test code +stubs := gostub.Stub(&configFile, "/tmp/test.config") + +data, err := GetConfig() +// data will now return contents of the /tmp/test.config file +``` + +gostub can also stub static functions in a test by using a variable to reference +the static function, and using that local variable to call the static function: + +```go +var timeNow = time.Now + +func GetDate() int { + return timeNow().Day() +} +``` + +You can test this by using gostub to stub the timeNow variable: + +```go +stubs := gostub.Stub(&timeNow, func() time.Time { + return time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC) +}) +defer stubs.Reset() + +// Test can check that GetDate returns 6 +``` + +If you are stubbing a function to return a constant value like in the above +test, you can use StubFunc instead: + +```go +stubs := gostub.StubFunc(&timeNow, time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC)) +defer stubs.Reset() +``` + +StubFunc can also be used to stub functions that return multiple values: + +```go +var osHostname = osHostname +// [...] production code using osHostname to call it. + +// Test code: +stubs := gostub.StubFunc(&osHostname, "fakehost", nil) +defer stubs.Reset() +``` + +The Reset method should be deferred to run at the end of the test to reset all +stubbed variables back to their original values. + +You can set up multiple stubs by calling Stub again: + +```go +stubs := gostub.Stub(&v1, 1) +stubs.Stub(&v2, 2) +defer stubs.Reset() +``` + +For simple cases where you are only setting up simple stubs, you can condense +the setup and cleanup into a single line: + +```go +defer gostub.Stub(&v1, 1).Stub(&v2, 2).Reset() +``` + +This sets up the stubs and then defers the Reset call. + +You should keep the return argument from the Stub call if you need to change +stubs or add more stubs during test execution: + +```go +stubs := gostub.Stub(&v1, 1) +defer stubs.Reset() + +// Do some testing +stubs.Stub(&v1, 5) + +// More testing +stubs.Stub(&b2, 6) +``` + +The Stub call must be passed a pointer to the variable that should be stubbed, +and a value which can be assigned to the variable. diff --git a/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl b/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl new file mode 100644 index 0000000..39f1c15 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl @@ -0,0 +1,18 @@ +# gostub + +[![Build Status](https://travis-ci.org/prashantv/gostub.svg?branch=master)](https://travis-ci.org/prashantv/gostub) +[![GoDoc](https://godoc.org/github.com/prashantv/gostub?status.svg)](https://godoc.org/github.com/prashantv/gostub) +[![Coverage Status](https://coveralls.io/repos/github/prashantv/gostub/badge.svg?branch=master)](https://coveralls.io/github/prashantv/gostub?branch=master) + +gostub is a library to make stubbing in unit tests easy. + +## Getting started + +Import the following package: +`{{ .ImportPath }}` + +Click [here](https://godoc.org/github.com/prashantv/gostub) to read the [API documentation](https://godoc.org/github.com/prashantv/gostub). + +## Package overview + +{{ .EmitSynopsis }} diff --git a/runtime/vendor/github.com/prashantv/gostub/assignable_test.go b/runtime/vendor/github.com/prashantv/gostub/assignable_test.go new file mode 100644 index 0000000..936e2de --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/assignable_test.go @@ -0,0 +1,34 @@ +package gostub + +import ( + "bytes" + "io" + "io/ioutil" + "strings" + "testing" +) + +const productionData = "production data" + +var dataReader io.Reader = bytes.NewReader([]byte(productionData)) + +func TestAssignableStub(t *testing.T) { + const testData = "test data" + stubs := Stub(&dataReader, strings.NewReader(testData)) + defer stubs.Reset() + + got, err := ioutil.ReadAll(dataReader) + if err != nil { + t.Fatalf("ReadAll failed: %v", err) + } + + if !bytes.Equal(got, []byte(testData)) { + t.Errorf("Got unexpected data:\n got %v\n want %v", string(got), string(testData)) + } +} + +func TestUnassignableStub(t *testing.T) { + defer expectPanic(t, "Stub wrong type", "not assignable") + var noInterface interface{} = "test" + Stub(&dataReader, noInterface) +} diff --git a/runtime/vendor/github.com/prashantv/gostub/doc.go b/runtime/vendor/github.com/prashantv/gostub/doc.go new file mode 100644 index 0000000..ee8dd61 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/doc.go @@ -0,0 +1,78 @@ +/* +Package gostub is used for stubbing variables in tests, and resetting the +original value once the test has been run. + +This can be used to stub static variables as well as static functions. To +stub a static variable, use the Stub function: + var configFile = "config.json" + + func GetConfig() ([]byte, error) { + return ioutil.ReadFile(configFile) + } + + // Test code + stubs := gostub.Stub(&configFile, "/tmp/test.config") + + data, err := GetConfig() + // data will now return contents of the /tmp/test.config file + +gostub can also stub static functions in a test by using a variable +to reference the static function, and using that local variable to call +the static function: + var timeNow = time.Now + + func GetDate() int { + return timeNow().Day() + } + +You can test this by using gostub to stub the timeNow variable: + stubs := gostub.Stub(&timeNow, func() time.Time { + return time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC) + }) + defer stubs.Reset() + + // Test can check that GetDate returns 6 + +If you are stubbing a function to return a constant value like in +the above test, you can use StubFunc instead: + stubs := gostub.StubFunc(&timeNow, time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC)) + defer stubs.Reset() + +StubFunc can also be used to stub functions that return multiple values: + var osHostname = osHostname + // [...] production code using osHostname to call it. + + // Test code: + stubs := gostub.StubFunc(&osHostname, "fakehost", nil) + defer stubs.Reset() + +The Reset method should be deferred to run at the end of the test to reset +all stubbed variables back to their original values. + +You can set up multiple stubs by calling Stub again: + stubs := gostub.Stub(&v1, 1) + stubs.Stub(&v2, 2) + defer stubs.Reset() + +For simple cases where you are only setting up simple stubs, you can condense +the setup and cleanup into a single line: + defer gostub.Stub(&v1, 1).Stub(&v2, 2).Reset() +This sets up the stubs and then defers the Reset call. + +You should keep the return argument from the Stub call if you need to change +stubs or add more stubs during test execution: + stubs := gostub.Stub(&v1, 1) + defer stubs.Reset() + + // Do some testing + stubs.Stub(&v1, 5) + + // More testing + stubs.Stub(&b2, 6) + +The Stub call must be passed a pointer to the variable that should be stubbed, +and a value which can be assigned to the variable. +*/ +package gostub + +//go:generate godocdown -template README.md.tmpl --output=README.md diff --git a/runtime/vendor/github.com/prashantv/gostub/env.go b/runtime/vendor/github.com/prashantv/gostub/env.go new file mode 100644 index 0000000..9315e05 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/env.go @@ -0,0 +1,36 @@ +package gostub + +import "os" + +func (s *Stubs) checkEnvKey(k string) { + if _, ok := s.origEnv[k]; !ok { + v, ok := os.LookupEnv(k) + s.origEnv[k] = envVal{v, ok} + } +} + +// SetEnv the specified environent variable to the specified value. +func (s *Stubs) SetEnv(k, v string) *Stubs { + s.checkEnvKey(k) + + os.Setenv(k, v) + return s +} + +// UnsetEnv unsets the specified environent variable. +func (s *Stubs) UnsetEnv(k string) *Stubs { + s.checkEnvKey(k) + + os.Unsetenv(k) + return s +} + +func (s *Stubs) resetEnv() { + for k, v := range s.origEnv { + if v.ok { + os.Setenv(k, v.val) + } else { + os.Unsetenv(k) + } + } +} diff --git a/runtime/vendor/github.com/prashantv/gostub/env_test.go b/runtime/vendor/github.com/prashantv/gostub/env_test.go new file mode 100644 index 0000000..7fa2f4b --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/env_test.go @@ -0,0 +1,34 @@ +package gostub + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestStubEnv(t *testing.T) { + os.Setenv("GOSTUB_T1", "V1") + os.Setenv("GOSTUB_T2", "V2") + os.Unsetenv("GOSTUB_NONE") + + stubs := New() + + stubs.SetEnv("GOSTUB_NONE", "a") + stubs.SetEnv("GOSTUB_T1", "1") + stubs.SetEnv("GOSTUB_T1", "2") + stubs.SetEnv("GOSTUB_T1", "3") + stubs.SetEnv("GOSTUB_T2", "4") + stubs.UnsetEnv("GOSTUB_T2") + + assert.Equal(t, "3", os.Getenv("GOSTUB_T1"), "Wrong value for T1") + assert.Equal(t, "", os.Getenv("GOSTUB_T2"), "Wrong value for T2") + assert.Equal(t, "a", os.Getenv("GOSTUB_NONE"), "Wrong value for NONE") + stubs.Reset() + + _, ok := os.LookupEnv("GOSTUB_NONE") + assert.False(t, ok, "NONE should be unset") + + assert.Equal(t, "V1", os.Getenv("GOSTUB_T1"), "Wrong reset value for T1") + assert.Equal(t, "V2", os.Getenv("GOSTUB_T2"), "Wrong reset value for T2") +} diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_test.go new file mode 100644 index 0000000..ebcd429 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/examples_test.go @@ -0,0 +1,28 @@ +package gostub_test + +import ( + "fmt" + "os" + + "github.com/prashantv/gostub" +) + +func ExampleStubFunc() { + var osHostname = os.Hostname + + defer gostub.StubFunc(&osHostname, "fakehost", nil).Reset() + host, err := osHostname() + + fmt.Println("Host:", host, "err:", err) + // Output: + // Host: fakehost err: +} + +func ExampleStub() { + var counter = 100 + + defer gostub.Stub(&counter, 200).Reset() + fmt.Println("Counter:", counter) + // Output: + // Counter: 200 +} diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go new file mode 100644 index 0000000..602dcdb --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go @@ -0,0 +1 @@ +package gostub_test diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go new file mode 100644 index 0000000..3f655e1 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go @@ -0,0 +1,43 @@ +package gostub_test + +import ( + "fmt" + "time" + + "github.com/prashantv/gostub" +) + +// Production code +var timeNow = time.Now + +func GetDay() int { + return timeNow().Day() +} + +// Test code +func Example_stubTimeWithFunction() { + var day = 2 + stubs := gostub.Stub(&timeNow, func() time.Time { + return time.Date(2015, 07, day, 0, 0, 0, 0, time.UTC) + }) + defer stubs.Reset() + + firstDay := GetDay() + + day = 3 + secondDay := GetDay() + + fmt.Printf("First day: %v, second day: %v\n", firstDay, secondDay) + // Output: + // First day: 2, second day: 3 +} + +// Test code +func Example_stubTimeWithConstant() { + stubs := gostub.StubFunc(&timeNow, time.Date(2015, 07, 2, 0, 0, 0, 0, time.UTC)) + defer stubs.Reset() + + fmt.Println("Day:", GetDay()) + // Output: + // Day: 2 +} diff --git a/runtime/vendor/github.com/prashantv/gostub/func_test.go b/runtime/vendor/github.com/prashantv/gostub/func_test.go new file mode 100644 index 0000000..1e03963 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/func_test.go @@ -0,0 +1,118 @@ +package gostub + +import ( + "errors" + "os" + "testing" + "time" +) + +func TestStubTime(t *testing.T) { + var timeNow = time.Now + + var fakeTime = time.Date(2015, 7, 1, 0, 0, 0, 0, time.UTC) + StubFunc(&timeNow, fakeTime) + expectVal(t, fakeTime, timeNow()) +} + +func TestReturnErr(t *testing.T) { + var osRemove = os.Remove + + StubFunc(&osRemove, nil) + expectVal(t, nil, osRemove("test")) + + e := errors.New("err") + StubFunc(&osRemove, e) + expectVal(t, e, osRemove("test")) +} + +func TestStubHostname(t *testing.T) { + var osHostname = os.Hostname + + StubFunc(&osHostname, "fakehost", nil) + hostname, err := osHostname() + expectVal(t, "fakehost", hostname) + expectVal(t, nil, err) + + var errNoHost = errors.New("no hostname") + StubFunc(&osHostname, "", errNoHost) + hostname, err = osHostname() + expectVal(t, "", hostname) + expectVal(t, errNoHost, err) +} + +func TestStubReturnFunc(t *testing.T) { + var retFunc = func() func() error { + return func() error { + return errors.New("err") + } + } + + var errInception = errors.New("in limbo") + StubFunc(&retFunc, func() error { + return errInception + }) + expectVal(t, errInception, retFunc()()) +} + +func TestStubFuncFail(t *testing.T) { + var osHostname = os.Hostname + var s string + + tests := []struct { + desc string + toStub interface{} + stubVals []interface{} + wantErr string + }{ + { + desc: "toStub is not a function", + toStub: &s, + stubVals: []interface{}{"fakehost", nil}, + wantErr: "to stub must be a pointer to a function", + }, + { + desc: "toStub is not a pointer", + toStub: osHostname, + stubVals: []interface{}{"fakehost", nil}, + wantErr: "to stub must be a pointer to a function", + }, + { + desc: "wrong number of stubVals", + toStub: &osHostname, + stubVals: []interface{}{"fakehost"}, + wantErr: "func type has 2 return values, but only 1 stub values provided", + }, + } + + for _, tt := range tests { + func() { + defer expectPanic(t, tt.desc, tt.wantErr) + StubFunc(tt.toStub, tt.stubVals...) + }() + } +} + +func TestMultipleStubFuncs(t *testing.T) { + var f1 = func() int { + return 100 + } + var f2 = func() int { + return 200 + } + var f3 = func() int { + return 300 + } + + stubs := StubFunc(&f1, 1).StubFunc(&f2, 2) + expectVal(t, f1(), 1) + expectVal(t, f2(), 2) + + stubs.StubFunc(&f3, 3) + expectVal(t, f3(), 3) + + stubs.Reset() + expectVal(t, f1(), 100) + expectVal(t, f2(), 200) + expectVal(t, f3(), 300) +} diff --git a/runtime/vendor/github.com/prashantv/gostub/gostub.go b/runtime/vendor/github.com/prashantv/gostub/gostub.go new file mode 100644 index 0000000..ce9fd84 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/gostub.go @@ -0,0 +1,126 @@ +package gostub + +import ( + "fmt" + "reflect" +) + +// Stub replaces the value stored at varToStub with stubVal. +// varToStub must be a pointer to the variable. stubVal should have a type +// that is assignable to the variable. +func Stub(varToStub interface{}, stubVal interface{}) *Stubs { + return New().Stub(varToStub, stubVal) +} + +// StubFunc replaces a function variable with a function that returns stubVal. +// funcVarToStub must be a pointer to a function variable. If the function +// returns multiple values, then multiple values should be passed to stubFunc. +// The values must match be assignable to the return values' types. +func StubFunc(funcVarToStub interface{}, stubVal ...interface{}) *Stubs { + return New().StubFunc(funcVarToStub, stubVal...) +} + +type envVal struct { + val string + ok bool +} + +// Stubs represents a set of stubbed variables that can be reset. +type Stubs struct { + // stubs is a map from the variable pointer (being stubbed) to the original value. + stubs map[reflect.Value]reflect.Value + origEnv map[string]envVal +} + +// New returns Stubs that can be used to stub out variables. +func New() *Stubs { + return &Stubs{ + stubs: make(map[reflect.Value]reflect.Value), + origEnv: make(map[string]envVal), + } +} + +// Stub replaces the value stored at varToStub with stubVal. +// varToStub must be a pointer to the variable. stubVal should have a type +// that is assignable to the variable. +func (s *Stubs) Stub(varToStub interface{}, stubVal interface{}) *Stubs { + v := reflect.ValueOf(varToStub) + stub := reflect.ValueOf(stubVal) + + // Ensure varToStub is a pointer to the variable. + if v.Type().Kind() != reflect.Ptr { + panic("variable to stub is expected to be a pointer") + } + + if _, ok := s.stubs[v]; !ok { + // Store the original value if this is the first time varPtr is being stubbed. + s.stubs[v] = reflect.ValueOf(v.Elem().Interface()) + } + + // *varToStub = stubVal + v.Elem().Set(stub) + return s +} + +// StubFunc replaces a function variable with a function that returns stubVal. +// funcVarToStub must be a pointer to a function variable. If the function +// returns multiple values, then multiple values should be passed to stubFunc. +// The values must match be assignable to the return values' types. +func (s *Stubs) StubFunc(funcVarToStub interface{}, stubVal ...interface{}) *Stubs { + funcPtrType := reflect.TypeOf(funcVarToStub) + if funcPtrType.Kind() != reflect.Ptr || + funcPtrType.Elem().Kind() != reflect.Func { + panic("func variable to stub must be a pointer to a function") + } + funcType := funcPtrType.Elem() + if funcType.NumOut() != len(stubVal) { + panic(fmt.Sprintf("func type has %v return values, but only %v stub values provided", + funcType.NumOut(), len(stubVal))) + } + + return s.Stub(funcVarToStub, FuncReturning(funcPtrType.Elem(), stubVal...).Interface()) +} + +// FuncReturning creates a new function with type funcType that returns results. +func FuncReturning(funcType reflect.Type, results ...interface{}) reflect.Value { + var resultValues []reflect.Value + for i, r := range results { + var retValue reflect.Value + if r == nil { + // We can't use reflect.ValueOf(nil), so we need to create the zero value. + retValue = reflect.Zero(funcType.Out(i)) + } else { + // We cannot simply use reflect.ValueOf(r) as that does not work for + // interface types, as reflect.ValueOf receives the dynamic type, which + // is the underlying type. e.g. for an error, it may *errors.errorString. + // Instead, we make the return type's expected interface value using + // reflect.New, and set the data to the passed in value. + tempV := reflect.New(funcType.Out(i)) + tempV.Elem().Set(reflect.ValueOf(r)) + retValue = tempV.Elem() + } + resultValues = append(resultValues, retValue) + } + return reflect.MakeFunc(funcType, func(_ []reflect.Value) []reflect.Value { + return resultValues + }) +} + +// Reset resets all stubbed variables back to their original values. +func (s *Stubs) Reset() { + for v, originalVal := range s.stubs { + v.Elem().Set(originalVal) + } + s.resetEnv() +} + +// ResetSingle resets a single stubbed variable back to its original value. +func (s *Stubs) ResetSingle(varToStub interface{}) { + v := reflect.ValueOf(varToStub) + originalVal, ok := s.stubs[v] + if !ok { + panic("cannot reset variable as it has not been stubbed yet") + } + + v.Elem().Set(originalVal) +} diff --git a/runtime/vendor/github.com/prashantv/gostub/gostub_test.go b/runtime/vendor/github.com/prashantv/gostub/gostub_test.go new file mode 100644 index 0000000..35d1476 --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/gostub_test.go @@ -0,0 +1,109 @@ +package gostub + +import "testing" + +// Variables used in stubbing. +var v1, v2, v3, v4 int + +// resetVars is used to reset the variables used in stubbing tests to their default values. +func resetVars() { + v1 = 100 + v2 = 200 + v3 = 300 + v4 = 400 +} + +func TestStub(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1) + + if v1 != 1 { + t.Errorf("expected") + } + expectVal(t, v1, 1) + stubs.Reset() + expectVal(t, v1, 100) +} + +func TestRestub(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1) + expectVal(t, v1, 1) + stubs.Stub(&v1, 2) + expectVal(t, v1, 2) + stubs.Reset() + expectVal(t, v1, 100) +} + +func TestResetSingle(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1).Stub(&v2, 2) + expectVal(t, v1, 1) + expectVal(t, v2, 2) + + stubs.ResetSingle(&v1) + expectVal(t, v1, 100) + expectVal(t, v2, 2) + + stubs.Reset() + expectVal(t, v1, 100) + expectVal(t, v2, 200) +} + +func TestResetSingleNotStubbed(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1) + expectVal(t, v1, 1) + + defer expectPanic(t, "ResetSingle unstubbed variable", "not been stubbed") + stubs.ResetSingle(&v2) +} + +func TestResetTwice(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1) + expectVal(t, v1, 1) + + stubs.Reset() + expectVal(t, v1, 100) + + stubs.Stub(&v1, 2) + expectVal(t, v1, 2) + + stubs.Reset() + expectVal(t, v1, 100) +} + +func TestMultipleStubs(t *testing.T) { + resetVars() + + stubs := Stub(&v1, 1).Stub(&v2, 2).Stub(&v3, 3) + expectVal(t, v1, 1) + expectVal(t, v2, 2) + expectVal(t, v3, 3) + expectVal(t, v4, 400) + + stubs.Stub(&v4, 4) + expectVal(t, v4, 4) + + stubs.Reset() + expectVal(t, v1, 100) + expectVal(t, v2, 200) + expectVal(t, v3, 300) + expectVal(t, v4, 400) +} + +func TestVarNotPtr(t *testing.T) { + defer expectPanic(t, "Stub non-pointer", "expected to be a pointer") + Stub(v1, 1) +} + +func TestTypeMismatch(t *testing.T) { + defer expectPanic(t, "Stub wrong type", "not assignable") + Stub(&v1, "test") +} diff --git a/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go b/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go new file mode 100644 index 0000000..557fbfb --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go @@ -0,0 +1,26 @@ +package gostub + +import ( + "fmt" + "reflect" + "strings" + "testing" +) + +func expectVal(t *testing.T, expected interface{}, got interface{}) { + if !reflect.DeepEqual(expected, got) { + t.Errorf("expected %v but got %v", expected, got) + } +} + +func expectPanic(t *testing.T, msg string, expectedPanic string) { + if r := recover(); r != nil { + got := fmt.Sprint(r) + if !strings.Contains(got, expectedPanic) { + t.Errorf("panic message expected to contain %q, got %v", expectedPanic, got) + } + return + } + + t.Errorf("%v expected to panic", msg) +} diff --git a/runtime/vendor/github.com/prashantv/gostub/version.go b/runtime/vendor/github.com/prashantv/gostub/version.go new file mode 100644 index 0000000..7160e9c --- /dev/null +++ b/runtime/vendor/github.com/prashantv/gostub/version.go @@ -0,0 +1,4 @@ +package gostub + +// Version contains the package version. +const Version = "1.0.0" -- Gitee From cf5e6ef2d1875b85049af5dc7f1011e59f1e036c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 28 May 2020 16:47:36 +0800 Subject: [PATCH 008/296] Match-id-9a03c8fb0841907b57369eb478a91c38db559375 --- cli/src/CMakeLists.txt | 4 +- cli/src/main.c | 54 +- cli/test/testcase/gtest_mytestcase.cpp | 654 ++++++++++++++++++++++++- 3 files changed, 678 insertions(+), 34 deletions(-) diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 49d4d07..4fb2934 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.26) -project(ascend_docker_cli C) +project(ascend-docker-cli C) set(CMAKE_C_STANDARD 11) aux_source_directory(. SRC) -add_executable(ascend_docker_cli ${SRC}) +add_executable(ascend-docker-cli ${SRC}) diff --git a/cli/src/main.c b/cli/src/main.c index 03c5a36..04fb5ef 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -52,7 +52,7 @@ static inline bool IsCmdArgsValid(struct CmdArgs *args) return (args->devices != NULL) && (args->rootfs != NULL) && (args->pid > 0); } -static void FreeCmdArgs(struct CmdArgs *args) +void FreeCmdArgs(struct CmdArgs *args) { if (args->devices != NULL) { free(args->devices); @@ -67,19 +67,19 @@ static void FreeCmdArgs(struct CmdArgs *args) args->pid = -1; } -static int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) +int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/%d/ns/%s"; return snprintf(buf, bufSize, fmtStr, pid, nsType); } -static int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) +int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/self/ns/%s"; return snprintf(buf, bufSize, fmtStr, nsType); } -static int EnterNsByFd(int fd, int nsType) +int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { @@ -90,7 +90,7 @@ static int EnterNsByFd(int fd, int nsType) return 0; } -static int EnterNsByPath(const char *path, int nsType) +int EnterNsByPath(const char *path, int nsType) { int fd; int ret; @@ -111,14 +111,14 @@ static int EnterNsByPath(const char *path, int nsType) return 0; } -static unsigned int GetNextSerialNum() +unsigned int GetNextSerialNum() { static unsigned int index = 0; return index++; } -static int MountDevice(const char *rootfs, const int serialNumber) +int MountDevice(const char *rootfs, const int serialNumber) { int ret; char src[BUF_SIZE] = {0}; @@ -154,7 +154,7 @@ static int MountDevice(const char *rootfs, const int serialNumber) return 0; } -static int DoDeviceMounting(const char *rootfs, const char *devicesList) +int DoDeviceMounting(const char *rootfs, const char *devicesList) { static const char *sep = ","; char list[BUF_SIZE] = {0}; @@ -175,7 +175,7 @@ static int DoDeviceMounting(const char *rootfs, const char *devicesList) return 0; } -static int CheckDirExists(char *dir, int len) +int CheckDirExists(char *dir, int len) { if (len < 0) { fprintf(stderr, "length of path is %d\n", len); @@ -192,7 +192,7 @@ static int CheckDirExists(char *dir, int len) } } -static int GetParentPathStr(const char *path, int lenOfPath, char *parent) +int GetParentPathStr(const char *path, int lenOfPath, char *parent) { if (lenOfPath < 0) { return -1; @@ -209,7 +209,7 @@ static int GetParentPathStr(const char *path, int lenOfPath, char *parent) return 0; } -static int MakeParentDir(char *path, mode_t mode) +int MakeParentDir(char *path, mode_t mode) { if (*path == '\0' || *path == '.') { return 0; @@ -233,7 +233,7 @@ static int MakeParentDir(char *path, mode_t mode) } } -static int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag) +int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag) { char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; @@ -287,7 +287,7 @@ static int MountFiles(const char *rootfs, const char *file, unsigned long reMoun return 0; } -static int DoCtrlDeviceMounting(const char *rootfs) +int DoCtrlDeviceMounting(const char *rootfs) { /* device */ unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; @@ -309,7 +309,7 @@ static int DoCtrlDeviceMounting(const char *rootfs) return 0; } -static int DoMounting(const struct CmdArgs *args) +int DoMounting(const struct CmdArgs *args) { int ret; @@ -412,7 +412,7 @@ char *GetCgroupRoot(char *line, const char *subSystem) return (rootDir); } -static int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) { FILE *fp; char *line = NULL; @@ -440,7 +440,7 @@ static int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const return 0; } -static int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath) +int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath) { int ret; struct stat devStat; @@ -460,7 +460,7 @@ static int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath) return 0; } -static int SetupDriverCgroup(FILE *cgroupAllow) +int SetupDriverCgroup(FILE *cgroupAllow) { int ret; @@ -485,7 +485,7 @@ static int SetupDriverCgroup(FILE *cgroupAllow) return 0; } -static int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) +int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) { int ret; char mountPath[BUF_SIZE] = {0x0}; @@ -608,7 +608,7 @@ static int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return 0; } -static int SetupMounts(struct CmdArgs *args) +int SetupMounts(struct CmdArgs *args) { int ret; struct ParsedConfig config; @@ -653,13 +653,8 @@ static int SetupMounts(struct CmdArgs *args) return 0; } -#ifdef gtest -int _main(int argc, char **argv) -{ -#else -int main(int argc, char **argv) +int Process(int argc, char **argv) { -#endif int c; int optionIndex; struct CmdArgs args = { @@ -699,3 +694,12 @@ int main(int argc, char **argv) FreeCmdArgs(&args); return 0; } + +#ifdef gtest +int _main(int argc, char **argv) { +#else +int main(int argc, char **argv) { +#endif + int ret = Process(argc, argv); + return ret; +} \ No newline at end of file diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index 119140e..9ba6e3c 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -6,21 +6,122 @@ #include #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" +#include using namespace std; using namespace testing; -extern "C" int IsStrEqual(const char *s1, const char *s2); +#define DAVINCI_MANAGER_PATH "/dev/davinci_manager" +#define BUF_SIZE 1024 +typedef char *(*ParseFileLine)(char *, const char *); +extern "C" int IsStrEqual(const char *s1, const char *s2); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); extern "C" int setns(int fd, int nstype); +extern "C" int open(const char *path, int flags); +extern "C" int close(int fd); +extern "C" int stat(const char *file_name, struct stat *buf); +extern "C" int mount(const char *source, const char *target, + const char *filesystemtype, unsigned long mountflags, const void *data); +extern "C" int rmdir(const char *pathname); extern "C" int EnterNsByFd(int fd, int nsType); +extern "C" int StrHasPrefix(const char *str, const char *prefix); +extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); +extern "C" int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); +extern "C" int EnterNsByPath(const char *path, int nsType); +extern "C" unsigned int GetNextSerialNum(); +extern "C" int MountDevice(const char *rootfs, const int serialNumber); +extern "C" int DoDeviceMounting(const char *rootfs, const char *devicesList); +extern "C" int CheckDirExists(char *dir, int len); +extern "C" int GetParentPathStr(const char *path, int lenOfPath, char *parent); +extern "C" int MakeParentDir(char *path, mode_t mode); +extern "C" int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag); +extern "C" int DoCtrlDeviceMounting(const char *rootfs); +extern "C" char *GetCgroupMount(char *line, const char *subsys); +extern "C" char *GetCgroupRoot(char *line, const char *subSystem); +extern "C" int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); +extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); +extern "C" int SetupDriverCgroup(FILE *cgroupAllow); +extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); +extern "C" int SetupCgroup(struct CmdArgs *args, const char *cgroupPath); +extern "C" int SetupMounts(struct CmdArgs *args); +extern "C" void FreeCmdArgs(struct CmdArgs *args); +extern "C" int Process(int argc, char **argv); + +struct CmdArgs { + char *devices; + char *rootfs; + int pid; +}; int stub_setns(int fd, int nstype) +{ + return 0; +} + +int Stub_EnterNsByFd_Success(int fd, int nsType) +{ + return 0; +} + +int stub_open(const char *path, int flags) +{ + return 0; +} + +int stub_mount_success(const char *source, const char *target, + const char *filesystemtype, unsigned long mountflags, const void *data) { return 0; } -class Test_Fhho : public Test { +int stub_MountDevice(const char *rootfs, const int serialNumber) +{ + return 0; +} + +int stub_MountFiles_success(const char *rootfs, const char *file, unsigned long reMountRwFlag) +{ + return 0; +} + + +int stub_CheckDirExists_fail(char *dir, int len) +{ + return -1; +} + +int Stub_EnterNsByPath_Success(const char *path, int nsType) +{ + return 0; +} + +int Stub_DoDeviceMounting_Success(const char *rootfs, const char *devicesList) +{ + return 0; +} + +int Stub_DoCtrlDeviceMounting_Success(const char *rootfs) +{ + return 0; +} + +int Stub_SetupCgroup_Success(struct CmdArgs *args, const char *cgroupPath) +{ + return 0; +} + +int Stub_SetupMounts_Success(struct CmdArgs *args) +{ + return 0; +} + +int Stub_SetupDriverCgroup_Fail(FILE *cgroupAllow) +{ + return 0; +} + +class Test_Fhho : public Test +{ protected: static void SetUpTestCase() { @@ -46,7 +147,6 @@ TEST_F(Test_Fhho, ClassEQ1) EXPECT_EQ(1, IsStrEqual("", "")); } -#if 0 TEST_F(Test_Fhho, ClassEQ2) { int pid = 1; @@ -54,10 +154,10 @@ TEST_F(Test_Fhho, ClassEQ2) char buf[100] = {0x0}; int bufSize = 100; int ret = GetNsPath(pid, nsType, buf, 100); - EXPECT_EQ(1, ret); + EXPECT_LE(0, ret); } -TEST_F(Test_Fhho, ClassEQ3) +TEST(EnterNsByFd, Status1) { int pid = 1; int nsType = 1; @@ -65,6 +165,546 @@ TEST_F(Test_Fhho, ClassEQ3) .stubs() .will(invoke(stub_setns)); int ret = EnterNsByFd(pid, nsType); - EXPECT_EQ(1, ret); + GlobalMockObject::verify(); + EXPECT_LE(0, ret); +} + +TEST(EnterNsByFd, Status2) +{ + int pid = 1; + int nsType = 1; + int ret = EnterNsByFd(pid, nsType); + EXPECT_LE(-1, ret); +} + +TEST(EnterNsByPath, Status1) +{ + char containerNsPath[BUF_SIZE] = {0}; + int nsType = 1; + MOCKER(open) + .stubs() + .will(invoke(stub_open)); + int ret = EnterNsByPath(containerNsPath, nsType); + GlobalMockObject::verify(); + EXPECT_LE(-1, ret); +} + +TEST(EnterNsByPath, Status2) +{ + char containerNsPath[BUF_SIZE] = {0}; + int nsType = 1; + int ret = EnterNsByPath(containerNsPath, nsType); + EXPECT_LE(-1, ret); +} + +TEST_F(Test_Fhho, StrHasPrefix) +{ + EXPECT_EQ(1, StrHasPrefix("/home/user", "/home")); + EXPECT_EQ(0, StrHasPrefix("/home/user", "/heme")); +} + +TEST(StrHasPrefix, status1) +{ + EXPECT_EQ(1, StrHasPrefix("/home/user", "/home")); +} + +TEST(StrHasPrefix, status2) +{ + EXPECT_EQ(0, StrHasPrefix("/home/user", "/heme")); +} + +TEST_F(Test_Fhho, GetNsPath) +{ + char containerNsPath[BUF_SIZE] = {0}; + int containerPid = 1; + EXPECT_LE(0, GetNsPath(containerPid,"mnt", containerNsPath, BUF_SIZE)); +} + +TEST_F(Test_Fhho, GetSelfNsPath) +{ + char nsPath[BUF_SIZE] = {0}; + EXPECT_LE(0, GetSelfNsPath("mnt", nsPath, BUF_SIZE)); +} + +TEST_F(Test_Fhho, GetNextSerialNum) +{ + EXPECT_EQ(0, GetNextSerialNum()); + EXPECT_EQ(1, GetNextSerialNum()); + EXPECT_EQ(2, GetNextSerialNum()); +} + +TEST(MountDevice, Status1) +{ + char *rootfs="/home"; + MOCKER(mount).stubs().will(invoke(stub_mount_success)); + int serialNumber = 0; + GlobalMockObject::verify(); + EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); +} +TEST(MountDevice, Status11) +{ + char *rootfs="/home/notexists"; + int serialNumber = 0; + EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); +} + +TEST(MountDevice, Status2) +{ + char *rootfs="../testcase/data"; +// char *rootfs="/home/zhouhongyu/DT/ascend-docker-cli/test/build/testcase/data"; + int serialNumber = 0; + EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); +} + +TEST(DoDeviceMounting, Status1) +{ + MOCKER(MountDevice) + .stubs() + .will(invoke(stub_MountDevice)); + char *rootfs = "/home"; + char *devicesList = "1,2"; + int ret = DoDeviceMounting(rootfs, devicesList); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(CheckDirExists, Status1) +{ + char *dir = "/home"; + int len = strlen(dir); + int ret = CheckDirExists(dir, len); + EXPECT_EQ(0, ret); +} + +TEST(GetParentPathStr, Status1) +{ + char *path = "/usr/bin"; + int lenOfPath = strlen(path); + char parent[BUF_SIZE] = {0}; + int ret = GetParentPathStr(path, lenOfPath, parent); + EXPECT_EQ(0, ret); +} + +TEST(MakeParentDir, Status1) +{ + char *path = "/home/test1/test2"; + mode_t mode = 0755; + char parentDir[BUF_SIZE] = {0}; + int ret = MakeParentDir(parentDir, mode); + EXPECT_EQ(0, ret); +} + +TEST(MakeParentDir, Status2) +{ + char *pathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/abcd"; + mode_t mode = 0755; + char *path = NULL; + path = strdup(pathData); + int ret = MakeParentDir(path, mode); + rmdir(path); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/"); + EXPECT_EQ(0, ret); +} + +TEST(MakeParentDir, Status3) +{ + char *pathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/abcd"; + mode_t mode = 0755; + char *path = NULL; + path = strdup(pathData); + int ret = MakeParentDir(path, mode); + ret = MakeParentDir(path, mode); + rmdir(path); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/"); + EXPECT_EQ(0, ret); +} + +TEST(MountFiles, Status1) +{ + MOCKER(MountDevice) + .stubs() + .will(invoke(stub_MountDevice)); + MOCKER(mount).stubs().will(invoke(stub_mount_success)); + char *rootfs = "../testcase/data/dev"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + umount("../testcase/data/dev" DAVINCI_MANAGER_PATH); + rmdir("../testcase/data/dev" DAVINCI_MANAGER_PATH); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(MountFiles, Status11) +{ + char *rootfs = "../testcase/data/dev"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + umount("../testcase/data/dev" DAVINCI_MANAGER_PATH); + rmdir("../testcase/data/dev" DAVINCI_MANAGER_PATH); + EXPECT_EQ(-1, ret); +} + +TEST(MountFiles, Status2) +{ + char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev"; + char *rootfs = NULL; + rootfs = strdup(rootfsData); + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; + int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev" DAVINCI_MANAGER_PATH); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev" DAVINCI_MANAGER_PATH); + EXPECT_EQ(-1, ret); +} + +TEST(MountFiles, Status3) +{ + char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; + char *rootfs = NULL; + rootfs = strdup(rootfsData); + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; + int ret = MountFiles(rootfs, "/usr", reMountRwFlag); + umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + EXPECT_EQ(-1, ret); +} + +TEST(MountFiles, Status4) +{ + char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; + char *rootfs = NULL; + rootfs = strdup(rootfsData); + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; + int ret = MountFiles(rootfs, "/notexist1/notexist2", reMountRwFlag); + umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + EXPECT_EQ(-1, ret); +} + +TEST(MountFiles, Status5) +{ + char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; + char *rootfs = NULL; + rootfs = strdup(rootfsData); + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; + int ret = MountFiles(rootfs, "/notexist2", reMountRwFlag); + umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + EXPECT_EQ(-1, ret); +} + +TEST(MountFiles, Status6) +{ + MOCKER(CheckDirExists).stubs().will(invoke(stub_CheckDirExists_fail)); + char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr1"; + char *rootfs = NULL; + rootfs = strdup(rootfsData); + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; + int ret = MountFiles(rootfs, "/usr", reMountRwFlag); + umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoCtrlDeviceMounting, Status1) +{ + char *rootfs = "/home"; + int ret = DoCtrlDeviceMounting(rootfs); + EXPECT_EQ(-1, ret); +} + +TEST(DoCtrlDeviceMounting, Status2) +{ + MOCKER(MountFiles).stubs().will(invoke(stub_MountFiles_success)); + char *rootfs = "/home"; + int ret = DoCtrlDeviceMounting(rootfs); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(GetCgroupMount, Status1) +{ + char *lineData = "406 403 0:27 /docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2 /sys/fs/cgroup/devices ro,nosuid,nodev,noexec,relatime master:15 - cgroup cgroup rw,devices"; + char *line = NULL; + line = strdup(lineData); + char *subsys = "devices"; + char *expectRes = "/sys/fs/cgroup/devices"; + char *actualRes = GetCgroupMount(line, subsys); + EXPECT_EQ(0, strcmp(actualRes, expectRes)); +} + +TEST(GetCgroupRoot, Status1) +{ + char *lineData = "3:devices:/docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2"; + char *line = NULL; + line = strdup(lineData); + char *subsys = "devices"; + char *expectRes = "/docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2"; + char *actualRes = GetCgroupRoot(line, subsys); + EXPECT_EQ(0, strcmp(actualRes, expectRes)); +} + +TEST(CatFileContent, Status1) +{ + char *mountPath= "./data/mountinfo.txt"; + char mount[BUF_SIZE] = {0x0}; + int ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); + EXPECT_EQ(-1, ret); +} + +TEST(SetupDeviceCgroup, Status1) +{ + char *cgroupPathData = "../testcase/data/devices.allow"; + char *cgroupPath = NULL; + cgroupPath = strdup(cgroupPathData); + FILE *cgroupAllow = NULL; + cgroupAllow = fopen(cgroupPath, "a"); + int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); + fclose(cgroupAllow); + EXPECT_EQ(0, ret); +} + +TEST(SetupDeviceCgroup, Status2) +{ + char *cgroupPathData = "../testcase/data/devices1.allow"; + char *cgroupPath = NULL; + cgroupPath = strdup(cgroupPathData); + FILE *cgroupAllow = NULL; + cgroupAllow = fopen(cgroupPath, "a"); + int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); + fclose(cgroupAllow); + EXPECT_EQ(0, ret); +} + +TEST(SetupDriverCgroup, Status1) +{ + char *cgroupPath = "../testcase/data/devices.allow"; + FILE *cgroupAllow = NULL; + cgroupAllow = fopen(cgroupPath, "a"); + int ret = SetupDriverCgroup(cgroupAllow); + fclose(cgroupAllow); + EXPECT_EQ(0, ret); +} + +TEST(SetupDriverCgroup, Status2) +{ + char *cgroupPath = "../testcase/data/devices1.allow"; + FILE *cgroupAllow = NULL; + cgroupAllow = fopen(cgroupPath, "a"); + int ret = SetupDriverCgroup(cgroupAllow); + fclose(cgroupAllow); + EXPECT_EQ(0, ret); } -#endif + +TEST(GetCgroupPath, Status1) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + + char cgroupPath[BUF_SIZE] = {0}; + int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); + EXPECT_EQ(0, ret); +} + +TEST(SetupCgroup, Status1) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + + char cgroupPath[BUF_SIZE] = {0}; + int ret = SetupCgroup(&args, cgroupPath); + EXPECT_EQ(-1, ret); +} + +TEST(SetupCgroup, Status2) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/devices.allow"; + char *cgroupPath = strdup(cgroupPathData); + int ret = SetupCgroup(&args, cgroupPath); + EXPECT_EQ(0, ret); +} + +TEST(SetupCgroup, Status3) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/"; + char *cgroupPath = strdup(cgroupPathData); + int ret = SetupCgroup(&args, cgroupPath); + EXPECT_EQ(-1, ret); +} + +TEST(SetupCgroup, Status4) +{ + MOCKER(SetupDriverCgroup) + .stubs() + .will(invoke(Stub_SetupDriverCgroup_Fail)); + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/"; + char *cgroupPath = strdup(cgroupPathData); + int ret = SetupCgroup(&args, cgroupPath); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status1) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + int ret = SetupMounts(&args); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status2) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status3) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status4) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status5) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status6) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); + MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(FreeCmdArgs, Status1) +{ + struct CmdArgs args = { + .devices = NULL, + .rootfs = NULL, + .pid = 1 + }; + FreeCmdArgs(&args); +} + +TEST(FreeCmdArgs, Status2) +{ + struct CmdArgs args = { + .devices = NULL, + .rootfs = NULL, + .pid = 1 + }; + char *devlist = "1,2"; + char *root = "/home"; + args.devices = strdup(devlist); + args.rootfs = strdup(root); + FreeCmdArgs(&args); +} + +TEST(Process, Status1) +{ + int argc = 0; + char **argv = NULL; + int ret = Process(argc, argv); + EXPECT_EQ(-1, ret); +} + +TEST(Process, Status2) +{ + int argc = 7; + char *argvData[7] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; + int ret = Process(argc, argvData); + EXPECT_EQ(-1, ret); +} + +TEST(Process, Status3) +{ + int argc = 7; + char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + int ret = Process(argc, argvData); + EXPECT_EQ(-1, ret); +} + +TEST(Process, Status4) +{ + int argc = 7; + char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + MOCKER(SetupMounts).stubs().will(invoke(Stub_SetupMounts_Success)); + int ret = Process(argc, argvData); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} \ No newline at end of file -- Gitee From a4f71f7b3d574b870f9bce97a29fb8ea7edeade9 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 28 May 2020 20:19:42 +0800 Subject: [PATCH 009/296] Match-id-69948825c312d1fb74e2e9658afb547da4da2769 --- cli/src/main.c | 6 ++++-- cli/test/testcase/gtest_mytestcase.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 04fb5ef..19d78d8 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -696,9 +696,11 @@ int Process(int argc, char **argv) } #ifdef gtest -int _main(int argc, char **argv) { +int _main(int argc, char **argv) +{ #else -int main(int argc, char **argv) { +int main(int argc, char **argv) +{ #endif int ret = Process(argc, argv); return ret; diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index 9ba6e3c..b5450f4 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -55,7 +55,7 @@ struct CmdArgs { int stub_setns(int fd, int nstype) { - return 0; + return 0; } int Stub_EnterNsByFd_Success(int fd, int nsType) @@ -69,7 +69,7 @@ int stub_open(const char *path, int flags) } int stub_mount_success(const char *source, const char *target, - const char *filesystemtype, unsigned long mountflags, const void *data) + const char *filesystemtype, unsigned long mountflags, const void *data) { return 0; } @@ -120,8 +120,7 @@ int Stub_SetupDriverCgroup_Fail(FILE *cgroupAllow) return 0; } -class Test_Fhho : public Test -{ +class Test_Fhho : public Test { protected: static void SetUpTestCase() { @@ -217,7 +216,7 @@ TEST_F(Test_Fhho, GetNsPath) { char containerNsPath[BUF_SIZE] = {0}; int containerPid = 1; - EXPECT_LE(0, GetNsPath(containerPid,"mnt", containerNsPath, BUF_SIZE)); + EXPECT_LE(0, GetNsPath(containerPid, "mnt", containerNsPath, BUF_SIZE)); } TEST_F(Test_Fhho, GetSelfNsPath) -- Gitee From ed6545d475d45ba61667af9bf10e35abcf54070a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 30 May 2020 10:45:57 +0800 Subject: [PATCH 010/296] Match-id-5de4f7900292a51c8f105269f8dd53980f0bdb5d --- hook/main.go | 19 ++-- hook/main_test.go | 228 ++++++++++++++++++++++++++++++++++++++++++- runtime/main.go | 17 +++- runtime/main_test.go | 173 ++++++++++++++++++++++++++++++++ 4 files changed, 424 insertions(+), 13 deletions(-) diff --git a/hook/main.go b/hook/main.go index 8b9b606..a781b11 100644 --- a/hook/main.go +++ b/hook/main.go @@ -30,6 +30,13 @@ const ( kvPairSize = 2 ) +var ( + stdIn = os.Stdin + sysCallExec = syscall.Exec + ascendDockerCliName = ascendDockerCli + defaultAscendDockerCliName = defaultAscendDockerCli +) + type containerConfig struct { Pid int Rootfs string @@ -120,9 +127,9 @@ func parseOciSpecFile(file string) (*specs.Spec, error) { return spec, nil } -func getContainerConfig() (*containerConfig, error) { +var getContainerConfig = func () (*containerConfig, error) { state := new(specs.State) - decoder := json.NewDecoder(os.Stdin) + decoder := json.NewDecoder(stdIn) if err := decoder.Decode(state); err != nil { return nil, fmt.Errorf("failed to parse the container's state") @@ -174,14 +181,14 @@ func doPrestartHook() error { return fmt.Errorf("failed to parse device setting: %w", err) } - cliPath, err := exec.LookPath(ascendDockerCli) + cliPath, err := exec.LookPath(ascendDockerCliName) if err != nil { - _, err = os.Stat(defaultAscendDockerCli) + _, err = os.Stat(defaultAscendDockerCliName) if err != nil { return fmt.Errorf("could not found ascend docker cli") } - cliPath = defaultAscendDockerCli + cliPath = defaultAscendDockerCliName } args := append([]string{cliPath}, @@ -189,7 +196,7 @@ func doPrestartHook() error { "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) - if err := syscall.Exec(cliPath, args, os.Environ()); err != nil { + if err := sysCallExec(cliPath, args, os.Environ()); err != nil { return fmt.Errorf("failed to exec ascend-docker-cli %v: %w", args, err) } diff --git a/hook/main_test.go b/hook/main_test.go index a5e982d..7d0aa2a 100644 --- a/hook/main_test.go +++ b/hook/main_test.go @@ -1,20 +1,242 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: hook main 函数单元测试 -*/ + */ package main import ( + "github.com/prashantv/gostub" + "os" + "os/exec" "reflect" "testing" ) func TestRemoveDuplication(t *testing.T) { - originList := []int {1,2,2,4,5,5,5,6,8,8} - targetList := []int {1,2,4,5,6,8} + originList := []int{1, 2, 2, 4, 5, 5, 5, 6, 8, 8} + targetList := []int{1, 2, 4, 5, 6, 8} resultList := removeDuplication(originList) if !reflect.DeepEqual(resultList, targetList) { t.Fail() } } + +func TestDoPrestartHookCase1(t *testing.T) { + if err := doPrestartHook(); err != nil { + t.Log("failed") + } +} + +func TestDoPrestartHookCase2(t *testing.T) { + conCfg := containerConfig{ + Pid: 123, + Rootfs: ".", + Env: []string{"ASCEND_VISIBLE_DEVICES=0l-3,5,7"}, + } + stub := gostub.StubFunc(&getContainerConfig, &conCfg, nil) + defer stub.Reset() + if err := doPrestartHook(); err != nil { + t.Log("failed") + } +} + +func TestDoPrestartHookCase3(t *testing.T) { + conCfg := containerConfig{ + Pid: 123, + Rootfs: ".", + Env: []string{"ASCEND_VISIBLE_DEVICE=0-3,5,7"}, + } + stub := gostub.StubFunc(&getContainerConfig, &conCfg, nil) + defer stub.Reset() + if err := doPrestartHook(); err != nil { + t.Log("failed") + } +} + +func TestDoPrestartHookCase4(t *testing.T) { + conCfg := containerConfig{ + Pid: 123, + Rootfs: ".", + Env: []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"}, + } + stub := gostub.StubFunc(&getContainerConfig, &conCfg, nil) + defer stub.Reset() + stub.Stub(&ascendDockerCliName, "") + stub.StubFunc(&sysCallExec, nil) + if err := doPrestartHook(); err != nil { + t.Log("failed") + } +} + +func TestDoPrestartHookCase5(t *testing.T) { + defer func() { + if err := recover(); err != nil { + t.Log("exception", err) + } + }() + conCfg := containerConfig{ + Pid: 123, + Rootfs: ".", + Env: []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"}, + } + stub := gostub.StubFunc(&getContainerConfig, &conCfg, nil) + defer stub.Reset() + stub.Stub(&ascendDockerCliName, "clii") + stub.Stub(&defaultAscendDockerCliName, "clii") + stub.StubFunc(&sysCallExec, nil) + if err := doPrestartHook(); err != nil { + t.Log("failed") + } +} + +func TestGetValueByKeyCase1(t *testing.T) { + data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} + key := "ASCEND_VISIBLE_DEVICES" + expectVal := "0-3,5,7" + actualVal := getValueByKey(data, key) + if actualVal != expectVal { + t.Fail() + } +} + +func TestGetValueByKeyCase2(t *testing.T) { + data := []string{"ASCEND_VISIBLE_DEVICES"} + key := "ASCEND_VISIBLE_DEVICES" + expectVal := "" + defer func() { + if err := recover(); err != nil { + t.Log("exception occur") + } + }() + actualVal := getValueByKey(data, key) + if actualVal != expectVal { + t.Fail() + } +} + +func TestGetValueByKeyCase3(t *testing.T) { + data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} + key := "ASCEND_VISIBLE_DEVICE" + expectVal := "" + actualVal := getValueByKey(data, key) + if actualVal != expectVal { + t.Fail() + } +} + +func TestParseDevicesCase1(t *testing.T) { + visibleDevices := "0-3,5,7" + expectVal := []int{0, 1, 2, 3, 5, 7} + actualVal, err := parseDevices(visibleDevices) + if err != nil || !reflect.DeepEqual(expectVal, actualVal) { + t.Fail() + } +} + +func TestParseDevicesCase2(t *testing.T) { + visibleDevices := "0-3-4,5,7" + _, err := parseDevices(visibleDevices) + if err != nil { + t.Fail() + } +} + +func TestParseDevicesCase3(t *testing.T) { + visibleDevices := "0l-3,5,7" + _, err := parseDevices(visibleDevices) + if err == nil { + t.Fail() + } +} + +func TestParseDevicesCase4(t *testing.T) { + visibleDevices := "0-3o,5,7" + _, err := parseDevices(visibleDevices) + if err == nil { + t.Fail() + } +} + +func TestParseDevicesCase5(t *testing.T) { + visibleDevices := "4-3,5,7" + _, err := parseDevices(visibleDevices) + if err == nil { + t.Fail() + } +} + +func TestParseDevicesCase6(t *testing.T) { + visibleDevices := "3o,5,7" + _, err := parseDevices(visibleDevices) + if err == nil { + t.Fail() + } +} + +func TestParseDevicesCase7(t *testing.T) { + visibleDevices := "0=3,5,7" + _, err := parseDevices(visibleDevices) + if err == nil { + t.Fail() + } +} + +func TestParseOciSpecFileCase1(t *testing.T) { + file := "file" + _, err := parseOciSpecFile(file) + if err == nil { + t.Fail() + } +} + +func TestParseOciSpecFileCase2(t *testing.T) { + file := "file" + f, err := os.Create(file) + defer os.Remove(file) + defer f.Close() + if err != nil { + t.Log("create file failed") + } + _, err = parseOciSpecFile(file) + if err == nil { + t.Fail() + } +} + +func TestParseOciSpecFileCase3(t *testing.T) { + file := "config.json" + cmd := exec.Command("runc", "spec") + if err := cmd.Run(); err != nil { + t.Log("runc spec failed") + } + defer os.Remove(file) + _, err := parseOciSpecFile(file) + if err != nil { + t.Fail() + } +} + +func TestGetContainerConfig(t *testing.T) { + file := "config.json" + cmd := exec.Command("runc", "spec") + if err := cmd.Run(); err != nil { + t.Log("runc spec failed") + } + defer func() { + if err := recover(); err != nil { + t.Log("exception", err) + } + }() + defer os.Remove(file) + stateFile, err := os.Open("config.json") + if err != nil { + t.Log("open file failed") + } + defer stateFile.Close() + + stub := gostub.Stub(&stdIn, stateFile) + defer stub.Reset() + + getContainerConfig() +} diff --git a/runtime/main.go b/runtime/main.go index f257bd8..19aba19 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -21,6 +21,15 @@ const ( loggingPrefix = "ascend-docker-runtime" hookCli = "ascend-docker-hook" hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" + dockerRuncFile = "docker-runc" + runcFile = "runc" +) + +var ( + hookCliPath = hookCli + hookDefaultFile = hookDefaultFilePath + dockerRuncName = dockerRuncFile + runcName = runcFile ) type args struct { @@ -46,9 +55,9 @@ func getArgs() (*args, error) { } var execRunc = func() error { - runcPath, err := exec.LookPath("docker-runc") + runcPath, err := exec.LookPath(dockerRuncName) if err != nil { - runcPath, err = exec.LookPath("runc") + runcPath, err = exec.LookPath(runcName) if err != nil { return fmt.Errorf("failed to find the path of runc: %w", err) } @@ -62,9 +71,9 @@ var execRunc = func() error { } func addHook(spec *specs.Spec) error { - path, err := exec.LookPath(hookCli) + path, err := exec.LookPath(hookCliPath) if err != nil { - path = hookDefaultFilePath + path = hookDefaultFile if _, err = os.Stat(path); err != nil { return fmt.Errorf("cannot find the hook") } diff --git a/runtime/main_test.go b/runtime/main_test.go index c585028..2288ac5 100644 --- a/runtime/main_test.go +++ b/runtime/main_test.go @@ -8,6 +8,7 @@ import ( "os" "testing" + "github.com/opencontainers/runtime-spec/specs-go" "github.com/prashantv/gostub" ) @@ -27,3 +28,175 @@ func TestArgsIsCreate(t *testing.T) { t.Fatalf("%v", err) } } + +func TestArgsIsCreateCase1(t *testing.T) { + t.Log("进入测试用例") + + testArgs := []string{"create", "--bundle"} + stub := gostub.Stub(&os.Args, testArgs) + defer stub.Reset() + + stub.Stub(&execRunc, func() error { + t.Log("execute stub") + return nil + }) + + if err := doProcess(); err == nil { + t.Fatalf("%v", err) + } +} + +func TestArgsIsCreateCase2(t *testing.T) { + t.Log("进入测试用例") + + testArgs := []string{"create", "--bundle", ""} + stub := gostub.Stub(&os.Args, testArgs) + defer stub.Reset() + + stub.Stub(&execRunc, func() error { + t.Log("execute stub") + return nil + }) + + if err := doProcess(); err != nil { + t.Fatalf("%v", err) + } +} + +func TestArgsIsCreateCase3(t *testing.T) { + t.Log("进入测试用例") + + if err := os.Mkdir("./test", 0655); err != nil { + } + f, err := os.Create("./test/config.json") + defer f.Close() + if err != nil { + } + testArgs := []string{"create", "--bundle", "./test"} + stub := gostub.Stub(&os.Args, testArgs) + defer stub.Reset() + + stub.Stub(&execRunc, func() error { + t.Log("execute stub") + return nil + }) + + if err := doProcess(); err == nil { + t.Fatalf("%v", err) + } +} + +func TestArgsIsCreateCase4(t *testing.T) { + t.Log("进入测试用例") + + if err := os.Mkdir("./test", 0655); err != nil { + } + f, err := os.Create("./test/config.json") + defer f.Close() + if err != nil { + } + testArgs := []string{"spec", "--bundle", "./test"} + stub := gostub.Stub(&os.Args, testArgs) + defer stub.Reset() + + stub.Stub(&execRunc, func() error { + t.Log("execute stub") + return nil + }) + + if err := doProcess(); err == nil { + t.Fatalf("%v", err) + } +} + +func TestModifySpecFile(t *testing.T) { + if err := modifySpecFile("./test/config.json"); err != nil { + t.Log("run modifySpecFile failed") + } +} + +func TestModifySpecFileCase1(t *testing.T) { + var file string = "./test" + if err := os.Mkdir("./test", 0400); err != nil { + + } + + if err := modifySpecFile(file); err != nil { + t.Log("run modifySpecFile failed") + } + if err := os.Remove(file); err != nil { + + } +} + +func TestModifySpecFileCase2(t *testing.T) { + var file string = "./test.json" + f, err := os.Create(file) + defer f.Close() + if err != nil { + t.Log("create file error") + } + + if err := modifySpecFile(file); err != nil { + t.Log("run modifySpecFile failed") + } + if err := os.Remove(file); err != nil { + + } +} + +func TestModifySpecFileCase3(t *testing.T) { + var file string = "./test_spec.json" + if err := modifySpecFile(file); err != nil { + t.Log("run modifySpecFile failed") + } +} + +func TestAddHook(t *testing.T) { + var specArgs = &specs.Spec{} + if err := addHook(specArgs); err != nil { + } +} + +func TestAddHookCase1(t *testing.T) { + var specArgs = &specs.Spec{} + stub := gostub.Stub(&hookCliPath, ".") + defer stub.Reset() + + if err := addHook(specArgs); err != nil { + } +} + +func TestAddHookCase2(t *testing.T) { + var specArgs = &specs.Spec{} + stub := gostub.Stub(&hookCliPath, ".") + defer stub.Reset() + stub.Stub(&hookDefaultFile, ".") + if err := addHook(specArgs); err != nil { + } +} + +func TestAddHookCase3(t *testing.T) { + var file string = "/usr/local/bin/ascend-docker-hook" + var filenew string = "/usr/local/bin/ascend-docker-hook-1" + + if err := os.Rename(file, filenew); err != nil { + t.Log("rename ", file) + } + var specArgs = &specs.Spec{} + if err := addHook(specArgs); err != nil { + } + if err := os.Rename(filenew, file); err != nil { + t.Log("rename ", file) + } +} + +func TestExecRunc(t *testing.T) { + stub := gostub.Stub(&dockerRuncName, "abc-runc") + stub.Stub(&runcName, "runc123") + defer stub.Reset() + + if err := execRunc(); err != nil { + + } +} \ No newline at end of file -- Gitee From 09044988211da1a46db524b4d4d7dc08bcdd0ab4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 30 May 2020 11:22:47 +0800 Subject: [PATCH 011/296] Match-id-017ee5c63599ca3cd86d9cd342f0f3e1a60ed1f6 --- hook/main.go | 12 ++++++------ hook/main_test.go | 30 +++++++++++++++++------------- runtime/main_test.go | 10 +++++----- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/hook/main.go b/hook/main.go index a781b11..2f41783 100644 --- a/hook/main.go +++ b/hook/main.go @@ -31,10 +31,10 @@ const ( ) var ( - stdIn = os.Stdin - sysCallExec = syscall.Exec - ascendDockerCliName = ascendDockerCli - defaultAscendDockerCliName = defaultAscendDockerCli + containerConfigInputStream = os.Stdin + doExec = syscall.Exec + ascendDockerCliName = ascendDockerCli + defaultAscendDockerCliName = defaultAscendDockerCli ) type containerConfig struct { @@ -129,7 +129,7 @@ func parseOciSpecFile(file string) (*specs.Spec, error) { var getContainerConfig = func () (*containerConfig, error) { state := new(specs.State) - decoder := json.NewDecoder(stdIn) + decoder := json.NewDecoder(containerConfigInputStream) if err := decoder.Decode(state); err != nil { return nil, fmt.Errorf("failed to parse the container's state") @@ -196,7 +196,7 @@ func doPrestartHook() error { "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) - if err := sysCallExec(cliPath, args, os.Environ()); err != nil { + if err := doExec(cliPath, args, os.Environ()); err != nil { return fmt.Errorf("failed to exec ascend-docker-cli %v: %w", args, err) } diff --git a/hook/main_test.go b/hook/main_test.go index 7d0aa2a..6cd40e1 100644 --- a/hook/main_test.go +++ b/hook/main_test.go @@ -12,6 +12,10 @@ import ( "testing" ) +const ( + pidSample = 123 +) + func TestRemoveDuplication(t *testing.T) { originList := []int{1, 2, 2, 4, 5, 5, 5, 6, 8, 8} targetList := []int{1, 2, 4, 5, 6, 8} @@ -30,7 +34,7 @@ func TestDoPrestartHookCase1(t *testing.T) { func TestDoPrestartHookCase2(t *testing.T) { conCfg := containerConfig{ - Pid: 123, + Pid: pidSample, Rootfs: ".", Env: []string{"ASCEND_VISIBLE_DEVICES=0l-3,5,7"}, } @@ -43,7 +47,7 @@ func TestDoPrestartHookCase2(t *testing.T) { func TestDoPrestartHookCase3(t *testing.T) { conCfg := containerConfig{ - Pid: 123, + Pid: pidSample, Rootfs: ".", Env: []string{"ASCEND_VISIBLE_DEVICE=0-3,5,7"}, } @@ -56,14 +60,14 @@ func TestDoPrestartHookCase3(t *testing.T) { func TestDoPrestartHookCase4(t *testing.T) { conCfg := containerConfig{ - Pid: 123, + Pid: pidSample, Rootfs: ".", Env: []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"}, } stub := gostub.StubFunc(&getContainerConfig, &conCfg, nil) defer stub.Reset() stub.Stub(&ascendDockerCliName, "") - stub.StubFunc(&sysCallExec, nil) + stub.StubFunc(&doExec, nil) if err := doPrestartHook(); err != nil { t.Log("failed") } @@ -76,7 +80,7 @@ func TestDoPrestartHookCase5(t *testing.T) { } }() conCfg := containerConfig{ - Pid: 123, + Pid: pidSample, Rootfs: ".", Env: []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"}, } @@ -84,7 +88,7 @@ func TestDoPrestartHookCase5(t *testing.T) { defer stub.Reset() stub.Stub(&ascendDockerCliName, "clii") stub.Stub(&defaultAscendDockerCliName, "clii") - stub.StubFunc(&sysCallExec, nil) + stub.StubFunc(&doExec, nil) if err := doPrestartHook(); err != nil { t.Log("failed") } @@ -92,9 +96,9 @@ func TestDoPrestartHookCase5(t *testing.T) { func TestGetValueByKeyCase1(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} - key := "ASCEND_VISIBLE_DEVICES" + kWord := "ASCEND_VISIBLE_DEVICES" expectVal := "0-3,5,7" - actualVal := getValueByKey(data, key) + actualVal := getValueByKey(data, kWord) if actualVal != expectVal { t.Fail() } @@ -102,14 +106,14 @@ func TestGetValueByKeyCase1(t *testing.T) { func TestGetValueByKeyCase2(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES"} - key := "ASCEND_VISIBLE_DEVICES" + kWord := "ASCEND_VISIBLE_DEVICES" expectVal := "" defer func() { if err := recover(); err != nil { t.Log("exception occur") } }() - actualVal := getValueByKey(data, key) + actualVal := getValueByKey(data, kWord) if actualVal != expectVal { t.Fail() } @@ -117,9 +121,9 @@ func TestGetValueByKeyCase2(t *testing.T) { func TestGetValueByKeyCase3(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} - key := "ASCEND_VISIBLE_DEVICE" + kWord := "ASCEND_VISIBLE_DEVICE" expectVal := "" - actualVal := getValueByKey(data, key) + actualVal := getValueByKey(data, kWord) if actualVal != expectVal { t.Fail() } @@ -235,7 +239,7 @@ func TestGetContainerConfig(t *testing.T) { } defer stateFile.Close() - stub := gostub.Stub(&stdIn, stateFile) + stub := gostub.Stub(&containerConfigInputStream, stateFile) defer stub.Reset() getContainerConfig() diff --git a/runtime/main_test.go b/runtime/main_test.go index 2288ac5..e857617 100644 --- a/runtime/main_test.go +++ b/runtime/main_test.go @@ -116,7 +116,7 @@ func TestModifySpecFile(t *testing.T) { } func TestModifySpecFileCase1(t *testing.T) { - var file string = "./test" + file := "./test" if err := os.Mkdir("./test", 0400); err != nil { } @@ -130,7 +130,7 @@ func TestModifySpecFileCase1(t *testing.T) { } func TestModifySpecFileCase2(t *testing.T) { - var file string = "./test.json" + file := "./test.json" f, err := os.Create(file) defer f.Close() if err != nil { @@ -146,7 +146,7 @@ func TestModifySpecFileCase2(t *testing.T) { } func TestModifySpecFileCase3(t *testing.T) { - var file string = "./test_spec.json" + file := "./test_spec.json" if err := modifySpecFile(file); err != nil { t.Log("run modifySpecFile failed") } @@ -177,8 +177,8 @@ func TestAddHookCase2(t *testing.T) { } func TestAddHookCase3(t *testing.T) { - var file string = "/usr/local/bin/ascend-docker-hook" - var filenew string = "/usr/local/bin/ascend-docker-hook-1" + file := "/usr/local/bin/ascend-docker-hook" + filenew := "/usr/local/bin/ascend-docker-hook-1" if err := os.Rename(file, filenew); err != nil { t.Log("rename ", file) -- Gitee From e4ddc439c49361e76a17d27a8a9f913c15f03a44 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 30 May 2020 10:18:10 +0800 Subject: [PATCH 012/296] Match-id-e8b94d03fcaae54471e8213a69229820b5987bdb --- install/deb/src/CMakeLists.txt | 24 +++++ install/deb/src/cjson/CMakeLists.txt | 8 ++ install/deb/src/install | 10 ++ install/deb/src/main.c | 144 +++++++++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 install/deb/src/CMakeLists.txt create mode 100644 install/deb/src/cjson/CMakeLists.txt create mode 100644 install/deb/src/install create mode 100644 install/deb/src/main.c diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt new file mode 100644 index 0000000..e324718 --- /dev/null +++ b/install/deb/src/CMakeLists.txt @@ -0,0 +1,24 @@ +# CMake 最低版本号要求 +cmake_minimum_required (VERSION 2.8) + +# 项目信息 +project (ascend-docker-plugin-install-helper) + +#导入头文件所在路径 +#PROJECT_SOURCE_DIR为cmake宏 +include_directories("${PROJECT_SOURCE_DIR}/cjson") + +# 查找当前目录下的所有源文件 +# 并将名称保存到 SRC 变量 +aux_source_directory(. SRC) + +# 指定生成目标 +add_executable(ascend-docker-plugin-install-helper ${SRC}) + +# 添加 math 子目录 +add_subdirectory(cjson) + +# 添加链接库 +#该命令要在add_executable命令下方,否则报错 +target_link_libraries(ascend-docker-plugin-install-helper cjson) + diff --git a/install/deb/src/cjson/CMakeLists.txt b/install/deb/src/cjson/CMakeLists.txt new file mode 100644 index 0000000..ad8ce98 --- /dev/null +++ b/install/deb/src/cjson/CMakeLists.txt @@ -0,0 +1,8 @@ +execute_process(COMMAND bash ../install) +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(cjson ${LIB_SRC}) + diff --git a/install/deb/src/install b/install/deb/src/install new file mode 100644 index 0000000..10c46f6 --- /dev/null +++ b/install/deb/src/install @@ -0,0 +1,10 @@ +#! /bin/bash +echo "extract files\n" +if [ ! -d "../cjson" ];then + mkdir ../src +else + rm -rf ../src +fi +/bin/cp -rf ${files} ../cjson +tar -zxvf ../*.tar.gz +files=`find ../ -name "cJSON.*"` diff --git a/install/deb/src/main.c b/install/deb/src/main.c new file mode 100644 index 0000000..ba5623f --- /dev/null +++ b/install/deb/src/main.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker + * auther: z00378930 zhang ou aka snake +*/ +#include "cJSON.h" +#include +#include +#include + +#define MAX_JSON_FILE_SIZE 65535 +#define JSON_FILE_PATH "/etc/docker/daemon.json" +#define TEMP_PATH "/etc/docker/daemon.json.back" +#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" + +void JsonFileRead(const FILE *pf, char *text, int maxBufferSize) +{ + fseek(pf, 0, SEEK_END); + + int size = (int)ftell(pf); + if (size >= maxBufferSize) { + fprintf(stderr, "file size too large\n"); + } + + fseek(pf, 0, SEEK_SET); + fread(text, sizeof(char), size, pf); + text[size] = '\0'; +} + +int CreateNode(cJSON *runtimes) +{ + cJSON *node = cJSON_GetObjectItem(runtimes, "ascend"); + if (node != NULL) { + return 0; + } + + cJSON *newItem = NULL; + newItem = cJSON_CreateObject(); + if (newItem == NULL) { + return -1; + } + cJSON_AddItemToObject(runtimes, "ascend", newItem); + + cJSON *paraArray = NULL; + paraArray = cJSON_CreateArray(); + if (paraArray == NULL) { + return -1; + } + + cJSON_AddItemToObject(newItem, "path", cJSON_CreateString(PATH_VALUE)); + cJSON_AddItemToObject(newItem, "runtimeArges", paraArray); + + return 0; +} + +int CreateRuntimes(cJSON *root) +{ + cJSON *runtimes = cJSON_CreateObject(); + if (runtimes == NULL) { + return -1; + } + cJSON_AddItemToObject(root, "runtimes", runtimes); + return CreateNode(runtimes); +} + +cJSON *CreateContent() +{ + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + return NULL; + } + + int ret = CreateRuntimes(root); + if (ret != 0) { + return NULL; + } + + return root; +} + +cJSON *InsertContent(const FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + JsonFileRead(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (!root) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + int ret; + if (runtimes == NULL) { + ret = CreateRuntimes(root); + } else { + ret = CreateNode(runtimes); + } + if (ret != 0) { + return NULL; + } + return root; +} + + +int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) +{ + cJSON *root = NULL; + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + root = CreateContent(); + } else { + root = InsertContent(pf); + fclose(pf); + } + + + if (root == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + return -1; + } + + fprintf(pf, "%s", cJSON_Print(root)); + fclose(pf); + + cJSON_Delete(root); + + return 0; +} + +/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ +int main() +{ + return DetectAndCreateJsonFile(JSON_FILE_PATH, TEMP_PATH); +} \ No newline at end of file -- Gitee From 3505f4ceabb95c5835380e8fffa01d989dd4b7f9 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 31 May 2020 15:03:38 +0800 Subject: [PATCH 013/296] Match-id-b3210f6463c7309d72f912f9aa7ff70a06498a5b --- install/deb/scripts/control | 6 ++++++ install/deb/scripts/postinst | 11 +++++++++++ install/deb/src/main.c | 16 +++++++++------- 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 install/deb/scripts/control create mode 100644 install/deb/scripts/postinst diff --git a/install/deb/scripts/control b/install/deb/scripts/control new file mode 100644 index 0000000..08b4b92 --- /dev/null +++ b/install/deb/scripts/control @@ -0,0 +1,6 @@ +Package: ascenddockertool +Maintainer: zhanou +Architecture: all +Version: 1.0.0 +Description: asenddockertool. + The asend docker tool help usr to modify a customed deamon.json. diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst new file mode 100644 index 0000000..9108644 --- /dev/null +++ b/install/deb/scripts/postinst @@ -0,0 +1,11 @@ +#! /bin/bash +DIR=/etc/docker +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +${DIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "create damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "create damom.json success\n" diff --git a/install/deb/src/main.c b/install/deb/src/main.c index ba5623f..4e9a62b 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -9,9 +9,9 @@ #include #define MAX_JSON_FILE_SIZE 65535 -#define JSON_FILE_PATH "/etc/docker/daemon.json" -#define TEMP_PATH "/etc/docker/daemon.json.back" -#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" +#define NUM_ARGS 3 +#define FINAL_INDEX 1 +#define TENP_INDEX 2 void JsonFileRead(const FILE *pf, char *text, int maxBufferSize) { @@ -114,10 +114,9 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) root = CreateContent(); } else { root = InsertContent(pf); - fclose(pf); + fclose(pf); } - if (root == NULL) { fprintf(stderr, "error: failed to create json\n"); return -1; @@ -138,7 +137,10 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) } /* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ -int main() +int main(int argc, char *argv[]) { - return DetectAndCreateJsonFile(JSON_FILE_PATH, TEMP_PATH); + if (argc != NUM_ARGS) { + return -1; + } + return DetectAndCreateJsonFile(argv[1], argv[2]); } \ No newline at end of file -- Gitee From af96d834d4c7e01b455d6e683bd12c210c5b3b40 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 31 May 2020 15:13:55 +0800 Subject: [PATCH 014/296] Match-id-11dcaa03119b74b6bb55e0583e9de076dcf4e7ea --- install/deb/src/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 4e9a62b..f149f5b 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -1,7 +1,6 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker - * auther: z00378930 zhang ou aka snake */ #include "cJSON.h" #include @@ -10,16 +9,17 @@ #define MAX_JSON_FILE_SIZE 65535 #define NUM_ARGS 3 -#define FINAL_INDEX 1 -#define TENP_INDEX 2 +#define FINAL_FILE_INDEX 1 +#define TEMP_FILE_INDEX 2 -void JsonFileRead(const FILE *pf, char *text, int maxBufferSize) +void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) { fseek(pf, 0, SEEK_END); int size = (int)ftell(pf); if (size >= maxBufferSize) { fprintf(stderr, "file size too large\n"); + return; } fseek(pf, 0, SEEK_SET); @@ -82,7 +82,7 @@ cJSON *CreateContent() cJSON *InsertContent(const FILE *pf) { char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - JsonFileRead(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); cJSON *root = NULL; root = cJSON_Parse(jsonStr); if (!root) { @@ -114,7 +114,7 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) root = CreateContent(); } else { root = InsertContent(pf); - fclose(pf); + fclose(pf); } if (root == NULL) { @@ -142,5 +142,5 @@ int main(int argc, char *argv[]) if (argc != NUM_ARGS) { return -1; } - return DetectAndCreateJsonFile(argv[1], argv[2]); + return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); } \ No newline at end of file -- Gitee From c9cfc3d99714890690be06850b10a0b934d8fbd9 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 1 Jun 2020 19:38:05 +0800 Subject: [PATCH 015/296] Match-id-96fe46406718e773b7792790d32f2bc675375a1a --- install/deb/scripts/control | 2 +- install/deb/scripts/postinst | 5 +-- install/rpm/ascend-docker-plgugin.spec | 45 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 install/rpm/ascend-docker-plgugin.spec diff --git a/install/deb/scripts/control b/install/deb/scripts/control index 08b4b92..fbab54c 100644 --- a/install/deb/scripts/control +++ b/install/deb/scripts/control @@ -1,5 +1,5 @@ Package: ascenddockertool -Maintainer: zhanou +Maintainer: huawei Architecture: all Version: 1.0.0 Description: asenddockertool. diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst index 9108644..0e2b5c6 100644 --- a/install/deb/scripts/postinst +++ b/install/deb/scripts/postinst @@ -1,8 +1,9 @@ -#! /bin/bash +#!/bin/bash DIR=/etc/docker SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" -${DIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} +BINDIR=/usr/local/bin +${BINDIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} if [ "$?" != "0" ]; then echo "create damon.json failed\n" exit 1 diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec new file mode 100644 index 0000000..674ff52 --- /dev/null +++ b/install/rpm/ascend-docker-plgugin.spec @@ -0,0 +1,45 @@ +Name: ascenddockerplugin +Version: 1.0.0 +Release: 1 +BuildArch: noarch +Summary: simple RPM package +License: FIXME + +%define _binaries_in_noarch_packages_terminate_build 0 + +%description +ascend-docker-plugin helps usrs to use NPU in docker + +%prep + +%build + +%install +mkdir -p %{buildroot}/usr/local/bin/ +cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/local/bin/ + +%pre + +%post +#!/bin/bash +DIR=/etc/docker +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +BINDIR=/usr/local/bin +${BINDIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "create damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "create damom.json success\n" + +%preun + +%postun + +%clean + +%files +%defattr(0755,root,root,0755) +/usr/local/bin/* -- Gitee From 396df6e2ea44ccb7a09c8657357d3fa0c1ff7127 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 1 Jun 2020 10:09:17 +0800 Subject: [PATCH 016/296] Match-id-211a5acee295801abbb9cb3fd85a2877e35002ed --- cli/src/main.c | 19 +++++++++++++++++++ cli/test/testcase/gtest_mytestcase.cpp | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/cli/src/main.c b/cli/src/main.c index 19d78d8..00f9d53 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -20,6 +20,7 @@ #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" #define DEVMM_SVM_PATH "/dev/devmm_svm" #define HISI_HDC_PATH "/dev/hisi_hdc" +#define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 #define ALLOW_PATH "/devices.allow" @@ -309,6 +310,18 @@ int DoCtrlDeviceMounting(const char *rootfs) return 0; } +int DoDirectoryMounting(const char *rootfs) +{ + /* directory */ + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NODEV | MS_NOSUID; + int ret = MountFiles(rootfs, ASCEND_DRIVER_PATH, reMountRwFlag); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); + return -1; + } + return 0; +} + int DoMounting(const struct CmdArgs *args) { int ret; @@ -325,6 +338,12 @@ int DoMounting(const struct CmdArgs *args) return -1; } + ret = DoDirectoryMounting(args->rootfs); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount directory\n"); + return -1; + } + return 0; } diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index b5450f4..58922f6 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -46,6 +46,7 @@ extern "C" int SetupCgroup(struct CmdArgs *args, const char *cgroupPath); extern "C" int SetupMounts(struct CmdArgs *args); extern "C" void FreeCmdArgs(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); +extern "C" int DoMounting(const struct CmdArgs *args); struct CmdArgs { char *devices; @@ -105,6 +106,11 @@ int Stub_DoCtrlDeviceMounting_Success(const char *rootfs) return 0; } +int Stub_DoMounting_Success(const struct CmdArgs *args) +{ + return 0; +} + int Stub_SetupCgroup_Success(struct CmdArgs *args, const char *cgroupPath) { return 0; @@ -647,6 +653,22 @@ TEST(SetupMounts, Status6) MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Success)); int ret = SetupMounts(&args); GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(SetupMounts, Status7) +{ + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); + MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); + MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Success)); + int ret = SetupMounts(&args); + GlobalMockObject::verify(); EXPECT_EQ(0, ret); } -- Gitee From ce562d8ec05b366def38fa0612c859f202bf4acf Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 1 Jun 2020 22:58:01 +0800 Subject: [PATCH 017/296] Match-id-64dcb4a2d7ea2d07ecaa4f55cf7ecfe0554865b5 --- cli/src/main.c | 15 +- cli/test/testcase/gtest_mytestcase.cpp | 475 ++++++++++++++++++------- 2 files changed, 354 insertions(+), 136 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 00f9d53..03ad3e8 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -210,6 +210,11 @@ int GetParentPathStr(const char *path, int lenOfPath, char *parent) return 0; } +int MakeDir(char * dir, int mode) +{ + return mkdir(dir, mode); +} + int MakeParentDir(char *path, mode_t mode) { if (*path == '\0' || *path == '.') { @@ -227,11 +232,9 @@ int MakeParentDir(char *path, mode_t mode) int ret = stat(path, &s); if (ret < 0) { fprintf(stderr, "error: failed to stat path: %s\n", path); - return (mkdir(path, mode)); - } - if (S_ISDIR(s.st_mode)) { - return 0; + return (MakeDir(path, mode)); } + return 0; } int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag) @@ -262,7 +265,7 @@ int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag } if (CheckDirExists(dst, strlen(dst)) < 0) { const mode_t curMode = srcStat.st_mode; - ret = mkdir(dst, curMode); + ret = MakeDir(dst, curMode); if (ret < 0) { fprintf(stderr, "error: failed to make dir: %s\n", dst); return -1; @@ -595,7 +598,7 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) return 0; } -static int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) +int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index 58922f6..e195972 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -23,6 +23,7 @@ extern "C" int stat(const char *file_name, struct stat *buf); extern "C" int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); extern "C" int rmdir(const char *pathname); +extern "C" int MakeDir(char * dir, int mode); extern "C" int EnterNsByFd(int fd, int nsType); extern "C" int StrHasPrefix(const char *str, const char *prefix); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); @@ -47,6 +48,8 @@ extern "C" int SetupMounts(struct CmdArgs *args); extern "C" void FreeCmdArgs(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); extern "C" int DoMounting(const struct CmdArgs *args); +extern "C" int DoDirectoryMounting(const char *rootfs); +extern "C" int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config); struct CmdArgs { char *devices; @@ -64,29 +67,94 @@ int Stub_EnterNsByFd_Success(int fd, int nsType) return 0; } -int stub_open(const char *path, int flags) +int Stub_EnterNsByFd_Failed(int fd, int nsType) +{ + return -1; +} + +int stub_open_success(const char *path, int flags) { return 0; } +int stub_open_failed(const char *path, int flags) +{ + return -1; +} + +int stub_close_success(int fd) +{ + return 0; +} + +int stub_MakeDir_success(char * dir, int mode) +{ + return 0; +} + +int stub_MakeDir_failed(char * dir, int mode) +{ + return -1; +} + int stub_mount_success(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { return 0; } -int stub_MountDevice(const char *rootfs, const int serialNumber) +int stub_mount_failed(const char *source, const char *target, + const char *filesystemtype, unsigned long mountflags, const void *data) +{ + return -1; +} + +int stub_stat_success(const char *file_name, struct stat *buf) +{ + return 0; +} + +int stub_stat_failed(const char *file_name, struct stat *buf) +{ + return -1; +} + +int Stub_MountDevice_Success(const char *rootfs, const int serialNumber) +{ + return 0; +} + +int Stub_MountDevice_Failed(const char *rootfs, const int serialNumber) +{ + return -1; +} + +int Stub_MountFiles_Success(const char *rootfs, const char *file, unsigned long reMountRwFlag) { return 0; } -int stub_MountFiles_success(const char *rootfs, const char *file, unsigned long reMountRwFlag) +int Stub_MountFiles_Failed(const char *rootfs, const char *file, unsigned long reMountRwFlag) +{ + return -1; +} + +int Stub_CheckDirExists_Success(char *dir, int len) { return 0; } +int Stub_MakeParentDir_Success(char *path, mode_t mode) +{ + return 0; +} -int stub_CheckDirExists_fail(char *dir, int len) +int Stub_MakeParentDir_Failed(char *path, mode_t mode) +{ + return -1; +} + +int Stub_CheckDirExists_Failed(char *dir, int len) { return -1; } @@ -96,32 +164,92 @@ int Stub_EnterNsByPath_Success(const char *path, int nsType) return 0; } +int Stub_EnterNsByPath_Failed(const char *path, int nsType) +{ + return 0; +} + int Stub_DoDeviceMounting_Success(const char *rootfs, const char *devicesList) { return 0; } +int Stub_DoDeviceMounting_Failed(const char *rootfs, const char *devicesList) +{ + return -1; +} + int Stub_DoCtrlDeviceMounting_Success(const char *rootfs) { return 0; } +int Stub_DoCtrlDeviceMounting_Failed(const char *rootfs) +{ + return -1; +} + +int Stub_DoDirectoryMounting_Success(const char *rootfs) +{ + return 0; +} + +int Stub_DoDirectoryMounting_Failed(const char *rootfs) +{ + return -1; +} + int Stub_DoMounting_Success(const struct CmdArgs *args) { return 0; } +int Stub_DoMounting_Failed(const struct CmdArgs *args) +{ + return -1; +} + int Stub_SetupCgroup_Success(struct CmdArgs *args, const char *cgroupPath) { return 0; } +int Stub_SetupCgroup_Failed(struct CmdArgs *args, const char *cgroupPath) +{ + return 0; +} + int Stub_SetupMounts_Success(struct CmdArgs *args) { return 0; } +int Stub_SetupDeviceCgroup_Success(FILE *cgroupAllow, const char *devPath) +{ + return 0; +} + +int Stub_SetupDeviceCgroup_Failed(FILE *cgroupAllow, const char *devPath) +{ + return -1; +} + int Stub_SetupDriverCgroup_Fail(FILE *cgroupAllow) +{ + return -1; +} + +int Stub_SetupDriverCgroup_Success(FILE *cgroupAllow) +{ + return 0; +} + +int Stub_DoPrepare_Failed(const struct CmdArgs *args, struct ParsedConfig *config) +{ + return -1; +} + +int Stub_DoPrepare_Success(const struct CmdArgs *args, struct ParsedConfig *config) { return 0; } @@ -186,9 +314,7 @@ TEST(EnterNsByPath, Status1) { char containerNsPath[BUF_SIZE] = {0}; int nsType = 1; - MOCKER(open) - .stubs() - .will(invoke(stub_open)); + MOCKER(open).stubs().will(invoke(stub_open_success)); int ret = EnterNsByPath(containerNsPath, nsType); GlobalMockObject::verify(); EXPECT_LE(-1, ret); @@ -242,30 +368,45 @@ TEST(MountDevice, Status1) { char *rootfs="/home"; MOCKER(mount).stubs().will(invoke(stub_mount_success)); + MOCKER(stat).stubs().will(invoke(stub_stat_success)); + MOCKER(close).stubs().will(invoke(stub_close_success)); + MOCKER(open).stubs().will(invoke(stub_open_success)); int serialNumber = 0; + EXPECT_EQ(0, MountDevice(rootfs, serialNumber)); GlobalMockObject::verify(); - EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); } -TEST(MountDevice, Status11) +TEST(MountDevice, Status2) { char *rootfs="/home/notexists"; int serialNumber = 0; EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); } -TEST(MountDevice, Status2) +TEST(MountDevice, Status3) { - char *rootfs="../testcase/data"; -// char *rootfs="/home/zhouhongyu/DT/ascend-docker-cli/test/build/testcase/data"; + char *rootfs="/home"; + MOCKER(stat).stubs().will(invoke(stub_stat_success)); + MOCKER(close).stubs().will(invoke(stub_close_success)); + MOCKER(open).stubs().will(invoke(stub_open_success)); + MOCKER(mount).stubs().will(invoke(stub_mount_failed)); int serialNumber = 0; EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); + GlobalMockObject::verify(); +} + +TEST(MountDevice, Status4) +{ + char *rootfs="/home"; + MOCKER(mount).stubs().will(invoke(stub_mount_success)); + MOCKER(stat).stubs().will(invoke(stub_stat_failed)); + int serialNumber = 0; + GlobalMockObject::verify(); + EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); } TEST(DoDeviceMounting, Status1) { - MOCKER(MountDevice) - .stubs() - .will(invoke(stub_MountDevice)); + MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; char *devicesList = "1,2"; int ret = DoDeviceMounting(rootfs, devicesList); @@ -273,6 +414,92 @@ TEST(DoDeviceMounting, Status1) EXPECT_EQ(0, ret); } +TEST(DoDeviceMounting, Status2) +{ + MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Failed)); + char *rootfs = "/home"; + char *devicesList = "1,2"; + int ret = DoDeviceMounting(rootfs, devicesList); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoDirectoryMounting, Status1) +{ + MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Failed)); + char *rootfs = "/home"; + int ret = DoDirectoryMounting(rootfs); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoDirectoryMounting, Status2) +{ + MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Success)); + char *rootfs = "/home"; + int ret = DoDirectoryMounting(rootfs); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(DoMounting, Status1) +{ + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Failed)); + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + int ret = DoMounting(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoMounting, Status2) +{ + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + int ret = DoMounting(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoMounting, Status3) +{ + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Failed)); + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + int ret = DoMounting(&args); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoMounting, Status4) +{ + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Success)); + struct CmdArgs args = { + .devices = "1,2", + .rootfs = "/home", + .pid = 1 + }; + int ret = DoMounting(&args); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + + TEST(CheckDirExists, Status1) { char *dir = "/home"; @@ -281,6 +508,14 @@ TEST(CheckDirExists, Status1) EXPECT_EQ(0, ret); } +TEST(CheckDirExists, Status2) +{ + char *dir = "/home/notexist"; + int len = strlen(dir); + int ret = CheckDirExists(dir, len); + EXPECT_EQ(-1, ret); +} + TEST(GetParentPathStr, Status1) { char *path = "/usr/bin"; @@ -292,7 +527,6 @@ TEST(GetParentPathStr, Status1) TEST(MakeParentDir, Status1) { - char *path = "/home/test1/test2"; mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; int ret = MakeParentDir(parentDir, mode); @@ -301,126 +535,97 @@ TEST(MakeParentDir, Status1) TEST(MakeParentDir, Status2) { - char *pathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/abcd"; mode_t mode = 0755; - char *path = NULL; - path = strdup(pathData); - int ret = MakeParentDir(path, mode); - rmdir(path); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/"); + char parentDir[BUF_SIZE] = {0}; + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Success)); + int ret = MakeParentDir(parentDir, mode); + GlobalMockObject::verify(); EXPECT_EQ(0, ret); } TEST(MakeParentDir, Status3) { - char *pathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/abcd"; + char *pathData = "/path/abc/abcd"; mode_t mode = 0755; char *path = NULL; path = strdup(pathData); + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(stat).stubs().will(invoke(stub_stat_success)); int ret = MakeParentDir(path, mode); ret = MakeParentDir(path, mode); - rmdir(path); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/build/abc/"); + GlobalMockObject::verify(); EXPECT_EQ(0, ret); } TEST(MountFiles, Status1) { - MOCKER(MountDevice) - .stubs() - .will(invoke(stub_MountDevice)); - MOCKER(mount).stubs().will(invoke(stub_mount_success)); - char *rootfs = "../testcase/data/dev"; + MOCKER(stat).stubs().will(invoke(stub_stat_failed)); + char *rootfs = "/dev"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); - umount("../testcase/data/dev" DAVINCI_MANAGER_PATH); - rmdir("../testcase/data/dev" DAVINCI_MANAGER_PATH); GlobalMockObject::verify(); - EXPECT_EQ(0, ret); -} - -TEST(MountFiles, Status11) -{ - char *rootfs = "../testcase/data/dev"; - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); - umount("../testcase/data/dev" DAVINCI_MANAGER_PATH); - rmdir("../testcase/data/dev" DAVINCI_MANAGER_PATH); EXPECT_EQ(-1, ret); } TEST(MountFiles, Status2) { - char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev"; - char *rootfs = NULL; - rootfs = strdup(rootfsData); - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; - int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); - umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev" DAVINCI_MANAGER_PATH); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/dev" DAVINCI_MANAGER_PATH); + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(MakeParentDir).stubs().will(invoke(Stub_MakeParentDir_Failed)); + char *rootfs = "/rootfs"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, "/home", reMountRwFlag); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(MountFiles, Status3) { - char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; - char *rootfs = NULL; - rootfs = strdup(rootfsData); - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; - int ret = MountFiles(rootfs, "/usr", reMountRwFlag); - umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(MakeDir).stubs().will(invoke(stub_MakeDir_failed)); + char *rootfs = "/rootfs"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, "/home", reMountRwFlag); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(MountFiles, Status4) { - char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; - char *rootfs = NULL; - rootfs = strdup(rootfsData); - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; - int ret = MountFiles(rootfs, "/notexist1/notexist2", reMountRwFlag); - umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(MakeParentDir).stubs().will(invoke(Stub_MakeParentDir_Success)); + MOCKER(mount).stubs().will(invoke(stub_mount_failed)); + char *rootfs = "/rootfs"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, "/home", reMountRwFlag); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(MountFiles, Status5) { - char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"; - char *rootfs = NULL; - rootfs = strdup(rootfsData); - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; - int ret = MountFiles(rootfs, "/notexist2", reMountRwFlag); - umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); - EXPECT_EQ(-1, ret); -} - -TEST(MountFiles, Status6) -{ - MOCKER(CheckDirExists).stubs().will(invoke(stub_CheckDirExists_fail)); - char *rootfsData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr1"; - char *rootfs = NULL; - rootfs = strdup(rootfsData); - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT; - int ret = MountFiles(rootfs, "/usr", reMountRwFlag); - umount("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); - rmdir("/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/usr"); + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(open).stubs().will(invoke(stub_open_success)); + MOCKER(close).stubs().will(invoke(stub_close_success)); + MOCKER(mount).stubs().will(invoke(stub_mount_success)); + char *rootfs = "/rootfs"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountFiles(rootfs, "/dev/random", reMountRwFlag); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } TEST(DoCtrlDeviceMounting, Status1) { char *rootfs = "/home"; + MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Failed)); int ret = DoCtrlDeviceMounting(rootfs); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(DoCtrlDeviceMounting, Status2) { - MOCKER(MountFiles).stubs().will(invoke(stub_MountFiles_success)); + MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Success)); char *rootfs = "/home"; int ret = DoCtrlDeviceMounting(rootfs); GlobalMockObject::verify(); @@ -451,7 +656,7 @@ TEST(GetCgroupRoot, Status1) TEST(CatFileContent, Status1) { - char *mountPath= "./data/mountinfo.txt"; + char *mountPath= "/not_exist_dir/mountinfo.txt"; char mount[BUF_SIZE] = {0x0}; int ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); EXPECT_EQ(-1, ret); @@ -459,46 +664,61 @@ TEST(CatFileContent, Status1) TEST(SetupDeviceCgroup, Status1) { - char *cgroupPathData = "../testcase/data/devices.allow"; + char *cgroupPathData = "devices.allow"; char *cgroupPath = NULL; cgroupPath = strdup(cgroupPathData); FILE *cgroupAllow = NULL; cgroupAllow = fopen(cgroupPath, "a"); + MOCKER(stat).stubs().will(invoke(stub_stat_failed)); int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); - fclose(cgroupAllow); - EXPECT_EQ(0, ret); + if (cgroupAllow != NULL) { + fclose(cgroupAllow); + } + EXPECT_EQ(-1, ret); } TEST(SetupDeviceCgroup, Status2) { - char *cgroupPathData = "../testcase/data/devices1.allow"; + char *cgroupPathData = "/not_exist_dir/devices1.allow"; char *cgroupPath = NULL; cgroupPath = strdup(cgroupPathData); FILE *cgroupAllow = NULL; cgroupAllow = fopen(cgroupPath, "a"); + MOCKER(stat).stubs().will(invoke(stub_stat_success)); int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); - fclose(cgroupAllow); - EXPECT_EQ(0, ret); + if (cgroupAllow != NULL) { + fclose(cgroupAllow); + } + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); } TEST(SetupDriverCgroup, Status1) { - char *cgroupPath = "../testcase/data/devices.allow"; + char *cgroupPath = "devices.allow"; FILE *cgroupAllow = NULL; cgroupAllow = fopen(cgroupPath, "a"); + MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); int ret = SetupDriverCgroup(cgroupAllow); - fclose(cgroupAllow); + if (cgroupAllow != NULL) { + fclose(cgroupAllow); + } + GlobalMockObject::verify(); EXPECT_EQ(0, ret); } TEST(SetupDriverCgroup, Status2) { - char *cgroupPath = "../testcase/data/devices1.allow"; + char *cgroupPath = "devices1.allow"; FILE *cgroupAllow = NULL; cgroupAllow = fopen(cgroupPath, "a"); + MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Failed)); int ret = SetupDriverCgroup(cgroupAllow); - fclose(cgroupAllow); - EXPECT_EQ(0, ret); + if (cgroupAllow != NULL) { + fclose(cgroupAllow); + } + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); } TEST(GetCgroupPath, Status1) @@ -521,8 +741,9 @@ TEST(SetupCgroup, Status1) .rootfs = "/home", .pid = 1 }; - - char cgroupPath[BUF_SIZE] = {0}; + char *cgroupPathData = "/not_exist_dir/cgroup_path"; + char *cgroupPath = NULL; + cgroupPath = strdup(cgroupPathData); int ret = SetupCgroup(&args, cgroupPath); EXPECT_EQ(-1, ret); } @@ -534,10 +755,12 @@ TEST(SetupCgroup, Status2) .rootfs = "/home", .pid = 1 }; - char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/data/devices.allow"; + char *cgroupPathData = "devices.allow"; char *cgroupPath = strdup(cgroupPathData); + MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Fail)); int ret = SetupCgroup(&args, cgroupPath); - EXPECT_EQ(0, ret); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); } TEST(SetupCgroup, Status3) @@ -547,27 +770,29 @@ TEST(SetupCgroup, Status3) .rootfs = "/home", .pid = 1 }; - char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/"; + char *cgroupPathData = "devices.allow"; char *cgroupPath = strdup(cgroupPathData); + MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); + MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Failed)); int ret = SetupCgroup(&args, cgroupPath); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(SetupCgroup, Status4) { - MOCKER(SetupDriverCgroup) - .stubs() - .will(invoke(Stub_SetupDriverCgroup_Fail)); + MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); + MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); struct CmdArgs args = { .devices = "1,2", .rootfs = "/home", .pid = 1 }; - char *cgroupPathData = "/home/zhouhongyu/DT/ascend-docker-cli/test/testcase/"; + char *cgroupPathData = "devices.allow"; char *cgroupPath = strdup(cgroupPathData); int ret = SetupCgroup(&args, cgroupPath); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } TEST(SetupMounts, Status1) @@ -577,7 +802,9 @@ TEST(SetupMounts, Status1) .rootfs = "/home", .pid = 1 }; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Failed)); int ret = SetupMounts(&args); + GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -588,7 +815,8 @@ TEST(SetupMounts, Status2) .rootfs = "/home", .pid = 1 }; - MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); + MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Failed)); int ret = SetupMounts(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -601,8 +829,9 @@ TEST(SetupMounts, Status3) .rootfs = "/home", .pid = 1 }; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); - MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Failed)); int ret = SetupMounts(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -615,9 +844,10 @@ TEST(SetupMounts, Status4) .rootfs = "/home", .pid = 1 }; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); - MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); - MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); + MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Failed)); int ret = SetupMounts(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -630,10 +860,11 @@ TEST(SetupMounts, Status5) .rootfs = "/home", .pid = 1 }; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); - MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); - MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); + MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Failed)); int ret = SetupMounts(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -646,23 +877,7 @@ TEST(SetupMounts, Status6) .rootfs = "/home", .pid = 1 }; - MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); - MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); - MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); - MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); - MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Success)); - int ret = SetupMounts(&args); - GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); -} - -TEST(SetupMounts, Status7) -{ - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); -- Gitee From 18fcecc02d4091eece20af7a88eba32f476aa33e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 1 Jun 2020 23:11:04 +0800 Subject: [PATCH 018/296] Match-id-955019847965808fc548ea017c7e1623abedfbe3 --- cli/src/main.c | 2 +- cli/test/testcase/gtest_mytestcase.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 03ad3e8..fba2f32 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -210,7 +210,7 @@ int GetParentPathStr(const char *path, int lenOfPath, char *parent) return 0; } -int MakeDir(char * dir, int mode) +int MakeDir(char *dir, int mode) { return mkdir(dir, mode); } diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/testcase/gtest_mytestcase.cpp index e195972..3a59593 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/testcase/gtest_mytestcase.cpp @@ -23,7 +23,7 @@ extern "C" int stat(const char *file_name, struct stat *buf); extern "C" int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); extern "C" int rmdir(const char *pathname); -extern "C" int MakeDir(char * dir, int mode); +extern "C" int MakeDir(char *dir, int mode); extern "C" int EnterNsByFd(int fd, int nsType); extern "C" int StrHasPrefix(const char *str, const char *prefix); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); @@ -87,12 +87,12 @@ int stub_close_success(int fd) return 0; } -int stub_MakeDir_success(char * dir, int mode) +int stub_MakeDir_success(char *dir, int mode) { return 0; } -int stub_MakeDir_failed(char * dir, int mode) +int stub_MakeDir_failed(char *dir, int mode) { return -1; } @@ -104,7 +104,7 @@ int stub_mount_success(const char *source, const char *target, } int stub_mount_failed(const char *source, const char *target, - const char *filesystemtype, unsigned long mountflags, const void *data) + const char *filesystemtype, unsigned long mountflags, const void *data) { return -1; } -- Gitee From 771c1dc0f2d6038d6483b69c72ea3740bb353d7d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 4 Jun 2020 10:15:24 +0800 Subject: [PATCH 019/296] Match-id-31a2cf5de79e2257afa7f0702b4667c98ae79f1e --- build/build.sh | 119 +++++++++++++++++++++++++++++++++++++++++ ci/dependency.xml | 36 +++++++++++++ install/deb/src/main.c | 1 + opensource/README.MD | 1 + output/README.MD | 1 + 5 files changed, 158 insertions(+) create mode 100644 build/build.sh create mode 100644 ci/dependency.xml create mode 100644 opensource/README.MD create mode 100644 output/README.MD diff --git a/build/build.sh b/build/build.sh new file mode 100644 index 0000000..5ab1c27 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +ROOT=$(cd `dirname $0`; pwd)/.. + +OPENSRC=${ROOT}/opensource +OUTPUT=${ROOT}/output +BUILD=${ROOT}/build + +CLIDIR=${ROOT}/cli +CLISRCNAME="main.c" + +INSTALLHELPERDIR=${ROOT}/install +INSTALLHELPERSRCNAME="main.c" + +HOOKDIR=${ROOT}/hook +HOOKSRCNAME="main.go" + +RUNTIMEDIR=${ROOT}/runtime +RUNTIMESRCNAME="main.go" + +DEBPACK=${ROOT}/debpack +BINDIR=${DEBPACK}/usr/local/bin +DEBDIR=${DEBPACK}/DEBIAN + +RPMPACK=${ROOT}/rpmpack +RPMSOURCESDIR=${RPMPACK}/SOURCES +RPMSPECDIR=${RPMPACK}/SPECS + + +CLISRCPATH=`find ${CLIDIR} -name "${CLISRCNAME}"` +CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} +INSTALLHELPERSRCPATH=`find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}"` +INSTALLHELPERSRCDIR=${INSTALLHELPERSRCPATH%/${INSTALLHELPERSRCNAME}} +HOOKSRCPATH=`find ${HOOKDIR} -name "${HOOKSRCNAME}"` +HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} +RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` +RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} + +funcbuild(){ +echo "make cli" +[ -d "${CLISRCDIR}/build" ]&&rm -rf ${CLISRCDIR}/build +mkdir ${CLISRCDIR}/build&&cd ${CLISRCDIR}/build +cmake ../ +make clean +make + +echo "make runtime" +[ -d "${INSTALLHELPERSRCDIR}/build" ]&&rm -rf ${INSTALLHELPERSRCDIR}/build +mkdir ${INSTALLHELPERSRCDIR}/build&&cd ${INSTALLHELPERSRCDIR}/build +cmake ../ +make clean +make + +[ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build +mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build +go build ../${HOOKSRCNAME} +mv main ascend-docker-hook + +[ -d "${RUNTIMESRCDIR}/build" ]&&rm -rf ${RUNTIMESRCDIR}/build +mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build +go build ../${RUNTIMESRCNAME} +mv main ascend-docker-runtime +} + +funcmakedeb(){ +cd ${BUILD} +mkdir -pv {${DEBDIR},${BINDIR}} +/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${BINDIR} +CONPATH=`find ${INSTALLHELPERDIR} -name "control"` +INSTPATH=`find ${INSTALLHELPERDIR} -name "postinst"` +/bin/cp -f ${CONPATH} ${INSTPATH} ${DEBDIR} +echo ${INSTPATH} +chmod 555 ${DEBDIR}/postinst +dpkg-deb -b ${DEBPACK} ascenddockertool_1.0.0_i386.deb +DEBS=`find ${BUILD} -name "*.deb"` +/bin/cp ${DEBS} ${OUTPUT} +} + +funcmakerpm(){ +mkdir -pv ${RPMPACK}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} +/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${RPMSOURCESDIR} +SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` +dos2unix ${SPECPATH} +/bin/cp -f ${SPECPATH} ${RPMSPECDIR} +rpmbuild --define "_topdir ${RPMPACK}" +rpmbuild --showrc | grep topdir +echo ${RPMPACK} +echo "%_topdir ${RPMPACK}" > ~/.rpmmacros +rpmbuild -bb ${RPMPACK}/SPECS/ascend-docker-plgugin.spec +RPMS=`find ${RPMPACK} -name "*.rpm"` +/bin/cp ${RPMS} ${OUTPUT} +} + +funcmakeclean(){ +[ -d "${RPMPACK}" ]&&rm -rf ${RPMPACK} +[ -d "${DEBPACK}" ]&&rm -rf ${DEBPACK} +} + +funcmakepull(){ +cd ${OPENSRC} +wget -O cJSON.tar.gz https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz --no-check-certificate +} + +funcmakeunzip(){ +cd ${OPENSRC} +tar -xzvf cJSON.tar.gz +CJSONS=`find . -name "cJSON.*"` +CJSONSLIB=`find ${INSTALLHELPERDIR} -name cjson -type d` +/bin/cp -f ${CJSONS} ${CJSONSLIB} +} + +funcmakeclean +if [ $1 == "pull" ]; then +funcmakepull +fi +funcmakeunzip +funcbuild +funcmakerpm +funcmakedeb diff --git a/ci/dependency.xml b/ci/dependency.xml new file mode 100644 index 0000000..d58862d --- /dev/null +++ b/ci/dependency.xml @@ -0,0 +1,36 @@ + + + + Component + Generic + + Atlas Platform + ascend-docker-plugin + 1.0.0 + + N + + + output/ + + + + + + + + 3rd-party + Generic + + cJSON-1.7.13.tar.gz + 05834SXQ + + + + /* + opensource + + + + + diff --git a/install/deb/src/main.c b/install/deb/src/main.c index f149f5b..856ce0c 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -11,6 +11,7 @@ #define NUM_ARGS 3 #define FINAL_FILE_INDEX 1 #define TEMP_FILE_INDEX 2 +#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) { diff --git a/opensource/README.MD b/opensource/README.MD new file mode 100644 index 0000000..7f17201 --- /dev/null +++ b/opensource/README.MD @@ -0,0 +1 @@ +put 3rd-party dependency here \ No newline at end of file diff --git a/output/README.MD b/output/README.MD new file mode 100644 index 0000000..09b35f5 --- /dev/null +++ b/output/README.MD @@ -0,0 +1 @@ +locate the output files \ No newline at end of file -- Gitee From 8a1e8a56223965926681b3ad14cead0b889d211b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 4 Jun 2020 14:07:14 +0800 Subject: [PATCH 020/296] Match-id-f760308402e936a028c4adfe550e58f2f3c17fe9 --- build/build.sh | 8 +++++++- install/deb/scripts/postinst | 3 +++ install/rpm/ascend-docker-plgugin.spec | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 5ab1c27..b491eb6 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,5 +1,6 @@ #!/bin/bash + ROOT=$(cd `dirname $0`; pwd)/.. OPENSRC=${ROOT}/opensource @@ -51,6 +52,11 @@ cmake ../ make clean make +[ -d "${ROOT}/opensource/src" ]&&rm -rf ${ROOT}/opensource/src +mkdir ${ROOT}/opensource/src +/bin/cp -rf ${HOOKSRCDIR}/vendor/* ${ROOT}/opensource/src +export GOPATH="${GOPATH}:${ROOT}/opensource" + [ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build go build ../${HOOKSRCNAME} @@ -103,7 +109,7 @@ wget -O cJSON.tar.gz https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz funcmakeunzip(){ cd ${OPENSRC} -tar -xzvf cJSON.tar.gz +tar -xzvf cJSON*.tar.gz CJSONS=`find . -name "cJSON.*"` CJSONSLIB=`find ${INSTALLHELPERDIR} -name cjson -type d` /bin/cp -f ${CJSONS} ${CJSONSLIB} diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst index 0e2b5c6..b7b36a6 100644 --- a/install/deb/scripts/postinst +++ b/install/deb/scripts/postinst @@ -1,5 +1,8 @@ #!/bin/bash DIR=/etc/docker +if [ ! -d "${DIR}" ]; then +mkdir ${DIR} +fi SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" BINDIR=/usr/local/bin diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 674ff52..adb0179 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -26,6 +26,9 @@ DIR=/etc/docker SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" BINDIR=/usr/local/bin +if [ ! -d "${DIR}" ]; then +mkdir ${DIR} +fi ${BINDIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} if [ "$?" != "0" ]; then echo "create damon.json failed\n" -- Gitee From 4a39d38aca0bcb3d0b1ea0d9a11cef9abe0b01ba Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 5 Jun 2020 15:37:53 +0800 Subject: [PATCH 021/296] Match-id-d2a1d5cb819a4384240491706637b9793c8da765 --- build/build.sh | 9 ++++++--- ci/dependency.xml | 2 +- install/deb/src/main.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/build.sh b/build/build.sh index b491eb6..8d00974 100644 --- a/build/build.sh +++ b/build/build.sh @@ -94,12 +94,15 @@ echo ${RPMPACK} echo "%_topdir ${RPMPACK}" > ~/.rpmmacros rpmbuild -bb ${RPMPACK}/SPECS/ascend-docker-plgugin.spec RPMS=`find ${RPMPACK} -name "*.rpm"` -/bin/cp ${RPMS} ${OUTPUT} -} +ARCH=`uname -m` +RPMSNAME=${RPMS##*/} +/bin/cp ${RPMS} ${OUTPUT}/${RPMSNAME}.${ARCH} + } funcmakeclean(){ [ -d "${RPMPACK}" ]&&rm -rf ${RPMPACK} [ -d "${DEBPACK}" ]&&rm -rf ${DEBPACK} +[ -d "${OUTPUT}" ]&&cd ${output}&&rm -rf * } funcmakepull(){ @@ -122,4 +125,4 @@ fi funcmakeunzip funcbuild funcmakerpm -funcmakedeb +#funcmakedeb diff --git a/ci/dependency.xml b/ci/dependency.xml index d58862d..8fea80e 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -5,7 +5,7 @@ Generic Atlas Platform - ascend-docker-plugin + ascend-docker-plugin 1.0.0 N diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 856ce0c..04da23e 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -49,7 +49,7 @@ int CreateNode(cJSON *runtimes) } cJSON_AddItemToObject(newItem, "path", cJSON_CreateString(PATH_VALUE)); - cJSON_AddItemToObject(newItem, "runtimeArges", paraArray); + cJSON_AddItemToObject(newItem, "runtimeArgs", paraArray); return 0; } -- Gitee From 3e79e7f65a390b984567bdcc5e613769b174e0d3 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 5 Jun 2020 17:46:11 +0800 Subject: [PATCH 022/296] Match-id-88fa3f6dbc102d5f289aae4de3a90875cdaa9f7f --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 8d00974..422bc15 100644 --- a/build/build.sh +++ b/build/build.sh @@ -102,7 +102,7 @@ RPMSNAME=${RPMS##*/} funcmakeclean(){ [ -d "${RPMPACK}" ]&&rm -rf ${RPMPACK} [ -d "${DEBPACK}" ]&&rm -rf ${DEBPACK} -[ -d "${OUTPUT}" ]&&cd ${output}&&rm -rf * +[ -d "${OUTPUT}" ]&&cd ${OUTPUT}&&rm -rf * } funcmakepull(){ -- Gitee From 7015ef2abb60bda0692499370f39dacea8820341 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 2 Jun 2020 20:14:23 +0800 Subject: [PATCH 023/296] Match-id-d63477aeeed6ecce1303bf643d612bbc5e0e46e3 --- hook/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook/main.go b/hook/main.go index 2f41783..8a5cfd1 100644 --- a/hook/main.go +++ b/hook/main.go @@ -66,7 +66,7 @@ func parseDevices(visibleDevices string) ([]int, error) { d = strings.TrimSpace(d) if strings.Contains(d, "-") { borders := strings.Split(d, "-") - if len(borders) < borderNum { + if len(borders) != borderNum { return nil, fmt.Errorf("invalid device range: %s", d) } -- Gitee From d870e512e460c5f73659dc623d4947e4c862ee46 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 5 Jun 2020 17:10:41 +0800 Subject: [PATCH 024/296] Match-id-166316a638ef119d6bcf9222fc5d52f1b73f6ada --- build/build.sh | 16 +- install/deb/scripts/postinst | 2 +- install/deb/scripts/prerm | 15 + install/deb/src/main.c | 374 +++++++++++++++---------- install/rpm/ascend-docker-plgugin.spec | 15 +- 5 files changed, 268 insertions(+), 154 deletions(-) create mode 100644 install/deb/scripts/prerm diff --git a/build/build.sh b/build/build.sh index 422bc15..493b486 100644 --- a/build/build.sh +++ b/build/build.sh @@ -74,29 +74,35 @@ mkdir -pv {${DEBDIR},${BINDIR}} /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${BINDIR} CONPATH=`find ${INSTALLHELPERDIR} -name "control"` INSTPATH=`find ${INSTALLHELPERDIR} -name "postinst"` -/bin/cp -f ${CONPATH} ${INSTPATH} ${DEBDIR} +RMPATH=`find ${INSTALLHELPERDIR} -name "prerm"` +/bin/cp -f ${CONPATH} ${INSTPATH} ${RMPATH} ${DEBDIR} echo ${INSTPATH} chmod 555 ${DEBDIR}/postinst +chmod 555 ${DEBDIR}/prerm dpkg-deb -b ${DEBPACK} ascenddockertool_1.0.0_i386.deb DEBS=`find ${BUILD} -name "*.deb"` /bin/cp ${DEBS} ${OUTPUT} } +funcfillarch(){ +CPUARCH=`uname -m` +sed -i "4a\BuildArch: $CPUARCH" ${RPMSPECDIR}/*.spec +} + funcmakerpm(){ mkdir -pv ${RPMPACK}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${RPMSOURCESDIR} SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` dos2unix ${SPECPATH} /bin/cp -f ${SPECPATH} ${RPMSPECDIR} +funcfillarch rpmbuild --define "_topdir ${RPMPACK}" rpmbuild --showrc | grep topdir echo ${RPMPACK} echo "%_topdir ${RPMPACK}" > ~/.rpmmacros rpmbuild -bb ${RPMPACK}/SPECS/ascend-docker-plgugin.spec RPMS=`find ${RPMPACK} -name "*.rpm"` -ARCH=`uname -m` -RPMSNAME=${RPMS##*/} -/bin/cp ${RPMS} ${OUTPUT}/${RPMSNAME}.${ARCH} +/bin/cp ${RPMS} ${OUTPUT} } funcmakeclean(){ @@ -125,4 +131,4 @@ fi funcmakeunzip funcbuild funcmakerpm -#funcmakedeb +#funcmakedeb \ No newline at end of file diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst index b7b36a6..f336a23 100644 --- a/install/deb/scripts/postinst +++ b/install/deb/scripts/postinst @@ -6,7 +6,7 @@ fi SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" BINDIR=/usr/local/bin -${BINDIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} +${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} if [ "$?" != "0" ]; then echo "create damon.json failed\n" exit 1 diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm new file mode 100644 index 0000000..089686d --- /dev/null +++ b/install/deb/scripts/prerm @@ -0,0 +1,15 @@ +#!/bin/bash +DIR=/etc/docker +if [ ! -d "${DIR}" ]; then +mkdir ${DIR} +fi +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +BINDIR=/usr/local/bin +${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "del damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "del damom.json success\n" diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 04da23e..3bf11ad 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -1,147 +1,229 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker -*/ -#include "cJSON.h" -#include -#include -#include - -#define MAX_JSON_FILE_SIZE 65535 -#define NUM_ARGS 3 -#define FINAL_FILE_INDEX 1 -#define TEMP_FILE_INDEX 2 -#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" - -void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) -{ - fseek(pf, 0, SEEK_END); - - int size = (int)ftell(pf); - if (size >= maxBufferSize) { - fprintf(stderr, "file size too large\n"); - return; - } - - fseek(pf, 0, SEEK_SET); - fread(text, sizeof(char), size, pf); - text[size] = '\0'; -} - -int CreateNode(cJSON *runtimes) -{ - cJSON *node = cJSON_GetObjectItem(runtimes, "ascend"); - if (node != NULL) { - return 0; - } - - cJSON *newItem = NULL; - newItem = cJSON_CreateObject(); - if (newItem == NULL) { - return -1; - } - cJSON_AddItemToObject(runtimes, "ascend", newItem); - - cJSON *paraArray = NULL; - paraArray = cJSON_CreateArray(); - if (paraArray == NULL) { - return -1; - } - - cJSON_AddItemToObject(newItem, "path", cJSON_CreateString(PATH_VALUE)); - cJSON_AddItemToObject(newItem, "runtimeArgs", paraArray); - - return 0; -} - -int CreateRuntimes(cJSON *root) -{ - cJSON *runtimes = cJSON_CreateObject(); - if (runtimes == NULL) { - return -1; - } - cJSON_AddItemToObject(root, "runtimes", runtimes); - return CreateNode(runtimes); -} - -cJSON *CreateContent() -{ - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - return NULL; - } - - int ret = CreateRuntimes(root); - if (ret != 0) { - return NULL; - } - - return root; -} - -cJSON *InsertContent(const FILE *pf) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (!root) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - int ret; - if (runtimes == NULL) { - ret = CreateRuntimes(root); - } else { - ret = CreateNode(runtimes); - } - if (ret != 0) { - return NULL; - } - return root; -} - - -int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) -{ - cJSON *root = NULL; - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - root = CreateContent(); - } else { - root = InsertContent(pf); - fclose(pf); - } - - if (root == NULL) { - fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); - return -1; - } - - fprintf(pf, "%s", cJSON_Print(root)); - fclose(pf); - - cJSON_Delete(root); - - return 0; -} - -/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ -int main(int argc, char *argv[]) -{ - if (argc != NUM_ARGS) { - return -1; - } - return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker +*/ +#include "cJSON.h" +#include +#include +#include + +#define MAX_JSON_FILE_SIZE 65535 +#define NUM_ARGS 4 +#define ADD_CMD "add" +#define RM_CMD "rm" +#define CMD_INDEX 1 +#define FINAL_FILE_INDEX 2 +#define TEMP_FILE_INDEX 3 +#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" + +void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) +{ + fseek(pf, 0, SEEK_END); + + int size = (int)ftell(pf); + if (size >= maxBufferSize) { + fprintf(stderr, "file size too large\n"); + return; + } + + fseek(pf, 0, SEEK_SET); + fread(text, sizeof(char), size, pf); + text[size] = '\0'; +} + +int CreateNode(cJSON *runtimes) +{ + cJSON *node = cJSON_GetObjectItem(runtimes, "ascend"); + if (node != NULL) { + return 0; + } + + cJSON *newItem = NULL; + newItem = cJSON_CreateObject(); + if (newItem == NULL) { + return -1; + } + cJSON_AddItemToObject(runtimes, "ascend", newItem); + + cJSON *paraArray = NULL; + paraArray = cJSON_CreateArray(); + if (paraArray == NULL) { + return -1; + } + + cJSON_AddItemToObject(newItem, "path", cJSON_CreateString(PATH_VALUE)); + cJSON_AddItemToObject(newItem, "runtimeArgs", paraArray); + + return 0; +} + +int CreateRuntimes(cJSON *root) +{ + cJSON *runtimes = cJSON_CreateObject(); + if (runtimes == NULL) { + return -1; + } + cJSON_AddItemToObject(root, "runtimes", runtimes); + return CreateNode(runtimes); +} + +cJSON *CreateContent() +{ + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + return NULL; + } + + int ret = CreateRuntimes(root); + if (ret != 0) { + return NULL; + } + + return root; +} + +cJSON *InsertContent(const FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (!root) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + int ret; + if (runtimes == NULL) { + ret = CreateRuntimes(root); + } else { + ret = CreateNode(runtimes); + } + if (ret != 0) { + return NULL; + } + return root; +} + + +int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) +{ + cJSON *root = NULL; + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + root = CreateContent(); + } else { + root = InsertContent(pf); + fclose(pf); + } + + if (root == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + return -1; + } + + fprintf(pf, "%s", cJSON_Print(root)); + fclose(pf); + + cJSON_Delete(root); + + return 0; +} + +cJSON *GetNewContent(const FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (!root) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + if (runtimes == NULL) { + fprintf(stderr, "no runtime key found\n"); + cJSON_Delete(root); + return NULL; + } + + cJSON *ascend = NULL; + ascend = cJSON_GetObjectItem(runtimes, "ascend"); + if (ascend == NULL) { + fprintf(stderr, "no ascend key found\n"); + cJSON_Delete(root); + return NULL; + } + + cJSON *removedItem = NULL; + removedItem = cJSON_DetachItemViaPointer(runtimes, ascend); + if (removedItem == NULL) { + fprintf(stderr, "remove runtime failed\n"); + cJSON_Delete(root); + return NULL; + } + + cJSON_Delete(removedItem); + return root; +} + +int CreateRevisedJsonFile(const char *filePath, const char *tempPath) +{ + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + fprintf(stderr, "error: no json files found\n"); + return -1; + } + cJSON *newContent = NULL; + newContent = GetNewContent(pf); + fclose(pf); + + if (newContent == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + cJSON_Delete(newContent); + return -1; + } + + fprintf(pf, "%s", cJSON_Print(newContent)); + fclose(pf); + + cJSON_Delete(newContent); + + return 0; +} + +/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ +int main(int argc, char *argv[]) +{ + if (argc != NUM_ARGS) { + return -1; + } + printf("%s\n", argv[FINAL_FILE_INDEX]); + printf("%s\n", argv[TEMP_FILE_INDEX]); + printf("%s\n", argv[CMD_INDEX]); + if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { + return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); + } + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); + } \ No newline at end of file diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index adb0179..495dbe9 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,7 +1,6 @@ Name: ascenddockerplugin Version: 1.0.0 Release: 1 -BuildArch: noarch Summary: simple RPM package License: FIXME @@ -29,7 +28,7 @@ BINDIR=/usr/local/bin if [ ! -d "${DIR}" ]; then mkdir ${DIR} fi -${BINDIR}/ascend-docker-plugin-install-helper ${DST} ${SRC} +${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} if [ "$?" != "0" ]; then echo "create damon.json failed\n" exit 1 @@ -38,6 +37,18 @@ fi echo "create damom.json success\n" %preun +#!/bin/bash +DIR=/etc/docker +BINDIR=/usr/local/bin +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "del damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "del damom.json success\n" %postun -- Gitee From db9314753925dd4e49a54efbbe1206149f7a3dea Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 6 Jun 2020 14:08:21 +0800 Subject: [PATCH 025/296] Match-id-e793c6dedc96a23da9f1bdc7febc0ffff821d41d --- build/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/build.sh b/build/build.sh index 493b486..e365b3d 100644 --- a/build/build.sh +++ b/build/build.sh @@ -56,6 +56,7 @@ make mkdir ${ROOT}/opensource/src /bin/cp -rf ${HOOKSRCDIR}/vendor/* ${ROOT}/opensource/src export GOPATH="${GOPATH}:${ROOT}/opensource" +export GO111MODULE=off [ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build -- Gitee From 2110535f0bd19f9058472e6a3d4d09b9602b7cd2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 9 Jun 2020 17:25:31 +0800 Subject: [PATCH 026/296] Match-id-6791cdca215337bdd4bb4df42904dec9f49174fa --- cli/src/main.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index fba2f32..504b613 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -112,24 +112,14 @@ int EnterNsByPath(const char *path, int nsType) return 0; } -unsigned int GetNextSerialNum() -{ - static unsigned int index = 0; - - return index++; -} - int MountDevice(const char *rootfs, const int serialNumber) { int ret; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; - char tmp[BUF_SIZE] = {0}; snprintf(src, BUF_SIZE, "/dev/" DEVICE_NAME "%d", serialNumber); - unsigned int targetSerialDevId = GetNextSerialNum(); - snprintf(tmp, BUF_SIZE, "/dev/" DEVICE_NAME "%d", targetSerialDevId); - snprintf(dst, BUF_SIZE, "%s%s", rootfs, (const char *)tmp); + snprintf(dst, BUF_SIZE, "%s%s", rootfs, (const char *)src); struct stat srcStat; ret = stat((const char *)src, &srcStat); -- Gitee From 5002aebf9abcdeb6d25c136c43f9dc329777b26c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 11 Jun 2020 10:40:04 +0800 Subject: [PATCH 027/296] Match-id-58ded49300187904b332c0e336002c8cc6bd1dbf --- install/deb/src/main.c | 243 +++++++++++++++++++++++++++-------------- 1 file changed, 164 insertions(+), 79 deletions(-) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 3bf11ad..7553a60 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -14,7 +14,13 @@ #define CMD_INDEX 1 #define FINAL_FILE_INDEX 2 #define TEMP_FILE_INDEX 3 -#define PATH_VALUE "/usr/local/bin/ascend-docker-runtime" +#define ASCEND_RUNTIME_PATH_VALUE "/usr/local/bin/ascend-docker-runtime" +#define ASCEND_RUNTIME_PATH_KEY "path" +#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" +#define RUNTIME_KEY "runtimes" +#define ASCEND_RUNTIME_NAME "ascend" +#define DEFALUT_KEY "default-runtime" +#define DEFAULT_VALUE "ascend" void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) { @@ -31,80 +37,200 @@ void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) text[size] = '\0'; } -int CreateNode(cJSON *runtimes) -{ - cJSON *node = cJSON_GetObjectItem(runtimes, "ascend"); - if (node != NULL) { - return 0; +cJSON *CreateAscendRuntimeInfo() +{ + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + fprintf(stderr, "create ascend runtime info root err\n"); + return NULL; } - - cJSON *newItem = NULL; - newItem = cJSON_CreateObject(); - if (newItem == NULL) { - return -1; + + cJSON *newString = NULL; + newString = cJSON_CreateString(ASCEND_RUNTIME_PATH_VALUE); + if (newString == NULL) { + fprintf(stderr, "create ascend runtime info path value err\n"); + cJSON_Delete(root); + return NULL; } - cJSON_AddItemToObject(runtimes, "ascend", newItem); - + cJSON *paraArray = NULL; paraArray = cJSON_CreateArray(); if (paraArray == NULL) { - return -1; + fprintf(stderr, "create ascend runtime info args err\n"); + cJSON_Delete(root); + cJSON_Delete(newString); + return NULL; } - - cJSON_AddItemToObject(newItem, "path", cJSON_CreateString(PATH_VALUE)); - cJSON_AddItemToObject(newItem, "runtimeArgs", paraArray); - return 0; + cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); + cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); + + return root; } -int CreateRuntimes(cJSON *root) +cJSON *CreateRuntimes() { - cJSON *runtimes = cJSON_CreateObject(); + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(); + if (ascendRuntime == NULL) { + fprintf(stderr, "create ascendruntime err\n"); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_CreateObject(); if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + cJSON_Delete(ascendRuntime); + return NULL; + } + + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + + return runtimes; +} + +int DelJsonContent(cJSON *root, const char *key) +{ + cJSON *existItem = NULL; + existItem = cJSON_GetObjectItem(root, key); + if (existItem == NULL) { + return 0; + } + + cJSON *removedItem = NULL; + removedItem = cJSON_DetachItemViaPointer(root, existItem); + if (removedItem == NULL) { + fprintf(stderr, "remove %s failed\n", key); return -1; } - cJSON_AddItemToObject(root, "runtimes", runtimes); - return CreateNode(runtimes); + + cJSON_Delete(removedItem); + return 0; } cJSON *CreateContent() -{ - cJSON *root = NULL; +{ + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = CreateRuntimes(); + if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + return NULL; + } + + cJSON *defaultRuntime = NULL; + defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(runtimes); + return NULL; + } + + cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { + /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ + fprintf(stderr, "create root err\n"); + cJSON_Delete(runtimes); + cJSON_Delete(defaultRuntime); return NULL; } - - int ret = CreateRuntimes(root); + + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); + + return root; +} + +cJSON *ModifyContent(const FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + if (runtimes == NULL) { + runtimes = CreateRuntimes(); + if (runtimes == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + } else { + int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(); + if (ascendRuntime == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + } + + /* 插入defaul runtime */ + int ret = DelJsonContent(root, DEFALUT_KEY); if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(root); return NULL; } + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); return root; } -cJSON *InsertContent(const FILE *pf) +cJSON *RemoveContent(const FILE *pf) { char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + cJSON *root = NULL; root = cJSON_Parse(jsonStr); - if (!root) { + if (root == NULL) { fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); return NULL; } - + + /* 去除default runtimes */ + int ret = DelJsonContent(root, DEFALUT_KEY); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + + /* 去除runtimes */ cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - int ret; + runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); if (runtimes == NULL) { - ret = CreateRuntimes(root); - } else { - ret = CreateNode(runtimes); + fprintf(stderr, "no runtime key found\n"); + cJSON_Delete(root); + return NULL; } + + ret = DelJsonContent(runtimes, DEFAULT_VALUE); if (ret != 0) { + cJSON_Delete(root); return NULL; } + return root; } @@ -117,7 +243,7 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) if (pf == NULL) { root = CreateContent(); } else { - root = InsertContent(pf); + root = ModifyContent(pf); fclose(pf); } @@ -140,46 +266,6 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) return 0; } -cJSON *GetNewContent(const FILE *pf) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (!root) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - if (runtimes == NULL) { - fprintf(stderr, "no runtime key found\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON *ascend = NULL; - ascend = cJSON_GetObjectItem(runtimes, "ascend"); - if (ascend == NULL) { - fprintf(stderr, "no ascend key found\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON *removedItem = NULL; - removedItem = cJSON_DetachItemViaPointer(runtimes, ascend); - if (removedItem == NULL) { - fprintf(stderr, "remove runtime failed\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON_Delete(removedItem); - return root; -} - int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { FILE *pf = NULL; @@ -189,7 +275,7 @@ int CreateRevisedJsonFile(const char *filePath, const char *tempPath) return -1; } cJSON *newContent = NULL; - newContent = GetNewContent(pf); + newContent = RemoveContent(pf); fclose(pf); if (newContent == NULL) { @@ -224,6 +310,5 @@ int main(int argc, char *argv[]) if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); } - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); - -} \ No newline at end of file + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); +} -- Gitee From 791e4adeb9139b00709365639c937969f1e28b30 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 11 Jun 2020 16:59:47 +0800 Subject: [PATCH 028/296] Match-id-524ab05611dbf56b78ab06d71dbd291eb4fb2dba --- hook/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook/main.go b/hook/main.go index 8a5cfd1..a867338 100644 --- a/hook/main.go +++ b/hook/main.go @@ -173,7 +173,7 @@ func doPrestartHook() error { visibleDevices := getValueByKey(containerConfig.Env, ascendVisibleDevices) if visibleDevices == "" { - return fmt.Errorf("failed to get device setting") + return nil } devices, err := parseDevices(visibleDevices) -- Gitee From bf8db41545ab8a0f537c2ca020230ccb6cc5ab7f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 11 Jun 2020 19:04:18 +0800 Subject: [PATCH 029/296] Match-id-79170974140b0ff6baf8dee4565a24a36dd6a9c4 --- build/build.sh | 19 +++++++++++++++---- install/deb/scripts/control | 3 --- install/rpm/ascend-docker-plgugin.spec | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/build/build.sh b/build/build.sh index e365b3d..0354ad6 100644 --- a/build/build.sh +++ b/build/build.sh @@ -37,6 +37,11 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} +VERSION="1.0.0" +RELEASE="1" +PACKAGENAEM="ascend-docker-runtime" +CPUARCH=`uname -m` + funcbuild(){ echo "make cli" [ -d "${CLISRCDIR}/build" ]&&rm -rf ${CLISRCDIR}/build @@ -69,6 +74,12 @@ go build ../${RUNTIMESRCNAME} mv main ascend-docker-runtime } +fillcontrol(){ +sed -i "1i\Package: ${PACKAGENAEM}" ${DEBDIR}/control +sed -i "2a\Architecture: all" ${DEBDIR}/control +sed -i "3a\Version: ${VERSION}" ${DEBDIR}/control +} + funcmakedeb(){ cd ${BUILD} mkdir -pv {${DEBDIR},${BINDIR}} @@ -78,15 +89,15 @@ INSTPATH=`find ${INSTALLHELPERDIR} -name "postinst"` RMPATH=`find ${INSTALLHELPERDIR} -name "prerm"` /bin/cp -f ${CONPATH} ${INSTPATH} ${RMPATH} ${DEBDIR} echo ${INSTPATH} +fillcontrol chmod 555 ${DEBDIR}/postinst chmod 555 ${DEBDIR}/prerm -dpkg-deb -b ${DEBPACK} ascenddockertool_1.0.0_i386.deb +dpkg-deb -b ${DEBPACK} ${PACKAGENAEM}_${VERSION}-${RELEASE}_${CPUARCH}.deb DEBS=`find ${BUILD} -name "*.deb"` /bin/cp ${DEBS} ${OUTPUT} } -funcfillarch(){ -CPUARCH=`uname -m` +funcfillspec(){ sed -i "4a\BuildArch: $CPUARCH" ${RPMSPECDIR}/*.spec } @@ -96,7 +107,7 @@ mkdir -pv ${RPMPACK}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` dos2unix ${SPECPATH} /bin/cp -f ${SPECPATH} ${RPMSPECDIR} -funcfillarch +funcfillspec rpmbuild --define "_topdir ${RPMPACK}" rpmbuild --showrc | grep topdir echo ${RPMPACK} diff --git a/install/deb/scripts/control b/install/deb/scripts/control index fbab54c..65fdc00 100644 --- a/install/deb/scripts/control +++ b/install/deb/scripts/control @@ -1,6 +1,3 @@ -Package: ascenddockertool Maintainer: huawei -Architecture: all -Version: 1.0.0 Description: asenddockertool. The asend docker tool help usr to modify a customed deamon.json. diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 495dbe9..85b558a 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,4 +1,4 @@ -Name: ascenddockerplugin +Name: ascend-docker-runtime Version: 1.0.0 Release: 1 Summary: simple RPM package -- Gitee From 39fe5ed6dbcf6054fc36b2991ba04cd0226a0e13 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 13 Jun 2020 16:07:56 +0800 Subject: [PATCH 030/296] Match-id-32a15651385a7d833acddf807ede6634942407d7 --- build/build.sh | 16 ++++- ci/dependency.xml | 15 +++++ cli/src/CMakeLists.txt | 19 ++++-- cli/src/HuaweiSecureC/CMakeLists.txt | 7 +++ cli/src/main.c | 62 +++++++++++++------- install/deb/src/CMakeLists.txt | 56 ++++++++++-------- install/deb/src/HuaweiSecureC/CMakeLists.txt | 7 +++ install/deb/src/cjson/CMakeLists.txt | 16 ++--- install/deb/src/main.c | 7 ++- platform/README.MD | 1 + 10 files changed, 145 insertions(+), 61 deletions(-) create mode 100644 cli/src/HuaweiSecureC/CMakeLists.txt create mode 100644 install/deb/src/HuaweiSecureC/CMakeLists.txt create mode 100644 platform/README.MD diff --git a/build/build.sh b/build/build.sh index 0354ad6..5c24550 100644 --- a/build/build.sh +++ b/build/build.sh @@ -4,6 +4,7 @@ ROOT=$(cd `dirname $0`; pwd)/.. OPENSRC=${ROOT}/opensource +PLATFORM=${ROOT}/platform OUTPUT=${ROOT}/output BUILD=${ROOT}/build @@ -132,8 +133,21 @@ funcmakeunzip(){ cd ${OPENSRC} tar -xzvf cJSON*.tar.gz CJSONS=`find . -name "cJSON.*"` -CJSONSLIB=`find ${INSTALLHELPERDIR} -name cjson -type d` +CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson /bin/cp -f ${CJSONS} ${CJSONSLIB} + +cd ${PLATFORM} +tar -xzvf HuaweiSecureC.tar.gz +SECURECSRC=`find . -name "src"` +SECURECINC=`find . -name "include"` + +SECURECLIB=${INSTALLHELPERDIR}/deb/src/HuaweiSecureC +/bin/cp -f ${SECURECSRC}/* ${SECURECLIB} +/bin/cp -f ${SECURECINC}/* ${SECURECLIB} + +SECURECLIB=${CLIDIR}/src/HuaweiSecureC +/bin/cp -f ${SECURECSRC}/* ${SECURECLIB} +/bin/cp -f ${SECURECINC}/* ${SECURECLIB} } funcmakeclean diff --git a/ci/dependency.xml b/ci/dependency.xml index 8fea80e..eddb2af 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -32,5 +32,20 @@ + + + BVersion + Generic + + Huawei Secure C + Huawei Secure C V100R001C01SPC009B003 + + + + /* + platform/ + + + diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 4fb2934..63a6a55 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -1,5 +1,14 @@ -cmake_minimum_required(VERSION 2.26) -project(ascend-docker-cli C) -set(CMAKE_C_STANDARD 11) -aux_source_directory(. SRC) -add_executable(ascend-docker-cli ${SRC}) +cmake_minimum_required(VERSION 2.26) +project(ascend-docker-cli C) +set(CMAKE_C_STANDARD 11) +## The common options using by both c and cxx + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") +aux_source_directory(. SRC) +add_subdirectory(HuaweiSecureC) +add_executable(ascend-docker-cli ${SRC}) +target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) +target_link_libraries(ascend-docker-cli -pie -Wl,-z,now HuaweiSecureC) diff --git a/cli/src/HuaweiSecureC/CMakeLists.txt b/cli/src/HuaweiSecureC/CMakeLists.txt new file mode 100644 index 0000000..92ab9b8 --- /dev/null +++ b/cli/src/HuaweiSecureC/CMakeLists.txt @@ -0,0 +1,7 @@ +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(HuaweiSecureC ${LIB_SRC}) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) diff --git a/cli/src/main.c b/cli/src/main.c index 504b613..bc19b64 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -15,6 +15,7 @@ #include #include #include +#include "securec.h" #define DEVICE_NAME "davinci" #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" @@ -29,7 +30,7 @@ #define MOUNT_SUBSTR_GAP 2 #define ROOT_SUBSTR_GAP 2 -static const struct option g_opts[] = { +static const struct option g_cmdOpts[] = { {"devices", required_argument, 0, 'd'}, {"pid", required_argument, 0, 'p'}, {"rootfs", required_argument, 0, 'r'}, @@ -71,13 +72,13 @@ void FreeCmdArgs(struct CmdArgs *args) int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/%d/ns/%s"; - return snprintf(buf, bufSize, fmtStr, pid, nsType); + return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, pid, nsType); } int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/self/ns/%s"; - return snprintf(buf, bufSize, fmtStr, nsType); + return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, nsType); } int EnterNsByFd(int fd, int nsType) @@ -118,9 +119,14 @@ int MountDevice(const char *rootfs, const int serialNumber) char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; - snprintf(src, BUF_SIZE, "/dev/" DEVICE_NAME "%d", serialNumber); - snprintf(dst, BUF_SIZE, "%s%s", rootfs, (const char *)src); - + ret = snprintf_s(src, BUF_SIZE, BUF_SIZE, "/dev/" DEVICE_NAME "%d", serialNumber); + if (ret < 0) { + return -1; + } + ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, (const char *)src); + if (ret < 0) { + return -1; + } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { @@ -149,7 +155,10 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) { static const char *sep = ","; char list[BUF_SIZE] = {0}; - strcpy(list, devicesList); + errno_t err = strncpy_s(list, BUF_SIZE, devicesList, strlen(devicesList)); + if (err != EOK) { + return -1; + } char *token = NULL; token = strtok(list, sep); @@ -196,7 +205,10 @@ int GetParentPathStr(const char *path, int lenOfPath, char *parent) if (len < 1) { return 0; } - strncpy(parent, path, len); + errno_t ret = strncpy_s(parent, BUF_SIZE, path, len); + if (ret != EOK) { + return -1; + } return 0; } @@ -231,13 +243,17 @@ int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag { char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; - snprintf(src, BUF_SIZE, "%s", file); - snprintf(dst, BUF_SIZE, "%s%s", rootfs, file); - + int ret = snprintf_s(src, BUF_SIZE, BUF_SIZE, "%s", file); + if (ret < 0) { + return -1; + } + ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, file); + if (ret < 0) { + return -1; + } struct stat srcStat; - int ret = stat((const char *) src, &srcStat); + ret = stat((const char *) src, &srcStat); if (ret < 0) { - fprintf(stderr, "error: failed to stat src: %s\n", src); return -1; } @@ -439,7 +455,10 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f while (getline(&line, &len, fp) != -1) { char* result = fn(line, "devices"); if (result != NULL && strlen(result) < bufferSize) { - strncpy(buffer, result, strlen(result)); + errno_t ret = strncpy_s(buffer, BUF_SIZE, result, strlen(result)); + if (ret != EOK) { + return -1; + } break; } } @@ -503,7 +522,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char mountPath[BUF_SIZE] = {0x0}; char mount[BUF_SIZE] = {0x0}; - ret = snprintf(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); + ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { fprintf(stderr, "error: assemble mount info path failed: ppid(%d)\n", getppid()); return -1; @@ -517,7 +536,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char cgroup[BUF_SIZE] = {0x0}; char cgroupPath[BUF_SIZE] = {0x0}; - ret = snprintf(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", args->pid); + ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); if (ret < 0) { fprintf(stderr, "error: assemble cgroup path failed: pid(%d)\n", args->pid); return -1; @@ -532,7 +551,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz // cut last '\n' off cgroup[strcspn(cgroup, "\n")] = '\0'; - ret = snprintf(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); + ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { fprintf(stderr, "error: assemble cgroup device path failed: \n"); return -1; @@ -549,7 +568,10 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) static const char *sep = ","; char list[BUF_SIZE] = {0}; - strcpy(list, args->devices); + errno_t err = strncpy_s(list, BUF_SIZE, args->devices, strlen(args->devices)); + if (err != EOK) { + return -1; + } char *token = NULL; cgroupAllow = fopen(cgroupPath, "a"); @@ -567,7 +589,7 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) token = strtok(list, sep); while (token != NULL) { - ret = snprintf(devicePath, BUF_SIZE, "/dev/" DEVICE_NAME "%d", atoi(token)); + ret = snprintf_s(devicePath, BUF_SIZE, BUF_SIZE, "/dev/" DEVICE_NAME "%d", atoi(token)); if (ret < 0) { fclose(cgroupAllow); fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); @@ -675,7 +697,7 @@ int Process(int argc, char **argv) .pid = -1 }; - while ((c = getopt_long(argc, argv, "d:p:r", g_opts, &optionIndex)) != -1) { + while ((c = getopt_long(argc, argv, "d:p:r", g_cmdOpts, &optionIndex)) != -1) { switch (c) { case 'd': args.devices = strdup(optarg); diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index e324718..35e44e7 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -1,24 +1,32 @@ -# CMake 最低版本号要求 -cmake_minimum_required (VERSION 2.8) - -# 项目信息 -project (ascend-docker-plugin-install-helper) - -#导入头文件所在路径 -#PROJECT_SOURCE_DIR为cmake宏 -include_directories("${PROJECT_SOURCE_DIR}/cjson") - -# 查找当前目录下的所有源文件 -# 并将名称保存到 SRC 变量 -aux_source_directory(. SRC) - -# 指定生成目标 -add_executable(ascend-docker-plugin-install-helper ${SRC}) - -# 添加 math 子目录 -add_subdirectory(cjson) - -# 添加链接库 -#该命令要在add_executable命令下方,否则报错 -target_link_libraries(ascend-docker-plugin-install-helper cjson) - +# CMake 最低版本号要求 +cmake_minimum_required (VERSION 2.8) + +# 项目信息 +project (ascend-docker-plugin-install-helper) + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + + +#导入头文件所在路径 +#PROJECT_SOURCE_DIR为cmake宏 +include_directories("${PROJECT_SOURCE_DIR}/cjson") +include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") + +# 查找当前目录下的所有源文件 +# 并将名称保存到 SRC 变量 +aux_source_directory(. SRC) + +# 指定生成目标 +add_executable(ascend-docker-plugin-install-helper ${SRC}) + +# 添加子目录 +add_subdirectory(cjson) +add_subdirectory(HuaweiSecureC) + +# 添加链接库 +#该命令要在add_executable命令下方,否则报错 +target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now cjson) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now HuaweiSecureC) + diff --git a/install/deb/src/HuaweiSecureC/CMakeLists.txt b/install/deb/src/HuaweiSecureC/CMakeLists.txt new file mode 100644 index 0000000..92ab9b8 --- /dev/null +++ b/install/deb/src/HuaweiSecureC/CMakeLists.txt @@ -0,0 +1,7 @@ +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(HuaweiSecureC ${LIB_SRC}) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) diff --git a/install/deb/src/cjson/CMakeLists.txt b/install/deb/src/cjson/CMakeLists.txt index ad8ce98..b5e902a 100644 --- a/install/deb/src/cjson/CMakeLists.txt +++ b/install/deb/src/cjson/CMakeLists.txt @@ -1,8 +1,8 @@ -execute_process(COMMAND bash ../install) -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) - -#生成链接库 -add_library(cjson ${LIB_SRC}) - +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(cjson ${LIB_SRC}) +target_compile_options(cjson PRIVATE -fstack-protector-all -fpie) + diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 7553a60..d8ef79f 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -6,6 +6,7 @@ #include #include #include +#include #define MAX_JSON_FILE_SIZE 65535 #define NUM_ARGS 4 @@ -22,7 +23,7 @@ #define DEFALUT_KEY "default-runtime" #define DEFAULT_VALUE "ascend" -void ReadJsonFile(const FILE *pf, char *text, int maxBufferSize) +void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { fseek(pf, 0, SEEK_END); @@ -144,7 +145,7 @@ cJSON *CreateContent() return root; } -cJSON *ModifyContent(const FILE *pf) +cJSON *ModifyContent(FILE *pf) { char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -197,7 +198,7 @@ cJSON *ModifyContent(const FILE *pf) return root; } -cJSON *RemoveContent(const FILE *pf) +cJSON *RemoveContent(FILE *pf) { char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); diff --git a/platform/README.MD b/platform/README.MD new file mode 100644 index 0000000..0e1b50b --- /dev/null +++ b/platform/README.MD @@ -0,0 +1 @@ +put platform dependency here \ No newline at end of file -- Gitee From c71cdf70380d790acbbfa2d6ecfc8223ff2993d2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 16 Jun 2020 16:28:37 +0800 Subject: [PATCH 031/296] Match-id-aa5b2e239bdd603ef626ea24fd7a4323c0d288cf --- build/build.sh | 2 +- cli/src/main.c | 8 ++++++++ hook/main.go | 2 +- install/deb/scripts/postinst | 2 +- install/deb/scripts/prerm | 2 +- install/deb/src/main.c | 2 +- install/rpm/ascend-docker-plgugin.spec | 10 +++++----- runtime/main.go | 3 +-- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/build/build.sh b/build/build.sh index 5c24550..0a82970 100644 --- a/build/build.sh +++ b/build/build.sh @@ -21,7 +21,7 @@ RUNTIMEDIR=${ROOT}/runtime RUNTIMESRCNAME="main.go" DEBPACK=${ROOT}/debpack -BINDIR=${DEBPACK}/usr/local/bin +BINDIR=${DEBPACK}/usr/bin DEBDIR=${DEBPACK}/DEBIAN RPMPACK=${ROOT}/rpmpack diff --git a/cli/src/main.c b/cli/src/main.c index bc19b64..b84d962 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -22,6 +22,7 @@ #define DEVMM_SVM_PATH "/dev/devmm_svm" #define HISI_HDC_PATH "/dev/hisi_hdc" #define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" +#define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 #define ALLOW_PATH "/devices.allow" @@ -328,6 +329,13 @@ int DoDirectoryMounting(const char *rootfs) fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); return -1; } + + ret = MountFiles(rootfs, ASCEND_ADDONS_PATH, reMountRwFlag); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", ASCEND_ADDONS_PATH); + return -1; + } + return 0; } diff --git a/hook/main.go b/hook/main.go index a867338..bba904b 100644 --- a/hook/main.go +++ b/hook/main.go @@ -24,7 +24,7 @@ const ( loggingPrefix = "ascend-docker-hook" ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" ascendDockerCli = "ascend-docker-cli" - defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli" + defaultAscendDockerCli = "/usr/bin/ascend-docker-cli" borderNum = 2 kvPairSize = 2 diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst index f336a23..29dc923 100644 --- a/install/deb/scripts/postinst +++ b/install/deb/scripts/postinst @@ -5,7 +5,7 @@ mkdir ${DIR} fi SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" -BINDIR=/usr/local/bin +BINDIR=/usr/bin ${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} if [ "$?" != "0" ]; then echo "create damon.json failed\n" diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm index 089686d..0a97191 100644 --- a/install/deb/scripts/prerm +++ b/install/deb/scripts/prerm @@ -5,7 +5,7 @@ mkdir ${DIR} fi SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" -BINDIR=/usr/local/bin +BINDIR=/usr/bin ${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then echo "del damon.json failed\n" diff --git a/install/deb/src/main.c b/install/deb/src/main.c index d8ef79f..e9a9d5c 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -15,7 +15,7 @@ #define CMD_INDEX 1 #define FINAL_FILE_INDEX 2 #define TEMP_FILE_INDEX 3 -#define ASCEND_RUNTIME_PATH_VALUE "/usr/local/bin/ascend-docker-runtime" +#define ASCEND_RUNTIME_PATH_VALUE "/usr/bin/ascend-docker-runtime" #define ASCEND_RUNTIME_PATH_KEY "path" #define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" #define RUNTIME_KEY "runtimes" diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 85b558a..291dc69 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -14,8 +14,8 @@ ascend-docker-plugin helps usrs to use NPU in docker %build %install -mkdir -p %{buildroot}/usr/local/bin/ -cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/local/bin/ +mkdir -p %{buildroot}/usr/bin/ +cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/bin/ %pre @@ -24,7 +24,7 @@ cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/local/bin/ DIR=/etc/docker SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" -BINDIR=/usr/local/bin +BINDIR=/usr/bin if [ ! -d "${DIR}" ]; then mkdir ${DIR} fi @@ -39,7 +39,7 @@ echo "create damom.json success\n" %preun #!/bin/bash DIR=/etc/docker -BINDIR=/usr/local/bin +BINDIR=/usr/bin SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" ${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} @@ -56,4 +56,4 @@ echo "del damom.json success\n" %files %defattr(0755,root,root,0755) -/usr/local/bin/* +/usr/bin/* diff --git a/runtime/main.go b/runtime/main.go index 19aba19..e5c899f 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -20,7 +20,7 @@ import ( const ( loggingPrefix = "ascend-docker-runtime" hookCli = "ascend-docker-hook" - hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" + hookDefaultFilePath = "/usr/bin/ascend-docker-hook" dockerRuncFile = "docker-runc" runcFile = "runc" ) @@ -165,7 +165,6 @@ func doProcess() error { func main() { log.SetPrefix(loggingPrefix) - if err := doProcess(); err != nil { log.Fatal(err) } -- Gitee From 602b1ab033f5a41ccc0a0773a64dead40d4bdc3a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 17 Jun 2020 22:49:36 +0800 Subject: [PATCH 032/296] Match-id-e2ec34e1bd98718093d20797b4980c96d0dbae6a --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 0a82970..a6aaece 100644 --- a/build/build.sh +++ b/build/build.sh @@ -66,12 +66,12 @@ export GO111MODULE=off [ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build -go build ../${HOOKSRCNAME} +go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook [ -d "${RUNTIMESRCDIR}/build" ]&&rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build -go build ../${RUNTIMESRCNAME} +go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} mv main ascend-docker-runtime } -- Gitee From 7915d2f8d51473248f66b1534d48031bcc12dfb0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 17 Jun 2020 19:39:12 +0800 Subject: [PATCH 033/296] Match-id-92fbf8191381873017507da7260f0c0ff6851a5e --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index a6aaece..98b9c43 100644 --- a/build/build.sh +++ b/build/build.sh @@ -156,5 +156,5 @@ funcmakepull fi funcmakeunzip funcbuild -funcmakerpm -#funcmakedeb \ No newline at end of file +[ -f /etc/redhat-release ]&&funcmakerpm +[ -f /etc/debian_version ]&&funcmakedeb -- Gitee From a245887a546744f0965eee6f74143ed8ce511397 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 18 Jun 2020 14:38:24 +0800 Subject: [PATCH 034/296] Match-id-1c1d124d29a76ff4be404d00226177a12462560d --- build/build.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 98b9c43..98b56d1 100644 --- a/build/build.sh +++ b/build/build.sh @@ -154,7 +154,14 @@ funcmakeclean if [ $1 == "pull" ]; then funcmakepull fi + funcmakeunzip funcbuild -[ -f /etc/redhat-release ]&&funcmakerpm -[ -f /etc/debian_version ]&&funcmakedeb + +if [ -f /etc/centos-release ]; then +funcmakerpm +fi + +if [ -f /etc/debian_version ]; then +funcmakedeb +fi -- Gitee From 1af253830e21a00f417ff13aad7aee6980b9f131 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 19 Jun 2020 15:00:10 +0800 Subject: [PATCH 035/296] Match-id-73655fa4b640c9790c6b3555829358eddb4ee230 --- cli/src/main.c | 414 ++++++++++++++++++++++++++++++------------------- 1 file changed, 256 insertions(+), 158 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index b84d962..9211730 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -15,12 +15,18 @@ #include #include #include +#include +#include #include "securec.h" +#undef major +#undef minor +#include + #define DEVICE_NAME "davinci" -#define DAVINCI_MANAGER_PATH "/dev/davinci_manager" -#define DEVMM_SVM_PATH "/dev/devmm_svm" -#define HISI_HDC_PATH "/dev/hisi_hdc" +#define DAVINCI_MANAGER "davinci_manager" +#define DEVMM_SVM "devmm_svm" +#define HISI_HDC "hisi_hdc" #define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" #define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" #define DEFAULT_DIR_MODE 0755 @@ -39,8 +45,8 @@ static const struct option g_cmdOpts[] = { }; struct CmdArgs { - char *devices; - char *rootfs; + char devices[BUF_SIZE]; + char rootfs[BUF_SIZE]; int pid; }; @@ -52,22 +58,7 @@ struct ParsedConfig { static inline bool IsCmdArgsValid(struct CmdArgs *args) { - return (args->devices != NULL) && (args->rootfs != NULL) && (args->pid > 0); -} - -void FreeCmdArgs(struct CmdArgs *args) -{ - if (args->devices != NULL) { - free(args->devices); - args->devices = NULL; - } - - if (args->rootfs != NULL) { - free(args->rootfs); - args->rootfs = NULL; - } - - args->pid = -1; + return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) @@ -98,7 +89,7 @@ int EnterNsByPath(const char *path, int nsType) int fd; int ret; - fd = open(path, O_RDONLY); + fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { fprintf(stderr, "error: failed to open ns path: %s\n", path); return -1; @@ -107,6 +98,7 @@ int EnterNsByPath(const char *path, int nsType) ret = EnterNsByFd(fd, nsType); if (ret < 0) { fprintf(stderr, "error: failed to set ns: %s\n", path); + close(fd); return -1; } @@ -114,20 +106,81 @@ int EnterNsByPath(const char *path, int nsType) return 0; } -int MountDevice(const char *rootfs, const int serialNumber) +static int Mount(const char *src, const char *dst) { + static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; int ret; - char src[BUF_SIZE] = {0}; - char dst[BUF_SIZE] = {0}; - ret = snprintf_s(src, BUF_SIZE, BUF_SIZE, "/dev/" DEVICE_NAME "%d", serialNumber); + ret = mount(src, dst, NULL, MS_BIND, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to mount\n"); + return -1; + } + + ret = mount(NULL, dst, NULL, remountFlags, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to re-mount\n"); + return -1; + } + + return 0; +} + +static int CreateFile(const char *path, mode_t mode) +{ + int fd = open(path, O_NOFOLLOW | O_CREAT, mode); + if (fd < 0) { + fprintf(stderr, "error: cannot create file: %s\n", path); + return -1; + } + close(fd); + return 0; +} + +static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, + char *src, size_t srcBufSize, char *dst, size_t dstBufSize) +{ + int ret; + error_t err; + char unresolvedDst[BUF_SIZE] = {0}; + char resolvedDst[PATH_MAX] = {0}; + + ret = snprintf_s(src, srcBufSize, srcBufSize, "/dev/%s", deviceName); + if (ret < 0) { + return -1; + } + + ret = snprintf_s(unresolvedDst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); if (ret < 0) { return -1; } - ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, (const char *)src); + + if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize device dst: %s\n", dst); + return -1; + } + + err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); + if (err != EOK) { + fprintf(stderr, "error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); + return -1; + } + + return 0; +} + +int MountDevice(const char *rootfs, const char *deviceName) +{ + int ret; + char src[BUF_SIZE] = {0}; + char dst[BUF_SIZE] = {0}; + + ret = GetDeviceMntSrcDst(rootfs, deviceName, src, BUF_SIZE, dst, BUF_SIZE); if (ret < 0) { + fprintf(stderr, "error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); return -1; } + struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { @@ -135,17 +188,15 @@ int MountDevice(const char *rootfs, const int serialNumber) return -1; } - close(open(dst, O_NOFOLLOW | O_CREAT, srcStat.st_mode)); - - ret = mount(src, dst, NULL, MS_BIND, NULL); + ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - fprintf(stderr, "error: failed to mount dev\n"); + fprintf(stderr, "error: failed to create mount dst file: %s\n", dst); return -1; } - ret = mount(NULL, dst, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC, NULL); + ret = Mount(src, dst); if (ret < 0) { - fprintf(stderr, "error: failed to re-mount dev\n"); + fprintf(stderr, "error: failed to mount dev\n"); return -1; } @@ -156,6 +207,8 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) { static const char *sep = ","; char list[BUF_SIZE] = {0}; + char deviceName[BUF_SIZE] = {0}; + errno_t err = strncpy_s(list, BUF_SIZE, devicesList, strlen(devicesList)); if (err != EOK) { return -1; @@ -164,7 +217,13 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) token = strtok(list, sep); while (token != NULL) { - int ret = MountDevice(rootfs, atoi((const char *) token)); + int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); + if (ret < 0) { + fprintf(stderr, "error: assemble device name failed, id: %s\n", token); + return -1; + } + + ret = MountDevice(rootfs, deviceName); if (ret < 0) { fprintf(stderr, "error: failed to mount device no. %s\n", token); return -1; @@ -176,122 +235,109 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) return 0; } -int CheckDirExists(char *dir, int len) +int CheckDirExists(const char *dir) { - if (len < 0) { - fprintf(stderr, "length of path is %d\n", len); - return -1; - } DIR *ptr = opendir(dir); if (NULL == ptr) { fprintf(stderr, "path %s not exist\n", dir); return -1; - } else { - fprintf(stdout, "path %s exist\n", dir); - closedir(ptr); - return 0; } + + fprintf(stdout, "path %s exist\n", dir); + closedir(ptr); + return 0; } -int GetParentPathStr(const char *path, int lenOfPath, char *parent) +int GetParentPathStr(const char *path, char *parent, size_t bufSize) { - if (lenOfPath < 0) { - return -1; - } char *ptr = strrchr(path, '/'); if (ptr == NULL) { return 0; } - int len = strlen(path) - strlen(ptr); + + int len = (int)strlen(path) - (int)strlen(ptr); if (len < 1) { return 0; } - errno_t ret = strncpy_s(parent, BUF_SIZE, path, len); + + errno_t ret = strncpy_s(parent, bufSize, path, len); if (ret != EOK) { return -1; } + return 0; } -int MakeDir(char *dir, int mode) +int MakeDir(const char *dir, int mode) { return mkdir(dir, mode); } -int MakeParentDir(char *path, mode_t mode) +int MakeParentDir(const char *path, mode_t mode) { if (*path == '\0' || *path == '.') { return 0; } - if (CheckDirExists(path, strlen(path)) == 0) { + if (CheckDirExists(path) == 0) { return 0; } + char parentPath[BUF_SIZE] = {0}; - GetParentPathStr(path, strlen(path), parentPath); + GetParentPathStr(path, parentPath, BUF_SIZE); if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { return -1; } + struct stat s; int ret = stat(path, &s); if (ret < 0) { fprintf(stderr, "error: failed to stat path: %s\n", path); return (MakeDir(path, mode)); } + return 0; } -int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag) +int MountDir(const char *rootfs, const char *src) { - char src[BUF_SIZE] = {0}; + int ret; char dst[BUF_SIZE] = {0}; - int ret = snprintf_s(src, BUF_SIZE, BUF_SIZE, "%s", file); - if (ret < 0) { - return -1; - } - ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, file); + + ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); if (ret < 0) { return -1; } + struct stat srcStat; - ret = stat((const char *) src, &srcStat); + ret = stat(src, &srcStat); if (ret < 0) { return -1; } - if (S_ISDIR(srcStat.st_mode)) { - /* directory */ - char parentDir[BUF_SIZE] = {0}; - GetParentPathStr(dst, strlen(dst), parentDir); - if (CheckDirExists(parentDir, strlen(parentDir)) < 0) { - mode_t parentMode = DEFAULT_DIR_MODE; - ret = MakeParentDir(parentDir, parentMode); - if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", parentDir); - return -1; - } - } - if (CheckDirExists(dst, strlen(dst)) < 0) { - const mode_t curMode = srcStat.st_mode; - ret = MakeDir(dst, curMode); - if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", dst); - return -1; - } + /* directory */ + char parentDir[BUF_SIZE] = {0}; + GetParentPathStr(dst, parentDir, BUF_SIZE); + if (CheckDirExists(parentDir) < 0) { + mode_t parentMode = DEFAULT_DIR_MODE; + ret = MakeParentDir(parentDir, parentMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", parentDir); + return -1; } - } else { - /* device */ - close(open(dst, O_NOFOLLOW | O_CREAT, srcStat.st_mode)); } - ret = mount(src, dst, NULL, MS_BIND, NULL); - if (ret < 0) { - fprintf(stderr, "error: failed to mount dev\n"); - return -1; + if (CheckDirExists(dst) < 0) { + const mode_t curMode = srcStat.st_mode; + ret = MakeDir(dst, curMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", dst); + return -1; + } } - ret = mount(NULL, dst, NULL, reMountRwFlag, NULL); + ret = Mount(src, dst); if (ret < 0) { - fprintf(stderr, "error: failed to re-mount dev\n"); + fprintf(stderr, "error: failed to mount dir: %s to %s\n", src, dst); return -1; } @@ -301,36 +347,37 @@ int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag int DoCtrlDeviceMounting(const char *rootfs) { /* device */ - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + int ret = MountDevice(rootfs, DAVINCI_MANAGER); if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", DAVINCI_MANAGER_PATH); + fprintf(stderr, "error: failed to mount device %s\n", DAVINCI_MANAGER); return -1; } - ret = MountFiles(rootfs, DEVMM_SVM_PATH, reMountRwFlag); + + ret = MountDevice(rootfs, DEVMM_SVM); if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", DEVMM_SVM_PATH); + fprintf(stderr, "error: failed to mount device %s\n", DEVMM_SVM); return -1; } - ret = MountFiles(rootfs, HISI_HDC_PATH, reMountRwFlag); + + ret = MountDevice(rootfs, HISI_HDC); if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", HISI_HDC_PATH); + fprintf(stderr, "error: failed to mount device %s\n", HISI_HDC); return -1; } + return 0; } int DoDirectoryMounting(const char *rootfs) { /* directory */ - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NODEV | MS_NOSUID; - int ret = MountFiles(rootfs, ASCEND_DRIVER_PATH, reMountRwFlag); + int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); if (ret < 0) { fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); return -1; } - ret = MountFiles(rootfs, ASCEND_ADDONS_PATH, reMountRwFlag); + ret = MountDir(rootfs, ASCEND_ADDONS_PATH); if (ret < 0) { fprintf(stderr, "error: failed to do mount %s\n", ASCEND_ADDONS_PATH); return -1; @@ -376,49 +423,64 @@ int StrHasPrefix(const char *str, const char *prefix) return (!strncmp(str, prefix, strlen(prefix))); } -static bool IsCgroupLineArgsValid(const char *rootDir, const char *mountPoint, const char* fsType, const char* substr) -{ - return ((rootDir != NULL && mountPoint != NULL && fsType != NULL && substr != NULL) && - (*rootDir != '\0' && *mountPoint != '\0' && *fsType != '\0' && *substr != '\0')); -} - -char *GetCgroupMount(char *line, const char *subsys) +static bool CheckRootDir(char **pLine) { - int i; - char *rootDir = NULL; - for (i = 0; i < ROOT_GAP; ++i) { + for (int i = 0; i < ROOT_GAP; i++) { /* root is substr before gap, line is substr after gap */ - rootDir = strsep(&line, " "); + rootDir = strsep(pLine, " "); + if (rootDir == NULL || *rootDir == '\0') { + return false; + } } - char *mountPoint = NULL; - mountPoint = strsep(&line, " "); - line = strchr(line, '-'); + return strlen(rootDir) < BUF_SIZE && !StrHasPrefix(rootDir, "/.."); +} +static bool CheckFsType(char **pLine) +{ char* fsType = NULL; - for (i = 0; i < FSTYPE_GAP; ++i) { - fsType = strsep(&line, " "); + for (int i = 0; i < FSTYPE_GAP; i++) { + fsType = strsep(pLine, " "); + if (fsType == NULL || *fsType == '\0') { + return false; + } } + return IsStrEqual(fsType, "cgroup"); +} + +static bool CheckSubStr(char **pLine, const char *subsys) +{ char* substr = NULL; - for (i = 0; i < MOUNT_SUBSTR_GAP; ++i) { - substr = strsep(&line, " "); + for (int i = 0; i < MOUNT_SUBSTR_GAP; i++) { + substr = strsep(pLine, " "); + if (substr == NULL || *substr == '\0') { + return false; + } } - if (!IsCgroupLineArgsValid(rootDir, mountPoint, fsType, substr)) { + return strstr(substr, subsys) != NULL; +} + +char *GetCgroupMount(char *line, const char *subsys) +{ + if (!CheckRootDir(&line)) { return NULL; } - if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { + char *mountPoint = NULL; + mountPoint = strsep(&line, " "); + line = strchr(line, '-'); + if (mountPoint == NULL || *mountPoint == '\0') { return NULL; } - if (strstr(substr, subsys) == NULL) { + if (!CheckFsType(&line)) { return NULL; } - if (!IsStrEqual(fsType, "cgroup")) { + if (!CheckSubStr(&line, subsys)) { return NULL; } @@ -431,30 +493,38 @@ char *GetCgroupRoot(char *line, const char *subSystem) int i; for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { token = strsep(&line, ":"); + if (token == NULL || *token == '\0') { + return NULL; + } } + char *rootDir = strsep(&line, ":"); - if (rootDir == NULL || token == NULL) { - return (NULL); - } - if (*rootDir == '\0' || *token == '\0') { - return (NULL); + if (rootDir == NULL || *rootDir == '\0') { + return NULL; } + if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { - return (NULL); + return NULL; } if (strstr(token, subSystem) == NULL) { - return (NULL); + return NULL; } - return (rootDir); + return rootDir; } int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) { - FILE *fp; + FILE *fp = NULL; char *line = NULL; size_t len = 0; + char resolvedPath[PATH_MAX] = {0x0}; - fp = fopen(filepath, "r"); + if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize path %s\n", filepath); + return -1; + } + + fp = fopen(resolvedPath, "r"); if (fp == NULL) { fprintf(stderr, "cannot open file.\n"); return -1; @@ -465,6 +535,7 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f if (result != NULL && strlen(result) < bufferSize) { errno_t ret = strncpy_s(buffer, BUF_SIZE, result, strlen(result)); if (ret != EOK) { + fclose(fp); return -1; } break; @@ -479,11 +550,19 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f return 0; } -int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath) +int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) { int ret; struct stat devStat; - ret = stat(devPath, &devStat); + char devPath[BUF_SIZE]; + + ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); + if (ret < 0) { + fprintf(stderr, "error: failed to assemble dev path for %s\n", devName); + return -1; + } + + ret = stat((const char *)devPath, &devStat); if (ret < 0) { fprintf(stderr, "error: failed to get stat of %s\n", devPath); return -1; @@ -503,21 +582,21 @@ int SetupDriverCgroup(FILE *cgroupAllow) { int ret; - ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER_PATH); + ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER_PATH); + fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM_PATH); + ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM_PATH); + fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC_PATH); + ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC_PATH); + fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC); return -1; } @@ -571,9 +650,15 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) { int ret; - char devicePath[BUF_SIZE] = {0}; + char deviceName[BUF_SIZE] = {0}; + char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; + if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize cgroup path: %s\n", cgroupPath); + return -1; + } + static const char *sep = ","; char list[BUF_SIZE] = {0}; errno_t err = strncpy_s(list, BUF_SIZE, args->devices, strlen(args->devices)); @@ -582,9 +667,9 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) } char *token = NULL; - cgroupAllow = fopen(cgroupPath, "a"); + cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - fprintf(stderr, "error: failed to open cgroup file: %s\n", cgroupPath); + fprintf(stderr, "error: failed to open cgroup file: %s\n", resolvedCgroupPath); return -1; } @@ -597,14 +682,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) token = strtok(list, sep); while (token != NULL) { - ret = snprintf_s(devicePath, BUF_SIZE, BUF_SIZE, "/dev/" DEVICE_NAME "%d", atoi(token)); + ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { fclose(cgroupAllow); fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, (const char *)devicePath); + ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); fprintf(stderr, "error: failed to setup cgroup %s\n", token); @@ -641,7 +726,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return -1; } - config->originNsFd = open((const char *)originNsPath, O_RDONLY); + config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { fprintf(stderr, "error: failed to get self ns fd: %s\n", originNsPath); return -1; @@ -698,42 +783,55 @@ int SetupMounts(struct CmdArgs *args) int Process(int argc, char **argv) { int c; + errno_t err; int optionIndex; - struct CmdArgs args = { - .devices = NULL, - .rootfs = NULL, - .pid = -1 - }; + bool isSucceed; + struct CmdArgs args = {0}; + + isSucceed = true; + while (isSucceed) { + c = getopt_long(argc, argv, "d:p:r", g_cmdOpts, &optionIndex); + if (c == -1) { + // cmd options exhausted + break; + } - while ((c = getopt_long(argc, argv, "d:p:r", g_cmdOpts, &optionIndex)) != -1) { switch (c) { case 'd': - args.devices = strdup(optarg); + err = strcpy_s(args.devices, BUF_SIZE, optarg); + if (err != EOK) { + isSucceed = false; + } break; case 'p': args.pid = atoi(optarg); + if (args.pid <= 0) { + isSucceed = false; + } break; case 'r': - args.rootfs = strdup(optarg); + err = strcpy_s(args.rootfs, BUF_SIZE, optarg); + if (err != EOK) { + isSucceed = false; + } break; default: fprintf(stderr, "unrecongnized option\n"); - return -1; // unrecognized option + isSucceed = false; // unrecognized option + break; } } - if (!IsCmdArgsValid(&args)) { - FreeCmdArgs(&args); + if (!isSucceed || !IsCmdArgsValid(&args)) { + fprintf(stderr, "error: information not completed or valid.\n"); return -1; } int ret = SetupMounts(&args); if (ret < 0) { - FreeCmdArgs(&args); return ret; } - FreeCmdArgs(&args); return 0; } -- Gitee From 4f8bc7390936e02288db21e4da9df65724427a6b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 20 Jun 2020 11:42:46 +0800 Subject: [PATCH 036/296] Match-id-7f42cd82b8c6b9d8e7fa94c7b5eea0a03384b838 --- cli/src/main.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 9211730..45b5473 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -19,10 +20,6 @@ #include #include "securec.h" -#undef major -#undef minor -#include - #define DEVICE_NAME "davinci" #define DAVINCI_MANAGER "davinci_manager" #define DEVMM_SVM "devmm_svm" @@ -37,7 +34,7 @@ #define MOUNT_SUBSTR_GAP 2 #define ROOT_SUBSTR_GAP 2 -static const struct option g_cmdOpts[] = { +static struct option g_cmdOpts[] = { {"devices", required_argument, 0, 'd'}, {"pid", required_argument, 0, 'p'}, {"rootfs", required_argument, 0, 'r'}, @@ -56,6 +53,13 @@ struct ParsedConfig { int originNsFd; }; +struct PathInfo { + char* src; + size_t srcLen; + char* dst; + size_t dstLen; +}; + static inline bool IsCmdArgsValid(struct CmdArgs *args) { return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); @@ -137,14 +141,32 @@ static int CreateFile(const char *path, mode_t mode) return 0; } +static int VerfifyPathInfo(const struct PathInfo* pathInfo) +{ + if (pathInfo == NULL || pathInfo->dst == NULL || pathInfo->src == NULL) { + return -1; + } + return 0; +} + static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, - char *src, size_t srcBufSize, char *dst, size_t dstBufSize) + struct PathInfo* pathInfo) { int ret; error_t err; char unresolvedDst[BUF_SIZE] = {0}; char resolvedDst[PATH_MAX] = {0}; + ret = VerfifyPathInfo(pathInfo); + if (ret < 0) { + return -1; + } + + size_t srcBufSize = pathInfo->srcLen; + size_t dstBufSize = pathInfo->dstLen; + char *src = pathInfo->src; + char *dst = pathInfo->dst; + ret = snprintf_s(src, srcBufSize, srcBufSize, "/dev/%s", deviceName); if (ret < 0) { return -1; @@ -174,8 +196,9 @@ int MountDevice(const char *rootfs, const char *deviceName) int ret; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; + struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, deviceName, src, BUF_SIZE, dst, BUF_SIZE); + ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); if (ret < 0) { fprintf(stderr, "error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); return -1; -- Gitee From 1e3f8a40b4dd7517dc504c08312d104630506363 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 23 Jun 2020 09:24:51 +0800 Subject: [PATCH 037/296] Match-id-fc5f021b8d5e66171f75e7d31d840d5e48ed3de4 --- cli/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main.c b/cli/src/main.c index 45b5473..671c091 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -112,7 +112,7 @@ int EnterNsByPath(const char *path, int nsType) static int Mount(const char *src, const char *dst) { - static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; int ret; ret = mount(src, dst, NULL, MS_BIND, NULL); -- Gitee From ef03a93818a2fced49bfb1fa2557926a796259ae Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 22 Jun 2020 12:22:42 +0800 Subject: [PATCH 038/296] Match-id-72be8dc15a12025cd504eb630821c23a35e341be --- cli/src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 671c091..7b59831 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -132,9 +132,15 @@ static int Mount(const char *src, const char *dst) static int CreateFile(const char *path, mode_t mode) { - int fd = open(path, O_NOFOLLOW | O_CREAT, mode); + char resolvedPath[PATH_MAX] = {0}; + if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: failed to resolve path %s\n", path); + return -1; + } + + int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - fprintf(stderr, "error: cannot create file: %s\n", path); + fprintf(stderr, "error: cannot create file: %s\n", resolvedPath); return -1; } close(fd); -- Gitee From 75f993a573617b50637ac21d3e7e13a687607447 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 28 Jun 2020 17:26:12 +0800 Subject: [PATCH 039/296] Match-id-44f9e6e30131cf60573aa16a83d655bae000e0fa --- runtime/config.json | 141 -------------------------------------------- 1 file changed, 141 deletions(-) delete mode 100644 runtime/config.json diff --git a/runtime/config.json b/runtime/config.json deleted file mode 100644 index f3a79d8..0000000 --- a/runtime/config.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "ociVersion": "0.4.0", - "platform": { - "os": "linux", - "arch": "amd64" - }, - "process": { - "terminal": true, - "user": {}, - "args": [ - "redis-server", - "--bind", - "0.0.0.0" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "rlimits": [ - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "runc", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev", - "ro" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "hooks": {}, - "linux": { - "resources": { - "devices": [ - { - "allow": false, - "access": "rwm" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - } - ], - "devices": null - } -} \ No newline at end of file -- Gitee From 59a66c363d43df7268560ffbbec75cdf1e097fc7 Mon Sep 17 00:00:00 2001 From: BianTanggui <841018prgray^> Date: Mon, 29 Jun 2020 17:19:56 +0800 Subject: [PATCH 040/296] Match-id-5e08e650d1346d0e7635370276a66d683f9e0bbf --- build/build.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 98b56d1..cc78cf7 100644 --- a/build/build.sh +++ b/build/build.sh @@ -51,7 +51,7 @@ cmake ../ make clean make -echo "make runtime" +echo "make installhelper" [ -d "${INSTALLHELPERSRCDIR}/build" ]&&rm -rf ${INSTALLHELPERSRCDIR}/build mkdir ${INSTALLHELPERSRCDIR}/build&&cd ${INSTALLHELPERSRCDIR}/build cmake ../ @@ -64,11 +64,13 @@ mkdir ${ROOT}/opensource/src export GOPATH="${GOPATH}:${ROOT}/opensource" export GO111MODULE=off +echo "make hook" [ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook +echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ]&&rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} @@ -85,6 +87,11 @@ funcmakedeb(){ cd ${BUILD} mkdir -pv {${DEBDIR},${BINDIR}} /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${BINDIR} +FILECNT=`ls -l ${BINDIR} |grep "^-"|wc -l` +echo "prepare package $FILECNT bins" +if [ $FILECNT -ne 4 ]; then +exit 1 +fi CONPATH=`find ${INSTALLHELPERDIR} -name "control"` INSTPATH=`find ${INSTALLHELPERDIR} -name "postinst"` RMPATH=`find ${INSTALLHELPERDIR} -name "prerm"` @@ -105,6 +112,11 @@ sed -i "4a\BuildArch: $CPUARCH" ${RPMSPECDIR}/*.spec funcmakerpm(){ mkdir -pv ${RPMPACK}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${RPMSOURCESDIR} +FILECNT=`ls -l ${RPMSOURCESDIR} |grep "^-"|wc -l` +echo "prepare package $FILECNT bins" +if [ $FILECNT -ne 4 ]; then +exit 1 +fi SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` dos2unix ${SPECPATH} /bin/cp -f ${SPECPATH} ${RPMSPECDIR} -- Gitee From 8428602f1912a517113cd49d473e366c753d04ea Mon Sep 17 00:00:00 2001 From: BianTanggui <841018prgray^> Date: Mon, 29 Jun 2020 19:28:09 +0800 Subject: [PATCH 041/296] Match-id-494965a6755e5862805420517e67b3b8355bc2ae --- install/deb/scripts/prerm | 6 +++--- install/rpm/ascend-docker-plgugin.spec | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm index 0a97191..ebfb388 100644 --- a/install/deb/scripts/prerm +++ b/install/deb/scripts/prerm @@ -1,10 +1,10 @@ #!/bin/bash DIR=/etc/docker -if [ ! -d "${DIR}" ]; then -mkdir ${DIR} -fi SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" +if [ ! -f "${DST}" ]; then +exit 0 +fi BINDIR=/usr/bin ${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 291dc69..81cf029 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -42,6 +42,9 @@ DIR=/etc/docker BINDIR=/usr/bin SRC="${DIR}/daemon.json.${PPID}" DST="${DIR}/daemon.json" +if [ ! -f "${DST}" ]; then +exit 0 +fi ${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then echo "del damon.json failed\n" -- Gitee From 70b5d7ff3e7f90ca36638f7cdc3d71aaa45fb902 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 4 Jul 2020 18:06:46 +0800 Subject: [PATCH 042/296] Match-id-c4316230dc6d4215a0a107038252461f5d998e11 --- cli/src/CMakeLists.txt | 28 +- cli/src/basic.h | 34 ++ cli/src/cgrp.c | 214 ++++++++++++ cli/src/cgrp.h | 9 + cli/src/main.c | 726 +---------------------------------------- cli/src/mount.c | 256 +++++++++++++++ cli/src/mount.h | 8 + cli/src/ns.c | 54 +++ cli/src/ns.h | 11 + cli/src/utils.c | 185 +++++++++++ cli/src/utils.h | 23 ++ 11 files changed, 824 insertions(+), 724 deletions(-) create mode 100644 cli/src/basic.h create mode 100644 cli/src/cgrp.c create mode 100644 cli/src/cgrp.h create mode 100644 cli/src/mount.c create mode 100644 cli/src/mount.h create mode 100644 cli/src/ns.c create mode 100644 cli/src/ns.h create mode 100644 cli/src/utils.c create mode 100644 cli/src/utils.h diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 63a6a55..2449567 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -1,14 +1,14 @@ -cmake_minimum_required(VERSION 2.26) -project(ascend-docker-cli C) -set(CMAKE_C_STANDARD 11) -## The common options using by both c and cxx - -message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") - -include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") -aux_source_directory(. SRC) -add_subdirectory(HuaweiSecureC) -add_executable(ascend-docker-cli ${SRC}) -target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-cli -pie -Wl,-z,now HuaweiSecureC) +cmake_minimum_required(VERSION 2.26) +project(ascend-docker-cli C) +set(CMAKE_C_STANDARD 11) +## The common options using by both c and cxx + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") +aux_source_directory(. SRC) +add_subdirectory(HuaweiSecureC) +add_executable(ascend-docker-cli ${SRC}) +target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) +target_link_libraries(ascend-docker-cli -pie -Wl,-z,now HuaweiSecureC) diff --git a/cli/src/basic.h b/cli/src/basic.h new file mode 100644 index 0000000..e10986f --- /dev/null +++ b/cli/src/basic.h @@ -0,0 +1,34 @@ +#ifndef _BASIC_H +#define _BASIC_H + +#include + +#define DEVICE_NAME "davinci" +#define DAVINCI_MANAGER "davinci_manager" +#define DEVMM_SVM "devmm_svm" +#define HISI_HDC "hisi_hdc" +#define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" +#define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" +#define DEFAULT_DIR_MODE 0755 +#define BUF_SIZE 1024 + +#define ALLOW_PATH "/devices.allow" +#define ROOT_GAP 4 +#define FSTYPE_GAP 2 +#define MOUNT_SUBSTR_GAP 2 +#define ROOT_SUBSTR_GAP 2 + +struct CmdArgs { + char devices[BUF_SIZE]; + char rootfs[BUF_SIZE]; + int pid; +}; + +struct PathInfo { + char* src; + size_t srcLen; + char* dst; + size_t dstLen; +}; + +#endif \ No newline at end of file diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c new file mode 100644 index 0000000..62accfd --- /dev/null +++ b/cli/src/cgrp.c @@ -0,0 +1,214 @@ +#include "cgrp.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "securec.h" +#include "utils.h" + +char *GetCgroupMount(char *line, const char *subsys) +{ + if (!CheckRootDir(&line)) { + return NULL; + } + + char *mountPoint = NULL; + mountPoint = strsep(&line, " "); + line = strchr(line, '-'); + if (mountPoint == NULL || *mountPoint == '\0') { + return NULL; + } + + if (!CheckFsType(&line)) { + return NULL; + } + + if (!CheckSubStr(&line, subsys)) { + return NULL; + } + + return mountPoint; +} + +char *GetCgroupRoot(char *line, const char *subSystem) +{ + char *token = NULL; + int i; + for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { + token = strsep(&line, ":"); + if (token == NULL || *token == '\0') { + return NULL; + } + } + + char *rootDir = strsep(&line, ":"); + if (rootDir == NULL || *rootDir == '\0') { + return NULL; + } + + if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { + return NULL; + } + if (strstr(token, subSystem) == NULL) { + return NULL; + } + return rootDir; +} + +int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) +{ + int ret; + struct stat devStat; + char devPath[BUF_SIZE]; + + ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); + if (ret < 0) { + fprintf(stderr, "error: failed to assemble dev path for %s\n", devName); + return -1; + } + + ret = stat((const char *)devPath, &devStat); + if (ret < 0) { + fprintf(stderr, "error: failed to get stat of %s\n", devPath); + return -1; + } + + bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || + fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; + if (isFailed) { + fprintf(stderr, "error: write devices failed\n"); + return -1; + } + + return 0; +} + +int SetupDriverCgroup(FILE *cgroupAllow) +{ + int ret; + + ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); + if (ret < 0) { + fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC); + return -1; + } + + return 0; +} + +int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) +{ + int ret; + char mountPath[BUF_SIZE] = {0x0}; + char mount[BUF_SIZE] = {0x0}; + + ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); + if (ret < 0) { + fprintf(stderr, "error: assemble mount info path failed: ppid(%d)\n", getppid()); + return -1; + } + + ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); + if (ret < 0) { + fprintf(stderr, "error: cat file content failed\n"); + return -1; + } + + char cgroup[BUF_SIZE] = {0x0}; + char cgroupPath[BUF_SIZE] = {0x0}; + ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); + if (ret < 0) { + fprintf(stderr, "error: assemble cgroup path failed: pid(%d)\n", args->pid); + return -1; + } + + ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); + if (ret < 0) { + fprintf(stderr, "error: cat file content failed\n"); + return -1; + } + + // cut last '\n' off + cgroup[strcspn(cgroup, "\n")] = '\0'; + + ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); + if (ret < 0) { + fprintf(stderr, "error: assemble cgroup device path failed: \n"); + return -1; + } + + return 0; +} + +int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) +{ + int ret; + char deviceName[BUF_SIZE] = {0}; + char resolvedCgroupPath[PATH_MAX] = {0}; + FILE *cgroupAllow = NULL; + + if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize cgroup path: %s\n", cgroupPath); + return -1; + } + + static const char *sep = ","; + char list[BUF_SIZE] = {0}; + errno_t err = strncpy_s(list, BUF_SIZE, args->devices, strlen(args->devices)); + if (err != EOK) { + return -1; + } + char *token = NULL; + + cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); + if (cgroupAllow == NULL) { + fprintf(stderr, "error: failed to open cgroup file: %s\n", resolvedCgroupPath); + return -1; + } + + ret = SetupDriverCgroup(cgroupAllow); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to setup driver cgroup\n"); + return -1; + } + + token = strtok(list, sep); + while (token != NULL) { + ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); + return -1; + } + + ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); + if (ret < 0) { + fclose(cgroupAllow); + fprintf(stderr, "error: failed to setup cgroup %s\n", token); + return -1; + } + + token = strtok(NULL, sep); + } + + fclose(cgroupAllow); + return 0; +} \ No newline at end of file diff --git a/cli/src/cgrp.h b/cli/src/cgrp.h new file mode 100644 index 0000000..4272887 --- /dev/null +++ b/cli/src/cgrp.h @@ -0,0 +1,9 @@ +#ifndef _CGRP_H +#define _CGRP_H + +#include "basic.h" + +int GetCgroupPath(const struct CmdArgs *args, char *effPath, size_t maxSize); +int SetupCgroup(struct CmdArgs *args, const char *cgroupPath); + +#endif \ No newline at end of file diff --git a/cli/src/main.c b/cli/src/main.c index 7b59831..baa594f 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -4,48 +4,21 @@ */ #define _GNU_SOURCE #include -#include +#include #include #include -#include -#include -#include -#include +#include #include -#include -#include +#include #include -#include -#include -#include +#include +#include #include "securec.h" -#define DEVICE_NAME "davinci" -#define DAVINCI_MANAGER "davinci_manager" -#define DEVMM_SVM "devmm_svm" -#define HISI_HDC "hisi_hdc" -#define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" -#define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" -#define DEFAULT_DIR_MODE 0755 -#define BUF_SIZE 1024 -#define ALLOW_PATH "/devices.allow" -#define ROOT_GAP 4 -#define FSTYPE_GAP 2 -#define MOUNT_SUBSTR_GAP 2 -#define ROOT_SUBSTR_GAP 2 - -static struct option g_cmdOpts[] = { - {"devices", required_argument, 0, 'd'}, - {"pid", required_argument, 0, 'p'}, - {"rootfs", required_argument, 0, 'r'}, - {0, 0, 0, 0} -}; - -struct CmdArgs { - char devices[BUF_SIZE]; - char rootfs[BUF_SIZE]; - int pid; -}; +#include "basic.h" +#include "ns.h" +#include "mount.h" +#include "cgrp.h" struct ParsedConfig { char containerNsPath[BUF_SIZE]; @@ -53,11 +26,11 @@ struct ParsedConfig { int originNsFd; }; -struct PathInfo { - char* src; - size_t srcLen; - char* dst; - size_t dstLen; +static struct option g_cmdOpts[] = { + {"devices", required_argument, 0, 'd'}, + {"pid", required_argument, 0, 'p'}, + {"rootfs", required_argument, 0, 'r'}, + {0, 0, 0, 0} }; static inline bool IsCmdArgsValid(struct CmdArgs *args) @@ -65,673 +38,6 @@ static inline bool IsCmdArgsValid(struct CmdArgs *args) return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } -int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) -{ - static const char *fmtStr = "/proc/%d/ns/%s"; - return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, pid, nsType); -} - -int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) -{ - static const char *fmtStr = "/proc/self/ns/%s"; - return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, nsType); -} - -int EnterNsByFd(int fd, int nsType) -{ - int ret = setns(fd, nsType); - if (ret < 0) { - fprintf(stderr, "error: failed to set ns: fd(%d)\n", fd); - return -1; - } - - return 0; -} - -int EnterNsByPath(const char *path, int nsType) -{ - int fd; - int ret; - - fd = open(path, O_RDONLY); // proc文件接口,非外部输入 - if (fd < 0) { - fprintf(stderr, "error: failed to open ns path: %s\n", path); - return -1; - } - - ret = EnterNsByFd(fd, nsType); - if (ret < 0) { - fprintf(stderr, "error: failed to set ns: %s\n", path); - close(fd); - return -1; - } - - close(fd); - return 0; -} - -static int Mount(const char *src, const char *dst) -{ - static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; - int ret; - - ret = mount(src, dst, NULL, MS_BIND, NULL); - if (ret < 0) { - fprintf(stderr, "error: failed to mount\n"); - return -1; - } - - ret = mount(NULL, dst, NULL, remountFlags, NULL); - if (ret < 0) { - fprintf(stderr, "error: failed to re-mount\n"); - return -1; - } - - return 0; -} - -static int CreateFile(const char *path, mode_t mode) -{ - char resolvedPath[PATH_MAX] = {0}; - if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: failed to resolve path %s\n", path); - return -1; - } - - int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); - if (fd < 0) { - fprintf(stderr, "error: cannot create file: %s\n", resolvedPath); - return -1; - } - close(fd); - return 0; -} - -static int VerfifyPathInfo(const struct PathInfo* pathInfo) -{ - if (pathInfo == NULL || pathInfo->dst == NULL || pathInfo->src == NULL) { - return -1; - } - return 0; -} - -static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, - struct PathInfo* pathInfo) -{ - int ret; - error_t err; - char unresolvedDst[BUF_SIZE] = {0}; - char resolvedDst[PATH_MAX] = {0}; - - ret = VerfifyPathInfo(pathInfo); - if (ret < 0) { - return -1; - } - - size_t srcBufSize = pathInfo->srcLen; - size_t dstBufSize = pathInfo->dstLen; - char *src = pathInfo->src; - char *dst = pathInfo->dst; - - ret = snprintf_s(src, srcBufSize, srcBufSize, "/dev/%s", deviceName); - if (ret < 0) { - return -1; - } - - ret = snprintf_s(unresolvedDst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); - if (ret < 0) { - return -1; - } - - if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize device dst: %s\n", dst); - return -1; - } - - err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); - if (err != EOK) { - fprintf(stderr, "error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); - return -1; - } - - return 0; -} - -int MountDevice(const char *rootfs, const char *deviceName) -{ - int ret; - char src[BUF_SIZE] = {0}; - char dst[BUF_SIZE] = {0}; - struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - - ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); - if (ret < 0) { - fprintf(stderr, "error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); - return -1; - } - - struct stat srcStat; - ret = stat((const char *)src, &srcStat); - if (ret < 0) { - fprintf(stderr, "error: failed to stat src: %s\n", src); - return -1; - } - - ret = CreateFile(dst, srcStat.st_mode); - if (ret < 0) { - fprintf(stderr, "error: failed to create mount dst file: %s\n", dst); - return -1; - } - - ret = Mount(src, dst); - if (ret < 0) { - fprintf(stderr, "error: failed to mount dev\n"); - return -1; - } - - return 0; -} - -int DoDeviceMounting(const char *rootfs, const char *devicesList) -{ - static const char *sep = ","; - char list[BUF_SIZE] = {0}; - char deviceName[BUF_SIZE] = {0}; - - errno_t err = strncpy_s(list, BUF_SIZE, devicesList, strlen(devicesList)); - if (err != EOK) { - return -1; - } - char *token = NULL; - - token = strtok(list, sep); - while (token != NULL) { - int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); - if (ret < 0) { - fprintf(stderr, "error: assemble device name failed, id: %s\n", token); - return -1; - } - - ret = MountDevice(rootfs, deviceName); - if (ret < 0) { - fprintf(stderr, "error: failed to mount device no. %s\n", token); - return -1; - } - - token = strtok(NULL, sep); - } - - return 0; -} - -int CheckDirExists(const char *dir) -{ - DIR *ptr = opendir(dir); - if (NULL == ptr) { - fprintf(stderr, "path %s not exist\n", dir); - return -1; - } - - fprintf(stdout, "path %s exist\n", dir); - closedir(ptr); - return 0; -} - -int GetParentPathStr(const char *path, char *parent, size_t bufSize) -{ - char *ptr = strrchr(path, '/'); - if (ptr == NULL) { - return 0; - } - - int len = (int)strlen(path) - (int)strlen(ptr); - if (len < 1) { - return 0; - } - - errno_t ret = strncpy_s(parent, bufSize, path, len); - if (ret != EOK) { - return -1; - } - - return 0; -} - -int MakeDir(const char *dir, int mode) -{ - return mkdir(dir, mode); -} - -int MakeParentDir(const char *path, mode_t mode) -{ - if (*path == '\0' || *path == '.') { - return 0; - } - if (CheckDirExists(path) == 0) { - return 0; - } - - char parentPath[BUF_SIZE] = {0}; - GetParentPathStr(path, parentPath, BUF_SIZE); - if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { - return -1; - } - - struct stat s; - int ret = stat(path, &s); - if (ret < 0) { - fprintf(stderr, "error: failed to stat path: %s\n", path); - return (MakeDir(path, mode)); - } - - return 0; -} - -int MountDir(const char *rootfs, const char *src) -{ - int ret; - char dst[BUF_SIZE] = {0}; - - ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); - if (ret < 0) { - return -1; - } - - struct stat srcStat; - ret = stat(src, &srcStat); - if (ret < 0) { - return -1; - } - - /* directory */ - char parentDir[BUF_SIZE] = {0}; - GetParentPathStr(dst, parentDir, BUF_SIZE); - if (CheckDirExists(parentDir) < 0) { - mode_t parentMode = DEFAULT_DIR_MODE; - ret = MakeParentDir(parentDir, parentMode); - if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", parentDir); - return -1; - } - } - - if (CheckDirExists(dst) < 0) { - const mode_t curMode = srcStat.st_mode; - ret = MakeDir(dst, curMode); - if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", dst); - return -1; - } - } - - ret = Mount(src, dst); - if (ret < 0) { - fprintf(stderr, "error: failed to mount dir: %s to %s\n", src, dst); - return -1; - } - - return 0; -} - -int DoCtrlDeviceMounting(const char *rootfs) -{ - /* device */ - int ret = MountDevice(rootfs, DAVINCI_MANAGER); - if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", DAVINCI_MANAGER); - return -1; - } - - ret = MountDevice(rootfs, DEVMM_SVM); - if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", DEVMM_SVM); - return -1; - } - - ret = MountDevice(rootfs, HISI_HDC); - if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", HISI_HDC); - return -1; - } - - return 0; -} - -int DoDirectoryMounting(const char *rootfs) -{ - /* directory */ - int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); - if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_ADDONS_PATH); - if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", ASCEND_ADDONS_PATH); - return -1; - } - - return 0; -} - -int DoMounting(const struct CmdArgs *args) -{ - int ret; - - ret = DoDeviceMounting(args->rootfs, args->devices); - if (ret < 0) { - fprintf(stderr, "error: failed to do mounts\n"); - return -1; - } - - ret = DoCtrlDeviceMounting(args->rootfs); - if (ret < 0) { - fprintf(stderr, "error: failed to do mount files\n"); - return -1; - } - - ret = DoDirectoryMounting(args->rootfs); - if (ret < 0) { - fprintf(stderr, "error: failed to do mount directory\n"); - return -1; - } - - return 0; -} - -typedef char *(*ParseFileLine)(char *, const char *); - -int IsStrEqual(const char *s1, const char *s2) -{ - return (!strcmp(s1, s2)); -} - -int StrHasPrefix(const char *str, const char *prefix) -{ - return (!strncmp(str, prefix, strlen(prefix))); -} - -static bool CheckRootDir(char **pLine) -{ - char *rootDir = NULL; - for (int i = 0; i < ROOT_GAP; i++) { - /* root is substr before gap, line is substr after gap */ - rootDir = strsep(pLine, " "); - if (rootDir == NULL || *rootDir == '\0') { - return false; - } - } - - return strlen(rootDir) < BUF_SIZE && !StrHasPrefix(rootDir, "/.."); -} - -static bool CheckFsType(char **pLine) -{ - char* fsType = NULL; - for (int i = 0; i < FSTYPE_GAP; i++) { - fsType = strsep(pLine, " "); - if (fsType == NULL || *fsType == '\0') { - return false; - } - } - - return IsStrEqual(fsType, "cgroup"); -} - -static bool CheckSubStr(char **pLine, const char *subsys) -{ - char* substr = NULL; - for (int i = 0; i < MOUNT_SUBSTR_GAP; i++) { - substr = strsep(pLine, " "); - if (substr == NULL || *substr == '\0') { - return false; - } - } - - return strstr(substr, subsys) != NULL; -} - -char *GetCgroupMount(char *line, const char *subsys) -{ - if (!CheckRootDir(&line)) { - return NULL; - } - - char *mountPoint = NULL; - mountPoint = strsep(&line, " "); - line = strchr(line, '-'); - if (mountPoint == NULL || *mountPoint == '\0') { - return NULL; - } - - if (!CheckFsType(&line)) { - return NULL; - } - - if (!CheckSubStr(&line, subsys)) { - return NULL; - } - - return mountPoint; -} - -char *GetCgroupRoot(char *line, const char *subSystem) -{ - char *token = NULL; - int i; - for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { - token = strsep(&line, ":"); - if (token == NULL || *token == '\0') { - return NULL; - } - } - - char *rootDir = strsep(&line, ":"); - if (rootDir == NULL || *rootDir == '\0') { - return NULL; - } - - if (strlen(rootDir) >= BUF_SIZE || StrHasPrefix(rootDir, "/..")) { - return NULL; - } - if (strstr(token, subSystem) == NULL) { - return NULL; - } - return rootDir; -} - -int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) -{ - FILE *fp = NULL; - char *line = NULL; - size_t len = 0; - char resolvedPath[PATH_MAX] = {0x0}; - - if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize path %s\n", filepath); - return -1; - } - - fp = fopen(resolvedPath, "r"); - if (fp == NULL) { - fprintf(stderr, "cannot open file.\n"); - return -1; - } - - while (getline(&line, &len, fp) != -1) { - char* result = fn(line, "devices"); - if (result != NULL && strlen(result) < bufferSize) { - errno_t ret = strncpy_s(buffer, BUF_SIZE, result, strlen(result)); - if (ret != EOK) { - fclose(fp); - return -1; - } - break; - } - } - - if (line != NULL) { - free(line); - } - - fclose(fp); - return 0; -} - -int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) -{ - int ret; - struct stat devStat; - char devPath[BUF_SIZE]; - - ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); - if (ret < 0) { - fprintf(stderr, "error: failed to assemble dev path for %s\n", devName); - return -1; - } - - ret = stat((const char *)devPath, &devStat); - if (ret < 0) { - fprintf(stderr, "error: failed to get stat of %s\n", devPath); - return -1; - } - - bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || - fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; - if (isFailed) { - fprintf(stderr, "error: write devices failed\n"); - return -1; - } - - return 0; -} - -int SetupDriverCgroup(FILE *cgroupAllow) -{ - int ret; - - ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); - if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); - return -1; - } - - ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); - if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM); - return -1; - } - - ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); - if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC); - return -1; - } - - return 0; -} - -int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) -{ - int ret; - char mountPath[BUF_SIZE] = {0x0}; - char mount[BUF_SIZE] = {0x0}; - - ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); - if (ret < 0) { - fprintf(stderr, "error: assemble mount info path failed: ppid(%d)\n", getppid()); - return -1; - } - - ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); - if (ret < 0) { - fprintf(stderr, "error: cat file content failed\n"); - return -1; - } - - char cgroup[BUF_SIZE] = {0x0}; - char cgroupPath[BUF_SIZE] = {0x0}; - ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); - if (ret < 0) { - fprintf(stderr, "error: assemble cgroup path failed: pid(%d)\n", args->pid); - return -1; - } - - ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); - if (ret < 0) { - fprintf(stderr, "error: cat file content failed\n"); - return -1; - } - - // cut last '\n' off - cgroup[strcspn(cgroup, "\n")] = '\0'; - - ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); - if (ret < 0) { - fprintf(stderr, "error: assemble cgroup device path failed: \n"); - return -1; - } - - return 0; -} - -int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) -{ - int ret; - char deviceName[BUF_SIZE] = {0}; - char resolvedCgroupPath[PATH_MAX] = {0}; - FILE *cgroupAllow = NULL; - - if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize cgroup path: %s\n", cgroupPath); - return -1; - } - - static const char *sep = ","; - char list[BUF_SIZE] = {0}; - errno_t err = strncpy_s(list, BUF_SIZE, args->devices, strlen(args->devices)); - if (err != EOK) { - return -1; - } - char *token = NULL; - - cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); - if (cgroupAllow == NULL) { - fprintf(stderr, "error: failed to open cgroup file: %s\n", resolvedCgroupPath); - return -1; - } - - ret = SetupDriverCgroup(cgroupAllow); - if (ret < 0) { - fclose(cgroupAllow); - fprintf(stderr, "error: failed to setup driver cgroup\n"); - return -1; - } - - token = strtok(list, sep); - while (token != NULL) { - ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); - if (ret < 0) { - fclose(cgroupAllow); - fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); - return -1; - } - - ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); - if (ret < 0) { - fclose(cgroupAllow); - fprintf(stderr, "error: failed to setup cgroup %s\n", token); - return -1; - } - - token = strtok(NULL, sep); - } - - fclose(cgroupAllow); - return 0; -} - int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; @@ -764,7 +70,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return 0; } -int SetupMounts(struct CmdArgs *args) +int SetupContainer(struct CmdArgs *args) { int ret; struct ParsedConfig config; @@ -856,7 +162,7 @@ int Process(int argc, char **argv) return -1; } - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); if (ret < 0) { return ret; } diff --git a/cli/src/mount.c b/cli/src/mount.c new file mode 100644 index 0000000..cd581a6 --- /dev/null +++ b/cli/src/mount.c @@ -0,0 +1,256 @@ +#include "mount.h" + +#include +#include +#include +#include +#include +#include "securec.h" +#include "utils.h" + +static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, + struct PathInfo* pathInfo) +{ + int ret; + errno_t err; + char unresolvedDst[BUF_SIZE] = {0}; + char resolvedDst[PATH_MAX] = {0}; + + ret = VerfifyPathInfo(pathInfo); + if (ret < 0) { + return -1; + } + + size_t srcBufSize = pathInfo->srcLen; + size_t dstBufSize = pathInfo->dstLen; + char *src = pathInfo->src; + char *dst = pathInfo->dst; + + ret = snprintf_s(src, srcBufSize, srcBufSize, "/dev/%s", deviceName); + if (ret < 0) { + return -1; + } + + ret = snprintf_s(unresolvedDst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); + if (ret < 0) { + return -1; + } + + if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize device dst: %s\n", dst); + return -1; + } + + err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); + if (err != EOK) { + fprintf(stderr, "error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); + return -1; + } + + return 0; +} + +int MountDevice(const char *rootfs, const char *deviceName) +{ + int ret; + char src[BUF_SIZE] = {0}; + char dst[BUF_SIZE] = {0}; + struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; + + ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); + if (ret < 0) { + fprintf(stderr, "error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); + return -1; + } + + struct stat srcStat; + ret = stat((const char *)src, &srcStat); + if (ret < 0) { + fprintf(stderr, "error: failed to stat src: %s\n", src); + return -1; + } + + ret = CreateFile(dst, srcStat.st_mode); + if (ret < 0) { + fprintf(stderr, "error: failed to create mount dst file: %s\n", dst); + return -1; + } + + ret = Mount(src, dst); + if (ret < 0) { + fprintf(stderr, "error: failed to mount dev\n"); + return -1; + } + + return 0; +} + +int DoDeviceMounting(const char *rootfs, const char *devicesList) +{ + static const char *sep = ","; + char list[BUF_SIZE] = {0}; + char deviceName[BUF_SIZE] = {0}; + + errno_t err = strncpy_s(list, BUF_SIZE, devicesList, strlen(devicesList)); + if (err != EOK) { + return -1; + } + char *token = NULL; + + token = strtok(list, sep); + while (token != NULL) { + int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); + if (ret < 0) { + fprintf(stderr, "error: assemble device name failed, id: %s\n", token); + return -1; + } + + ret = MountDevice(rootfs, deviceName); + if (ret < 0) { + fprintf(stderr, "error: failed to mount device no. %s\n", token); + return -1; + } + + token = strtok(NULL, sep); + } + + return 0; +} + +int MakeParentDir(const char *path, mode_t mode) +{ + if (*path == '\0' || *path == '.') { + return 0; + } + if (CheckDirExists(path) == 0) { + return 0; + } + + char parentPath[BUF_SIZE] = {0}; + GetParentPathStr(path, parentPath, BUF_SIZE); + if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + return -1; + } + + struct stat s; + int ret = stat(path, &s); + if (ret < 0) { + fprintf(stderr, "error: failed to stat path: %s\n", path); + return (MakeDir(path, mode)); + } + + return 0; +} + +int MountDir(const char *rootfs, const char *src) +{ + int ret; + char dst[BUF_SIZE] = {0}; + + ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); + if (ret < 0) { + return -1; + } + + struct stat srcStat; + ret = stat(src, &srcStat); + if (ret < 0) { + return -1; + } + + /* directory */ + char parentDir[BUF_SIZE] = {0}; + GetParentPathStr(dst, parentDir, BUF_SIZE); + if (CheckDirExists(parentDir) < 0) { + mode_t parentMode = DEFAULT_DIR_MODE; + ret = MakeParentDir(parentDir, parentMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", parentDir); + return -1; + } + } + + if (CheckDirExists(dst) < 0) { + const mode_t curMode = srcStat.st_mode; + ret = MakeDir(dst, curMode); + if (ret < 0) { + fprintf(stderr, "error: failed to make dir: %s\n", dst); + return -1; + } + } + + ret = Mount(src, dst); + if (ret < 0) { + fprintf(stderr, "error: failed to mount dir: %s to %s\n", src, dst); + return -1; + } + + return 0; +} + +int DoCtrlDeviceMounting(const char *rootfs) +{ + /* device */ + int ret = MountDevice(rootfs, DAVINCI_MANAGER); + if (ret < 0) { + fprintf(stderr, "error: failed to mount device %s\n", DAVINCI_MANAGER); + return -1; + } + + ret = MountDevice(rootfs, DEVMM_SVM); + if (ret < 0) { + fprintf(stderr, "error: failed to mount device %s\n", DEVMM_SVM); + return -1; + } + + ret = MountDevice(rootfs, HISI_HDC); + if (ret < 0) { + fprintf(stderr, "error: failed to mount device %s\n", HISI_HDC); + return -1; + } + + return 0; +} + +int DoDirectoryMounting(const char *rootfs) +{ + /* directory */ + int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_ADDONS_PATH); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount %s\n", ASCEND_ADDONS_PATH); + return -1; + } + + return 0; +} + +int DoMounting(const struct CmdArgs *args) +{ + int ret; + + ret = DoDeviceMounting(args->rootfs, args->devices); + if (ret < 0) { + fprintf(stderr, "error: failed to do mounts\n"); + return -1; + } + + ret = DoCtrlDeviceMounting(args->rootfs); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount files\n"); + return -1; + } + + ret = DoDirectoryMounting(args->rootfs); + if (ret < 0) { + fprintf(stderr, "error: failed to do mount directory\n"); + return -1; + } + + return 0; +} \ No newline at end of file diff --git a/cli/src/mount.h b/cli/src/mount.h new file mode 100644 index 0000000..769137f --- /dev/null +++ b/cli/src/mount.h @@ -0,0 +1,8 @@ +#ifndef _MOUNT_H +#define _MOUNT_H + +#include "basic.h" + +int DoMounting(const struct CmdArgs *args); + +#endif \ No newline at end of file diff --git a/cli/src/ns.c b/cli/src/ns.c new file mode 100644 index 0000000..ff9be07 --- /dev/null +++ b/cli/src/ns.c @@ -0,0 +1,54 @@ +#define _GNU_SOURCE +#include "ns.h" + +#include +#include +#include +#include "securec.h" + +#include "basic.h" + +int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) +{ + static const char *fmtStr = "/proc/%d/ns/%s"; + return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, pid, nsType); +} + +int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) +{ + static const char *fmtStr = "/proc/self/ns/%s"; + return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, nsType); +} + +int EnterNsByFd(int fd, int nsType) +{ + int ret = setns(fd, nsType); + if (ret < 0) { + fprintf(stderr, "error: failed to set ns: fd(%d)\n", fd); + return -1; + } + + return 0; +} + +int EnterNsByPath(const char *path, int nsType) +{ + int fd; + int ret; + + fd = open(path, O_RDONLY); // proc文件接口,非外部输入 + if (fd < 0) { + fprintf(stderr, "error: failed to open ns path: %s\n", path); + return -1; + } + + ret = EnterNsByFd(fd, nsType); + if (ret < 0) { + fprintf(stderr, "error: failed to set ns: %s\n", path); + close(fd); + return -1; + } + + close(fd); + return 0; +} \ No newline at end of file diff --git a/cli/src/ns.h b/cli/src/ns.h new file mode 100644 index 0000000..af3c963 --- /dev/null +++ b/cli/src/ns.h @@ -0,0 +1,11 @@ +#ifndef _NS_H +#define _NS_H + +#include + +int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); +int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); +int EnterNsByFd(int fd, int nsType); +int EnterNsByPath(const char *path, int nsType); + +#endif \ No newline at end of file diff --git a/cli/src/utils.c b/cli/src/utils.c new file mode 100644 index 0000000..47bd293 --- /dev/null +++ b/cli/src/utils.c @@ -0,0 +1,185 @@ +#include "utils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "securec.h" + +int IsStrEqual(const char *s1, const char *s2) +{ + return (!strcmp(s1, s2)); +} + +int StrHasPrefix(const char *str, const char *prefix) +{ + return (!strncmp(str, prefix, strlen(prefix))); +} + +bool CheckRootDir(char **pLine) +{ + char *rootDir = NULL; + for (int i = 0; i < ROOT_GAP; i++) { + /* root is substr before gap, line is substr after gap */ + rootDir = strsep(pLine, " "); + if (rootDir == NULL || *rootDir == '\0') { + return false; + } + } + + return strlen(rootDir) < BUF_SIZE && !StrHasPrefix(rootDir, "/.."); +} + +bool CheckFsType(char **pLine) +{ + char* fsType = NULL; + for (int i = 0; i < FSTYPE_GAP; i++) { + fsType = strsep(pLine, " "); + if (fsType == NULL || *fsType == '\0') { + return false; + } + } + + return IsStrEqual(fsType, "cgroup"); +} + +bool CheckSubStr(char **pLine, const char *subsys) +{ + char* substr = NULL; + for (int i = 0; i < MOUNT_SUBSTR_GAP; i++) { + substr = strsep(pLine, " "); + if (substr == NULL || *substr == '\0') { + return false; + } + } + + return strstr(substr, subsys) != NULL; +} + +int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +{ + FILE *fp = NULL; + char *line = NULL; + size_t len = 0; + char resolvedPath[PATH_MAX] = {0x0}; + + if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: cannot canonicalize path %s\n", filepath); + return -1; + } + + fp = fopen(resolvedPath, "r"); + if (fp == NULL) { + fprintf(stderr, "cannot open file.\n"); + return -1; + } + + while (getline(&line, &len, fp) != -1) { + char* result = fn(line, "devices"); + if (result != NULL && strlen(result) < bufferSize) { + errno_t ret = strncpy_s(buffer, BUF_SIZE, result, strlen(result)); + if (ret != EOK) { + fclose(fp); + return -1; + } + break; + } + } + + if (line != NULL) { + free(line); + } + + fclose(fp); + return 0; +} + +int MakeDir(const char *dir, int mode) +{ + return mkdir(dir, mode); +} + +int CheckDirExists(const char *dir) +{ + DIR *ptr = opendir(dir); + if (NULL == ptr) { + fprintf(stderr, "path %s not exist\n", dir); + return -1; + } + + fprintf(stdout, "path %s exist\n", dir); + closedir(ptr); + return 0; +} + +int GetParentPathStr(const char *path, char *parent, size_t bufSize) +{ + char *ptr = strrchr(path, '/'); + if (ptr == NULL) { + return 0; + } + + int len = (int)strlen(path) - (int)strlen(ptr); + if (len < 1) { + return 0; + } + + errno_t ret = strncpy_s(parent, bufSize, path, len); + if (ret != EOK) { + return -1; + } + + return 0; +} + +int CreateFile(const char *path, mode_t mode) +{ + char resolvedPath[PATH_MAX] = {0}; + if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { + fprintf(stderr, "error: failed to resolve path %s\n", path); + return -1; + } + + int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); + if (fd < 0) { + fprintf(stderr, "error: cannot create file: %s\n", resolvedPath); + return -1; + } + close(fd); + return 0; +} + +int VerfifyPathInfo(const struct PathInfo* pathInfo) +{ + if (pathInfo == NULL || pathInfo->dst == NULL || pathInfo->src == NULL) { + return -1; + } + return 0; +} + +int Mount(const char *src, const char *dst) +{ + static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; + int ret; + + ret = mount(src, dst, NULL, MS_BIND, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to mount\n"); + return -1; + } + + ret = mount(NULL, dst, NULL, remountFlags, NULL); + if (ret < 0) { + fprintf(stderr, "error: failed to re-mount\n"); + return -1; + } + + return 0; +} \ No newline at end of file diff --git a/cli/src/utils.h b/cli/src/utils.h new file mode 100644 index 0000000..d4a0052 --- /dev/null +++ b/cli/src/utils.h @@ -0,0 +1,23 @@ +#ifndef _UTILS_H +#define _UTILS_H + +#include +#include +#include +#include "basic.h" + +typedef char *(*ParseFileLine)(char *, const char *); +int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); +bool CheckFsType(char **pLine); +bool CheckSubStr(char **pLine, const char *subsys); +bool CheckRootDir(char **pLine); +int MakeDir(const char *dir, int mode); +int CheckDirExists(const char *dir); +int GetParentPathStr(const char *path, char *parent, size_t bufSize); +int CreateFile(const char *path, mode_t mode); +int VerfifyPathInfo(const struct PathInfo* pathInfo); +int Mount(const char *src, const char *dst); +int IsStrEqual(const char *s1, const char *s2); +int StrHasPrefix(const char *str, const char *prefix); + +#endif \ No newline at end of file -- Gitee From d29403afa529d2fd31a1df83953b1f78d30246e6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 4 Jul 2020 19:12:20 +0800 Subject: [PATCH 043/296] Match-id-0342455040ca22ad7bef331d4c7e37bae4fa44bf --- cli/src/cgrp.c | 33 ++++++++++++----------- cli/src/logging.c | 22 ++++++++++++++++ cli/src/logging.h | 7 +++++ cli/src/main.c | 24 ++++++++--------- cli/src/mount.c | 67 +++++++++++++++-------------------------------- cli/src/ns.c | 10 +++---- cli/src/utils.c | 46 +++++++++++++++++++++++++------- cli/src/utils.h | 9 ++++--- 8 files changed, 126 insertions(+), 92 deletions(-) create mode 100644 cli/src/logging.c create mode 100644 cli/src/logging.h diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 62accfd..7b5eb02 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -10,6 +10,7 @@ #include #include "securec.h" #include "utils.h" +#include "logging.h" char *GetCgroupMount(char *line, const char *subsys) { @@ -68,20 +69,20 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - fprintf(stderr, "error: failed to assemble dev path for %s\n", devName); + logError("error: failed to assemble dev path for %s\n", devName); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - fprintf(stderr, "error: failed to get stat of %s\n", devPath); + logError("error: failed to get stat of %s\n", devPath); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - fprintf(stderr, "error: write devices failed\n"); + logError("error: write devices failed\n"); return -1; } @@ -94,19 +95,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); + logError("error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", DEVMM_SVM); + logError("error: failed to setup cgroup for %s\n", DEVMM_SVM); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - fprintf(stderr, "error: failed to setup cgroup for %s\n", HISI_HDC); + logError("error: failed to setup cgroup for %s\n", HISI_HDC); return -1; } @@ -121,13 +122,13 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - fprintf(stderr, "error: assemble mount info path failed: ppid(%d)\n", getppid()); + logError("error: assemble mount info path failed: ppid(%d)\n", getppid()); return -1; } ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - fprintf(stderr, "error: cat file content failed\n"); + logError("error: cat file content failed\n"); return -1; } @@ -135,13 +136,13 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char cgroupPath[BUF_SIZE] = {0x0}; ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); if (ret < 0) { - fprintf(stderr, "error: assemble cgroup path failed: pid(%d)\n", args->pid); + logError("error: assemble cgroup path failed: pid(%d)\n", args->pid); return -1; } ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - fprintf(stderr, "error: cat file content failed\n"); + logError("error: cat file content failed\n"); return -1; } @@ -150,7 +151,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - fprintf(stderr, "error: assemble cgroup device path failed: \n"); + logError("error: assemble cgroup device path failed: \n"); return -1; } @@ -165,7 +166,7 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) FILE *cgroupAllow = NULL; if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize cgroup path: %s\n", cgroupPath); + logError("error: cannot canonicalize cgroup path: %s\n", cgroupPath); return -1; } @@ -179,14 +180,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - fprintf(stderr, "error: failed to open cgroup file: %s\n", resolvedCgroupPath); + logError("error: failed to open cgroup file: %s\n", resolvedCgroupPath); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - fprintf(stderr, "error: failed to setup driver cgroup\n"); + logError("error: failed to setup driver cgroup\n"); return -1; } @@ -195,14 +196,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { fclose(cgroupAllow); - fprintf(stderr, "error: failed to assemble device path for no.%s\n", token); + logError("error: failed to assemble device path for no.%s\n", token); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - fprintf(stderr, "error: failed to setup cgroup %s\n", token); + logError("error: failed to setup cgroup %s\n", token); return -1; } diff --git a/cli/src/logging.c b/cli/src/logging.c new file mode 100644 index 0000000..b269168 --- /dev/null +++ b/cli/src/logging.c @@ -0,0 +1,22 @@ +#include "logging.h" + +#include +#include + +void logError(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + fprintf(stderr, fmt, args); + va_end(args); +} + +void logInfo(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + fprintf(stdout, fmt, args); + va_end(args); +} \ No newline at end of file diff --git a/cli/src/logging.h b/cli/src/logging.h new file mode 100644 index 0000000..0ddef00 --- /dev/null +++ b/cli/src/logging.h @@ -0,0 +1,7 @@ +#ifndef _LOGGING_H +#define _LOGGING_H + +void logError(const char *fmt, ...); +void logInfo(const char *fmt, ...); + +#endif diff --git a/cli/src/main.c b/cli/src/main.c index baa594f..abe9f63 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -3,7 +3,6 @@ * Description: ascend-docker-cli工具,配置容器挂载Ascend NPU设备 */ #define _GNU_SOURCE -#include #include #include #include @@ -19,6 +18,7 @@ #include "ns.h" #include "mount.h" #include "cgrp.h" +#include "logging.h" struct ParsedConfig { char containerNsPath[BUF_SIZE]; @@ -44,26 +44,26 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - fprintf(stderr, "error: failed to get container mnt ns path: pid(%d)\n", args->pid); + logError("error: failed to get container mnt ns path: pid(%d)\n", args->pid); return -1; } ret = GetCgroupPath(args, config->cgroupPath, BUF_SIZE); if (ret < 0) { - fprintf(stderr, "error: failed to get cgroup path\n"); + logError("error: failed to get cgroup path\n"); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - fprintf(stderr, "error: failed to get self ns path\n"); + logError("error: failed to get self ns path\n"); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - fprintf(stderr, "error: failed to get self ns fd: %s\n", originNsPath); + logError("error: failed to get self ns fd: %s\n", originNsPath); return -1; } @@ -77,28 +77,28 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - fprintf(stderr, "error: failed to prepare nesessary config\n"); + logError("error: failed to prepare nesessary config\n"); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - fprintf(stderr, "error: failed to set to container ns: %s\n", config.containerNsPath); + logError("error: failed to set to container ns: %s\n", config.containerNsPath); close(config.originNsFd); return -1; } ret = DoMounting(args); if (ret < 0) { - fprintf(stderr, "error: failed to do mounting\n"); + logError("error: failed to do mounting\n"); close(config.originNsFd); return -1; } ret = SetupCgroup(args, (const char *)config.cgroupPath); if (ret < 0) { - fprintf(stderr, "error: failed to set up cgroup\n"); + logError("error: failed to set up cgroup\n"); close(config.originNsFd); return -1; } @@ -106,7 +106,7 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - fprintf(stderr, "error: failed to set ns back\n"); + logError("error: failed to set ns back\n"); close(config.originNsFd); return -1; } @@ -151,14 +151,14 @@ int Process(int argc, char **argv) } break; default: - fprintf(stderr, "unrecongnized option\n"); + logError("unrecongnized option\n"); isSucceed = false; // unrecognized option break; } } if (!isSucceed || !IsCmdArgsValid(&args)) { - fprintf(stderr, "error: information not completed or valid.\n"); + logError("error: information not completed or valid.\n"); return -1; } diff --git a/cli/src/mount.c b/cli/src/mount.c index cd581a6..53ea5ea 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -1,12 +1,12 @@ #include "mount.h" -#include #include #include #include #include #include "securec.h" #include "utils.h" +#include "logging.h" static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, struct PathInfo* pathInfo) @@ -37,13 +37,13 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize device dst: %s\n", dst); + logError("error: cannot canonicalize device dst: %s\n", dst); return -1; } err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); if (err != EOK) { - fprintf(stderr, "error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); + logError("error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); return -1; } @@ -59,26 +59,26 @@ int MountDevice(const char *rootfs, const char *deviceName) ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); if (ret < 0) { - fprintf(stderr, "error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); + logError("error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - fprintf(stderr, "error: failed to stat src: %s\n", src); + logError("error: failed to stat src: %s\n", src); return -1; } ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - fprintf(stderr, "error: failed to create mount dst file: %s\n", dst); + logError("error: failed to create mount dst file: %s\n", dst); return -1; } ret = Mount(src, dst); if (ret < 0) { - fprintf(stderr, "error: failed to mount dev\n"); + logError("error: failed to mount dev\n"); return -1; } @@ -101,13 +101,13 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) while (token != NULL) { int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { - fprintf(stderr, "error: assemble device name failed, id: %s\n", token); + logError("error: assemble device name failed, id: %s\n", token); return -1; } ret = MountDevice(rootfs, deviceName); if (ret < 0) { - fprintf(stderr, "error: failed to mount device no. %s\n", token); + logError("error: failed to mount device no. %s\n", token); return -1; } @@ -117,31 +117,6 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) return 0; } -int MakeParentDir(const char *path, mode_t mode) -{ - if (*path == '\0' || *path == '.') { - return 0; - } - if (CheckDirExists(path) == 0) { - return 0; - } - - char parentPath[BUF_SIZE] = {0}; - GetParentPathStr(path, parentPath, BUF_SIZE); - if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { - return -1; - } - - struct stat s; - int ret = stat(path, &s); - if (ret < 0) { - fprintf(stderr, "error: failed to stat path: %s\n", path); - return (MakeDir(path, mode)); - } - - return 0; -} - int MountDir(const char *rootfs, const char *src) { int ret; @@ -165,23 +140,23 @@ int MountDir(const char *rootfs, const char *src) mode_t parentMode = DEFAULT_DIR_MODE; ret = MakeParentDir(parentDir, parentMode); if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", parentDir); + logError("error: failed to make dir: %s\n", parentDir); return -1; } } if (CheckDirExists(dst) < 0) { const mode_t curMode = srcStat.st_mode; - ret = MakeDir(dst, curMode); + ret = MkDir(dst, curMode); if (ret < 0) { - fprintf(stderr, "error: failed to make dir: %s\n", dst); + logError("error: failed to make dir: %s\n", dst); return -1; } } ret = Mount(src, dst); if (ret < 0) { - fprintf(stderr, "error: failed to mount dir: %s to %s\n", src, dst); + logError("error: failed to mount dir: %s to %s\n", src, dst); return -1; } @@ -193,19 +168,19 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER); if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", DAVINCI_MANAGER); + logError("error: failed to mount device %s\n", DAVINCI_MANAGER); return -1; } ret = MountDevice(rootfs, DEVMM_SVM); if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", DEVMM_SVM); + logError("error: failed to mount device %s\n", DEVMM_SVM); return -1; } ret = MountDevice(rootfs, HISI_HDC); if (ret < 0) { - fprintf(stderr, "error: failed to mount device %s\n", HISI_HDC); + logError("error: failed to mount device %s\n", HISI_HDC); return -1; } @@ -217,13 +192,13 @@ int DoDirectoryMounting(const char *rootfs) /* directory */ int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", ASCEND_DRIVER_PATH); + logError("error: failed to do mount %s\n", ASCEND_DRIVER_PATH); return -1; } ret = MountDir(rootfs, ASCEND_ADDONS_PATH); if (ret < 0) { - fprintf(stderr, "error: failed to do mount %s\n", ASCEND_ADDONS_PATH); + logError("error: failed to do mount %s\n", ASCEND_ADDONS_PATH); return -1; } @@ -236,19 +211,19 @@ int DoMounting(const struct CmdArgs *args) ret = DoDeviceMounting(args->rootfs, args->devices); if (ret < 0) { - fprintf(stderr, "error: failed to do mounts\n"); + logError("error: failed to do mounts\n"); return -1; } ret = DoCtrlDeviceMounting(args->rootfs); if (ret < 0) { - fprintf(stderr, "error: failed to do mount files\n"); + logError("error: failed to do mount files\n"); return -1; } ret = DoDirectoryMounting(args->rootfs); if (ret < 0) { - fprintf(stderr, "error: failed to do mount directory\n"); + logError("error: failed to do mount directory\n"); return -1; } diff --git a/cli/src/ns.c b/cli/src/ns.c index ff9be07..def63f0 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -4,9 +4,9 @@ #include #include #include -#include "securec.h" - #include "basic.h" +#include "securec.h" +#include "logging.h" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { @@ -24,7 +24,7 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - fprintf(stderr, "error: failed to set ns: fd(%d)\n", fd); + logError("error: failed to set ns: fd(%d)\n", fd); return -1; } @@ -38,13 +38,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - fprintf(stderr, "error: failed to open ns path: %s\n", path); + logError("error: failed to open ns path: %s\n", path); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - fprintf(stderr, "error: failed to set ns: %s\n", path); + logError("error: failed to set ns: %s\n", path); close(fd); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index 47bd293..bd20826 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -1,9 +1,9 @@ #include "utils.h" +#include #include #include #include -#include #include #include #include @@ -12,6 +12,7 @@ #include #include #include "securec.h" +#include "logging.h" int IsStrEqual(const char *s1, const char *s2) { @@ -71,13 +72,13 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: cannot canonicalize path %s\n", filepath); + logError("error: cannot canonicalize path %s\n", filepath); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - fprintf(stderr, "cannot open file.\n"); + logError("cannot open file.\n"); return -1; } @@ -101,20 +102,45 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f return 0; } -int MakeDir(const char *dir, int mode) +int MkDir(const char *dir, int mode) { return mkdir(dir, mode); } +int MakeParentDir(const char *path, mode_t mode) +{ + if (*path == '\0' || *path == '.') { + return 0; + } + if (CheckDirExists(path) == 0) { + return 0; + } + + char parentPath[BUF_SIZE] = {0}; + GetParentPathStr(path, parentPath, BUF_SIZE); + if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + return -1; + } + + struct stat s; + int ret = stat(path, &s); + if (ret < 0) { + logError("error: failed to stat path: %s\n", path); + return (MkDir(path, mode)); + } + + return 0; +} + int CheckDirExists(const char *dir) { DIR *ptr = opendir(dir); if (NULL == ptr) { - fprintf(stderr, "path %s not exist\n", dir); + logError("path %s not exist\n", dir); return -1; } - fprintf(stdout, "path %s exist\n", dir); + logInfo("path %s exist\n", dir); closedir(ptr); return 0; } @@ -143,13 +169,13 @@ int CreateFile(const char *path, mode_t mode) { char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - fprintf(stderr, "error: failed to resolve path %s\n", path); + logError("error: failed to resolve path %s\n", path); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - fprintf(stderr, "error: cannot create file: %s\n", resolvedPath); + logError("error: cannot create file: %s\n", resolvedPath); return -1; } close(fd); @@ -171,13 +197,13 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, MS_BIND, NULL); if (ret < 0) { - fprintf(stderr, "error: failed to mount\n"); + logError("error: failed to mount\n"); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - fprintf(stderr, "error: failed to re-mount\n"); + logError("error: failed to re-mount\n"); return -1; } diff --git a/cli/src/utils.h b/cli/src/utils.h index d4a0052..7d1f8f7 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -6,18 +6,21 @@ #include #include "basic.h" +// For cgroup setup +int StrHasPrefix(const char *str, const char *prefix); typedef char *(*ParseFileLine)(char *, const char *); int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); bool CheckFsType(char **pLine); bool CheckSubStr(char **pLine, const char *subsys); bool CheckRootDir(char **pLine); -int MakeDir(const char *dir, int mode); + +// For mount setup +int MkDir(const char *dir, int mode); +int MakeParentDir(const char *path, mode_t mode); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int CreateFile(const char *path, mode_t mode); int VerfifyPathInfo(const struct PathInfo* pathInfo); int Mount(const char *src, const char *dst); -int IsStrEqual(const char *s1, const char *s2); -int StrHasPrefix(const char *str, const char *prefix); #endif \ No newline at end of file -- Gitee From cd41979504e99fb51d4dfaeedc4c0e48cc3a88fd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 5 Jul 2020 12:06:17 +0800 Subject: [PATCH 044/296] Match-id-b08926bead0de9d389a4ccbc630730c47db50300 --- cli/src/basic.h | 4 ++++ cli/src/cgrp.c | 4 ++++ cli/src/cgrp.h | 4 ++++ cli/src/logging.c | 4 ++++ cli/src/logging.h | 4 ++++ cli/src/mount.c | 8 +++++-- cli/src/mount.h | 4 ++++ cli/src/ns.c | 4 ++++ cli/src/ns.h | 6 ++++- cli/src/utils.c | 61 +++++++++++++++++++++++++---------------------- cli/src/utils.h | 15 +++++++----- 11 files changed, 80 insertions(+), 38 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index e10986f..835310c 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具公共宏和结构体定义 +*/ #ifndef _BASIC_H #define _BASIC_H diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 7b5eb02..e84dfca 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器CGroup配置模块 +*/ #include "cgrp.h" #include diff --git a/cli/src/cgrp.h b/cli/src/cgrp.h index 4272887..f4fa949 100644 --- a/cli/src/cgrp.h +++ b/cli/src/cgrp.h @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器CGroup配置模块头文件 +*/ #ifndef _CGRP_H #define _CGRP_H diff --git a/cli/src/logging.c b/cli/src/logging.c index b269168..b42f479 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具日志模块 +*/ #include "logging.h" #include diff --git a/cli/src/logging.h b/cli/src/logging.h index 0ddef00..3b8b5f4 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具日志模块头文件 +*/ #ifndef _LOGGING_H #define _LOGGING_H diff --git a/cli/src/mount.c b/cli/src/mount.c index 53ea5ea..7be1c94 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -1,8 +1,12 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器设备与驱动挂载模块 +*/ #include "mount.h" -#include #include #include +#include #include #include "securec.h" #include "utils.h" @@ -16,7 +20,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, char unresolvedDst[BUF_SIZE] = {0}; char resolvedDst[PATH_MAX] = {0}; - ret = VerfifyPathInfo(pathInfo); + ret = VerifyPathInfo(pathInfo); if (ret < 0) { return -1; } diff --git a/cli/src/mount.h b/cli/src/mount.h index 769137f..ddefced 100644 --- a/cli/src/mount.h +++ b/cli/src/mount.h @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器设备与驱动挂载模块头文件 +*/ #ifndef _MOUNT_H #define _MOUNT_H diff --git a/cli/src/ns.c b/cli/src/ns.c index def63f0..5256a5e 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器Namespace实用函数模块 +*/ #define _GNU_SOURCE #include "ns.h" diff --git a/cli/src/ns.h b/cli/src/ns.h index af3c963..18c4be3 100644 --- a/cli/src/ns.h +++ b/cli/src/ns.h @@ -1,9 +1,13 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器Namespace实用函数模块头文件 +*/ #ifndef _NS_H #define _NS_H #include -int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); +int GetNsPath(int pid, const char *nsType, char *buf, size_t bufSize); int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); int EnterNsByFd(int fd, int nsType); int EnterNsByPath(const char *path, int nsType); diff --git a/cli/src/utils.c b/cli/src/utils.c index bd20826..8b2faaf 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -1,8 +1,11 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具实用函数模块 +*/ #include "utils.h" #include #include -#include #include #include #include @@ -14,7 +17,7 @@ #include "securec.h" #include "logging.h" -int IsStrEqual(const char *s1, const char *s2) +static int IsStrEqual(const char *s1, const char *s2) { return (!strcmp(s1, s2)); } @@ -107,28 +110,11 @@ int MkDir(const char *dir, int mode) return mkdir(dir, mode); } -int MakeParentDir(const char *path, mode_t mode) +int VerifyPathInfo(const struct PathInfo* pathInfo) { - if (*path == '\0' || *path == '.') { - return 0; - } - if (CheckDirExists(path) == 0) { - return 0; - } - - char parentPath[BUF_SIZE] = {0}; - GetParentPathStr(path, parentPath, BUF_SIZE); - if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + if (pathInfo == NULL || pathInfo->dst == NULL || pathInfo->src == NULL) { return -1; } - - struct stat s; - int ret = stat(path, &s); - if (ret < 0) { - logError("error: failed to stat path: %s\n", path); - return (MkDir(path, mode)); - } - return 0; } @@ -165,6 +151,31 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) return 0; } +int MakeParentDir(const char *path, mode_t mode) +{ + if (*path == '\0' || *path == '.') { + return 0; + } + if (CheckDirExists(path) == 0) { + return 0; + } + + char parentPath[BUF_SIZE] = {0}; + GetParentPathStr(path, parentPath, BUF_SIZE); + if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + return -1; + } + + struct stat s; + int ret = stat(path, &s); + if (ret < 0) { + logError("error: failed to stat path: %s\n", path); + return (MkDir(path, mode)); + } + + return 0; +} + int CreateFile(const char *path, mode_t mode) { char resolvedPath[PATH_MAX] = {0}; @@ -182,14 +193,6 @@ int CreateFile(const char *path, mode_t mode) return 0; } -int VerfifyPathInfo(const struct PathInfo* pathInfo) -{ - if (pathInfo == NULL || pathInfo->dst == NULL || pathInfo->src == NULL) { - return -1; - } - return 0; -} - int Mount(const char *src, const char *dst) { static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; diff --git a/cli/src/utils.h b/cli/src/utils.h index 7d1f8f7..cd5892d 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -1,26 +1,29 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具实用函数模块头文件 +*/ #ifndef _UTILS_H #define _UTILS_H #include -#include #include #include "basic.h" // For cgroup setup int StrHasPrefix(const char *str, const char *prefix); -typedef char *(*ParseFileLine)(char *, const char *); -int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); +bool CheckRootDir(char **pLine); bool CheckFsType(char **pLine); bool CheckSubStr(char **pLine, const char *subsys); -bool CheckRootDir(char **pLine); +typedef char *(*ParseFileLine)(char *, const char *); +int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); // For mount setup int MkDir(const char *dir, int mode); -int MakeParentDir(const char *path, mode_t mode); +int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); +int MakeParentDir(const char *path, mode_t mode); int CreateFile(const char *path, mode_t mode); -int VerfifyPathInfo(const struct PathInfo* pathInfo); int Mount(const char *src, const char *dst); #endif \ No newline at end of file -- Gitee From a9ec6444888f2d717e305da723f7bb79a0b73c69 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 6 Jul 2020 11:13:00 +0800 Subject: [PATCH 045/296] Match-id-2dde9f027721ce1b2cc97d2c9c433ea457db8afd --- cli/src/cgrp.c | 32 ++++++++++++++++---------------- cli/src/logging.c | 4 ++-- cli/src/logging.h | 4 ++-- cli/src/main.c | 22 +++++++++++----------- cli/src/mount.c | 38 +++++++++++++++++++------------------- cli/src/ns.c | 6 +++--- cli/src/utils.c | 18 +++++++++--------- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index e84dfca..7cf2757 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -73,20 +73,20 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - logError("error: failed to assemble dev path for %s\n", devName); + LogError("error: failed to assemble dev path for %s\n", devName); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - logError("error: failed to get stat of %s\n", devPath); + LogError("error: failed to get stat of %s\n", devPath); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - logError("error: write devices failed\n"); + LogError("error: write devices failed\n"); return -1; } @@ -99,19 +99,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - logError("error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); + LogError("error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - logError("error: failed to setup cgroup for %s\n", DEVMM_SVM); + LogError("error: failed to setup cgroup for %s\n", DEVMM_SVM); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - logError("error: failed to setup cgroup for %s\n", HISI_HDC); + LogError("error: failed to setup cgroup for %s\n", HISI_HDC); return -1; } @@ -126,13 +126,13 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - logError("error: assemble mount info path failed: ppid(%d)\n", getppid()); + LogError("error: assemble mount info path failed: ppid(%d)\n", getppid()); return -1; } ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - logError("error: cat file content failed\n"); + LogError("error: cat file content failed\n"); return -1; } @@ -140,13 +140,13 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char cgroupPath[BUF_SIZE] = {0x0}; ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); if (ret < 0) { - logError("error: assemble cgroup path failed: pid(%d)\n", args->pid); + LogError("error: assemble cgroup path failed: pid(%d)\n", args->pid); return -1; } ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - logError("error: cat file content failed\n"); + LogError("error: cat file content failed\n"); return -1; } @@ -155,7 +155,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - logError("error: assemble cgroup device path failed: \n"); + LogError("error: assemble cgroup device path failed: \n"); return -1; } @@ -170,7 +170,7 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) FILE *cgroupAllow = NULL; if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - logError("error: cannot canonicalize cgroup path: %s\n", cgroupPath); + LogError("error: cannot canonicalize cgroup path: %s\n", cgroupPath); return -1; } @@ -184,14 +184,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - logError("error: failed to open cgroup file: %s\n", resolvedCgroupPath); + LogError("error: failed to open cgroup file: %s\n", resolvedCgroupPath); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - logError("error: failed to setup driver cgroup\n"); + LogError("error: failed to setup driver cgroup\n"); return -1; } @@ -200,14 +200,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { fclose(cgroupAllow); - logError("error: failed to assemble device path for no.%s\n", token); + LogError("error: failed to assemble device path for no.%s\n", token); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - logError("error: failed to setup cgroup %s\n", token); + LogError("error: failed to setup cgroup %s\n", token); return -1; } diff --git a/cli/src/logging.c b/cli/src/logging.c index b42f479..45fa89a 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -7,7 +7,7 @@ #include #include -void logError(const char *fmt, ...) +void LogError(const char *fmt, ...) { va_list args; @@ -16,7 +16,7 @@ void logError(const char *fmt, ...) va_end(args); } -void logInfo(const char *fmt, ...) +void LogInfo(const char *fmt, ...) { va_list args; diff --git a/cli/src/logging.h b/cli/src/logging.h index 3b8b5f4..c0d31e3 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -5,7 +5,7 @@ #ifndef _LOGGING_H #define _LOGGING_H -void logError(const char *fmt, ...); -void logInfo(const char *fmt, ...); +void LogError(const char *fmt, ...); +void LogInfo(const char *fmt, ...); #endif diff --git a/cli/src/main.c b/cli/src/main.c index abe9f63..9157ef0 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -44,26 +44,26 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - logError("error: failed to get container mnt ns path: pid(%d)\n", args->pid); + LogError("error: failed to get container mnt ns path: pid(%d)\n", args->pid); return -1; } ret = GetCgroupPath(args, config->cgroupPath, BUF_SIZE); if (ret < 0) { - logError("error: failed to get cgroup path\n"); + LogError("error: failed to get cgroup path\n"); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - logError("error: failed to get self ns path\n"); + LogError("error: failed to get self ns path\n"); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - logError("error: failed to get self ns fd: %s\n", originNsPath); + LogError("error: failed to get self ns fd: %s\n", originNsPath); return -1; } @@ -77,28 +77,28 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - logError("error: failed to prepare nesessary config\n"); + LogError("error: failed to prepare nesessary config\n"); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - logError("error: failed to set to container ns: %s\n", config.containerNsPath); + LogError("error: failed to set to container ns: %s\n", config.containerNsPath); close(config.originNsFd); return -1; } ret = DoMounting(args); if (ret < 0) { - logError("error: failed to do mounting\n"); + LogError("error: failed to do mounting\n"); close(config.originNsFd); return -1; } ret = SetupCgroup(args, (const char *)config.cgroupPath); if (ret < 0) { - logError("error: failed to set up cgroup\n"); + LogError("error: failed to set up cgroup\n"); close(config.originNsFd); return -1; } @@ -106,7 +106,7 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - logError("error: failed to set ns back\n"); + LogError("error: failed to set ns back\n"); close(config.originNsFd); return -1; } @@ -151,14 +151,14 @@ int Process(int argc, char **argv) } break; default: - logError("unrecongnized option\n"); + LogError("unrecongnized option\n"); isSucceed = false; // unrecognized option break; } } if (!isSucceed || !IsCmdArgsValid(&args)) { - logError("error: information not completed or valid.\n"); + LogError("error: information not completed or valid.\n"); return -1; } diff --git a/cli/src/mount.c b/cli/src/mount.c index 7be1c94..52bd056 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -41,13 +41,13 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - logError("error: cannot canonicalize device dst: %s\n", dst); + LogError("error: cannot canonicalize device dst: %s\n", dst); return -1; } err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); if (err != EOK) { - logError("error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); + LogError("error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); return -1; } @@ -63,26 +63,26 @@ int MountDevice(const char *rootfs, const char *deviceName) ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); if (ret < 0) { - logError("error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); + LogError("error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - logError("error: failed to stat src: %s\n", src); + LogError("error: failed to stat src: %s\n", src); return -1; } ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - logError("error: failed to create mount dst file: %s\n", dst); + LogError("error: failed to create mount dst file: %s\n", dst); return -1; } ret = Mount(src, dst); if (ret < 0) { - logError("error: failed to mount dev\n"); + LogError("error: failed to mount dev\n"); return -1; } @@ -105,13 +105,13 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) while (token != NULL) { int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { - logError("error: assemble device name failed, id: %s\n", token); + LogError("error: assemble device name failed, id: %s\n", token); return -1; } ret = MountDevice(rootfs, deviceName); if (ret < 0) { - logError("error: failed to mount device no. %s\n", token); + LogError("error: failed to mount device no. %s\n", token); return -1; } @@ -144,7 +144,7 @@ int MountDir(const char *rootfs, const char *src) mode_t parentMode = DEFAULT_DIR_MODE; ret = MakeParentDir(parentDir, parentMode); if (ret < 0) { - logError("error: failed to make dir: %s\n", parentDir); + LogError("error: failed to make dir: %s\n", parentDir); return -1; } } @@ -153,14 +153,14 @@ int MountDir(const char *rootfs, const char *src) const mode_t curMode = srcStat.st_mode; ret = MkDir(dst, curMode); if (ret < 0) { - logError("error: failed to make dir: %s\n", dst); + LogError("error: failed to make dir: %s\n", dst); return -1; } } ret = Mount(src, dst); if (ret < 0) { - logError("error: failed to mount dir: %s to %s\n", src, dst); + LogError("error: failed to mount dir: %s to %s\n", src, dst); return -1; } @@ -172,19 +172,19 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER); if (ret < 0) { - logError("error: failed to mount device %s\n", DAVINCI_MANAGER); + LogError("error: failed to mount device %s\n", DAVINCI_MANAGER); return -1; } ret = MountDevice(rootfs, DEVMM_SVM); if (ret < 0) { - logError("error: failed to mount device %s\n", DEVMM_SVM); + LogError("error: failed to mount device %s\n", DEVMM_SVM); return -1; } ret = MountDevice(rootfs, HISI_HDC); if (ret < 0) { - logError("error: failed to mount device %s\n", HISI_HDC); + LogError("error: failed to mount device %s\n", HISI_HDC); return -1; } @@ -196,13 +196,13 @@ int DoDirectoryMounting(const char *rootfs) /* directory */ int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); if (ret < 0) { - logError("error: failed to do mount %s\n", ASCEND_DRIVER_PATH); + LogError("error: failed to do mount %s\n", ASCEND_DRIVER_PATH); return -1; } ret = MountDir(rootfs, ASCEND_ADDONS_PATH); if (ret < 0) { - logError("error: failed to do mount %s\n", ASCEND_ADDONS_PATH); + LogError("error: failed to do mount %s\n", ASCEND_ADDONS_PATH); return -1; } @@ -215,19 +215,19 @@ int DoMounting(const struct CmdArgs *args) ret = DoDeviceMounting(args->rootfs, args->devices); if (ret < 0) { - logError("error: failed to do mounts\n"); + LogError("error: failed to do mounts\n"); return -1; } ret = DoCtrlDeviceMounting(args->rootfs); if (ret < 0) { - logError("error: failed to do mount files\n"); + LogError("error: failed to do mount files\n"); return -1; } ret = DoDirectoryMounting(args->rootfs); if (ret < 0) { - logError("error: failed to do mount directory\n"); + LogError("error: failed to do mount directory\n"); return -1; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 5256a5e..33e2e19 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -28,7 +28,7 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - logError("error: failed to set ns: fd(%d)\n", fd); + LogError("error: failed to set ns: fd(%d)\n", fd); return -1; } @@ -42,13 +42,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - logError("error: failed to open ns path: %s\n", path); + LogError("error: failed to open ns path: %s\n", path); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - logError("error: failed to set ns: %s\n", path); + LogError("error: failed to set ns: %s\n", path); close(fd); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index 8b2faaf..3f5f5ba 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -75,13 +75,13 @@ int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* f char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - logError("error: cannot canonicalize path %s\n", filepath); + LogError("error: cannot canonicalize path %s\n", filepath); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - logError("cannot open file.\n"); + LogError("cannot open file.\n"); return -1; } @@ -122,11 +122,11 @@ int CheckDirExists(const char *dir) { DIR *ptr = opendir(dir); if (NULL == ptr) { - logError("path %s not exist\n", dir); + LogError("path %s not exist\n", dir); return -1; } - logInfo("path %s exist\n", dir); + LogInfo("path %s exist\n", dir); closedir(ptr); return 0; } @@ -169,7 +169,7 @@ int MakeParentDir(const char *path, mode_t mode) struct stat s; int ret = stat(path, &s); if (ret < 0) { - logError("error: failed to stat path: %s\n", path); + LogError("error: failed to stat path: %s\n", path); return (MkDir(path, mode)); } @@ -180,13 +180,13 @@ int CreateFile(const char *path, mode_t mode) { char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - logError("error: failed to resolve path %s\n", path); + LogError("error: failed to resolve path %s\n", path); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - logError("error: cannot create file: %s\n", resolvedPath); + LogError("error: cannot create file: %s\n", resolvedPath); return -1; } close(fd); @@ -200,13 +200,13 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, MS_BIND, NULL); if (ret < 0) { - logError("error: failed to mount\n"); + LogError("error: failed to mount\n"); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - logError("error: failed to re-mount\n"); + LogError("error: failed to re-mount\n"); return -1; } -- Gitee From 5383ef422c32441945fd9c630e36354626dd0e26 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 10 Jul 2020 16:56:45 +0800 Subject: [PATCH 046/296] Match-id-643ea45ddaa5db67fa89a9ed6cc3c7c1cca217b1 --- cli/src/HuaweiSecureC/CMakeLists.txt | 14 +- cli/src/basic.h | 8 +- cli/src/main.c | 140 +++-- cli/src/mount.c | 11 +- cli/src/options.c | 53 ++ cli/src/options.h | 13 + hook/main.go | 43 ++ install/deb/src/CMakeLists.txt | 64 +- install/deb/src/HuaweiSecureC/CMakeLists.txt | 14 +- install/deb/src/cjson/CMakeLists.txt | 16 +- install/deb/src/main.c | 630 +++++++++---------- 11 files changed, 597 insertions(+), 409 deletions(-) create mode 100644 cli/src/options.c create mode 100644 cli/src/options.h diff --git a/cli/src/HuaweiSecureC/CMakeLists.txt b/cli/src/HuaweiSecureC/CMakeLists.txt index 92ab9b8..4a9d0c5 100644 --- a/cli/src/HuaweiSecureC/CMakeLists.txt +++ b/cli/src/HuaweiSecureC/CMakeLists.txt @@ -1,7 +1,7 @@ -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) - -#生成链接库 -add_library(HuaweiSecureC ${LIB_SRC}) -target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(HuaweiSecureC ${LIB_SRC}) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) diff --git a/cli/src/basic.h b/cli/src/basic.h index 835310c..98743de 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -6,6 +6,7 @@ #define _BASIC_H #include +#include #define DEVICE_NAME "davinci" #define DAVINCI_MANAGER "davinci_manager" @@ -23,9 +24,10 @@ #define ROOT_SUBSTR_GAP 2 struct CmdArgs { - char devices[BUF_SIZE]; - char rootfs[BUF_SIZE]; - int pid; + char devices[BUF_SIZE]; + char rootfs[BUF_SIZE]; + int pid; + char options[BUF_SIZE]; }; struct PathInfo { diff --git a/cli/src/main.c b/cli/src/main.c index 9157ef0..56b0917 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -19,6 +19,9 @@ #include "mount.h" #include "cgrp.h" #include "logging.h" +#include "options.h" + +#define DECIMAL 10 struct ParsedConfig { char containerNsPath[BUF_SIZE]; @@ -30,9 +33,97 @@ static struct option g_cmdOpts[] = { {"devices", required_argument, 0, 'd'}, {"pid", required_argument, 0, 'p'}, {"rootfs", required_argument, 0, 'r'}, + {"options", required_argument, 0, 'o'}, {0, 0, 0, 0} }; +typedef bool (*CmdArgParser)(struct CmdArgs *args, const char *arg); + +static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) +{ + errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); + if (err != EOK) { + LogError("error: failed to get devices from cmd args."); + return false; + } + + return true; +} + +static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) +{ + errno = 0; + args->pid = strtol(optarg, NULL, DECIMAL); + if (errno != 0) { + LogError("error: failed to convert pid string from cmd args, pid string: %s.", arg); + return false; + } + + if (args->pid <= 0) { + LogError("error: invalid pid %d.", args->pid); + return false; + } + + return true; +} + +static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) +{ + errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); + if (err != EOK) { + LogError("error: failed to get rootfs path from cmd args"); + return false; + } + + return true; +} + +static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) +{ + errno_t err = strcpy_s(args->options, BUF_SIZE, arg); + if (err != EOK) { + LogError("error: failed to get options string from cmd args"); + return false; + } + + return true; +} + +#define NUM_OF_CMD_ARGS 4 + +static struct { + const int c; + CmdArgParser parser; +} g_cmdArgParsers[NUM_OF_CMD_ARGS] = { + {'d', DevicesCmdArgParser}, + {'p', PidCmdArgParser}, + {'r', RootfsCmdArgParser}, + {'o', OptionsCmdArgParser} +}; + +static int ParseOneCmdArg(struct CmdArgs *args, int indicator, const char *value) +{ + int i; + for (i = 0; i < NUM_OF_CMD_ARGS; i++) { + if (g_cmdArgParsers[i].c == indicator) { + break; + } + } + + if (i == NUM_OF_CMD_ARGS) { + LogError("error: unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); + return -1; + } + + bool isOK = g_cmdArgParsers[i].parser(args, value); + if (!isOK) { + LogError("error: failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); + return -1; + } + + return 0; +} + static inline bool IsCmdArgsValid(struct CmdArgs *args) { return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); @@ -67,6 +158,12 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return -1; } + ret = ParseRuntimeOptions(args->options); + if (ret < 0) { + LogError("error: failed to parse runtime options."); + return -1; + } + return 0; } @@ -118,51 +215,24 @@ int SetupContainer(struct CmdArgs *args) int Process(int argc, char **argv) { int c; - errno_t err; + int ret; int optionIndex; - bool isSucceed; struct CmdArgs args = {0}; - isSucceed = true; - while (isSucceed) { - c = getopt_long(argc, argv, "d:p:r", g_cmdOpts, &optionIndex); - if (c == -1) { - // cmd options exhausted - break; - } - - switch (c) { - case 'd': - err = strcpy_s(args.devices, BUF_SIZE, optarg); - if (err != EOK) { - isSucceed = false; - } - break; - case 'p': - args.pid = atoi(optarg); - if (args.pid <= 0) { - isSucceed = false; - } - break; - case 'r': - err = strcpy_s(args.rootfs, BUF_SIZE, optarg); - if (err != EOK) { - isSucceed = false; - } - break; - default: - LogError("unrecongnized option\n"); - isSucceed = false; // unrecognized option - break; + while ((c = getopt_long(argc, argv, "d:p:r:o", g_cmdOpts, &optionIndex)) != -1) { + ret = ParseOneCmdArg(&args, c, optarg); + if (ret < 0) { + LogError("error: failed to parse cmd args."); + return -1; } } - if (!isSucceed || !IsCmdArgsValid(&args)) { + if (!IsCmdArgsValid(&args)) { LogError("error: information not completed or valid.\n"); return -1; } - int ret = SetupContainer(&args); + ret = SetupContainer(&args); if (ret < 0) { return ret; } diff --git a/cli/src/mount.c b/cli/src/mount.c index 52bd056..9d72371 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -11,6 +11,7 @@ #include "securec.h" #include "utils.h" #include "logging.h" +#include "options.h" static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, struct PathInfo* pathInfo) @@ -100,8 +101,9 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) return -1; } char *token = NULL; + char *context = NULL; - token = strtok(list, sep); + token = strtok_s(list, sep, &context); while (token != NULL) { int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); if (ret < 0) { @@ -115,7 +117,7 @@ int DoDeviceMounting(const char *rootfs, const char *devicesList) return -1; } - token = strtok(NULL, sep); + token = strtok_s(NULL, sep, &context); } return 0; @@ -225,6 +227,11 @@ int DoMounting(const struct CmdArgs *args) return -1; } + if (IsOptionNoDrvSet()) { + // 不挂载DRIVER + return 0; + } + ret = DoDirectoryMounting(args->rootfs); if (ret < 0) { LogError("error: failed to do mount directory\n"); diff --git a/cli/src/options.c b/cli/src/options.c new file mode 100644 index 0000000..7c644fd --- /dev/null +++ b/cli/src/options.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具挂载选项 +*/ +#include "options.h" + +#include +#include +#include "securec.h" + +static struct { + bool noDrv; +} g_runtimeOptions; + +static struct { + const char *name; + bool *flag; +} g_optionNameFlagTable[] = { + {"NODRV", &g_runtimeOptions.noDrv}, // 不挂载Driver + {NULL, NULL} +}; + +int ParseRuntimeOptions(const char *options) +{ + // set defaults value + g_runtimeOptions.noDrv = false; + + static const char *seperator = ","; + char *runtimeOptions = strdup(options); + char *context = NULL; + char *token = NULL; + + token = strtok_s(runtimeOptions, seperator, &context); + while (token != NULL) { + for (int i = 0; g_optionNameFlagTable[i].name != NULL; i++) { + if (strcmp((const char *)token, g_optionNameFlagTable[i].name)) { + continue; + } + + *g_optionNameFlagTable[i].flag = true; + } + + token = strtok_s(NULL, seperator, &context); + } + + free(runtimeOptions); + return 0; +} + +bool IsOptionNoDrvSet() +{ + return g_runtimeOptions.noDrv; +} \ No newline at end of file diff --git a/cli/src/options.h b/cli/src/options.h new file mode 100644 index 0000000..713c2fa --- /dev/null +++ b/cli/src/options.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具挂载选项头文件 +*/ +#ifndef _OPTIONS_H +#define _OPTIONS_H + +#include + +int ParseRuntimeOptions(const char *options); +bool IsOptionNoDrvSet(); + +#endif diff --git a/hook/main.go b/hook/main.go index bba904b..4c12347 100644 --- a/hook/main.go +++ b/hook/main.go @@ -23,6 +23,7 @@ import ( const ( loggingPrefix = "ascend-docker-hook" ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" + ascendRuntimeOptions = "ASCEND_RUNTIME_OPTIONS" ascendDockerCli = "ascend-docker-cli" defaultAscendDockerCli = "/usr/bin/ascend-docker-cli" @@ -37,6 +38,10 @@ var ( defaultAscendDockerCliName = defaultAscendDockerCli ) +var validRuntimeOptions = [...]string { + "NODRV", +} + type containerConfig struct { Pid int Rootfs string @@ -104,6 +109,35 @@ func parseDevices(visibleDevices string) ([]int, error) { return removeDuplication(devices), nil } +func isRuntimeOptionValid(option string) bool { + for _, validOption := range validRuntimeOptions { + if option == validOption { + return true + } + } + + return false +} + +func parseRuntimeOptions(runtimeOptions string) ([]string, error) { + parsedOptions := make([]string, 0) + + if runtimeOptions == "" { + return parsedOptions, nil + } + + for _, option := range strings.Split(runtimeOptions, ",") { + option = strings.TrimSpace(option) + if !isRuntimeOptionValid(option) { + return nil, fmt.Errorf("invalid runtime option %s", option) + } + + parsedOptions = append(parsedOptions, option) + } + + return parsedOptions, nil +} + func parseOciSpecFile(file string) (*specs.Spec, error) { f, err := os.Open(file) if err != nil { @@ -181,6 +215,11 @@ func doPrestartHook() error { return fmt.Errorf("failed to parse device setting: %w", err) } + parsedOptions, err := parseRuntimeOptions(getValueByKey(containerConfig.Env, ascendRuntimeOptions)) + if err != nil { + return fmt.Errorf("failed to parse runtime options: %w", err) + } + cliPath, err := exec.LookPath(ascendDockerCliName) if err != nil { _, err = os.Stat(defaultAscendDockerCliName) @@ -196,6 +235,10 @@ func doPrestartHook() error { "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) + if len(parsedOptions) > 0 { + args = append(args, "--options", strings.Join(parsedOptions, ",")) + } + if err := doExec(cliPath, args, os.Environ()); err != nil { return fmt.Errorf("failed to exec ascend-docker-cli %v: %w", args, err) } diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index 35e44e7..5012826 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -1,32 +1,32 @@ -# CMake 最低版本号要求 -cmake_minimum_required (VERSION 2.8) - -# 项目信息 -project (ascend-docker-plugin-install-helper) - -message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") - - -#导入头文件所在路径 -#PROJECT_SOURCE_DIR为cmake宏 -include_directories("${PROJECT_SOURCE_DIR}/cjson") -include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") - -# 查找当前目录下的所有源文件 -# 并将名称保存到 SRC 变量 -aux_source_directory(. SRC) - -# 指定生成目标 -add_executable(ascend-docker-plugin-install-helper ${SRC}) - -# 添加子目录 -add_subdirectory(cjson) -add_subdirectory(HuaweiSecureC) - -# 添加链接库 -#该命令要在add_executable命令下方,否则报错 -target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now cjson) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now HuaweiSecureC) - +# CMake 最低版本号要求 +cmake_minimum_required (VERSION 2.8) + +# 项目信息 +project (ascend-docker-plugin-install-helper) + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + + +#导入头文件所在路径 +#PROJECT_SOURCE_DIR为cmake宏 +include_directories("${PROJECT_SOURCE_DIR}/cjson") +include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") + +# 查找当前目录下的所有源文件 +# 并将名称保存到 SRC 变量 +aux_source_directory(. SRC) + +# 指定生成目标 +add_executable(ascend-docker-plugin-install-helper ${SRC}) + +# 添加子目录 +add_subdirectory(cjson) +add_subdirectory(HuaweiSecureC) + +# 添加链接库 +#该命令要在add_executable命令下方,否则报错 +target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now cjson) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now HuaweiSecureC) + diff --git a/install/deb/src/HuaweiSecureC/CMakeLists.txt b/install/deb/src/HuaweiSecureC/CMakeLists.txt index 92ab9b8..4a9d0c5 100644 --- a/install/deb/src/HuaweiSecureC/CMakeLists.txt +++ b/install/deb/src/HuaweiSecureC/CMakeLists.txt @@ -1,7 +1,7 @@ -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) - -#生成链接库 -add_library(HuaweiSecureC ${LIB_SRC}) -target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(HuaweiSecureC ${LIB_SRC}) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) diff --git a/install/deb/src/cjson/CMakeLists.txt b/install/deb/src/cjson/CMakeLists.txt index b5e902a..01a144f 100644 --- a/install/deb/src/cjson/CMakeLists.txt +++ b/install/deb/src/cjson/CMakeLists.txt @@ -1,8 +1,8 @@ -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) - -#生成链接库 -add_library(cjson ${LIB_SRC}) -target_compile_options(cjson PRIVATE -fstack-protector-all -fpie) - +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(. LIB_SRC) + +#生成链接库 +add_library(cjson ${LIB_SRC}) +target_compile_options(cjson PRIVATE -fstack-protector-all -fpie) + diff --git a/install/deb/src/main.c b/install/deb/src/main.c index e9a9d5c..cf1f350 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -1,315 +1,315 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker -*/ -#include "cJSON.h" -#include -#include -#include -#include - -#define MAX_JSON_FILE_SIZE 65535 -#define NUM_ARGS 4 -#define ADD_CMD "add" -#define RM_CMD "rm" -#define CMD_INDEX 1 -#define FINAL_FILE_INDEX 2 -#define TEMP_FILE_INDEX 3 -#define ASCEND_RUNTIME_PATH_VALUE "/usr/bin/ascend-docker-runtime" -#define ASCEND_RUNTIME_PATH_KEY "path" -#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" -#define RUNTIME_KEY "runtimes" -#define ASCEND_RUNTIME_NAME "ascend" -#define DEFALUT_KEY "default-runtime" -#define DEFAULT_VALUE "ascend" - -void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) -{ - fseek(pf, 0, SEEK_END); - - int size = (int)ftell(pf); - if (size >= maxBufferSize) { - fprintf(stderr, "file size too large\n"); - return; - } - - fseek(pf, 0, SEEK_SET); - fread(text, sizeof(char), size, pf); - text[size] = '\0'; -} - -cJSON *CreateAscendRuntimeInfo() -{ - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - fprintf(stderr, "create ascend runtime info root err\n"); - return NULL; - } - - cJSON *newString = NULL; - newString = cJSON_CreateString(ASCEND_RUNTIME_PATH_VALUE); - if (newString == NULL) { - fprintf(stderr, "create ascend runtime info path value err\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON *paraArray = NULL; - paraArray = cJSON_CreateArray(); - if (paraArray == NULL) { - fprintf(stderr, "create ascend runtime info args err\n"); - cJSON_Delete(root); - cJSON_Delete(newString); - return NULL; - } - - cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); - cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); - - return root; -} - -cJSON *CreateRuntimes() -{ - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(); - if (ascendRuntime == NULL) { - fprintf(stderr, "create ascendruntime err\n"); - return NULL; - } - - cJSON *runtimes = NULL; - runtimes = cJSON_CreateObject(); - if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); - cJSON_Delete(ascendRuntime); - return NULL; - } - - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - - return runtimes; -} - -int DelJsonContent(cJSON *root, const char *key) -{ - cJSON *existItem = NULL; - existItem = cJSON_GetObjectItem(root, key); - if (existItem == NULL) { - return 0; - } - - cJSON *removedItem = NULL; - removedItem = cJSON_DetachItemViaPointer(root, existItem); - if (removedItem == NULL) { - fprintf(stderr, "remove %s failed\n", key); - return -1; - } - - cJSON_Delete(removedItem); - return 0; -} - -cJSON *CreateContent() -{ - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = CreateRuntimes(); - if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); - return NULL; - } - - cJSON *defaultRuntime = NULL; - defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(runtimes); - return NULL; - } - - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ - fprintf(stderr, "create root err\n"); - cJSON_Delete(runtimes); - cJSON_Delete(defaultRuntime); - return NULL; - } - - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -cJSON *ModifyContent(FILE *pf) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - if (runtimes == NULL) { - runtimes = CreateRuntimes(); - if (runtimes == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - } else { - int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(); - if (ascendRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - } - - /* 插入defaul runtime */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -cJSON *RemoveContent(FILE *pf) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 去除default runtimes */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - /* 去除runtimes */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); - if (runtimes == NULL) { - fprintf(stderr, "no runtime key found\n"); - cJSON_Delete(root); - return NULL; - } - - ret = DelJsonContent(runtimes, DEFAULT_VALUE); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - return root; -} - - -int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) -{ - cJSON *root = NULL; - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - root = CreateContent(); - } else { - root = ModifyContent(pf); - fclose(pf); - } - - if (root == NULL) { - fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); - return -1; - } - - fprintf(pf, "%s", cJSON_Print(root)); - fclose(pf); - - cJSON_Delete(root); - - return 0; -} - -int CreateRevisedJsonFile(const char *filePath, const char *tempPath) -{ - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - fprintf(stderr, "error: no json files found\n"); - return -1; - } - cJSON *newContent = NULL; - newContent = RemoveContent(pf); - fclose(pf); - - if (newContent == NULL) { - fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - return -1; - } - - fprintf(pf, "%s", cJSON_Print(newContent)); - fclose(pf); - - cJSON_Delete(newContent); - - return 0; -} - -/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ -int main(int argc, char *argv[]) -{ - if (argc != NUM_ARGS) { - return -1; - } - printf("%s\n", argv[FINAL_FILE_INDEX]); - printf("%s\n", argv[TEMP_FILE_INDEX]); - printf("%s\n", argv[CMD_INDEX]); - if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { - return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); - } - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); -} +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker +*/ +#include "cJSON.h" +#include +#include +#include +#include + +#define MAX_JSON_FILE_SIZE 65535 +#define NUM_ARGS 4 +#define ADD_CMD "add" +#define RM_CMD "rm" +#define CMD_INDEX 1 +#define FINAL_FILE_INDEX 2 +#define TEMP_FILE_INDEX 3 +#define ASCEND_RUNTIME_PATH_VALUE "/usr/bin/ascend-docker-runtime" +#define ASCEND_RUNTIME_PATH_KEY "path" +#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" +#define RUNTIME_KEY "runtimes" +#define ASCEND_RUNTIME_NAME "ascend" +#define DEFALUT_KEY "default-runtime" +#define DEFAULT_VALUE "ascend" + +void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) +{ + fseek(pf, 0, SEEK_END); + + int size = (int)ftell(pf); + if (size >= maxBufferSize) { + fprintf(stderr, "file size too large\n"); + return; + } + + fseek(pf, 0, SEEK_SET); + fread(text, sizeof(char), size, pf); + text[size] = '\0'; +} + +cJSON *CreateAscendRuntimeInfo() +{ + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + fprintf(stderr, "create ascend runtime info root err\n"); + return NULL; + } + + cJSON *newString = NULL; + newString = cJSON_CreateString(ASCEND_RUNTIME_PATH_VALUE); + if (newString == NULL) { + fprintf(stderr, "create ascend runtime info path value err\n"); + cJSON_Delete(root); + return NULL; + } + + cJSON *paraArray = NULL; + paraArray = cJSON_CreateArray(); + if (paraArray == NULL) { + fprintf(stderr, "create ascend runtime info args err\n"); + cJSON_Delete(root); + cJSON_Delete(newString); + return NULL; + } + + cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); + cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); + + return root; +} + +cJSON *CreateRuntimes() +{ + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(); + if (ascendRuntime == NULL) { + fprintf(stderr, "create ascendruntime err\n"); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_CreateObject(); + if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + cJSON_Delete(ascendRuntime); + return NULL; + } + + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + + return runtimes; +} + +int DelJsonContent(cJSON *root, const char *key) +{ + cJSON *existItem = NULL; + existItem = cJSON_GetObjectItem(root, key); + if (existItem == NULL) { + return 0; + } + + cJSON *removedItem = NULL; + removedItem = cJSON_DetachItemViaPointer(root, existItem); + if (removedItem == NULL) { + fprintf(stderr, "remove %s failed\n", key); + return -1; + } + + cJSON_Delete(removedItem); + return 0; +} + +cJSON *CreateContent() +{ + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = CreateRuntimes(); + if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + return NULL; + } + + cJSON *defaultRuntime = NULL; + defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(runtimes); + return NULL; + } + + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ + fprintf(stderr, "create root err\n"); + cJSON_Delete(runtimes); + cJSON_Delete(defaultRuntime); + return NULL; + } + + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); + + return root; +} + +cJSON *ModifyContent(FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + if (runtimes == NULL) { + runtimes = CreateRuntimes(); + if (runtimes == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + } else { + int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(); + if (ascendRuntime == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + } + + /* 插入defaul runtime */ + int ret = DelJsonContent(root, DEFALUT_KEY); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); + + return root; +} + +cJSON *RemoveContent(FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 去除default runtimes */ + int ret = DelJsonContent(root, DEFALUT_KEY); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + + /* 去除runtimes */ + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); + if (runtimes == NULL) { + fprintf(stderr, "no runtime key found\n"); + cJSON_Delete(root); + return NULL; + } + + ret = DelJsonContent(runtimes, DEFAULT_VALUE); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + + return root; +} + + +int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) +{ + cJSON *root = NULL; + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + root = CreateContent(); + } else { + root = ModifyContent(pf); + fclose(pf); + } + + if (root == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + return -1; + } + + fprintf(pf, "%s", cJSON_Print(root)); + fclose(pf); + + cJSON_Delete(root); + + return 0; +} + +int CreateRevisedJsonFile(const char *filePath, const char *tempPath) +{ + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + fprintf(stderr, "error: no json files found\n"); + return -1; + } + cJSON *newContent = NULL; + newContent = RemoveContent(pf); + fclose(pf); + + if (newContent == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + cJSON_Delete(newContent); + return -1; + } + + fprintf(pf, "%s", cJSON_Print(newContent)); + fclose(pf); + + cJSON_Delete(newContent); + + return 0; +} + +/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ +int main(int argc, char *argv[]) +{ + if (argc != NUM_ARGS) { + return -1; + } + printf("%s\n", argv[FINAL_FILE_INDEX]); + printf("%s\n", argv[TEMP_FILE_INDEX]); + printf("%s\n", argv[CMD_INDEX]); + if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { + return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); + } + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); +} -- Gitee From 2d152dfe69dbd41df0db7be446df83b5a2bf8852 Mon Sep 17 00:00:00 2001 From: BianTanggui <841018prgray^> Date: Sat, 11 Jul 2020 16:37:21 +0800 Subject: [PATCH 047/296] Match-id-88a009a7b98f518918ad4b6b65b85f4135c6fd35 --- build/build.sh | 4 ++-- install/rpm/ascend-docker-plgugin.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.sh b/build/build.sh index cc78cf7..669b0dd 100644 --- a/build/build.sh +++ b/build/build.sh @@ -38,8 +38,8 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="1.0.0" -RELEASE="1" +VERSION="20.0.0" +RELEASE="RC1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 81cf029..f828f1d 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,6 +1,6 @@ Name: ascend-docker-runtime -Version: 1.0.0 -Release: 1 +Version: 20.0.0 +Release: RC1 Summary: simple RPM package License: FIXME -- Gitee From 4283403f5cd8d40f057446a0ab48ca366ef8ee1f Mon Sep 17 00:00:00 2001 From: BianTanggui <841018prgray^> Date: Wed, 15 Jul 2020 20:39:27 +0800 Subject: [PATCH 048/296] Match-id-efa0133022dd9178dab494f49640e179c49bef72 --- build/build.sh | 5 ++--- install/rpm/ascend-docker-plgugin.spec | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build/build.sh b/build/build.sh index 669b0dd..22bce06 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,5 @@ #!/bin/bash - ROOT=$(cd `dirname $0`; pwd)/.. OPENSRC=${ROOT}/opensource @@ -38,8 +37,8 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="20.0.0" -RELEASE="RC1" +VERSION="20.0.RC1" +RELEASE="1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index f828f1d..0a8140d 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,6 +1,6 @@ Name: ascend-docker-runtime -Version: 20.0.0 -Release: RC1 +Version: 20.0.RC1 +Release: 1 Summary: simple RPM package License: FIXME -- Gitee From dbb32fdff3606e0087c2a6f83a97e8e5c3087b82 Mon Sep 17 00:00:00 2001 From: BianTanggui <841018prgray^> Date: Fri, 24 Jul 2020 14:52:13 +0800 Subject: [PATCH 049/296] Match-id-23d82720e22bc3b9efd6c672b90d5357aa2dfdfb --- build/build.sh | 4 ++-- ci/dependency.xml | 2 +- install/rpm/ascend-docker-plgugin.spec | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.sh b/build/build.sh index 22bce06..033a03c 100644 --- a/build/build.sh +++ b/build/build.sh @@ -37,7 +37,7 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="20.0.RC1" +VERSION="20.10.0.B010" RELEASE="1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` @@ -175,4 +175,4 @@ fi if [ -f /etc/debian_version ]; then funcmakedeb -fi +fi \ No newline at end of file diff --git a/ci/dependency.xml b/ci/dependency.xml index eddb2af..96233a5 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -6,7 +6,7 @@ Atlas Platform ascend-docker-plugin - 1.0.0 + 20.10.0.B010 N diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 0a8140d..8c6ebf3 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,5 +1,5 @@ Name: ascend-docker-runtime -Version: 20.0.RC1 +Version: 20.10.0.B010 Release: 1 Summary: simple RPM package License: FIXME -- Gitee From af7ffd82c0210824e5178c62f60a3cb2f3c37a2b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 25 Jul 2020 10:40:27 +0800 Subject: [PATCH 050/296] Match-id-245bc76da887818fe1357759f0f0645039ea7ff1 --- cli/src/cgrp.c | 30 +++++++++++++++--------------- cli/src/logging.c | 4 ++-- cli/src/main.c | 20 ++++++++++---------- cli/src/mount.c | 38 +++++++++++++++++++------------------- cli/src/ns.c | 10 +++++----- cli/src/utils.c | 10 +++++----- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 7cf2757..4df1f73 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -71,22 +71,22 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) struct stat devStat; char devPath[BUF_SIZE]; - ret = snprintf_s(devPath, BUF_SIZE, BUF_SIZE, "/dev/%s", devName); + ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - LogError("error: failed to assemble dev path for %s\n", devName); + LogError("error: failed to assemble dev path for %s.", devName); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - LogError("error: failed to get stat of %s\n", devPath); + LogError("error: failed to get stat of %s.", devPath); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - LogError("error: write devices failed\n"); + LogError("error: write devices failed."); return -1; } @@ -99,19 +99,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - LogError("error: failed to setup cgroup for %s\n", DAVINCI_MANAGER); + LogError("error: failed to setup cgroup for %s.", DAVINCI_MANAGER); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - LogError("error: failed to setup cgroup for %s\n", DEVMM_SVM); + LogError("error: failed to setup cgroup for %s.", DEVMM_SVM); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - LogError("error: failed to setup cgroup for %s\n", HISI_HDC); + LogError("error: failed to setup cgroup for %s.", HISI_HDC); return -1; } @@ -124,15 +124,15 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char mountPath[BUF_SIZE] = {0x0}; char mount[BUF_SIZE] = {0x0}; - ret = snprintf_s(mountPath, BUF_SIZE, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); + ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - LogError("error: assemble mount info path failed: ppid(%d)\n", getppid()); + LogError("error: assemble mount info path failed: ppid(%d).", getppid()); return -1; } ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - LogError("error: cat file content failed\n"); + LogError("error: cat file content failed."); return -1; } @@ -146,16 +146,16 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - LogError("error: cat file content failed\n"); + LogError("error: cat file content failed."); return -1; } // cut last '\n' off cgroup[strcspn(cgroup, "\n")] = '\0'; - ret = snprintf_s(effPath, BUF_SIZE, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); + ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - LogError("error: assemble cgroup device path failed: \n"); + LogError("error: assemble cgroup device path failed."); return -1; } @@ -184,14 +184,14 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - LogError("error: failed to open cgroup file: %s\n", resolvedCgroupPath); + LogError("error: failed to open cgroup file: %s.", resolvedCgroupPath); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to setup driver cgroup\n"); + LogError("error: failed to setup driver cgroup."); return -1; } diff --git a/cli/src/logging.c b/cli/src/logging.c index 45fa89a..a4c5411 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -12,7 +12,7 @@ void LogError(const char *fmt, ...) va_list args; va_start(args, fmt); - fprintf(stderr, fmt, args); + vfprintf(stderr, fmt, args); va_end(args); } @@ -21,6 +21,6 @@ void LogInfo(const char *fmt, ...) va_list args; va_start(args, fmt); - fprintf(stdout, fmt, args); + vfprintf(stdout, fmt, args); va_end(args); } \ No newline at end of file diff --git a/cli/src/main.c b/cli/src/main.c index 56b0917..8556e6e 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -135,26 +135,26 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get container mnt ns path: pid(%d)\n", args->pid); + LogError("error: failed to get container mnt ns path: pid(%d).", args->pid); return -1; } ret = GetCgroupPath(args, config->cgroupPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get cgroup path\n"); + LogError("error: failed to get cgroup path."); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get self ns path\n"); + LogError("error: failed to get self ns path."); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - LogError("error: failed to get self ns fd: %s\n", originNsPath); + LogError("error: failed to get self ns fd: %s.", originNsPath); return -1; } @@ -174,28 +174,28 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - LogError("error: failed to prepare nesessary config\n"); + LogError("error: failed to prepare nesessary config."); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - LogError("error: failed to set to container ns: %s\n", config.containerNsPath); + LogError("error: failed to set to container ns: %s.", config.containerNsPath); close(config.originNsFd); return -1; } ret = DoMounting(args); if (ret < 0) { - LogError("error: failed to do mounting\n"); + LogError("error: failed to do mounting."); close(config.originNsFd); return -1; } ret = SetupCgroup(args, (const char *)config.cgroupPath); if (ret < 0) { - LogError("error: failed to set up cgroup\n"); + LogError("error: failed to set up cgroup."); close(config.originNsFd); return -1; } @@ -203,7 +203,7 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - LogError("error: failed to set ns back\n"); + LogError("error: failed to set ns back."); close(config.originNsFd); return -1; } @@ -228,7 +228,7 @@ int Process(int argc, char **argv) } if (!IsCmdArgsValid(&args)) { - LogError("error: information not completed or valid.\n"); + LogError("error: information not completed or valid."); return -1; } diff --git a/cli/src/mount.c b/cli/src/mount.c index 9d72371..b932027 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -31,24 +31,24 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, char *src = pathInfo->src; char *dst = pathInfo->dst; - ret = snprintf_s(src, srcBufSize, srcBufSize, "/dev/%s", deviceName); + ret = sprintf_s(src, srcBufSize, "/dev/%s", deviceName); if (ret < 0) { return -1; } - ret = snprintf_s(unresolvedDst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); + ret = sprintf_s(unresolvedDst, BUF_SIZE, "%s%s", rootfs, src); if (ret < 0) { return -1; } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize device dst: %s\n", dst); + LogError("error: cannot canonicalize device dst: %s.", dst); return -1; } err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); if (err != EOK) { - LogError("error: failed to copy resolved device mnt path to dst: %s\n", resolvedDst); + LogError("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); return -1; } @@ -64,26 +64,26 @@ int MountDevice(const char *rootfs, const char *deviceName) ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); if (ret < 0) { - LogError("error: failed to get device mount src and(or) dst path, device name: %s\n", deviceName); + LogError("error: failed to get device mount src and(or) dst path, device name: %s.", deviceName); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - LogError("error: failed to stat src: %s\n", src); + LogError("error: failed to stat src: %s.", src); return -1; } ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - LogError("error: failed to create mount dst file: %s\n", dst); + LogError("error: failed to create mount dst file: %s.", dst); return -1; } ret = Mount(src, dst); if (ret < 0) { - LogError("error: failed to mount dev\n"); + LogError("error: failed to mount dev."); return -1; } @@ -128,7 +128,7 @@ int MountDir(const char *rootfs, const char *src) int ret; char dst[BUF_SIZE] = {0}; - ret = snprintf_s(dst, BUF_SIZE, BUF_SIZE, "%s%s", rootfs, src); + ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, src); if (ret < 0) { return -1; } @@ -146,7 +146,7 @@ int MountDir(const char *rootfs, const char *src) mode_t parentMode = DEFAULT_DIR_MODE; ret = MakeParentDir(parentDir, parentMode); if (ret < 0) { - LogError("error: failed to make dir: %s\n", parentDir); + LogError("error: failed to make dir: %s.", parentDir); return -1; } } @@ -155,14 +155,14 @@ int MountDir(const char *rootfs, const char *src) const mode_t curMode = srcStat.st_mode; ret = MkDir(dst, curMode); if (ret < 0) { - LogError("error: failed to make dir: %s\n", dst); + LogError("error: failed to make dir: %s.", dst); return -1; } } ret = Mount(src, dst); if (ret < 0) { - LogError("error: failed to mount dir: %s to %s\n", src, dst); + LogError("error: failed to mount dir: %s to %s.", src, dst); return -1; } @@ -174,19 +174,19 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER); if (ret < 0) { - LogError("error: failed to mount device %s\n", DAVINCI_MANAGER); + LogError("error: failed to mount device %s.", DAVINCI_MANAGER); return -1; } ret = MountDevice(rootfs, DEVMM_SVM); if (ret < 0) { - LogError("error: failed to mount device %s\n", DEVMM_SVM); + LogError("error: failed to mount device %s.", DEVMM_SVM); return -1; } ret = MountDevice(rootfs, HISI_HDC); if (ret < 0) { - LogError("error: failed to mount device %s\n", HISI_HDC); + LogError("error: failed to mount device %s.", HISI_HDC); return -1; } @@ -198,13 +198,13 @@ int DoDirectoryMounting(const char *rootfs) /* directory */ int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); if (ret < 0) { - LogError("error: failed to do mount %s\n", ASCEND_DRIVER_PATH); + LogError("error: failed to do mount %s.", ASCEND_DRIVER_PATH); return -1; } ret = MountDir(rootfs, ASCEND_ADDONS_PATH); if (ret < 0) { - LogError("error: failed to do mount %s\n", ASCEND_ADDONS_PATH); + LogError("error: failed to do mount %s.", ASCEND_ADDONS_PATH); return -1; } @@ -217,13 +217,13 @@ int DoMounting(const struct CmdArgs *args) ret = DoDeviceMounting(args->rootfs, args->devices); if (ret < 0) { - LogError("error: failed to do mounts\n"); + LogError("error: failed to do mounts."); return -1; } ret = DoCtrlDeviceMounting(args->rootfs); if (ret < 0) { - LogError("error: failed to do mount files\n"); + LogError("error: failed to do mount files."); return -1; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 33e2e19..e66f696 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -15,20 +15,20 @@ int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/%d/ns/%s"; - return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, pid, nsType); + return sprintf_s(buf, bufSize, fmtStr, pid, nsType); } int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) { static const char *fmtStr = "/proc/self/ns/%s"; - return snprintf_s(buf, BUF_SIZE, bufSize, fmtStr, nsType); + return sprintf_s(buf, bufSize, fmtStr, nsType); } int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - LogError("error: failed to set ns: fd(%d)\n", fd); + LogError("error: failed to set ns: fd(%d).", fd); return -1; } @@ -42,13 +42,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - LogError("error: failed to open ns path: %s\n", path); + LogError("error: failed to open ns path: %s.", path); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - LogError("error: failed to set ns: %s\n", path); + LogError("error: failed to set ns: %s.", path); close(fd); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index 3f5f5ba..0eab320 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -122,11 +122,11 @@ int CheckDirExists(const char *dir) { DIR *ptr = opendir(dir); if (NULL == ptr) { - LogError("path %s not exist\n", dir); + LogError("path %s not exist.", dir); return -1; } - LogInfo("path %s exist\n", dir); + LogInfo("path %s exist.", dir); closedir(ptr); return 0; } @@ -169,7 +169,7 @@ int MakeParentDir(const char *path, mode_t mode) struct stat s; int ret = stat(path, &s); if (ret < 0) { - LogError("error: failed to stat path: %s\n", path); + LogError("error: failed to stat path: %s.", path); return (MkDir(path, mode)); } @@ -180,13 +180,13 @@ int CreateFile(const char *path, mode_t mode) { char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - LogError("error: failed to resolve path %s\n", path); + LogError("error: failed to resolve path %s.", path); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - LogError("error: cannot create file: %s\n", resolvedPath); + LogError("error: cannot create file: %s.", resolvedPath); return -1; } close(fd); -- Gitee From 09b0210696532f599f7cc0c9a97df34f6aa1f7e2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 25 Jul 2020 11:24:29 +0800 Subject: [PATCH 051/296] Match-id-f71d276734eb182df9af864f18cb5af2abe90dc3 --- cli/src/cgrp.c | 85 +++++++++++++++++++++++++++++++++++++++- cli/src/mount.c | 22 +++++++++++ cli/src/utils.c | 102 +----------------------------------------------- cli/src/utils.h | 10 +---- 4 files changed, 107 insertions(+), 112 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 4df1f73..b664042 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -16,6 +16,87 @@ #include "utils.h" #include "logging.h" +bool TakeNthWord(char **pLine, unsigned int n, char **word) +{ + char *w = NULL; + for (unsigned int i = 0; i < n; i++) { + w = strsep(pLine, " "); + if (w == NULL || *w == '\0') { + return false; + } + } + + *word = w; + return true; +} + +bool CheckRootDir(char **pLine) +{ + char *rootDir = NULL; + if (!TakeNthWord(pLine, ROOT_GAP, &rootDir)) { + return false; + } + + return strlen(rootDir) < BUF_SIZE && !StrHasPrefix(rootDir, "/.."); +} + +bool CheckFsType(char **pLine) +{ + char* fsType = NULL; + if (!TakeNthWord(pLine, FSTYPE_GAP, &fsType)) { + return false; + } + + return IsStrEqual(fsType, "cgroup"); +} + +bool CheckSubStr(char **pLine, const char *subsys) +{ + char* substr = NULL; + if (!TakeNthWord(pLine, MOUNT_SUBSTR_GAP, &substr)) { + return false; + } + + return strstr(substr, subsys) != NULL; +} + +typedef char *(*ParseFileLine)(char *, const char *); +int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +{ + FILE *fp = NULL; + char *result = NULL; + char *line = NULL; + size_t len = 0; + char resolvedPath[PATH_MAX] = {0x0}; + + if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { + LogError("error: cannot canonicalize path %s.", filepath); + return -1; + } + + fp = fopen(resolvedPath, "r"); + if (fp == NULL) { + LogError("cannot open file."); + return -1; + } + + while (getline(&line, &len, fp) != -1) { + result = fn(line, "devices"); + if (result != NULL && strlen(result) < bufferSize) { + break; + } + } + + errno_t ret = strcpy_s(buffer, bufferSize, result); + free(line); + fclose(fp); + if (ret != EOK) { + return -1; + } + + return 0; +} + char *GetCgroupMount(char *line, const char *subsys) { if (!CheckRootDir(&line)) { @@ -130,7 +211,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz return -1; } - ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); + ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { LogError("error: cat file content failed."); return -1; @@ -144,7 +225,7 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz return -1; } - ret = CatFileContent(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); + ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { LogError("error: cat file content failed."); return -1; diff --git a/cli/src/mount.c b/cli/src/mount.c index b932027..9d23190 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -8,11 +8,33 @@ #include #include #include +#include #include "securec.h" #include "utils.h" #include "logging.h" #include "options.h" +int Mount(const char *src, const char *dst) +{ + static const unsigned long mountFlags = MS_BIND; + static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; + int ret; + + ret = mount(src, dst, NULL, mountFlags, NULL); + if (ret < 0) { + LogError("error: failed to mount."); + return -1; + } + + ret = mount(NULL, dst, NULL, remountFlags, NULL); + if (ret < 0) { + LogError("error: failed to re-mount."); + return -1; + } + + return 0; +} + static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, struct PathInfo* pathInfo) { diff --git a/cli/src/utils.c b/cli/src/utils.c index 0eab320..adf6d4b 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -11,13 +11,11 @@ #include #include #include -#include #include -#include #include "securec.h" #include "logging.h" -static int IsStrEqual(const char *s1, const char *s2) +int IsStrEqual(const char *s1, const char *s2) { return (!strcmp(s1, s2)); } @@ -27,84 +25,6 @@ int StrHasPrefix(const char *str, const char *prefix) return (!strncmp(str, prefix, strlen(prefix))); } -bool CheckRootDir(char **pLine) -{ - char *rootDir = NULL; - for (int i = 0; i < ROOT_GAP; i++) { - /* root is substr before gap, line is substr after gap */ - rootDir = strsep(pLine, " "); - if (rootDir == NULL || *rootDir == '\0') { - return false; - } - } - - return strlen(rootDir) < BUF_SIZE && !StrHasPrefix(rootDir, "/.."); -} - -bool CheckFsType(char **pLine) -{ - char* fsType = NULL; - for (int i = 0; i < FSTYPE_GAP; i++) { - fsType = strsep(pLine, " "); - if (fsType == NULL || *fsType == '\0') { - return false; - } - } - - return IsStrEqual(fsType, "cgroup"); -} - -bool CheckSubStr(char **pLine, const char *subsys) -{ - char* substr = NULL; - for (int i = 0; i < MOUNT_SUBSTR_GAP; i++) { - substr = strsep(pLine, " "); - if (substr == NULL || *substr == '\0') { - return false; - } - } - - return strstr(substr, subsys) != NULL; -} - -int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) -{ - FILE *fp = NULL; - char *line = NULL; - size_t len = 0; - char resolvedPath[PATH_MAX] = {0x0}; - - if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize path %s\n", filepath); - return -1; - } - - fp = fopen(resolvedPath, "r"); - if (fp == NULL) { - LogError("cannot open file.\n"); - return -1; - } - - while (getline(&line, &len, fp) != -1) { - char* result = fn(line, "devices"); - if (result != NULL && strlen(result) < bufferSize) { - errno_t ret = strncpy_s(buffer, BUF_SIZE, result, strlen(result)); - if (ret != EOK) { - fclose(fp); - return -1; - } - break; - } - } - - if (line != NULL) { - free(line); - } - - fclose(fp); - return 0; -} - int MkDir(const char *dir, int mode) { return mkdir(dir, mode); @@ -190,25 +110,5 @@ int CreateFile(const char *path, mode_t mode) return -1; } close(fd); - return 0; -} - -int Mount(const char *src, const char *dst) -{ - static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; - int ret; - - ret = mount(src, dst, NULL, MS_BIND, NULL); - if (ret < 0) { - LogError("error: failed to mount\n"); - return -1; - } - - ret = mount(NULL, dst, NULL, remountFlags, NULL); - if (ret < 0) { - LogError("error: failed to re-mount\n"); - return -1; - } - return 0; } \ No newline at end of file diff --git a/cli/src/utils.h b/cli/src/utils.h index cd5892d..39b59ae 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -9,21 +9,13 @@ #include #include "basic.h" -// For cgroup setup +int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); -bool CheckRootDir(char **pLine); -bool CheckFsType(char **pLine); -bool CheckSubStr(char **pLine, const char *subsys); -typedef char *(*ParseFileLine)(char *, const char *); -int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); - -// For mount setup int MkDir(const char *dir, int mode); int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeParentDir(const char *path, mode_t mode); int CreateFile(const char *path, mode_t mode); -int Mount(const char *src, const char *dst); #endif \ No newline at end of file -- Gitee From 27561ec1ce44617dd5e1dbcb4fb82d26df79803c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Jul 2020 17:44:05 +0800 Subject: [PATCH 052/296] Match-id-3b1b67c3bf449ccb084588665428f4aef723d2b2 --- cli/src/basic.c | 10 +++++++++ cli/src/basic.h | 19 ++++++++++------ cli/src/cgrp.c | 33 +++++++++------------------ cli/src/cgrp.h | 4 ++-- cli/src/main.c | 59 +++++++++++++++++++++++++++++++++++++++++++------ cli/src/mount.c | 43 ++++++++++++----------------------- cli/src/mount.h | 2 +- 7 files changed, 102 insertions(+), 68 deletions(-) create mode 100644 cli/src/basic.c diff --git a/cli/src/basic.c b/cli/src/basic.c new file mode 100644 index 0000000..643cc9f --- /dev/null +++ b/cli/src/basic.c @@ -0,0 +1,10 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具公共宏和结构体定义 +*/ +#include "basic.h" + +void InitParsedConfig(struct ParsedConfig *parsedConfig) +{ + parsedConfig->devicesNr = MAX_DEVICE_NR; +} \ No newline at end of file diff --git a/cli/src/basic.h b/cli/src/basic.h index 98743de..8f188dc 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -16,6 +16,7 @@ #define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 +#define MAX_DEVICE_NR 1024 #define ALLOW_PATH "/devices.allow" #define ROOT_GAP 4 @@ -23,13 +24,6 @@ #define MOUNT_SUBSTR_GAP 2 #define ROOT_SUBSTR_GAP 2 -struct CmdArgs { - char devices[BUF_SIZE]; - char rootfs[BUF_SIZE]; - int pid; - char options[BUF_SIZE]; -}; - struct PathInfo { char* src; size_t srcLen; @@ -37,4 +31,15 @@ struct PathInfo { size_t dstLen; }; +struct ParsedConfig { + char rootfs[BUF_SIZE]; + unsigned int devices[MAX_DEVICE_NR]; + size_t devicesNr; + char containerNsPath[BUF_SIZE]; + char cgroupPath[BUF_SIZE]; + int originNsFd; +}; + +void InitParsedConfig(struct ParsedConfig *parsedConfig); + #endif \ No newline at end of file diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index b664042..c799bb9 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -199,7 +199,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) return 0; } -int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize) +int GetCgroupPath(int pid, char *effPath, size_t maxSize) { int ret; char mountPath[BUF_SIZE] = {0x0}; @@ -219,9 +219,9 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz char cgroup[BUF_SIZE] = {0x0}; char cgroupPath[BUF_SIZE] = {0x0}; - ret = snprintf_s(cgroupPath, BUF_SIZE, BUF_SIZE, "/proc/%d/cgroup", args->pid); + ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { - LogError("error: assemble cgroup path failed: pid(%d)\n", args->pid); + LogError("error: assemble cgroup path failed: pid(%d).", pid); return -1; } @@ -243,26 +243,18 @@ int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSiz return 0; } -int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) +int SetupCgroup(const struct ParsedConfig *config) { int ret; char deviceName[BUF_SIZE] = {0}; char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; - if (realpath(cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize cgroup path: %s\n", cgroupPath); + if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { + LogError("error: cannot canonicalize cgroup path: %s.", config->cgroupPath); return -1; } - static const char *sep = ","; - char list[BUF_SIZE] = {0}; - errno_t err = strncpy_s(list, BUF_SIZE, args->devices, strlen(args->devices)); - if (err != EOK) { - return -1; - } - char *token = NULL; - cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { LogError("error: failed to open cgroup file: %s.", resolvedCgroupPath); @@ -275,24 +267,21 @@ int SetupCgroup(struct CmdArgs *args, const char *cgroupPath) LogError("error: failed to setup driver cgroup."); return -1; } - - token = strtok(list, sep); - while (token != NULL) { - ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); + + for (size_t idx = 0; idx < config->devicesNr; idx++) { + ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to assemble device path for no.%s\n", token); + LogError("error: failed to assemble device path for no.%u.", config->devices[idx]); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to setup cgroup %s\n", token); + LogError("error: failed to setup cgroup for %s.", deviceName); return -1; } - - token = strtok(NULL, sep); } fclose(cgroupAllow); diff --git a/cli/src/cgrp.h b/cli/src/cgrp.h index f4fa949..e66dd1e 100644 --- a/cli/src/cgrp.h +++ b/cli/src/cgrp.h @@ -7,7 +7,7 @@ #include "basic.h" -int GetCgroupPath(const struct CmdArgs *args, char *effPath, size_t maxSize); -int SetupCgroup(struct CmdArgs *args, const char *cgroupPath); +int GetCgroupPath(int pid, char *effPath, size_t maxSize); +int SetupCgroup(const struct ParsedConfig *config); #endif \ No newline at end of file diff --git a/cli/src/main.c b/cli/src/main.c index 8556e6e..6cdf36b 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -23,10 +23,11 @@ #define DECIMAL 10 -struct ParsedConfig { - char containerNsPath[BUF_SIZE]; - char cgroupPath[BUF_SIZE]; - int originNsFd; +struct CmdArgs { + char devices[BUF_SIZE]; + char rootfs[BUF_SIZE]; + int pid; + char options[BUF_SIZE]; }; static struct option g_cmdOpts[] = { @@ -129,9 +130,51 @@ static inline bool IsCmdArgsValid(struct CmdArgs *args) return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } +static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) +{ + static const char *sep = ","; + char *token = NULL; + char *context = NULL; + size_t idx = 0; + + token = strtok_s(devices, sep, &context); + while (token != NULL) { + if (idx >= *idListSize) { + LogError("error: too many devices(%u), support %u devices maximally", idx, *idListSize); + return -1; + } + + errno = 0; + idList[idx] = strtoul((const char *)token, NULL, DECIMAL); + if (errno != 0) { + LogError("error: failed to convert device id (%s) from cmd args, caused by: %s.", token, strerror(errno)); + return -1; + } + + idx++; + token = strtok_s(NULL, sep, &context); + } + + *idListSize = idx; + return 0; +} + int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; + errno_t err; + + err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); + if (err != EOK) { + LogError("error: failed to copy rootfs path to parsed config."); + return -1; + } + + ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); + if (ret < 0) { + LogError("error: failed to parse device ids from cmdline argument"); + return -1; + } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { @@ -139,7 +182,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return -1; } - ret = GetCgroupPath(args, config->cgroupPath, BUF_SIZE); + ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { LogError("error: failed to get cgroup path."); return -1; @@ -172,6 +215,8 @@ int SetupContainer(struct CmdArgs *args) int ret; struct ParsedConfig config; + InitParsedConfig(&config); + ret = DoPrepare(args, &config); if (ret < 0) { LogError("error: failed to prepare nesessary config."); @@ -186,14 +231,14 @@ int SetupContainer(struct CmdArgs *args) return -1; } - ret = DoMounting(args); + ret = DoMounting(&config); if (ret < 0) { LogError("error: failed to do mounting."); close(config.originNsFd); return -1; } - ret = SetupCgroup(args, (const char *)config.cgroupPath); + ret = SetupCgroup(&config); if (ret < 0) { LogError("error: failed to set up cgroup."); close(config.originNsFd); diff --git a/cli/src/mount.c b/cli/src/mount.c index 9d23190..8ea900a 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -112,34 +112,22 @@ int MountDevice(const char *rootfs, const char *deviceName) return 0; } -int DoDeviceMounting(const char *rootfs, const char *devicesList) +int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr) { - static const char *sep = ","; - char list[BUF_SIZE] = {0}; char deviceName[BUF_SIZE] = {0}; - errno_t err = strncpy_s(list, BUF_SIZE, devicesList, strlen(devicesList)); - if (err != EOK) { - return -1; - } - char *token = NULL; - char *context = NULL; - - token = strtok_s(list, sep, &context); - while (token != NULL) { - int ret = snprintf_s(deviceName, BUF_SIZE, BUF_SIZE, "%s%s", DEVICE_NAME, token); + for (size_t idx = 0; idx < idsNr; idx++) { + int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (ret < 0) { - LogError("error: assemble device name failed, id: %s\n", token); + LogError("error: assemble device name failed, id: %u.", ids[idx]); return -1; } ret = MountDevice(rootfs, deviceName); if (ret < 0) { - LogError("error: failed to mount device no. %s\n", token); + LogError("error: failed to mount device %s.", deviceName); return -1; } - - token = strtok_s(NULL, sep, &context); } return 0; @@ -233,31 +221,28 @@ int DoDirectoryMounting(const char *rootfs) return 0; } -int DoMounting(const struct CmdArgs *args) +int DoMounting(const struct ParsedConfig *config) { int ret; - ret = DoDeviceMounting(args->rootfs, args->devices); + ret = DoDeviceMounting(config->rootfs, config->devices, config->devicesNr); if (ret < 0) { LogError("error: failed to do mounts."); return -1; } - ret = DoCtrlDeviceMounting(args->rootfs); + ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { LogError("error: failed to do mount files."); return -1; } - if (IsOptionNoDrvSet()) { - // 不挂载DRIVER - return 0; - } - - ret = DoDirectoryMounting(args->rootfs); - if (ret < 0) { - LogError("error: failed to do mount directory\n"); - return -1; + if (!IsOptionNoDrvSet()) { + ret = DoDirectoryMounting(config->rootfs); + if (ret < 0) { + LogError("error: failed to do mount directory."); + return -1; + } } return 0; diff --git a/cli/src/mount.h b/cli/src/mount.h index ddefced..f1bb6ff 100644 --- a/cli/src/mount.h +++ b/cli/src/mount.h @@ -7,6 +7,6 @@ #include "basic.h" -int DoMounting(const struct CmdArgs *args); +int DoMounting(const struct ParsedConfig *config); #endif \ No newline at end of file -- Gitee From 2bcecfbcffa062be3cece6152ea24d109cc91fda Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 30 Jul 2020 21:07:02 +0800 Subject: [PATCH 053/296] Match-id-77d0dcf76c49b84511b8f24c2acab8d001fbf905 --- cli/src/basic.h | 7 ++- cli/src/mount.c | 119 ++++++++++++++++++++++++++++++++++++------------ cli/src/utils.c | 20 +++++--- cli/src/utils.h | 2 +- 4 files changed, 111 insertions(+), 37 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 8f188dc..b930316 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -12,8 +12,13 @@ #define DAVINCI_MANAGER "davinci_manager" #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" -#define ASCEND_DRIVER_PATH "/usr/local/Ascend/driver" +#define ASCEND_DRIVER_LIB64_PATH "/usr/local/Ascend/driver/lib64" +#define ASCEND_DRIVER_TOOLS_PATH "/usr/local/Ascend/driver/tools" +#define ASCEND_DRIVER_INC_PATH "/usr/local/Ascend/driver/include" #define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" +#define ASCEND_DCMI_PATH "/usr/local/dcmi" +#define ASCEND_NPU_SMI_PATH "/usr/local/sbin/npu-smi" +#define ASCEND_SLOG_CONF_PATH "/var/log/npu/conf/slog/slog.conf" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 diff --git a/cli/src/mount.c b/cli/src/mount.c index 8ea900a..30dd7ca 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -133,6 +133,39 @@ int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr) return 0; } +int MountFile(const char *rootfs, const char *filepath) +{ + int ret; + char dst[BUF_SIZE] = {0}; + + ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); + if (ret < 0) { + LogError("error: failed to assemble file mounting path, file: %s.", filepath); + return -1; + } + + struct stat srcStat; + ret = stat(filepath, &srcStat); + if (ret < 0) { + LogError("error: failed to stat src: %s.", filepath); + return -1; + } + + ret = CreateFile(dst, srcStat.st_mode); + if (ret < 0) { + LogError("error: failed to create mount dst file: %s.", dst); + return -1; + } + + ret = Mount(filepath, dst); + if (ret < 0) { + LogError("error: failed to mount dev."); + return -1; + } + + return 0; +} + int MountDir(const char *rootfs, const char *src) { int ret; @@ -149,25 +182,10 @@ int MountDir(const char *rootfs, const char *src) return -1; } - /* directory */ - char parentDir[BUF_SIZE] = {0}; - GetParentPathStr(dst, parentDir, BUF_SIZE); - if (CheckDirExists(parentDir) < 0) { - mode_t parentMode = DEFAULT_DIR_MODE; - ret = MakeParentDir(parentDir, parentMode); - if (ret < 0) { - LogError("error: failed to make dir: %s.", parentDir); - return -1; - } - } - - if (CheckDirExists(dst) < 0) { - const mode_t curMode = srcStat.st_mode; - ret = MkDir(dst, curMode); - if (ret < 0) { - LogError("error: failed to make dir: %s.", dst); - return -1; - } + ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); + if (ret < 0) { + LogError("error: failed to make dir: %s.", dst); + return -1; } ret = Mount(src, dst); @@ -206,9 +224,21 @@ int DoCtrlDeviceMounting(const char *rootfs) int DoDirectoryMounting(const char *rootfs) { /* directory */ - int ret = MountDir(rootfs, ASCEND_DRIVER_PATH); + int ret = MountDir(rootfs, ASCEND_DRIVER_LIB64_PATH); + if (ret < 0) { + LogError("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_DRIVER_TOOLS_PATH); + if (ret < 0) { + LogError("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_DRIVER_INC_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_DRIVER_PATH); + LogError("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); return -1; } @@ -218,6 +248,29 @@ int DoDirectoryMounting(const char *rootfs) return -1; } + ret = MountDir(rootfs, ASCEND_DCMI_PATH); + if (ret < 0) { + LogError("error: failed to do mount %s.", ASCEND_DCMI_PATH); + return -1; + } + + return 0; +} + +int DoFileMounting(const char *rootfs) +{ + int ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH); + if (ret < 0) { + LogError("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); + return -1; + } + + MountFile(rootfs, ASCEND_SLOG_CONF_PATH); + if (ret < 0) { + LogError("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); + return -1; + } + return 0; } @@ -227,22 +280,30 @@ int DoMounting(const struct ParsedConfig *config) ret = DoDeviceMounting(config->rootfs, config->devices, config->devicesNr); if (ret < 0) { - LogError("error: failed to do mounts."); + LogError("error: failed to mount devices."); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - LogError("error: failed to do mount files."); + LogError("error: failed to mount ctrl devices."); return -1; } - if (!IsOptionNoDrvSet()) { - ret = DoDirectoryMounting(config->rootfs); - if (ret < 0) { - LogError("error: failed to do mount directory."); - return -1; - } + if (IsOptionNoDrvSet()) { + return 0; + } + + ret = DoFileMounting(config->rootfs); + if (ret < 0) { + LogError("error: failed to mount files."); + return -1; + } + + ret = DoDirectoryMounting(config->rootfs); + if (ret < 0) { + LogError("error: failed to do mount directories."); + return -1; } return 0; diff --git a/cli/src/utils.c b/cli/src/utils.c index adf6d4b..85bfb36 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -71,7 +71,7 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) return 0; } -int MakeParentDir(const char *path, mode_t mode) +int MakeDirWithParent(const char *path, mode_t mode) { if (*path == '\0' || *path == '.') { return 0; @@ -82,15 +82,13 @@ int MakeParentDir(const char *path, mode_t mode) char parentPath[BUF_SIZE] = {0}; GetParentPathStr(path, parentPath, BUF_SIZE); - if (strlen(parentPath) > 0 && MakeParentDir(parentPath, mode) < 0) { + if (strlen(parentPath) > 0 && MakeDirWithParent(parentPath, mode) < 0) { return -1; } - struct stat s; - int ret = stat(path, &s); + int ret = MkDir(path, mode); if (ret < 0) { - LogError("error: failed to stat path: %s.", path); - return (MkDir(path, mode)); + return -1; } return 0; @@ -98,6 +96,16 @@ int MakeParentDir(const char *path, mode_t mode) int CreateFile(const char *path, mode_t mode) { + /* directory */ + char parentDir[BUF_SIZE] = {0}; + GetParentPathStr(path, parentDir, BUF_SIZE); + + int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); + if (ret < 0) { + LogError("error: failed to make parent dir for file: %s", path); + return -1; + } + char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { LogError("error: failed to resolve path %s.", path); diff --git a/cli/src/utils.h b/cli/src/utils.h index 39b59ae..29dc8d7 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -15,7 +15,7 @@ int MkDir(const char *dir, int mode); int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); -int MakeParentDir(const char *path, mode_t mode); +int MakeDirWithParent(const char *path, mode_t mode); int CreateFile(const char *path, mode_t mode); #endif \ No newline at end of file -- Gitee From 12c4bbd54a3fbba783f60b30c065e85f97ac694b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 11 Aug 2020 12:00:52 +0800 Subject: [PATCH 054/296] Match-id-f7cdfc7a411976f9681dbea6a0d794378ec36d97 --- cli/src/basic.h | 1 + cli/src/logging.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++ cli/src/logging.h | 5 +++ cli/src/main.c | 29 ++++++++++++---- cli/src/mount.c | 7 ++-- cli/src/options.c | 8 +++++ cli/src/options.h | 1 + cli/src/utils.c | 2 -- hook/main.go | 1 + 9 files changed, 130 insertions(+), 11 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index b930316..44620b4 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -22,6 +22,7 @@ #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 +#define DEFAULT_LOG_FILE "/var/log/ascend-docker-runtime.log" #define ALLOW_PATH "/devices.allow" #define ROOT_GAP 4 diff --git a/cli/src/logging.c b/cli/src/logging.c index a4c5411..e8dad21 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -5,22 +5,109 @@ #include "logging.h" #include +#include #include +#include +#include +#include +#include +#include "securec.h" +#include "basic.h" + +static int g_pid = -1; +static FILE *g_logFile = NULL; + +void SetPidForLog(int pid) +{ + g_pid = pid; +} + +int OpenLog(const char *logFile) +{ + char realPath[PATH_MAX] = {0}; + + if (g_logFile != NULL) { + return 0; // 防重入 + } + + if (realpath(logFile, realPath) == NULL && errno != ENOENT) { + LogError("error: cannot canonicalize log file path %s.", logFile); + return -1; + } + + g_logFile = fopen((const char *)realPath, "ae"); + if (g_logFile == NULL) { + LogError("error: failed to open log file %s.", realPath); + return -1; + } + + return 0; +} + +void CloseLog() +{ + if (g_logFile != NULL) { + (void)fclose(g_logFile); + g_logFile = NULL; + } +} + +static void WriteLog(char level, const char *fmt, va_list args) +{ + struct timeval tv = {0}; + struct tm *tm = NULL; + char buf[BUF_SIZE] = {0}; + + if (g_logFile == NULL) { + return; + } + + if (gettimeofday(&tv, NULL) < 0 || + (tm = gmtime(&tv.tv_sec)) == NULL || + strftime(buf, sizeof(buf), "%m%d %T", tm) == 0) { + strcpy_s(buf, sizeof(buf), "0000 00:00:00"); + } + + fprintf(g_logFile, "[%c %s.%06ld %d] ", level, buf, tv.tv_usec, g_pid); + vfprintf(g_logFile, fmt, args); + fputc('\n', g_logFile); +} void LogError(const char *fmt, ...) { va_list args; + va_list logArgs; va_start(args, fmt); + va_copy(logArgs, args); vfprintf(stderr, fmt, args); + WriteLog('E', fmt, logArgs); + va_end(logArgs); va_end(args); } void LogInfo(const char *fmt, ...) { va_list args; + va_list logArgs; va_start(args, fmt); + va_copy(logArgs, args); vfprintf(stdout, fmt, args); + WriteLog('I', fmt, logArgs); + va_end(logArgs); + va_end(args); +} + +void LogWarning(const char *fmt, ...) +{ + va_list args; + va_list logArgs; + + va_start(args, fmt); + va_copy(logArgs, args); + vfprintf(stderr, fmt, args); + WriteLog('W', fmt, logArgs); + va_end(logArgs); va_end(args); } \ No newline at end of file diff --git a/cli/src/logging.h b/cli/src/logging.h index c0d31e3..eb25a4e 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -5,7 +5,12 @@ #ifndef _LOGGING_H #define _LOGGING_H +void SetPidForLog(int pid); +int OpenLog(const char *logFile); +void CloseLog(); + void LogError(const char *fmt, ...); void LogInfo(const char *fmt, ...); +void LogWarning(const char *fmt, ...); #endif diff --git a/cli/src/main.c b/cli/src/main.c index 6cdf36b..23262e6 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -201,12 +201,6 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return -1; } - ret = ParseRuntimeOptions(args->options); - if (ret < 0) { - LogError("error: failed to parse runtime options."); - return -1; - } - return 0; } @@ -277,11 +271,34 @@ int Process(int argc, char **argv) return -1; } + ret = ParseRuntimeOptions(args.options); + if (ret < 0) { + LogError("error: failed to parse runtime options."); + return -1; + } + + SetPidForLog(args.pid); + + if (IsOptionVerboseSet()) { + ret = OpenLog(DEFAULT_LOG_FILE); + if (ret < 0) { + LogError("error: failed to open log file %s.", DEFAULT_LOG_FILE); + return -1; + } + } + ret = SetupContainer(&args); if (ret < 0) { + if (IsOptionVerboseSet()) { + CloseLog(); + } return ret; } + if (IsOptionVerboseSet()) { + CloseLog(); + } + return 0; } diff --git a/cli/src/mount.c b/cli/src/mount.c index 30dd7ca..6ef04c4 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -147,8 +147,8 @@ int MountFile(const char *rootfs, const char *filepath) struct stat srcStat; ret = stat(filepath, &srcStat); if (ret < 0) { - LogError("error: failed to stat src: %s.", filepath); - return -1; + LogWarning("warning: failed to find file %s on host, skipping", filepath); + return 0; } ret = CreateFile(dst, srcStat.st_mode); @@ -179,7 +179,8 @@ int MountDir(const char *rootfs, const char *src) struct stat srcStat; ret = stat(src, &srcStat); if (ret < 0) { - return -1; + LogWarning("warning: failed to find dir %s on host, skipping", src); + return 0; } ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); diff --git a/cli/src/options.c b/cli/src/options.c index 7c644fd..db65922 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -10,6 +10,7 @@ static struct { bool noDrv; + bool verbose; } g_runtimeOptions; static struct { @@ -17,6 +18,7 @@ static struct { bool *flag; } g_optionNameFlagTable[] = { {"NODRV", &g_runtimeOptions.noDrv}, // 不挂载Driver + {"VERBOSE", &g_runtimeOptions.verbose}, // 输出日志 {NULL, NULL} }; @@ -24,6 +26,7 @@ int ParseRuntimeOptions(const char *options) { // set defaults value g_runtimeOptions.noDrv = false; + g_runtimeOptions.verbose = false; static const char *seperator = ","; char *runtimeOptions = strdup(options); @@ -50,4 +53,9 @@ int ParseRuntimeOptions(const char *options) bool IsOptionNoDrvSet() { return g_runtimeOptions.noDrv; +} + +bool IsOptionVerboseSet() +{ + return g_runtimeOptions.verbose; } \ No newline at end of file diff --git a/cli/src/options.h b/cli/src/options.h index 713c2fa..178e67c 100644 --- a/cli/src/options.h +++ b/cli/src/options.h @@ -9,5 +9,6 @@ int ParseRuntimeOptions(const char *options); bool IsOptionNoDrvSet(); +bool IsOptionVerboseSet(); #endif diff --git a/cli/src/utils.c b/cli/src/utils.c index 85bfb36..56cfc3a 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -42,11 +42,9 @@ int CheckDirExists(const char *dir) { DIR *ptr = opendir(dir); if (NULL == ptr) { - LogError("path %s not exist.", dir); return -1; } - LogInfo("path %s exist.", dir); closedir(ptr); return 0; } diff --git a/hook/main.go b/hook/main.go index 4c12347..3b9c96e 100644 --- a/hook/main.go +++ b/hook/main.go @@ -40,6 +40,7 @@ var ( var validRuntimeOptions = [...]string { "NODRV", + "VERBOSE", } type containerConfig struct { -- Gitee From cc86bacf10af2d76df2ebaab1b345fbb792fea5c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 12 Aug 2020 17:12:25 +0800 Subject: [PATCH 055/296] Match-id-976313045b38f9d45c2d04462bd7aa4e52d3d910 --- build/build.sh | 2 +- install/rpm/ascend-docker-plgugin.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 033a03c..e6e09fb 100644 --- a/build/build.sh +++ b/build/build.sh @@ -37,7 +37,7 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="20.10.0.B010" +VERSION="20.10.0.B011" RELEASE="1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 8c6ebf3..4b2827f 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,5 +1,5 @@ Name: ascend-docker-runtime -Version: 20.10.0.B010 +Version: 20.10.0.B011 Release: 1 Summary: simple RPM package License: FIXME -- Gitee From 93c255226589947f6abb55088e7d365a107addca Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 13 Aug 2020 22:54:04 +0800 Subject: [PATCH 056/296] Match-id-beb8d4fb418798357ca537b319d7668809a73832 --- build/build.sh | 2 +- install/rpm/ascend-docker-plgugin.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index e6e09fb..353dc52 100644 --- a/build/build.sh +++ b/build/build.sh @@ -37,7 +37,7 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="20.10.0.B011" +VERSION="20.10.0.B020" RELEASE="1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec index 4b2827f..f6f27aa 100644 --- a/install/rpm/ascend-docker-plgugin.spec +++ b/install/rpm/ascend-docker-plgugin.spec @@ -1,5 +1,5 @@ Name: ascend-docker-runtime -Version: 20.10.0.B011 +Version: 20.10.0.B020 Release: 1 Summary: simple RPM package License: FIXME -- Gitee From 1186fd79cb154b9551581bc41ef09940d03f9500 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 14 Aug 2020 15:39:38 +0800 Subject: [PATCH 057/296] Match-id-35cb677715f18e6f886c35c5a2e416662c53dee4 --- build/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 353dc52..c30d13b 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,7 @@ #!/bin/bash ROOT=$(cd `dirname $0`; pwd)/.. +TOP_DIR=$ROOT/.. OPENSRC=${ROOT}/opensource PLATFORM=${ROOT}/platform @@ -37,7 +38,8 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION="20.10.0.B020" +SOFT_VERSION=`cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2` +VERSION=$SOFT_VERSION RELEASE="1" PACKAGENAEM="ascend-docker-runtime" CPUARCH=`uname -m` @@ -117,6 +119,7 @@ if [ $FILECNT -ne 4 ]; then exit 1 fi SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` +sed -i "2c Version: ${SOFT_VERSION}" ${SPECPATH} dos2unix ${SPECPATH} /bin/cp -f ${SPECPATH} ${RPMSPECDIR} funcfillspec -- Gitee From 8852e0f5a6012f7456b0d1c8503f9b641943f9b0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 12 Aug 2020 10:04:47 +0800 Subject: [PATCH 058/296] Match-id-8cad4ff461f64381114db1fcb55d8d1a13b10ca0 --- cli/src/logging.c | 37 ++++++++++++++++++++++--------------- cli/src/main.c | 18 ++++++------------ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/cli/src/logging.c b/cli/src/logging.c index e8dad21..a980460 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -13,6 +13,7 @@ #include #include "securec.h" #include "basic.h" +#include "options.h" static int g_pid = -1; static FILE *g_logFile = NULL; @@ -26,8 +27,8 @@ int OpenLog(const char *logFile) { char realPath[PATH_MAX] = {0}; - if (g_logFile != NULL) { - return 0; // 防重入 + if (!IsOptionVerboseSet()) { // 日志开关 + return 0; } if (realpath(logFile, realPath) == NULL && errno != ENOENT) { @@ -46,7 +47,7 @@ int OpenLog(const char *logFile) void CloseLog() { - if (g_logFile != NULL) { + if (IsOptionVerboseSet() && g_logFile != NULL) { (void)fclose(g_logFile); g_logFile = NULL; } @@ -76,38 +77,44 @@ static void WriteLog(char level, const char *fmt, va_list args) void LogError(const char *fmt, ...) { va_list args; - va_list logArgs; va_start(args, fmt); - va_copy(logArgs, args); + + va_list argsCopy; + va_copy(argsCopy, args); + WriteLog('E', fmt, argsCopy); + va_end(argsCopy); + vfprintf(stderr, fmt, args); - WriteLog('E', fmt, logArgs); - va_end(logArgs); va_end(args); } void LogInfo(const char *fmt, ...) { va_list args; - va_list logArgs; va_start(args, fmt); - va_copy(logArgs, args); + + va_list argsCopy; + va_copy(argsCopy, args); + WriteLog('I', fmt, argsCopy); + va_end(argsCopy); + vfprintf(stdout, fmt, args); - WriteLog('I', fmt, logArgs); - va_end(logArgs); va_end(args); } void LogWarning(const char *fmt, ...) { va_list args; - va_list logArgs; va_start(args, fmt); - va_copy(logArgs, args); + + va_list argsCopy; + va_copy(argsCopy, args); + WriteLog('W', fmt, argsCopy); + va_end(argsCopy); + vfprintf(stderr, fmt, args); - WriteLog('W', fmt, logArgs); - va_end(logArgs); va_end(args); } \ No newline at end of file diff --git a/cli/src/main.c b/cli/src/main.c index 23262e6..96bef1a 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -279,25 +279,19 @@ int Process(int argc, char **argv) SetPidForLog(args.pid); - if (IsOptionVerboseSet()) { - ret = OpenLog(DEFAULT_LOG_FILE); - if (ret < 0) { - LogError("error: failed to open log file %s.", DEFAULT_LOG_FILE); - return -1; - } + ret = OpenLog(DEFAULT_LOG_FILE); + if (ret < 0) { + LogError("error: failed to open log file %s.", DEFAULT_LOG_FILE); + return -1; } ret = SetupContainer(&args); if (ret < 0) { - if (IsOptionVerboseSet()) { - CloseLog(); - } + CloseLog(); return ret; } - if (IsOptionVerboseSet()) { - CloseLog(); - } + CloseLog(); return 0; } -- Gitee From 7450e279643d902a98a0bd73bffcfbfb2e1852f0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 15 Jul 2020 14:58:02 +0800 Subject: [PATCH 059/296] Match-id-6bec9e8ddf9ab55562f6a096cbc1b65546890066 --- .gitignore | 1 + cli/test/CMakeLists.txt | 157 - cli/test/dt/CMakeLists.txt | 85 + cli/test/dt/Depend/CMakeLists.txt | 60 + .../dt/Depend/HuaweiSecureC/CMakeLists.txt | 9 + cli/test/dt/Depend/public_stub.cpp | 6 + cli/test/dt/Depend/ut_comm.h | 24 + cli/test/dt/Depend/ut_main.cpp | 35 + cli/test/dt/Scripts/pre.sh | 30 + cli/test/dt/build.sh | 150 + cli/test/dt/cmake/internal_utils.cmake | 72 + cli/test/dt/srclib/CMakeLists.txt | 21 + .../{ => dt}/testcase/gtest_mytestcase.cpp | 550 +- cli/test/{ => dt}/testcase/main.cpp | 0 cli/test/include/gtest/UdpSocket.h | 220 - cli/test/include/gtest/gtest-death-test.h | 283 - cli/test/include/gtest/gtest-message.h | 230 - cli/test/include/gtest/gtest-param-test.h | 1421 - cli/test/include/gtest/gtest-printers.h | 796 - cli/test/include/gtest/gtest-spi.h | 232 - cli/test/include/gtest/gtest-test-part.h | 180 - cli/test/include/gtest/gtest-typed-test.h | 259 - cli/test/include/gtest/gtest.h | 2552 -- cli/test/include/gtest/gtest_pred_impl.h | 371 - cli/test/include/gtest/gtest_prod.h | 58 - .../internal/gtest-death-test-internal.h | 308 - .../include/gtest/internal/gtest-filepath.h | 210 - .../include/gtest/internal/gtest-internal.h | 1280 - .../include/gtest/internal/gtest-linked_ptr.h | 233 - .../internal/gtest-param-util-generated.h | 4822 --- .../gtest-param-util-generated.h.pump | 301 - .../include/gtest/internal/gtest-param-util.h | 628 - cli/test/include/gtest/internal/gtest-port.h | 1782 - .../include/gtest/internal/gtest-string.h | 350 - cli/test/include/gtest/internal/gtest-tuple.h | 968 - .../include/gtest/internal/gtest-tuple.h.pump | 336 - .../include/gtest/internal/gtest-type-util.h | 3330 -- .../gtest/internal/gtest-type-util.h.pump | 296 - cli/test/include/gtest/msxml6.h | 27093 ---------------- cli/test/include/gtest/msxml6.idl | 3934 --- cli/test/include/gtest/msxml6did.h | 660 - cli/test/include/gtest/tinystr.h | 294 - cli/test/include/gtest/tinyxml.h | 1511 - cli/test/include/mockcpp/AfterMatchBuilder.h | 58 - .../include/mockcpp/AfterMatchBuilder.tcc | 58 - cli/test/include/mockcpp/AfterMatcher.h | 56 - cli/test/include/mockcpp/ApiHook.h | 24 - cli/test/include/mockcpp/ApiHookFunctor.h | 167 - cli/test/include/mockcpp/ApiHookGenerator.h | 75 - cli/test/include/mockcpp/ApiHookHolder.h | 19 - .../include/mockcpp/ApiHookHolderFactory.h | 23 - cli/test/include/mockcpp/ApiHookKey.h | 50 - cli/test/include/mockcpp/ApiHookMocker.h | 125 - cli/test/include/mockcpp/ArgumentsList.h | 43 - cli/test/include/mockcpp/ArgumentsListDef.h | 13 - .../include/mockcpp/ArgumentsListDef.h.rule | 1 - .../include/mockcpp/ArgumentsMacroHelpers.h | 67 - .../include/mockcpp/ArgumentsMatchBuilder.h | 77 - .../include/mockcpp/ArgumentsMatchBuilder.tcc | 87 - cli/test/include/mockcpp/Asserter.h | 61 - .../include/mockcpp/AssertionFailedError.h | 45 - cli/test/include/mockcpp/BeforeMatchBuilder.h | 59 - .../include/mockcpp/BeforeMatchBuilder.tcc | 59 - cli/test/include/mockcpp/BeforeMatcher.h | 56 - cli/test/include/mockcpp/CallerMatchBuilder.h | 48 - .../include/mockcpp/CallerMatchBuilder.tcc | 37 - cli/test/include/mockcpp/CallerMatcher.h | 45 - .../include/mockcpp/ChainableMockMethod.h | 133 - .../mockcpp/ChainableMockMethodContainer.h | 54 - .../include/mockcpp/ChainableMockMethodCore.h | 89 - .../mockcpp/ChainableMockMethodIndexKey.h | 46 - .../include/mockcpp/ChainableMockMethodKey.h | 36 - .../mockcpp/ChainableMockMethodNameKey.h | 46 - .../include/mockcpp/ChainableMockObject.h | 69 - .../include/mockcpp/ChainableMockObjectBase.h | 75 - cli/test/include/mockcpp/ChainingMockHelper.h | 254 - cli/test/include/mockcpp/CheckWith.h | 56 - cli/test/include/mockcpp/CodeModifier.h | 35 - cli/test/include/mockcpp/Constraint.h | 40 - cli/test/include/mockcpp/ConstraintSet.h | 64 - .../include/mockcpp/DecoratedConstraint.h | 57 - cli/test/include/mockcpp/DefaultBuilder.h | 47 - cli/test/include/mockcpp/DefaultMatcher.h | 40 - .../mockcpp/DefaultMethodAddrGetterDef.h | 500 - .../mockcpp/DefaultMethodAddrGetterDef.h.rule | 1 - cli/test/include/mockcpp/DefaultStub.h | 48 - cli/test/include/mockcpp/DelegatedMethod.h | 76 - cli/test/include/mockcpp/DelegatedMethodDef.h | 26 - .../include/mockcpp/DelegatedMethodDef.h.rule | 1 - .../mockcpp/DelegatedMethodGetByVptrDef.h | 5 - .../DelegatedMethodGetByVptrDef.h.rule | 1 - .../include/mockcpp/DelegatedMethodGetDef.h | 100 - .../mockcpp/DelegatedMethodGetDef.h.rule | 1 - .../include/mockcpp/DelegatedMethodGetter.h | 84 - .../include/mockcpp/DestructorAddrGetterDef.h | 5 - .../mockcpp/DestructorAddrGetterDef.h.rule | 1 - cli/test/include/mockcpp/DestructorChecker.h | 58 - cli/test/include/mockcpp/DieStub.h | 47 - cli/test/include/mockcpp/DummyBuilder.h | 31 - cli/test/include/mockcpp/EqualityUtil.h | 43 - cli/test/include/mockcpp/Exception.h | 56 - cli/test/include/mockcpp/ExpectsMatcher.h | 48 - cli/test/include/mockcpp/Formatter.h | 92 - cli/test/include/mockcpp/Functor.h | 124 - .../mockcpp/GenericMethodIndicesChecker.h | 65 - cli/test/include/mockcpp/GlobalMockObject.h | 65 - .../include/mockcpp/GnuMethodIndicesChecker.h | 40 - .../include/mockcpp/GnuMethodInfoReader.h | 105 - cli/test/include/mockcpp/HookMockObject.h | 64 - cli/test/include/mockcpp/IdentityBuilder.h | 42 - cli/test/include/mockcpp/Ignore.h | 46 - cli/test/include/mockcpp/IgnoreHandler.h | 46 - .../include/mockcpp/IgnoreResultHandler.h | 39 - .../mockcpp/IgnoreResultHandlerFactory.h | 43 - cli/test/include/mockcpp/IgnoreReturnStub.h | 44 - cli/test/include/mockcpp/IncrementStub.h | 110 - .../include/mockcpp/IndexInvokableGetter.h | 39 - cli/test/include/mockcpp/InterfaceInfo.h | 39 - cli/test/include/mockcpp/Invocation.h | 73 - cli/test/include/mockcpp/InvocationId.h | 41 - .../include/mockcpp/InvocationMockBuilder.h | 47 - .../include/mockcpp/InvocationMockBuilder.tcc | 39 - .../mockcpp/InvocationMockBuilderGetter.h | 59 - cli/test/include/mockcpp/InvocationMocker.h | 63 - .../mockcpp/InvocationMockerContainer.h | 44 - .../mockcpp/InvocationMockerNamespace.h | 41 - .../include/mockcpp/InvocationMockerSet.h | 61 - .../include/mockcpp/InvocationTimesMatcher.h | 51 - .../mockcpp/InvocationWithReturnType.h | 52 - cli/test/include/mockcpp/Invokable.h | 65 - cli/test/include/mockcpp/InvokedAtLeast.h | 45 - cli/test/include/mockcpp/InvokedAtMost.h | 47 - cli/test/include/mockcpp/InvokedExactly.h | 45 - cli/test/include/mockcpp/InvokedOnce.h | 42 - .../include/mockcpp/InvokedTimesMatcher.h | 52 - cli/test/include/mockcpp/InvokedTimesReader.h | 36 - .../include/mockcpp/InvokedTimesRecorder.h | 36 - cli/test/include/mockcpp/IsAnything.h | 42 - cli/test/include/mockcpp/IsAnythingHelper.h | 37 - cli/test/include/mockcpp/IsConst.h | 49 - cli/test/include/mockcpp/IsEqual.h | 58 - cli/test/include/mockcpp/IsGreaterThan.h | 59 - cli/test/include/mockcpp/IsLessThan.h | 58 - cli/test/include/mockcpp/IsMirror.h | 181 - cli/test/include/mockcpp/IsNotEqual.h | 58 - cli/test/include/mockcpp/IsRef.h | 56 - cli/test/include/mockcpp/IsStringContains.h | 37 - cli/test/include/mockcpp/IsStringEndWith.h | 37 - cli/test/include/mockcpp/IsStringStartWith.h | 37 - cli/test/include/mockcpp/JmpCode.h | 45 - cli/test/include/mockcpp/Matcher.h | 42 - cli/test/include/mockcpp/Method.h | 47 - .../include/mockcpp/MethodIndiceChecker.h | 48 - .../include/mockcpp/MethodIndiceCheckerDef.h | 500 - .../mockcpp/MethodIndiceCheckerDef.h.rule | 1 - cli/test/include/mockcpp/MethodInfoReader.h | 35 - cli/test/include/mockcpp/MethodTypeTraits.h | 56 - .../include/mockcpp/MethodTypeTraitsDef.h | 26 - .../mockcpp/MethodTypeTraitsDef.h.rule | 1 - .../include/mockcpp/MismatchResultHandler.h | 51 - .../mockcpp/MismatchResultHandlerFactory.h | 43 - cli/test/include/mockcpp/MockBuilder.h | 56 - cli/test/include/mockcpp/MockObject.h | 181 - cli/test/include/mockcpp/MockObjectBase.h | 72 - cli/test/include/mockcpp/MockObjectHelper.h | 46 - cli/test/include/mockcpp/MoreStubBuilder.h | 47 - cli/test/include/mockcpp/MoreStubBuilder.tcc | 33 - .../include/mockcpp/MsvcMethodInfoReader.h | 85 - cli/test/include/mockcpp/MsvcRtti.h | 76 - .../include/mockcpp/NormalResultHandler.h | 46 - .../mockcpp/NormalResultHandlerFactory.h | 43 - cli/test/include/mockcpp/ObjNameGetter.h | 38 - cli/test/include/mockcpp/OrderingMatcher.h | 39 - cli/test/include/mockcpp/OutBound.h | 60 - cli/test/include/mockcpp/OutBoundPointer.h | 129 - cli/test/include/mockcpp/OutputStringStream.h | 25 - .../mockcpp/ParameterizedApiHookHolder.h | 38 - cli/test/include/mockcpp/PendingMatcher.h | 66 - cli/test/include/mockcpp/ProcStub.h | 196 - cli/test/include/mockcpp/ProcessWith.h | 58 - cli/test/include/mockcpp/RepeatMacros.h | 70 - cli/test/include/mockcpp/RepeatStub.h | 49 - cli/test/include/mockcpp/ReportFailure.h | 51 - cli/test/include/mockcpp/Result.h | 50 - cli/test/include/mockcpp/ResultHandler.h | 40 - .../include/mockcpp/ResultHandlerFactory.h | 46 - cli/test/include/mockcpp/ReturnObjectList.h | 64 - cli/test/include/mockcpp/ReturnStub.h | 48 - cli/test/include/mockcpp/SelfDescribe.h | 36 - .../mockcpp/SimpleInvocationRecorder.h | 44 - cli/test/include/mockcpp/Spy.h | 55 - cli/test/include/mockcpp/StatelessMatcher.h | 39 - cli/test/include/mockcpp/StringConstraint.h | 47 - cli/test/include/mockcpp/StringPredict.h | 39 - cli/test/include/mockcpp/Stub.h | 41 - cli/test/include/mockcpp/StubBuilder.h | 47 - cli/test/include/mockcpp/StubBuilder.tcc | 33 - cli/test/include/mockcpp/StubContainer.h | 52 - cli/test/include/mockcpp/StubsBuilder.h | 44 - cli/test/include/mockcpp/StubsMatcher.h | 40 - cli/test/include/mockcpp/TestFailureMatcher.h | 45 - cli/test/include/mockcpp/ThenStub.h | 49 - cli/test/include/mockcpp/ThrowExceptionStub.h | 74 - cli/test/include/mockcpp/TypeString.h | 53 - cli/test/include/mockcpp/TypeTraits.h | 108 - cli/test/include/mockcpp/TypelessConstraint.h | 37 - .../mockcpp/TypelessConstraintAdapter.h | 48 - cli/test/include/mockcpp/TypelessStub.h | 42 - .../include/mockcpp/TypelessStubAdapter.h | 50 - cli/test/include/mockcpp/VirtualTable.h | 61 - cli/test/include/mockcpp/VirtualTableUtils.h | 34 - cli/test/include/mockcpp/Void.h | 31 - cli/test/include/mockcpp/VoidResultHandler.h | 56 - .../mockcpp/VoidResultHandlerFactory.h | 46 - cli/test/include/mockcpp/WillStub.h | 49 - cli/test/include/mockcpp/WinCodeModifier.h | 35 - cli/test/include/mockcpp/mockable.h | 33 - cli/test/include/mockcpp/mockcpp.h | 92 - cli/test/include/mockcpp/mockcpp.hpp | 29 - cli/test/include/mockcpp/mokc.h | 52 - cli/test/include/mockcpp/types/Any.h | 75 - cli/test/include/mockcpp/types/AnyBase.h | 71 - cli/test/include/mockcpp/types/AnyCast.h | 166 - cli/test/include/mockcpp/types/Holder.h | 65 - cli/test/include/mockcpp/types/PlaceHolder.h | 48 - cli/test/include/mockcpp/types/RefAny.h | 81 - cli/test/include/mockcpp/types/RefHolder.h | 58 - cli/test/include/mockcpp/types/ValueHolder.h | 298 - cli/test/include/mockcpp/utils.h | 59 - cli/test/testcase/CMakeCache.txt | 304 - cli/test/testcase/Makefile | 208 - 231 files changed, 824 insertions(+), 67212 deletions(-) create mode 100644 .gitignore delete mode 100644 cli/test/CMakeLists.txt create mode 100644 cli/test/dt/CMakeLists.txt create mode 100644 cli/test/dt/Depend/CMakeLists.txt create mode 100644 cli/test/dt/Depend/HuaweiSecureC/CMakeLists.txt create mode 100644 cli/test/dt/Depend/public_stub.cpp create mode 100644 cli/test/dt/Depend/ut_comm.h create mode 100644 cli/test/dt/Depend/ut_main.cpp create mode 100644 cli/test/dt/Scripts/pre.sh create mode 100644 cli/test/dt/build.sh create mode 100644 cli/test/dt/cmake/internal_utils.cmake create mode 100644 cli/test/dt/srclib/CMakeLists.txt rename cli/test/{ => dt}/testcase/gtest_mytestcase.cpp (60%) rename cli/test/{ => dt}/testcase/main.cpp (100%) delete mode 100644 cli/test/include/gtest/UdpSocket.h delete mode 100644 cli/test/include/gtest/gtest-death-test.h delete mode 100644 cli/test/include/gtest/gtest-message.h delete mode 100644 cli/test/include/gtest/gtest-param-test.h delete mode 100644 cli/test/include/gtest/gtest-printers.h delete mode 100644 cli/test/include/gtest/gtest-spi.h delete mode 100644 cli/test/include/gtest/gtest-test-part.h delete mode 100644 cli/test/include/gtest/gtest-typed-test.h delete mode 100644 cli/test/include/gtest/gtest.h delete mode 100644 cli/test/include/gtest/gtest_pred_impl.h delete mode 100644 cli/test/include/gtest/gtest_prod.h delete mode 100644 cli/test/include/gtest/internal/gtest-death-test-internal.h delete mode 100644 cli/test/include/gtest/internal/gtest-filepath.h delete mode 100644 cli/test/include/gtest/internal/gtest-internal.h delete mode 100644 cli/test/include/gtest/internal/gtest-linked_ptr.h delete mode 100644 cli/test/include/gtest/internal/gtest-param-util-generated.h delete mode 100644 cli/test/include/gtest/internal/gtest-param-util-generated.h.pump delete mode 100644 cli/test/include/gtest/internal/gtest-param-util.h delete mode 100644 cli/test/include/gtest/internal/gtest-port.h delete mode 100644 cli/test/include/gtest/internal/gtest-string.h delete mode 100644 cli/test/include/gtest/internal/gtest-tuple.h delete mode 100644 cli/test/include/gtest/internal/gtest-tuple.h.pump delete mode 100644 cli/test/include/gtest/internal/gtest-type-util.h delete mode 100644 cli/test/include/gtest/internal/gtest-type-util.h.pump delete mode 100644 cli/test/include/gtest/msxml6.h delete mode 100644 cli/test/include/gtest/msxml6.idl delete mode 100644 cli/test/include/gtest/msxml6did.h delete mode 100644 cli/test/include/gtest/tinystr.h delete mode 100644 cli/test/include/gtest/tinyxml.h delete mode 100644 cli/test/include/mockcpp/AfterMatchBuilder.h delete mode 100644 cli/test/include/mockcpp/AfterMatchBuilder.tcc delete mode 100644 cli/test/include/mockcpp/AfterMatcher.h delete mode 100644 cli/test/include/mockcpp/ApiHook.h delete mode 100644 cli/test/include/mockcpp/ApiHookFunctor.h delete mode 100644 cli/test/include/mockcpp/ApiHookGenerator.h delete mode 100644 cli/test/include/mockcpp/ApiHookHolder.h delete mode 100644 cli/test/include/mockcpp/ApiHookHolderFactory.h delete mode 100644 cli/test/include/mockcpp/ApiHookKey.h delete mode 100644 cli/test/include/mockcpp/ApiHookMocker.h delete mode 100644 cli/test/include/mockcpp/ArgumentsList.h delete mode 100644 cli/test/include/mockcpp/ArgumentsListDef.h delete mode 100644 cli/test/include/mockcpp/ArgumentsListDef.h.rule delete mode 100644 cli/test/include/mockcpp/ArgumentsMacroHelpers.h delete mode 100644 cli/test/include/mockcpp/ArgumentsMatchBuilder.h delete mode 100644 cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc delete mode 100644 cli/test/include/mockcpp/Asserter.h delete mode 100644 cli/test/include/mockcpp/AssertionFailedError.h delete mode 100644 cli/test/include/mockcpp/BeforeMatchBuilder.h delete mode 100644 cli/test/include/mockcpp/BeforeMatchBuilder.tcc delete mode 100644 cli/test/include/mockcpp/BeforeMatcher.h delete mode 100644 cli/test/include/mockcpp/CallerMatchBuilder.h delete mode 100644 cli/test/include/mockcpp/CallerMatchBuilder.tcc delete mode 100644 cli/test/include/mockcpp/CallerMatcher.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethod.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethodContainer.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethodCore.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethodIndexKey.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethodKey.h delete mode 100644 cli/test/include/mockcpp/ChainableMockMethodNameKey.h delete mode 100644 cli/test/include/mockcpp/ChainableMockObject.h delete mode 100644 cli/test/include/mockcpp/ChainableMockObjectBase.h delete mode 100644 cli/test/include/mockcpp/ChainingMockHelper.h delete mode 100644 cli/test/include/mockcpp/CheckWith.h delete mode 100644 cli/test/include/mockcpp/CodeModifier.h delete mode 100644 cli/test/include/mockcpp/Constraint.h delete mode 100644 cli/test/include/mockcpp/ConstraintSet.h delete mode 100644 cli/test/include/mockcpp/DecoratedConstraint.h delete mode 100644 cli/test/include/mockcpp/DefaultBuilder.h delete mode 100644 cli/test/include/mockcpp/DefaultMatcher.h delete mode 100644 cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h delete mode 100644 cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule delete mode 100644 cli/test/include/mockcpp/DefaultStub.h delete mode 100644 cli/test/include/mockcpp/DelegatedMethod.h delete mode 100644 cli/test/include/mockcpp/DelegatedMethodDef.h delete mode 100644 cli/test/include/mockcpp/DelegatedMethodDef.h.rule delete mode 100644 cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h delete mode 100644 cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule delete mode 100644 cli/test/include/mockcpp/DelegatedMethodGetDef.h delete mode 100644 cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule delete mode 100644 cli/test/include/mockcpp/DelegatedMethodGetter.h delete mode 100644 cli/test/include/mockcpp/DestructorAddrGetterDef.h delete mode 100644 cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule delete mode 100644 cli/test/include/mockcpp/DestructorChecker.h delete mode 100644 cli/test/include/mockcpp/DieStub.h delete mode 100644 cli/test/include/mockcpp/DummyBuilder.h delete mode 100644 cli/test/include/mockcpp/EqualityUtil.h delete mode 100644 cli/test/include/mockcpp/Exception.h delete mode 100644 cli/test/include/mockcpp/ExpectsMatcher.h delete mode 100644 cli/test/include/mockcpp/Formatter.h delete mode 100644 cli/test/include/mockcpp/Functor.h delete mode 100644 cli/test/include/mockcpp/GenericMethodIndicesChecker.h delete mode 100644 cli/test/include/mockcpp/GlobalMockObject.h delete mode 100644 cli/test/include/mockcpp/GnuMethodIndicesChecker.h delete mode 100644 cli/test/include/mockcpp/GnuMethodInfoReader.h delete mode 100644 cli/test/include/mockcpp/HookMockObject.h delete mode 100644 cli/test/include/mockcpp/IdentityBuilder.h delete mode 100644 cli/test/include/mockcpp/Ignore.h delete mode 100644 cli/test/include/mockcpp/IgnoreHandler.h delete mode 100644 cli/test/include/mockcpp/IgnoreResultHandler.h delete mode 100644 cli/test/include/mockcpp/IgnoreResultHandlerFactory.h delete mode 100644 cli/test/include/mockcpp/IgnoreReturnStub.h delete mode 100644 cli/test/include/mockcpp/IncrementStub.h delete mode 100644 cli/test/include/mockcpp/IndexInvokableGetter.h delete mode 100644 cli/test/include/mockcpp/InterfaceInfo.h delete mode 100644 cli/test/include/mockcpp/Invocation.h delete mode 100644 cli/test/include/mockcpp/InvocationId.h delete mode 100644 cli/test/include/mockcpp/InvocationMockBuilder.h delete mode 100644 cli/test/include/mockcpp/InvocationMockBuilder.tcc delete mode 100644 cli/test/include/mockcpp/InvocationMockBuilderGetter.h delete mode 100644 cli/test/include/mockcpp/InvocationMocker.h delete mode 100644 cli/test/include/mockcpp/InvocationMockerContainer.h delete mode 100644 cli/test/include/mockcpp/InvocationMockerNamespace.h delete mode 100644 cli/test/include/mockcpp/InvocationMockerSet.h delete mode 100644 cli/test/include/mockcpp/InvocationTimesMatcher.h delete mode 100644 cli/test/include/mockcpp/InvocationWithReturnType.h delete mode 100644 cli/test/include/mockcpp/Invokable.h delete mode 100644 cli/test/include/mockcpp/InvokedAtLeast.h delete mode 100644 cli/test/include/mockcpp/InvokedAtMost.h delete mode 100644 cli/test/include/mockcpp/InvokedExactly.h delete mode 100644 cli/test/include/mockcpp/InvokedOnce.h delete mode 100644 cli/test/include/mockcpp/InvokedTimesMatcher.h delete mode 100644 cli/test/include/mockcpp/InvokedTimesReader.h delete mode 100644 cli/test/include/mockcpp/InvokedTimesRecorder.h delete mode 100644 cli/test/include/mockcpp/IsAnything.h delete mode 100644 cli/test/include/mockcpp/IsAnythingHelper.h delete mode 100644 cli/test/include/mockcpp/IsConst.h delete mode 100644 cli/test/include/mockcpp/IsEqual.h delete mode 100644 cli/test/include/mockcpp/IsGreaterThan.h delete mode 100644 cli/test/include/mockcpp/IsLessThan.h delete mode 100644 cli/test/include/mockcpp/IsMirror.h delete mode 100644 cli/test/include/mockcpp/IsNotEqual.h delete mode 100644 cli/test/include/mockcpp/IsRef.h delete mode 100644 cli/test/include/mockcpp/IsStringContains.h delete mode 100644 cli/test/include/mockcpp/IsStringEndWith.h delete mode 100644 cli/test/include/mockcpp/IsStringStartWith.h delete mode 100644 cli/test/include/mockcpp/JmpCode.h delete mode 100644 cli/test/include/mockcpp/Matcher.h delete mode 100644 cli/test/include/mockcpp/Method.h delete mode 100644 cli/test/include/mockcpp/MethodIndiceChecker.h delete mode 100644 cli/test/include/mockcpp/MethodIndiceCheckerDef.h delete mode 100644 cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule delete mode 100644 cli/test/include/mockcpp/MethodInfoReader.h delete mode 100644 cli/test/include/mockcpp/MethodTypeTraits.h delete mode 100644 cli/test/include/mockcpp/MethodTypeTraitsDef.h delete mode 100644 cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule delete mode 100644 cli/test/include/mockcpp/MismatchResultHandler.h delete mode 100644 cli/test/include/mockcpp/MismatchResultHandlerFactory.h delete mode 100644 cli/test/include/mockcpp/MockBuilder.h delete mode 100644 cli/test/include/mockcpp/MockObject.h delete mode 100644 cli/test/include/mockcpp/MockObjectBase.h delete mode 100644 cli/test/include/mockcpp/MockObjectHelper.h delete mode 100644 cli/test/include/mockcpp/MoreStubBuilder.h delete mode 100644 cli/test/include/mockcpp/MoreStubBuilder.tcc delete mode 100644 cli/test/include/mockcpp/MsvcMethodInfoReader.h delete mode 100644 cli/test/include/mockcpp/MsvcRtti.h delete mode 100644 cli/test/include/mockcpp/NormalResultHandler.h delete mode 100644 cli/test/include/mockcpp/NormalResultHandlerFactory.h delete mode 100644 cli/test/include/mockcpp/ObjNameGetter.h delete mode 100644 cli/test/include/mockcpp/OrderingMatcher.h delete mode 100644 cli/test/include/mockcpp/OutBound.h delete mode 100644 cli/test/include/mockcpp/OutBoundPointer.h delete mode 100644 cli/test/include/mockcpp/OutputStringStream.h delete mode 100644 cli/test/include/mockcpp/ParameterizedApiHookHolder.h delete mode 100644 cli/test/include/mockcpp/PendingMatcher.h delete mode 100644 cli/test/include/mockcpp/ProcStub.h delete mode 100644 cli/test/include/mockcpp/ProcessWith.h delete mode 100644 cli/test/include/mockcpp/RepeatMacros.h delete mode 100644 cli/test/include/mockcpp/RepeatStub.h delete mode 100644 cli/test/include/mockcpp/ReportFailure.h delete mode 100644 cli/test/include/mockcpp/Result.h delete mode 100644 cli/test/include/mockcpp/ResultHandler.h delete mode 100644 cli/test/include/mockcpp/ResultHandlerFactory.h delete mode 100644 cli/test/include/mockcpp/ReturnObjectList.h delete mode 100644 cli/test/include/mockcpp/ReturnStub.h delete mode 100644 cli/test/include/mockcpp/SelfDescribe.h delete mode 100644 cli/test/include/mockcpp/SimpleInvocationRecorder.h delete mode 100644 cli/test/include/mockcpp/Spy.h delete mode 100644 cli/test/include/mockcpp/StatelessMatcher.h delete mode 100644 cli/test/include/mockcpp/StringConstraint.h delete mode 100644 cli/test/include/mockcpp/StringPredict.h delete mode 100644 cli/test/include/mockcpp/Stub.h delete mode 100644 cli/test/include/mockcpp/StubBuilder.h delete mode 100644 cli/test/include/mockcpp/StubBuilder.tcc delete mode 100644 cli/test/include/mockcpp/StubContainer.h delete mode 100644 cli/test/include/mockcpp/StubsBuilder.h delete mode 100644 cli/test/include/mockcpp/StubsMatcher.h delete mode 100644 cli/test/include/mockcpp/TestFailureMatcher.h delete mode 100644 cli/test/include/mockcpp/ThenStub.h delete mode 100644 cli/test/include/mockcpp/ThrowExceptionStub.h delete mode 100644 cli/test/include/mockcpp/TypeString.h delete mode 100644 cli/test/include/mockcpp/TypeTraits.h delete mode 100644 cli/test/include/mockcpp/TypelessConstraint.h delete mode 100644 cli/test/include/mockcpp/TypelessConstraintAdapter.h delete mode 100644 cli/test/include/mockcpp/TypelessStub.h delete mode 100644 cli/test/include/mockcpp/TypelessStubAdapter.h delete mode 100644 cli/test/include/mockcpp/VirtualTable.h delete mode 100644 cli/test/include/mockcpp/VirtualTableUtils.h delete mode 100644 cli/test/include/mockcpp/Void.h delete mode 100644 cli/test/include/mockcpp/VoidResultHandler.h delete mode 100644 cli/test/include/mockcpp/VoidResultHandlerFactory.h delete mode 100644 cli/test/include/mockcpp/WillStub.h delete mode 100644 cli/test/include/mockcpp/WinCodeModifier.h delete mode 100644 cli/test/include/mockcpp/mockable.h delete mode 100644 cli/test/include/mockcpp/mockcpp.h delete mode 100644 cli/test/include/mockcpp/mockcpp.hpp delete mode 100644 cli/test/include/mockcpp/mokc.h delete mode 100644 cli/test/include/mockcpp/types/Any.h delete mode 100644 cli/test/include/mockcpp/types/AnyBase.h delete mode 100644 cli/test/include/mockcpp/types/AnyCast.h delete mode 100644 cli/test/include/mockcpp/types/Holder.h delete mode 100644 cli/test/include/mockcpp/types/PlaceHolder.h delete mode 100644 cli/test/include/mockcpp/types/RefAny.h delete mode 100644 cli/test/include/mockcpp/types/RefHolder.h delete mode 100644 cli/test/include/mockcpp/types/ValueHolder.h delete mode 100644 cli/test/include/mockcpp/utils.h delete mode 100644 cli/test/testcase/CMakeCache.txt delete mode 100644 cli/test/testcase/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..722d5e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/cli/test/CMakeLists.txt b/cli/test/CMakeLists.txt deleted file mode 100644 index 2863f5f..0000000 --- a/cli/test/CMakeLists.txt +++ /dev/null @@ -1,157 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(demo) -macro(dtcenter_init_complier_settings) - set(compiler_flags - CMAKE_C_FLAGS - CMAKE_C_FLAGS_DEBUG - CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL - CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELWITHDEBINFO - ) - - if (MSVC) - # For MSVC, CMake sets certain flags to defaults we want to override. - # This replacement code is taken from sample in the CMake Wiki at - # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace. - foreach(flag_var ${compiler_flags}) - if (NOT BUILD_SHARED_LIBS) - # When DTCenter is built as a shared library, it should also use - # shared runtime libraries. Otherwise, it may end up with multiple - # copies of runtime library data in different modules, resulting in - # hard-to-find crashes. When it is built as a static library, it is - # preferable to use CRT as static libraries, as we don't have to rely - # on CRT DLLs being available. CMake always defaults to using shared - # CRT libraries, so we override that default here. - string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}") - endif () - - # Do not create .pdb files - string(REPLACE "/Zi" "/Z7" ${flag_var} "${${flag_var}}") - string(REPLACE "/ZI" "/Z7" ${flag_var} "${${flag_var}}") - - # We prefer more strict warning checking for building DTCenter. - # Replaces /W3 with /W4 in defaults. - # string(REPLACE "/W3" "/W4" ${flag_var} "${${flag_var}}") - endforeach() - - # Suppress MSVC warnning - add_definitions(-wd4996) - - # Summary of tuple support for Microsoft Visual Studio: - # Compiler version(MS) version(cmake) Support - # ---------- ----------- -------------- ----------------------------- - # vs 2005 8 1400 disabled warings [4355] - # <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple. - # VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10 - # VS 2013 12 1800 std::tr1::tuple - if (MSVC) - if (MSVC_VERSION EQUAL 1400) - add_definitions(-wd4355) - endif (MSVC_VERSION EQUAL 1400) - - if (MSVC_VERSION EQUAL 1700) - add_definitions(/D _VARIADIC_MAX=10) - endif (MSVC_VERSION EQUAL 1700) - endif (MSVC) - - # Summary of name for Microsoft Visual Studio: - # Compiler version(MS) version(cmake) Name - # ---------- ----------- -------------- ----------------------------- - # VS 2005 8 1400 vs2005 - # VS 2008 9 1500 vs2008 - # VS 2010 10 1600 vs2010 - # VS 2012 11 1700 vs2012 - # VS 2013 12 1800 vs2013 - # VS 2015 13 1900 vs2015 - if (MSVC_VERSION EQUAL 1400) - set(MSVC_NAME "vs2005") - elseif (MSVC_VERSION EQUAL 1500) - set(MSVC_NAME "vs2008") - elseif (MSVC_VERSION EQUAL 1600) - set(MSVC_NAME "vs2010") - elseif (MSVC_VERSION EQUAL 1700) - set(MSVC_NAME "vs2012") - elseif (MSVC_VERSION EQUAL 1800) - set(MSVC_NAME "vs2013") - elseif (MSVC_VERSION EQUAL 1900) - set(MSVC_NAME "vs2015") - elseif (MSVC_VERSION EQUAL 1910) - set(MSVC_NAME "vs2017") - else () - message(FATAL_ERROR "Please add the MSVC_NAME for MSVC_VERSION[${MSVC_VERSION}]") - endif (MSVC_VERSION EQUAL 1400) - - if (NOT BUILD_SHARED_LIBS) - set(LIBRARY_POSTFIX "mtd") - else () - set(LIBRARY_POSTFIX "mdd") - endif (NOT BUILD_SHARED_LIBS) - endif (MSVC) - - if(UNIX) - # 调试开关 - add_definitions(-g) - # 关闭优化开关 - add_definitions(-O0) - # 4.8.5编译选项 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - # ASAN编译选项 - if (BUILD_ASAN) - add_definitions(-fsanitize=address -fsanitize-recover=all) - add_definitions(-fno-omit-frame-pointer -fno-stack-protector) - add_definitions(-fsanitize=leak) - endif(BUILD_ASAN) - - if (BUILD_FUZZ) - # 包含FUZZ时,必须使用C++11语法编译 - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif(BUILD_FUZZ) - - # DTCenter定义的宏 - add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX) - - # 默认不支持中文用例名,如果要支持请打开以下配置 - # add_definitions(-DDTCENTER_CN2EN) - - # GCC编译器告警开关 - add_definitions(-Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=0) - add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) - add_definitions(-Wno-sign-compare -Wno-nonnull-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers -Wno-missing-field-initializers) - #add_definitions(-fprofile-arcs -ftest-coverage) - # 以下只对C++语言有有效 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wno-reorder") - - # GCC 4.3.4不支持 -Wno-conversion-null, 先注释掉 - #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null") - - #add_definitions(-rdynamic) - - - endif(UNIX) -endmacro() -dtcenter_init_complier_settings() -add_definitions(-g -O0) -add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX -D_GLIBCXX_USE_CXX11_ABI=0) -add_definitions(-Dgtest) - -# GCC编译器告警开关 -add_definitions(-Wall -Wextra) -add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) -add_definitions(-Wno-sign-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers) - - -set(UT_DEMO_SRCS testcase/main.cpp ../src/main.c testcase/gtest_mytestcase.cpp) - -add_executable(ut_demo ${UT_DEMO_SRCS}) -target_link_libraries(ut_demo - ${PROJECT_SOURCE_DIR}/lib/libdtcenter.a -) -target_link_libraries(ut_demo -pthread) -target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/include) diff --git a/cli/test/dt/CMakeLists.txt b/cli/test/dt/CMakeLists.txt new file mode 100644 index 0000000..4c08ab3 --- /dev/null +++ b/cli/test/dt/CMakeLists.txt @@ -0,0 +1,85 @@ +cmake_minimum_required(VERSION 2.6) + +project(demo) +macro(dtcenter_init_complier_settings) + set(compiler_flags + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + ) + + + if(UNIX) + # 调试开关 + add_definitions(-g) + # 关闭优化开关 + add_definitions(-O0) + # 4.8.5编译选项 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + # ASAN编译选项 + if (BUILD_ASAN) + add_definitions(-fsanitize=address -fsanitize-recover=all) + add_definitions(-fno-omit-frame-pointer -fno-stack-protector) + add_definitions(-fsanitize=leak) + endif(BUILD_ASAN) + + if (BUILD_FUZZ) + # 包含FUZZ时,必须使用C++11语法编译 + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif(BUILD_FUZZ) + + # DTCenter定义的宏 + add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX) + + # 默认不支持中文用例名,如果要支持请打开以下配置 + # add_definitions(-DDTCENTER_CN2EN) + + # GCC编译器告警开关 + add_definitions(-Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=1) + add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) + add_definitions(-Wno-sign-compare -Wno-nonnull-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers -Wno-missing-field-initializers) + add_definitions(-fprofile-arcs -ftest-coverage) + # 以下只对C++语言有有效 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wno-reorder") + + # GCC 4.3.4不支持 -Wno-conversion-null, 先注释掉 + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null") + + #add_definitions(-rdynamic) + + + endif(UNIX) +endmacro() +#dtcenter_init_complier_settings() +#add_definitions(-g -O0) +#add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX) +add_definitions(-Dgtest) +#add_definitions(-lgcov --coverage) + +# GCC编译器告警开关 +#add_definitions(-Wall -Wextra) +#add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) +#add_definitions(-Wno-sign-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers) +#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector -std=c11 -D _GNU_SOURCE -fprofile-arcs") +#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector -std=c++11 -D _GNU_SOURCE -fprofile-arcs") + +add_subdirectory(srclib) +set(UT_DEMO_SRCS testcase/main.cpp testcase/gtest_mytestcase.cpp) + +add_executable(ut_demo ${UT_DEMO_SRCS}) +target_link_libraries(ut_demo + ${PROJECT_SOURCE_DIR}/Depend/lib/libgtest.a + ${PROJECT_SOURCE_DIR}/Depend/lib/libmockcpp.a + ) +target_link_libraries(ut_demo -fprofile-arcs -pthread) +target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/googletest/googletest/include) +target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/mockcpp/include) +target_link_libraries(ut_demo demolib) diff --git a/cli/test/dt/Depend/CMakeLists.txt b/cli/test/dt/Depend/CMakeLists.txt new file mode 100644 index 0000000..01f8bac --- /dev/null +++ b/cli/test/dt/Depend/CMakeLists.txt @@ -0,0 +1,60 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) + +PROJECT(depend_lib) + +# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to +# make it prominent in the GUI. +#option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) + +# Specify where is boost +option(USE_DTCENTER_BOOST "Use ${CMAKE_CURRENT_LIST_DIR}/boost header files or not." ON) +if(USE_DTCENTER_BOOST) + set(BOOST_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}") +else() + set(BOOST_INCLUDE_DIRS "/usr/include" CACHE PATH "path to boost include dir") +endif() + +# helper functions and macros used by dtcenter. +#include(${CMAKE_CURRENT_LIST_DIR}/../cmake/internal_utils.cmake) +#dtcenter_init_complier_settings() + +# Subdirectories +set(mockcpp_dir mockcpp) +set(gtest_dir googletest/googletest/) +set(gtest_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/${gtest_dir}) +set(mockcpp_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/${mockcpp_dir}) + +# 将gtest, mockcpp 打包成 depend_lib +set(gtest_library $) +set(mockcpp_library $) + +# global_stubs +ADD_LIBRARY(ut_main STATIC ${CMAKE_CURRENT_LIST_DIR}/public_stub.cpp + ${CMAKE_CURRENT_LIST_DIR}/ut_main.cpp) +TARGET_INCLUDE_DIRECTORIES(ut_main PUBLIC "${gtest_SOURCE_DIR}/include") +TARGET_INCLUDE_DIRECTORIES(ut_main PUBLIC "${mockcpp_SOURCE_DIR}/include") + +add_subdirectory(${gtest_dir} gtest.out) +add_subdirectory(${mockcpp_dir} mockcpp.out) + + +#CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) +#PROJECT(depend_lib) +# +#SET(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/lib") +#if(CMAKE_COMPILER_IS_GNUCXX) +# ADD_COMPILE_OPTIONS(-std=c++11) +# message(STATUS "optional:-std=c++11") +#endif(CMAKE_COMPILER_IS_GNUCXX) +# +#FILE(GLOB SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/public_stub.cpp +# ${CMAKE_CURRENT_LIST_DIR}/ut_main.cpp ) +# +## global_stubs +## mian +#ADD_LIBRARY(ut_main STATIC ${SOURCE_FILES}) +# +#INCLUDE_DIRECTORIES("googletest/googletest/include") +#LINK_DIRECTORIES("googletest/lib") +#TARGET_LINK_LIBRARIES(ut_main pthread) +#TARGET_LINK_LIBRARIES(ut_main libgtest) diff --git a/cli/test/dt/Depend/HuaweiSecureC/CMakeLists.txt b/cli/test/dt/Depend/HuaweiSecureC/CMakeLists.txt new file mode 100644 index 0000000..69343c9 --- /dev/null +++ b/cli/test/dt/Depend/HuaweiSecureC/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.0) +# 查找当前目录下的所有源文件 +# 并将名称保存到 LIB_SRC 变量 +aux_source_directory(src LIB_SRC) +include_directories(include) + +#生成链接库 +add_library(HuaweiSecureC STATIC ${LIB_SRC}) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) diff --git a/cli/test/dt/Depend/public_stub.cpp b/cli/test/dt/Depend/public_stub.cpp new file mode 100644 index 0000000..fa6846b --- /dev/null +++ b/cli/test/dt/Depend/public_stub.cpp @@ -0,0 +1,6 @@ +#ifndef __PUBLIC_STUB_H__ +#define __PUBLIC_STUB_H__ + + + +#endif diff --git a/cli/test/dt/Depend/ut_comm.h b/cli/test/dt/Depend/ut_comm.h new file mode 100644 index 0000000..72d8e5b --- /dev/null +++ b/cli/test/dt/Depend/ut_comm.h @@ -0,0 +1,24 @@ +#ifndef __UT_COMM_H__ +#define __UT_COMM_H__ + +#include +#include "gtest/gtest.h" +#include "mockcpp/mockcpp.hpp" + + +#define EXTERN_C extern "C" + +#define ENVIRONMENT_AUTO_REGISTER(Name, Environment) \ +namespace { \ +class Name##AutoRegister { \ +public: \ + Name##AutoRegister() { \ + testing::AddGlobalTestEnvironment(new Environment); \ + } \ +}; \ +Name##AutoRegister global##Name; \ +} + + +#endif + diff --git a/cli/test/dt/Depend/ut_main.cpp b/cli/test/dt/Depend/ut_main.cpp new file mode 100644 index 0000000..2ef8fc2 --- /dev/null +++ b/cli/test/dt/Depend/ut_main.cpp @@ -0,0 +1,35 @@ +#include "gtest/gtest.h" +#include +#include +#include + +using namespace testing; + +void handler(int sig) +{ + void *array[20]; + size_t size; + + // get void*'s for all entries on the stack + size = backtrace(array, 20); + + // print out all the frames to stderr + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(sig); +} + +int main(int argc, char* argv[]) +{ + signal(SIGABRT, handler); + signal(SIGFPE, handler); + signal(SIGILL, handler); + signal(SIGINT, handler); + signal(SIGSEGV, handler); + signal(SIGTERM, handler); + + //testing::InitGoogleTest(&argc, argv); + int result = testing::Init_UT(argc, argv,true); + + return result; +} diff --git a/cli/test/dt/Scripts/pre.sh b/cli/test/dt/Scripts/pre.sh new file mode 100644 index 0000000..7ed2019 --- /dev/null +++ b/cli/test/dt/Scripts/pre.sh @@ -0,0 +1,30 @@ +#!/bin/sh +cd ../Depend/ + +if [ -d "./lib" ]; then + rm -rf ./lib +fi + +BUILD_DIR="./build" +if [ ! -d "${BUILD_DIR}" ]; then + mkdir ${BUILD_DIR} +else + rm -rf ${BUILD_DIR}/* + echo "prefix clean" +fi +cd ${BUILD_DIR} +cmake .. +make + +mkdir ../lib +cp gtest.out/libgtest.a ../lib +cp mockcpp.out/libmockcpp.a ../lib +cp libut_main.a ../lib + +cd .. +if [ -d "${BUILD_DIR}" ]; then + rm -rf ${BUILD_DIR} +fi + +cd ../Scripts + diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh new file mode 100644 index 0000000..fce8d43 --- /dev/null +++ b/cli/test/dt/build.sh @@ -0,0 +1,150 @@ +#!/bin/bash +CUR_DIR=$(cd `dirname $0`;pwd) +SRC_ROOT="../../src" + +# 检测执行pre脚本 +usage() +{ + echo "usage:" + echo "./build.sh [module]." + echo "eg: ./build.sh" + echo "eg: ./build.sh cli" + exit 1 +} + +makepre() +{ + if [ -f ${CUR_DIR}/../../../googletest.tar.gz ]; then + cd ${CUR_DIR}/../../../ + tar xf ${CUR_DIR}/../../../googletest.tar.gz + cd ${CUR_DIR} + fi + if [ -d ${CUR_DIR}/../../../googletest ]; then + cp -rf ${CUR_DIR}/../../../googletest ${CUR_DIR}/Depend/googletest/ + fi + + if [ -f ${CUR_DIR}/../../../mockcpp.tar.gz ]; then + cd ${CUR_DIR}/../../../ + tar xf ${CUR_DIR}/../../../mockcpp.tar.gz + cd ${CUR_DIR} + fi + if [ -d ${CUR_DIR}/../../../mockcpp ]; then + cp -rf ${CUR_DIR}/../../../mockcpp/* ${CUR_DIR}/Depend/mockcpp/ + fi + + # 如果没有生成过,则需要生成 + if [ ! -d Depend/lib ] + then + echo "-------------make pre begin-------------------" + cd Scripts + chmod u+x ./pre.sh + ./pre.sh + cd - + echo "-------------make pre end---------------------" + fi + + if [ $? -ne 0 ] + then + return 1 + else + return 0 + fi +} + +build_huaweisecurec() +{ + echo "-------------build_ut huaweisecurec begin-------------------" + if [ -f ${CUR_DIR}/../../../HuaweiSecureC.tar.gz ]; then + cd ${CUR_DIR}/../../../ + tar xf ${CUR_DIR}/../../../HuaweiSecureC.tar.gz + cd ${CUR_DIR} + fi + if [ -d ${CUR_DIR}/../../../HuaweiSecureC/ ]; then + cp -rf ${CUR_DIR}/../../../HuaweiSecureC/* ${CUR_DIR}/Depend/HuaweiSecureC/ + cp -rf ${CUR_DIR}/../../../HuaweiSecureC/* ${SRC_ROOT}/HuaweiSecureC/ + fi + cd ${CUR_DIR}/Depend/HuaweiSecureC + if [ -d ./build ]; then + rm -rf ./build + fi + mkdir ./build + cd ./build + cmake .. + make + cp libHuaweiSecureC.a ${CUR_DIR}/srclib + echo "-------------build_ut huaweisecurec end-------------------" +} + +build_cli() +{ + echo "-------------build_ut cli begin-------------------" + cd ${CUR_DIR} + if [ -d ${CUR_DIR}/build ]; then + rm -rf ${CUR_DIR}/build + fi + mkdir ${CUR_DIR}/build + cd ${CUR_DIR}/build + cmake .. + make + echo "-------------build_ut cli end---------------------" +} + +run_lcov_cli() +{ + echo "-------------run_ut cli begin-------------------" + cd ${CUR_DIR}/build + ./ut_demo + cd ${SRC_ROOT}/.. + lcov --no-external -o result.info -b . -d . -c + genhtml result.info -o Report + echo "-------------run_ut cli end-------------------" +} + +main() +{ + # 找到SRC目录 + cd ${SRC_ROOT} + SRC_ROOT=$(pwd) + cd - + + # step_1 输入检测 + if [ $# -gt 1 ] + then + usage + return + fi + # step_2 执行pre脚本 + makepre + if [ $? -ne 0 ] + then + echo "pre failed." + return 1 + else + echo "pre succeed." + fi + + echo SRC_ROOT is "$SRC_ROOT" + + # step_3 编译对应模块 + build_huaweisecurec + build_cli + if [ $? -ne 0 ] + then + echo "build_cli failed." + return 1 + else + echo "build_cli succeed." + fi + + # step_4 执行ut_demo程序和lcov覆盖率 + run_lcov_cli + if [ $? -ne 0 ] + then + echo "run_lcov_cli failed." + return 1 + else + echo "run_lcov_cli succeed." + fi +} + +main $* diff --git a/cli/test/dt/cmake/internal_utils.cmake b/cli/test/dt/cmake/internal_utils.cmake new file mode 100644 index 0000000..bd1dde2 --- /dev/null +++ b/cli/test/dt/cmake/internal_utils.cmake @@ -0,0 +1,72 @@ +macro(dtcenter_init_complier_settings) + set(compiler_flags + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + ) + + if(UNIX) + # 调试开关 + add_definitions(-g) + # 关闭优化开关 + add_definitions(-O0) + # 4.8.5编译选项 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + # ASAN编译选项 + if (BUILD_ASAN) + add_definitions(-fsanitize=address -fsanitize-recover=all) + add_definitions(-fno-omit-frame-pointer -fno-stack-protector) + add_definitions(-fsanitize=leak) + endif(BUILD_ASAN) + + if (BUILD_FUZZ) + # 包含FUZZ时,必须使用C++11语法编译 + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif(BUILD_FUZZ) + + # DTCenter定义的宏 + add_definitions(-DDT_COMPILE_GCC -DAUTOSTAR_LINUX) + + # 默认不支持中文用例名,如果要支持请打开以下配置 + # add_definitions(-DDTCENTER_CN2EN) + + # GCC编译器告警开关 + add_definitions(-Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=1) + add_definitions(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-parentheses -Wno-write-strings -Wno-format-security) + add_definitions(-Wno-sign-compare -Wno-nonnull-compare -Wno-return-type -Wno-comment -Wno-ignored-qualifiers -Wno-missing-field-initializers) + #add_definitions(-fprofile-arcs -ftest-coverage) + # 以下只对C++语言有有效 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -Wno-reorder") + + # GCC 4.3.4不支持 -Wno-conversion-null, 先注释掉 + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null") + + add_definitions(-rdynamic) + endif(UNIX) + + # 2020/05/06 通用编译选项 + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector -std=c11 -D _GNU_SOURCE -fprofile-arcs") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector -std=c++11 -D _GNU_SOURCE -fprofile-arcs") + SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,noexecstack -Wl,-z,relro ${CMAKE_SHARED_LINKER_FLAGS}") + SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb") + endif() + + + +endmacro() + +function(output_conan_include_dirs) + get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) + foreach(dir ${dirs}) + message(STATUS "dir='${dir}'") + endforeach() +endfunction() diff --git a/cli/test/dt/srclib/CMakeLists.txt b/cli/test/dt/srclib/CMakeLists.txt new file mode 100644 index 0000000..3607f62 --- /dev/null +++ b/cli/test/dt/srclib/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 2.6) + +project(demolib) + +# 代码覆盖率 +# coverage option +OPTION (ENABLE_COVERAGE "Use gcov" ON) +MESSAGE(STATUS ENABLE_COVERAGE=${ENABLE_COVERAGE}) +IF(ENABLE_COVERAGE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") +ENDIF() +#add_definitions(-Dgtest -lgcov) +add_definitions(-Dgtest) +#set(UT_DEMO_SRCS ../../../src/main.c) +aux_source_directory(../../../src UT_DEMO_SRCS) +include_directories("../../../src/HuaweiSecureC/include") + +add_library(${PROJECT_NAME} ${UT_DEMO_SRCS}) +target_link_libraries(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/libHuaweiSecureC.a) diff --git a/cli/test/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp similarity index 60% rename from cli/test/testcase/gtest_mytestcase.cpp rename to cli/test/dt/testcase/gtest_mytestcase.cpp index 3a59593..af43842 100644 --- a/cli/test/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -13,48 +13,61 @@ using namespace testing; #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" #define BUF_SIZE 1024 +#define MAX_DEVICE_NR 1024 typedef char *(*ParseFileLine)(char *, const char *); extern "C" int IsStrEqual(const char *s1, const char *s2); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); -extern "C" int setns(int fd, int nstype); +extern "C" int snprintf_s(char *strDest, size_t destMax, size_t count, const char *format, ...); extern "C" int open(const char *path, int flags); extern "C" int close(int fd); extern "C" int stat(const char *file_name, struct stat *buf); extern "C" int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); +extern "C" int Mount(const char *src, const char *dst); +extern "C" int MkDir(const char *dir, int mode); extern "C" int rmdir(const char *pathname); -extern "C" int MakeDir(char *dir, int mode); extern "C" int EnterNsByFd(int fd, int nsType); extern "C" int StrHasPrefix(const char *str, const char *prefix); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); extern "C" int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); extern "C" int EnterNsByPath(const char *path, int nsType); -extern "C" unsigned int GetNextSerialNum(); -extern "C" int MountDevice(const char *rootfs, const int serialNumber); -extern "C" int DoDeviceMounting(const char *rootfs, const char *devicesList); +extern "C" int MountDevice(const char *rootfs, const char *deviceName); +extern "C" int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr); extern "C" int CheckDirExists(char *dir, int len); -extern "C" int GetParentPathStr(const char *path, int lenOfPath, char *parent); -extern "C" int MakeParentDir(char *path, mode_t mode); -extern "C" int MountFiles(const char *rootfs, const char *file, unsigned long reMountRwFlag); +extern "C" int GetParentPathStr(const char *path, char *parent, size_t bufSize); +extern "C" int MakeDirWithParent(const char *path, mode_t mode); +extern "C" int MountDir(const char *rootfs, const char *file, unsigned long reMountRwFlag); extern "C" int DoCtrlDeviceMounting(const char *rootfs); extern "C" char *GetCgroupMount(char *line, const char *subsys); extern "C" char *GetCgroupRoot(char *line, const char *subSystem); -extern "C" int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); +extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); -extern "C" int SetupCgroup(struct CmdArgs *args, const char *cgroupPath); -extern "C" int SetupMounts(struct CmdArgs *args); -extern "C" void FreeCmdArgs(struct CmdArgs *args); +extern "C" int SetupCgroup(const struct ParsedConfig *config); +extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); -extern "C" int DoMounting(const struct CmdArgs *args); +extern "C" int DoFileMounting(const char *rootfs); +extern "C" int DoMounting(const struct ParsedConfig *config); extern "C" int DoDirectoryMounting(const char *rootfs); extern "C" int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config); +extern "C" int ParseRuntimeOptions(const char *options); +extern "C" bool IsOptionNoDrvSet(); struct CmdArgs { - char *devices; - char *rootfs; - int pid; + char devices[BUF_SIZE]; + char rootfs[BUF_SIZE]; + int pid; + char options[BUF_SIZE]; +}; + +struct ParsedConfig { + char rootfs[BUF_SIZE]; + unsigned int devices[MAX_DEVICE_NR]; + size_t devicesNr; + char containerNsPath[BUF_SIZE]; + char cgroupPath[BUF_SIZE]; + int originNsFd; }; int stub_setns(int fd, int nstype) @@ -62,6 +75,16 @@ int stub_setns(int fd, int nstype) return 0; } +int Stub_GetNsPath_Failed(const int pid, const char *nsType, char *buf, size_t bufSize) +{ + return -1; +} + +int Stub_GetSelfNsPath_Failed(const char *nsType, char *buf, size_t bufSize) +{ + return -1; +} + int Stub_EnterNsByFd_Success(int fd, int nsType) { return 0; @@ -87,12 +110,12 @@ int stub_close_success(int fd) return 0; } -int stub_MakeDir_success(char *dir, int mode) +int stub_MkDir_success(const char *dir, int mode) { return 0; } -int stub_MakeDir_failed(char *dir, int mode) +int stub_MkDir_failed(const char *dir, int mode) { return -1; } @@ -103,6 +126,11 @@ int stub_mount_success(const char *source, const char *target, return 0; } +int stub_Mount_success(const char *src, const char *dst) +{ + return 0; +} + int stub_mount_failed(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { @@ -119,22 +147,22 @@ int stub_stat_failed(const char *file_name, struct stat *buf) return -1; } -int Stub_MountDevice_Success(const char *rootfs, const int serialNumber) +int Stub_MountDevice_Success(const char *rootfs, const char *deviceName) { return 0; } -int Stub_MountDevice_Failed(const char *rootfs, const int serialNumber) +int Stub_MountDevice_Failed(const char *rootfs, const char *deviceName) { return -1; } -int Stub_MountFiles_Success(const char *rootfs, const char *file, unsigned long reMountRwFlag) +int Stub_MountDir_Success(const char *rootfs, const char *file, unsigned long reMountRwFlag) { return 0; } -int Stub_MountFiles_Failed(const char *rootfs, const char *file, unsigned long reMountRwFlag) +int Stub_MountDir_Failed(const char *rootfs, const char *file, unsigned long reMountRwFlag) { return -1; } @@ -144,12 +172,12 @@ int Stub_CheckDirExists_Success(char *dir, int len) return 0; } -int Stub_MakeParentDir_Success(char *path, mode_t mode) +int Stub_MakeDirWithParent_Success(const char *path, mode_t mode) { return 0; } -int Stub_MakeParentDir_Failed(char *path, mode_t mode) +int Stub_MakeDirWithParent_Failed(const char *path, mode_t mode) { return -1; } @@ -169,12 +197,12 @@ int Stub_EnterNsByPath_Failed(const char *path, int nsType) return 0; } -int Stub_DoDeviceMounting_Success(const char *rootfs, const char *devicesList) +int Stub_DoDeviceMounting_Success(const char *rootfs, const unsigned int ids[], size_t idsNr) { return 0; } -int Stub_DoDeviceMounting_Failed(const char *rootfs, const char *devicesList) +int Stub_DoDeviceMounting_Failed(const char *rootfs, const unsigned int ids[], size_t idsNr) { return -1; } @@ -199,27 +227,37 @@ int Stub_DoDirectoryMounting_Failed(const char *rootfs) return -1; } -int Stub_DoMounting_Success(const struct CmdArgs *args) +int Stub_DoFileMounting_Success(const char *rootfs) +{ + return 0; +} + +int Stub_DoFileMounting_Failed(const char *rootfs) +{ + return -1; +} + +int Stub_DoMounting_Success(const struct ParsedConfig *config) { return 0; } -int Stub_DoMounting_Failed(const struct CmdArgs *args) +int Stub_DoMounting_Failed(const struct ParsedConfig *config) { return -1; } -int Stub_SetupCgroup_Success(struct CmdArgs *args, const char *cgroupPath) +int Stub_SetupCgroup_Success(const struct ParsedConfig *config) { return 0; } -int Stub_SetupCgroup_Failed(struct CmdArgs *args, const char *cgroupPath) +int Stub_SetupCgroup_Failed(const struct ParsedConfig *config) { return 0; } -int Stub_SetupMounts_Success(struct CmdArgs *args) +int Stub_SetupContainer_Success(struct CmdArgs *args) { return 0; } @@ -254,6 +292,26 @@ int Stub_DoPrepare_Success(const struct CmdArgs *args, struct ParsedConfig *conf return 0; } +int Stub_ParseFileByLine_Success(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +{ + return 0; +} + +int Stub_GetCgroupPath_Success(const struct CmdArgs *args, char *effPath, const size_t maxSize) +{ + return 0; +} + +bool Stub_IsOptionNoDrvSet_True() +{ + return true; +} + +bool Stub_IsOptionNoDrvSet_False() +{ + return false; +} + class Test_Fhho : public Test { protected: static void SetUpTestCase() @@ -283,8 +341,8 @@ TEST_F(Test_Fhho, ClassEQ1) TEST_F(Test_Fhho, ClassEQ2) { int pid = 1; - char* nsType = "mnt"; - char buf[100] = {0x0}; + const char* nsType = "mnt"; + char buf[100] = {0x0}; int bufSize = 100; int ret = GetNsPath(pid, nsType, buf, 100); EXPECT_LE(0, ret); @@ -357,12 +415,6 @@ TEST_F(Test_Fhho, GetSelfNsPath) EXPECT_LE(0, GetSelfNsPath("mnt", nsPath, BUF_SIZE)); } -TEST_F(Test_Fhho, GetNextSerialNum) -{ - EXPECT_EQ(0, GetNextSerialNum()); - EXPECT_EQ(1, GetNextSerialNum()); - EXPECT_EQ(2, GetNextSerialNum()); -} TEST(MountDevice, Status1) { @@ -371,15 +423,15 @@ TEST(MountDevice, Status1) MOCKER(stat).stubs().will(invoke(stub_stat_success)); MOCKER(close).stubs().will(invoke(stub_close_success)); MOCKER(open).stubs().will(invoke(stub_open_success)); - int serialNumber = 0; - EXPECT_EQ(0, MountDevice(rootfs, serialNumber)); + char *deviceName="davinci100"; + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); } TEST(MountDevice, Status2) { char *rootfs="/home/notexists"; - int serialNumber = 0; - EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); + char *deviceName="davinci0"; + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } TEST(MountDevice, Status3) @@ -389,8 +441,8 @@ TEST(MountDevice, Status3) MOCKER(close).stubs().will(invoke(stub_close_success)); MOCKER(open).stubs().will(invoke(stub_open_success)); MOCKER(mount).stubs().will(invoke(stub_mount_failed)); - int serialNumber = 0; - EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); + char *deviceName="davinci0"; + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); } @@ -399,17 +451,18 @@ TEST(MountDevice, Status4) char *rootfs="/home"; MOCKER(mount).stubs().will(invoke(stub_mount_success)); MOCKER(stat).stubs().will(invoke(stub_stat_failed)); - int serialNumber = 0; + char *deviceName="davinci0"; GlobalMockObject::verify(); - EXPECT_EQ(-1, MountDevice(rootfs, serialNumber)); + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } TEST(DoDeviceMounting, Status1) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; - char *devicesList = "1,2"; - int ret = DoDeviceMounting(rootfs, devicesList); + unsigned int devicesList[2] = {1, 2}; + size_t idNr = 2; + int ret = DoDeviceMounting(rootfs, devicesList, idNr); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } @@ -418,15 +471,16 @@ TEST(DoDeviceMounting, Status2) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Failed)); char *rootfs = "/home"; - char *devicesList = "1,2"; - int ret = DoDeviceMounting(rootfs, devicesList); + unsigned int devicesList[2] = {1, 2}; + size_t idNr = 2; + int ret = DoDeviceMounting(rootfs, devicesList, idNr); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(DoDirectoryMounting, Status1) { - MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Failed)); + MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); char *rootfs = "/home"; int ret = DoDirectoryMounting(rootfs); GlobalMockObject::verify(); @@ -435,7 +489,7 @@ TEST(DoDirectoryMounting, Status1) TEST(DoDirectoryMounting, Status2) { - MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Success)); + MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Success)); char *rootfs = "/home"; int ret = DoDirectoryMounting(rootfs); GlobalMockObject::verify(); @@ -445,12 +499,12 @@ TEST(DoDirectoryMounting, Status2) TEST(DoMounting, Status1) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Failed)); - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - int ret = DoMounting(&args); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + int ret = DoMounting(&config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -459,12 +513,12 @@ TEST(DoMounting, Status2) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - int ret = DoMounting(&args); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + int ret = DoMounting(&config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -474,12 +528,12 @@ TEST(DoMounting, Status3) MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Failed)); - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - int ret = DoMounting(&args); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + int ret = DoMounting(&config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -488,13 +542,15 @@ TEST(DoMounting, Status4) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(IsOptionNoDrvSet).stubs().will(invoke(Stub_IsOptionNoDrvSet_False)); + MOCKER(DoFileMounting).stubs().will(invoke(Stub_DoFileMounting_Success)); MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Success)); - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - int ret = DoMounting(&args); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + int ret = DoMounting(&config); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } @@ -519,97 +575,95 @@ TEST(CheckDirExists, Status2) TEST(GetParentPathStr, Status1) { char *path = "/usr/bin"; - int lenOfPath = strlen(path); char parent[BUF_SIZE] = {0}; - int ret = GetParentPathStr(path, lenOfPath, parent); + int ret = GetParentPathStr(path, parent, BUF_SIZE); EXPECT_EQ(0, ret); } -TEST(MakeParentDir, Status1) +TEST(MakeDirWithParent, Status1) { mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; - int ret = MakeParentDir(parentDir, mode); + int ret = MakeDirWithParent(parentDir, mode); EXPECT_EQ(0, ret); } -TEST(MakeParentDir, Status2) +TEST(MakeDirWithParent, Status2) { mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Success)); - int ret = MakeParentDir(parentDir, mode); + int ret = MakeDirWithParent(parentDir, mode); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } -TEST(MakeParentDir, Status3) +TEST(MakeDirWithParent, Status3) { char *pathData = "/path/abc/abcd"; mode_t mode = 0755; char *path = NULL; path = strdup(pathData); MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(stat).stubs().will(invoke(stub_stat_success)); - int ret = MakeParentDir(path, mode); - ret = MakeParentDir(path, mode); + MOCKER(MkDir).stubs().will(invoke(stub_MkDir_success)); + int ret = MakeDirWithParent(path, mode); + ret = MakeDirWithParent(path, mode); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } -TEST(MountFiles, Status1) +TEST(MountDir, Status1) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); char *rootfs = "/dev"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); + int ret = MountDir(rootfs, DAVINCI_MANAGER_PATH, reMountRwFlag); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } -TEST(MountFiles, Status2) +TEST(MountDir, Status2) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(MakeParentDir).stubs().will(invoke(Stub_MakeParentDir_Failed)); + MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Failed)); char *rootfs = "/rootfs"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, "/home", reMountRwFlag); + int ret = MountDir(rootfs, "/home", reMountRwFlag); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(MountFiles, Status3) +TEST(MountDir, Status3) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(MakeDir).stubs().will(invoke(stub_MakeDir_failed)); + MOCKER(MkDir).stubs().will(invoke(stub_MkDir_failed)); char *rootfs = "/rootfs"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, "/home", reMountRwFlag); + int ret = MountDir(rootfs, "/home", reMountRwFlag); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(MountFiles, Status4) +TEST(MountDir, Status4) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(MakeParentDir).stubs().will(invoke(Stub_MakeParentDir_Success)); + MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); MOCKER(mount).stubs().will(invoke(stub_mount_failed)); char *rootfs = "/rootfs"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, "/home", reMountRwFlag); + int ret = MountDir(rootfs, "/home", reMountRwFlag); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(MountFiles, Status5) +TEST(MountDir, Status5) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(open).stubs().will(invoke(stub_open_success)); - MOCKER(close).stubs().will(invoke(stub_close_success)); - MOCKER(mount).stubs().will(invoke(stub_mount_success)); + MOCKER(MkDir).stubs().will(invoke(stub_MkDir_success)); + MOCKER(Mount).stubs().will(invoke(stub_Mount_success)); char *rootfs = "/rootfs"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountFiles(rootfs, "/dev/random", reMountRwFlag); + int ret = MountDir(rootfs, "/dev/random", reMountRwFlag); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } @@ -617,7 +671,7 @@ TEST(MountFiles, Status5) TEST(DoCtrlDeviceMounting, Status1) { char *rootfs = "/home"; - MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Failed)); + MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); int ret = DoCtrlDeviceMounting(rootfs); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -625,7 +679,7 @@ TEST(DoCtrlDeviceMounting, Status1) TEST(DoCtrlDeviceMounting, Status2) { - MOCKER(MountFiles).stubs().will(invoke(Stub_MountFiles_Success)); + MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; int ret = DoCtrlDeviceMounting(rootfs); GlobalMockObject::verify(); @@ -654,11 +708,11 @@ TEST(GetCgroupRoot, Status1) EXPECT_EQ(0, strcmp(actualRes, expectRes)); } -TEST(CatFileContent, Status1) +TEST(ParseFileByLine, Status1) { char *mountPath= "/not_exist_dir/mountinfo.txt"; char mount[BUF_SIZE] = {0x0}; - int ret = CatFileContent(mount, BUF_SIZE, GetCgroupMount, mountPath); + int ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); EXPECT_EQ(-1, ret); } @@ -723,11 +777,13 @@ TEST(SetupDriverCgroup, Status2) TEST(GetCgroupPath, Status1) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + + MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); @@ -736,45 +792,41 @@ TEST(GetCgroupPath, Status1) TEST(SetupCgroup, Status1) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - char *cgroupPathData = "/not_exist_dir/cgroup_path"; - char *cgroupPath = NULL; - cgroupPath = strdup(cgroupPathData); - int ret = SetupCgroup(&args, cgroupPath); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + strcpy(config.cgroupPath, "/not_exist_dir/cgroup_path"); + int ret = SetupCgroup(&config); EXPECT_EQ(-1, ret); } TEST(SetupCgroup, Status2) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - char *cgroupPathData = "devices.allow"; - char *cgroupPath = strdup(cgroupPathData); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + strcpy(config.cgroupPath, "devices.allow"); MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Fail)); - int ret = SetupCgroup(&args, cgroupPath); + int ret = SetupCgroup(&config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } TEST(SetupCgroup, Status3) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - char *cgroupPathData = "devices.allow"; - char *cgroupPath = strdup(cgroupPathData); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + strcpy(config.cgroupPath, "devices.allow"); MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Failed)); - int ret = SetupCgroup(&args, cgroupPath); + int ret = SetupCgroup(&config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -783,134 +835,110 @@ TEST(SetupCgroup, Status4) { MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; - char *cgroupPathData = "devices.allow"; - char *cgroupPath = strdup(cgroupPathData); - int ret = SetupCgroup(&args, cgroupPath); + struct ParsedConfig config; + strcpy(config.rootfs, "/home"); + config.devices[0] = 1; + config.devices[1] = 2; + config.devicesNr = 2; + strcpy(config.cgroupPath, "devices.allow"); + int ret = SetupCgroup(&config); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } -TEST(SetupMounts, Status1) +TEST(SetupContainer, Status1) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Failed)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(SetupMounts, Status2) +TEST(SetupContainer, Status2) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Failed)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(SetupMounts, Status3) +TEST(SetupContainer, Status3) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Failed)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(SetupMounts, Status4) +TEST(SetupContainer, Status4) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Failed)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(SetupMounts, Status5) +TEST(SetupContainer, Status5) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Failed)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } -TEST(SetupMounts, Status6) +TEST(SetupContainer, Status6) { - struct CmdArgs args = { - .devices = "1,2", - .rootfs = "/home", - .pid = 1 - }; + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + MOCKER(DoPrepare).stubs().will(invoke(Stub_DoPrepare_Success)); MOCKER(EnterNsByPath).stubs().will(invoke(Stub_EnterNsByPath_Success)); MOCKER(DoMounting).stubs().will(invoke(Stub_DoMounting_Success)); MOCKER(SetupCgroup).stubs().will(invoke(Stub_SetupCgroup_Success)); MOCKER(EnterNsByFd).stubs().will(invoke(Stub_EnterNsByFd_Success)); - int ret = SetupMounts(&args); + int ret = SetupContainer(&args); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } -TEST(FreeCmdArgs, Status1) -{ - struct CmdArgs args = { - .devices = NULL, - .rootfs = NULL, - .pid = 1 - }; - FreeCmdArgs(&args); -} - -TEST(FreeCmdArgs, Status2) -{ - struct CmdArgs args = { - .devices = NULL, - .rootfs = NULL, - .pid = 1 - }; - char *devlist = "1,2"; - char *root = "/home"; - args.devices = strdup(devlist); - args.rootfs = strdup(root); - FreeCmdArgs(&args); -} - TEST(Process, Status1) { int argc = 0; @@ -922,25 +950,109 @@ TEST(Process, Status1) TEST(Process, Status2) { int argc = 7; - char *argvData[7] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; - int ret = Process(argc, argvData); + const char *argvData[7] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; + int ret = Process(argc,const_cast(argvData)); EXPECT_EQ(-1, ret); } TEST(Process, Status3) { int argc = 7; - char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; - int ret = Process(argc, argvData); + const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + int ret = Process(argc, const_cast(argvData)); EXPECT_EQ(-1, ret); } TEST(Process, Status4) { int argc = 7; - char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; - MOCKER(SetupMounts).stubs().will(invoke(Stub_SetupMounts_Success)); - int ret = Process(argc, argvData); + const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + MOCKER(SetupContainer).stubs().will(invoke(Stub_SetupContainer_Success)); + int ret = Process(argc,const_cast(argvData)); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(ParseRuntimeOptions, Status1) +{ + const char options[BUF_SIZE] = "1,2"; + int ret = ParseRuntimeOptions(options); + EXPECT_EQ(0, ret); +} + +TEST(DoPrepare, Status1) +{ + MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(&args, &config); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(DoPrepare, Status2) +{ + MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(&args, &config); + GlobalMockObject::verify(); + EXPECT_EQ(0, ret); +} + +TEST(DoPrepare, Status3) +{ + MOCKER(GetNsPath).stubs().will(invoke(Stub_GetNsPath_Failed)); + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(&args, &config); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoPrepare, Status4) +{ + MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); + MOCKER(GetSelfNsPath).stubs().will(invoke(Stub_GetSelfNsPath_Failed)); + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(&args, &config); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST(DoPrepare, Status5) +{ + MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); + MOCKER(open).stubs().will(invoke(stub_open_failed)); + struct CmdArgs args; + strcpy(args.rootfs, "/home"); + args.devices[0] = '1'; + args.devices[1] = '2'; + args.pid = 1; + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } \ No newline at end of file diff --git a/cli/test/testcase/main.cpp b/cli/test/dt/testcase/main.cpp similarity index 100% rename from cli/test/testcase/main.cpp rename to cli/test/dt/testcase/main.cpp diff --git a/cli/test/include/gtest/UdpSocket.h b/cli/test/include/gtest/UdpSocket.h deleted file mode 100644 index 8adec87..0000000 --- a/cli/test/include/gtest/UdpSocket.h +++ /dev/null @@ -1,220 +0,0 @@ -#pragma once - -#include "gtest/internal/gtest-port.h" - -#ifdef GTEST_OS_WINDOWS -//此处不包含winsock.h了 -#include -#endif - -#ifdef GTEST_OS_LINUX -#include -#include -#include -#include -#include -#include -#include - -#define HANDLE void* -#define UINT32 unsigned int -#define UINT8 unsigned char -#define UIN16 unsigned short -#define SOCKET unsigned int -#define INVALID_SOCKET 0 -#define SOCKET_ERROR -1 -#endif -/*相关接口*/ -namespace testing { - /*ulLogtype枚举宏定义:消息的打印级别*/ -#define DT_SETUP 0 /*全局初始化事件*/ -#define DT_TEARDOWN 1 /*全局加载事件*/ -#define DT_TESTCASE_BEGIN 2 /*用例开始事件*/ -#define DT_TESTCASE_END 3 /*用例结束事件*/ - -#define DT_MSG_MAGIC_WORD 0x4F4F4F4F - - - -//是下面MsgStruct的消息内容 - -#define DT_MSG_TRACE_HEADER \ -unsigned int ulMagicWord; \ -unsigned int usProdType; \ -unsigned int usLength \ - -#pragma pack(push,1) -//传向socket的消息内容中的消息头 - struct DT_MSG_TRACE_HEADER_SUCT - { - DT_MSG_TRACE_HEADER; - }; - - typedef struct - { - DT_MSG_TRACE_HEADER; - }DT_MSG_TRACE_STRU; - - //传向Socket的适应msgtype为字符串类型的消息体 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int direction; //发送方向 - unsigned int protocal; //协议 - unsigned int msgFlag; //消息类型是INT32时为1,为0时INT8 * - unsigned int msgTypeLen; //消息类型的长度 (msgType == 0) strlen(msgTypeStr) + strlen(reservered) - unsigned char msgTypeStr[1]; //消息类型 - unsigned int msgcontentlength; //消息内容的长度 - unsigned char msgcontent[1]; //消息内容 - }DT_MSG_TRACE_DATA_STRU_INT8; - - //传向Socket的适应msgtype为int类型的消息体 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int direction; //发送方向 - unsigned int protocal; //协议 - unsigned int msgFlag; //消息类型是INT32时为1,为0时INT8 * - unsigned int msgType; //消息类型 - unsigned int msgcontentlength; //消息内容的长度 - unsigned char msgcontent[1]; //消息内容 - }DT_MSG_TRACE_DATA_STRU_INT32; - - - //msgtype消息类型 -#define OUTER_MSG 0 //外部消息 -#define INNER_MSG 1 //内部消息 - -//传向Socket的适应NodeB的消息体 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int msgType; //内外部消息 0: 外部消息 1:内部消息 RecPId的长度 - unsigned int SenderCpuId; //发出的Cpuid,若msgType为内部消息时,SenderCpuId = RecCpuId - unsigned int SenderPId; //发出的pid, - unsigned int RecCpuId; //收到的Cpuid, - unsigned int RecPId; //收到的pid, - unsigned int msgcontentlength; //msgContents长度 - unsigned char msgContents[1]; //消息内容 - }DT_MSG_TRACE_DATA_STRU_NodeB; - - //传向Socket的适应LTE的消息体 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int msgType; - unsigned int SenderCpuId; //发出的Cpuid - unsigned int SenderPId; //发出的pid, - unsigned int RecCpuId; //收到的Cpuid, - unsigned int RecPId; //收到的pid, - unsigned int msgcontentlength; //msgContents长度 - unsigned char msgContents[1]; //消息内容 - }DT_MSG_TRACE_DATA_STRU_LTE; - - //传向Socket的公用的dopra 消息 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int msgType; - unsigned int SenderCpuId; //发出的Cpuid - unsigned int SenderPId; //发出的pid, - unsigned int RecCpuId; //收到的Cpuid, - unsigned int RecPId; //收到的pid, - unsigned int msgcontentlength; //msgContents长度 - unsigned char msgContents[1]; //消息内容 - }DT_MSG_TRACE_DATA_STRU_Common; - - //传向Socket的5G产品的Service消息 - typedef struct - { - DT_MSG_TRACE_HEADER; - unsigned int SenderServiceID; // 服务提供者ID - unsigned int ReceiverServiceID; // 服务使用者ID - unsigned int ServiceType; // 服务类型ID - unsigned int ServiceID; // API或者ABI的ID - unsigned int MsgContentSize; // 原始服务消息长度 - unsigned char MsgContents[1]; // 原始消息内容 - } DT_MSG_TRACE_DATA_STRU_SERVICE; -#pragma pack(pop) - - - /*MessageStruct,统一的消息头结构*/ - typedef struct - { - unsigned int ulMsgHead; /*消息头,4字节,统一为0xf634f634*/ - unsigned int ulMsgLen; /*消息总长度(包括消息体),4字节*/ - unsigned int ulMsgHeadLen; /*消息头长度,4字节*/ - unsigned int ulVersionId; /*版本号,4字节,目前为0x00000001*/ - unsigned char aucdate_time[24]; /*消息发送时间,24字节,字符串如:2009-08-24 12:13:15.999 */ - unsigned int ulReserved; /*保留字节*/ - unsigned int ulSource; /*发送的消息类型,值域0-1,具体意义见上面的ulSource宏定义*/ - unsigned int ulLogtype; /*消息的打印级别,值域0-9,具体意义见上面的ulLogtype宏定义*/ - unsigned int ulMsgBodyLen; /*消息体长度*/ - } MsgStruct; - -#define SERVERPORT 6868 -#define LOCALPORT 7878 - - /*udpSocket消息通信类定义*/ - /*请不要自己直接使用下面的类,否则会给定位问题带来麻烦*/ - class UdpSocket - { - public: - UdpSocket(void); - ~UdpSocket(void); - - private: - UINT32 m_localPort; - std::string m_strServerIP; - SOCKET m_hHandle; - sockaddr_in addrTo; - bool m_bTraceFlag; - bool m_bPortTraceFlag; /*串口开关*/ - bool m_bDocPrintFlag; /*Doc界面打印开关*/ - std::string m_SuiteName; /*当前发送消息的测试套名称*/ - std::string m_preSuiteName; /*上一个测试套名称*/ - std::string m_CaseName; /*测试用例名称*/ - HANDLE m_FileHandle; /*记录串口消息的文件句柄*/ - std::string m_fileFolderPath; /*创建的AutoStar文件夹的路径*/ - bool m_bNewFileFlag; - - int Init_Socket(); /*socket初始化*/ - int CreateSocket(void); /*创建socket*/ - int MessageSend(UINT32 ulSource, UINT32 ulLogtype, UINT32 usDataLen, UINT8 *poctData); /*消息发送*/ - int WritePortMessageToTxt(UINT32 ulLogtype, UINT8 *poctData); /*写串口消息到文本*/ - unsigned int DT_MessageHead_INT32(UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData, UINT32 msgFlag); - unsigned int DT_MessageHead_INT8(UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData, UINT32 msgFlag); - unsigned int DT_MessageHead_NodeB(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); - unsigned int DT_MessageHead_LTE(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); - unsigned int DT_MessageHead_InnerMsg(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData, UINT8 *pOutData); - public: - int SocketBind(void); /*socket绑定*/ - int UdpSendMessage(UINT32 ulSource, UINT32 ulLogtype, UINT32 usDataLen, UINT8 *poctData); /*消息发送*/ - int ReceiveMessage(UINT8 *recvData); /*消息接收*/ - int CloseSocket(void); /*socket关闭*/ - int SetServerIP(std::string strIP); - int SetLocalPort(UINT32 localPort); - int OpenTrace(bool bTrace); /*消息发送开关*/ - int ComportMsgPrint(bool bFlag); /*串口打印开关*/ - int SetSuiteCaseName(const char *pSuiteName, const char *pCaseName); - void DT_SendMessageToTracer_INT32(UINT32 ulSource, UINT32 ucProt, UINT32 ucDirection, UINT32 MsgType, UINT32 usDataLen, UINT8 *poctData); /*INT32的消息类型的消息发送*/ - void DT_SendMessageToTracer_INT8(UINT32 ulSource, UINT32 ucProt, UINT32 ucDirection, UINT8 *pstrMsgType, UINT32 usDataLen, UINT8 *poctData); /*字符串的消息类型的消息发送*/ - void DT_SendMessageToTracer_NodeB(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ - void DT_SendMessageToTracer_LTE(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ - void DT_SendMessageToTracer_InnerMsg(UINT32 MsgType, UINT32 SenderCpuId, UINT32 SenderPId, UINT32 RecCpuId, UINT32 RecPId, UINT32 usDataLen, UINT8 *poctData); /*NodeB的消息发送*/ - void DT_SendMessageToTracer_ServiceMsg( // 5G产品, 服务消息跟踪 - UINT32 ulSource, - UINT32 SenderServiceId, - UINT32 ReceiverServiceId, - UINT32 ServiceType, // 0 : ABI 1 : API - UINT32 ServiceID, // API ID or ABI ID - UINT32 usDataLen, - UINT8 *poctData); - - bool GetPrintDocFlag(); /*获取Doc界面打印开关*/ - void SetPrintDocFlag(bool bFlag); /*设置Doc界面打印开关*/ - void SetNewFileCreateFlag(bool bFlag); /*设置串口打印重定向到文件时,本进程范围内不覆盖之前的打印*/ - - }; - -} diff --git a/cli/test/include/gtest/gtest-death-test.h b/cli/test/include/gtest/gtest-death-test.h deleted file mode 100644 index a27883f..0000000 --- a/cli/test/include/gtest/gtest-death-test.h +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for death tests. It is -// #included by gtest.h so a user doesn't need to include this -// directly. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ - -#include "gtest/internal/gtest-death-test-internal.h" - -namespace testing { - -// This flag controls the style of death tests. Valid values are "threadsafe", -// meaning that the death test child process will re-execute the test binary -// from the start, running only a single death test, or "fast", -// meaning that the child process will execute the test logic immediately -// after forking. -GTEST_DECLARE_string_(death_test_style); - -#if GTEST_HAS_DEATH_TEST - -// The following macros are useful for writing death tests. - -// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is -// executed: -// -// 1. It generates a warning if there is more than one active -// thread. This is because it's safe to fork() or clone() only -// when there is a single thread. -// -// 2. The parent process clone()s a sub-process and runs the death -// test in it; the sub-process exits with code 0 at the end of the -// death test, if it hasn't exited already. -// -// 3. The parent process waits for the sub-process to terminate. -// -// 4. The parent process checks the exit code and error message of -// the sub-process. -// -// Examples: -// -// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); -// for (int i = 0; i < 5; i++) { -// EXPECT_DEATH(server.ProcessRequest(i), -// "Invalid request .* in ProcessRequest()") -// << "Failed to die on request " << i); -// } -// -// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); -// -// bool KilledBySIGHUP(int exit_code) { -// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; -// } -// -// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); -// -// On the regular expressions used in death tests: -// -// On POSIX-compliant systems (*nix), we use the library, -// which uses the POSIX extended regex syntax. -// -// On other platforms (e.g. Windows), we only support a simple regex -// syntax implemented as part of Google Test. This limited -// implementation should be enough most of the time when writing -// death tests; though it lacks many features you can find in PCRE -// or POSIX extended regex syntax. For example, we don't support -// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and -// repetition count ("x{5,7}"), among others. -// -// Below is the syntax that we do support. We chose it to be a -// subset of both PCRE and POSIX extended regex, so it's easy to -// learn wherever you come from. In the following: 'A' denotes a -// literal character, period (.), or a single \\ escape sequence; -// 'x' and 'y' denote regular expressions; 'm' and 'n' are for -// natural numbers. -// -// c matches any literal character c -// \\d matches any decimal digit -// \\D matches any character that's not a decimal digit -// \\f matches \f -// \\n matches \n -// \\r matches \r -// \\s matches any ASCII whitespace, including \n -// \\S matches any character that's not a whitespace -// \\t matches \t -// \\v matches \v -// \\w matches any letter, _, or decimal digit -// \\W matches any character that \\w doesn't match -// \\c matches any literal character c, which must be a punctuation -// . matches any single character except \n -// A? matches 0 or 1 occurrences of A -// A* matches 0 or many occurrences of A -// A+ matches 1 or many occurrences of A -// ^ matches the beginning of a string (not that of each line) -// $ matches the end of a string (not that of each line) -// xy matches x followed by y -// -// If you accidentally use PCRE or POSIX extended regex features -// not implemented by us, you will get a run-time failure. In that -// case, please try to rewrite your regular expression within the -// above syntax. -// -// This implementation is *not* meant to be as highly tuned or robust -// as a compiled regex library, but should perform well enough for a -// death test, which already incurs significant overhead by launching -// a child process. -// -// Known caveats: -// -// A "threadsafe" style death test obtains the path to the test -// program from argv[0] and re-executes it in the sub-process. For -// simplicity, the current implementation doesn't search the PATH -// when launching the sub-process. This means that the user must -// invoke the test program via a path that contains at least one -// path separator (e.g. path/to/foo_test and -// /absolute/path/to/bar_test are fine, but foo_test is not). This -// is rarely a problem as people usually don't put the test binary -// directory in PATH. -// -// TODO(wan@google.com): make thread-safe death tests search the PATH. - -// Asserts that a given statement causes the program to exit, with an -// integer exit status that satisfies predicate, and emitting error output -// that matches regex. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) - -// Like ASSERT_EXIT, but continues on to successive tests in the -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) - -// Asserts that a given statement causes the program to exit, either by -// explicitly exiting with a nonzero exit code or being killed by a -// signal, and emitting error output that matches regex. -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Like ASSERT_DEATH, but continues on to successive tests in the -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: - -// Tests that an exit code describes a normal exit with a given exit code. -class GTEST_API_ ExitedWithCode { - public: - explicit ExitedWithCode(int exit_code); - bool operator()(int exit_status) const; - private: - // No implementation - assignment is unsupported. - void operator=(const ExitedWithCode& other); - - const int exit_code_; -}; - -# if !GTEST_OS_WINDOWS -// Tests that an exit code describes an exit due to termination by a -// given signal. -class GTEST_API_ KilledBySignal { - public: - explicit KilledBySignal(int signum); - bool operator()(int exit_status) const; - private: - const int signum_; -}; -# endif // !GTEST_OS_WINDOWS - -// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. -// The death testing framework causes this to have interesting semantics, -// since the sideeffects of the call are only visible in opt mode, and not -// in debug mode. -// -// In practice, this can be used to test functions that utilize the -// LOG(DFATAL) macro using the following style: -// -// int DieInDebugOr12(int* sideeffect) { -// if (sideeffect) { -// *sideeffect = 12; -// } -// LOG(DFATAL) << "death"; -// return 12; -// } -// -// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { -// int sideeffect = 0; -// // Only asserts in dbg. -// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); -// -// #ifdef NDEBUG -// // opt-mode has sideeffect visible. -// EXPECT_EQ(12, sideeffect); -// #else -// // dbg-mode no visible sideeffect. -// EXPECT_EQ(0, sideeffect); -// #endif -// } -// -// This will assert that DieInDebugReturn12InOpt() crashes in debug -// mode, usually due to a DCHECK or LOG(DFATAL), but returns the -// appropriate fallback value (12 in this case) in opt mode. If you -// need to test that a function has appropriate side-effects in opt -// mode, include assertions against the side-effects. A general -// pattern for this is: -// -// EXPECT_DEBUG_DEATH({ -// // Side-effects here will have an effect after this statement in -// // opt mode, but none in debug mode. -// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); -// }, "death"); -// -# ifdef NDEBUG - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - do { statement; } while (::testing::internal::AlwaysFalse()) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - do { statement; } while (::testing::internal::AlwaysFalse()) - -# else - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - EXPECT_DEATH(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - ASSERT_DEATH(statement, regex) - -# endif // NDEBUG for EXPECT_DEBUG_DEATH -#endif // GTEST_HAS_DEATH_TEST - -// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and -// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if -// death tests are supported; otherwise they just issue a warning. This is -// useful when you are combining death test assertions with normal test -// assertions in one test. -#if GTEST_HAS_DEATH_TEST -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - EXPECT_DEATH(statement, regex) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - ASSERT_DEATH(statement, regex) -#else -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) -#endif - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ diff --git a/cli/test/include/gtest/gtest-message.h b/cli/test/include/gtest/gtest-message.h deleted file mode 100644 index 9b7142f..0000000 --- a/cli/test/include/gtest/gtest-message.h +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the Message class. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! - -#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ - -#include - -#include "gtest/internal/gtest-string.h" -#include "gtest/internal/gtest-internal.h" - -namespace testing { - -// The Message class works like an ostream repeater. -// -// Typical usage: -// -// 1. You stream a bunch of values to a Message object. -// It will remember the text in a stringstream. -// 2. Then you stream the Message object to an ostream. -// This causes the text in the Message to be streamed -// to the ostream. -// -// For example; -// -// testing::Message foo; -// foo << 1 << " != " << 2; -// std::cout << foo; -// -// will print "1 != 2". -// -// Message is not intended to be inherited from. In particular, its -// destructor is not virtual. -// -// Note that stringstream behaves differently in gcc and in MSVC. You -// can stream a NULL char pointer to it in the former, but not in the -// latter (it causes an access violation if you do). The Message -// class hides this difference by treating a NULL char pointer as -// "(null)". -class GTEST_API_ Message { - private: - // The type of basic IO manipulators (endl, ends, and flush) for - // narrow streams. - typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); - - public: - // Constructs an empty Message. - // We allocate the stringstream separately because otherwise each use of - // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's - // stack frame leading to huge stack frames in some cases; gcc does not reuse - // the stack space. - Message() : ss_(new ::std::stringstream) { - // By default, we want there to be enough precision when printing - // a double to a Message. - *ss_ << std::setprecision(std::numeric_limits::digits10 + 2); - } - - // Copy constructor. - Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT - *ss_ << msg.GetString(); - } - - // Constructs a Message from a C-string. - explicit Message(const char* str) : ss_(new ::std::stringstream) { - *ss_ << str; - } - -#if GTEST_OS_SYMBIAN - // Streams a value (either a pointer or not) to this object. - template - inline Message& operator <<(const T& value) { - StreamHelper(typename internal::is_pointer::type(), value); - return *this; - } -#else - // Streams a non-pointer value to this object. - template - inline Message& operator <<(const T& val) { - ::GTestStreamToHelper(ss_.get(), val); - return *this; - } - - // Streams a pointer value to this object. - // - // This function is an overload of the previous one. When you - // stream a pointer to a Message, this definition will be used as it - // is more specialized. (The C++ Standard, section - // [temp.func.order].) If you stream a non-pointer, then the - // previous definition will be used. - // - // The reason for this overload is that streaming a NULL pointer to - // ostream is undefined behavior. Depending on the compiler, you - // may get "0", "(nil)", "(null)", or an access violation. To - // ensure consistent result across compilers, we always treat NULL - // as "(null)". - template - inline Message& operator <<(T* const& pointer) { // NOLINT - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - ::GTestStreamToHelper(ss_.get(), pointer); - } - return *this; - } -#endif // GTEST_OS_SYMBIAN - - // Since the basic IO manipulators are overloaded for both narrow - // and wide streams, we have to provide this specialized definition - // of operator <<, even though its body is the same as the - // templatized version above. Without this definition, streaming - // endl or other basic IO manipulators to Message will confuse the - // compiler. - Message& operator <<(BasicNarrowIoManip val) { - *ss_ << val; - return *this; - } - - // Instead of 1/0, we want to see true/false for bool values. - Message& operator <<(bool b) { - return *this << (b ? "true" : "false"); - } - - // These two overloads allow streaming a wide C string to a Message - // using the UTF-8 encoding. - Message& operator <<(const wchar_t* wide_c_str) { - return *this << internal::String::ShowWideCString(wide_c_str); - } - Message& operator <<(wchar_t* wide_c_str) { - return *this << internal::String::ShowWideCString(wide_c_str); - } - -#if GTEST_HAS_STD_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::std::wstring& wstr); -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::wstring& wstr); -#endif // GTEST_HAS_GLOBAL_WSTRING - - // Gets the text streamed to this object so far as a String. - // Each '\0' character in the buffer is replaced with "\\0". - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - internal::String GetString() const { - return internal::StringStreamToString(ss_.get()); - } - - private: - -#if GTEST_OS_SYMBIAN - // These are needed as the Nokia Symbian Compiler cannot decide between - // const T& and const T* in a function template. The Nokia compiler _can_ - // decide between class template specializations for T and T*, so a - // tr1::type_traits-like is_pointer works, and we can overload on that. - template - inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) { - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - ::GTestStreamToHelper(ss_.get(), pointer); - } - } - template - inline void StreamHelper(internal::false_type /*dummy*/, const T& value) { - ::GTestStreamToHelper(ss_.get(), value); - } -#endif // GTEST_OS_SYMBIAN - - // We'll hold the text streamed to this object here. - const internal::scoped_ptr< ::std::stringstream> ss_; - - // We declare (but don't implement) this to prevent the compiler - // from implementing the assignment operator. - void operator=(const Message&); -}; - -// Streams a Message to an ostream. -inline std::ostream& operator <<(std::ostream& os, const Message& sb) { - return os << sb.GetString(); -} - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ diff --git a/cli/test/include/gtest/gtest-param-test.h b/cli/test/include/gtest/gtest-param-test.h deleted file mode 100644 index 6407cfd..0000000 --- a/cli/test/include/gtest/gtest-param-test.h +++ /dev/null @@ -1,1421 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-param-test.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: vladl@google.com (Vlad Losev) -// -// Macros and functions for implementing parameterized tests -// in Google C++ Testing Framework (Google Test) -// -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ - - -// Value-parameterized tests allow you to test your code with different -// parameters without writing multiple copies of the same test. -// -// Here is how you use value-parameterized tests: - -#if 0 - -// To write value-parameterized tests, first you should define a fixture -// class. It is usually derived from testing::TestWithParam (see below for -// another inheritance scheme that's sometimes useful in more complicated -// class hierarchies), where the type of your parameter values. -// TestWithParam is itself derived from testing::Test. T can be any -// copyable type. If it's a raw pointer, you are responsible for managing the -// lifespan of the pointed values. - -class FooTest : public ::testing::TestWithParam { - // You can implement all the usual class fixture members here. -}; - -// Then, use the TEST_P macro to define as many parameterized tests -// for this fixture as you want. The _P suffix is for "parameterized" -// or "pattern", whichever you prefer to think. - -TEST_P(FooTest, DoesBlah) { - // Inside a test, access the test parameter with the GetParam() method - // of the TestWithParam class: - EXPECT_TRUE(foo.Blah(GetParam())); - ... -} - -TEST_P(FooTest, HasBlahBlah) { - ... -} - -// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test -// case with any set of parameters you want. Google Test defines a number -// of functions for generating test parameters. They return what we call -// (surprise!) parameter generators. Here is a summary of them, which -// are all in the testing namespace: -// -// -// Range(begin, end [, step]) - Yields values {begin, begin+step, -// begin+step+step, ...}. The values do not -// include end. step defaults to 1. -// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. -// ValuesIn(container) - Yields values from a C-style array, an STL -// ValuesIn(begin,end) container, or an iterator range [begin, end). -// Bool() - Yields sequence {false, true}. -// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product -// for the math savvy) of the values generated -// by the N generators. -// -// For more details, see comments at the definitions of these functions below -// in this file. -// -// The following statement will instantiate tests from the FooTest test case -// each with parameter values "meeny", "miny", and "moe". - -INSTANTIATE_TEST_CASE_P(InstantiationName, - FooTest, - Values("meeny", "miny", "moe")); - -// To distinguish different instances of the pattern, (yes, you -// can instantiate it more then once) the first argument to the -// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the -// actual test case name. Remember to pick unique prefixes for different -// instantiations. The tests from the instantiation above will have -// these names: -// -// * InstantiationName/FooTest.DoesBlah/0 for "meeny" -// * InstantiationName/FooTest.DoesBlah/1 for "miny" -// * InstantiationName/FooTest.DoesBlah/2 for "moe" -// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" -// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" -// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" -// -// You can use these names in --gtest_filter. -// -// This statement will instantiate all tests from FooTest again, each -// with parameter values "cat" and "dog": - -const char* pets[] = {"cat", "dog"}; -INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); - -// The tests from the instantiation above will have these names: -// -// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" -// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" -// -// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests -// in the given test case, whether their definitions come before or -// AFTER the INSTANTIATE_TEST_CASE_P statement. -// -// Please also note that generator expressions (including parameters to the -// generators) are evaluated in InitGoogleTest(), after main() has started. -// This allows the user on one hand, to adjust generator parameters in order -// to dynamically determine a set of tests to run and on the other hand, -// give the user a chance to inspect the generated tests with Google Test -// reflection API before RUN_ALL_TESTS() is executed. -// -// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc -// for more examples. -// -// In the future, we plan to publish the API for defining new parameter -// generators. But for now this interface remains part of the internal -// implementation and is subject to change. -// -// -// A parameterized test fixture must be derived from testing::Test and from -// testing::WithParamInterface, where T is the type of the parameter -// values. Inheriting from TestWithParam satisfies that requirement because -// TestWithParam inherits from both Test and WithParamInterface. In more -// complicated hierarchies, however, it is occasionally useful to inherit -// separately from Test and WithParamInterface. For example: - -class BaseTest : public ::testing::Test { - // You can inherit all the usual members for a non-parameterized test - // fixture here. -}; - -class DerivedTest : public BaseTest, public ::testing::WithParamInterface { - // The usual test fixture members go here too. -}; - -TEST_F(BaseTest, HasFoo) { - // This is an ordinary non-parameterized test. -} - -TEST_P(DerivedTest, DoesBlah) { - // GetParam works just the same here as if you inherit from TestWithParam. - EXPECT_TRUE(foo.Blah(GetParam())); -} - -#endif // 0 - -#include "gtest/internal/gtest-port.h" - -#if !GTEST_OS_SYMBIAN -# include -#endif - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-param-util-generated.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Functions producing parameter generators. -// -// Google Test uses these generators to produce parameters for value- -// parameterized tests. When a parameterized test case is instantiated -// with a particular generator, Google Test creates and runs tests -// for each element in the sequence produced by the generator. -// -// In the following sample, tests from test case FooTest are instantiated -// each three times with parameter values 3, 5, and 8: -// -// class FooTest : public TestWithParam { ... }; -// -// TEST_P(FooTest, TestThis) { -// } -// TEST_P(FooTest, TestThat) { -// } -// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); -// - -// Range() returns generators providing sequences of values in a range. -// -// Synopsis: -// Range(start, end) -// - returns a generator producing a sequence of values {start, start+1, -// start+2, ..., }. -// Range(start, end, step) -// - returns a generator producing a sequence of values {start, start+step, -// start+step+step, ..., }. -// Notes: -// * The generated sequences never include end. For example, Range(1, 5) -// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) -// returns a generator producing {1, 3, 5, 7}. -// * start and end must have the same type. That type may be any integral or -// floating-point type or a user defined type satisfying these conditions: -// * It must be assignable (have operator=() defined). -// * It must have operator+() (operator+(int-compatible type) for -// two-operand version). -// * It must have operator<() defined. -// Elements in the resulting sequences will also have that type. -// * Condition start < end must be satisfied in order for resulting sequences -// to contain any elements. -// -template -internal::ParamGenerator Range(T start, T end, IncrementT step) { - return internal::ParamGenerator( - new internal::RangeGenerator(start, end, step)); -} - -template -internal::ParamGenerator Range(T start, T end) { - return Range(start, end, 1); -} - -// ValuesIn() function allows generation of tests with parameters coming from -// a container. -// -// Synopsis: -// ValuesIn(const T (&array)[N]) -// - returns a generator producing sequences with elements from -// a C-style array. -// ValuesIn(const Container& container) -// - returns a generator producing sequences with elements from -// an STL-style container. -// ValuesIn(Iterator begin, Iterator end) -// - returns a generator producing sequences with elements from -// a range [begin, end) defined by a pair of STL-style iterators. These -// iterators can also be plain C pointers. -// -// Please note that ValuesIn copies the values from the containers -// passed in and keeps them to generate tests in RUN_ALL_TESTS(). -// -// Examples: -// -// This instantiates tests from test case StringTest -// each with C-string values of "foo", "bar", and "baz": -// -// const char* strings[] = {"foo", "bar", "baz"}; -// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); -// -// This instantiates tests from test case StlStringTest -// each with STL strings with values "a" and "b": -// -// ::std::vector< ::std::string> GetParameterStrings() { -// ::std::vector< ::std::string> v; -// v.push_back("a"); -// v.push_back("b"); -// return v; -// } -// -// INSTANTIATE_TEST_CASE_P(CharSequence, -// StlStringTest, -// ValuesIn(GetParameterStrings())); -// -// -// This will also instantiate tests from CharTest -// each with parameter values 'a' and 'b': -// -// ::std::list GetParameterChars() { -// ::std::list list; -// list.push_back('a'); -// list.push_back('b'); -// return list; -// } -// ::std::list l = GetParameterChars(); -// INSTANTIATE_TEST_CASE_P(CharSequence2, -// CharTest, -// ValuesIn(l.begin(), l.end())); -// -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end) { - typedef typename ::testing::internal::IteratorTraits - ::value_type ParamType; - return internal::ParamGenerator( - new internal::ValuesInIteratorRangeGenerator(begin, end)); -} - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]) { - return ValuesIn(array, array + N); -} - -template -internal::ParamGenerator ValuesIn( - const Container& container) { - return ValuesIn(container.begin(), container.end()); -} - -// Values() allows generating tests from explicitly specified list of -// parameters. -// -// Synopsis: -// Values(T v1, T v2, ..., T vN) -// - returns a generator producing sequences with elements v1, v2, ..., vN. -// -// For example, this instantiates tests from test case BarTest each -// with values "one", "two", and "three": -// -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); -// -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. -// The exact type of values will depend on the type of parameter in BazTest. -// -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// -// Currently, Values() supports from 1 to 50 parameters. -// -template -internal::ValueArray1 Values(T1 v1) { - return internal::ValueArray1(v1); -} - -template -internal::ValueArray2 Values(T1 v1, T2 v2) { - return internal::ValueArray2(v1, v2); -} - -template -internal::ValueArray3 Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3(v1, v2, v3); -} - -template -internal::ValueArray4 Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4(v1, v2, v3, v4); -} - -template -internal::ValueArray5 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5(v1, v2, v3, v4, v5); -} - -template -internal::ValueArray6 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6(v1, v2, v3, v4, v5, v6); -} - -template -internal::ValueArray7 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7(v1, v2, v3, v4, v5, - v6, v7); -} - -template -internal::ValueArray8 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template -internal::ValueArray9 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template -internal::ValueArray10 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template -internal::ValueArray11 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template -internal::ValueArray12 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template -internal::ValueArray13 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template -internal::ValueArray14 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template -internal::ValueArray15 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template -internal::ValueArray16 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template -internal::ValueArray17 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template -internal::ValueArray18 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template -internal::ValueArray19 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template -internal::ValueArray20 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template -internal::ValueArray21 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template -internal::ValueArray22 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template -internal::ValueArray23 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template -internal::ValueArray24 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template -internal::ValueArray25 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template -internal::ValueArray26 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template -internal::ValueArray27 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template -internal::ValueArray28 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template -internal::ValueArray29 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template -internal::ValueArray30 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template -internal::ValueArray31 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template -internal::ValueArray32 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template -internal::ValueArray33 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template -internal::ValueArray34 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template -internal::ValueArray35 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template -internal::ValueArray36 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template -internal::ValueArray37 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template -internal::ValueArray38 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template -internal::ValueArray39 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template -internal::ValueArray40 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template -internal::ValueArray41 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template -internal::ValueArray42 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template -internal::ValueArray43 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template -internal::ValueArray44 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template -internal::ValueArray45 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template -internal::ValueArray46 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template -internal::ValueArray47 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template -internal::ValueArray48 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template -internal::ValueArray49 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template -internal::ValueArray50 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); -} - -// Bool() allows generating tests with parameters in a set of (false, true). -// -// Synopsis: -// Bool() -// - returns a generator producing sequences with elements {false, true}. -// -// It is useful when testing code that depends on Boolean flags. Combinations -// of multiple flags can be tested when several Bool()'s are combined using -// Combine() function. -// -// In the following example all tests in the test case FlagDependentTest -// will be instantiated twice with parameters false and true. -// -// class FlagDependentTest : public testing::TestWithParam { -// virtual void SetUp() { -// external_flag = GetParam(); -// } -// } -// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); -// -inline internal::ParamGenerator Bool() { - return Values(false, true); -} - -# if GTEST_HAS_COMBINE -// Combine() allows the user to combine two or more sequences to produce -// values of a Cartesian product of those sequences' elements. -// -// Synopsis: -// Combine(gen1, gen2, ..., genN) -// - returns a generator producing sequences with elements coming from -// the Cartesian product of elements from the sequences generated by -// gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple where T1, T2, ..., TN are the types -// of elements from sequences produces by gen1, gen2, ..., genN. -// -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. -// -// Example: -// -// This will instantiate tests in test case AnimalTest each one with -// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), -// tuple("dog", BLACK), and tuple("dog", WHITE): -// -// enum Color { BLACK, GRAY, WHITE }; -// class AnimalTest -// : public testing::TestWithParam > {...}; -// -// TEST_P(AnimalTest, AnimalLooksNice) {...} -// -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); -// -// This will instantiate tests in FlagDependentTest with all variations of two -// Boolean flags: -// -// class FlagDependentTest -// : public testing::TestWithParam > { -// virtual void SetUp() { -// // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); -// } -// }; -// -// TEST_P(FlagDependentTest, TestFeature1) { -// // Test your code using external_flag_1 and external_flag_2 here. -// } -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); -// -template -internal::CartesianProductHolder2 Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2( - g1, g2); -} - -template -internal::CartesianProductHolder3 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3( - g1, g2, g3); -} - -template -internal::CartesianProductHolder4 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4( - g1, g2, g3, g4); -} - -template -internal::CartesianProductHolder5 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5( - g1, g2, g3, g4, g5); -} - -template -internal::CartesianProductHolder6 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6( - g1, g2, g3, g4, g5, g6); -} - -template -internal::CartesianProductHolder7 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7( - g1, g2, g3, g4, g5, g6, g7); -} - -template -internal::CartesianProductHolder8 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template -internal::CartesianProductHolder9 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template -internal::CartesianProductHolder10 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ - ::testing::internal::ParamGenerator \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - int gtest_##prefix##test_case_name##_dummy_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - __FILE__, __LINE__) - -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/cli/test/include/gtest/gtest-printers.h b/cli/test/include/gtest/gtest-printers.h deleted file mode 100644 index 9cbab3f..0000000 --- a/cli/test/include/gtest/gtest-printers.h +++ /dev/null @@ -1,796 +0,0 @@ -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Google Test - The Google C++ Testing Framework -// -// This file implements a universal value printer that can print a -// value of any type T: -// -// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); -// -// A user can teach this function how to print a class type T by -// defining either operator<<() or PrintTo() in the namespace that -// defines T. More specifically, the FIRST defined function in the -// following list will be used (assuming T is defined in namespace -// foo): -// -// 1. foo::PrintTo(const T&, ostream*) -// 2. operator<<(ostream&, const T&) defined in either foo or the -// global namespace. -// -// If none of the above is defined, it will print the debug string of -// the value if it is a protocol buffer, or print the raw bytes in the -// value otherwise. -// -// To aid debugging: when T is a reference type, the address of the -// value is also printed; when T is a (const) char pointer, both the -// pointer value and the NUL-terminated string it points to are -// printed. -// -// We also provide some convenient wrappers: -// -// // Prints a value to a string. For a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// std::string ::testing::PrintToString(const T& value); -// -// // Prints a value tersely: for a reference type, the referenced -// // value (but not the address) is printed; for a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); -// -// // Prints value using the type inferred by the compiler. The difference -// // from UniversalTersePrint() is that this function prints both the -// // pointer and the NUL-terminated string for a (const or not) char pointer. -// void ::testing::internal::UniversalPrint(const T& value, ostream*); -// -// // Prints the fields of a tuple tersely to a string vector, one -// // element for each field. Tuple support must be enabled in -// // gtest-port.h. -// std::vector UniversalTersePrintTupleFieldsToStrings( -// const Tuple& value); -// -// Known limitation: -// -// The print primitives print the elements of an STL-style container -// using the compiler-inferred type of *iter where iter is a -// const_iterator of the container. When const_iterator is an input -// iterator but not a forward iterator, this inferred type may not -// match value_type, and the print output may be incorrect. In -// practice, this is rarely a problem as for most containers -// const_iterator is a forward iterator. We'll fix this if there's an -// actual need for it. Note that this fix cannot rely on value_type -// being defined as many user-defined container types don't have -// value_type. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#include // NOLINT -#include -#include -#include -#include -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-internal.h" - -namespace testing { - -// Definitions in the 'internal' and 'internal2' name spaces are -// subject to change without notice. DO NOT USE THEM IN USER CODE! -namespace internal2 { - -// Prints the given number of bytes in the given object to the given -// ostream. -GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, - size_t count, - ::std::ostream* os); - -// For selecting which printer to use when a given type has neither << -// nor PrintTo(). -enum TypeKind { - kProtobuf, // a protobuf type - kConvertibleToInteger, // a type implicitly convertible to BiggestInt - // (e.g. a named or unnamed enum type) - kOtherType // anything else -}; - -// TypeWithoutFormatter::PrintValue(value, os) is called -// by the universal printer to print a value of type T when neither -// operator<< nor PrintTo() is defined for T, where kTypeKind is the -// "kind" of T as defined by enum TypeKind. -template -class TypeWithoutFormatter { - public: - // This default version is called when kTypeKind is kOtherType. - static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast(&value), - sizeof(value), os); - } -}; - -// We print a protobuf using its ShortDebugString() when the string -// doesn't exceed this many characters; otherwise we print it using -// DebugString() for better readability. -const size_t kProtobufOneLinerMaxLength = 50; - -template -class TypeWithoutFormatter { - public: - static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); - *os << ("<" + pretty_str + ">"); - } -}; - -template -class TypeWithoutFormatter { - public: - // Since T has no << operator or PrintTo() but can be implicitly - // converted to BiggestInt, we print it as a BiggestInt. - // - // Most likely T is an enum type (either named or unnamed), in which - // case printing it as an integer is the desired behavior. In case - // T is not an enum, printing it as an integer is the best we can do - // given that it has no user-defined printer. - static void PrintValue(const T& value, ::std::ostream* os) { - const internal::BiggestInt kBigInt = value; - *os << kBigInt; - } -}; - -// Prints the given value to the given ostream. If the value is a -// protocol message, its debug string is printed; if it's an enum or -// of a type implicitly convertible to BiggestInt, it's printed as an -// integer; otherwise the bytes in the value are printed. This is -// what UniversalPrinter::Print() does when it knows nothing about -// type T and T has neither << operator nor PrintTo(). -// -// A user can override this behavior for a class type Foo by defining -// a << operator in the namespace where Foo is defined. -// -// We put this operator in namespace 'internal2' instead of 'internal' -// to simplify the implementation, as much code in 'internal' needs to -// use << in STL, which would conflict with our own << were it defined -// in 'internal'. -// -// Note that this operator<< takes a generic std::basic_ostream type instead of the more restricted std::ostream. If -// we define it to take an std::ostream instead, we'll get an -// "ambiguous overloads" compiler error when trying to print a type -// Foo that supports streaming to std::basic_ostream, as the compiler cannot tell whether -// operator<<(std::ostream&, const T&) or -// operator<<(std::basic_stream, const Foo&) is more -// specific. -template -::std::basic_ostream& operator<<( - ::std::basic_ostream& os, const T& x) { - TypeWithoutFormatter::value ? kProtobuf : - internal::ImplicitlyConvertible::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); - return os; -} - -} // namespace internal2 -} // namespace testing - -// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up -// magic needed for implementing UniversalPrinter won't work. -namespace testing_internal { - -// Used to print a value that is not an STL-style container when the -// user doesn't define PrintTo() for it. -template -void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { - // With the following statement, during unqualified name lookup, - // testing::internal2::operator<< appears as if it was declared in - // the nearest enclosing namespace that contains both - // ::testing_internal and ::testing::internal2, i.e. the global - // namespace. For more details, refer to the C++ Standard section - // 7.3.4-1 [namespace.udir]. This allows us to fall back onto - // testing::internal2::operator<< in case T doesn't come with a << - // operator. - // - // We cannot write 'using ::testing::internal2::operator<<;', which - // gcc 3.3 fails to compile due to a compiler bug. - using namespace ::testing::internal2; // NOLINT - - // Assuming T is defined in namespace foo, in the next statement, - // the compiler will consider all of: - // - // 1. foo::operator<< (thanks to Koenig look-up), - // 2. ::operator<< (as the current namespace is enclosed in ::), - // 3. testing::internal2::operator<< (thanks to the using statement above). - // - // The operator<< whose type matches T best will be picked. - // - // We deliberately allow #2 to be a candidate, as sometimes it's - // impossible to define #1 (e.g. when foo is ::std, defining - // anything in it is undefined behavior unless you are a compiler - // vendor.). - *os << value; -} - -} // namespace testing_internal - -namespace testing { -namespace internal { - -// UniversalPrinter::Print(value, ostream_ptr) prints the given -// value to the given ostream. The caller must ensure that -// 'ostream_ptr' is not NULL, or the behavior is undefined. -// -// We define UniversalPrinter as a class template (as opposed to a -// function template), as we need to partially specialize it for -// reference types, which cannot be done with function templates. -template -class UniversalPrinter; - -template -void UniversalPrint(const T& value, ::std::ostream* os); - -// Used to print an STL-style container when the user doesn't define -// a PrintTo() for it. -template -void DefaultPrintTo(IsContainer /* dummy */, - false_type /* is not a pointer */, - const C& container, ::std::ostream* os) { - const size_t kMaxCount = 32; // The maximum number of elements to print. - *os << '{'; - size_t count = 0; - for (typename C::const_iterator it = container.begin(); - it != container.end(); ++it, ++count) { - if (count > 0) { - *os << ','; - if (count == kMaxCount) { // Enough has been printed. - *os << " ..."; - break; - } - } - *os << ' '; - // We cannot call PrintTo(*it, os) here as PrintTo() doesn't - // handle *it being a native array. - internal::UniversalPrint(*it, os); - } - - if (count > 0) { - *os << ' '; - } - *os << '}'; -} - -// Used to print a pointer that is neither a char pointer nor a member -// pointer, when the user doesn't define PrintTo() for it. (A member -// variable pointer or member function pointer doesn't really point to -// a location in the address space. Their representation is -// implementation-defined. Therefore they will be printed as raw -// bytes.) -template -void DefaultPrintTo(IsNotContainer /* dummy */, - true_type /* is a pointer */, - T* p, ::std::ostream* os) { - if (p == NULL) { - *os << "NULL"; - } else { - // C++ doesn't allow casting from a function pointer to any object - // pointer. - // - // IsTrue() silences warnings: "Condition is always true", - // "unreachable code". - if (IsTrue(ImplicitlyConvertible::value)) { - // T is not a function type. We just call << to print p, - // relying on ADL to pick up user-defined << for their pointer - // types, if any. - *os << p; - } else { - // T is a function type, so '*os << p' doesn't do what we want - // (it just prints p as bool). We want to print p as a const - // void*. However, we cannot cast it to const void* directly, - // even using reinterpret_cast, as earlier versions of gcc - // (e.g. 3.4.5) cannot compile the cast when p is a function - // pointer. Casting to UInt64 first solves the problem. - *os << reinterpret_cast( - reinterpret_cast(p)); - } - } -} - -// Used to print a non-container, non-pointer value when the user -// doesn't define PrintTo() for it. -template -void DefaultPrintTo(IsNotContainer /* dummy */, - false_type /* is not a pointer */, - const T& value, ::std::ostream* os) { - ::testing_internal::DefaultPrintNonContainerTo(value, os); -} - -// Prints the given value using the << operator if it has one; -// otherwise prints the bytes in it. This is what -// UniversalPrinter::Print() does when PrintTo() is not specialized -// or overloaded for type T. -// -// A user can override this behavior for a class type Foo by defining -// an overload of PrintTo() in the namespace where Foo is defined. We -// give the user this option as sometimes defining a << operator for -// Foo is not desirable (e.g. the coding style may prevent doing it, -// or there is already a << operator but it doesn't do what the user -// wants). -template -void PrintTo(const T& value, ::std::ostream* os) { - // DefaultPrintTo() is overloaded. The type of its first two - // arguments determine which version will be picked. If T is an - // STL-style container, the version for container will be called; if - // T is a pointer, the pointer version will be called; otherwise the - // generic version will be called. - // - // Note that we check for container types here, prior to we check - // for protocol message types in our operator<<. The rationale is: - // - // For protocol messages, we want to give people a chance to - // override Google Mock's format by defining a PrintTo() or - // operator<<. For STL containers, other formats can be - // incompatible with Google Mock's format for the container - // elements; therefore we check for container types here to ensure - // that our format is used. - // - // The second argument of DefaultPrintTo() is needed to bypass a bug - // in Symbian's C++ compiler that prevents it from picking the right - // overload between: - // - // PrintTo(const T& x, ...); - // PrintTo(T* x, ...); - DefaultPrintTo(IsContainerTest(0), is_pointer(), value, os); -} - -// The following list of PrintTo() overloads tells -// UniversalPrinter::Print() how to print standard types (built-in -// types, strings, plain arrays, and pointers). - -// Overloads for various char types. -GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); -GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); -inline void PrintTo(char c, ::std::ostream* os) { - // When printing a plain char, we always treat it as unsigned. This - // way, the output won't be affected by whether the compiler thinks - // char is signed or not. - PrintTo(static_cast(c), os); -} - -// Overloads for other simple built-in types. -inline void PrintTo(bool x, ::std::ostream* os) { - *os << (x ? "true" : "false"); -} - -// Overload for wchar_t type. -// Prints a wchar_t as a symbol if it is printable or as its internal -// code otherwise and also as its decimal code (except for L'\0'). -// The L'\0' char is printed as "L'\\0'". The decimal code is printed -// as signed integer when wchar_t is implemented by the compiler -// as a signed type and is printed as an unsigned integer when wchar_t -// is implemented as an unsigned type. -GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); - -// Overloads for C strings. -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// signed/unsigned char is often used for representing binary data, so -// we print pointers to it as void* to be safe. -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// MSVC can be configured to define wchar_t as a typedef of unsigned -// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native -// type. When wchar_t is a typedef, defining an overload for const -// wchar_t* would cause unsigned short* be printed as a wide string, -// possibly causing invalid memory accesses. -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) -// Overloads for wide C strings -GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); -inline void PrintTo(wchar_t* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -#endif - -// Overload for C arrays. Multi-dimensional arrays are printed -// properly. - -// Prints the given number of elements in an array, without printing -// the curly braces. -template -void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { - UniversalPrint(a[0], os); - for (size_t i = 1; i != count; i++) { - *os << ", "; - UniversalPrint(a[i], os); - } -} - -// Overloads for ::string and ::std::string. -#if GTEST_HAS_GLOBAL_STRING -GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); -inline void PrintTo(const ::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_STRING - -GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); -inline void PrintTo(const ::std::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} - -// Overloads for ::wstring and ::std::wstring. -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_TR1_TUPLE -// Overload for ::std::tr1::tuple. Needed for printing function arguments, -// which are packed as tuples. - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os); - -// Overloaded PrintTo() for tuples of various arities. We support -// tuples of up-to 10 fields. The following implementation works -// regardless of whether tr1::tuple is implemented using the -// non-standard variadic template feature or not. - -inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo( - const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} -#endif // GTEST_HAS_TR1_TUPLE - -// Overload for std::pair. -template -void PrintTo(const ::std::pair& value, ::std::ostream* os) { - *os << '('; - // We cannot use UniversalPrint(value.first, os) here, as T1 may be - // a reference type. The same for printing value.second. - UniversalPrinter::Print(value.first, os); - *os << ", "; - UniversalPrinter::Print(value.second, os); - *os << ')'; -} - -// Implements printing a non-reference type T by letting the compiler -// pick the right overload of PrintTo() for T. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - // Note: we deliberately don't call this PrintTo(), as that name - // conflicts with ::testing::internal::PrintTo in the body of the - // function. - static void Print(const T& value, ::std::ostream* os) { - // By default, ::testing::internal::PrintTo() is used for printing - // the value. - // - // Thanks to Koenig look-up, if T is a class and has its own - // PrintTo() function defined in its namespace, that function will - // be visible here. Since it is more specific than the generic ones - // in ::testing::internal, it will be picked by the compiler in the - // following statement - exactly what we want. - PrintTo(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// UniversalPrintArray(begin, len, os) prints an array of 'len' -// elements, starting at address 'begin'. -template -void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { - if (len == 0) { - *os << "{}"; - } else { - *os << "{ "; - const size_t kThreshold = 18; - const size_t kChunkSize = 8; - // If the array has more than kThreshold elements, we'll have to - // omit some details by printing only the first and the last - // kChunkSize elements. - // TODO(wan@google.com): let the user control the threshold using a flag. - if (len <= kThreshold) { - PrintRawArrayTo(begin, len, os); - } else { - PrintRawArrayTo(begin, kChunkSize, os); - *os << ", ..., "; - PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); - } - *os << " }"; - } -} -// This overload prints a (const) char array compactly. -GTEST_API_ void UniversalPrintArray(const char* begin, - size_t len, - ::std::ostream* os); - -// Implements printing an array type T[N]. -template -class UniversalPrinter { - public: - // Prints the given array, omitting some elements when there are too - // many. - static void Print(const T (&a)[N], ::std::ostream* os) { - UniversalPrintArray(a, N, os); - } -}; - -// Implements printing a reference type T&. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - static void Print(const T& value, ::std::ostream* os) { - // Prints the address of the value. We use reinterpret_cast here - // as static_cast doesn't compile when T is a function type. - *os << "@" << reinterpret_cast(&value) << " "; - - // Then prints the value itself. - UniversalPrint(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// Prints a value tersely: for a reference type, the referenced value -// (but not the address) is printed; for a (const) char pointer, the -// NUL-terminated string (but not the pointer) is printed. -template -void UniversalTersePrint(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); -} -inline void UniversalTersePrint(const char* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(string(str), os); - } -} -inline void UniversalTersePrint(char* str, ::std::ostream* os) { - UniversalTersePrint(static_cast(str), os); -} - -// Prints a value using the type inferred by the compiler. The -// difference between this and UniversalTersePrint() is that for a -// (const) char pointer, this prints both the pointer and the -// NUL-terminated string. -template -void UniversalPrint(const T& value, ::std::ostream* os) { - UniversalPrinter::Print(value, os); -} - -#if GTEST_HAS_TR1_TUPLE -typedef ::std::vector Strings; - -// This helper template allows PrintTo() for tuples and -// UniversalTersePrintTupleFieldsToStrings() to be defined by -// induction on the number of tuple fields. The idea is that -// TuplePrefixPrinter::PrintPrefixTo(t, os) prints the first N -// fields in tuple t, and can be defined in terms of -// TuplePrefixPrinter. - -// The inductive case. -template -struct TuplePrefixPrinter { - // Prints the first N fields of a tuple. - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - TuplePrefixPrinter::PrintPrefixTo(t, os); - *os << ", "; - UniversalPrinter::type> - ::Print(::std::tr1::get(t), os); - } - - // Tersely prints the first N fields of a tuple to a string vector, - // one element for each field. - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Base cases. -template <> -struct TuplePrefixPrinter<0> { - template - static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} - - template - static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} -}; -// We have to specialize the entire TuplePrefixPrinter<> class -// template here, even though the definition of -// TersePrintPrefixToStrings() is the same as the generic version, as -// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't -// support specializing a method template of a class template. -template <> -struct TuplePrefixPrinter<1> { - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - UniversalPrinter::type>:: - Print(::std::tr1::get<0>(t), os); - } - - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get<0>(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os) { - *os << "("; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - PrintPrefixTo(t, os); - *os << ")"; -} - -// Prints the fields of a tuple tersely to a string vector, one -// element for each field. See the comment before -// UniversalTersePrint() for how we define "tersely". -template -Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { - Strings result; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - TersePrintPrefixToStrings(value, &result); - return result; -} -#endif // GTEST_HAS_TR1_TUPLE - -} // namespace internal - -template -::std::string PrintToString(const T& value) { - ::std::stringstream ss; - internal::UniversalTersePrint(value, &ss); - return ss.str(); -} - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ diff --git a/cli/test/include/gtest/gtest-spi.h b/cli/test/include/gtest/gtest-spi.h deleted file mode 100644 index b226e55..0000000 --- a/cli/test/include/gtest/gtest-spi.h +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Utilities for testing Google Test itself and code that uses Google Test -// (e.g. frameworks built on top of Google Test). - -#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ -#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ - -#include "gtest/gtest.h" - -namespace testing { - -// This helper class can be used to mock out Google Test failure reporting -// so that we can test Google Test or code that builds on Google Test. -// -// An object of this class appends a TestPartResult object to the -// TestPartResultArray object given in the constructor whenever a Google Test -// failure is reported. It can either intercept only failures that are -// generated in the same thread that created this object or it can intercept -// all generated failures. The scope of this mock object can be controlled with -// the second argument to the two arguments constructor. -class GTEST_API_ ScopedFakeTestPartResultReporter - : public TestPartResultReporterInterface { - public: - // The two possible mocking modes of this object. - enum InterceptMode { - INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. - INTERCEPT_ALL_THREADS // Intercepts all failures. - }; - - // The c'tor sets this object as the test part result reporter used - // by Google Test. The 'result' parameter specifies where to report the - // results. This reporter will only catch failures generated in the current - // thread. DEPRECATED - explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); - - // Same as above, but you can choose the interception scope of this object. - ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, - TestPartResultArray* result); - - // The d'tor restores the previous test part result reporter. - virtual ~ScopedFakeTestPartResultReporter(); - - // Appends the TestPartResult object to the TestPartResultArray - // received in the constructor. - // - // This method is from the TestPartResultReporterInterface - // interface. - virtual void ReportTestPartResult(const TestPartResult& result); - private: - void Init(); - - const InterceptMode intercept_mode_; - TestPartResultReporterInterface* old_reporter_; - TestPartResultArray* const result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); -}; - -namespace internal { - -// A helper class for implementing EXPECT_FATAL_FAILURE() and -// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given -// TestPartResultArray contains exactly one failure that has the given -// type and contains the given substring. If that's not the case, a -// non-fatal failure will be generated. -class GTEST_API_ SingleFailureChecker { - public: - // The constructor remembers the arguments. - SingleFailureChecker(const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr); - ~SingleFailureChecker(); - private: - const TestPartResultArray* const results_; - const TestPartResult::Type type_; - const string substr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); -}; - -} // namespace internal - -} // namespace testing - -// A set of macros for testing Google Test assertions or code that's expected -// to generate Google Test fatal failures. It verifies that the given -// statement will cause exactly one fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_FATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - 'statement' cannot reference local non-static variables or -// non-static members of the current object. -// - 'statement' cannot return a value. -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. The AcceptsMacroThatExpandsToUnprotectedComma test in -// gtest_unittest.cc will fail to compile if we do that. -#define EXPECT_FATAL_FAILURE(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ALL_THREADS, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -// A macro for testing Google Test assertions or code that's expected to -// generate Google Test non-fatal failures. It asserts that the given -// statement will cause exactly one non-fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// 'statement' is allowed to reference local variables and members of -// the current object. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. If we do that, the code won't compile when the user gives -// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that -// expands to code containing an unprotected comma. The -// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc -// catches that. -// -// For the same reason, we have to write -// if (::testing::internal::AlwaysTrue()) { statement; } -// instead of -// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) -// to avoid an MSVC warning on unreachable code. -#define EXPECT_NONFATAL_FAILURE(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS,\ - >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_ diff --git a/cli/test/include/gtest/gtest-test-part.h b/cli/test/include/gtest/gtest-test-part.h deleted file mode 100644 index 0a9e460..0000000 --- a/cli/test/include/gtest/gtest-test-part.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: mheule@google.com (Markus Heule) -// - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ - -#include -#include -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-string.h" - -namespace testing { - -// A copyable object representing the result of a test part (i.e. an -// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). -// -// Don't inherit from TestPartResult as its destructor is not virtual. -class GTEST_API_ TestPartResult { - public: - // The possible outcomes of a test part (i.e. an assertion or an - // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). - enum Type { - kSuccess, // Succeeded. - kNonFatalFailure, // Failed but the test can continue. - kFatalFailure, // Failed and the test should be terminated. - kFouceSuccess //强制使用例成功,且直接返回退出用例 - }; - - // C'tor. TestPartResult does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestPartResult object. - TestPartResult(Type a_type, - const char* a_file_name, - int a_line_number, - const char* a_message) - : type_(a_type), - file_name_(a_file_name), - line_number_(a_line_number), - summary_(ExtractSummary(a_message)), - message_(a_message) { - } - - // Gets the outcome of the test part. - Type type() const { return type_; } - - // Gets the name of the source file where the test part took place, or - // NULL if it's unknown. - const char* file_name() const { return file_name_.c_str(); } - - // Gets the line in the source file where the test part took place, - // or -1 if it's unknown. - int line_number() const { return line_number_; } - - // Gets the summary of the failure message. - const char* summary() const { return summary_.c_str(); } - - // Gets the message associated with the test part. - const char* message() const { return message_.c_str(); } - - // Returns true iff the test part passed. - bool passed() const { return ((type_ == kSuccess) || (type_ == kFouceSuccess)); } - - // Returns true iff the test part failed. - bool failed() const { return ((type_ != kSuccess) && (type_ != kFouceSuccess)); } - - // Returns true iff the test part non-fatally failed. - bool nonfatally_failed() const { return type_ == kNonFatalFailure; } - - // Returns true iff the test part fatally failed. - bool fatally_failed() const { return type_ == kFatalFailure; } - - // Returns true if 强制成功. - bool fatally_succeed() const { return type_ == kFouceSuccess; } - private: - Type type_; - - // Gets the summary of the failure message by omitting the stack - // trace in it. - static internal::String ExtractSummary(const char* message); - - // The name of the source file where the test part took place, or - // NULL if the source file is unknown. - internal::String file_name_; - // The line in the source file where the test part took place, or -1 - // if the line number is unknown. - int line_number_; - internal::String summary_; // The test failure summary. - internal::String message_; // The test failure message. -}; - -// Prints a TestPartResult object. -std::ostream& operator<<(std::ostream& os, const TestPartResult& result); - -// An array of TestPartResult objects. -// -// Don't inherit from TestPartResultArray as its destructor is not -// virtual. -class GTEST_API_ TestPartResultArray { - public: - TestPartResultArray() {} - - // Appends the given TestPartResult to the array. - void Append(const TestPartResult& result); - - // Returns the TestPartResult at the given index (0-based). - const TestPartResult& GetTestPartResult(int index) const; - - // Returns the number of TestPartResult objects in the array. - int size() const; - - private: - std::vector array_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); -}; - -// This interface knows how to report a test part result. -class TestPartResultReporterInterface { - public: - virtual ~TestPartResultReporterInterface() {} - - virtual void ReportTestPartResult(const TestPartResult& result) = 0; -}; - -namespace internal { - -// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a -// statement generates new fatal failures. To do so it registers itself as the -// current test part result reporter. Besides checking if fatal failures were -// reported, it only delegates the reporting to the former result reporter. -// The original result reporter is restored in the destructor. -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -class GTEST_API_ HasNewFatalFailureHelper - : public TestPartResultReporterInterface { - public: - HasNewFatalFailureHelper(); - virtual ~HasNewFatalFailureHelper(); - virtual void ReportTestPartResult(const TestPartResult& result); - bool has_new_fatal_failure() const { return has_new_fatal_failure_; } - private: - bool has_new_fatal_failure_; - TestPartResultReporterInterface* original_reporter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); -}; - -} // namespace internal - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ diff --git a/cli/test/include/gtest/gtest-typed-test.h b/cli/test/include/gtest/gtest-typed-test.h deleted file mode 100644 index fe1e83b..0000000 --- a/cli/test/include/gtest/gtest-typed-test.h +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// This header implements typed tests and type-parameterized tests. - -// Typed (aka type-driven) tests repeat the same test for types in a -// list. You must know which types you want to test with when writing -// typed tests. Here's how you do it: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - public: - ... - typedef std::list List; - static T shared_; - T value_; -}; - -// Next, associate a list of types with the test case, which will be -// repeated for each type in the list. The typedef is necessary for -// the macro to parse correctly. -typedef testing::Types MyTypes; -TYPED_TEST_CASE(FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// TYPED_TEST_CASE(FooTest, int); - -// Then, use TYPED_TEST() instead of TEST_F() to define as many typed -// tests for this test case as you want. -TYPED_TEST(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - // Since we are inside a derived class template, C++ requires use to - // visit the members of FooTest via 'this'. - TypeParam n = this->value_; - - // To visit static members of the fixture, add the TestFixture:: - // prefix. - n += TestFixture::shared_; - - // To refer to typedefs in the fixture, add the "typename - // TestFixture::" prefix. - typename TestFixture::List values; - values.push_back(n); - ... -} - -TYPED_TEST(FooTest, HasPropertyA) { ... } - -#endif // 0 - -// Type-parameterized tests are abstract test patterns parameterized -// by a type. Compared with typed tests, type-parameterized tests -// allow you to define the test pattern without knowing what the type -// parameters are. The defined pattern can be instantiated with -// different types any number of times, in any number of translation -// units. -// -// If you are designing an interface or concept, you can define a -// suite of type-parameterized tests to verify properties that any -// valid implementation of the interface/concept should have. Then, -// each implementation can easily instantiate the test suite to verify -// that it conforms to the requirements, without having to write -// similar tests repeatedly. Here's an example: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - ... -}; - -// Next, declare that you will define a type-parameterized test case -// (the _P suffix is for "parameterized" or "pattern", whichever you -// prefer): -TYPED_TEST_CASE_P(FooTest); - -// Then, use TYPED_TEST_P() to define as many type-parameterized tests -// for this type-parameterized test case as you want. -TYPED_TEST_P(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - TypeParam n = 0; - ... -} - -TYPED_TEST_P(FooTest, HasPropertyA) { ... } - -// Now the tricky part: you need to register all test patterns before -// you can instantiate them. The first argument of the macro is the -// test case name; the rest are the names of the tests in this test -// case. -REGISTER_TYPED_TEST_CASE_P(FooTest, - DoesBlah, HasPropertyA); - -// Finally, you are free to instantiate the pattern with the types you -// want. If you put the above code in a header file, you can #include -// it in multiple C++ source files and instantiate it multiple times. -// -// To distinguish different instances of the pattern, the first -// argument to the INSTANTIATE_* macro is a prefix that will be added -// to the actual test case name. Remember to pick unique prefixes for -// different instances. -typedef testing::Types MyTypes; -INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); - -#endif // 0 - -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-type-util.h" - -// Implements typed tests. - -#if GTEST_HAS_TYPED_TEST - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the typedef for the type parameters of the -// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) - -# define TYPED_TEST(CaseName, TestName) \ - template \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", #CaseName, #TestName, 0); \ - template \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)::TestBody() - -#endif // GTEST_HAS_TYPED_TEST - -// Implements type-parameterized tests. - -#if GTEST_HAS_TYPED_TEST_P - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the namespace name that the type-parameterized tests for -// the given type-parameterized test case are defined in. The exact -// name of the namespace is subject to change without notice. -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the variable used to remember the names of -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. -// -// Expands to the name of the variable used to remember the names of -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ - -// The variables defined in the type-parameterized test macros are -// static as typically these macros are used in a .h file that can be -// #included in multiple translation units linked together. -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) - -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template \ - class TestName : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName::TestBody() - -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase::type>::Register(\ - #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) - -#endif // GTEST_HAS_TYPED_TEST_P - -#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/cli/test/include/gtest/gtest.h b/cli/test/include/gtest/gtest.h deleted file mode 100644 index 27959ee..0000000 --- a/cli/test/include/gtest/gtest.h +++ /dev/null @@ -1,2552 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for Google Test. It should be -// included by any test program that uses Google Test. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! -// -// Acknowledgment: Google Test borrowed the idea of automatic test -// registration from Barthelemy Dagenais' (barthelemy@prologique.com) -// easyUnit framework. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_H_ - -#include -#include -#include -#include - -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-string.h" -#include "gtest/gtest-death-test.h" -#include "gtest/gtest-message.h" -#include "gtest/gtest-param-test.h" -#include "gtest/gtest-printers.h" -#include "gtest/gtest_prod.h" -#include "gtest/gtest-test-part.h" -#include "gtest/gtest-typed-test.h" - -// Depending on the platform, different string classes are available. -// On Linux, in addition to ::std::string, Google also makes use of -// class ::string, which has the same interface as ::std::string, but -// has a different implementation. -// -// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that -// ::string is available AND is a distinct type to ::std::string, or -// define it to 0 to indicate otherwise. -// -// If the user's ::std::string and ::string are the same class due to -// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0. -// -// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined -// heuristically. - -#define VERSION_STRING "verions:1025!\n\ -add FORCE_SUCCESS()\n" - -#define PRINT_DT_VERSION() printf("%s", VERSION_STRING); -//added by ywx627293 -extern "C" std::string g_current_cmd; -//add end - -extern int gtest_assert_count_; - -namespace testing { - -extern std::map map_testcase_assert; -// Declares the flags. - -// This flag temporary enables the disabled tests. -GTEST_DECLARE_bool_(also_run_disabled_tests); - -// This flag brings the debugger on an assertion failure. -GTEST_DECLARE_bool_(break_on_failure); - -// This flag controls whether Google Test catches all test-thrown exceptions -// and logs them as failures. -GTEST_DECLARE_bool_(catch_exceptions); - -// This flag enables using colors in terminal output. Available values are -// "yes" to enable colors, "no" (disable colors), or "auto" (the default) -// to let Google Test decide. -GTEST_DECLARE_string_(color); - -// This flag sets up the filter to select by name using a glob pattern -// the tests to run. If the filter is not given all tests are executed. -GTEST_DECLARE_string_(filter); - -// This flag causes the Google Test to list tests. None of the tests listed -// are actually run if the flag is provided. -GTEST_DECLARE_bool_(list_tests); - -//以下是autostar团队增加的命令 -GTEST_DECLARE_bool_(save_tests); -GTEST_DECLARE_string_(list_order); -GTEST_DECLARE_string_(dark_list_order); -GTEST_DECLARE_bool_(style_check); -GTEST_DECLARE_string_(style_check_output); -GTEST_DECLARE_string_(fuzzing_config); -GTEST_DECLARE_string_(fuzzing_args); -//end autostar - -// This flag controls whether Google Test emits a detailed XML report to a file -// in addition to its normal textual output. -GTEST_DECLARE_string_(output); - -// This flags control whether Google Test prints the elapsed time for each -// test. -GTEST_DECLARE_bool_(print_time); - -// This flag specifies the random number seed. -GTEST_DECLARE_int32_(random_seed); - -// This flag sets how many times the tests are repeated. The default value -// is 1. If the value is -1 the tests are repeating forever. -GTEST_DECLARE_int32_(repeat); - -// This flag controls whether Google Test includes Google Test internal -// stack frames in failure stack traces. -GTEST_DECLARE_bool_(show_internal_stack_frames); - -// When this flag is specified, tests' order is randomized on every iteration. -GTEST_DECLARE_bool_(shuffle); - -// This flag specifies the maximum number of stack frames to be -// printed in a failure message. -GTEST_DECLARE_int32_(stack_trace_depth); - -// When this flag is specified, a failed assertion will throw an -// exception if exceptions are enabled, or exit the program with a -// non-zero code otherwise. -GTEST_DECLARE_bool_(throw_on_failure); - -// When this flag is set with a "host:port" string, on supported -// platforms test results are streamed to the specified port on -// the specified host machine. -GTEST_DECLARE_string_(stream_result_to); - -GTEST_DECLARE_bool_(simple_reports); - -//socket local port -GTEST_DECLARE_int32_(local_port); - -//socket server ip -GTEST_DECLARE_string_(server_ip); -// The upper limit for valid stack trace depths. -const int kMaxStackTraceDepth = 100; -//guoqiuju 增加 -extern int g_set_throw_effect; - -namespace internal { - -class AssertHelper; -class DefaultGlobalTestPartResultReporter; -class ExecDeathTest; -class NoExecDeathTest; -class FinalSuccessChecker; -class GTestFlagSaver; -class TestResultAccessor; -class TestEventListenersAccessor; -class TestEventRepeater; -class WindowsDeathTest; -class UnitTestImpl* GetUnitTestImpl(); -void ReportFailureInUnknownLocation(TestPartResult::Type result_type, - const String& message); - -// Converts a streamable value to a String. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". -// Declared in gtest-internal.h but defined here, so that it has access -// to the definition of the Message class, required by the ARM -// compiler. -template -String StreamableToString(const T& streamable) { - return (Message() << streamable).GetString(); -} - -} // namespace internal - -// The friend relationship of some of these classes is cyclic. -// If we don't forward declare them the compiler might confuse the classes -// in friendship clauses with same named classes on the scope. -class Test; -class TestCase; -class TestInfo; -class UnitTest; - -// A class for indicating whether an assertion was successful. When -// the assertion wasn't successful, the AssertionResult object -// remembers a non-empty message that describes how it failed. -// -// To create an instance of this class, use one of the factory functions -// (AssertionSuccess() and AssertionFailure()). -// -// This class is useful for two purposes: -// 1. Defining predicate functions to be used with Boolean test assertions -// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts -// 2. Defining predicate-format functions to be -// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). -// -// For example, if you define IsEven predicate: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) -// will print the message -// -// Value of: IsEven(Fib(5)) -// Actual: false (5 is odd) -// Expected: true -// -// instead of a more opaque -// -// Value of: IsEven(Fib(5)) -// Actual: false -// Expected: true -// -// in case IsEven is a simple Boolean predicate. -// -// If you expect your predicate to be reused and want to support informative -// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up -// about half as often as positive ones in our tests), supply messages for -// both success and failure cases: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess() << n << " is even"; -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print -// -// Value of: IsEven(Fib(6)) -// Actual: true (8 is even) -// Expected: false -// -// NB: Predicates that support negative Boolean assertions have reduced -// performance in positive ones so be careful not to use them in tests -// that have lots (tens of thousands) of positive Boolean assertions. -// -// To use this class with EXPECT_PRED_FORMAT assertions such as: -// -// // Verifies that Foo() returns an even number. -// EXPECT_PRED_FORMAT1(IsEven, Foo()); -// -// you need to define: -// -// testing::AssertionResult IsEven(const char* expr, int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() -// << "Expected: " << expr << " is even\n Actual: it's " << n; -// } -// -// If Foo() returns 5, you will see the following message: -// -// Expected: Foo() is even -// Actual: it's 5 -// -#pragma pack(push, 4) //该类修改为4字节对齐,防止用户修改字节对齐后不恢复,导致message_错误 -class GTEST_API_ AssertionResult { - public: - // Copy constructor. - // Used in EXPECT_TRUE/FALSE(assertion_result). - AssertionResult(const AssertionResult& other); - // Used in the EXPECT_TRUE/FALSE(bool_expression). - explicit AssertionResult(bool success) : success_(success) {} - - // Returns true iff the assertion succeeded. - operator bool() const { return success_; } // NOLINT - - // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. - AssertionResult operator!() const; - - // Returns the text streamed into this AssertionResult. Test assertions - // use it when they fail (i.e., the predicate's outcome doesn't match the - // assertion's expectation). When nothing has been streamed into the - // object, returns an empty string. - const char* message() const { - return message_.get() != NULL ? message_->c_str() : ""; - } - // TODO(vladl@google.com): Remove this after making sure no clients use it. - // Deprecated; please use message() instead. - const char* failure_message() const { return message(); } - - // Streams a custom failure message into this object. - template AssertionResult& operator<<(const T& value) { - AppendMessage(Message() << value); - return *this; - } - - // Allows streaming basic output manipulators such as endl or flush into - // this object. - AssertionResult& operator<<( - ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { - AppendMessage(Message() << basic_manipulator); - return *this; - } - - private: - // Appends the contents of message to message_. - void AppendMessage(const Message& a_message) { - if (message_.get() == NULL) - message_.reset(new ::std::string); - message_->append(a_message.GetString().c_str()); - } - - // Stores result of the assertion predicate. - bool success_; - // Stores the message describing the condition in case the expectation - // construct is not satisfied with the predicate's outcome. - // Referenced via a pointer to avoid taking too much stack frame space - // with test assertions. - internal::scoped_ptr< ::std::string> message_; - - GTEST_DISALLOW_ASSIGN_(AssertionResult); -}; -#pragma pack(pop) - -// Makes a successful assertion result. -GTEST_API_ AssertionResult AssertionSuccess(); - -// Makes a failed assertion result. -GTEST_API_ AssertionResult AssertionFailure(); - -// Makes a failed assertion result with the given failure message. -// Deprecated; use AssertionFailure() << msg. -GTEST_API_ AssertionResult AssertionFailure(const Message& msg); - -// The abstract class that all tests inherit from. -// -// In Google Test, a unit test program contains one or many TestCases, and -// each TestCase contains one or many Tests. -// -// When you define a test using the TEST macro, you don't need to -// explicitly derive from Test - the TEST macro automatically does -// this for you. -// -// The only time you derive from Test is when defining a test fixture -// to be used a TEST_F. For example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { ... } -// virtual void TearDown() { ... } -// ... -// }; -// -// TEST_F(FooTest, Bar) { ... } -// TEST_F(FooTest, Baz) { ... } -// -// Test is not copyable. -class GTEST_API_ Test { - public: - friend class TestInfo; - - // Defines types for pointers to functions that set up and tear down - // a test case. - typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; - typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; - - // The d'tor is virtual as we intend to inherit from Test. - virtual ~Test(); - - // Sets up the stuff shared by all tests in this test case. - // - // Google Test will call Foo::SetUpTestCase() before running the first - // test in test case Foo. Hence a sub-class can define its own - // SetUpTestCase() method to shadow the one defined in the super - // class. - static void SetUpTestCase() {} - - // Tears down the stuff shared by all tests in this test case. - // - // Google Test will call Foo::TearDownTestCase() after running the last - // test in test case Foo. Hence a sub-class can define its own - // TearDownTestCase() method to shadow the one defined in the super - // class. - static void TearDownTestCase() {} - - // Returns true iff the current test has a fatal failure. - static bool HasFatalFailure(); - - // Returns true iff the current test has a non-fatal failure. - static bool HasNonfatalFailure(); - - static bool HasFatalSuccess(); - // Returns true iff the current test has a (either fatal or - // non-fatal) failure. - static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } - - // Logs a property for the current test. Only the last value for a given - // key is remembered. - // These are public static so they can be called from utility functions - // that are not members of the test fixture. - // The arguments are const char* instead strings, as Google Test is used - // on platforms where string doesn't compile. - // - // Note that a driving consideration for these RecordProperty methods - // was to produce xml output suited to the Greenspan charting utility, - // which at present will only chart values that fit in a 32-bit int. It - // is the user's responsibility to restrict their values to 32-bit ints - // if they intend them to be used with Greenspan. - static void RecordProperty(const char* key, const char* value); - static void RecordProperty(const char* key, int value); - - protected: - // Creates a Test object. - Test(); - - // Sets up the test fixture. - virtual void SetUp(); - - // Tears down the test fixture. - virtual void TearDown(); - - private: - // Returns true iff the current test has the same fixture class as - // the first test in the current test case. - static bool HasSameFixtureClass(); - - // Runs the test after the test fixture has been set up. - // - // A sub-class must implement this to define the test logic. - // - // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. - // Instead, use the TEST or TEST_F macro. - virtual void TestBody() = 0; - - // Sets up, executes, and tears down the test. - void Run(); - -//由autostar增加,用于发送消息 - void TestRunSend(TestInfo* impl, int iState); - void RunCtorRegFunc(); - void RunDtorRegFunc(); - //end autostar - - // Deletes self. We deliberately pick an unusual name for this - // internal method to avoid clashing with names used in user TESTs. - void DeleteSelf_() { delete this; } - - // Uses a GTestFlagSaver to save and restore all Google Test flags. - const internal::GTestFlagSaver* const gtest_flag_saver_; - - // Often a user mis-spells SetUp() as Setup() and spends a long time - // wondering why it is never called by Google Test. The declaration of - // the following method is solely for catching such an error at - // compile time: - // - // - The return type is deliberately chosen to be not void, so it - // will be a conflict if a user declares void Setup() in his test - // fixture. - // - // - This method is private, so it will be another compiler error - // if a user calls it from his test fixture. - // - // DO NOT OVERRIDE THIS FUNCTION. - // - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } - - // We disallow copying Tests. - GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); -}; - -typedef internal::TimeInMillis TimeInMillis; - -// A copyable object representing a user specified test property which can be -// output as a key/value string pair. -// -// Don't inherit from TestProperty as its destructor is not virtual. -class TestProperty { - public: - // C'tor. TestProperty does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestProperty object. - TestProperty(const char* a_key, const char* a_value) : - key_(a_key), value_(a_value) { - } - - // Gets the user supplied key. - const char* key() const { - return key_.c_str(); - } - - // Gets the user supplied value. - const char* value() const { - return value_.c_str(); - } - - // Sets a new value, overriding the one supplied in the constructor. - void SetValue(const char* new_value) { - value_ = new_value; - } - - private: - // The key supplied by the user. - internal::String key_; - // The value supplied by the user. - internal::String value_; -}; - -// The result of a single Test. This includes a list of -// TestPartResults, a list of TestProperties, a count of how many -// death tests there are in the Test, and how much time it took to run -// the Test. -// -// TestResult is not copyable. -class GTEST_API_ TestResult { - public: - // Creates an empty TestResult. - TestResult(); - - // D'tor. Do not inherit from TestResult. - ~TestResult(); - - // Gets the number of all test parts. This is the sum of the number - // of successful test parts and the number of failed test parts. - int total_part_count() const; - - // Returns the number of the test properties. - int test_property_count() const; - - // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } - - // Returns true iff the test failed. - bool Failed() const; - - // Returns true iff the test fatally failed. - bool HasFatalFailure() const; - - bool HasFatalSuccess() const; - // Returns true iff the test has a non-fatal failure. - bool HasNonfatalFailure() const; - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test part result among all the results. i can range - // from 0 to test_property_count() - 1. If i is not in that range, aborts - // the program. - const TestPartResult& GetTestPartResult(int i) const; - - // Returns the i-th test property. i can range from 0 to - // test_property_count() - 1. If i is not in that range, aborts the - // program. - const TestProperty& GetTestProperty(int i) const; - - // Adds a test part result to the list. - //autostar 修改public属性 - void AddTestPartResult(const TestPartResult& test_part_result); - - private: - friend class TestInfo; - friend class UnitTest; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::ExecDeathTest; - friend class internal::TestResultAccessor; - friend class internal::UnitTestImpl; - friend class internal::WindowsDeathTest; - - // Gets the vector of TestPartResults. - const std::vector& test_part_results() const { - return test_part_results_; - } - - // Gets the vector of TestProperties. - const std::vector& test_properties() const { - return test_properties_; - } - - // Sets the elapsed time. - void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } - - // Adds a test property to the list. The property is validated and may add - // a non-fatal failure if invalid (e.g., if it conflicts with reserved - // key names). If a property is already recorded for the same key, the - // value will be updated, rather than storing multiple values for the same - // key. - void RecordProperty(const TestProperty& test_property); - - // Adds a failure if the key is a reserved attribute of Google Test - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const TestProperty& test_property); - - // Returns the death test count. - int death_test_count() const { return death_test_count_; } - - // Increments the death test count, returning the new count. - int increment_death_test_count() { return ++death_test_count_; } - - // Clears the test part results. - void ClearTestPartResults(); - - // Clears the object. - void Clear(); - - // Protects mutable state of the property vector and of owned - // properties, whose values may be updated. - internal::Mutex test_properites_mutex_; - - // The vector of TestPartResults - std::vector test_part_results_; - // The vector of TestProperties - std::vector test_properties_; - // Running count of death tests. - int death_test_count_; - // The elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - - // We disallow copying TestResult. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); -}; // class TestResult - -// A TestInfo object stores the following information about a test: -// -// Test case name -// Test name -// Whether the test should be run -// A function pointer that creates the test object when invoked -// Test result -// -// The constructor of TestInfo registers itself with the UnitTest -// singleton such that the RUN_ALL_TESTS() macro knows which tests to -// run. -class GTEST_API_ TestInfo { - public: - // Destructs a TestInfo object. This function is not virtual, so - // don't inherit from TestInfo. - ~TestInfo(); - - // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } - - // Returns the test name. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a typed - // or a type-parameterized test. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns the text representation of the value parameter, or NULL if this - // is not a value-parameterized test. - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; - } - - // Returns true if this test should run, that is if the test is not disabled - // (or it is disabled but the also_run_disabled_tests flag has been specified) - // and its full name matches the user-specified filter. - // - // Google Test allows the user to filter the tests by their full names. - // The full name of a test Bar in test case Foo is defined as - // "Foo.Bar". Only the tests that match the filter will run. - // - // A filter is a colon-separated list of glob (not regex) patterns, - // optionally followed by a '-' and a colon-separated list of - // negative patterns (tests to exclude). A test is run if it - // matches one of the positive patterns and does not match any of - // the negative patterns. - // - // For example, *A*:Foo.* is a filter that matches any string that - // contains the character 'A' or starts with "Foo.". - bool should_run() const { return should_run_; } - - // Returns the result of the test. - const TestResult* result() const { return &result_; } - - //由autostar增加,用于保存用例所在的文件和行号 - std::string GetFilePath() const { return strFilePath; } - std::string GetCaseId() const { return name_id_; } - int GetCaseLine() const { return iCaseLine; } - TestResult* resultEx() const { return (TestResult*)&result_; } - - private: - -#if GTEST_HAS_DEATH_TEST - friend class internal::DefaultDeathTestFactory; -#endif // GTEST_HAS_DEATH_TEST - friend class Test; - friend class TestCase; - friend class internal::UnitTestImpl; - friend TestInfo* internal::MakeAndRegisterTestInfo( - const char* test_case_name, const char* name, - const char* type_param, - const char* value_param, - internal::TypeId fixture_class_id, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - internal::TestFactoryBase* factory, - std::string sFilePath, - int iLine, - const char* name_id); - - // Constructs a TestInfo object. The newly constructed instance assumes - // ownership of the factory object. - TestInfo(const char* test_case_name, const char* name, - const char* a_type_param, - const char* a_value_param, - internal::TypeId fixture_class_id, - internal::TestFactoryBase* factory, - std::string sFilePath, - int iLine, - const char* name_id = ""); - - // Increments the number of death tests encountered in this test so - // far. - int increment_death_test_count() { - return result_.increment_death_test_count(); - } - - //由autostar增加,用于保存用例所在的文件和行号 - void SetFilePath( std::string sFilePath ) { strFilePath = sFilePath; } - void SetCaseLine( int iLine ) { iCaseLine = iLine; } - - // Creates the test object, runs it, records its result, and then - // deletes it. - void Run(); - - static void ClearTestResult(TestInfo* test_info) { - test_info->result_.Clear(); - } - - // These fields are immutable properties of the test. - const std::string test_case_name_; // Test case name - const std::string name_; // Test name - const std::string name_id_; // Test name id - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // Text representation of the value parameter, or NULL if this is not a - // value-parameterized test. - const internal::scoped_ptr value_param_; - const internal::TypeId fixture_class_id_; // ID of the test fixture class - bool should_run_; // True iff this test should run - bool is_disabled_; // True iff this test is disabled - bool matches_filter_; // True if this test matches the - // user-specified filter. - internal::TestFactoryBase* const factory_; // The factory that creates - // the test object - - // This field is mutable and needs to be reset before running the - // test for the second time. - TestResult result_; - - std::string strFilePath; - int iCaseLine; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); -}; - -// A test case, which consists of a vector of TestInfos. -// -// TestCase is not copyable. -class GTEST_API_ TestCase { - public: - // Creates a TestCase with the given name. - // - // TestCase does NOT have a default constructor. Always use this - // constructor to create a TestCase object. - // - // Arguments: - // - // name: name of the test case - // a_type_param: the name of the test's type parameter, or NULL if - // this is not a type-parameterized test. - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase(const char* name, const char* a_type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); - - // Destructor of TestCase. - virtual ~TestCase(); - - // Gets the name of the TestCase. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a - // type-parameterized test case. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns true if any test in this test case should run. - bool should_run() const { return should_run_; } - - // Gets the number of successful tests in this test case. - int successful_test_count() const; - - // Gets the number of failed tests in this test case. - int failed_test_count() const; - - // Gets the number of disabled tests in this test case. - int disabled_test_count() const; - - // Get the number of tests in this test case that should run. - int test_to_run_count() const; - - // Gets the number of all tests in this test case. - int total_test_count() const; - - // Returns true iff the test case passed. - bool Passed() const { return !Failed(); } - - // Returns true iff the test case failed. - bool Failed() const { return failed_test_count() > 0; } - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - const TestInfo* GetTestInfo(int i) const; - - int total_testcase_assert_count() const; - - private: - friend class Test; - friend class internal::UnitTestImpl; - - // Gets the (mutable) vector of TestInfos in this TestCase. - std::vector& test_info_list() { return test_info_list_; } - - // Gets the (immutable) vector of TestInfos in this TestCase. - const std::vector& test_info_list() const { - return test_info_list_; - } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - TestInfo* GetMutableTestInfo(int i); - - // Sets the should_run member. - void set_should_run(bool should) { should_run_ = should; } - - // Adds a TestInfo to this test case. Will delete the TestInfo upon - // destruction of the TestCase object. - void AddTestInfo(TestInfo * test_info); - - // Clears the results of all tests in this test case. - void ClearResult(); - - // Clears the results of all tests in the given test case. - static void ClearTestCaseResult(TestCase* test_case) { - test_case->ClearResult(); - } - - // Runs every test in this TestCase. - void Run(); - - // Runs SetUpTestCase() for this TestCase. This wrapper is needed - // for catching exceptions thrown from SetUpTestCase(). - //modify by guoqiuju,修改在测试套事件中assert系列不抛异常,这样就可以继续执行和返回结果 - void RunSetUpTestCase() { g_set_throw_effect = 0; (*set_up_tc_)(); g_set_throw_effect = 1;} - - // Runs TearDownTestCase() for this TestCase. This wrapper is - // needed for catching exceptions thrown from TearDownTestCase(). - //modify by guoqiuju,修改在测试套事件中assert系列不抛异常,这样就可以继续执行和返回结果 - void RunTearDownTestCase() { g_set_throw_effect = 0; (*tear_down_tc_)(); g_set_throw_effect = 1;} - - // Returns true iff test passed. - static bool TestPassed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Passed(); - } - - // Returns true iff test failed. - static bool TestFailed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Failed(); - } - - // Returns true iff test is disabled. - static bool TestDisabled(const TestInfo* test_info) { - return test_info->is_disabled_; - } - - // Returns true if the given test should run. - static bool ShouldRunTest(const TestInfo* test_info) { - return test_info->should_run(); - } - - // Shuffles the tests in this test case. - void ShuffleTests(internal::Random* random); - - // Restores the test order to before the first shuffle. - void UnshuffleTests(); - - //让所有测试用例失败 - void SetTestsFail(); - - //让所有测试用例成功 - void SetTestsPass(); - // Name of the test case. - internal::String name_; - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // The vector of TestInfos in their original order. It owns the - // elements in the vector. - std::vector test_info_list_; - // Provides a level of indirection for the test list to allow easy - // shuffling and restoring the test order. The i-th element in this - // vector is the index of the i-th test in the shuffled test list. - std::vector test_indices_; - // Pointer to the function that sets up the test case. - Test::SetUpTestCaseFunc set_up_tc_; - // Pointer to the function that tears down the test case. - Test::TearDownTestCaseFunc tear_down_tc_; - // True iff any test in this test case should run. - bool should_run_; - // Elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - - // We disallow copying TestCases. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); -}; - -// An Environment object is capable of setting up and tearing down an -// environment. The user should subclass this to define his own -// environment(s). -// -// An Environment object does the set-up and tear-down in virtual -// methods SetUp() and TearDown() instead of the constructor and the -// destructor, as: -// -// 1. You cannot safely throw from a destructor. This is a problem -// as in some cases Google Test is used where exceptions are enabled, and -// we may want to implement ASSERT_* using exceptions where they are -// available. -// 2. You cannot use ASSERT_* directly in a constructor or -// destructor. -class Environment { - public: - // The d'tor is virtual as we need to subclass Environment. - virtual ~Environment() {} - - // Override this to define how to set up the environment. - virtual void SetUp() {} - - // Override this to define how to tear down the environment. - virtual void TearDown() {} - private: - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } -}; - -// The interface for tracing execution of tests. The methods are organized in -// the order the corresponding events are fired. -class TestEventListener { - public: - virtual ~TestEventListener() {} - - // Fired before any test activity starts. - virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; - - // Fired before each iteration of tests starts. There may be more than - // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration - // index, starting from 0. - virtual void OnTestIterationStart(const UnitTest& unit_test, - int iteration) = 0; - - // Fired before environment set-up for each iteration of tests starts. - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; - - // Fired after environment set-up for each iteration of tests ends. - virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; - - // Fired before the test case starts. - virtual void OnTestCaseStart(const TestCase& test_case) = 0; - - // Fired before the test starts. - virtual void OnTestStart(const TestInfo& test_info) = 0; - - // Fired before the test set-up starts. - virtual void OnTestSetUpStart(const Test& test) {} - - // Fired after the test set-up ends. - virtual void OnTestSetUpEnd(const Test& test) {} - - // Fired after a failed assertion or a SUCCEED() invocation. - virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; - - // Fired before the test tear-down starts. - virtual void OnTestTearDownStart(const Test& test) {} - - // Fired after the test tear-down ends. - virtual void OnTestTearDownEnd(const Test& test) {} - - // Fired after the test ends. - virtual void OnTestEnd(const TestInfo& test_info) = 0; - - // Fired after the test case ends. - virtual void OnTestCaseEnd(const TestCase& test_case) = 0; - - // Fired before environment tear-down for each iteration of tests starts. - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; - - // Fired after environment tear-down for each iteration of tests ends. - virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; - - // Fired after each iteration of tests finishes. - virtual void OnTestIterationEnd(const UnitTest& unit_test, - int iteration) = 0; - - // Fired after all test activities have ended. - virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; -}; - -// The convenience class for users who need to override just one or two -// methods and are not concerned that a possible change to a signature of -// the methods they override will not be caught during the build. For -// comments about each method please see the definition of TestEventListener -// above. -class EmptyTestEventListener : public TestEventListener { - public: - virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestSetUpStart(const Test& /*test*/) {} - virtual void OnTestSetUpEnd(const Test& /*test*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestTearDownStart(const Test& /*test*/) {} - virtual void OnTestTearDownEnd(const Test& /*test*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} -}; - -struct styleCheckItem -{ - styleCheckItem() - { - file = ""; - line = 0; - assert_count = 0; - } - std::string file; - int line; - int assert_count; -}; - -class styleCheck : public EmptyTestEventListener -{ -public: - static void tick(); - static std::map styleCheckData; - virtual void OnTestProgramEnd(const UnitTest &ut); - virtual void OnTestStart(const TestInfo &ti); -}; - -// TestEventListeners lets users add listeners to track events in Google Test. -class GTEST_API_ TestEventListeners { - public: - TestEventListeners(); - ~TestEventListeners(); - - // Appends an event listener to the end of the list. Google Test assumes - // the ownership of the listener (i.e. it will delete the listener when - // the test program finishes). - void Append(TestEventListener* listener); - - // Removes the given event listener from the list and returns it. It then - // becomes the caller's responsibility to delete the listener. Returns - // NULL if the listener is not found in the list. - TestEventListener* Release(TestEventListener* listener); - - // Returns the standard listener responsible for the default console - // output. Can be removed from the listeners list to shut down default - // console output. Note that removing this object from the listener list - // with Release transfers its ownership to the caller and makes this - // function return NULL the next time. - TestEventListener* default_result_printer() const { - return default_result_printer_; - } - - // Returns the standard listener responsible for the default XML output - // controlled by the --gtest_output=xml flag. Can be removed from the - // listeners list by users who want to shut down the default XML output - // controlled by this flag and substitute it with custom one. Note that - // removing this object from the listener list with Release transfers its - // ownership to the caller and makes this function return NULL the next - // time. - TestEventListener* default_xml_generator() const { - return default_xml_generator_; - } - -private: - friend class Test; - friend class TestCase; - friend class TestInfo; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::NoExecDeathTest; - friend class internal::TestEventListenersAccessor; - friend class internal::UnitTestImpl; - - // Returns repeater that broadcasts the TestEventListener events to all - // subscribers. - TestEventListener* repeater(); - - // Sets the default_result_printer attribute to the provided listener. - // The listener is also added to the listener list and previous - // default_result_printer is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultResultPrinter(TestEventListener* listener); - - // Sets the default_xml_generator attribute to the provided listener. The - // listener is also added to the listener list and previous - // default_xml_generator is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultXmlGenerator(TestEventListener* listener); - - // Controls whether events will be forwarded by the repeater to the - // listeners in the list. - bool EventForwardingEnabled() const; - void SuppressEventForwarding(); - - // The actual list of listeners. - internal::TestEventRepeater* repeater_; - // Listener responsible for the standard result output. - TestEventListener* default_result_printer_; - // Listener responsible for the creation of the XML output file. - TestEventListener* default_xml_generator_; - - // We disallow copying TestEventListeners. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); -}; - -// A UnitTest consists of a vector of TestCases. -// -// This is a singleton class. The only instance of UnitTest is -// created when UnitTest::GetInstance() is first called. This -// instance is never deleted. -// -// UnitTest is not copyable. -// -// This class is thread-safe as long as the methods are called -// according to their specification. -class GTEST_API_ UnitTest { - public: - // Gets the singleton UnitTest object. The first time this method - // is called, a UnitTest object is constructed and returned. - // Consecutive calls will return the same object. - static UnitTest* GetInstance(); - - // Runs all tests in this UnitTest object and prints the result. - // Returns 0 if successful, or 1 otherwise. - // - // This method can only be called from the main thread. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - int Run() GTEST_MUST_USE_RESULT_; - - // Returns the working directory when the first TEST() or TEST_F() - // was executed. The UnitTest object owns the string. - const char* original_working_dir() const; - - // Returns the TestCase object for the test that's currently running, - // or NULL if no test is running. - const TestCase* current_test_case() const; - - // Returns the TestInfo object for the test that's currently running, - // or NULL if no test is running. - const TestInfo* current_test_info() const; - - // Returns the random seed used at the start of the current test run. - int random_seed() const; - -#if GTEST_HAS_PARAM_TEST - // Returns the ParameterizedTestCaseRegistry object used to keep track of - // value-parameterized tests and instantiate and register them. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - internal::ParameterizedTestCaseRegistry& parameterized_test_registry(); -#endif // GTEST_HAS_PARAM_TEST - - // Gets the number of successful test cases. - int successful_test_case_count() const; - - // Gets the number of failed test cases. - int failed_test_case_count() const; - - // Gets the number of all test cases. - int total_test_case_count() const; - - // Gets the number of all test cases that contain at least one test - // that should run. - int test_case_to_run_count() const; - - // Gets the number of successful tests. - int successful_test_count() const; - - // Gets the number of failed tests. - int failed_test_count() const; - - // Gets the number of disabled tests. - int disabled_test_count() const; - - // Gets the number of all tests. - int total_test_count() const; - - // Gets the number of tests that should run. - int test_to_run_count() const; - - // Gets the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const; - - // Returns true iff the unit test passed (i.e. all test cases passed). - bool Passed() const; - - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). - bool Failed() const; - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const; - - // Returns the list of event listeners that can be used to track events - // inside Google Test. - TestEventListeners& listeners(); - - // Adds a TestPartResult to the current TestResult object. All - // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) - // eventually call this to report their results. The user code - // should use the assertion macros instead of calling this directly. - //此函数由autostar修改,从private改为public属性,方便给amock使用 - void AddTestPartResult(TestPartResult::Type result_type, - const char* file_name, - int line_number, - const internal::String& message, - const internal::String& os_stack_trace); - - private: - // Registers and returns a global test environment. When a test - // program is run, all global test environments will be set-up in - // the order they were registered. After all tests in the program - // have finished, all global test environments will be torn-down in - // the *reverse* order they were registered. - // - // The UnitTest object takes ownership of the given environment. - // - // This method can only be called from the main thread. - Environment* AddEnvironment(Environment* env); - - // Adds a TestProperty to the current TestResult object. If the result already - // contains a property with the same key, the value will be updated. - void RecordPropertyForCurrentTest(const char* key, const char* value); - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i); - - // Accessors for the implementation object. - internal::UnitTestImpl* impl() { return impl_; } - const internal::UnitTestImpl* impl() const { return impl_; } - - // These classes and funcions are friends as they need to access private - // members of UnitTest. - friend class Test; - friend class internal::AssertHelper; - friend class internal::ScopedTrace; - friend Environment* AddGlobalTestEnvironment(Environment* env); - friend internal::UnitTestImpl* internal::GetUnitTestImpl(); - friend void internal::ReportFailureInUnknownLocation( - TestPartResult::Type result_type, - const internal::String& message); - - // Creates an empty UnitTest. - UnitTest(); - - // D'tor - virtual ~UnitTest(); - - // Pushes a trace defined by SCOPED_TRACE() on to the per-thread - // Google Test trace stack. - void PushGTestTrace(const internal::TraceInfo& trace); - - // Pops a trace from the per-thread Google Test trace stack. - void PopGTestTrace(); - - // Protects mutable state in *impl_. This is mutable as some const - // methods need to lock it too. - mutable internal::Mutex mutex_; - - // Opaque implementation object. This field is never changed once - // the object is constructed. We don't mark it as const here, as - // doing so will cause a warning in the constructor of UnitTest. - // Mutable state in *impl_ is protected by mutex_. - internal::UnitTestImpl* impl_; - - // We disallow copying UnitTest. - GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); -}; - -// A convenient wrapper for adding an environment for the test -// program. -// -// You should call this before RUN_ALL_TESTS() is called, probably in -// main(). If you use gtest_main, you need to call this before main() -// starts for it to take effect. For example, you can define a global -// variable like this: -// -// testing::Environment* const foo_env = -// testing::AddGlobalTestEnvironment(new FooEnvironment); -// -// However, we strongly recommend you to write your own main() and -// call AddGlobalTestEnvironment() there, as relying on initialization -// of global variables makes the code harder to read and may cause -// problems when you register multiple environments from different -// translation units and the environments have dependencies among them -// (remember that the compiler doesn't guarantee the order in which -// global variables from different translation units are initialized). -inline Environment* AddGlobalTestEnvironment(Environment* env) { - return UnitTest::GetInstance()->AddEnvironment(env); -} - -// Initializes Google Test. This must be called before calling -// RUN_ALL_TESTS(). In particular, it parses a command line for the -// flags that Google Test recognizes. Whenever a Google Test flag is -// seen, it is removed from argv, and *argc is decremented. -// -// No value is returned. Instead, the Google Test flag variables are -// updated. -// -// Calling the function for the second time has no user-visible effect. -//这个重载函数由autostar修改,增加一个参数用来设置消息发送时的IP地址 -GTEST_API_ void InitGoogleTest(int* argc, char** argv, std::string strIP) ; - -// This overloaded version can be used in Windows programs compiled in -// UNICODE mode. -GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv, std::string ) ; - -namespace internal { - -// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) -// operand to be used in a failure message. The type (but not value) -// of the other operand may affect the format. This allows us to -// print a char* as a raw pointer when it is compared against another -// char*, and print it as a C string when it is compared against an -// std::string object, for example. -// -// The default implementation ignores the type of the other operand. -// Some specialized versions are used to handle formatting wide or -// narrow C strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -String FormatForComparisonFailureMessage(const T1& value, - const T2& /* other_operand */) { - // C++Builder compiles this incorrectly if the namespace isn't explicitly - // given. - return ::testing::PrintToString(value); -} - -// The helper function for {ASSERT|EXPECT}_EQ. -template -AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4389) // Temporarily disables warning on - // signed/unsigned mismatch. -#endif - - if (expected == actual) { - return AssertionSuccess(); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - - return EqFailure(expected_expression, - actual_expression, - FormatForComparisonFailureMessage(expected, actual), - FormatForComparisonFailureMessage(actual, expected), - false); -} - -// With this overloaded version, we allow anonymous enums to be used -// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums -// can be implicitly cast to BiggestInt. -GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual); - -// The helper class for {ASSERT|EXPECT}_EQ. The template argument -// lhs_is_null_literal is true iff the first argument to ASSERT_EQ() -// is a null pointer literal. The following default implementation is -// for lhs_is_null_literal being false. -template -class EqHelper { - public: - // This templatized version is for the general case. - template - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // With this overloaded version, we allow anonymous enums to be used - // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous - // enums can be implicitly cast to BiggestInt. - // - // Even though its body looks the same as the above version, we - // cannot merge the two, as it will make anonymous enums unhappy. - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } -}; - -// This specialization is used when the first argument to ASSERT_EQ() -// is a null pointer literal, like NULL, false, or 0. -template <> -class EqHelper { - public: - // We define two overloaded versions of Compare(). The first - // version will be picked when the second argument to ASSERT_EQ() is - // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or - // EXPECT_EQ(false, a_bool). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual, - // The following line prevents this overload from being considered if T2 - // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) - // expands to Compare("", "", NULL, my_ptr), which requires a conversion - // to match the Secret* in the other overload, which would otherwise make - // this template match better. - typename EnableIf::value>::type* = 0) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // This version will be picked when the second argument to ASSERT_EQ() is a - // pointer, e.g. ASSERT_EQ(NULL, a_pointer). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - // We used to have a second template parameter instead of Secret*. That - // template parameter would deduce to 'long', making this a better match - // than the first overload even without the first overload's EnableIf. - // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to - // non-pointer argument" (even a deduced integral argument), so the old - // implementation caused warnings in user code. - Secret* /* expected (NULL) */, - T* actual) { - // We already know that 'expected' is a null pointer. - return CmpHelperEQ(expected_expression, actual_expression, - static_cast(NULL), actual); - } -}; - -// A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste -// of similar code. -// -// For each templatized helper function, we also define an overloaded -// version for BiggestInt in order to reduce code bloat and allow -// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled -// with gcc 4. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template \ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return AssertionFailure() \ - << "Expected: (" << expr1 << ") " #op " (" << expr2\ - << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ - << " vs " << FormatForComparisonFailureMessage(val2, val1);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) - -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// Implements the helper function for {ASSERT|EXPECT}_NE -GTEST_IMPL_CMP_HELPER_(NE, !=); -// Implements the helper function for {ASSERT|EXPECT}_LE -GTEST_IMPL_CMP_HELPER_(LE, <=); -// Implements the helper function for {ASSERT|EXPECT}_LT -GTEST_IMPL_CMP_HELPER_(LT, < ); -// Implements the helper function for {ASSERT|EXPECT}_GE -GTEST_IMPL_CMP_HELPER_(GE, >=); -// Implements the helper function for {ASSERT|EXPECT}_GT -GTEST_IMPL_CMP_HELPER_(GT, > ); - -#undef GTEST_IMPL_CMP_HELPER_ - -// The helper function for {ASSERT|EXPECT}_STREQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRCASEEQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRNE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRCASENE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - - -// Helper function for *_STREQ on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const wchar_t* expected, - const wchar_t* actual); - -// Helper function for *_STRNE on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); - -} // namespace internal - -// IsSubstring() and IsNotSubstring() are intended to be used as the -// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by -// themselves. They check whether needle is a substring of haystack -// (NULL is considered a substring of itself only), and return an -// appropriate error message when they fail. -// -// The {needle,haystack}_expr arguments are the stringified -// expressions that generated the two real arguments. -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -#endif // GTEST_HAS_STD_WSTRING - -namespace internal { - -// Helper template function for comparing floating-points. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression, - const char* actual_expression, - RawType expected, - RawType actual) { - const FloatingPoint lhs(expected), rhs(actual); - - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - ::std::stringstream expected_ss; - expected_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << expected; - - ::std::stringstream actual_ss; - actual_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << actual; - - return EqFailure(expected_expression, - actual_expression, - StringStreamToString(&expected_ss), - StringStreamToString(&actual_ss), - false); -} - -// Helper function for implementing ASSERT_NEAR. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, - const char* expr2, - const char* abs_error_expr, - double val1, - double val2, - double abs_error); - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// A class that enables one to stream messages to assertion macros -class GTEST_API_ AssertHelper { - public: - // Constructor. - AssertHelper(TestPartResult::Type type, - const char* file, - int line, - const char* message); - ~AssertHelper(); - - // Message assignment is a semantic trick to enable assertion - // streaming; see the GTEST_MESSAGE_ macro below. - void operator=(const Message& message) const; - - private: - // We put our data in a struct so that the size of the AssertHelper class can - // be as small as possible. This is important because gcc is incapable of - // re-using stack space even for temporary variables, so every EXPECT_EQ - // reserves stack space for another AssertHelper. - struct AssertHelperData { - AssertHelperData(TestPartResult::Type t, - const char* srcfile, - int line_num, - const char* msg) - : type(t), file(srcfile), line(line_num), message(msg) { } - - TestPartResult::Type const type; - const char* const file; - int const line; - String const message; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); - }; - - AssertHelperData* const data_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); -}; - -} // namespace internal - -#if GTEST_HAS_PARAM_TEST -// The pure interface class that all value-parameterized tests inherit from. -// A value-parameterized class must inherit from both ::testing::Test and -// ::testing::WithParamInterface. In most cases that just means inheriting -// from ::testing::TestWithParam, but more complicated test hierarchies -// may need to inherit from Test and WithParamInterface at different levels. -// -// This interface has support for accessing the test parameter value via -// the GetParam() method. -// -// Use it with one of the parameter generator defining functions, like Range(), -// Values(), ValuesIn(), Bool(), and Combine(). -// -// class FooTest : public ::testing::TestWithParam { -// protected: -// FooTest() { -// // Can use GetParam() here. -// } -// virtual ~FooTest() { -// // Can use GetParam() here. -// } -// virtual void SetUp() { -// // Can use GetParam() here. -// } -// virtual void TearDown { -// // Can use GetParam() here. -// } -// }; -// TEST_P(FooTest, DoesBar) { -// // Can use GetParam() method here. -// Foo foo; -// ASSERT_TRUE(foo.DoesBar(GetParam())); -// } -// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); - -template -class WithParamInterface { - public: - typedef T ParamType; - virtual ~WithParamInterface() {} - - // The current parameter value. Is also available in the test fixture's - // constructor. This member function is non-static, even though it only - // references static data, to reduce the opportunity for incorrect uses - // like writing 'WithParamInterface::GetParam()' for a test that - // uses a fixture whose parameter type is int. - const ParamType& GetParam() const { return *parameter_; } - - private: - // Sets parameter value. The caller is responsible for making sure the value - // remains alive and unchanged throughout the current test. - static void SetParam(const ParamType* parameter) { - parameter_ = parameter; - } - - // Static value used for accessing parameter during a test lifetime. - static const ParamType* parameter_; - - // TestClass must be a subclass of WithParamInterface and Test. - template friend class internal::ParameterizedTestFactory; -}; - -template -const T* WithParamInterface::parameter_ = NULL; - -// Most value-parameterized classes can ignore the existence of -// WithParamInterface, and can just inherit from ::testing::TestWithParam. - -template -class TestWithParam : public Test, public WithParamInterface { -}; - -#endif // GTEST_HAS_PARAM_TEST - -// Macros for indicating success/failure in test code. - -// ADD_FAILURE unconditionally adds a failure to the current test. -// SUCCEED generates a success - it doesn't automatically make the -// current test successful, as a test is only successful when it has -// no failure. -// -// EXPECT_* verifies that a certain condition is satisfied. If not, -// it behaves like ADD_FAILURE. In particular: -// -// EXPECT_TRUE verifies that a Boolean condition is true. -// EXPECT_FALSE verifies that a Boolean condition is false. -// -// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except -// that they will also abort the current function on failure. People -// usually want the fail-fast behavior of FAIL and ASSERT_*, but those -// writing data-driven tests often find themselves using ADD_FAILURE -// and EXPECT_* more. -// -// Examples: -// -// EXPECT_TRUE(server.StatusIsOK()); -// ASSERT_FALSE(server.HasPendingRequest(port)) -// << "There are still pending requests " << "on port " << port; - -// Generates a nonfatal failure with a generic message. -#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") - -// Generates a nonfatal failure at the given source file location with -// a generic message. -#define ADD_FAILURE_AT(file, line) \ - GTEST_MESSAGE_AT_(file, line, "Failed", \ - ::testing::TestPartResult::kNonFatalFailure) - -// Generates a fatal failure with a generic message. -#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") - -// Generates a fatal failure with a generic message. -#define GTEST_FORCE_SUCCESS_() GTEST_FATAL_SUCCESS_("Succeed") - -// Define this macro to 1 to omit the definition of FAIL(), which is a -// generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_FAIL -# define FAIL() GTEST_FAIL() -#endif - -//add by qiaoyang 强制置用例成功,直接返回 -#if !GTEST_DONT_DEFINE_Immediately_Succeed -# define FORCE_SUCCESS() GTEST_FORCE_SUCCESS_() -#endif - -// Generates a success with a generic message. -#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") - -// Define this macro to 1 to omit the definition of SUCCEED(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_SUCCEED -# define SUCCEED() GTEST_SUCCEED() -#endif - -// Macros for testing exceptions. -// -// * {ASSERT|EXPECT}_THROW(statement, expected_exception): -// Tests that the statement throws the expected exception. -// * {ASSERT|EXPECT}_NO_THROW(statement): -// Tests that the statement doesn't throw any exception. -// * {ASSERT|EXPECT}_ANY_THROW(statement): -// Tests that the statement throws an exception. - -#define EXPECT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) -#define EXPECT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define EXPECT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define ASSERT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) -#define ASSERT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) -#define ASSERT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) - -// Boolean assertions. Condition can be either a Boolean expression or an -// AssertionResult. For more information on how to use AssertionResult with -// these macros see comments on that class. -#define EXPECT_TRUE(condition) \ - GTEST_TEST_BOOLEAN2_(condition, #condition, false, true, \ - GTEST_NONFATAL_FAILURE_) -#define EXPECT_FALSE(condition) \ - GTEST_TEST_BOOLEAN2_(!(condition), #condition, true, false, \ - GTEST_NONFATAL_FAILURE_) -#define ASSERT_TRUE(condition) \ - GTEST_TEST_BOOLEAN2_(condition, #condition, false, true, \ - GTEST_FATAL_FAILURE_) -#define ASSERT_FALSE(condition) \ - GTEST_TEST_BOOLEAN2_(!(condition), #condition, true, false, \ - GTEST_FATAL_FAILURE_) - -// Includes the auto-generated header that implements a family of -// generic predicate assertion macros. -#include "gtest/gtest_pred_impl.h" - -// Macros for testing equalities and inequalities. -// -// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual -// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 -// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 -// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 -// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 -// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 -// -// When they are not, Google Test prints both the tested expressions and -// their actual values. The values must be compatible built-in types, -// or you will get a compiler error. By "compatible" we mean that the -// values can be compared by the respective operator. -// -// Note: -// -// 1. It is possible to make a user-defined type work with -// {ASSERT|EXPECT}_??(), but that requires overloading the -// comparison operators and is thus discouraged by the Google C++ -// Usage Guide. Therefore, you are advised to use the -// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are -// equal. -// -// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on -// pointers (in particular, C strings). Therefore, if you use it -// with two C strings, you are testing how their locations in memory -// are related, not how their content is related. To compare two C -// strings by content, use {ASSERT|EXPECT}_STR*(). -// -// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to -// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you -// what the actual value is when it fails, and similarly for the -// other comparisons. -// -// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() -// evaluate their arguments, which is undefined. -// -// 5. These macros evaluate their arguments exactly once. -// -// Examples: -// -// EXPECT_NE(5, Foo()); -// EXPECT_EQ(NULL, a_pointer); -// ASSERT_LT(i, array_size); -// ASSERT_GT(records.size(), 0) << "There is no record left."; - -#define EXPECT_EQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define EXPECT_NE(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) -#define EXPECT_LE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define EXPECT_LT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define EXPECT_GE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define EXPECT_GT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -#define GTEST_ASSERT_EQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define GTEST_ASSERT_NE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) -#define GTEST_ASSERT_LE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define GTEST_ASSERT_LT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define GTEST_ASSERT_GE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define GTEST_ASSERT_GT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of -// ASSERT_XY(), which clashes with some users' own code. - -#if !GTEST_DONT_DEFINE_ASSERT_EQ -# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_NE -# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LE -# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LT -# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GE -# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GT -# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) -#endif - -// C String Comparisons. All tests treat NULL and any non-NULL string -// as different. Two NULLs are equal. -// -// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 -// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 -// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case -// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case -// -// For wide or narrow string objects, you can use the -// {ASSERT|EXPECT}_??() macros. -// -// Don't depend on the order in which the arguments are evaluated, -// which is undefined. -// -// These macros evaluate their arguments exactly once. - -#define EXPECT_STREQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define EXPECT_STRNE(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define EXPECT_STRCASEEQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define EXPECT_STRCASENE(s1, s2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -#define ASSERT_STREQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define ASSERT_STRNE(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define ASSERT_STRCASEEQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define ASSERT_STRCASENE(s1, s2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -// Macros for comparing floating-point numbers. -// -// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): -// Tests that two float values are almost equal. -// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): -// Tests that two double values are almost equal. -// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): -// Tests that v1 and v2 are within the given distance to each other. -// -// Google Test uses ULP-based comparison to automatically pick a default -// error bound that is appropriate for the operands. See the -// FloatingPoint template class in gtest-internal.h if you are -// interested in the implementation details. - -#define EXPECT_FLOAT_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_DOUBLE_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_FLOAT_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_DOUBLE_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_NEAR(val1, val2, abs_error)\ - EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -#define ASSERT_NEAR(val1, val2, abs_error)\ - ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -// These predicate format functions work on floating-point values, and -// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. -// -// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, - float val1, float val2); -GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, - double val1, double val2); - - -#if GTEST_OS_WINDOWS - -// Macros that test for HRESULT failure and success, these are only useful -// on Windows, and rely on Windows SDK macros and APIs to compile. -// -// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) -// -// When expr unexpectedly fails or succeeds, Google Test prints the -// expected result and the actual result with both a human-readable -// string representation of the error, if available, as well as the -// hex result code. -# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -#endif // GTEST_OS_WINDOWS - -// Macros that execute statement and check that it doesn't generate new fatal -// failures in the current thread. -// -// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); -// -// Examples: -// -// EXPECT_NO_FATAL_FAILURE(Process()); -// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; -// -#define ASSERT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) -#define EXPECT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) - -// Causes a trace (including the source file path, the current line -// number, and the given message) to be included in every test failure -// message generated by code in the current scope. The effect is -// undone when the control leaves the current scope. -// -// The message argument can be anything streamable to std::ostream. -// -// In the implementation, we include the current line number as part -// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s -// to appear in the same block - as long as they are on different -// lines. -#define SCOPED_TRACE(message) \ - ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ - __FILE__, __LINE__, ::testing::Message() << (message)) - -// Compile-time assertion for type equality. -// StaticAssertTypeEq() compiles iff type1 and type2 are -// the same type. The value it returns is not interesting. -// -// Instead of making StaticAssertTypeEq a class template, we make it a -// function template that invokes a helper class template. This -// prevents a user from misusing StaticAssertTypeEq by -// defining objects of that type. -// -// CAVEAT: -// -// When used inside a method of a class template, -// StaticAssertTypeEq() is effective ONLY IF the method is -// instantiated. For example, given: -// -// template class Foo { -// public: -// void Bar() { testing::StaticAssertTypeEq(); } -// }; -// -// the code: -// -// void Test1() { Foo foo; } -// -// will NOT generate a compiler error, as Foo::Bar() is never -// actually instantiated. Instead, you need: -// -// void Test2() { Foo foo; foo.Bar(); } -// -// to cause a compiler error. -template -bool StaticAssertTypeEq() { - (void)internal::StaticAssertTypeEqHelper(); - return true; -} - -// Defines a test. -// -// The first parameter is the name of the test case, and the second -// parameter is the name of the test within the test case. -// -// The convention is to end the test case name with "Test". For -// example, a test case for the Foo class can be named FooTest. -// -// The user should put his test code between braces after using this -// macro. Example: -// -// TEST(FooTest, InitializesCorrectly) { -// Foo foo; -// EXPECT_TRUE(foo.StatusIsOK()); -// } - -#define POLESTAR_CHECK_FUZZ "\\FUZZ_TestCases\\" -#define POLESTAR_CHECK_STR "\\testcases\\llt\\" -#define POLESTAR_CHECK_HLT "\\testcases\\hlt\\" -#define POLESTAR_TEST_HLT "POLESTAR_HLT" -#define POLESTAR_TEST_LLT "POLESTAR_LLT" -#define POLESTAR_TEST_PCST "POLESTAR_PCST" - -inline const char *get_test_type(char *file_name) -{ - unsigned int loop = 0; - - if (file_name==0) return POLESTAR_TEST_HLT; - - for (loop=0;loop() here to get the type ID of testing::Test. This -// is to work around a suspected linker bug when using Google Test as -// a framework on Mac OS X. The bug causes GetTypeId< -// ::testing::Test>() to return different values depending on whether -// the call is from the Google Test framework itself or from user test -// code. GetTestTypeId() is guaranteed to always return the same -// value, as it always calls GetTypeId<>() from the Google Test -// framework. -#define GTEST_TEST(test_case_name, test_name, ...)\ - GTEST_TEST_(test_case_name, test_name, \ - ::testing::Test, ::testing::internal::GetTestTypeId(), ##__VA_ARGS__) - -// Define this macro to 1 to omit the definition of TEST(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_TEST -# define TEST(test_case_name, test_name, ...) GTEST_TEST(test_case_name, test_name, ##__VA_ARGS__) -#endif - -// Defines a test that uses a test fixture. -// -// The first parameter is the name of the test fixture class, which -// also doubles as the test case name. The second parameter is the -// name of the test within the test case. -// -// A test fixture class must be declared earlier. The user should put -// his test code between braces after using this macro. Example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { b_.AddElement(3); } -// -// Foo a_; -// Foo b_; -// }; -// -// TEST_F(FooTest, InitializesCorrectly) { -// EXPECT_TRUE(a_.StatusIsOK()); -// } -// -// TEST_F(FooTest, ReturnsElementCountCorrectly) { -// EXPECT_EQ(0, a_.size()); -// EXPECT_EQ(1, b_.size()); -// } - -//Autostar add 中文用例名转为测试套名加行号 by xutaiqiang -#if DTCENTER_CN2EN - -#define DT_CH2EN1(test_fixture, LineNo) test_fixture##_Line##LineNo -#define DT_CH2EN(test_fixture, LineNo) DT_CH2EN1(test_fixture, LineNo) - -#define TEST_F(test_fixture, test_name, ...)\ - GTEST_TEST_CH(test_fixture, DT_CH2EN(test_fixture, __LINE__), ##__VA_ARGS__) - -#define GTEST_TEST_CH(test_fixture, test_name, ...)\ - GTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId(), ##__VA_ARGS__) -#else - -#define TEST_F(test_fixture, test_name, ...)\ - GTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId(), ##__VA_ARGS__) -#endif - -// Use this macro in main() to run all tests. It returns 0 if all -// tests are successful, or 1 otherwise. -// -// RUN_ALL_TESTS() should be invoked after the command line has been -// parsed by InitGoogleTest(). - -// modify by dtcenter 2018-04-16 -// for fuzzing testing -#ifdef DT_FUZZ -extern "C" { - typedef int (*GTEST_RunHook)(); -} - -extern "C" __attribute__ ((visibility("default"))) void __gcov_flush(void); -extern "C" int GTEST_Run(); -extern "C" bool FUZZ_NeedRunGlobalSetup(); -extern "C" bool FUZZ_NeedRunTestsuitSetup(const std::string &suitname); -extern "C" bool FUZZ_NeedRunTestcaseSetup(const std::string &casename); -extern "C" bool FUZZ_NeedRunGlobalTeardown(); -extern "C" bool FUZZ_NeedRunTestsuitTeardown(const std::string &suitname); -extern "C" bool FUZZ_NeedRunTestcaseTeardown(const std::string &casename); -extern "C" int FUZZ_Main(GTEST_RunHook run_proc, const std::string &fuzzer_config_file, const std::string &fuzzer_args); -#define RUN_ALL_TESTS()\ - (::testing::FUZZ_Main(::testing::GTEST_Run, GTEST_FLAG(fuzzing_config), GTEST_FLAG(fuzzing_args))) -#else -#define RUN_ALL_TESTS()\ - (::testing::UnitTest::GetInstance()->Run()) -#endif //DT_FUZZ - -//由autostar增加,用于结构体类型的变量比较 -void AssertStructVar(const char *pcFileName, int lLineNum, void *pst1, void *pst2, int lLen ); -void ExpectStructVar(const char *pcFileName, int lLineNum, void *pst1, void *pst2, int lLen , const char *Msg); -// Add By wwj Add Struct Cmp Marco -#define ASSERT_SAME_DATA(Expect, Atual)\ - ::testing::AssertStructVar( __FILE__, __LINE__, (void *)&(Expect), (void *)&(Atual), sizeof(Atual)) -#define ASSERT_SAME_MEMORY(Expect, Atual, Len)\ - ::testing::AssertStructVar( __FILE__, __LINE__, Expect, Atual, Len) -#define EXPECT_SAME_MEMORY(Expect, Atual, Len, Msg)\ - ::testing::ExpectStructVar( __FILE__, __LINE__, Expect, Atual, Len, Msg) - -//函数声明,无需给外部使用的函数声明请在此处增加 -typedef int (*PFUNC)(); -typedef int (*DT_USERPRINT)(const char *, va_list ); - -class RegFunc -{ -public: - static RegFunc* GetInstance(); - //向列表中添加注册函数 - void AddRegFuncCtorList(PFUNC pFuncName); - void AddRegFuncDtorList(PFUNC pFuncName); - //从列表中删除注册的函数 - void DelRegFuncCtorList(PFUNC pFuncName); - void DelRegFuncDtorList(PFUNC pFuncName); - //清空列表,可以中途使用,初始构造函数有调用 - void ClearRegFuncList(); - //获取列表内容 - std::vector GetRegFuncCtorList(); - std::vector GetRegFuncDtorList(); - void RunCtorRegFunc(); - void RunDtorRegFunc(); -private: - RegFunc(); - ~RegFunc(); - std::vector m_RegFuncCtorList; - std::vector m_RegFuncDtorList; - static RegFunc *m_pRegFuncInst; -}; - -bool IsFileExist(const std::string &path); -bool IsDirectoryExist(const std::string &path); -std::string GetApplicationFullPath(); -std::string GetApplicationDir(); -std::string GetApplicationName(); -void SwitchOnTrace(bool bFlag); -void ComprotMsgPrint(bool bFlag); -void Send_Send_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void Send_Recv_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void Send_Expect_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void Send_User_INFO(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void Send_Send_Serial_MSG(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void OpenBaseCompare(bool bFlag); -int BaseCompare(unsigned int ulSource, unsigned int ulLogtype, unsigned int ulDataLen, unsigned char *poctData); -void SetBaseResultDir(char* dir); -void Send_Every_Msg(unsigned int ulSource, unsigned int ulLogtype, unsigned int usDataLen, unsigned char *poctData); -void SendMsgToTracer_INT32(unsigned int ulSource, unsigned int ucProt,unsigned int ucDirection, unsigned int MsgType,unsigned int usDataLen, unsigned char *poctData); -void SendMsgToTracer_INT8(unsigned int ulSource,unsigned int ucProt,unsigned int ucDirection, unsigned char *pstrMsgType,unsigned int usDataLen, unsigned char *poctData); -void SendMsgToTracer_NodeB(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); -void SendMsgToTracer_LTE(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); -void SendMsgToTracer_InnerMsg(unsigned int MsgType,unsigned int SenderCpuId, unsigned int SenderPId,unsigned int RecCpuId,unsigned int RecPId,unsigned int usDataLen,unsigned char *poctData); -void SendMessageToTracer_ServiceMsg( - unsigned int ulSource, - unsigned int SenderServiceId, - unsigned int ReceiverServiceId, - unsigned int ServiceType, // API or ABI - unsigned int ServiceID, // API ID or ABI ID - unsigned int usDataLen, - unsigned char *poctData); -void PrintOnDoc(bool bFlag); -int SendCaseInfoToServer(); -int GetSendMsg(unsigned char **poctData, unsigned int *len); -int GetNodAttribute(char *Caption, char *ArrValue); -extern "C" int DT_CommPrint( char *pcFormat, ... ); -void DT_RegisterUserPrint( DT_USERPRINT pfnUserPrint); -void DT_SetUserXslPath(std::string xslPath); -std::string DT_GetUserXslPath(); - -/*对gtest的初始化操作 -argc、argv:是命令行参数 -bFlag:true表示是结果生成xml文件,默认为false,不生成。 -strIP:是发消息时server的IP地址,默认为本机127.0.0.1。 -注意:后两个参数如果不需要设置可以不用填写。 -*/ -#define SERVERDEFAULTIP "127.0.0.1" -// Returns 0 if all tests passed, or 1 other wise. -int Init_UT(int argc, wchar_t* argv[], bool bFlag = false, std::string strIP = SERVERDEFAULTIP); -int Init_UT(int argc, char* argv[], bool bFlag = false, std::string strIP = SERVERDEFAULTIP); - -//分别向测试用例类 Test的构造函数和析构函数里加入调用的外部函数 -#define ADD_FUNC_TEST_CTOR(name)\ - ::testing::RegFunc::GetInstance()->AddRegFuncCtorList(name) -#define ADD_FUNC_TEST_DTOR(name)\ - ::testing::RegFunc::GetInstance()->AddRegFuncDtorList(name) -//从列表中删除注册的函数 -#define DEL_FUNC_TEST_CTOR(name)\ - ::testing::RegFunc::GetInstance()->DelRegFuncCtorList(name) -#define DEL_FUNC_TEST_DTOR(name)\ - ::testing::RegFunc::GetInstance()->DelRegFuncDtorList(name) -#define GET_FUNC_CTOR_LIST()\ - ::testing::RegFunc::GetInstance()->GetRegFuncCtorList() -#define GET_FUNC_DTOR_LIST()\ - ::testing::RegFunc::GetInstance()->GetRegFuncDtorList() -//用户请勿使用,会导致AMock打桩失败。清除所有注册函数的接口 -#define CLEAR_FUNC_LIST()\ - ::testing::RegFunc::GetInstance()->ClearRegFuncList() - - -/*ulSource枚举宏定义:发送的消息的类型,根据不同的产品来进行扩展*/ -#define UTCENTER 0 /* UT_Center工具发送的消息,包括 */ -#define PRODUCT_RNC12 1 /* RNC12产品消息 */ -#define PRODUCT_LTE 2 /* LTE产品消息 */ -#define PRODUCT_ROSA 3 /* Rosa产品消息 */ -#define PRODUCT_NODEB 4 /* NodeB产品消息 */ -#define PRODUCT_MBSC 5 /* MBSC产品消息 */ -#define PRODUCT_WIMAX 6 /* wimax产品消息 */ -#define PRODUCT_TD 7 /* TD 产品信息 */ -#define PRODUCT_AP 8 /* AP产品信息 */ -#define PRODUCT_TD_RRU 9 /* TD RRU产品信息 */ -#define PRODUCT_RNC_R13 10 /* RNC13产品信息 */ -#define PRODUCT_GBSC 11 /* GBSC产品信息 */ -#define PRODUCT_COMMON 12 /* 适合各个产品的内部消息 */ - -/*ulLogtype枚举宏定义:消息的打印级别*/ -#define DT_PRINTF_INFO 4 /* 用户打印信息*/ -#define DT_PRINTF_ERROR 6 /* 用例错误信息*/ -#define DT_MSG_EXPECT 7 /* 期望接收的消息*/ -#define DT_MSG_SEND 8 /* 用例发送的消息*/ -#define DT_MSG_RECV 9 /* 实际接收的消息*/ -#define DT_MSG_SERIAL 10 /* 实际接收的消息*/ -#define DT_COMPARE_TXT_MSG 11 /* 用于比较的TXT类型的消息*/ -#define DT_COMPARE_BIT_MSG 12 /* 用于比较的BIT类型的消息*/ -#define DT_PRINTF_CPU_INFO 13 /* 打印CPU信息 */ -#define DT_SERVICE_MSG_SEND 14 /* 5G产品发送的服务消息 */ - - -/*ulSource:上面的取值 -usDataLen:数据长度 -poctData:要发送的数据 -*/ - -//添加全局空间 -//设置是否需要跟踪消息,默认为不发送 -//true 为发送 -#define SWITCH_ON_TRACE(bFlag)\ - ::testing::SwitchOnTrace(bFlag); \ - ::testing::OpenBaseCompare(bFlag) - -//串口打印开关 -#define COMPORT_MSG_PRINT(bFlag)\ - ::testing::ComprotMsgPrint(bFlag); - -//Doc界面打印开关,控制正确的用例和测试套是否需要打印到控制台上 -#define PRINT_ON_DOC(bFlag)\ - ::testing::PrintOnDoc(bFlag); - - -#define SEND_SEND_MSG(ulSource, usDataLen, poctData)\ - (::testing::Send_Send_MSG(ulSource, DT_MSG_SEND, usDataLen, (unsigned char *)poctData)) - -#define SEND_RECV_MSG(ulSource, usDataLen, poctData)\ - (::testing::Send_Recv_MSG(ulSource, DT_MSG_RECV, usDataLen, (unsigned char *)poctData)) - -#define SEND_EXPECT_MSG(ulSource, usDataLen, poctData)\ - (::testing::Send_Expect_MSG(ulSource, DT_MSG_EXPECT, usDataLen, (unsigned char *)poctData)) - -#define SEND_USER_INFO(usDataLen, poctData)\ - (::testing::Send_User_INFO(UTCENTER, DT_PRINTF_INFO, usDataLen, (unsigned char *)poctData)) - -#define SEND_SEND_SERIAL_MSG(ulSource, usDataLen, poctData)\ - (::testing::Send_Send_Serial_MSG(ulSource, DT_MSG_SERIAL, usDataLen, (unsigned char *)poctData)) - -//其中compareType为DT_COMPARE_TXT_MSG(文本消息)或DT_COMPARE_BIT_MSG(二进制消息)中的一个 -#define SEND_COMPARE_MSG(ulSource, usDataLen, poctData, compareType)\ - ::testing::BaseCompare(ulSource, compareType, usDataLen, (unsigned char *)poctData);\ - ::testing::Send_Every_Msg(ulSource, compareType, usDataLen, (unsigned char *)poctData) - -#define SET_BASE_DIR(dir) \ - (::testing::SetBaseResultDir(dir)) -#define GET_SEND_MSG(poctData, len)\ - (::testing::GetSendMsg(poctData, len)) - -#define GET_NODE_ATTRITUBE(Caption, ArrValue)\ - (::testing::GetNodAttribute(Caption, ArrValue)) - -#define SEND_MSG_TO_TRACER_INT32(ulSource,ucProt,ucDirection, MsgType,usDataLen,poctData)\ - (::testing::SendMsgToTracer_INT32(ulSource,ucProt,ucDirection, MsgType,usDataLen,poctData)) - -#define SEND_MSG_TO_TRACER_INT8(ulSource,ucProt,ucDirection, pstrMsgType,usDataLen, poctData)\ - (::testing::SendMsgToTracer_INT8(ulSource,ucProt,ucDirection, pstrMsgType,usDataLen, poctData)) - -#define SEND_MSG_TO_TRACER_NODEB(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ - (::testing::SendMsgToTracer_NodeB(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) -#define SEND_MSG_TO_TRACER_LTE(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ - (::testing::SendMsgToTracer_LTE(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) -#define SEND_MSG_TO_TRACER_InnerMsg(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)\ - (::testing::SendMsgToTracer_InnerMsg(MsgType,SenderCpuId,SenderPId,RecCpuId,RecPId,usDataLen,poctData)) - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ diff --git a/cli/test/include/gtest/gtest_pred_impl.h b/cli/test/include/gtest/gtest_pred_impl.h deleted file mode 100644 index f1538b5..0000000 --- a/cli/test/include/gtest/gtest_pred_impl.h +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file is AUTOMATICALLY GENERATED on 09/24/2010 by command -// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! -// -// Implements a family of generic predicate assertion macros. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Makes sure this header is not included before gtest.h. -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ - -// This header implements a family of generic predicate assertion -// macros: -// -// ASSERT_PRED_FORMAT1(pred_format, v1) -// ASSERT_PRED_FORMAT2(pred_format, v1, v2) -// ... -// -// where pred_format is a function or functor that takes n (in the -// case of ASSERT_PRED_FORMATn) values and their source expression -// text, and returns a testing::AssertionResult. See the definition -// of ASSERT_EQ in gtest.h for an example. -// -// If you don't care about formatting, you can use the more -// restrictive version: -// -// ASSERT_PRED1(pred, v1) -// ASSERT_PRED2(pred, v1, v2) -// ... -// -// where pred is an n-ary function or functor that returns bool, -// and the values v1, v2, ..., must support the << operator for -// streaming to std::ostream. -// -// We also define the EXPECT_* variations. -// -// For now we only support predicates whose arity is at most 5. -// Please email googletestframework@googlegroups.com if you need -// support for higher arities. - -// GTEST_ASSERT_ is the basic statement to which all of the assertions -// in this file reduce. Don't use this in your code. - -#define GTEST_ASSERT_(expression, on_failure) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar = (expression)) \ - ; \ - else \ - on_failure(gtest_ar.failure_message()) - -#define GTEST_ASSERT2_(expression, on_failure) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if(++gtest_assert_count_) \ - if (const ::testing::AssertionResult gtest_ar = (expression)) \ - ; \ - else \ - on_failure(gtest_ar.failure_message()) - -// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -template -AssertionResult AssertPred1Helper(const char* pred_text, - const char* e1, - Pred pred, - const T1& v1) { - if (pred(v1)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. -// Don't use this in your code. -#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, v1),\ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -#define GTEST_PRED1_(pred, v1, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ - #v1, \ - pred, \ - v1), on_failure) - -// Unary predicate assertion macros. -#define EXPECT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -template -AssertionResult AssertPred2Helper(const char* pred_text, - const char* e1, - const char* e2, - Pred pred, - const T1& v1, - const T2& v2) { - if (pred(v1, v2)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. -// Don't use this in your code. -#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ - GTEST_ASSERT2_(pred_format(#v1, #v2, v1, v2),\ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -#define GTEST_PRED2_(pred, v1, v2, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ - #v1, \ - #v2, \ - pred, \ - v1, \ - v2), on_failure) - -// Binary predicate assertion macros. -#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -template -AssertionResult AssertPred3Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3) { - if (pred(v1, v2, v3)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. -// Don't use this in your code. -#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - pred, \ - v1, \ - v2, \ - v3), on_failure) - -// Ternary predicate assertion macros. -#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -template -AssertionResult AssertPred4Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4) { - if (pred(v1, v2, v3, v4)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. -// Don't use this in your code. -#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4), on_failure) - -// 4-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -template -AssertionResult AssertPred5Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - const char* e5, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4, - const T5& v5) { - if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ", " - << e5 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4 - << "\n" << e5 << " evaluates to " << v5; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. -// Don't use this in your code. -#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - #v5, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4, \ - v5), on_failure) - -// 5-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) - - - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ diff --git a/cli/test/include/gtest/gtest_prod.h b/cli/test/include/gtest/gtest_prod.h deleted file mode 100644 index da80ddc..0000000 --- a/cli/test/include/gtest/gtest_prod.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Google C++ Testing Framework definitions useful in production code. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ - -// When you need to test the private or protected members of a class, -// use the FRIEND_TEST macro to declare your tests as friends of the -// class. For example: -// -// class MyClass { -// private: -// void MyMethod(); -// FRIEND_TEST(MyClassTest, MyMethod); -// }; -// -// class MyClassTest : public testing::Test { -// // ... -// }; -// -// TEST_F(MyClassTest, MyMethod) { -// // Can call MyClass::MyMethod() here. -// } - -#define FRIEND_TEST(test_case_name, test_name)\ -friend class test_case_name##_##test_name##_Test - -#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/cli/test/include/gtest/internal/gtest-death-test-internal.h b/cli/test/include/gtest/internal/gtest-death-test-internal.h deleted file mode 100644 index 1d9f83b..0000000 --- a/cli/test/include/gtest/internal/gtest-death-test-internal.h +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines internal utilities needed for implementing -// death tests. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - -#include "gtest/internal/gtest-internal.h" - -#include - -namespace testing { -namespace internal { - -GTEST_DECLARE_string_(internal_run_death_test); - -// Names of the flags (needed for parsing Google Test flags). -const char kDeathTestStyleFlag[] = "death_test_style"; -const char kDeathTestUseFork[] = "death_test_use_fork"; -const char kInternalRunDeathTestFlag[] = "internal_run_death_test"; - -#if GTEST_HAS_DEATH_TEST - -// DeathTest is a class that hides much of the complexity of the -// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method -// returns a concrete class that depends on the prevailing death test -// style, as defined by the --gtest_death_test_style and/or -// --gtest_internal_run_death_test flags. - -// In describing the results of death tests, these terms are used with -// the corresponding definitions: -// -// exit status: The integer exit information in the format specified -// by wait(2) -// exit code: The integer code passed to exit(3), _exit(2), or -// returned from main() -class GTEST_API_ DeathTest { - public: - // Create returns false if there was an error determining the - // appropriate action to take for the current death test; for example, - // if the gtest_death_test_style flag is set to an invalid value. - // The LastMessage method will return a more detailed message in that - // case. Otherwise, the DeathTest pointer pointed to by the "test" - // argument is set. If the death test should be skipped, the pointer - // is set to NULL; otherwise, it is set to the address of a new concrete - // DeathTest object that controls the execution of the current test. - static bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); - DeathTest(); - virtual ~DeathTest() { } - - // A helper class that aborts a death test when it's deleted. - class ReturnSentinel { - public: - explicit ReturnSentinel(DeathTest* test) : test_(test) { } - ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } - private: - DeathTest* const test_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); - } GTEST_ATTRIBUTE_UNUSED_; - - // An enumeration of possible roles that may be taken when a death - // test is encountered. EXECUTE means that the death test logic should - // be executed immediately. OVERSEE means that the program should prepare - // the appropriate environment for a child process to execute the death - // test, then wait for it to complete. - enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; - - // An enumeration of the three reasons that a test might be aborted. - enum AbortReason { - TEST_ENCOUNTERED_RETURN_STATEMENT, - TEST_THREW_EXCEPTION, - TEST_DID_NOT_DIE - }; - - // Assumes one of the above roles. - virtual TestRole AssumeRole() = 0; - - // Waits for the death test to finish and returns its status. - virtual int Wait() = 0; - - // Returns true if the death test passed; that is, the test process - // exited during the test, its exit status matches a user-supplied - // predicate, and its stderr output matches a user-supplied regular - // expression. - // The user-supplied predicate may be a macro expression rather - // than a function pointer or functor, or else Wait and Passed could - // be combined. - virtual bool Passed(bool exit_status_ok) = 0; - - // Signals that the death test did not die as expected. - virtual void Abort(AbortReason reason) = 0; - - // Returns a human-readable outcome message regarding the outcome of - // the last death test. - static const char* LastMessage(); - - static void set_last_death_test_message(const String& message); - - private: - // A string containing a description of the outcome of the last death test. - static String last_death_test_message_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); -}; - -// Factory interface for death tests. May be mocked out for testing. -class DeathTestFactory { - public: - virtual ~DeathTestFactory() { } - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test) = 0; -}; - -// A concrete DeathTestFactory implementation for normal use. -class DefaultDeathTestFactory : public DeathTestFactory { - public: - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); -}; - -// Returns true if exit_status describes a process that was terminated -// by a signal, or exited normally with a nonzero exit code. -GTEST_API_ bool ExitedUnsuccessfully(int exit_status); - -// Traps C++ exceptions escaping statement and reports them as test -// failures. Note that trapping SEH exceptions is not implemented here. -# if GTEST_HAS_EXCEPTIONS -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } catch (const ::std::exception& gtest_exception) { \ - fprintf(\ - stderr, \ - "\n%s: Caught std::exception-derived exception escaping the " \ - "death test statement. Exception message: %s\n", \ - ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ - gtest_exception.what()); \ - fflush(stderr); \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } catch (...) { \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } - -# else -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) - -# endif - -// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, -// ASSERT_EXIT*, and EXPECT_EXIT*. -# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - const ::testing::internal::RE& gtest_regex = (regex); \ - ::testing::internal::DeathTest* gtest_dt; \ - if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ - __FILE__, __LINE__, >est_dt)) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - if (gtest_dt != NULL) { \ - ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ - gtest_dt_ptr(gtest_dt); \ - switch (gtest_dt->AssumeRole()) { \ - case ::testing::internal::DeathTest::OVERSEE_TEST: \ - if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - break; \ - case ::testing::internal::DeathTest::EXECUTE_TEST: { \ - ::testing::internal::DeathTest::ReturnSentinel \ - gtest_sentinel(gtest_dt); \ - GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ - gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ - break; \ - } \ - default: \ - break; \ - } \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ - fail(::testing::internal::DeathTest::LastMessage()) -// The symbol "fail" here expands to something into which a message -// can be streamed. - -// A class representing the parsed contents of the -// --gtest_internal_run_death_test flag, as it existed when -// RUN_ALL_TESTS was called. -class InternalRunDeathTestFlag { - public: - InternalRunDeathTestFlag(const String& a_file, - int a_line, - int an_index, - int a_write_fd) - : file_(a_file), line_(a_line), index_(an_index), - write_fd_(a_write_fd) {} - - ~InternalRunDeathTestFlag() { - if (write_fd_ >= 0) - posix::Close(write_fd_); - } - - String file() const { return file_; } - int line() const { return line_; } - int index() const { return index_; } - int write_fd() const { return write_fd_; } - - private: - String file_; - int line_; - int index_; - int write_fd_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); -}; - -// Returns a newly created InternalRunDeathTestFlag object with fields -// initialized from the GTEST_FLAG(internal_run_death_test) flag if -// the flag is specified; otherwise returns NULL. -InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() - -#endif // GTEST_HAS_DEATH_TEST - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ diff --git a/cli/test/include/gtest/internal/gtest-filepath.h b/cli/test/include/gtest/internal/gtest-filepath.h deleted file mode 100644 index b36b3cf..0000000 --- a/cli/test/include/gtest/internal/gtest-filepath.h +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: keith.ray@gmail.com (Keith Ray) -// -// Google Test filepath utilities -// -// This header file declares classes and functions used internally by -// Google Test. They are subject to change without notice. -// -// This file is #included in . -// Do not include this header file separately! - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ - -#include "gtest/internal/gtest-string.h" - -namespace testing { -namespace internal { - -// FilePath - a class for file and directory pathname manipulation which -// handles platform-specific conventions (like the pathname separator). -// Used for helper functions for naming files in a directory for xml output. -// Except for Set methods, all methods are const or static, which provides an -// "immutable value object" -- useful for peace of mind. -// A FilePath with a value ending in a path separator ("like/this/") represents -// a directory, otherwise it is assumed to represent a file. In either case, -// it may or may not represent an actual file or directory in the file system. -// Names are NOT checked for syntax correctness -- no checking for illegal -// characters, malformed paths, etc. - -class GTEST_API_ FilePath { - public: - FilePath() : pathname_("") { } - FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } - - explicit FilePath(const char* pathname) : pathname_(pathname) { - Normalize(); - } - - explicit FilePath(const String& pathname) : pathname_(pathname) { - Normalize(); - } - - FilePath& operator=(const FilePath& rhs) { - Set(rhs); - return *this; - } - - void Set(const FilePath& rhs) { - pathname_ = rhs.pathname_; - } - - String ToString() const { return pathname_; } - const char* c_str() const { return pathname_.c_str(); } - - // Returns the current working directory, or "" if unsuccessful. - static FilePath GetCurrentDir(); - - // Given directory = "dir", base_name = "test", number = 0, - // extension = "xml", returns "dir/test.xml". If number is greater - // than zero (e.g., 12), returns "dir/test_12.xml". - // On Windows platform, uses \ as the separator rather than /. - static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); - - // Given directory = "dir", relative_path = "test.xml", - // returns "dir/test.xml". - // On Windows, uses \ as the separator rather than /. - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); - - // Returns a pathname for a file that does not currently exist. The pathname - // will be directory/base_name.extension or - // directory/base_name_.extension if directory/base_name.extension - // already exists. The number will be incremented until a pathname is found - // that does not already exist. - // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. - // There could be a race condition if two or more processes are calling this - // function at the same time -- they could both pick the same filename. - static FilePath GenerateUniqueFileName(const FilePath& directory, - const FilePath& base_name, - const char* extension); - - // Returns true iff the path is NULL or "". - bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; } - - // If input name has a trailing separator character, removes it and returns - // the name, otherwise return the name string unmodified. - // On Windows platform, uses \ as the separator, other platforms use /. - FilePath RemoveTrailingPathSeparator() const; - - // Returns a copy of the FilePath with the directory part removed. - // Example: FilePath("path/to/file").RemoveDirectoryName() returns - // FilePath("file"). If there is no directory part ("just_a_file"), it returns - // the FilePath unmodified. If there is no file part ("just_a_dir/") it - // returns an empty FilePath (""). - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveDirectoryName() const; - - // RemoveFileName returns the directory path with the filename removed. - // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". - // If the FilePath is "a_file" or "/a_file", RemoveFileName returns - // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does - // not have a file, like "just/a/dir/", it returns the FilePath unmodified. - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveFileName() const; - - // Returns a copy of the FilePath with the case-insensitive extension removed. - // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns - // FilePath("dir/file"). If a case-insensitive extension is not - // found, returns a copy of the original FilePath. - FilePath RemoveExtension(const char* extension) const; - - // Creates directories so that path exists. Returns true if successful or if - // the directories already exist; returns false if unable to create - // directories for any reason. Will also return false if the FilePath does - // not represent a directory (that is, it doesn't end with a path separator). - bool CreateDirectoriesRecursively() const; - - // Create the directory so that path exists. Returns true if successful or - // if the directory already exists; returns false if unable to create the - // directory for any reason, including if the parent directory does not - // exist. Not named "CreateDirectory" because that's a macro on Windows. - bool CreateFolder() const; - - // Returns true if FilePath describes something in the file-system, - // either a file, directory, or whatever, and that something exists. - bool FileOrDirectoryExists() const; - - // Returns true if pathname describes a directory in the file-system - // that exists. - bool DirectoryExists() const; - - // Returns true if FilePath ends with a path separator, which indicates that - // it is intended to represent a directory. Returns false otherwise. - // This does NOT check that a directory (or file) actually exists. - bool IsDirectory() const; - - // Returns true if pathname describes a root directory. (Windows has one - // root directory per disk drive.) - bool IsRootDirectory() const; - - // Returns true if pathname describes an absolute path. - bool IsAbsolutePath() const; - - private: - // Replaces multiple consecutive separators with a single separator. - // For example, "bar///foo" becomes "bar/foo". Does not eliminate other - // redundancies that might be in a pathname involving "." or "..". - // - // A pathname with multiple consecutive separators may occur either through - // user error or as a result of some scripts or APIs that generate a pathname - // with a trailing separator. On other platforms the same API or script - // may NOT generate a pathname with a trailing "/". Then elsewhere that - // pathname may have another "/" and pathname components added to it, - // without checking for the separator already being there. - // The script language and operating system may allow paths like "foo//bar" - // but some of the functions in FilePath will not handle that correctly. In - // particular, RemoveTrailingPathSeparator() only removes one separator, and - // it is called in CreateDirectoriesRecursively() assuming that it will change - // a pathname from directory syntax (trailing separator) to filename syntax. - // - // On Windows this method also replaces the alternate path separator '/' with - // the primary path separator '\\', so that for example "bar\\/\\foo" becomes - // "bar\\foo". - - void Normalize(); - - // Returns a pointer to the last occurence of a valid path separator in - // the FilePath. On Windows, for example, both '/' and '\' are valid path - // separators. Returns NULL if no path separator was found. - const char* FindLastPathSeparator() const; - - String pathname_; -}; // class FilePath - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ diff --git a/cli/test/include/gtest/internal/gtest-internal.h b/cli/test/include/gtest/internal/gtest-internal.h deleted file mode 100644 index 691a202..0000000 --- a/cli/test/include/gtest/internal/gtest-internal.h +++ /dev/null @@ -1,1280 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares functions and macros used internally by -// Google Test. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ - -#include "gtest/internal/gtest-port.h" - -#if GTEST_OS_LINUX -# include -# include -# include -# include -#endif // GTEST_OS_LINUX - -#include -#include -#include -#include -#include - -#include "gtest/internal/gtest-string.h" -#include "gtest/internal/gtest-filepath.h" -#include "gtest/internal/gtest-type-util.h" - -// Due to C++ preprocessor weirdness, we need double indirection to -// concatenate two tokens when one of them is __LINE__. Writing -// -// foo ## __LINE__ -// -// will result in the token foo__LINE__, instead of foo followed by -// the current line number. For more details, see -// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 -#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) -#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar - -// Google Test defines the testing::Message class to allow construction of -// test messages via the << operator. The idea is that anything -// streamable to std::ostream can be streamed to a testing::Message. -// This allows a user to use his own types in Google Test assertions by -// overloading the << operator. -// -// util/gtl/stl_logging-inl.h overloads << for STL containers. These -// overloads cannot be defined in the std namespace, as that will be -// undefined behavior. Therefore, they are defined in the global -// namespace instead. -// -// C++'s symbol lookup rule (i.e. Koenig lookup) says that these -// overloads are visible in either the std namespace or the global -// namespace, but not other namespaces, including the testing -// namespace which Google Test's Message class is in. -// -// To allow STL containers (and other types that has a << operator -// defined in the global namespace) to be used in Google Test assertions, -// testing::Message must access the custom << operator from the global -// namespace. Hence this helper function. -// -// Note: Jeffrey Yasskin suggested an alternative fix by "using -// ::operator<<;" in the definition of Message's operator<<. That fix -// doesn't require a helper function, but unfortunately doesn't -// compile with MSVC. -template -inline void GTestStreamToHelper(std::ostream* os, const T& val) { - *os << val; -} - -class ProtocolMessage; -namespace proto2 { class Message; } - -namespace testing { - -// Forward declarations. - -class AssertionResult; // Result of an assertion. -class Message; // Represents a failure message. -class Test; // Represents a test. -class TestInfo; // Information about a test. -class TestPartResult; // Result of a test part. -class UnitTest; // A collection of test cases. - -template -::std::string PrintToString(const T& value); - -namespace internal { - -struct TraceInfo; // Information about a trace point. -class ScopedTrace; // Implements scoped trace. -class TestInfoImpl; // Opaque implementation of TestInfo -class UnitTestImpl; // Opaque implementation of UnitTest - -// How many times InitGoogleTest() has been called. -extern int g_init_gtest_count; - -// The text used in failure messages to indicate the start of the -// stack trace. -GTEST_API_ extern const char kStackTraceMarker[]; - -// A secret type that Google Test users don't know about. It has no -// definition on purpose. Therefore it's impossible to create a -// Secret object, which is what we want. -class Secret; - -// Two overloaded helpers for checking at compile time whether an -// expression is a null pointer literal (i.e. NULL or any 0-valued -// compile-time integral constant). Their return values have -// different sizes, so we can use sizeof() to test which version is -// picked by the compiler. These helpers have no implementations, as -// we only need their signatures. -// -// Given IsNullLiteralHelper(x), the compiler will pick the first -// version if x can be implicitly converted to Secret*, and pick the -// second version otherwise. Since Secret is a secret and incomplete -// type, the only expression a user can write that has type Secret* is -// a null pointer literal. Therefore, we know that x is a null -// pointer literal if and only if the first version is picked by the -// compiler. -char IsNullLiteralHelper(Secret* p); -char (&IsNullLiteralHelper(...))[2]; // NOLINT - -// A compile-time bool constant that is true if and only if x is a -// null pointer literal (i.e. NULL or any 0-valued compile-time -// integral constant). -#ifdef GTEST_ELLIPSIS_NEEDS_POD_ -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_IS_NULL_LITERAL_(x) false -#else -# define GTEST_IS_NULL_LITERAL_(x) \ - (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) -#endif // GTEST_ELLIPSIS_NEEDS_POD_ - -// Appends the user-supplied message to the Google-Test-generated message. -GTEST_API_ String AppendUserMessage(const String& gtest_msg, - const Message& user_msg); - -// A helper class for creating scoped traces in user programs. -class GTEST_API_ ScopedTrace { - public: - // The c'tor pushes the given source file location and message onto - // a trace stack maintained by Google Test. - ScopedTrace(const char* file, int line, const Message& message); - - // The d'tor pops the info pushed by the c'tor. - // - // Note that the d'tor is not virtual in order to be efficient. - // Don't inherit from ScopedTrace! - ~ScopedTrace(); - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. - -// Converts a streamable value to a String. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". -// Declared here but defined in gtest.h, so that it has access -// to the definition of the Message class, required by the ARM -// compiler. -template -String StreamableToString(const T& streamable); - -// The Symbian compiler has a bug that prevents it from selecting the -// correct overload of FormatForComparisonFailureMessage (see below) -// unless we pass the first argument by reference. If we do that, -// however, Visual Age C++ 10.1 generates a compiler error. Therefore -// we only apply the work-around for Symbian. -#if defined(__SYMBIAN32__) -# define GTEST_CREF_WORKAROUND_ const& -#else -# define GTEST_CREF_WORKAROUND_ -#endif - -// When this operand is a const char* or char*, if the other operand -// is a ::std::string or ::string, we print this operand as a C string -// rather than a pointer (we do the same for wide strings); otherwise -// we print it as a pointer to be safe. - -// This internal macro is used to avoid duplicated code. -#define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\ -inline String FormatForComparisonFailureMessage(\ - operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ - const operand2_type& /*operand2*/) {\ - return operand1_printer(str);\ -}\ -inline String FormatForComparisonFailureMessage(\ - const operand2_type::value_type* GTEST_CREF_WORKAROUND_ str, \ - const operand2_type& /*operand2*/) {\ - return operand1_printer(str);\ -} - -GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted) -#if GTEST_HAS_STD_WSTRING -GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted) -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_STRING -GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted) -#endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted) -#endif // GTEST_HAS_GLOBAL_WSTRING - -#undef GTEST_FORMAT_IMPL_ - -// The next four overloads handle the case where the operand being -// printed is a char/wchar_t pointer and the other operand is not a -// string/wstring object. In such cases, we just print the operand as -// a pointer to be safe. -#define GTEST_FORMAT_CHAR_PTR_IMPL_(CharType) \ - template \ - String FormatForComparisonFailureMessage(CharType* GTEST_CREF_WORKAROUND_ p, \ - const T&) { \ - return PrintToString(static_cast(p)); \ - } - -GTEST_FORMAT_CHAR_PTR_IMPL_(char) -GTEST_FORMAT_CHAR_PTR_IMPL_(const char) -GTEST_FORMAT_CHAR_PTR_IMPL_(wchar_t) -GTEST_FORMAT_CHAR_PTR_IMPL_(const wchar_t) - -#undef GTEST_FORMAT_CHAR_PTR_IMPL_ - -// Constructs and returns the message for an equality assertion -// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. -// -// The first four parameters are the expressions used in the assertion -// and their values, as strings. For example, for ASSERT_EQ(foo, bar) -// where foo is 5 and bar is 6, we have: -// -// expected_expression: "foo" -// actual_expression: "bar" -// expected_value: "5" -// actual_value: "6" -// -// The ignoring_case parameter is true iff the assertion is a -// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will -// be inserted into the message. -GTEST_API_ AssertionResult EqFailure(const char* expected_expression, - const char* actual_expression, - const String& expected_value, - const String& actual_value, - bool ignoring_case); - -// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. -GTEST_API_ String GetBoolAssertionFailureMessage( - const AssertionResult& assertion_result, - const char* expression_text, - const char* actual_predicate_value, - const char* expected_predicate_value); - -// This template class represents an IEEE floating-point number -// (either single-precision or double-precision, depending on the -// template parameters). -// -// The purpose of this class is to do more sophisticated number -// comparison. (Due to round-off error, etc, it's very unlikely that -// two floating-points will be equal exactly. Hence a naive -// comparison by the == operation often doesn't work.) -// -// Format of IEEE floating-point: -// -// The most-significant bit being the leftmost, an IEEE -// floating-point looks like -// -// sign_bit exponent_bits fraction_bits -// -// Here, sign_bit is a single bit that designates the sign of the -// number. -// -// For float, there are 8 exponent bits and 23 fraction bits. -// -// For double, there are 11 exponent bits and 52 fraction bits. -// -// More details can be found at -// http://en.wikipedia.org/wiki/IEEE_floating-point_standard. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -template -class FloatingPoint { - public: - // Defines the unsigned integer type that has the same size as the - // floating point number. - typedef typename TypeWithSize::UInt Bits; - - // Constants. - - // # of bits in a number. - static const size_t kBitCount = 8*sizeof(RawType); - - // # of fraction bits in a number. - static const size_t kFractionBitCount = - std::numeric_limits::digits - 1; - - // # of exponent bits in a number. - static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; - - // The mask for the sign bit. - static const Bits kSignBitMask = static_cast(1) << (kBitCount - 1); - - // The mask for the fraction bits. - static const Bits kFractionBitMask = - ~static_cast(0) >> (kExponentBitCount + 1); - - // The mask for the exponent bits. - static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); - - // How many ULP's (Units in the Last Place) we want to tolerate when - // comparing two numbers. The larger the value, the more error we - // allow. A 0 value means that two numbers must be exactly the same - // to be considered equal. - // - // The maximum error of a single floating-point operation is 0.5 - // units in the last place. On Intel CPU's, all floating-point - // calculations are done with 80-bit precision, while double has 64 - // bits. Therefore, 4 should be enough for ordinary use. - // - // See the following article for more details on ULP: - // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm. - static const size_t kMaxUlps = 4; - - // Constructs a FloatingPoint from a raw floating-point number. - // - // On an Intel CPU, passing a non-normalized NAN (Not a Number) - // around may change its bits, although the new value is guaranteed - // to be also a NAN. Therefore, don't expect this constructor to - // preserve the bits in x when x is a NAN. - explicit FloatingPoint(const RawType& x) { u_.value_ = x; } - - // Static methods - - // Reinterprets a bit pattern as a floating-point number. - // - // This function is needed to test the AlmostEquals() method. - static RawType ReinterpretBits(const Bits bits) { - FloatingPoint fp(0); - fp.u_.bits_ = bits; - return fp.u_.value_; - } - - // Returns the floating-point number that represent positive infinity. - static RawType Infinity() { - return ReinterpretBits(kExponentBitMask); - } - - // Non-static methods - - // Returns the bits that represents this number. - const Bits &bits() const { return u_.bits_; } - - // Returns the exponent bits of this number. - Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } - - // Returns the fraction bits of this number. - Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } - - // Returns the sign bit of this number. - Bits sign_bit() const { return kSignBitMask & u_.bits_; } - - // Returns true iff this is NAN (not a number). - bool is_nan() const { - // It's a NAN if the exponent bits are all ones and the fraction - // bits are not entirely zeros. - return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); - } - - // Returns true iff this number is at most kMaxUlps ULP's away from - // rhs. In particular, this function: - // - // - returns false if either number is (or both are) NAN. - // - treats really large numbers as almost equal to infinity. - // - thinks +0.0 and -0.0 are 0 DLP's apart. - bool AlmostEquals(const FloatingPoint& rhs) const { - // The IEEE standard says that any comparison operation involving - // a NAN must return false. - if (is_nan() || rhs.is_nan()) return false; - - return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) - <= kMaxUlps; - } - - private: - // The data type used to store the actual floating-point number. - union FloatingPointUnion { - RawType value_; // The raw floating-point number. - Bits bits_; // The bits that represent the number. - }; - - // Converts an integer from the sign-and-magnitude representation to - // the biased representation. More precisely, let N be 2 to the - // power of (kBitCount - 1), an integer x is represented by the - // unsigned number x + N. - // - // For instance, - // - // -N + 1 (the most negative number representable using - // sign-and-magnitude) is represented by 1; - // 0 is represented by N; and - // N - 1 (the biggest number representable using - // sign-and-magnitude) is represented by 2N - 1. - // - // Read http://en.wikipedia.org/wiki/Signed_number_representations - // for more details on signed number representations. - static Bits SignAndMagnitudeToBiased(const Bits &sam) { - if (kSignBitMask & sam) { - // sam represents a negative number. - return ~sam + 1; - } else { - // sam represents a positive number. - return kSignBitMask | sam; - } - } - - // Given two numbers in the sign-and-magnitude representation, - // returns the distance between them as an unsigned number. - static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, - const Bits &sam2) { - const Bits biased1 = SignAndMagnitudeToBiased(sam1); - const Bits biased2 = SignAndMagnitudeToBiased(sam2); - return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); - } - - FloatingPointUnion u_; -}; - -// Typedefs the instances of the FloatingPoint template class that we -// care to use. -typedef FloatingPoint Float; -typedef FloatingPoint Double; - -// In order to catch the mistake of putting tests that use different -// test fixture classes in the same test case, we need to assign -// unique IDs to fixture classes and compare them. The TypeId type is -// used to hold such IDs. The user should treat TypeId as an opaque -// type: the only operation allowed on TypeId values is to compare -// them for equality using the == operator. -typedef const void* TypeId; - -template -class TypeIdHelper { - public: - // dummy_ must not have a const type. Otherwise an overly eager - // compiler (e.g. MSVC 7.1 & 8.0) may try to merge - // TypeIdHelper::dummy_ for different Ts as an "optimization". - static bool dummy_; -}; - -template -bool TypeIdHelper::dummy_ = false; - -// GetTypeId() returns the ID of type T. Different values will be -// returned for different types. Calling the function twice with the -// same type argument is guaranteed to return the same ID. -template -TypeId GetTypeId() { - // The compiler is required to allocate a different - // TypeIdHelper::dummy_ variable for each T used to instantiate - // the template. Therefore, the address of dummy_ is guaranteed to - // be unique. - return &(TypeIdHelper::dummy_); -} - -// Returns the type ID of ::testing::Test. Always call this instead -// of GetTypeId< ::testing::Test>() to get the type ID of -// ::testing::Test, as the latter may give the wrong result due to a -// suspected linker bug when compiling Google Test as a Mac OS X -// framework. -GTEST_API_ TypeId GetTestTypeId(); - -// Defines the abstract factory interface that creates instances -// of a Test object. -class TestFactoryBase { - public: - virtual ~TestFactoryBase() {} - - // Creates a test instance to run. The instance is both created and destroyed - // within TestInfoImpl::Run() - virtual Test* CreateTest() = 0; - - protected: - TestFactoryBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); -}; - -// This class provides implementation of TeastFactoryBase interface. -// It is used in TEST and TEST_F macros. -template -class TestFactoryImpl : public TestFactoryBase { - public: - virtual Test* CreateTest() { return new TestClass; } -}; - -#if GTEST_OS_WINDOWS - -// Predicate-formatters for implementing the HRESULT checking macros -// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} -// We pass a long instead of HRESULT to avoid causing an -// include dependency for the HRESULT type. -GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, - long hr); // NOLINT -GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, - long hr); // NOLINT - -#endif // GTEST_OS_WINDOWS - -// Types of SetUpTestCase() and TearDownTestCase() functions. -typedef void (*SetUpTestCaseFunc)(); -typedef void (*TearDownTestCaseFunc)(); - -// Creates a new TestInfo object and registers it with Google Test; -// returns the created object. -// -// Arguments: -// -// test_case_name: name of the test case -// name: name of the test -// type_param the name of the test's type parameter, or NULL if -// this is not a typed or a type-parameterized test. -// value_param text representation of the test's value parameter, -// or NULL if this is not a type-parameterized test. -// fixture_class_id: ID of the test fixture class -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -// factory: pointer to the factory that creates a test object. -// The newly created TestInfo instance will assume -// ownership of the factory object. -GTEST_API_ TestInfo* MakeAndRegisterTestInfo( - const char* test_case_name, const char* name, - const char* type_param, - const char* value_param, - TypeId fixture_class_id, - SetUpTestCaseFunc set_up_tc, - TearDownTestCaseFunc tear_down_tc, - TestFactoryBase* factory, - std::string sFilePath, - int iLine, - const char* name_id = ""); - -// If *pstr starts with the given prefix, modifies *pstr to be right -// past the prefix and returns true; otherwise leaves *pstr unchanged -// and returns false. None of pstr, *pstr, and prefix can be NULL. -GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// State of the definition of a type-parameterized test case. -class GTEST_API_ TypedTestCasePState { - public: - TypedTestCasePState() : registered_(false) {} - - // Adds the given test name to defined_test_names_ and return true - // if the test case hasn't been registered; otherwise aborts the - // program. - bool AddTestName(const char* file, int line, const char* case_name, - const char* test_name) { - if (registered_) { - fprintf(stderr, "%s Test %s must be defined before " - "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n", - FormatFileLocation(file, line).c_str(), test_name, case_name); - fflush(stderr); - posix::Abort(); - } - defined_test_names_.insert(test_name); - return true; - } - - // Verifies that registered_tests match the test names in - // defined_test_names_; returns registered_tests if successful, or - // aborts the program otherwise. - const char* VerifyRegisteredTestNames( - const char* file, int line, const char* registered_tests); - - private: - bool registered_; - ::std::set defined_test_names_; -}; - -// Skips to the first non-space char after the first comma in 'str'; -// returns NULL if no comma is found in 'str'. -inline const char* SkipComma(const char* str) { - const char* comma = strchr(str, ','); - if (comma == NULL) { - return NULL; - } - while (IsSpace(*(++comma))) {} - return comma; -} - -// Returns the prefix of 'str' before the first comma in it; returns -// the entire string if it contains no comma. -inline String GetPrefixUntilComma(const char* str) { - const char* comma = strchr(str, ','); - return comma == NULL ? String(str) : String(str, comma - str); -} - -// TypeParameterizedTest::Register() -// registers a list of type-parameterized tests with Google Test. The -// return value is insignificant - we just need to return something -// such that we can call this function in a namespace scope. -// -// Implementation note: The GTEST_TEMPLATE_ macro declares a template -// template parameter. It's defined in gtest-type-util.h. -template -class TypeParameterizedTest { - public: - // 'index' is the index of the test in the type list 'Types' - // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, - // Types). Valid values for 'index' are [0, N - 1] where N is the - // length of Types. - static bool Register(const char* prefix, const char* case_name, - const char* test_names, int index) { - typedef typename Types::Head Type; - typedef Fixture FixtureClass; - typedef typename GTEST_BIND_(TestSel, Type) TestClass; - - // First, registers the first type-parameterized test in the type - // list. - MakeAndRegisterTestInfo( - String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/", - case_name, index).c_str(), - GetPrefixUntilComma(test_names).c_str(), - GetTypeName().c_str(), - NULL, // No value parameter. - GetTypeId(), - TestClass::SetUpTestCase, - TestClass::TearDownTestCase, - new TestFactoryImpl); - - // Next, recurses (at compile time) with the tail of the type list. - return TypeParameterizedTest - ::Register(prefix, case_name, test_names, index + 1); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTest { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/, int /*index*/) { - return true; - } -}; - -// TypeParameterizedTestCase::Register() -// registers *all combinations* of 'Tests' and 'Types' with Google -// Test. The return value is insignificant - we just need to return -// something such that we can call this function in a namespace scope. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* prefix, const char* case_name, - const char* test_names) { - typedef typename Tests::Head Head; - - // First, register the first test in 'Test' for each type in 'Types'. - TypeParameterizedTest::Register( - prefix, case_name, test_names, 0); - - // Next, recurses (at compile time) with the tail of the test list. - return TypeParameterizedTestCase - ::Register(prefix, case_name, SkipComma(test_names)); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/) { - return true; - } -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// Returns the current OS stack trace as a String. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in -// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test, - int skip_count); - -// Helpers for suppressing warnings on unreachable code or constant -// condition. - -// Always returns true. -GTEST_API_ bool AlwaysTrue(); - -// Always returns false. -inline bool AlwaysFalse() { return !AlwaysTrue(); } - -// Helper for suppressing false warning from Clang on a const char* -// variable declared in a conditional expression always being NULL in -// the else branch. -struct GTEST_API_ ConstCharPtr { - ConstCharPtr(const char* str) : value(str) {} - operator bool() const { return true; } - const char* value; -}; - -// A simple Linear Congruential Generator for generating random -// numbers with a uniform distribution. Unlike rand() and srand(), it -// doesn't use global state (and therefore can't interfere with user -// code). Unlike rand_r(), it's portable. An LCG isn't very random, -// but it's good enough for our purposes. -class GTEST_API_ Random { - public: - static const UInt32 kMaxRange = 1u << 31; - - explicit Random(UInt32 seed) : state_(seed) {} - - void Reseed(UInt32 seed) { state_ = seed; } - - // Generates a random number from [0, range). Crashes if 'range' is - // 0 or greater than kMaxRange. - UInt32 Generate(UInt32 range); - - private: - UInt32 state_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); -}; - -// Defining a variable of type CompileAssertTypesEqual will cause a -// compiler error iff T1 and T2 are different types. -template -struct CompileAssertTypesEqual; - -template -struct CompileAssertTypesEqual { -}; - -// Removes the reference from a type if it is a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::remove_reference, which is not widely available yet. -template -struct RemoveReference { typedef T type; }; // NOLINT -template -struct RemoveReference { typedef T type; }; // NOLINT - -// A handy wrapper around RemoveReference that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_REFERENCE_(T) \ - typename ::testing::internal::RemoveReference::type - -// Removes const from a type if it is a const type, otherwise leaves -// it unchanged. This is the same as tr1::remove_const, which is not -// widely available yet. -template -struct RemoveConst { typedef T type; }; // NOLINT -template -struct RemoveConst { typedef T type; }; // NOLINT - -// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above -// definition to fail to remove the const in 'const int[3]' and 'const -// char[3][4]'. The following specialization works around the bug. -// However, it causes trouble with GCC and thus needs to be -// conditionally compiled. -#if defined(_MSC_VER) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; -#endif - -// A handy wrapper around RemoveConst that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_CONST_(T) \ - typename ::testing::internal::RemoveConst::type - -// Turns const U&, U&, const U, and U all into U. -#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ - GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) - -// Adds reference to a type if it is not a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::add_reference, which is not widely available yet. -template -struct AddReference { typedef T& type; }; // NOLINT -template -struct AddReference { typedef T& type; }; // NOLINT - -// A handy wrapper around AddReference that works when the argument T -// depends on template parameters. -#define GTEST_ADD_REFERENCE_(T) \ - typename ::testing::internal::AddReference::type - -// Adds a reference to const on top of T as necessary. For example, -// it transforms -// -// char ==> const char& -// const char ==> const char& -// char& ==> const char& -// const char& ==> const char& -// -// The argument T must depend on some template parameters. -#define GTEST_REFERENCE_TO_CONST_(T) \ - GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) - -// ImplicitlyConvertible::value is a compile-time bool -// constant that's true iff type From can be implicitly converted to -// type To. -template -class ImplicitlyConvertible { - private: - // We need the following helper functions only for their types. - // They have no implementations. - - // MakeFrom() is an expression whose type is From. We cannot simply - // use From(), as the type From may not have a public default - // constructor. - static From MakeFrom(); - - // These two functions are overloaded. Given an expression - // Helper(x), the compiler will pick the first version if x can be - // implicitly converted to type To; otherwise it will pick the - // second version. - // - // The first version returns a value of size 1, and the second - // version returns a value of size 2. Therefore, by checking the - // size of Helper(x), which can be done at compile time, we can tell - // which version of Helper() is used, and hence whether x can be - // implicitly converted to type To. - static char Helper(To); - static char (&Helper(...))[2]; // NOLINT - - // We have to put the 'public' section after the 'private' section, - // or MSVC refuses to compile the code. - public: - // MSVC warns about implicitly converting from double to int for - // possible loss of data, so we need to temporarily disable the - // warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4244) // Temporarily disables warning 4244. - - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -# pragma warning(pop) // Restores the warning state. -#elif defined(__BORLANDC__) - // C++Builder cannot use member overload resolution during template - // instantiation. The simplest workaround is to use its C++0x type traits - // functions (C++Builder 2009 and above only). - static const bool value = __is_convertible(From, To); -#else - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -#endif // _MSV_VER -}; -template -const bool ImplicitlyConvertible::value; - -// IsAProtocolMessage::value is a compile-time bool constant that's -// true iff T is type ProtocolMessage, proto2::Message, or a subclass -// of those. -template -struct IsAProtocolMessage - : public bool_constant< - ImplicitlyConvertible::value || - ImplicitlyConvertible::value> { -}; - -// When the compiler sees expression IsContainerTest(0), if C is an -// STL-style container class, the first overload of IsContainerTest -// will be viable (since both C::iterator* and C::const_iterator* are -// valid types and NULL can be implicitly converted to them). It will -// be picked over the second overload as 'int' is a perfect match for -// the type of argument 0. If C::iterator or C::const_iterator is not -// a valid type, the first overload is not viable, and the second -// overload will be picked. Therefore, we can determine whether C is -// a container class by checking the type of IsContainerTest(0). -// The value of the expression is insignificant. -// -// Note that we look for both C::iterator and C::const_iterator. The -// reason is that C++ injects the name of a class as a member of the -// class itself (e.g. you can refer to class iterator as either -// 'iterator' or 'iterator::iterator'). If we look for C::iterator -// only, for example, we would mistakenly think that a class named -// iterator is an STL container. -// -// Also note that the simpler approach of overloading -// IsContainerTest(typename C::const_iterator*) and -// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. -typedef int IsContainer; -template -IsContainer IsContainerTest(int /* dummy */, - typename C::iterator* /* it */ = NULL, - typename C::const_iterator* /* const_it */ = NULL) { - return 0; -} - -typedef char IsNotContainer; -template -IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } - -// EnableIf::type is void when 'Cond' is true, and -// undefined when 'Cond' is false. To use SFINAE to make a function -// overload only apply when a particular expression is true, add -// "typename EnableIf::type* = 0" as the last parameter. -template struct EnableIf; -template<> struct EnableIf { typedef void type; }; // NOLINT - -// Utilities for native arrays. - -// ArrayEq() compares two k-dimensional native arrays using the -// elements' operator==, where k can be any integer >= 0. When k is -// 0, ArrayEq() degenerates into comparing a single pair of values. - -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs); - -// This generic version is used when k is 0. -template -inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } - -// This overload is used when k >= 1. -template -inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { - return internal::ArrayEq(lhs, N, rhs); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous ArrayEq() function, arrays with different sizes would -// lead to different copies of the template code. -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs) { - for (size_t i = 0; i != size; i++) { - if (!internal::ArrayEq(lhs[i], rhs[i])) - return false; - } - return true; -} - -// Finds the first element in the iterator range [begin, end) that -// equals elem. Element may be a native array type itself. -template -Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { - for (Iter it = begin; it != end; ++it) { - if (internal::ArrayEq(*it, elem)) - return it; - } - return end; -} - -// CopyArray() copies a k-dimensional native array using the elements' -// operator=, where k can be any integer >= 0. When k is 0, -// CopyArray() degenerates into copying a single value. - -template -void CopyArray(const T* from, size_t size, U* to); - -// This generic version is used when k is 0. -template -inline void CopyArray(const T& from, U* to) { *to = from; } - -// This overload is used when k >= 1. -template -inline void CopyArray(const T(&from)[N], U(*to)[N]) { - internal::CopyArray(from, N, *to); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous CopyArray() function, arrays with different sizes -// would lead to different copies of the template code. -template -void CopyArray(const T* from, size_t size, U* to) { - for (size_t i = 0; i != size; i++) { - internal::CopyArray(from[i], to + i); - } -} - -// The relation between an NativeArray object (see below) and the -// native array it represents. -enum RelationToSource { - kReference, // The NativeArray references the native array. - kCopy // The NativeArray makes a copy of the native array and - // owns the copy. -}; - -// Adapts a native array to a read-only STL-style container. Instead -// of the complete STL container concept, this adaptor only implements -// members useful for Google Mock's container matchers. New members -// should be added as needed. To simplify the implementation, we only -// support Element being a raw type (i.e. having no top-level const or -// reference modifier). It's the client's responsibility to satisfy -// this requirement. Element can be an array type itself (hence -// multi-dimensional arrays are supported). -template -class NativeArray { - public: - // STL-style container typedefs. - typedef Element value_type; - typedef Element* iterator; - typedef const Element* const_iterator; - - // Constructs from a native array. - NativeArray(const Element* array, size_t count, RelationToSource relation) { - Init(array, count, relation); - } - - // Copy constructor. - NativeArray(const NativeArray& rhs) { - Init(rhs.array_, rhs.size_, rhs.relation_to_source_); - } - - ~NativeArray() { - // Ensures that the user doesn't instantiate NativeArray with a - // const or reference type. - static_cast(StaticAssertTypeEqHelper()); - if (relation_to_source_ == kCopy) - delete[] array_; - } - - // STL-style container methods. - size_t size() const { return size_; } - const_iterator begin() const { return array_; } - const_iterator end() const { return array_ + size_; } - bool operator==(const NativeArray& rhs) const { - return size() == rhs.size() && - ArrayEq(begin(), size(), rhs.begin()); - } - - private: - // Initializes this object; makes a copy of the input array if - // 'relation' is kCopy. - void Init(const Element* array, size_t a_size, RelationToSource relation) { - if (relation == kReference) { - array_ = array; - } else { - Element* const copy = new Element[a_size]; - CopyArray(array, a_size, copy); - array_ = copy; - } - size_ = a_size; - relation_to_source_ = relation; - } - - const Element* array_; - size_t size_; - RelationToSource relation_to_source_; - - GTEST_DISALLOW_ASSIGN_(NativeArray); -}; - - -#if GTEST_HAS_EXCEPTIONS -//add by qiaoyang,增加强制置成功的用例抛出的异常类 -class GoogleTestSuccessException { -public: - explicit GoogleTestSuccessException(const char *str) :strmsg(str){} -private: - string strmsg; -}; -#endif - -} // namespace internal -} // namespace testing - -#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ - ::testing::internal::AssertHelper(result_type, file, line, message) \ - = ::testing::Message() - -#define GTEST_MESSAGE_(message, result_type) \ - GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) - -//#define GTEST_FATAL_FAILURE_(message) -// return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) -//modify by autostar -//修改为直接抛异常出来,这样直接就从用例执行中退出,异常类型直接用0,不用宏,避免包含h文件的问题 -#define GTEST_FATAL_FAILURE_(message) \ -{\ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure);\ - if (::testing::g_set_throw_effect)\ - throw 0;\ -} - -#define GTEST_NONFATAL_FAILURE_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) - -#define GTEST_SUCCESS_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) - -//add by qiaoyang 强制置用例成功,直接返回 -#define GTEST_FATAL_SUCCESS_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kFouceSuccess);\ - if (::testing::g_set_throw_effect)\ - throw ::testing::internal::GoogleTestSuccessException("Fouce Succeed!");\ -// Suppresses MSVC warnings 4072 (unreachable code) for the code following -// statement if it returns or throws (or doesn't return or throw in some -// situations). -#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ - if (::testing::internal::AlwaysTrue()) { statement; } - -#define GTEST_TEST_THROW_(statement, expected_exception, fail) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::ConstCharPtr gtest_msg = "") { \ - bool gtest_caught_expected = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (expected_exception const&) { \ - gtest_caught_expected = true; \ - } \ - catch (...) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws a different type."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - if (!gtest_caught_expected) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws nothing."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ - fail(gtest_msg.value) - -#define GTEST_TEST_NO_THROW_(statement, fail) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ - fail("Expected: " #statement " doesn't throw an exception.\n" \ - " Actual: it throws.") - -#define GTEST_TEST_ANY_THROW_(statement, fail) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - bool gtest_caught_any = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - gtest_caught_any = true; \ - } \ - if (!gtest_caught_any) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ - fail("Expected: " #statement " throws an exception.\n" \ - " Actual: it doesn't.") - - -// Implements Boolean test assertions such as EXPECT_TRUE. expression can be -// either a boolean expression or an AssertionResult. text is a textual -// represenation of expression as it was passed into the EXPECT_TRUE. -#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ - ; \ - else \ - fail(::testing::internal::GetBoolAssertionFailureMessage(\ - gtest_ar_, text, #actual, #expected).c_str()) - -#define GTEST_TEST_BOOLEAN2_(expression, text, actual, expected, fail) \ -{ \ - ::testing::styleCheck::tick(); \ -} \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if(++gtest_assert_count_) \ - if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ - ; \ - else \ - fail(::testing::internal::GetBoolAssertionFailureMessage(\ - gtest_ar_, text, #actual, #expected).c_str()) - -#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ - fail("Expected: " #statement " doesn't generate new fatal " \ - "failures in the current thread.\n" \ - " Actual: it does.") - -// Expands to the name of the class that implements the given test. -#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - test_case_name##_##test_name##_Test - -// Helper macro for defining tests. -//autostar修改,增加 __FILE__ __LINE__宏 -#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id, ...)\ -class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ - public:\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ - private:\ - virtual void TestBody();\ - static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ -};\ -\ -::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ - ::test_info_ =\ - ::testing::internal::MakeAndRegisterTestInfo(\ - #test_case_name, #test_name, NULL, NULL, \ - (parent_id), \ - parent_class::SetUpTestCase, \ - parent_class::TearDownTestCase, \ - new ::testing::internal::TestFactoryImpl<\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>,\ - __FILE__, __LINE__, ##__VA_ARGS__);\ -void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ diff --git a/cli/test/include/gtest/internal/gtest-linked_ptr.h b/cli/test/include/gtest/internal/gtest-linked_ptr.h deleted file mode 100644 index 57147b4..0000000 --- a/cli/test/include/gtest/internal/gtest-linked_ptr.h +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2003 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: Dan Egnor (egnor@google.com) -// -// A "smart" pointer type with reference tracking. Every pointer to a -// particular object is kept on a circular linked list. When the last pointer -// to an object is destroyed or reassigned, the object is deleted. -// -// Used properly, this deletes the object when the last reference goes away. -// There are several caveats: -// - Like all reference counting schemes, cycles lead to leaks. -// - Each smart pointer is actually two pointers (8 bytes instead of 4). -// - Every time a pointer is assigned, the entire list of pointers to that -// object is traversed. This class is therefore NOT SUITABLE when there -// will often be more than two or three pointers to a particular object. -// - References are only tracked as long as linked_ptr<> objects are copied. -// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS -// will happen (double deletion). -// -// A good use of this class is storing object references in STL containers. -// You can safely put linked_ptr<> in a vector<>. -// Other uses may not be as good. -// -// Note: If you use an incomplete type with linked_ptr<>, the class -// *containing* linked_ptr<> must have a constructor and destructor (even -// if they do nothing!). -// -// Bill Gibbons suggested we use something like this. -// -// Thread Safety: -// Unlike other linked_ptr implementations, in this implementation -// a linked_ptr object is thread-safe in the sense that: -// - it's safe to copy linked_ptr objects concurrently, -// - it's safe to copy *from* a linked_ptr and read its underlying -// raw pointer (e.g. via get()) concurrently, and -// - it's safe to write to two linked_ptrs that point to the same -// shared object concurrently. -// TODO(wan@google.com): rename this to safe_linked_ptr to avoid -// confusion with normal linked_ptr. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ - -#include -#include - -#include "gtest/internal/gtest-port.h" - -namespace testing { -namespace internal { - -// Protects copying of all linked_ptr objects. -GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); - -// This is used internally by all instances of linked_ptr<>. It needs to be -// a non-template class because different types of linked_ptr<> can refer to -// the same object (linked_ptr(obj) vs linked_ptr(obj)). -// So, it needs to be possible for different types of linked_ptr to participate -// in the same circular linked list, so we need a single class type here. -// -// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr. -class linked_ptr_internal { - public: - // Create a new circle that includes only this instance. - void join_new() { - next_ = this; - } - - // Many linked_ptr operations may change p.link_ for some linked_ptr - // variable p in the same circle as this object. Therefore we need - // to prevent two such operations from occurring concurrently. - // - // Note that different types of linked_ptr objects can coexist in a - // circle (e.g. linked_ptr, linked_ptr, and - // linked_ptr). Therefore we must use a single mutex to - // protect all linked_ptr objects. This can create serious - // contention in production code, but is acceptable in a testing - // framework. - - // Join an existing circle. - // L < g_linked_ptr_mutex - void join(linked_ptr_internal const* ptr) { - MutexLock lock(&g_linked_ptr_mutex); - - linked_ptr_internal const* p = ptr; - while (p->next_ != ptr) p = p->next_; - p->next_ = this; - next_ = ptr; - } - - // Leave whatever circle we're part of. Returns true if we were the - // last member of the circle. Once this is done, you can join() another. - // L < g_linked_ptr_mutex - bool depart() { - MutexLock lock(&g_linked_ptr_mutex); - - if (next_ == this) return true; - linked_ptr_internal const* p = next_; - while (p->next_ != this) p = p->next_; - p->next_ = next_; - return false; - } - - private: - mutable linked_ptr_internal const* next_; -}; - -template -class linked_ptr { - public: - typedef T element_type; - - // Take over ownership of a raw pointer. This should happen as soon as - // possible after the object is created. - explicit linked_ptr(T* ptr = NULL) { capture(ptr); } - ~linked_ptr() { depart(); } - - // Copy an existing linked_ptr<>, adding ourselves to the list of references. - template linked_ptr(linked_ptr const& ptr) { copy(&ptr); } - linked_ptr(linked_ptr const& ptr) { // NOLINT - assert(&ptr != this); - copy(&ptr); - } - - // Assignment releases the old value and acquires the new. - template linked_ptr& operator=(linked_ptr const& ptr) { - depart(); - copy(&ptr); - return *this; - } - - linked_ptr& operator=(linked_ptr const& ptr) { - if (&ptr != this) { - depart(); - copy(&ptr); - } - return *this; - } - - // Smart pointer members. - void reset(T* ptr = NULL) { - depart(); - capture(ptr); - } - T* get() const { return value_; } - T* operator->() const { return value_; } - T& operator*() const { return *value_; } - - bool operator==(T* p) const { return value_ == p; } - bool operator!=(T* p) const { return value_ != p; } - template - bool operator==(linked_ptr const& ptr) const { - return value_ == ptr.get(); - } - template - bool operator!=(linked_ptr const& ptr) const { - return value_ != ptr.get(); - } - - private: - template - friend class linked_ptr; - - T* value_; - linked_ptr_internal link_; - - void depart() { - if (link_.depart()) delete value_; - } - - void capture(T* ptr) { - value_ = ptr; - link_.join_new(); - } - - template void copy(linked_ptr const* ptr) { - value_ = ptr->get(); - if (value_) - link_.join(&ptr->link_); - else - link_.join_new(); - } -}; - -template inline -bool operator==(T* ptr, const linked_ptr& x) { - return ptr == x.get(); -} - -template inline -bool operator!=(T* ptr, const linked_ptr& x) { - return ptr != x.get(); -} - -// A function to convert T* into linked_ptr -// Doing e.g. make_linked_ptr(new FooBarBaz(arg)) is a shorter notation -// for linked_ptr >(new FooBarBaz(arg)) -template -linked_ptr make_linked_ptr(T* ptr) { - return linked_ptr(ptr); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util-generated.h b/cli/test/include/gtest/internal/gtest-param-util-generated.h deleted file mode 100644 index 2582675..0000000 --- a/cli/test/include/gtest/internal/gtest-param-util-generated.h +++ /dev/null @@ -1,4822 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-param-util-generated.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most 50 arguments in Values, -// and at most 10 arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tr1::tuple which is -// currently set at 10. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-port.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -template -class ValueArray1 { - public: - explicit ValueArray1(T1 v1) : v1_(v1) {} - - template - operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray1& other); - - const T1 v1_; -}; - -template -class ValueArray2 { - public: - ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray2& other); - - const T1 v1_; - const T2 v2_; -}; - -template -class ValueArray3 { - public: - ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray3& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; -}; - -template -class ValueArray4 { - public: - ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray4& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; -}; - -template -class ValueArray5 { - public: - ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray5& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; -}; - -template -class ValueArray6 { - public: - ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray6& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; -}; - -template -class ValueArray7 { - public: - ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray7& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; -}; - -template -class ValueArray8 { - public: - ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray8& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; -}; - -template -class ValueArray9 { - public: - ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray9& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; -}; - -template -class ValueArray10 { - public: - ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray10& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; -}; - -template -class ValueArray11 { - public: - ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray11& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; -}; - -template -class ValueArray12 { - public: - ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray12& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; -}; - -template -class ValueArray13 { - public: - ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray13& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; -}; - -template -class ValueArray14 { - public: - ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray14& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; -}; - -template -class ValueArray15 { - public: - ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray15& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; -}; - -template -class ValueArray16 { - public: - ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray16& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; -}; - -template -class ValueArray17 { - public: - ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray17& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; -}; - -template -class ValueArray18 { - public: - ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray18& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; -}; - -template -class ValueArray19 { - public: - ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray19& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; -}; - -template -class ValueArray20 { - public: - ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray20& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; -}; - -template -class ValueArray21 { - public: - ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray21& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; -}; - -template -class ValueArray22 { - public: - ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray22& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; -}; - -template -class ValueArray23 { - public: - ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, - v23_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray23& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; -}; - -template -class ValueArray24 { - public: - ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray24& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; -}; - -template -class ValueArray25 { - public: - ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray25& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; -}; - -template -class ValueArray26 { - public: - ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray26& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; -}; - -template -class ValueArray27 { - public: - ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray27& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; -}; - -template -class ValueArray28 { - public: - ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray28& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; -}; - -template -class ValueArray29 { - public: - ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray29& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; -}; - -template -class ValueArray30 { - public: - ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray30& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; -}; - -template -class ValueArray31 { - public: - ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray31& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; -}; - -template -class ValueArray32 { - public: - ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray32& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; -}; - -template -class ValueArray33 { - public: - ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray33& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; -}; - -template -class ValueArray34 { - public: - ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray34& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; -}; - -template -class ValueArray35 { - public: - ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, - v35_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray35& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; -}; - -template -class ValueArray36 { - public: - ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray36& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; -}; - -template -class ValueArray37 { - public: - ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray37& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; -}; - -template -class ValueArray38 { - public: - ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray38& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; -}; - -template -class ValueArray39 { - public: - ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray39& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; -}; - -template -class ValueArray40 { - public: - ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray40& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; -}; - -template -class ValueArray41 { - public: - ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray41& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; -}; - -template -class ValueArray42 { - public: - ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray42& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; -}; - -template -class ValueArray43 { - public: - ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), - v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray43& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; -}; - -template -class ValueArray44 { - public: - ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), - v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), - v43_(v43), v44_(v44) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray44& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; -}; - -template -class ValueArray45 { - public: - ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), - v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray45& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; -}; - -template -class ValueArray46 { - public: - ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray46& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; -}; - -template -class ValueArray47 { - public: - ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), - v47_(v47) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, - v47_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray47& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; -}; - -template -class ValueArray48 { - public: - ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), - v46_(v46), v47_(v47), v48_(v48) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, - v48_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray48& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; -}; - -template -class ValueArray49 { - public: - ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, - T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, - v48_, v49_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray49& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; -}; - -template -class ValueArray50 { - public: - ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, - T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} - - template - operator ParamGenerator() const { - const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_, - v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_, - v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_, - v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_, - v48_, v49_, v50_}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray50& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; - const T50 v50_; -}; - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -template -class CartesianProductGenerator2 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator2(const ParamGenerator& g1, - const ParamGenerator& g2) - : g1_(g1), g2_(g2) {} - virtual ~CartesianProductGenerator2() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current2_; - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - ParamType current_value_; - }; // class CartesianProductGenerator2::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator2& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; -}; // class CartesianProductGenerator2 - - -template -class CartesianProductGenerator3 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator3(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - virtual ~CartesianProductGenerator3() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current3_; - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - ParamType current_value_; - }; // class CartesianProductGenerator3::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator3& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; -}; // class CartesianProductGenerator3 - - -template -class CartesianProductGenerator4 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator4(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - virtual ~CartesianProductGenerator4() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current4_; - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - ParamType current_value_; - }; // class CartesianProductGenerator4::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator4& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; -}; // class CartesianProductGenerator4 - - -template -class CartesianProductGenerator5 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator5(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - virtual ~CartesianProductGenerator5() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current5_; - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - ParamType current_value_; - }; // class CartesianProductGenerator5::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator5& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; -}; // class CartesianProductGenerator5 - - -template -class CartesianProductGenerator6 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator6(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - virtual ~CartesianProductGenerator6() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current6_; - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - ParamType current_value_; - }; // class CartesianProductGenerator6::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator6& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; -}; // class CartesianProductGenerator6 - - -template -class CartesianProductGenerator7 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator7(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - virtual ~CartesianProductGenerator7() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current7_; - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - ParamType current_value_; - }; // class CartesianProductGenerator7::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator7& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; -}; // class CartesianProductGenerator7 - - -template -class CartesianProductGenerator8 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator8(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - virtual ~CartesianProductGenerator8() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current8_; - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - ParamType current_value_; - }; // class CartesianProductGenerator8::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator8& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; -}; // class CartesianProductGenerator8 - - -template -class CartesianProductGenerator9 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator9(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - virtual ~CartesianProductGenerator9() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current9_; - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - ParamType current_value_; - }; // class CartesianProductGenerator9::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator9& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; -}; // class CartesianProductGenerator9 - - -template -class CartesianProductGenerator10 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator10(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9, - const ParamGenerator& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - virtual ~CartesianProductGenerator10() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end(), g10_, g10_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9, - const ParamGenerator& g10, - const typename ParamGenerator::iterator& current10) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9), - begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current10_; - if (current10_ == end10_) { - current10_ = begin10_; - ++current9_; - } - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_ && - current10_ == typed_other->current10_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_), - begin10_(other.begin10_), - end10_(other.end10_), - current10_(other.current10_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_, *current10_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_ || - current10_ == end10_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - const typename ParamGenerator::iterator begin10_; - const typename ParamGenerator::iterator end10_; - typename ParamGenerator::iterator current10_; - ParamType current_value_; - }; // class CartesianProductGenerator10::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator10& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; - const ParamGenerator g10_; -}; // class CartesianProductGenerator10 - - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -template -class CartesianProductHolder2 { - public: -CartesianProductHolder2(const Generator1& g1, const Generator2& g2) - : g1_(g1), g2_(g2) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator2( - static_cast >(g1_), - static_cast >(g2_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder2& other); - - const Generator1 g1_; - const Generator2 g2_; -}; // class CartesianProductHolder2 - -template -class CartesianProductHolder3 { - public: -CartesianProductHolder3(const Generator1& g1, const Generator2& g2, - const Generator3& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator3( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder3& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; -}; // class CartesianProductHolder3 - -template -class CartesianProductHolder4 { - public: -CartesianProductHolder4(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator4( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder4& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; -}; // class CartesianProductHolder4 - -template -class CartesianProductHolder5 { - public: -CartesianProductHolder5(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator5( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder5& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; -}; // class CartesianProductHolder5 - -template -class CartesianProductHolder6 { - public: -CartesianProductHolder6(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator6( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder6& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; -}; // class CartesianProductHolder6 - -template -class CartesianProductHolder7 { - public: -CartesianProductHolder7(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator7( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder7& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; -}; // class CartesianProductHolder7 - -template -class CartesianProductHolder8 { - public: -CartesianProductHolder8(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator8( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder8& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; -}; // class CartesianProductHolder8 - -template -class CartesianProductHolder9 { - public: -CartesianProductHolder9(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator9( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder9& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; -}; // class CartesianProductHolder9 - -template -class CartesianProductHolder10 { - public: -CartesianProductHolder10(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9, const Generator10& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator10( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_), - static_cast >(g10_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder10& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; - const Generator10 g10_; -}; // class CartesianProductHolder10 - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump b/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump deleted file mode 100644 index dbe9386..0000000 --- a/cli/test/include/gtest/internal/gtest-param-util-generated.h.pump +++ /dev/null @@ -1,301 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 50 $$ Maximum length of Values arguments we want to support. -$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most $n arguments in Values, -// and at most $maxtuple arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tr1::tuple which is -// currently set at $maxtuple. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-param-util.h" -#include "gtest/internal/gtest-port.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -template -class ValueArray1 { - public: - explicit ValueArray1(T1 v1) : v1_(v1) {} - - template - operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray1& other); - - const T1 v1_; -}; - -$range i 2..n -$for i [[ -$range j 1..i - -template <$for j, [[typename T$j]]> -class ValueArray$i { - public: - ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {} - - template - operator ParamGenerator() const { - const T array[] = {$for j, [[v$(j)_]]}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray$i& other); - -$for j [[ - - const T$j v$(j)_; -]] - -}; - -]] - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -$range i 2..maxtuple -$for i [[ -$range j 1..i -$range k 2..i - -template <$for j, [[typename T$j]]> -class CartesianProductGenerator$i - : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > { - public: - typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType; - - CartesianProductGenerator$i($for j, [[const ParamGenerator& g$j]]) - : $for j, [[g$(j)_(g$j)]] {} - virtual ~CartesianProductGenerator$i() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, $for j, [[ - - const ParamGenerator& g$j, - const typename ParamGenerator::iterator& current$(j)]]) - : base_(base), -$for j, [[ - - begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j) -]] { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current$(i)_; - -$for k [[ - if (current$(i+2-k)_ == end$(i+2-k)_) { - current$(i+2-k)_ = begin$(i+2-k)_; - ++current$(i+2-k-1)_; - } - -]] - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ($for j && [[ - - current$(j)_ == typed_other->current$(j)_ -]]); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), $for j, [[ - - begin$(j)_(other.begin$(j)_), - end$(j)_(other.end$(j)_), - current$(j)_(other.current$(j)_) -]] { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType($for j, [[*current$(j)_]]); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return -$for j || [[ - - current$(j)_ == end$(j)_ -]]; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. -$for j [[ - - const typename ParamGenerator::iterator begin$(j)_; - const typename ParamGenerator::iterator end$(j)_; - typename ParamGenerator::iterator current$(j)_; -]] - - ParamType current_value_; - }; // class CartesianProductGenerator$i::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator$i& other); - - -$for j [[ - const ParamGenerator g$(j)_; - -]] -}; // class CartesianProductGenerator$i - - -]] - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -$range i 2..maxtuple -$for i [[ -$range j 1..i - -template <$for j, [[class Generator$j]]> -class CartesianProductHolder$i { - public: -CartesianProductHolder$i($for j, [[const Generator$j& g$j]]) - : $for j, [[g$(j)_(g$j)]] {} - template <$for j, [[typename T$j]]> - operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const { - return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >( - new CartesianProductGenerator$i<$for j, [[T$j]]>( -$for j,[[ - - static_cast >(g$(j)_) -]])); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder$i& other); - - -$for j [[ - const Generator$j g$(j)_; - -]] -}; // class CartesianProductHolder$i - -]] - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/cli/test/include/gtest/internal/gtest-param-util.h b/cli/test/include/gtest/internal/gtest-param-util.h deleted file mode 100644 index 17af47f..0000000 --- a/cli/test/include/gtest/internal/gtest-param-util.h +++ /dev/null @@ -1,628 +0,0 @@ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ - -#include -#include -#include - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -#include "gtest/internal/gtest-internal.h" -#include "gtest/internal/gtest-linked_ptr.h" -#include "gtest/internal/gtest-port.h" -#include "gtest/gtest-printers.h" - -#if GTEST_HAS_PARAM_TEST - -namespace testing { -namespace internal { - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Outputs a message explaining invalid registration of different -// fixture class for the same test case. This may happen when -// TEST_P macro is used to define two tests with the same name -// but in different namespaces. -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - const char* file, int line); - -template class ParamGeneratorInterface; -template class ParamGenerator; - -// Interface for iterating over elements provided by an implementation -// of ParamGeneratorInterface. -template -class ParamIteratorInterface { - public: - virtual ~ParamIteratorInterface() {} - // A pointer to the base generator instance. - // Used only for the purposes of iterator comparison - // to make sure that two iterators belong to the same generator. - virtual const ParamGeneratorInterface* BaseGenerator() const = 0; - // Advances iterator to point to the next element - // provided by the generator. The caller is responsible - // for not calling Advance() on an iterator equal to - // BaseGenerator()->End(). - virtual void Advance() = 0; - // Clones the iterator object. Used for implementing copy semantics - // of ParamIterator. - virtual ParamIteratorInterface* Clone() const = 0; - // Dereferences the current iterator and provides (read-only) access - // to the pointed value. It is the caller's responsibility not to call - // Current() on an iterator equal to BaseGenerator()->End(). - // Used for implementing ParamGenerator::operator*(). - virtual const T* Current() const = 0; - // Determines whether the given iterator and other point to the same - // element in the sequence generated by the generator. - // Used for implementing ParamGenerator::operator==(). - virtual bool Equals(const ParamIteratorInterface& other) const = 0; -}; - -// Class iterating over elements provided by an implementation of -// ParamGeneratorInterface. It wraps ParamIteratorInterface -// and implements the const forward iterator concept. -template -class ParamIterator { - public: - typedef T value_type; - typedef const T& reference; - typedef ptrdiff_t difference_type; - - // ParamIterator assumes ownership of the impl_ pointer. - ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} - ParamIterator& operator=(const ParamIterator& other) { - if (this != &other) - impl_.reset(other.impl_->Clone()); - return *this; - } - - const T& operator*() const { return *impl_->Current(); } - const T* operator->() const { return impl_->Current(); } - // Prefix version of operator++. - ParamIterator& operator++() { - impl_->Advance(); - return *this; - } - // Postfix version of operator++. - ParamIterator operator++(int /*unused*/) { - ParamIteratorInterface* clone = impl_->Clone(); - impl_->Advance(); - return ParamIterator(clone); - } - bool operator==(const ParamIterator& other) const { - return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); - } - bool operator!=(const ParamIterator& other) const { - return !(*this == other); - } - - private: - friend class ParamGenerator; - explicit ParamIterator(ParamIteratorInterface* impl) : impl_(impl) {} - scoped_ptr > impl_; -}; - -// ParamGeneratorInterface is the binary interface to access generators -// defined in other translation units. -template -class ParamGeneratorInterface { - public: - typedef T ParamType; - - virtual ~ParamGeneratorInterface() {} - - // Generator interface definition - virtual ParamIteratorInterface* Begin() const = 0; - virtual ParamIteratorInterface* End() const = 0; -}; - -// Wraps ParamGeneratorInterface and provides general generator syntax -// compatible with the STL Container concept. -// This class implements copy initialization semantics and the contained -// ParamGeneratorInterface instance is shared among all copies -// of the original object. This is possible because that instance is immutable. -template -class ParamGenerator { - public: - typedef ParamIterator iterator; - - explicit ParamGenerator(ParamGeneratorInterface* impl) : impl_(impl) {} - ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} - - ParamGenerator& operator=(const ParamGenerator& other) { - impl_ = other.impl_; - return *this; - } - - iterator begin() const { return iterator(impl_->Begin()); } - iterator end() const { return iterator(impl_->End()); } - - private: - linked_ptr > impl_; -}; - -// Generates values from a range of two comparable values. Can be used to -// generate sequences of user-defined types that implement operator+() and -// operator<(). -// This class is used in the Range() function. -template -class RangeGenerator : public ParamGeneratorInterface { - public: - RangeGenerator(T begin, T end, IncrementT step) - : begin_(begin), end_(end), - step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} - virtual ~RangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, begin_, 0, step_); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, end_, end_index_, step_); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, T value, int index, - IncrementT step) - : base_(base), value_(value), index_(index), step_(step) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - value_ = value_ + step_; - index_++; - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const T* Current() const { return &value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const int other_index = - CheckedDowncastToActualType(&other)->index_; - return index_ == other_index; - } - - private: - Iterator(const Iterator& other) - : ParamIteratorInterface(), - base_(other.base_), value_(other.value_), index_(other.index_), - step_(other.step_) {} - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - T value_; - int index_; - const IncrementT step_; - }; // class RangeGenerator::Iterator - - static int CalculateEndIndex(const T& begin, - const T& end, - const IncrementT& step) { - int end_index = 0; - for (T i = begin; i < end; i = i + step) - end_index++; - return end_index; - } - - // No implementation - assignment is unsupported. - void operator=(const RangeGenerator& other); - - const T begin_; - const T end_; - const IncrementT step_; - // The index for the end() iterator. All the elements in the generated - // sequence are indexed (0-based) to aid iterator comparison. - const int end_index_; -}; // class RangeGenerator - - -// Generates values from a pair of STL-style iterators. Used in the -// ValuesIn() function. The elements are copied from the source range -// since the source can be located on the stack, and the generator -// is likely to persist beyond that stack frame. -template -class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { - public: - template - ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) - : container_(begin, end) {} - virtual ~ValuesInIteratorRangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, container_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, container_.end()); - } - - private: - typedef typename ::std::vector ContainerType; - - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - typename ContainerType::const_iterator iterator) - : base_(base), iterator_(iterator) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - ++iterator_; - value_.reset(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - // We need to use cached value referenced by iterator_ because *iterator_ - // can return a temporary object (and of type other then T), so just - // having "return &*iterator_;" doesn't work. - // value_ is updated here and not in Advance() because Advance() - // can advance iterator_ beyond the end of the range, and we cannot - // detect that fact. The client code, on the other hand, is - // responsible for not calling Current() on an out-of-range iterator. - virtual const T* Current() const { - if (value_.get() == NULL) - value_.reset(new T(*iterator_)); - return value_.get(); - } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - return iterator_ == - CheckedDowncastToActualType(&other)->iterator_; - } - - private: - Iterator(const Iterator& other) - // The explicit constructor call suppresses a false warning - // emitted by gcc when supplied with the -Wextra option. - : ParamIteratorInterface(), - base_(other.base_), - iterator_(other.iterator_) {} - - const ParamGeneratorInterface* const base_; - typename ContainerType::const_iterator iterator_; - // A cached value of *iterator_. We keep it here to allow access by - // pointer in the wrapping iterator's operator->(). - // value_ needs to be mutable to be accessed in Current(). - // Use of scoped_ptr helps manage cached value's lifetime, - // which is bound by the lifespan of the iterator itself. - mutable scoped_ptr value_; - }; // class ValuesInIteratorRangeGenerator::Iterator - - // No implementation - assignment is unsupported. - void operator=(const ValuesInIteratorRangeGenerator& other); - - const ContainerType container_; -}; // class ValuesInIteratorRangeGenerator - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Stores a parameter value and later creates tests parameterized with that -// value. -template -class ParameterizedTestFactory : public TestFactoryBase { - public: - typedef typename TestClass::ParamType ParamType; - explicit ParameterizedTestFactory(ParamType parameter) : - parameter_(parameter) {} - virtual Test* CreateTest() { - TestClass::SetParam(¶meter_); - return new TestClass(); - } - - private: - const ParamType parameter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactoryBase is a base class for meta-factories that create -// test factories for passing into MakeAndRegisterTestInfo function. -template -class TestMetaFactoryBase { - public: - virtual ~TestMetaFactoryBase() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactory creates test factories for passing into -// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives -// ownership of test factory pointer, same factory object cannot be passed -// into that method twice. But ParameterizedTestCaseInfo is going to call -// it for each Test/Parameter value combination. Thus it needs meta factory -// creator class. -template -class TestMetaFactory - : public TestMetaFactoryBase { - public: - typedef typename TestCase::ParamType ParamType; - - TestMetaFactory() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { - return new ParameterizedTestFactory(parameter); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfoBase is a generic interface -// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase -// accumulates test information provided by TEST_P macro invocations -// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations -// and uses that information to register all resulting test instances -// in RegisterTests method. The ParameterizeTestCaseRegistry class holds -// a collection of pointers to the ParameterizedTestCaseInfo objects -// and calls RegisterTests() on each of them when asked. -class ParameterizedTestCaseInfoBase { - public: - virtual ~ParameterizedTestCaseInfoBase() {} - - // Base part of test case name for display purposes. - virtual const string& GetTestCaseName() const = 0; - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const = 0; - // UnitTest class invokes this method to register tests in this - // test case right before running them in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - virtual void RegisterTests() = 0; - - protected: - ParameterizedTestCaseInfoBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P -// macro invocations for a particular test case and generators -// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that -// test case. It registers tests with all values generated by all -// generators when asked. -template -class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { - public: - // ParamType and GeneratorCreationFunc are private types but are required - // for declarations of public methods AddTestPattern() and - // AddTestCaseInstantiation(). - typedef typename TestCase::ParamType ParamType; - // A function that returns an instance of appropriate generator type. - typedef ParamGenerator(GeneratorCreationFunc)(); - - explicit ParameterizedTestCaseInfo(const char* name) - : test_case_name_(name) {} - - // Test case base name for display purposes. - virtual const string& GetTestCaseName() const { return test_case_name_; } - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); } - // TEST_P macro uses AddTestPattern() to record information - // about a single test in a LocalTestInfo structure. - // test_case_name is the base name of the test case (without invocation - // prefix). test_base_name is the name of an individual test without - // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is - // test case base name and DoBar is test base name. - void AddTestPattern(const char* test_case_name, - const char* test_base_name, - TestMetaFactoryBase* meta_factory) { - tests_.push_back(linked_ptr(new TestInfo(test_case_name, - test_base_name, - meta_factory))); - } - // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information - // about a generator. - int AddTestCaseInstantiation(const string& instantiation_name, - GeneratorCreationFunc* func, - const char* sFilePath/* file */, - int iLine/* line */) { - instantiations_.push_back(::std::make_pair(instantiation_name, func)); - //add by qiaoyang - test_case_p_sfilePath_ = sFilePath; - test_case_p_iLine_ = iLine; - return 0; // Return value used only to run this method in namespace scope. - } - // UnitTest class invokes this method to register tests in this test case - // test cases right before running tests in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - // UnitTest has a guard to prevent from calling this method more then once. - virtual void RegisterTests() { - for (typename TestInfoContainer::iterator test_it = tests_.begin(); - test_it != tests_.end(); ++test_it) { - linked_ptr test_info = *test_it; - for (typename InstantiationContainer::iterator gen_it = - instantiations_.begin(); gen_it != instantiations_.end(); - ++gen_it) { - const string& instantiation_name = gen_it->first; - ParamGenerator generator((*gen_it->second)()); - - Message test_case_name_stream; - if ( !instantiation_name.empty() ) - test_case_name_stream << instantiation_name << "/"; - test_case_name_stream << test_info->test_case_base_name; - - int i = 0; - for (typename ParamGenerator::iterator param_it = - generator.begin(); - param_it != generator.end(); ++param_it, ++i) { - Message test_name_stream; - test_name_stream << test_info->test_base_name << "/" << i; - MakeAndRegisterTestInfo( - test_case_name_stream.GetString().c_str(), - test_name_stream.GetString().c_str(), - NULL, // No type parameter. - PrintToString(*param_it).c_str(), - GetTestCaseTypeId(), - TestCase::SetUpTestCase, - TestCase::TearDownTestCase, - test_info->test_meta_factory->CreateTestFactory(*param_it), -// __FILE__, __LINE__);//autostar增加后两个参数,使用参数化功能 - test_case_p_sfilePath_, test_case_p_iLine_);//autostar增加后两个参数,使用参数化功能 - } // for param_it - } // for gen_it - } // for test_it - } // RegisterTests - - private: - // LocalTestInfo structure keeps information about a single test registered - // with TEST_P macro. - struct TestInfo { - TestInfo(const char* a_test_case_base_name, - const char* a_test_base_name, - TestMetaFactoryBase* a_test_meta_factory) : - test_case_base_name(a_test_case_base_name), - test_base_name(a_test_base_name), - test_meta_factory(a_test_meta_factory) {} - - const string test_case_base_name; - const string test_base_name; - const scoped_ptr > test_meta_factory; - }; - typedef ::std::vector > TestInfoContainer; - // Keeps pairs of - // received from INSTANTIATE_TEST_CASE_P macros. - typedef ::std::vector > - InstantiationContainer; - - const string test_case_name_; - TestInfoContainer tests_; - InstantiationContainer instantiations_; - - //add by qiaoyang - std::string test_case_p_sfilePath_; - int test_case_p_iLine_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); -}; // class ParameterizedTestCaseInfo - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase -// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P -// macros use it to locate their corresponding ParameterizedTestCaseInfo -// descriptors. -class ParameterizedTestCaseRegistry { - public: - ParameterizedTestCaseRegistry() {} - ~ParameterizedTestCaseRegistry() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - delete *it; - } - } - - // Looks up or creates and returns a structure containing information about - // tests and instantiations of a particular test case. - template - ParameterizedTestCaseInfo* GetTestCasePatternHolder( - const char* test_case_name, - const char* file, - int line) { - ParameterizedTestCaseInfo* typed_test_info = NULL; - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - if ((*it)->GetTestCaseName() == test_case_name) { - if ((*it)->GetTestCaseTypeId() != GetTypeId()) { - // Complain about incorrect usage of Google Test facilities - // and terminate the program since we cannot guaranty correct - // test case setup and tear-down in this case. - ReportInvalidTestCaseType(test_case_name, file, line); - posix::Abort(); - } else { - // At this point we are sure that the object we found is of the same - // type we are looking for, so we downcast it to that type - // without further checks. - typed_test_info = CheckedDowncastToActualType< - ParameterizedTestCaseInfo >(*it); - } - break; - } - } - if (typed_test_info == NULL) { - typed_test_info = new ParameterizedTestCaseInfo(test_case_name); - test_case_infos_.push_back(typed_test_info); - } - return typed_test_info; - } - void RegisterTests() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - (*it)->RegisterTests(); - } - } - - private: - typedef ::std::vector TestCaseInfoContainer; - - TestCaseInfoContainer test_case_infos_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); -}; - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ diff --git a/cli/test/include/gtest/internal/gtest-port.h b/cli/test/include/gtest/internal/gtest-port.h deleted file mode 100644 index c313915..0000000 --- a/cli/test/include/gtest/internal/gtest-port.h +++ /dev/null @@ -1,1782 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan) -// -// Low-level types and utilities for porting Google Test to various -// platforms. They are subject to change without notice. DO NOT USE -// THEM IN USER CODE. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -// The user can define the following macros in the build script to -// control Google Test's behavior. If the user doesn't define a macro -// in this list, Google Test will define it. -// -// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) -// is/isn't available. -// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions -// are enabled. -// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::string, which is different to std::string). -// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::wstring, which is different to std::wstring). -// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular -// expressions are/aren't available. -// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that -// is/isn't available. -// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't -// enabled. -// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that -// std::wstring does/doesn't work (Google Test can -// be used where std::wstring is unavailable). -// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple -// is/isn't available. -// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the -// compiler supports Microsoft's "Structured -// Exception Handling". -// GTEST_HAS_STREAM_REDIRECTION -// - Define it to 1/0 to indicate whether the -// platform supports I/O stream redirection using -// dup() and dup2(). -// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google -// Test's own tr1 tuple implementation should be -// used. Unused when the user sets -// GTEST_HAS_TR1_TUPLE to 0. -// GTEST_LINKED_AS_SHARED_LIBRARY -// - Define to 1 when compiling tests that use -// Google Test as a shared library (known as -// DLL on Windows). -// GTEST_CREATE_SHARED_LIBRARY -// - Define to 1 when compiling Google Test itself -// as a shared library. - -// This header defines the following utilities: -// -// Macros indicating the current platform (defined to 1 if compiled on -// the given platform; otherwise undefined): -// GTEST_OS_AIX - IBM AIX -// GTEST_OS_CYGWIN - Cygwin -// GTEST_OS_HPUX - HP-UX -// GTEST_OS_LINUX - Linux -// GTEST_OS_LINUX_ANDROID - Google Android -// GTEST_OS_MAC - Mac OS X -// GTEST_OS_NACL - Google Native Client (NaCl) -// GTEST_OS_SOLARIS - Sun Solaris -// GTEST_OS_SYMBIAN - Symbian -// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) -// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop -// GTEST_OS_WINDOWS_MINGW - MinGW -// GTEST_OS_WINDOWS_MOBILE - Windows Mobile -// GTEST_OS_ZOS - z/OS -// -// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the -// most stable support. Since core members of the Google Test project -// don't have access to other platforms, support for them may be less -// stable. If you notice any problems on your platform, please notify -// googletestframework@googlegroups.com (patches for fixing them are -// even more welcome!). -// -// Note that it is possible that none of the GTEST_OS_* macros are defined. -// -// Macros indicating available Google Test features (defined to 1 if -// the corresponding feature is supported; otherwise undefined): -// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized -// tests) -// GTEST_HAS_DEATH_TEST - death tests -// GTEST_HAS_PARAM_TEST - value-parameterized tests -// GTEST_HAS_TYPED_TEST - typed tests -// GTEST_HAS_TYPED_TEST_P - type-parameterized tests -// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with -// GTEST_HAS_POSIX_RE (see above) which users can -// define themselves. -// GTEST_USES_SIMPLE_RE - our own simple regex is used; -// the above two are mutually exclusive. -// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). -// -// Macros for basic C++ coding: -// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. -// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a -// variable don't have to be used. -// GTEST_DISALLOW_ASSIGN_ - disables operator=. -// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. -// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. -// -// Synchronization: -// Mutex, MutexLock, ThreadLocal, GetThreadCount() -// - synchronization primitives. -// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above -// synchronization primitives have real implementations -// and Google Test is thread-safe; or 0 otherwise. -// -// Template meta programming: -// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. -// IteratorTraits - partial implementation of std::iterator_traits, which -// is not available in libCstd when compiled with Sun C++. -// -// Smart pointers: -// scoped_ptr - as in TR2. -// -// Regular expressions: -// RE - a simple regular expression class using the POSIX -// Extended Regular Expression syntax on UNIX-like -// platforms, or a reduced regular exception syntax on -// other platforms, including Windows. -// -// Logging: -// GTEST_LOG_() - logs messages at the specified severity level. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. -// -// Stdout and stderr capturing: -// CaptureStdout() - starts capturing stdout. -// GetCapturedStdout() - stops capturing stdout and returns the captured -// string. -// CaptureStderr() - starts capturing stderr. -// GetCapturedStderr() - stops capturing stderr and returns the captured -// string. -// -// Integer types: -// TypeWithSize - maps an integer to a int type. -// Int32, UInt32, Int64, UInt64, TimeInMillis -// - integers of known sizes. -// BiggestInt - the biggest signed integer type. -// -// Command-line utilities: -// GTEST_FLAG() - references a flag. -// GTEST_DECLARE_*() - declares a flag. -// GTEST_DEFINE_*() - defines a flag. -// GetArgvs() - returns the command line as a vector of strings. -// -// Environment variable utilities: -// GetEnv() - gets the value of an environment variable. -// BoolFromGTestEnv() - parses a bool environment variable. -// Int32FromGTestEnv() - parses an Int32 environment variable. -// StringFromGTestEnv() - parses a string environment variable. - -#include // for isspace, etc -#include // for ptrdiff_t -#include -#include -#include -#ifndef _WIN32_WCE -# include -# include -#endif // !_WIN32_WCE - -#include // NOLINT -#include // NOLINT -#include // NOLINT - -#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" -#define GTEST_FLAG_PREFIX_ "gtest_" -#define GTEST_FLAG_PREFIX_DASH_ "gtest-" -#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" -#define GTEST_NAME_ "Google Test" -#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" - -// Determines the version of gcc that is used to compile this. -#ifdef __GNUC__ -// 40302 means version 4.3.2. -# define GTEST_GCC_VER_ \ - (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) -#endif // __GNUC__ - -// Determines the platform on which Google Test is compiled. -#ifdef __CYGWIN__ -# define GTEST_OS_CYGWIN 1 -#elif defined __SYMBIAN32__ -# define GTEST_OS_SYMBIAN 1 -#elif defined _WIN32 -# define GTEST_OS_WINDOWS 1 -# ifdef _WIN32_WCE -# define GTEST_OS_WINDOWS_MOBILE 1 -# elif defined(__MINGW__) || defined(__MINGW32__) -# define GTEST_OS_WINDOWS_MINGW 1 -# else -# define GTEST_OS_WINDOWS_DESKTOP 1 -# endif // _WIN32_WCE -#elif defined __APPLE__ -# define GTEST_OS_MAC 1 -#elif defined __linux__ -# define GTEST_OS_LINUX 1 -# ifdef ANDROID -# define GTEST_OS_LINUX_ANDROID 1 -# endif // ANDROID -#elif defined __MVS__ -# define GTEST_OS_ZOS 1 -#elif defined(__sun) && defined(__SVR4) -# define GTEST_OS_SOLARIS 1 -#elif defined(_AIX) -# define GTEST_OS_AIX 1 -#elif defined(__hpux) -# define GTEST_OS_HPUX 1 -#elif defined __native_client__ -# define GTEST_OS_NACL 1 -#elif defined DTCENTER //Autostar add 中文用例转测试套名加行号的宏定义 by xutaiqiang -#define DTCENTER_CN2EN 1 -#endif // __CYGWIN__ - -// Brings in definitions for functions used in the testing::internal::posix -// namespace (read, write, close, chdir, isatty, stat). We do not currently -// use them on Windows Mobile. -#if !GTEST_OS_WINDOWS -// This assumes that non-Windows OSes provide unistd.h. For OSes where this -// is not the case, we need to include headers that provide the functions -// mentioned above. -# include -# if !GTEST_OS_NACL -// TODO(vladl@google.com): Remove this condition when Native Client SDK adds -// strings.h (tracked in -// http://code.google.com/p/nativeclient/issues/detail?id=1175). -# include // Native Client doesn't provide strings.h. -# endif -#elif !GTEST_OS_WINDOWS_MOBILE -# include -# include -#endif - -// Defines this to true iff Google Test can use POSIX regular expressions. -#ifndef GTEST_HAS_POSIX_RE -# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) -#endif - -#if GTEST_HAS_POSIX_RE - -// On some platforms, needs someone to define size_t, and -// won't compile otherwise. We can #include it here as we already -// included , which is guaranteed to define size_t through -// . -# include // NOLINT - -# define GTEST_USES_POSIX_RE 1 - -#elif GTEST_OS_WINDOWS - -// is not available on Windows. Use our own simple regex -// implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#else - -// may not be available on this platform. Use our own -// simple regex implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#endif // GTEST_HAS_POSIX_RE - -#ifndef GTEST_HAS_EXCEPTIONS -// The user didn't tell us whether exceptions are enabled, so we need -// to figure it out. -# if defined(_MSC_VER) || defined(__BORLANDC__) -// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS -// macro to enable exceptions, so we'll do the same. -// Assumes that exceptions are enabled by default. -# ifndef _HAS_EXCEPTIONS -# define _HAS_EXCEPTIONS 1 -# endif // _HAS_EXCEPTIONS -# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS -# elif defined(__GNUC__) && __EXCEPTIONS -// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__SUNPRO_CC) -// Sun Pro CC supports exceptions. However, there is no compile-time way of -// detecting whether they are enabled or not. Therefore, we assume that -// they are enabled unless the user tells us otherwise. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__IBMCPP__) && __EXCEPTIONS -// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__HP_aCC) -// Exception handling is in effect by default in HP aCC compiler. It has to -// be turned of by +noeh compiler option if desired. -# define GTEST_HAS_EXCEPTIONS 1 -# else -// For other compilers, we assume exceptions are disabled to be -// conservative. -# define GTEST_HAS_EXCEPTIONS 0 -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -#endif // GTEST_HAS_EXCEPTIONS - -#if !defined(GTEST_HAS_STD_STRING) -// Even though we don't use this macro any longer, we keep it in case -// some clients still depend on it. -# define GTEST_HAS_STD_STRING 1 -#elif !GTEST_HAS_STD_STRING -// The user told us that ::std::string isn't available. -# error "Google Test cannot be used where ::std::string isn't available." -#endif // !defined(GTEST_HAS_STD_STRING) - -#ifndef GTEST_HAS_GLOBAL_STRING -// The user didn't tell us whether ::string is available, so we need -// to figure it out. - -# define GTEST_HAS_GLOBAL_STRING 0 - -#endif // GTEST_HAS_GLOBAL_STRING - -#ifndef GTEST_HAS_STD_WSTRING -// The user didn't tell us whether ::std::wstring is available, so we need -// to figure it out. -// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring -// is available. - -// Cygwin 1.7 and below doesn't support ::std::wstring. -// Solaris' libc++ doesn't support it either. Android has -// no support for it at least as recent as Froyo (2.2). -# define GTEST_HAS_STD_WSTRING \ - (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) - -#endif // GTEST_HAS_STD_WSTRING - -#ifndef GTEST_HAS_GLOBAL_WSTRING -// The user didn't tell us whether ::wstring is available, so we need -// to figure it out. -# define GTEST_HAS_GLOBAL_WSTRING \ - (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) -#endif // GTEST_HAS_GLOBAL_WSTRING - -// Determines whether RTTI is available. -#ifndef GTEST_HAS_RTTI -// The user didn't tell us whether RTTI is enabled, so we need to -// figure it out. - -# ifdef _MSC_VER - -# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) - -# ifdef __GXX_RTTI -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif // __GXX_RTTI - -// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if -// both the typeid and dynamic_cast features are present. -# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) - -# ifdef __RTTI_ALL__ -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -# else - -// For all other compilers, we assume RTTI is enabled. -# define GTEST_HAS_RTTI 1 - -# endif // _MSC_VER - -#endif // GTEST_HAS_RTTI - -// It's this header's responsibility to #include when RTTI -// is enabled. -#if GTEST_HAS_RTTI -# include -#endif - -// Determines whether Google Test can use the pthreads library. -#ifndef GTEST_HAS_PTHREAD -// The user didn't tell us explicitly, so we assume pthreads support is -// available on Linux and Mac. -// -// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 -// to your compiler flags. -# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX) -#endif // GTEST_HAS_PTHREAD - -#if GTEST_HAS_PTHREAD -// gtest-port.h guarantees to #include when GTEST_HAS_PTHREAD is -// true. -# include // NOLINT - -// For timespec and nanosleep, used below. -# include // NOLINT -#endif - -// Determines whether Google Test can use tr1/tuple. You can define -// this macro to 0 to prevent Google Test from using tuple (any -// feature depending on tuple with be disabled in this mode). -#ifndef GTEST_HAS_TR1_TUPLE -// The user didn't tell us not to do it, so we assume it's OK. -# define GTEST_HAS_TR1_TUPLE 1 -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether Google Test's own tr1 tuple implementation -// should be used. -#ifndef GTEST_USE_OWN_TR1_TUPLE -// The user didn't tell us, so we need to figure it out. - -// We use our own TR1 tuple if we aren't sure the user has an -// implementation of it already. At this time, GCC 4.0.0+ and MSVC -// 2010 are the only mainstream compilers that come with a TR1 tuple -// implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by -// defining __GNUC__ and friends, but cannot compile GCC's tuple -// implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB -// Feature Pack download, which we cannot assume the user has. -# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \ - || _MSC_VER >= 1600 -# define GTEST_USE_OWN_TR1_TUPLE 0 -# else -# define GTEST_USE_OWN_TR1_TUPLE 1 -# endif - -#endif // GTEST_USE_OWN_TR1_TUPLE - -// To avoid conditional compilation everywhere, we make it -// gtest-port.h's responsibility to #include the header implementing -// tr1/tuple. -#if GTEST_HAS_TR1_TUPLE - -# if GTEST_USE_OWN_TR1_TUPLE -# include "gtest/internal/gtest-tuple.h" -# elif GTEST_OS_SYMBIAN - -// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to -// use STLport's tuple implementation, which unfortunately doesn't -// work as the copy of STLport distributed with Symbian is incomplete. -// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to -// use its own tuple implementation. -# ifdef BOOST_HAS_TR1_TUPLE -# undef BOOST_HAS_TR1_TUPLE -# endif // BOOST_HAS_TR1_TUPLE - -// This prevents , which defines -// BOOST_HAS_TR1_TUPLE, from being #included by Boost's . -# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED -# include - -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) -// GCC 4.0+ implements tr1/tuple in the header. This does -// not conform to the TR1 spec, which requires the header to be . - -# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 -// Until version 4.3.2, gcc has a bug that causes , -// which is #included by , to not compile when RTTI is -// disabled. _TR1_FUNCTIONAL is the header guard for -// . Hence the following #define is a hack to prevent -// from being included. -# define _TR1_FUNCTIONAL 1 -# include -# undef _TR1_FUNCTIONAL // Allows the user to #include - // if he chooses to. -# else -# include // NOLINT -# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 - -# else -// If the compiler is not GCC 4.0+, we assume the user is using a -// spec-conforming TR1 implementation. -# include // NOLINT -# endif // GTEST_USE_OWN_TR1_TUPLE - -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether clone(2) is supported. -// Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. -// Also see http://linux.die.net/man/2/clone. -#ifndef GTEST_HAS_CLONE -// The user didn't tell us, so we need to figure it out. - -# if GTEST_OS_LINUX && !defined(__ia64__) -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) - -#endif // GTEST_HAS_CLONE - -// Determines whether to support stream redirection. This is used to test -// output correctness and to implement death tests. -#ifndef GTEST_HAS_STREAM_REDIRECTION -// By default, we assume that stream redirection is supported on all -// platforms except known mobile ones. -# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN -# define GTEST_HAS_STREAM_REDIRECTION 0 -# else -# define GTEST_HAS_STREAM_REDIRECTION 1 -# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN -#endif // GTEST_HAS_STREAM_REDIRECTION - -// Determines whether to support death tests. -// Google Test does not support death tests for VC 7.1 and earlier as -// abort() in a VC 7.1 application compiled as GUI in debug config -// pops up a dialog window that cannot be suppressed programmatically. -#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ - (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ - GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX) -# define GTEST_HAS_DEATH_TEST 1 -# include // NOLINT -#endif - -// We don't support MSVC 7.1 with exceptions disabled now. Therefore -// all the compilers we care about are adequate for supporting -// value-parameterized tests. -#define GTEST_HAS_PARAM_TEST 1 - -// Determines whether to support type-driven tests. - -// Typed tests need and variadic macros, which GCC, VC++ 8.0, -// Sun Pro CC, IBM Visual Age, and HP aCC support. -#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ - defined(__IBMCPP__) || defined(__HP_aCC) -# define GTEST_HAS_TYPED_TEST 1 -# define GTEST_HAS_TYPED_TEST_P 1 -#endif - -// Determines whether to support Combine(). This only makes sense when -// value-parameterized tests are enabled. The implementation doesn't -// work on Sun Studio since it doesn't understand templated conversion -// operators. -#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) -# define GTEST_HAS_COMBINE 1 -#endif - -// Determines whether the system compiler uses UTF-16 for encoding wide strings. -#define GTEST_WIDE_STRING_USES_UTF16_ \ - (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) - -// Determines whether test results can be streamed to a socket. -#if GTEST_OS_LINUX -# define GTEST_CAN_STREAM_RESULTS_ 1 -#endif - -// Defines some utility macros. - -// The GNU compiler emits a warning if nested "if" statements are followed by -// an "else" statement and braces are not used to explicitly disambiguate the -// "else" binding. This leads to problems with code like: -// -// if (gate) -// ASSERT_*(condition) << "Some message"; -// -// The "switch (0) case 0:" idiom is used to suppress this. -#ifdef __INTEL_COMPILER -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ -#else -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT -#endif - -// Use this annotation at the end of a struct/class definition to -// prevent the compiler from optimizing away instances that are never -// used. This is useful when all interesting logic happens inside the -// c'tor and / or d'tor. Example: -// -// struct Foo { -// Foo() { ... } -// } GTEST_ATTRIBUTE_UNUSED_; -// -// Also use it after a variable or parameter declaration to tell the -// compiler the variable/parameter does not have to be used. -#if defined(__GNUC__) && !defined(COMPILER_ICC) -# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) -#else -# define GTEST_ATTRIBUTE_UNUSED_ -#endif - -// A macro to disallow operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_ASSIGN_(type)\ - void operator=(type const &) - -// A macro to disallow copy constructor and operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ - type(type const &);\ - GTEST_DISALLOW_ASSIGN_(type) - -// Tell the compiler to warn about unused return values for functions declared -// with this macro. The macro should be used on function declarations -// following the argument list: -// -// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; -#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) -# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) -#else -# define GTEST_MUST_USE_RESULT_ -#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC - -// Determine whether the compiler supports Microsoft's Structured Exception -// Handling. This is supported by several Windows compilers but generally -// does not exist on any other system. -#ifndef GTEST_HAS_SEH -// The user didn't tell us, so we need to figure it out. - -# if defined(_MSC_VER) || defined(__BORLANDC__) -// These two compilers are known to support SEH. -# define GTEST_HAS_SEH 1 -# else -// Assume no SEH. -# define GTEST_HAS_SEH 0 -# endif - -#endif // GTEST_HAS_SEH - -#ifdef _MSC_VER - -# if GTEST_LINKED_AS_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllimport) -# elif GTEST_CREATE_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllexport) -# endif - -#endif // _MSC_VER - -#ifndef GTEST_API_ -# define GTEST_API_ -#endif - -#ifdef __GNUC__ -// Ask the compiler to never inline a given function. -# define GTEST_NO_INLINE_ __attribute__((noinline)) -#else -# define GTEST_NO_INLINE_ -#endif - -namespace testing { - -class Message; - -namespace internal { - -class String; - -// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -template -struct CompileAssert { -}; - -#define GTEST_COMPILE_ASSERT_(expr, msg) \ - typedef ::testing::internal::CompileAssert<(bool(expr))> \ - msg[bool(expr) ? 1 : -1] - -// Implementation details of GTEST_COMPILE_ASSERT_: -// -// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outter parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// GTEST_COMPILE_ASSERT_(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. -// -// This template is declared, but intentionally undefined. -template -struct StaticAssertTypeEqHelper; - -template -struct StaticAssertTypeEqHelper {}; - -#if GTEST_HAS_GLOBAL_STRING -typedef ::string string; -#else -typedef ::std::string string; -#endif // GTEST_HAS_GLOBAL_STRING - -#if GTEST_HAS_GLOBAL_WSTRING -typedef ::wstring wstring; -#elif GTEST_HAS_STD_WSTRING -typedef ::std::wstring wstring; -#endif // GTEST_HAS_GLOBAL_WSTRING - -// A helper for suppressing warnings on constant condition. It just -// returns 'condition'. -GTEST_API_ bool IsTrue(bool condition); - -// Defines scoped_ptr. - -// This implementation of scoped_ptr is PARTIAL - it only contains -// enough stuff to satisfy Google Test's need. - -#pragma pack(push, 4) //该类修改为4字节对齐,防止用户修改字节对齐后不恢复,导致message_错误 - -template -class scoped_ptr { - public: - typedef T element_type; - - explicit scoped_ptr(T* p = NULL) : ptr_(p) {} - ~scoped_ptr() { reset(); } - - T& operator*() const { return *ptr_; } - T* operator->() const { return ptr_; } - T* get() const { return ptr_; } - - T* release() { - T* const ptr = ptr_; - ptr_ = NULL; - return ptr; - } - - void reset(T* p = NULL) { - if (p != ptr_) { - if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. - delete ptr_; - } - ptr_ = p; - } - } - private: - T* ptr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); -}; -#pragma pack(pop) - -// Defines RE. - -// A simple C++ wrapper for . It uses the POSIX Extended -// Regular Expression syntax. -class GTEST_API_ RE { - public: - // A copy constructor is required by the Standard to initialize object - // references from r-values. - RE(const RE& other) { Init(other.pattern()); } - - // Constructs an RE from a string. - RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT - -#if GTEST_HAS_GLOBAL_STRING - - RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT - -#endif // GTEST_HAS_GLOBAL_STRING - - RE(const char* regex) { Init(regex); } // NOLINT - ~RE(); - - // Returns the string representation of the regex. - const char* pattern() const { return pattern_; } - - // FullMatch(str, re) returns true iff regular expression re matches - // the entire str. - // PartialMatch(str, re) returns true iff regular expression re - // matches a substring of str (including str itself). - // - // TODO(wan@google.com): make FullMatch() and PartialMatch() work - // when str contains NUL characters. - static bool FullMatch(const ::std::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::std::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#if GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const ::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#endif // GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const char* str, const RE& re); - static bool PartialMatch(const char* str, const RE& re); - - private: - void Init(const char* regex); - - // We use a const char* instead of a string, as Google Test may be used - // where string is not available. We also do not use Google Test's own - // String type here, in order to simplify dependencies between the - // files. - const char* pattern_; - bool is_valid_; - -#if GTEST_USES_POSIX_RE - - regex_t full_regex_; // For FullMatch(). - regex_t partial_regex_; // For PartialMatch(). - -#else // GTEST_USES_SIMPLE_RE - - const char* full_pattern_; // For FullMatch(); - -#endif - - GTEST_DISALLOW_ASSIGN_(RE); -}; - -// Formats a source file path and a line number as they would appear -// in an error message from the compiler used to compile this code. -GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); - -// Formats a file location for compiler-independent XML output. -// Although this function is not platform dependent, we put it next to -// FormatFileLocation in order to contrast the two functions. -GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, - int line); - -// Defines logging utilities: -// GTEST_LOG_(severity) - logs messages at the specified severity level. The -// message itself is streamed into the macro. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. - -enum GTestLogSeverity { - GTEST_INFO, - GTEST_WARNING, - GTEST_ERROR, - GTEST_FATAL -}; - -// Formats log entry severity, provides a stream object for streaming the -// log message, and terminates the message with a newline when going out of -// scope. -class GTEST_API_ GTestLog { - public: - GTestLog(GTestLogSeverity severity, const char* file, int line); - - // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. - ~GTestLog(); - - ::std::ostream& GetStream() { return ::std::cerr; } - - private: - const GTestLogSeverity severity_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); -}; - -#define GTEST_LOG_(severity) \ - ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ - __FILE__, __LINE__).GetStream() - -inline void LogToStderr() {} -inline void FlushInfoLog() { fflush(NULL); } - -// INTERNAL IMPLEMENTATION - DO NOT USE. -// -// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition -// is not satisfied. -// Synopsys: -// GTEST_CHECK_(boolean_condition); -// or -// GTEST_CHECK_(boolean_condition) << "Additional message"; -// -// This checks the condition and if the condition is not satisfied -// it prints message about the condition violation, including the -// condition itself, plus additional message streamed into it, if any, -// and then it aborts the program. It aborts the program irrespective of -// whether it is built in the debug mode or not. -#define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " - -// An all-mode assert to verify that the given POSIX-style function -// call returns 0 (indicating success). Known limitation: this -// doesn't expand to a balanced 'if' statement, so enclose the macro -// in {} if you need to use it as the only statement in an 'if' -// branch. -#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ - if (const int gtest_error = (posix_call)) \ - GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ - << gtest_error - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Use ImplicitCast_ as a safe version of static_cast for upcasting in -// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a -// const Foo*). When you use ImplicitCast_, the compiler checks that -// the cast is safe. Such explicit ImplicitCast_s are necessary in -// surprisingly many situations where C++ demands an exact type match -// instead of an argument type convertable to a target type. -// -// The syntax for using ImplicitCast_ is the same as for static_cast: -// -// ImplicitCast_(expr) -// -// ImplicitCast_ would have been part of the C++ standard library, -// but the proposal was submitted too late. It will probably make -// its way into the language in the future. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., implicit_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template -inline To ImplicitCast_(To x) { return x; } - -// When you upcast (that is, cast a pointer from type Foo to type -// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts -// always succeed. When you downcast (that is, cast a pointer from -// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because -// how do you know the pointer is really of type SubclassOfFoo? It -// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, -// when you downcast, you should use this macro. In debug mode, we -// use dynamic_cast<> to double-check the downcast is legal (we die -// if it's not). In normal mode, we do the efficient static_cast<> -// instead. Thus, it's important to test in debug mode to make sure -// the cast is legal! -// This is the only place in the code we should use dynamic_cast<>. -// In particular, you SHOULDN'T be using dynamic_cast<> in order to -// do RTTI (eg code like this: -// if (dynamic_cast(foo)) HandleASubclass1Object(foo); -// if (dynamic_cast(foo)) HandleASubclass2Object(foo); -// You should design the code some other way not to need this. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., down_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template // use like this: DownCast_(foo); -inline To DownCast_(From* f) { // so we only accept pointers - // Ensures that To is a sub-type of From *. This test is here only - // for compile-time type checking, and has no overhead in an - // optimized build at run-time, as it will be optimized away - // completely. - if (false) { - const To to = NULL; - ::testing::internal::ImplicitCast_(to); - } - -#if GTEST_HAS_RTTI - // RTTI: debug mode only! - GTEST_CHECK_(f == NULL || dynamic_cast(f) != NULL); -#endif - return static_cast(f); -} - -// Downcasts the pointer of type Base to Derived. -// Derived must be a subclass of Base. The parameter MUST -// point to a class of type Derived, not any subclass of it. -// When RTTI is available, the function performs a runtime -// check to enforce this. -template -Derived* CheckedDowncastToActualType(Base* base) { -#if GTEST_HAS_RTTI - GTEST_CHECK_(typeid(*base) == typeid(Derived)); - return dynamic_cast(base); // NOLINT -#else - return static_cast(base); // Poor man's downcast. -#endif -} - -#if GTEST_HAS_STREAM_REDIRECTION - -// Defines the stderr capturer: -// CaptureStdout - starts capturing stdout. -// GetCapturedStdout - stops capturing stdout and returns the captured string. -// CaptureStderr - starts capturing stderr. -// GetCapturedStderr - stops capturing stderr and returns the captured string. -// -GTEST_API_ void CaptureStdout(); -GTEST_API_ String GetCapturedStdout(); -GTEST_API_ void CaptureStderr(); -GTEST_API_ String GetCapturedStderr(); - -#endif // GTEST_HAS_STREAM_REDIRECTION - - -#if GTEST_HAS_DEATH_TEST - -// A copy of all command line arguments. Set by InitGoogleTest(). -extern ::std::vector g_argvs; - -// GTEST_HAS_DEATH_TEST implies we have ::std::string. -const ::std::vector& GetArgvs(); - -#endif // GTEST_HAS_DEATH_TEST - -// Defines synchronization primitives. - -#if GTEST_HAS_PTHREAD - -// Sleeps for (roughly) n milli-seconds. This function is only for -// testing Google Test's own constructs. Don't use it in user tests, -// either directly or indirectly. -inline void SleepMilliseconds(int n) { - const timespec time = { - 0, // 0 seconds. - n * 1000L * 1000L, // And n ms. - }; - nanosleep(&time, NULL); -} - -// Allows a controller thread to pause execution of newly created -// threads until notified. Instances of this class must be created -// and destroyed in the controller thread. -// -// This class is only for testing Google Test's own constructs. Do not -// use it in user tests, either directly or indirectly. -class Notification { - public: - Notification() : notified_(false) {} - - // Notifies all threads created with this notification to start. Must - // be called from the controller thread. - void Notify() { notified_ = true; } - - // Blocks until the controller thread notifies. Must be called from a test - // thread. - void WaitForNotification() { - while(!notified_) { - SleepMilliseconds(10); - } - } - - private: - volatile bool notified_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); -}; - -// As a C-function, ThreadFuncWithCLinkage cannot be templated itself. -// Consequently, it cannot select a correct instantiation of ThreadWithParam -// in order to call its Run(). Introducing ThreadWithParamBase as a -// non-templated base class for ThreadWithParam allows us to bypass this -// problem. -class ThreadWithParamBase { - public: - virtual ~ThreadWithParamBase() {} - virtual void Run() = 0; -}; - -// pthread_create() accepts a pointer to a function type with the C linkage. -// According to the Standard (7.5/1), function types with different linkages -// are different even if they are otherwise identical. Some compilers (for -// example, SunStudio) treat them as different types. Since class methods -// cannot be defined with C-linkage we need to define a free C-function to -// pass into pthread_create(). -extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { - static_cast(thread)->Run(); - return NULL; -} - -// Helper class for testing Google Test's multi-threading constructs. -// To use it, write: -// -// void ThreadFunc(int param) { /* Do things with param */ } -// Notification thread_can_start; -// ... -// // The thread_can_start parameter is optional; you can supply NULL. -// ThreadWithParam thread(&ThreadFunc, 5, &thread_can_start); -// thread_can_start.Notify(); -// -// These classes are only for testing Google Test's own constructs. Do -// not use them in user tests, either directly or indirectly. -template -class ThreadWithParam : public ThreadWithParamBase { - public: - typedef void (*UserThreadFunc)(T); - - ThreadWithParam( - UserThreadFunc func, T param, Notification* thread_can_start) - : func_(func), - param_(param), - thread_can_start_(thread_can_start), - finished_(false) { - ThreadWithParamBase* const base = this; - // The thread can be created only after all fields except thread_ - // have been initialized. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); - } - ~ThreadWithParam() { Join(); } - - void Join() { - if (!finished_) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); - finished_ = true; - } - } - - virtual void Run() { - if (thread_can_start_ != NULL) - thread_can_start_->WaitForNotification(); - func_(param_); - } - - private: - const UserThreadFunc func_; // User-supplied thread function. - const T param_; // User-supplied parameter to the thread function. - // When non-NULL, used to block execution until the controller thread - // notifies. - Notification* const thread_can_start_; - bool finished_; // true iff we know that the thread function has finished. - pthread_t thread_; // The native thread object. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); -}; - -// MutexBase and Mutex implement mutex on pthreads-based platforms. They -// are used in conjunction with class MutexLock: -// -// Mutex mutex; -// ... -// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end -// // of the current scope. -// -// MutexBase implements behavior for both statically and dynamically -// allocated mutexes. Do not use MutexBase directly. Instead, write -// the following to define a static mutex: -// -// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); -// -// You can forward declare a static mutex like this: -// -// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); -// -// To create a dynamic mutex, just define an object of type Mutex. -class MutexBase { - public: - // Acquires this mutex. - void Lock() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); - owner_ = pthread_self(); - } - - // Releases this mutex. - void Unlock() { - // We don't protect writing to owner_ here, as it's the caller's - // responsibility to ensure that the current thread holds the - // mutex when this is called. - owner_ = 0; - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); - } - - // Does nothing if the current thread holds the mutex. Otherwise, crashes - // with high probability. - void AssertHeld() const { - GTEST_CHECK_(owner_ == pthread_self()) - << "The current thread is not holding the mutex @" << this; - } - - // A static mutex may be used before main() is entered. It may even - // be used before the dynamic initialization stage. Therefore we - // must be able to initialize a static mutex object at link time. - // This means MutexBase has to be a POD and its member variables - // have to be public. - public: - pthread_mutex_t mutex_; // The underlying pthread mutex. - pthread_t owner_; // The thread holding the mutex; 0 means no one holds it. -}; - -// Forward-declares a static mutex. -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::MutexBase mutex - -// Defines and statically (i.e. at link time) initializes a static mutex. -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ - ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 } - -// The Mutex class can only be used for mutexes created at runtime. It -// shares its API with MutexBase otherwise. -class Mutex : public MutexBase { - public: - Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - owner_ = 0; - } - ~Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); -}; - -// We cannot name this class MutexLock as the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(MutexBase* mutex) - : mutex_(mutex) { mutex_->Lock(); } - - ~GTestMutexLock() { mutex_->Unlock(); } - - private: - MutexBase* const mutex_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); -}; - -typedef GTestMutexLock MutexLock; - -// Helpers for ThreadLocal. - -// pthread_key_create() requires DeleteThreadLocalValue() to have -// C-linkage. Therefore it cannot be templatized to access -// ThreadLocal. Hence the need for class -// ThreadLocalValueHolderBase. -class ThreadLocalValueHolderBase { - public: - virtual ~ThreadLocalValueHolderBase() {} -}; - -// Called by pthread to delete thread-local data stored by -// pthread_setspecific(). -extern "C" inline void DeleteThreadLocalValue(void* value_holder) { - delete static_cast(value_holder); -} - -// Implements thread-local storage on pthreads-based systems. -// -// // Thread 1 -// ThreadLocal tl(100); // 100 is the default value for each thread. -// -// // Thread 2 -// tl.set(150); // Changes the value for thread 2 only. -// EXPECT_EQ(150, tl.get()); -// -// // Thread 1 -// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. -// tl.set(200); -// EXPECT_EQ(200, tl.get()); -// -// The template type argument T must have a public copy constructor. -// In addition, the default ThreadLocal constructor requires T to have -// a public default constructor. -// -// An object managed for a thread by a ThreadLocal instance is deleted -// when the thread exits. Or, if the ThreadLocal instance dies in -// that thread, when the ThreadLocal dies. It's the user's -// responsibility to ensure that all other threads using a ThreadLocal -// have exited when it dies, or the per-thread objects for those -// threads will not be deleted. -// -// Google Test only uses global ThreadLocal objects. That means they -// will die after main() has returned. Therefore, no per-thread -// object managed by Google Test will be leaked as long as all threads -// using Google Test have exited when main() returns. -template -class ThreadLocal { - public: - ThreadLocal() : key_(CreateKey()), - default_() {} - explicit ThreadLocal(const T& value) : key_(CreateKey()), - default_(value) {} - - ~ThreadLocal() { - // Destroys the managed object for the current thread, if any. - DeleteThreadLocalValue(pthread_getspecific(key_)); - - // Releases resources associated with the key. This will *not* - // delete managed objects for other threads. - GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); - } - - T* pointer() { return GetOrCreateValue(); } - const T* pointer() const { return GetOrCreateValue(); } - const T& get() const { return *pointer(); } - void set(const T& value) { *pointer() = value; } - - private: - // Holds a value of type T. - class ValueHolder : public ThreadLocalValueHolderBase { - public: - explicit ValueHolder(const T& value) : value_(value) {} - - T* pointer() { return &value_; } - - private: - T value_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); - }; - - static pthread_key_t CreateKey() { - pthread_key_t key; - // When a thread exits, DeleteThreadLocalValue() will be called on - // the object managed for that thread. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_key_create(&key, &DeleteThreadLocalValue)); - return key; - } - - T* GetOrCreateValue() const { - ThreadLocalValueHolderBase* const holder = - static_cast(pthread_getspecific(key_)); - if (holder != NULL) { - return CheckedDowncastToActualType(holder)->pointer(); - } - - ValueHolder* const new_holder = new ValueHolder(default_); - ThreadLocalValueHolderBase* const holder_base = new_holder; - GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); - return new_holder->pointer(); - } - - // A key pthreads uses for looking up per-thread values. - const pthread_key_t key_; - const T default_; // The default value for each thread. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); -}; - -# define GTEST_IS_THREADSAFE 1 - -#else // GTEST_HAS_PTHREAD - -// A dummy implementation of synchronization primitives (mutex, lock, -// and thread-local variable). Necessary for compiling Google Test where -// mutex is not supported - using Google Test in multiple threads is not -// supported on such platforms. - -class Mutex { - public: - Mutex() {} - void AssertHeld() const {} -}; - -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::Mutex mutex - -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex - -class GTestMutexLock { - public: - explicit GTestMutexLock(Mutex*) {} // NOLINT -}; - -typedef GTestMutexLock MutexLock; - -template -class ThreadLocal { - public: - ThreadLocal() : value_() {} - explicit ThreadLocal(const T& value) : value_(value) {} - T* pointer() { return &value_; } - const T* pointer() const { return &value_; } - const T& get() const { return value_; } - void set(const T& value) { value_ = value; } - private: - T value_; -}; - -// The above synchronization primitives have dummy implementations. -// Therefore Google Test is not thread-safe. -# define GTEST_IS_THREADSAFE 0 - -#endif // GTEST_HAS_PTHREAD - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -GTEST_API_ size_t GetThreadCount(); - -// Passing non-POD classes through ellipsis (...) crashes the ARM -// compiler and generates a warning in Sun Studio. The Nokia Symbian -// and the IBM XL C/C++ compiler try to instantiate a copy constructor -// for objects passed through ellipsis (...), failing for uncopyable -// objects. We define this to ensure that only POD is passed through -// ellipsis on these systems. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_ELLIPSIS_NEEDS_POD_ 1 -#else -# define GTEST_CAN_COMPARE_NULL 1 -#endif - -// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between -// const T& and const T* in a function template. These compilers -// _can_ decide between class template specializations for T and T*, -// so a tr1::type_traits-like is_pointer works. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) -# define GTEST_NEEDS_IS_POINTER_ 1 -#endif - -template -struct bool_constant { - typedef bool_constant type; - static const bool value = bool_value; -}; -template const bool bool_constant::value; - -typedef bool_constant false_type; -typedef bool_constant true_type; - -template -struct is_pointer : public false_type {}; - -template -struct is_pointer : public true_type {}; - -template -struct IteratorTraits { - typedef typename Iterator::value_type value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -#if GTEST_OS_WINDOWS -# define GTEST_PATH_SEP_ "\\" -# define GTEST_HAS_ALT_PATH_SEP_ 1 -// The biggest signed integer type the compiler supports. -typedef __int64 BiggestInt; -#else -# define GTEST_PATH_SEP_ "/" -# define GTEST_HAS_ALT_PATH_SEP_ 0 -typedef long long BiggestInt; // NOLINT -#endif // GTEST_OS_WINDOWS - -// Utilities for char. - -// isspace(int ch) and friends accept an unsigned char or EOF. char -// may be signed, depending on the compiler (or compiler flags). -// Therefore we need to cast a char to unsigned char before calling -// isspace(), etc. - -inline bool IsAlpha(char ch) { - return isalpha(static_cast(ch)) != 0; -} -inline bool IsAlNum(char ch) { - return isalnum(static_cast(ch)) != 0; -} -inline bool IsDigit(char ch) { - return isdigit(static_cast(ch)) != 0; -} -inline bool IsLower(char ch) { - return islower(static_cast(ch)) != 0; -} -inline bool IsSpace(char ch) { - return isspace(static_cast(ch)) != 0; -} -inline bool IsUpper(char ch) { - return isupper(static_cast(ch)) != 0; -} -inline bool IsXDigit(char ch) { - return isxdigit(static_cast(ch)) != 0; -} - -inline char ToLower(char ch) { - return static_cast(tolower(static_cast(ch))); -} -inline char ToUpper(char ch) { - return static_cast(toupper(static_cast(ch))); -} - -// The testing::internal::posix namespace holds wrappers for common -// POSIX functions. These wrappers hide the differences between -// Windows/MSVC and POSIX systems. Since some compilers define these -// standard functions as macros, the wrapper cannot have the same name -// as the wrapped function. - -namespace posix { - -// Functions with a different name on Windows. - -#if GTEST_OS_WINDOWS - -typedef struct _stat StatStruct; - -# ifdef __BORLANDC__ -inline int IsATTY(int fd) { return isatty(fd); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -# else // !__BORLANDC__ -# if GTEST_OS_WINDOWS_MOBILE -inline int IsATTY(int /* fd */) { return 0; } -# else -inline int IsATTY(int fd) { return _isatty(fd); } -# endif // GTEST_OS_WINDOWS_MOBILE -inline int StrCaseCmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return _strdup(src); } -# endif // __BORLANDC__ - -# if GTEST_OS_WINDOWS_MOBILE -inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } -// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this -// time and thus not defined there. -# else -inline int FileNo(FILE* file) { return _fileno(file); } -inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } -inline int RmDir(const char* dir) { return _rmdir(dir); } -inline bool IsDir(const StatStruct& st) { - return (_S_IFDIR & st.st_mode) != 0; -} -# endif // GTEST_OS_WINDOWS_MOBILE - -#else - -typedef struct stat StatStruct; - -inline int FileNo(FILE* file) { return fileno(file); } -inline int IsATTY(int fd) { return isatty(fd); } -inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -inline int RmDir(const char* dir) { return rmdir(dir); } -inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } - -#endif // GTEST_OS_WINDOWS - -// Functions deprecated by MSVC 8.0. - -#ifdef _MSC_VER -// Temporarily disable warning 4996 (deprecated function). -# pragma warning(push) -# pragma warning(disable:4996) -#endif - -//由autostar修改,因为加入其他功能引入mfc的文件,符号冲突,把此函数改名字 -inline const char* ASStrNCpy(char* dest, const char* src, size_t n) { - return strncpy(dest, src, n); -} - -// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and -// StrError() aren't needed on Windows CE at this time and thus not -// defined there. - -#if !GTEST_OS_WINDOWS_MOBILE -inline int ChDir(const char* dir) { return chdir(dir); } -#endif -inline FILE* FOpen(const char* path, const char* mode) { - return fopen(path, mode); -} -#if !GTEST_OS_WINDOWS_MOBILE -inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { - return freopen(path, mode, stream); -} -inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } -#endif -inline int FClose(FILE* fp) { return fclose(fp); } -#if !GTEST_OS_WINDOWS_MOBILE -inline int Read(int fd, void* buf, unsigned int count) { - return static_cast(read(fd, buf, count)); -} -inline int Write(int fd, const void* buf, unsigned int count) { - return static_cast(write(fd, buf, count)); -} -inline int Close(int fd) { return close(fd); } -inline const char* StrError(int errnum) { return strerror(errnum); } -#endif -inline const char* GetEnv(const char* name) { -#if GTEST_OS_WINDOWS_MOBILE - // We are on Windows CE, which has no environment variables. - return NULL; -#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) - // Environment variables which we programmatically clear will be set to the - // empty string rather than unset (NULL). Handle that case. - const char* const env = getenv(name); - return (env != NULL && env[0] != '\0') ? env : NULL; -#else - return getenv(name); -#endif -} - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - -#if GTEST_OS_WINDOWS_MOBILE -// Windows CE has no C library. The abort() function is used in -// several places in Google Test. This implementation provides a reasonable -// imitation of standard behaviour. -void Abort(); -#else -inline void Abort() { abort(); } -#endif // GTEST_OS_WINDOWS_MOBILE - -} // namespace posix - -// The maximum number a BiggestInt can represent. This definition -// works no matter BiggestInt is represented in one's complement or -// two's complement. -// -// We cannot rely on numeric_limits in STL, as __int64 and long long -// are not part of standard C++ and numeric_limits doesn't need to be -// defined for them. -const BiggestInt kMaxBiggestInt = - ~(static_cast(1) << (8*sizeof(BiggestInt) - 1)); - -// This template class serves as a compile-time function from size to -// type. It maps a size in bytes to a primitive type with that -// size. e.g. -// -// TypeWithSize<4>::UInt -// -// is typedef-ed to be unsigned int (unsigned integer made up of 4 -// bytes). -// -// Such functionality should belong to STL, but I cannot find it -// there. -// -// Google Test uses this class in the implementation of floating-point -// comparison. -// -// For now it only handles UInt (unsigned int) as that's all Google Test -// needs. Other types can be easily added in the future if need -// arises. -template -class TypeWithSize { - public: - // This prevents the user from using TypeWithSize with incorrect - // values of N. - typedef void UInt; -}; - -// The specialization for size 4. -template <> -class TypeWithSize<4> { - public: - // unsigned int has size 4 in both gcc and MSVC. - // - // As base/basictypes.h doesn't compile on Windows, we cannot use - // uint32, uint64, and etc here. - typedef int Int; - typedef unsigned int UInt; -}; - -// The specialization for size 8. -template <> -class TypeWithSize<8> { - public: - -#if GTEST_OS_WINDOWS - typedef __int64 Int; - typedef unsigned __int64 UInt; -#else - typedef long long Int; // NOLINT - typedef unsigned long long UInt; // NOLINT -#endif // GTEST_OS_WINDOWS -}; - -// Integer types of known sizes. -typedef TypeWithSize<4>::Int Int32; -typedef TypeWithSize<4>::UInt UInt32; -typedef TypeWithSize<8>::Int Int64; -typedef TypeWithSize<8>::UInt UInt64; -typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. - -// Utilities for command line flags and environment variables. - -// Macro for referencing flags. -#define GTEST_FLAG(name) FLAGS_gtest_##name - -// Macros for declaring flags. -#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) -#define GTEST_DECLARE_int32_(name) \ - GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) -#define GTEST_DECLARE_string_(name) \ - GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name) - -// Macros for defining flags. -#define GTEST_DEFINE_bool_(name, default_val, doc) \ - GTEST_API_ bool GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_int32_(name, default_val, doc) \ - GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_string_(name, default_val, doc) \ - GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val) - -// Parses 'str' for a 32-bit signed integer. If successful, writes the result -// to *value and returns true; otherwise leaves *value unchanged and returns -// false. -// TODO(chandlerc): Find a better way to refactor flag and environment parsing -// out of both gtest-port.cc and gtest.cc to avoid exporting this utility -// function. -bool ParseInt32(const Message& src_text, const char* str, Int32* value); - -// Parses a bool/Int32/string from the environment variable -// corresponding to the given Google Test flag. -bool BoolFromGTestEnv(const char* flag, bool default_val); -GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); -const char* StringFromGTestEnv(const char* flag, const char* default_val); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ diff --git a/cli/test/include/gtest/internal/gtest-string.h b/cli/test/include/gtest/internal/gtest-string.h deleted file mode 100644 index dc3a07b..0000000 --- a/cli/test/include/gtest/internal/gtest-string.h +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares the String class and functions used internally by -// Google Test. They are subject to change without notice. They should not used -// by code external to Google Test. -// -// This header file is #included by . -// It should not be #included by other files. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ - -#ifdef __BORLANDC__ -// string.h is not guaranteed to provide strcpy on C++ Builder. -# include -#endif - -#include -#include "gtest/internal/gtest-port.h" - -#include - -namespace testing { -namespace internal { - -// String - a UTF-8 string class. -// -// For historic reasons, we don't use std::string. -// -// TODO(wan@google.com): replace this class with std::string or -// implement it in terms of the latter. -// -// Note that String can represent both NULL and the empty string, -// while std::string cannot represent NULL. -// -// NULL and the empty string are considered different. NULL is less -// than anything (including the empty string) except itself. -// -// This class only provides minimum functionality necessary for -// implementing Google Test. We do not intend to implement a full-fledged -// string class here. -// -// Since the purpose of this class is to provide a substitute for -// std::string on platforms where it cannot be used, we define a copy -// constructor and assignment operators such that we don't need -// conditional compilation in a lot of places. -// -// In order to make the representation efficient, the d'tor of String -// is not virtual. Therefore DO NOT INHERIT FROM String. -class GTEST_API_ String { - public: - // Static utility methods - - // Returns the input enclosed in double quotes if it's not NULL; - // otherwise returns "(null)". For example, "\"Hello\"" is returned - // for input "Hello". - // - // This is useful for printing a C string in the syntax of a literal. - // - // Known issue: escape sequences are not handled yet. - static String ShowCStringQuoted(const char* c_str); - - // Clones a 0-terminated C string, allocating memory using new. The - // caller is responsible for deleting the return value using - // delete[]. Returns the cloned string, or NULL if the input is - // NULL. - // - // This is different from strdup() in string.h, which allocates - // memory using malloc(). - static const char* CloneCString(const char* c_str); - -#if GTEST_OS_WINDOWS_MOBILE - // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be - // able to pass strings to Win32 APIs on CE we need to convert them - // to 'Unicode', UTF-16. - - // Creates a UTF-16 wide string from the given ANSI string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the wide string, or NULL if the - // input is NULL. - // - // The wide string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static LPCWSTR AnsiToUtf16(const char* c_str); - - // Creates an ANSI string from the given wide string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the ANSI string, or NULL if the - // input is NULL. - // - // The returned string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static const char* Utf16ToAnsi(LPCWSTR utf16_str); -#endif - - // Compares two C strings. Returns true iff they have the same content. - // - // Unlike strcmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CStringEquals(const char* lhs, const char* rhs); - - // Converts a wide C string to a String using the UTF-8 encoding. - // NULL will be converted to "(null)". If an error occurred during - // the conversion, "(failed to convert from wide string)" is - // returned. - static String ShowWideCString(const wchar_t* wide_c_str); - - // Similar to ShowWideCString(), except that this function encloses - // the converted string in double quotes. - static String ShowWideCStringQuoted(const wchar_t* wide_c_str); - - // Compares two wide C strings. Returns true iff they have the same - // content. - // - // Unlike wcscmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); - - // Compares two C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike strcasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CaseInsensitiveCStringEquals(const char* lhs, - const char* rhs); - - // Compares two wide C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike wcscasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL wide C string, - // including the empty string. - // NB: The implementations on different platforms slightly differ. - // On windows, this method uses _wcsicmp which compares according to LC_CTYPE - // environment variable. On GNU platform this method uses wcscasecmp - // which compares according to LC_CTYPE category of the current locale. - // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the - // current locale. - static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); - - // Formats a list of arguments to a String, using the same format - // spec string as for printf. - // - // We do not use the StringPrintf class as it is not universally - // available. - // - // The result is limited to 4096 characters (including the tailing - // 0). If 4096 characters are not enough to format the input, - // "" is returned. - static String Format(const char* format, ...); - - // C'tors - - // The default c'tor constructs a NULL string. - String() : c_str_(NULL), length_(0) {} - - // Constructs a String by cloning a 0-terminated C string. - String(const char* a_c_str) { // NOLINT - if (a_c_str == NULL) { - c_str_ = NULL; - length_ = 0; - } else { - ConstructNonNull(a_c_str, strlen(a_c_str)); - } - } - - // Constructs a String by copying a given number of chars from a - // buffer. E.g. String("hello", 3) creates the string "hel", - // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "", - // and String(NULL, 1) results in access violation. - String(const char* buffer, size_t a_length) { - ConstructNonNull(buffer, a_length); - } - - // The copy c'tor creates a new copy of the string. The two - // String objects do not share content. - String(const String& str) : c_str_(NULL), length_(0) { *this = str; } - - // D'tor. String is intended to be a final class, so the d'tor - // doesn't need to be virtual. - ~String() { delete[] c_str_; } - - // Allows a String to be implicitly converted to an ::std::string or - // ::string, and vice versa. Converting a String containing a NULL - // pointer to ::std::string or ::string is undefined behavior. - // Converting a ::std::string or ::string containing an embedded NUL - // character to a String will result in the prefix up to the first - // NUL character. - String(const ::std::string& str) { - ConstructNonNull(str.c_str(), str.length()); - } - - operator ::std::string() const { return ::std::string(c_str(), length()); } - -#if GTEST_HAS_GLOBAL_STRING - String(const ::string& str) { - ConstructNonNull(str.c_str(), str.length()); - } - - operator ::string() const { return ::string(c_str(), length()); } -#endif // GTEST_HAS_GLOBAL_STRING - - // Returns true iff this is an empty string (i.e. ""). - bool empty() const { return (c_str() != NULL) && (length() == 0); } - - // Compares this with another String. - // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0 - // if this is greater than rhs. - int Compare(const String& rhs) const; - - // Returns true iff this String equals the given C string. A NULL - // string and a non-NULL string are considered not equal. - bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; } - - // Returns true iff this String is less than the given String. A - // NULL string is considered less than "". - bool operator<(const String& rhs) const { return Compare(rhs) < 0; } - - // Returns true iff this String doesn't equal the given C string. A NULL - // string and a non-NULL string are considered not equal. - bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); } - - // Returns true iff this String ends with the given suffix. *Any* - // String is considered to end with a NULL or empty suffix. - bool EndsWith(const char* suffix) const; - - // Returns true iff this String ends with the given suffix, not considering - // case. Any String is considered to end with a NULL or empty suffix. - bool EndsWithCaseInsensitive(const char* suffix) const; - - // Returns the length of the encapsulated string, or 0 if the - // string is NULL. - size_t length() const { return length_; } - - // Gets the 0-terminated C string this String object represents. - // The String object still owns the string. Therefore the caller - // should NOT delete the return value. - const char* c_str() const { return c_str_; } - - // Assigns a C string to this object. Self-assignment works. - const String& operator=(const char* a_c_str) { - return *this = String(a_c_str); - } - - // Assigns a String object to this object. Self-assignment works. - const String& operator=(const String& rhs) { - if (this != &rhs) { - delete[] c_str_; - if (rhs.c_str() == NULL) { - c_str_ = NULL; - length_ = 0; - } else { - ConstructNonNull(rhs.c_str(), rhs.length()); - } - } - - return *this; - } - - private: - // Constructs a non-NULL String from the given content. This - // function can only be called when c_str_ has not been allocated. - // ConstructNonNull(NULL, 0) results in an empty string (""). - // ConstructNonNull(NULL, non_zero) is undefined behavior. - void ConstructNonNull(const char* buffer, size_t a_length) { - char* const str = new char[a_length + 1]; - memcpy(str, buffer, a_length); - str[a_length] = '\0'; - c_str_ = str; - length_ = a_length; - } - - const char* c_str_; - size_t length_; -}; // class String - -// Streams a String to an ostream. Each '\0' character in the String -// is replaced with "\\0". -inline ::std::ostream& operator<<(::std::ostream& os, const String& str) { - if (str.c_str() == NULL) { - os << "(null)"; - } else { - const char* const c_str = str.c_str(); - for (size_t i = 0; i != str.length(); i++) { - if (c_str[i] == '\0') { - os << "\\0"; - } else { - os << c_str[i]; - } - } - } - return os; -} - -// Gets the content of the stringstream's buffer as a String. Each '\0' -// character in the buffer is replaced with "\\0". -GTEST_API_ String StringStreamToString(::std::stringstream* stream); - -// Converts a streamable value to a String. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". - -// Declared here but defined in gtest.h, so that it has access -// to the definition of the Message class, required by the ARM -// compiler. -template -String StreamableToString(const T& streamable); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ diff --git a/cli/test/include/gtest/internal/gtest-tuple.h b/cli/test/include/gtest/internal/gtest-tuple.h deleted file mode 100644 index d1af50e..0000000 --- a/cli/test/include/gtest/internal/gtest-tuple.h +++ /dev/null @@ -1,968 +0,0 @@ -// This file was GENERATED by a script. DO NOT EDIT BY HAND!!! - -// Copyright 2009 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> -#define GTEST_1_TUPLE_(T) tuple -#define GTEST_2_TUPLE_(T) tuple -#define GTEST_3_TUPLE_(T) tuple -#define GTEST_4_TUPLE_(T) tuple -#define GTEST_5_TUPLE_(T) tuple -#define GTEST_6_TUPLE_(T) tuple -#define GTEST_7_TUPLE_(T) tuple -#define GTEST_8_TUPLE_(T) tuple -#define GTEST_9_TUPLE_(T) tuple -#define GTEST_10_TUPLE_(T) tuple - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. -#define GTEST_0_TYPENAMES_(T) -#define GTEST_1_TYPENAMES_(T) typename T##0 -#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 -#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 -#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3 -#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4 -#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5 -#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6 -#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 -#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8 -#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8, typename T##9 - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - -template -struct TupleElement { typedef T0 type; }; - -template -struct TupleElement { typedef T1 type; }; - -template -struct TupleElement { typedef T2 type; }; - -template -struct TupleElement { typedef T3 type; }; - -template -struct TupleElement { typedef T4 type; }; - -template -struct TupleElement { typedef T5 type; }; - -template -struct TupleElement { typedef T6 type; }; - -template -struct TupleElement { typedef T7 type; }; - -template -struct TupleElement { typedef T8 type; }; - -template -struct TupleElement { typedef T9 type; }; - -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - -template -class GTEST_1_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} - - tuple(const tuple& t) : f0_(t.f0_) {} - - template - tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_1_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { - f0_ = t.f0_; - return *this; - } - - T0 f0_; -}; - -template -class GTEST_2_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), - f1_(f1) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} - - template - tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_2_TUPLE_(U)& t) { - return CopyFrom(t); - } - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - return *this; - } - - T0 f0_; - T1 f1_; -}; - -template -class GTEST_3_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - template - tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_3_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; -}; - -template -class GTEST_4_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} - - template - tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_4_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; -}; - -template -class GTEST_5_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, - GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_) {} - - template - tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_5_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; -}; - -template -class GTEST_6_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_) {} - - template - tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_6_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; -}; - -template -class GTEST_7_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - template - tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_7_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; -}; - -template -class GTEST_8_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, - GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - template - tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_8_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; -}; - -template -class GTEST_9_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - template - tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_9_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; -}; - -template -class tuple { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), - f9_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} - - template - tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), - f9_(t.f9_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_10_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - f9_ = t.f9_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; - T9 f9_; -}; - -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -template -inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { - return GTEST_1_TUPLE_(T)(f0); -} - -template -inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { - return GTEST_2_TUPLE_(T)(f0, f1); -} - -template -inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { - return GTEST_3_TUPLE_(T)(f0, f1, f2); -} - -template -inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3) { - return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); -} - -template -inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4) { - return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); -} - -template -inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5) { - return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); -} - -template -inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6) { - return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); -} - -template -inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { - return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); -} - -template -inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8) { - return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); -} - -template -inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8, const T9& f9) { - return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); -} - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - -template -struct tuple_size { static const int value = 0; }; - -template -struct tuple_size { static const int value = 1; }; - -template -struct tuple_size { static const int value = 2; }; - -template -struct tuple_size { static const int value = 3; }; - -template -struct tuple_size { static const int value = 4; }; - -template -struct tuple_size { static const int value = 5; }; - -template -struct tuple_size { static const int value = 6; }; - -template -struct tuple_size { static const int value = 7; }; - -template -struct tuple_size { static const int value = 8; }; - -template -struct tuple_size { static const int value = 9; }; - -template -struct tuple_size { static const int value = 10; }; - -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - -template <> -class Get<0> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - Field(Tuple& t) { return t.f0_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - ConstField(const Tuple& t) { return t.f0_; } -}; - -template <> -class Get<1> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - Field(Tuple& t) { return t.f1_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - ConstField(const Tuple& t) { return t.f1_; } -}; - -template <> -class Get<2> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - Field(Tuple& t) { return t.f2_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - ConstField(const Tuple& t) { return t.f2_; } -}; - -template <> -class Get<3> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - Field(Tuple& t) { return t.f3_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - ConstField(const Tuple& t) { return t.f3_; } -}; - -template <> -class Get<4> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - Field(Tuple& t) { return t.f4_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - ConstField(const Tuple& t) { return t.f4_; } -}; - -template <> -class Get<5> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - Field(Tuple& t) { return t.f5_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - ConstField(const Tuple& t) { return t.f5_; } -}; - -template <> -class Get<6> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - Field(Tuple& t) { return t.f6_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - ConstField(const Tuple& t) { return t.f6_; } -}; - -template <> -class Get<7> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - Field(Tuple& t) { return t.f7_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - ConstField(const Tuple& t) { return t.f7_; } -}; - -template <> -class Get<8> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - Field(Tuple& t) { return t.f8_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - ConstField(const Tuple& t) { return t.f8_; } -}; - -template <> -class Get<9> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - Field(Tuple& t) { return t.f9_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - ConstField(const Tuple& t) { return t.f9_; } -}; - -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(const GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - -#undef GTEST_0_TUPLE_ -#undef GTEST_1_TUPLE_ -#undef GTEST_2_TUPLE_ -#undef GTEST_3_TUPLE_ -#undef GTEST_4_TUPLE_ -#undef GTEST_5_TUPLE_ -#undef GTEST_6_TUPLE_ -#undef GTEST_7_TUPLE_ -#undef GTEST_8_TUPLE_ -#undef GTEST_9_TUPLE_ -#undef GTEST_10_TUPLE_ - -#undef GTEST_0_TYPENAMES_ -#undef GTEST_1_TYPENAMES_ -#undef GTEST_2_TYPENAMES_ -#undef GTEST_3_TYPENAMES_ -#undef GTEST_4_TYPENAMES_ -#undef GTEST_5_TYPENAMES_ -#undef GTEST_6_TYPENAMES_ -#undef GTEST_7_TYPENAMES_ -#undef GTEST_8_TYPENAMES_ -#undef GTEST_9_TYPENAMES_ -#undef GTEST_10_TYPENAMES_ - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/cli/test/include/gtest/internal/gtest-tuple.h.pump b/cli/test/include/gtest/internal/gtest-tuple.h.pump deleted file mode 100644 index ef51909..0000000 --- a/cli/test/include/gtest/internal/gtest-tuple.h.pump +++ /dev/null @@ -1,336 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 10 $$ Maximum number of tuple fields we want to support. -$$ This meta comment fixes auto-indentation in Emacs. }} -// Copyright 2009 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - - -$range i 0..n-1 -$range j 0..n -$range k 1..n -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> - -$for k [[ -$range m 0..k-1 -$range m2 k..n-1 -#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]> - -]] - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. - -$for j [[ -$range m 0..j-1 -#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]] - - -]] - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template <$for i, [[typename T$i = void]]> -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - - -$for i [[ -template -struct TupleElement [[]] -{ typedef T$i type; }; - - -]] -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - - -$for k [[ -$range m 0..k-1 -template -class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] { - public: - template friend class gtest_internal::Get; - - tuple() : $for m, [[f$(m)_()]] {} - - explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]] -$for m, [[f$(m)_(f$m)]] {} - - tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} - - template - tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {} - -$if k == 2 [[ - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - -]] - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) { - return CopyFrom(t); - } - -$if k == 2 [[ - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - -]] - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) { - -$for m [[ - f$(m)_ = t.f$(m)_; - -]] - return *this; - } - - -$for m [[ - T$m f$(m)_; - -]] -}; - - -]] -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -$for k [[ -$range m 0..k-1 - -template -inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) { - return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]); -} - -]] - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - - -$for j [[ -template -struct tuple_size { static const int value = $j; }; - - -]] -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - - -$for i [[ -template <> -class Get<$i> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) - Field(Tuple& t) { return t.f$(i)_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple)) - ConstField(const Tuple& t) { return t.f$(i)_; } -}; - - -]] -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) -get(GTEST_$(n)_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T))) -get(const GTEST_$(n)_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t, - const GTEST_$(n)_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t, - const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - - -$for j [[ -#undef GTEST_$(j)_TUPLE_ - -]] - - -$for j [[ -#undef GTEST_$(j)_TYPENAMES_ - -]] - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ diff --git a/cli/test/include/gtest/internal/gtest-type-util.h b/cli/test/include/gtest/internal/gtest-type-util.h deleted file mode 100644 index b7b01b0..0000000 --- a/cli/test/include/gtest/internal/gtest-type-util.h +++ /dev/null @@ -1,3330 +0,0 @@ -// This file was GENERATED by command: -// pump.py gtest-type-util.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most 50 types in a list, and at most 50 -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-string.h" - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# ifdef __GLIBCXX__ -# include -# elif defined(__HP_aCC) -# include -# endif // __GLIBCXX__ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -String GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if defined(__GLIBCXX__) || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# ifdef __GLIBCXX__ - using abi::__cxa_demangle; -# endif // __GLIBCXX__ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const String name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // __GLIBCXX__ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; -template -struct Types2 { - typedef T1 Head; - typedef Types1 Tail; -}; - -template -struct Types3 { - typedef T1 Head; - typedef Types2 Tail; -}; - -template -struct Types4 { - typedef T1 Head; - typedef Types3 Tail; -}; - -template -struct Types5 { - typedef T1 Head; - typedef Types4 Tail; -}; - -template -struct Types6 { - typedef T1 Head; - typedef Types5 Tail; -}; - -template -struct Types7 { - typedef T1 Head; - typedef Types6 Tail; -}; - -template -struct Types8 { - typedef T1 Head; - typedef Types7 Tail; -}; - -template -struct Types9 { - typedef T1 Head; - typedef Types8 Tail; -}; - -template -struct Types10 { - typedef T1 Head; - typedef Types9 Tail; -}; - -template -struct Types11 { - typedef T1 Head; - typedef Types10 Tail; -}; - -template -struct Types12 { - typedef T1 Head; - typedef Types11 Tail; -}; - -template -struct Types13 { - typedef T1 Head; - typedef Types12 Tail; -}; - -template -struct Types14 { - typedef T1 Head; - typedef Types13 Tail; -}; - -template -struct Types15 { - typedef T1 Head; - typedef Types14 Tail; -}; - -template -struct Types16 { - typedef T1 Head; - typedef Types15 Tail; -}; - -template -struct Types17 { - typedef T1 Head; - typedef Types16 Tail; -}; - -template -struct Types18 { - typedef T1 Head; - typedef Types17 Tail; -}; - -template -struct Types19 { - typedef T1 Head; - typedef Types18 Tail; -}; - -template -struct Types20 { - typedef T1 Head; - typedef Types19 Tail; -}; - -template -struct Types21 { - typedef T1 Head; - typedef Types20 Tail; -}; - -template -struct Types22 { - typedef T1 Head; - typedef Types21 Tail; -}; - -template -struct Types23 { - typedef T1 Head; - typedef Types22 Tail; -}; - -template -struct Types24 { - typedef T1 Head; - typedef Types23 Tail; -}; - -template -struct Types25 { - typedef T1 Head; - typedef Types24 Tail; -}; - -template -struct Types26 { - typedef T1 Head; - typedef Types25 Tail; -}; - -template -struct Types27 { - typedef T1 Head; - typedef Types26 Tail; -}; - -template -struct Types28 { - typedef T1 Head; - typedef Types27 Tail; -}; - -template -struct Types29 { - typedef T1 Head; - typedef Types28 Tail; -}; - -template -struct Types30 { - typedef T1 Head; - typedef Types29 Tail; -}; - -template -struct Types31 { - typedef T1 Head; - typedef Types30 Tail; -}; - -template -struct Types32 { - typedef T1 Head; - typedef Types31 Tail; -}; - -template -struct Types33 { - typedef T1 Head; - typedef Types32 Tail; -}; - -template -struct Types34 { - typedef T1 Head; - typedef Types33 Tail; -}; - -template -struct Types35 { - typedef T1 Head; - typedef Types34 Tail; -}; - -template -struct Types36 { - typedef T1 Head; - typedef Types35 Tail; -}; - -template -struct Types37 { - typedef T1 Head; - typedef Types36 Tail; -}; - -template -struct Types38 { - typedef T1 Head; - typedef Types37 Tail; -}; - -template -struct Types39 { - typedef T1 Head; - typedef Types38 Tail; -}; - -template -struct Types40 { - typedef T1 Head; - typedef Types39 Tail; -}; - -template -struct Types41 { - typedef T1 Head; - typedef Types40 Tail; -}; - -template -struct Types42 { - typedef T1 Head; - typedef Types41 Tail; -}; - -template -struct Types43 { - typedef T1 Head; - typedef Types42 Tail; -}; - -template -struct Types44 { - typedef T1 Head; - typedef Types43 Tail; -}; - -template -struct Types45 { - typedef T1 Head; - typedef Types44 Tail; -}; - -template -struct Types46 { - typedef T1 Head; - typedef Types45 Tail; -}; - -template -struct Types47 { - typedef T1 Head; - typedef Types46 Tail; -}; - -template -struct Types48 { - typedef T1 Head; - typedef Types47 Tail; -}; - -template -struct Types49 { - typedef T1 Head; - typedef Types48 Tail; -}; - -template -struct Types50 { - typedef T1 Head; - typedef Types49 Tail; -}; - - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. -template -struct Types { - typedef internal::Types50 type; -}; - -template <> -struct Types { - typedef internal::Types0 type; -}; -template -struct Types { - typedef internal::Types1 type; -}; -template -struct Types { - typedef internal::Types2 type; -}; -template -struct Types { - typedef internal::Types3 type; -}; -template -struct Types { - typedef internal::Types4 type; -}; -template -struct Types { - typedef internal::Types5 type; -}; -template -struct Types { - typedef internal::Types6 type; -}; -template -struct Types { - typedef internal::Types7 type; -}; -template -struct Types { - typedef internal::Types8 type; -}; -template -struct Types { - typedef internal::Types9 type; -}; -template -struct Types { - typedef internal::Types10 type; -}; -template -struct Types { - typedef internal::Types11 type; -}; -template -struct Types { - typedef internal::Types12 type; -}; -template -struct Types { - typedef internal::Types13 type; -}; -template -struct Types { - typedef internal::Types14 type; -}; -template -struct Types { - typedef internal::Types15 type; -}; -template -struct Types { - typedef internal::Types16 type; -}; -template -struct Types { - typedef internal::Types17 type; -}; -template -struct Types { - typedef internal::Types18 type; -}; -template -struct Types { - typedef internal::Types19 type; -}; -template -struct Types { - typedef internal::Types20 type; -}; -template -struct Types { - typedef internal::Types21 type; -}; -template -struct Types { - typedef internal::Types22 type; -}; -template -struct Types { - typedef internal::Types23 type; -}; -template -struct Types { - typedef internal::Types24 type; -}; -template -struct Types { - typedef internal::Types25 type; -}; -template -struct Types { - typedef internal::Types26 type; -}; -template -struct Types { - typedef internal::Types27 type; -}; -template -struct Types { - typedef internal::Types28 type; -}; -template -struct Types { - typedef internal::Types29 type; -}; -template -struct Types { - typedef internal::Types30 type; -}; -template -struct Types { - typedef internal::Types31 type; -}; -template -struct Types { - typedef internal::Types32 type; -}; -template -struct Types { - typedef internal::Types33 type; -}; -template -struct Types { - typedef internal::Types34 type; -}; -template -struct Types { - typedef internal::Types35 type; -}; -template -struct Types { - typedef internal::Types36 type; -}; -template -struct Types { - typedef internal::Types37 type; -}; -template -struct Types { - typedef internal::Types38 type; -}; -template -struct Types { - typedef internal::Types39 type; -}; -template -struct Types { - typedef internal::Types40 type; -}; -template -struct Types { - typedef internal::Types41 type; -}; -template -struct Types { - typedef internal::Types42 type; -}; -template -struct Types { - typedef internal::Types43 type; -}; -template -struct Types { - typedef internal::Types44 type; -}; -template -struct Types { - typedef internal::Types45 type; -}; -template -struct Types { - typedef internal::Types46 type; -}; -template -struct Types { - typedef internal::Types47 type; -}; -template -struct Types { - typedef internal::Types48 type; -}; -template -struct Types { - typedef internal::Types49 type; -}; - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; -template -struct Templates2 { - typedef TemplateSel Head; - typedef Templates1 Tail; -}; - -template -struct Templates3 { - typedef TemplateSel Head; - typedef Templates2 Tail; -}; - -template -struct Templates4 { - typedef TemplateSel Head; - typedef Templates3 Tail; -}; - -template -struct Templates5 { - typedef TemplateSel Head; - typedef Templates4 Tail; -}; - -template -struct Templates6 { - typedef TemplateSel Head; - typedef Templates5 Tail; -}; - -template -struct Templates7 { - typedef TemplateSel Head; - typedef Templates6 Tail; -}; - -template -struct Templates8 { - typedef TemplateSel Head; - typedef Templates7 Tail; -}; - -template -struct Templates9 { - typedef TemplateSel Head; - typedef Templates8 Tail; -}; - -template -struct Templates10 { - typedef TemplateSel Head; - typedef Templates9 Tail; -}; - -template -struct Templates11 { - typedef TemplateSel Head; - typedef Templates10 Tail; -}; - -template -struct Templates12 { - typedef TemplateSel Head; - typedef Templates11 Tail; -}; - -template -struct Templates13 { - typedef TemplateSel Head; - typedef Templates12 Tail; -}; - -template -struct Templates14 { - typedef TemplateSel Head; - typedef Templates13 Tail; -}; - -template -struct Templates15 { - typedef TemplateSel Head; - typedef Templates14 Tail; -}; - -template -struct Templates16 { - typedef TemplateSel Head; - typedef Templates15 Tail; -}; - -template -struct Templates17 { - typedef TemplateSel Head; - typedef Templates16 Tail; -}; - -template -struct Templates18 { - typedef TemplateSel Head; - typedef Templates17 Tail; -}; - -template -struct Templates19 { - typedef TemplateSel Head; - typedef Templates18 Tail; -}; - -template -struct Templates20 { - typedef TemplateSel Head; - typedef Templates19 Tail; -}; - -template -struct Templates21 { - typedef TemplateSel Head; - typedef Templates20 Tail; -}; - -template -struct Templates22 { - typedef TemplateSel Head; - typedef Templates21 Tail; -}; - -template -struct Templates23 { - typedef TemplateSel Head; - typedef Templates22 Tail; -}; - -template -struct Templates24 { - typedef TemplateSel Head; - typedef Templates23 Tail; -}; - -template -struct Templates25 { - typedef TemplateSel Head; - typedef Templates24 Tail; -}; - -template -struct Templates26 { - typedef TemplateSel Head; - typedef Templates25 Tail; -}; - -template -struct Templates27 { - typedef TemplateSel Head; - typedef Templates26 Tail; -}; - -template -struct Templates28 { - typedef TemplateSel Head; - typedef Templates27 Tail; -}; - -template -struct Templates29 { - typedef TemplateSel Head; - typedef Templates28 Tail; -}; - -template -struct Templates30 { - typedef TemplateSel Head; - typedef Templates29 Tail; -}; - -template -struct Templates31 { - typedef TemplateSel Head; - typedef Templates30 Tail; -}; - -template -struct Templates32 { - typedef TemplateSel Head; - typedef Templates31 Tail; -}; - -template -struct Templates33 { - typedef TemplateSel Head; - typedef Templates32 Tail; -}; - -template -struct Templates34 { - typedef TemplateSel Head; - typedef Templates33 Tail; -}; - -template -struct Templates35 { - typedef TemplateSel Head; - typedef Templates34 Tail; -}; - -template -struct Templates36 { - typedef TemplateSel Head; - typedef Templates35 Tail; -}; - -template -struct Templates37 { - typedef TemplateSel Head; - typedef Templates36 Tail; -}; - -template -struct Templates38 { - typedef TemplateSel Head; - typedef Templates37 Tail; -}; - -template -struct Templates39 { - typedef TemplateSel Head; - typedef Templates38 Tail; -}; - -template -struct Templates40 { - typedef TemplateSel Head; - typedef Templates39 Tail; -}; - -template -struct Templates41 { - typedef TemplateSel Head; - typedef Templates40 Tail; -}; - -template -struct Templates42 { - typedef TemplateSel Head; - typedef Templates41 Tail; -}; - -template -struct Templates43 { - typedef TemplateSel Head; - typedef Templates42 Tail; -}; - -template -struct Templates44 { - typedef TemplateSel Head; - typedef Templates43 Tail; -}; - -template -struct Templates45 { - typedef TemplateSel Head; - typedef Templates44 Tail; -}; - -template -struct Templates46 { - typedef TemplateSel Head; - typedef Templates45 Tail; -}; - -template -struct Templates47 { - typedef TemplateSel Head; - typedef Templates46 Tail; -}; - -template -struct Templates48 { - typedef TemplateSel Head; - typedef Templates47 Tail; -}; - -template -struct Templates49 { - typedef TemplateSel Head; - typedef Templates48 Tail; -}; - -template -struct Templates50 { - typedef TemplateSel Head; - typedef Templates49 Tail; -}; - - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. -template -struct Templates { - typedef Templates50 type; -}; - -template <> -struct Templates { - typedef Templates0 type; -}; -template -struct Templates { - typedef Templates1 type; -}; -template -struct Templates { - typedef Templates2 type; -}; -template -struct Templates { - typedef Templates3 type; -}; -template -struct Templates { - typedef Templates4 type; -}; -template -struct Templates { - typedef Templates5 type; -}; -template -struct Templates { - typedef Templates6 type; -}; -template -struct Templates { - typedef Templates7 type; -}; -template -struct Templates { - typedef Templates8 type; -}; -template -struct Templates { - typedef Templates9 type; -}; -template -struct Templates { - typedef Templates10 type; -}; -template -struct Templates { - typedef Templates11 type; -}; -template -struct Templates { - typedef Templates12 type; -}; -template -struct Templates { - typedef Templates13 type; -}; -template -struct Templates { - typedef Templates14 type; -}; -template -struct Templates { - typedef Templates15 type; -}; -template -struct Templates { - typedef Templates16 type; -}; -template -struct Templates { - typedef Templates17 type; -}; -template -struct Templates { - typedef Templates18 type; -}; -template -struct Templates { - typedef Templates19 type; -}; -template -struct Templates { - typedef Templates20 type; -}; -template -struct Templates { - typedef Templates21 type; -}; -template -struct Templates { - typedef Templates22 type; -}; -template -struct Templates { - typedef Templates23 type; -}; -template -struct Templates { - typedef Templates24 type; -}; -template -struct Templates { - typedef Templates25 type; -}; -template -struct Templates { - typedef Templates26 type; -}; -template -struct Templates { - typedef Templates27 type; -}; -template -struct Templates { - typedef Templates28 type; -}; -template -struct Templates { - typedef Templates29 type; -}; -template -struct Templates { - typedef Templates30 type; -}; -template -struct Templates { - typedef Templates31 type; -}; -template -struct Templates { - typedef Templates32 type; -}; -template -struct Templates { - typedef Templates33 type; -}; -template -struct Templates { - typedef Templates34 type; -}; -template -struct Templates { - typedef Templates35 type; -}; -template -struct Templates { - typedef Templates36 type; -}; -template -struct Templates { - typedef Templates37 type; -}; -template -struct Templates { - typedef Templates38 type; -}; -template -struct Templates { - typedef Templates39 type; -}; -template -struct Templates { - typedef Templates40 type; -}; -template -struct Templates { - typedef Templates41 type; -}; -template -struct Templates { - typedef Templates42 type; -}; -template -struct Templates { - typedef Templates43 type; -}; -template -struct Templates { - typedef Templates44 type; -}; -template -struct Templates { - typedef Templates45 type; -}; -template -struct Templates { - typedef Templates46 type; -}; -template -struct Templates { - typedef Templates47 type; -}; -template -struct Templates { - typedef Templates48 type; -}; -template -struct Templates { - typedef Templates49 type; -}; - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { typedef Types1 type; }; - -template -struct TypeList > { - typedef typename Types::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/cli/test/include/gtest/internal/gtest-type-util.h.pump b/cli/test/include/gtest/internal/gtest-type-util.h.pump deleted file mode 100644 index 27f331d..0000000 --- a/cli/test/include/gtest/internal/gtest-type-util.h.pump +++ /dev/null @@ -1,296 +0,0 @@ -$$ -*- mode: c++; -*- -$var n = 50 $$ Maximum length of type lists we want to support. -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most $n types in a list, and at most $n -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -#include "gtest/internal/gtest-port.h" -#include "gtest/internal/gtest-string.h" - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# ifdef __GLIBCXX__ -# include -# elif defined(__HP_aCC) -# include -# endif // __GLIBCXX__ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -String GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if defined(__GLIBCXX__) || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# ifdef __GLIBCXX__ - using abi::__cxa_demangle; -# endif // __GLIBCXX__ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const String name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // __GLIBCXX__ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; - -$range i 2..n - -$for i [[ -$range j 1..i -$range k 2..i -template <$for j, [[typename T$j]]> -struct Types$i { - typedef T1 Head; - typedef Types$(i-1)<$for k, [[T$k]]> Tail; -}; - - -]] - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. - -$range i 1..n -template <$for i, [[typename T$i = internal::None]]> -struct Types { - typedef internal::Types$n<$for i, [[T$i]]> type; -}; - -template <> -struct Types<$for i, [[internal::None]]> { - typedef internal::Types0 type; -}; - -$range i 1..n-1 -$for i [[ -$range j 1..i -$range k i+1..n -template <$for j, [[typename T$j]]> -struct Types<$for j, [[T$j]]$for k[[, internal::None]]> { - typedef internal::Types$i<$for j, [[T$j]]> type; -}; - -]] - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; - -$range i 2..n - -$for i [[ -$range j 1..i -$range k 2..i -template <$for j, [[GTEST_TEMPLATE_ T$j]]> -struct Templates$i { - typedef TemplateSel Head; - typedef Templates$(i-1)<$for k, [[T$k]]> Tail; -}; - - -]] - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. - -$range i 1..n -template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]> -struct Templates { - typedef Templates$n<$for i, [[T$i]]> type; -}; - -template <> -struct Templates<$for i, [[NoneT]]> { - typedef Templates0 type; -}; - -$range i 1..n-1 -$for i [[ -$range j 1..i -$range k i+1..n -template <$for j, [[GTEST_TEMPLATE_ T$j]]> -struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> { - typedef Templates$i<$for j, [[T$j]]> type; -}; - -]] - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { typedef Types1 type; }; - - -$range i 1..n -template <$for i, [[typename T$i]]> -struct TypeList > { - typedef typename Types<$for i, [[T$i]]>::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ diff --git a/cli/test/include/gtest/msxml6.h b/cli/test/include/gtest/msxml6.h deleted file mode 100644 index f7946e3..0000000 --- a/cli/test/include/gtest/msxml6.h +++ /dev/null @@ -1,27093 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0366 */ -/* Compiler settings for msxml6.idl: - Oicf, W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __msxml6_h__ -#define __msxml6_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IXMLDOMImplementation_FWD_DEFINED__ -#define __IXMLDOMImplementation_FWD_DEFINED__ -typedef interface IXMLDOMImplementation IXMLDOMImplementation; -#endif /* __IXMLDOMImplementation_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMNode_FWD_DEFINED__ -#define __IXMLDOMNode_FWD_DEFINED__ -typedef interface IXMLDOMNode IXMLDOMNode; -#endif /* __IXMLDOMNode_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMDocumentFragment_FWD_DEFINED__ -#define __IXMLDOMDocumentFragment_FWD_DEFINED__ -typedef interface IXMLDOMDocumentFragment IXMLDOMDocumentFragment; -#endif /* __IXMLDOMDocumentFragment_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMDocument_FWD_DEFINED__ -#define __IXMLDOMDocument_FWD_DEFINED__ -typedef interface IXMLDOMDocument IXMLDOMDocument; -#endif /* __IXMLDOMDocument_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMDocument2_FWD_DEFINED__ -#define __IXMLDOMDocument2_FWD_DEFINED__ -typedef interface IXMLDOMDocument2 IXMLDOMDocument2; -#endif /* __IXMLDOMDocument2_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMDocument3_FWD_DEFINED__ -#define __IXMLDOMDocument3_FWD_DEFINED__ -typedef interface IXMLDOMDocument3 IXMLDOMDocument3; -#endif /* __IXMLDOMDocument3_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMNodeList_FWD_DEFINED__ -#define __IXMLDOMNodeList_FWD_DEFINED__ -typedef interface IXMLDOMNodeList IXMLDOMNodeList; -#endif /* __IXMLDOMNodeList_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMNamedNodeMap_FWD_DEFINED__ -#define __IXMLDOMNamedNodeMap_FWD_DEFINED__ -typedef interface IXMLDOMNamedNodeMap IXMLDOMNamedNodeMap; -#endif /* __IXMLDOMNamedNodeMap_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMCharacterData_FWD_DEFINED__ -#define __IXMLDOMCharacterData_FWD_DEFINED__ -typedef interface IXMLDOMCharacterData IXMLDOMCharacterData; -#endif /* __IXMLDOMCharacterData_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMAttribute_FWD_DEFINED__ -#define __IXMLDOMAttribute_FWD_DEFINED__ -typedef interface IXMLDOMAttribute IXMLDOMAttribute; -#endif /* __IXMLDOMAttribute_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMElement_FWD_DEFINED__ -#define __IXMLDOMElement_FWD_DEFINED__ -typedef interface IXMLDOMElement IXMLDOMElement; -#endif /* __IXMLDOMElement_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMText_FWD_DEFINED__ -#define __IXMLDOMText_FWD_DEFINED__ -typedef interface IXMLDOMText IXMLDOMText; -#endif /* __IXMLDOMText_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMComment_FWD_DEFINED__ -#define __IXMLDOMComment_FWD_DEFINED__ -typedef interface IXMLDOMComment IXMLDOMComment; -#endif /* __IXMLDOMComment_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMProcessingInstruction_FWD_DEFINED__ -#define __IXMLDOMProcessingInstruction_FWD_DEFINED__ -typedef interface IXMLDOMProcessingInstruction IXMLDOMProcessingInstruction; -#endif /* __IXMLDOMProcessingInstruction_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMCDATASection_FWD_DEFINED__ -#define __IXMLDOMCDATASection_FWD_DEFINED__ -typedef interface IXMLDOMCDATASection IXMLDOMCDATASection; -#endif /* __IXMLDOMCDATASection_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMDocumentType_FWD_DEFINED__ -#define __IXMLDOMDocumentType_FWD_DEFINED__ -typedef interface IXMLDOMDocumentType IXMLDOMDocumentType; -#endif /* __IXMLDOMDocumentType_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMNotation_FWD_DEFINED__ -#define __IXMLDOMNotation_FWD_DEFINED__ -typedef interface IXMLDOMNotation IXMLDOMNotation; -#endif /* __IXMLDOMNotation_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMEntity_FWD_DEFINED__ -#define __IXMLDOMEntity_FWD_DEFINED__ -typedef interface IXMLDOMEntity IXMLDOMEntity; -#endif /* __IXMLDOMEntity_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMEntityReference_FWD_DEFINED__ -#define __IXMLDOMEntityReference_FWD_DEFINED__ -typedef interface IXMLDOMEntityReference IXMLDOMEntityReference; -#endif /* __IXMLDOMEntityReference_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMParseError_FWD_DEFINED__ -#define __IXMLDOMParseError_FWD_DEFINED__ -typedef interface IXMLDOMParseError IXMLDOMParseError; -#endif /* __IXMLDOMParseError_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMParseError2_FWD_DEFINED__ -#define __IXMLDOMParseError2_FWD_DEFINED__ -typedef interface IXMLDOMParseError2 IXMLDOMParseError2; -#endif /* __IXMLDOMParseError2_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMParseErrorCollection_FWD_DEFINED__ -#define __IXMLDOMParseErrorCollection_FWD_DEFINED__ -typedef interface IXMLDOMParseErrorCollection IXMLDOMParseErrorCollection; -#endif /* __IXMLDOMParseErrorCollection_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMSchemaCollection_FWD_DEFINED__ -#define __IXMLDOMSchemaCollection_FWD_DEFINED__ -typedef interface IXMLDOMSchemaCollection IXMLDOMSchemaCollection; -#endif /* __IXMLDOMSchemaCollection_FWD_DEFINED__ */ - - -#ifndef __IXTLRuntime_FWD_DEFINED__ -#define __IXTLRuntime_FWD_DEFINED__ -typedef interface IXTLRuntime IXTLRuntime; -#endif /* __IXTLRuntime_FWD_DEFINED__ */ - - -#ifndef __IXSLTemplate_FWD_DEFINED__ -#define __IXSLTemplate_FWD_DEFINED__ -typedef interface IXSLTemplate IXSLTemplate; -#endif /* __IXSLTemplate_FWD_DEFINED__ */ - - -#ifndef __IXSLProcessor_FWD_DEFINED__ -#define __IXSLProcessor_FWD_DEFINED__ -typedef interface IXSLProcessor IXSLProcessor; -#endif /* __IXSLProcessor_FWD_DEFINED__ */ - - -#ifndef __ISAXXMLReader_FWD_DEFINED__ -#define __ISAXXMLReader_FWD_DEFINED__ -typedef interface ISAXXMLReader ISAXXMLReader; -#endif /* __ISAXXMLReader_FWD_DEFINED__ */ - - -#ifndef __ISAXXMLFilter_FWD_DEFINED__ -#define __ISAXXMLFilter_FWD_DEFINED__ -typedef interface ISAXXMLFilter ISAXXMLFilter; -#endif /* __ISAXXMLFilter_FWD_DEFINED__ */ - - -#ifndef __ISAXLocator_FWD_DEFINED__ -#define __ISAXLocator_FWD_DEFINED__ -typedef interface ISAXLocator ISAXLocator; -#endif /* __ISAXLocator_FWD_DEFINED__ */ - - -#ifndef __ISAXEntityResolver_FWD_DEFINED__ -#define __ISAXEntityResolver_FWD_DEFINED__ -typedef interface ISAXEntityResolver ISAXEntityResolver; -#endif /* __ISAXEntityResolver_FWD_DEFINED__ */ - - -#ifndef __ISAXContentHandler_FWD_DEFINED__ -#define __ISAXContentHandler_FWD_DEFINED__ -typedef interface ISAXContentHandler ISAXContentHandler; -#endif /* __ISAXContentHandler_FWD_DEFINED__ */ - - -#ifndef __ISAXDTDHandler_FWD_DEFINED__ -#define __ISAXDTDHandler_FWD_DEFINED__ -typedef interface ISAXDTDHandler ISAXDTDHandler; -#endif /* __ISAXDTDHandler_FWD_DEFINED__ */ - - -#ifndef __ISAXErrorHandler_FWD_DEFINED__ -#define __ISAXErrorHandler_FWD_DEFINED__ -typedef interface ISAXErrorHandler ISAXErrorHandler; -#endif /* __ISAXErrorHandler_FWD_DEFINED__ */ - - -#ifndef __ISAXLexicalHandler_FWD_DEFINED__ -#define __ISAXLexicalHandler_FWD_DEFINED__ -typedef interface ISAXLexicalHandler ISAXLexicalHandler; -#endif /* __ISAXLexicalHandler_FWD_DEFINED__ */ - - -#ifndef __ISAXDeclHandler_FWD_DEFINED__ -#define __ISAXDeclHandler_FWD_DEFINED__ -typedef interface ISAXDeclHandler ISAXDeclHandler; -#endif /* __ISAXDeclHandler_FWD_DEFINED__ */ - - -#ifndef __ISAXAttributes_FWD_DEFINED__ -#define __ISAXAttributes_FWD_DEFINED__ -typedef interface ISAXAttributes ISAXAttributes; -#endif /* __ISAXAttributes_FWD_DEFINED__ */ - - -#ifndef __IVBSAXXMLReader_FWD_DEFINED__ -#define __IVBSAXXMLReader_FWD_DEFINED__ -typedef interface IVBSAXXMLReader IVBSAXXMLReader; -#endif /* __IVBSAXXMLReader_FWD_DEFINED__ */ - - -#ifndef __IVBSAXXMLFilter_FWD_DEFINED__ -#define __IVBSAXXMLFilter_FWD_DEFINED__ -typedef interface IVBSAXXMLFilter IVBSAXXMLFilter; -#endif /* __IVBSAXXMLFilter_FWD_DEFINED__ */ - - -#ifndef __IVBSAXLocator_FWD_DEFINED__ -#define __IVBSAXLocator_FWD_DEFINED__ -typedef interface IVBSAXLocator IVBSAXLocator; -#endif /* __IVBSAXLocator_FWD_DEFINED__ */ - - -#ifndef __IVBSAXEntityResolver_FWD_DEFINED__ -#define __IVBSAXEntityResolver_FWD_DEFINED__ -typedef interface IVBSAXEntityResolver IVBSAXEntityResolver; -#endif /* __IVBSAXEntityResolver_FWD_DEFINED__ */ - - -#ifndef __IVBSAXContentHandler_FWD_DEFINED__ -#define __IVBSAXContentHandler_FWD_DEFINED__ -typedef interface IVBSAXContentHandler IVBSAXContentHandler; -#endif /* __IVBSAXContentHandler_FWD_DEFINED__ */ - - -#ifndef __IVBSAXDTDHandler_FWD_DEFINED__ -#define __IVBSAXDTDHandler_FWD_DEFINED__ -typedef interface IVBSAXDTDHandler IVBSAXDTDHandler; -#endif /* __IVBSAXDTDHandler_FWD_DEFINED__ */ - - -#ifndef __IVBSAXErrorHandler_FWD_DEFINED__ -#define __IVBSAXErrorHandler_FWD_DEFINED__ -typedef interface IVBSAXErrorHandler IVBSAXErrorHandler; -#endif /* __IVBSAXErrorHandler_FWD_DEFINED__ */ - - -#ifndef __IVBSAXLexicalHandler_FWD_DEFINED__ -#define __IVBSAXLexicalHandler_FWD_DEFINED__ -typedef interface IVBSAXLexicalHandler IVBSAXLexicalHandler; -#endif /* __IVBSAXLexicalHandler_FWD_DEFINED__ */ - - -#ifndef __IVBSAXDeclHandler_FWD_DEFINED__ -#define __IVBSAXDeclHandler_FWD_DEFINED__ -typedef interface IVBSAXDeclHandler IVBSAXDeclHandler; -#endif /* __IVBSAXDeclHandler_FWD_DEFINED__ */ - - -#ifndef __IVBSAXAttributes_FWD_DEFINED__ -#define __IVBSAXAttributes_FWD_DEFINED__ -typedef interface IVBSAXAttributes IVBSAXAttributes; -#endif /* __IVBSAXAttributes_FWD_DEFINED__ */ - - -#ifndef __IMXWriter_FWD_DEFINED__ -#define __IMXWriter_FWD_DEFINED__ -typedef interface IMXWriter IMXWriter; -#endif /* __IMXWriter_FWD_DEFINED__ */ - - -#ifndef __IMXAttributes_FWD_DEFINED__ -#define __IMXAttributes_FWD_DEFINED__ -typedef interface IMXAttributes IMXAttributes; -#endif /* __IMXAttributes_FWD_DEFINED__ */ - - -#ifndef __IMXReaderControl_FWD_DEFINED__ -#define __IMXReaderControl_FWD_DEFINED__ -typedef interface IMXReaderControl IMXReaderControl; -#endif /* __IMXReaderControl_FWD_DEFINED__ */ - - -#ifndef __IMXSchemaDeclHandler_FWD_DEFINED__ -#define __IMXSchemaDeclHandler_FWD_DEFINED__ -typedef interface IMXSchemaDeclHandler IMXSchemaDeclHandler; -#endif /* __IMXSchemaDeclHandler_FWD_DEFINED__ */ - - -#ifndef __IMXXMLFilter_FWD_DEFINED__ -#define __IMXXMLFilter_FWD_DEFINED__ -typedef interface IMXXMLFilter IMXXMLFilter; -#endif /* __IMXXMLFilter_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMSchemaCollection2_FWD_DEFINED__ -#define __IXMLDOMSchemaCollection2_FWD_DEFINED__ -typedef interface IXMLDOMSchemaCollection2 IXMLDOMSchemaCollection2; -#endif /* __IXMLDOMSchemaCollection2_FWD_DEFINED__ */ - - -#ifndef __ISchemaStringCollection_FWD_DEFINED__ -#define __ISchemaStringCollection_FWD_DEFINED__ -typedef interface ISchemaStringCollection ISchemaStringCollection; -#endif /* __ISchemaStringCollection_FWD_DEFINED__ */ - - -#ifndef __ISchemaItemCollection_FWD_DEFINED__ -#define __ISchemaItemCollection_FWD_DEFINED__ -typedef interface ISchemaItemCollection ISchemaItemCollection; -#endif /* __ISchemaItemCollection_FWD_DEFINED__ */ - - -#ifndef __ISchemaItem_FWD_DEFINED__ -#define __ISchemaItem_FWD_DEFINED__ -typedef interface ISchemaItem ISchemaItem; -#endif /* __ISchemaItem_FWD_DEFINED__ */ - - -#ifndef __ISchema_FWD_DEFINED__ -#define __ISchema_FWD_DEFINED__ -typedef interface ISchema ISchema; -#endif /* __ISchema_FWD_DEFINED__ */ - - -#ifndef __ISchemaParticle_FWD_DEFINED__ -#define __ISchemaParticle_FWD_DEFINED__ -typedef interface ISchemaParticle ISchemaParticle; -#endif /* __ISchemaParticle_FWD_DEFINED__ */ - - -#ifndef __ISchemaAttribute_FWD_DEFINED__ -#define __ISchemaAttribute_FWD_DEFINED__ -typedef interface ISchemaAttribute ISchemaAttribute; -#endif /* __ISchemaAttribute_FWD_DEFINED__ */ - - -#ifndef __ISchemaElement_FWD_DEFINED__ -#define __ISchemaElement_FWD_DEFINED__ -typedef interface ISchemaElement ISchemaElement; -#endif /* __ISchemaElement_FWD_DEFINED__ */ - - -#ifndef __ISchemaType_FWD_DEFINED__ -#define __ISchemaType_FWD_DEFINED__ -typedef interface ISchemaType ISchemaType; -#endif /* __ISchemaType_FWD_DEFINED__ */ - - -#ifndef __ISchemaComplexType_FWD_DEFINED__ -#define __ISchemaComplexType_FWD_DEFINED__ -typedef interface ISchemaComplexType ISchemaComplexType; -#endif /* __ISchemaComplexType_FWD_DEFINED__ */ - - -#ifndef __ISchemaAttributeGroup_FWD_DEFINED__ -#define __ISchemaAttributeGroup_FWD_DEFINED__ -typedef interface ISchemaAttributeGroup ISchemaAttributeGroup; -#endif /* __ISchemaAttributeGroup_FWD_DEFINED__ */ - - -#ifndef __ISchemaModelGroup_FWD_DEFINED__ -#define __ISchemaModelGroup_FWD_DEFINED__ -typedef interface ISchemaModelGroup ISchemaModelGroup; -#endif /* __ISchemaModelGroup_FWD_DEFINED__ */ - - -#ifndef __ISchemaAny_FWD_DEFINED__ -#define __ISchemaAny_FWD_DEFINED__ -typedef interface ISchemaAny ISchemaAny; -#endif /* __ISchemaAny_FWD_DEFINED__ */ - - -#ifndef __ISchemaIdentityConstraint_FWD_DEFINED__ -#define __ISchemaIdentityConstraint_FWD_DEFINED__ -typedef interface ISchemaIdentityConstraint ISchemaIdentityConstraint; -#endif /* __ISchemaIdentityConstraint_FWD_DEFINED__ */ - - -#ifndef __ISchemaNotation_FWD_DEFINED__ -#define __ISchemaNotation_FWD_DEFINED__ -typedef interface ISchemaNotation ISchemaNotation; -#endif /* __ISchemaNotation_FWD_DEFINED__ */ - - -#ifndef __IXMLDOMSelection_FWD_DEFINED__ -#define __IXMLDOMSelection_FWD_DEFINED__ -typedef interface IXMLDOMSelection IXMLDOMSelection; -#endif /* __IXMLDOMSelection_FWD_DEFINED__ */ - - -#ifndef __XMLDOMDocumentEvents_FWD_DEFINED__ -#define __XMLDOMDocumentEvents_FWD_DEFINED__ -typedef interface XMLDOMDocumentEvents XMLDOMDocumentEvents; -#endif /* __XMLDOMDocumentEvents_FWD_DEFINED__ */ - - -#ifndef __IXMLHTTPRequest_FWD_DEFINED__ -#define __IXMLHTTPRequest_FWD_DEFINED__ -typedef interface IXMLHTTPRequest IXMLHTTPRequest; -#endif /* __IXMLHTTPRequest_FWD_DEFINED__ */ - - -#ifndef __IServerXMLHTTPRequest_FWD_DEFINED__ -#define __IServerXMLHTTPRequest_FWD_DEFINED__ -typedef interface IServerXMLHTTPRequest IServerXMLHTTPRequest; -#endif /* __IServerXMLHTTPRequest_FWD_DEFINED__ */ - - -#ifndef __IServerXMLHTTPRequest2_FWD_DEFINED__ -#define __IServerXMLHTTPRequest2_FWD_DEFINED__ -typedef interface IServerXMLHTTPRequest2 IServerXMLHTTPRequest2; -#endif /* __IServerXMLHTTPRequest2_FWD_DEFINED__ */ - - -#ifndef __IMXNamespacePrefixes_FWD_DEFINED__ -#define __IMXNamespacePrefixes_FWD_DEFINED__ -typedef interface IMXNamespacePrefixes IMXNamespacePrefixes; -#endif /* __IMXNamespacePrefixes_FWD_DEFINED__ */ - - -#ifndef __IVBMXNamespaceManager_FWD_DEFINED__ -#define __IVBMXNamespaceManager_FWD_DEFINED__ -typedef interface IVBMXNamespaceManager IVBMXNamespaceManager; -#endif /* __IVBMXNamespaceManager_FWD_DEFINED__ */ - - -#ifndef __IMXNamespaceManager_FWD_DEFINED__ -#define __IMXNamespaceManager_FWD_DEFINED__ -typedef interface IMXNamespaceManager IMXNamespaceManager; -#endif /* __IMXNamespaceManager_FWD_DEFINED__ */ - - -#ifndef __DOMDocument_FWD_DEFINED__ -#define __DOMDocument_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DOMDocument DOMDocument; -#else -typedef struct DOMDocument DOMDocument; -#endif /* __cplusplus */ - -#endif /* __DOMDocument_FWD_DEFINED__ */ - - -#ifndef __DOMDocument26_FWD_DEFINED__ -#define __DOMDocument26_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DOMDocument26 DOMDocument26; -#else -typedef struct DOMDocument26 DOMDocument26; -#endif /* __cplusplus */ - -#endif /* __DOMDocument26_FWD_DEFINED__ */ - - -#ifndef __DOMDocument30_FWD_DEFINED__ -#define __DOMDocument30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DOMDocument30 DOMDocument30; -#else -typedef struct DOMDocument30 DOMDocument30; -#endif /* __cplusplus */ - -#endif /* __DOMDocument30_FWD_DEFINED__ */ - - -#ifndef __DOMDocument40_FWD_DEFINED__ -#define __DOMDocument40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DOMDocument40 DOMDocument40; -#else -typedef struct DOMDocument40 DOMDocument40; -#endif /* __cplusplus */ - -#endif /* __DOMDocument40_FWD_DEFINED__ */ - - -#ifndef __DOMDocument60_FWD_DEFINED__ -#define __DOMDocument60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DOMDocument60 DOMDocument60; -#else -typedef struct DOMDocument60 DOMDocument60; -#endif /* __cplusplus */ - -#endif /* __DOMDocument60_FWD_DEFINED__ */ - - -#ifndef __FreeThreadedDOMDocument_FWD_DEFINED__ -#define __FreeThreadedDOMDocument_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FreeThreadedDOMDocument FreeThreadedDOMDocument; -#else -typedef struct FreeThreadedDOMDocument FreeThreadedDOMDocument; -#endif /* __cplusplus */ - -#endif /* __FreeThreadedDOMDocument_FWD_DEFINED__ */ - - -#ifndef __FreeThreadedDOMDocument26_FWD_DEFINED__ -#define __FreeThreadedDOMDocument26_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FreeThreadedDOMDocument26 FreeThreadedDOMDocument26; -#else -typedef struct FreeThreadedDOMDocument26 FreeThreadedDOMDocument26; -#endif /* __cplusplus */ - -#endif /* __FreeThreadedDOMDocument26_FWD_DEFINED__ */ - - -#ifndef __FreeThreadedDOMDocument30_FWD_DEFINED__ -#define __FreeThreadedDOMDocument30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FreeThreadedDOMDocument30 FreeThreadedDOMDocument30; -#else -typedef struct FreeThreadedDOMDocument30 FreeThreadedDOMDocument30; -#endif /* __cplusplus */ - -#endif /* __FreeThreadedDOMDocument30_FWD_DEFINED__ */ - - -#ifndef __FreeThreadedDOMDocument40_FWD_DEFINED__ -#define __FreeThreadedDOMDocument40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FreeThreadedDOMDocument40 FreeThreadedDOMDocument40; -#else -typedef struct FreeThreadedDOMDocument40 FreeThreadedDOMDocument40; -#endif /* __cplusplus */ - -#endif /* __FreeThreadedDOMDocument40_FWD_DEFINED__ */ - - -#ifndef __FreeThreadedDOMDocument60_FWD_DEFINED__ -#define __FreeThreadedDOMDocument60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class FreeThreadedDOMDocument60 FreeThreadedDOMDocument60; -#else -typedef struct FreeThreadedDOMDocument60 FreeThreadedDOMDocument60; -#endif /* __cplusplus */ - -#endif /* __FreeThreadedDOMDocument60_FWD_DEFINED__ */ - - -#ifndef __XMLSchemaCache_FWD_DEFINED__ -#define __XMLSchemaCache_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLSchemaCache XMLSchemaCache; -#else -typedef struct XMLSchemaCache XMLSchemaCache; -#endif /* __cplusplus */ - -#endif /* __XMLSchemaCache_FWD_DEFINED__ */ - - -#ifndef __XMLSchemaCache26_FWD_DEFINED__ -#define __XMLSchemaCache26_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLSchemaCache26 XMLSchemaCache26; -#else -typedef struct XMLSchemaCache26 XMLSchemaCache26; -#endif /* __cplusplus */ - -#endif /* __XMLSchemaCache26_FWD_DEFINED__ */ - - -#ifndef __XMLSchemaCache30_FWD_DEFINED__ -#define __XMLSchemaCache30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLSchemaCache30 XMLSchemaCache30; -#else -typedef struct XMLSchemaCache30 XMLSchemaCache30; -#endif /* __cplusplus */ - -#endif /* __XMLSchemaCache30_FWD_DEFINED__ */ - - -#ifndef __XMLSchemaCache40_FWD_DEFINED__ -#define __XMLSchemaCache40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLSchemaCache40 XMLSchemaCache40; -#else -typedef struct XMLSchemaCache40 XMLSchemaCache40; -#endif /* __cplusplus */ - -#endif /* __XMLSchemaCache40_FWD_DEFINED__ */ - - -#ifndef __XMLSchemaCache60_FWD_DEFINED__ -#define __XMLSchemaCache60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLSchemaCache60 XMLSchemaCache60; -#else -typedef struct XMLSchemaCache60 XMLSchemaCache60; -#endif /* __cplusplus */ - -#endif /* __XMLSchemaCache60_FWD_DEFINED__ */ - - -#ifndef __XSLTemplate_FWD_DEFINED__ -#define __XSLTemplate_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XSLTemplate XSLTemplate; -#else -typedef struct XSLTemplate XSLTemplate; -#endif /* __cplusplus */ - -#endif /* __XSLTemplate_FWD_DEFINED__ */ - - -#ifndef __XSLTemplate26_FWD_DEFINED__ -#define __XSLTemplate26_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XSLTemplate26 XSLTemplate26; -#else -typedef struct XSLTemplate26 XSLTemplate26; -#endif /* __cplusplus */ - -#endif /* __XSLTemplate26_FWD_DEFINED__ */ - - -#ifndef __XSLTemplate30_FWD_DEFINED__ -#define __XSLTemplate30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XSLTemplate30 XSLTemplate30; -#else -typedef struct XSLTemplate30 XSLTemplate30; -#endif /* __cplusplus */ - -#endif /* __XSLTemplate30_FWD_DEFINED__ */ - - -#ifndef __XSLTemplate40_FWD_DEFINED__ -#define __XSLTemplate40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XSLTemplate40 XSLTemplate40; -#else -typedef struct XSLTemplate40 XSLTemplate40; -#endif /* __cplusplus */ - -#endif /* __XSLTemplate40_FWD_DEFINED__ */ - - -#ifndef __XSLTemplate60_FWD_DEFINED__ -#define __XSLTemplate60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XSLTemplate60 XSLTemplate60; -#else -typedef struct XSLTemplate60 XSLTemplate60; -#endif /* __cplusplus */ - -#endif /* __XSLTemplate60_FWD_DEFINED__ */ - - -#ifndef __XMLHTTP_FWD_DEFINED__ -#define __XMLHTTP_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLHTTP XMLHTTP; -#else -typedef struct XMLHTTP XMLHTTP; -#endif /* __cplusplus */ - -#endif /* __XMLHTTP_FWD_DEFINED__ */ - - -#ifndef __XMLHTTP26_FWD_DEFINED__ -#define __XMLHTTP26_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLHTTP26 XMLHTTP26; -#else -typedef struct XMLHTTP26 XMLHTTP26; -#endif /* __cplusplus */ - -#endif /* __XMLHTTP26_FWD_DEFINED__ */ - - -#ifndef __XMLHTTP30_FWD_DEFINED__ -#define __XMLHTTP30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLHTTP30 XMLHTTP30; -#else -typedef struct XMLHTTP30 XMLHTTP30; -#endif /* __cplusplus */ - -#endif /* __XMLHTTP30_FWD_DEFINED__ */ - - -#ifndef __XMLHTTP40_FWD_DEFINED__ -#define __XMLHTTP40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLHTTP40 XMLHTTP40; -#else -typedef struct XMLHTTP40 XMLHTTP40; -#endif /* __cplusplus */ - -#endif /* __XMLHTTP40_FWD_DEFINED__ */ - - -#ifndef __XMLHTTP60_FWD_DEFINED__ -#define __XMLHTTP60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLHTTP60 XMLHTTP60; -#else -typedef struct XMLHTTP60 XMLHTTP60; -#endif /* __cplusplus */ - -#endif /* __XMLHTTP60_FWD_DEFINED__ */ - - -#ifndef __ServerXMLHTTP_FWD_DEFINED__ -#define __ServerXMLHTTP_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ServerXMLHTTP ServerXMLHTTP; -#else -typedef struct ServerXMLHTTP ServerXMLHTTP; -#endif /* __cplusplus */ - -#endif /* __ServerXMLHTTP_FWD_DEFINED__ */ - - -#ifndef __ServerXMLHTTP30_FWD_DEFINED__ -#define __ServerXMLHTTP30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ServerXMLHTTP30 ServerXMLHTTP30; -#else -typedef struct ServerXMLHTTP30 ServerXMLHTTP30; -#endif /* __cplusplus */ - -#endif /* __ServerXMLHTTP30_FWD_DEFINED__ */ - - -#ifndef __ServerXMLHTTP40_FWD_DEFINED__ -#define __ServerXMLHTTP40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ServerXMLHTTP40 ServerXMLHTTP40; -#else -typedef struct ServerXMLHTTP40 ServerXMLHTTP40; -#endif /* __cplusplus */ - -#endif /* __ServerXMLHTTP40_FWD_DEFINED__ */ - - -#ifndef __ServerXMLHTTP60_FWD_DEFINED__ -#define __ServerXMLHTTP60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class ServerXMLHTTP60 ServerXMLHTTP60; -#else -typedef struct ServerXMLHTTP60 ServerXMLHTTP60; -#endif /* __cplusplus */ - -#endif /* __ServerXMLHTTP60_FWD_DEFINED__ */ - - -#ifndef __SAXXMLReader_FWD_DEFINED__ -#define __SAXXMLReader_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXXMLReader SAXXMLReader; -#else -typedef struct SAXXMLReader SAXXMLReader; -#endif /* __cplusplus */ - -#endif /* __SAXXMLReader_FWD_DEFINED__ */ - - -#ifndef __SAXXMLReader30_FWD_DEFINED__ -#define __SAXXMLReader30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXXMLReader30 SAXXMLReader30; -#else -typedef struct SAXXMLReader30 SAXXMLReader30; -#endif /* __cplusplus */ - -#endif /* __SAXXMLReader30_FWD_DEFINED__ */ - - -#ifndef __SAXXMLReader40_FWD_DEFINED__ -#define __SAXXMLReader40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXXMLReader40 SAXXMLReader40; -#else -typedef struct SAXXMLReader40 SAXXMLReader40; -#endif /* __cplusplus */ - -#endif /* __SAXXMLReader40_FWD_DEFINED__ */ - - -#ifndef __SAXXMLReader60_FWD_DEFINED__ -#define __SAXXMLReader60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXXMLReader60 SAXXMLReader60; -#else -typedef struct SAXXMLReader60 SAXXMLReader60; -#endif /* __cplusplus */ - -#endif /* __SAXXMLReader60_FWD_DEFINED__ */ - - -#ifndef __MXXMLWriter_FWD_DEFINED__ -#define __MXXMLWriter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXXMLWriter MXXMLWriter; -#else -typedef struct MXXMLWriter MXXMLWriter; -#endif /* __cplusplus */ - -#endif /* __MXXMLWriter_FWD_DEFINED__ */ - - -#ifndef __MXXMLWriter30_FWD_DEFINED__ -#define __MXXMLWriter30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXXMLWriter30 MXXMLWriter30; -#else -typedef struct MXXMLWriter30 MXXMLWriter30; -#endif /* __cplusplus */ - -#endif /* __MXXMLWriter30_FWD_DEFINED__ */ - - -#ifndef __MXXMLWriter40_FWD_DEFINED__ -#define __MXXMLWriter40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXXMLWriter40 MXXMLWriter40; -#else -typedef struct MXXMLWriter40 MXXMLWriter40; -#endif /* __cplusplus */ - -#endif /* __MXXMLWriter40_FWD_DEFINED__ */ - - -#ifndef __MXXMLWriter60_FWD_DEFINED__ -#define __MXXMLWriter60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXXMLWriter60 MXXMLWriter60; -#else -typedef struct MXXMLWriter60 MXXMLWriter60; -#endif /* __cplusplus */ - -#endif /* __MXXMLWriter60_FWD_DEFINED__ */ - - -#ifndef __MXHTMLWriter_FWD_DEFINED__ -#define __MXHTMLWriter_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXHTMLWriter MXHTMLWriter; -#else -typedef struct MXHTMLWriter MXHTMLWriter; -#endif /* __cplusplus */ - -#endif /* __MXHTMLWriter_FWD_DEFINED__ */ - - -#ifndef __MXHTMLWriter30_FWD_DEFINED__ -#define __MXHTMLWriter30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXHTMLWriter30 MXHTMLWriter30; -#else -typedef struct MXHTMLWriter30 MXHTMLWriter30; -#endif /* __cplusplus */ - -#endif /* __MXHTMLWriter30_FWD_DEFINED__ */ - - -#ifndef __MXHTMLWriter40_FWD_DEFINED__ -#define __MXHTMLWriter40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXHTMLWriter40 MXHTMLWriter40; -#else -typedef struct MXHTMLWriter40 MXHTMLWriter40; -#endif /* __cplusplus */ - -#endif /* __MXHTMLWriter40_FWD_DEFINED__ */ - - -#ifndef __MXHTMLWriter60_FWD_DEFINED__ -#define __MXHTMLWriter60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXHTMLWriter60 MXHTMLWriter60; -#else -typedef struct MXHTMLWriter60 MXHTMLWriter60; -#endif /* __cplusplus */ - -#endif /* __MXHTMLWriter60_FWD_DEFINED__ */ - - -#ifndef __SAXAttributes_FWD_DEFINED__ -#define __SAXAttributes_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXAttributes SAXAttributes; -#else -typedef struct SAXAttributes SAXAttributes; -#endif /* __cplusplus */ - -#endif /* __SAXAttributes_FWD_DEFINED__ */ - - -#ifndef __SAXAttributes30_FWD_DEFINED__ -#define __SAXAttributes30_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXAttributes30 SAXAttributes30; -#else -typedef struct SAXAttributes30 SAXAttributes30; -#endif /* __cplusplus */ - -#endif /* __SAXAttributes30_FWD_DEFINED__ */ - - -#ifndef __SAXAttributes40_FWD_DEFINED__ -#define __SAXAttributes40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXAttributes40 SAXAttributes40; -#else -typedef struct SAXAttributes40 SAXAttributes40; -#endif /* __cplusplus */ - -#endif /* __SAXAttributes40_FWD_DEFINED__ */ - - -#ifndef __SAXAttributes60_FWD_DEFINED__ -#define __SAXAttributes60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SAXAttributes60 SAXAttributes60; -#else -typedef struct SAXAttributes60 SAXAttributes60; -#endif /* __cplusplus */ - -#endif /* __SAXAttributes60_FWD_DEFINED__ */ - - -#ifndef __MXNamespaceManager_FWD_DEFINED__ -#define __MXNamespaceManager_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXNamespaceManager MXNamespaceManager; -#else -typedef struct MXNamespaceManager MXNamespaceManager; -#endif /* __cplusplus */ - -#endif /* __MXNamespaceManager_FWD_DEFINED__ */ - - -#ifndef __MXNamespaceManager40_FWD_DEFINED__ -#define __MXNamespaceManager40_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXNamespaceManager40 MXNamespaceManager40; -#else -typedef struct MXNamespaceManager40 MXNamespaceManager40; -#endif /* __cplusplus */ - -#endif /* __MXNamespaceManager40_FWD_DEFINED__ */ - - -#ifndef __MXNamespaceManager60_FWD_DEFINED__ -#define __MXNamespaceManager60_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MXNamespaceManager60 MXNamespaceManager60; -#else -typedef struct MXNamespaceManager60 MXNamespaceManager60; -#endif /* __cplusplus */ - -#endif /* __MXNamespaceManager60_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" -#include "oaidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void * ); - -/* interface __MIDL_itf_msxml6_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1997-2005. -// -//-------------------------------------------------------------------------- -#define DOMDocument DOMDocument2 -#define CLSID_DOMDocument CLSID_DOMDocument2 - -#if !defined(_W64) -#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -#define _W64 __w64 -#else -#define _W64 -#endif -#endif -#if defined(_WIN64) - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; -#else - typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; -#endif -#ifdef __ISAXXMLReader_INTERFACE_DEFINED__ -#undef __MSXML2_LIBRARY_DEFINED__ -#endif -#ifdef __USE_MSXML6_NAMESPACE__ -namespace MSXML6 { -#endif - - -extern RPC_IF_HANDLE __MIDL_itf_msxml6_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msxml6_0000_v0_0_s_ifspec; - - -#ifndef __MSXML2_LIBRARY_DEFINED__ -#define __MSXML2_LIBRARY_DEFINED__ - -/* library MSXML2 */ -/* [lcid][helpstring][version][uuid] */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#undef ParseURL -#if !defined(__msxml_h__) || defined(__IXMLElementNotificationSink_INTERFACE_DEFINED__) -typedef /* [helpstring] */ -enum tagDOMNodeType - { NODE_INVALID = 0, - NODE_ELEMENT = NODE_INVALID + 1, - NODE_ATTRIBUTE = NODE_ELEMENT + 1, - NODE_TEXT = NODE_ATTRIBUTE + 1, - NODE_CDATA_SECTION = NODE_TEXT + 1, - NODE_ENTITY_REFERENCE = NODE_CDATA_SECTION + 1, - NODE_ENTITY = NODE_ENTITY_REFERENCE + 1, - NODE_PROCESSING_INSTRUCTION = NODE_ENTITY + 1, - NODE_COMMENT = NODE_PROCESSING_INSTRUCTION + 1, - NODE_DOCUMENT = NODE_COMMENT + 1, - NODE_DOCUMENT_TYPE = NODE_DOCUMENT + 1, - NODE_DOCUMENT_FRAGMENT = NODE_DOCUMENT_TYPE + 1, - NODE_NOTATION = NODE_DOCUMENT_FRAGMENT + 1 - } DOMNodeType; - -#endif -#if !defined(__msxml_sxh_enums__) -#define __msxml_sxh_enums__ -typedef /* [helpstring] */ -enum _SERVERXMLHTTP_OPTION - { SXH_OPTION_URL = -1, - SXH_OPTION_URL_CODEPAGE = SXH_OPTION_URL + 1, - SXH_OPTION_ESCAPE_PERCENT_IN_URL = SXH_OPTION_URL_CODEPAGE + 1, - SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS = SXH_OPTION_ESCAPE_PERCENT_IN_URL + 1, - SXH_OPTION_SELECT_CLIENT_SSL_CERT = SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS + 1 - } SERVERXMLHTTP_OPTION; - -typedef /* [helpstring] */ -enum _SXH_SERVER_CERT_OPTION - { SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x100, - SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x200, - SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x1000, - SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x2000, - SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = SXH_SERVER_CERT_IGNORE_UNKNOWN_CA + SXH_SERVER_CERT_IGNORE_WRONG_USAGE + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID - } SXH_SERVER_CERT_OPTION; - -typedef /* [helpstring] */ -enum _SXH_PROXY_SETTING - { SXH_PROXY_SET_DEFAULT = 0, - SXH_PROXY_SET_PRECONFIG = 0, - SXH_PROXY_SET_DIRECT = 0x1, - SXH_PROXY_SET_PROXY = 0x2 - } SXH_PROXY_SETTING; - -#endif // !defined(__msxml_sxh_enums__) -#if !defined(__msxml_som_enums__) -#define __msxml_som_enums__ -typedef /* [helpstring] */ -enum _SOMITEMTYPE - { SOMITEM_SCHEMA = 0x1000, - SOMITEM_ATTRIBUTE = 0x1001, - SOMITEM_ATTRIBUTEGROUP = 0x1002, - SOMITEM_NOTATION = 0x1003, - SOMITEM_ANNOTATION = 0x1004, - SOMITEM_IDENTITYCONSTRAINT = 0x1100, - SOMITEM_KEY = 0x1101, - SOMITEM_KEYREF = 0x1102, - SOMITEM_UNIQUE = 0x1103, - SOMITEM_ANYTYPE = 0x2000, - SOMITEM_DATATYPE = 0x2100, - SOMITEM_DATATYPE_ANYTYPE = 0x2101, - SOMITEM_DATATYPE_ANYURI = 0x2102, - SOMITEM_DATATYPE_BASE64BINARY = 0x2103, - SOMITEM_DATATYPE_BOOLEAN = 0x2104, - SOMITEM_DATATYPE_BYTE = 0x2105, - SOMITEM_DATATYPE_DATE = 0x2106, - SOMITEM_DATATYPE_DATETIME = 0x2107, - SOMITEM_DATATYPE_DAY = 0x2108, - SOMITEM_DATATYPE_DECIMAL = 0x2109, - SOMITEM_DATATYPE_DOUBLE = 0x210a, - SOMITEM_DATATYPE_DURATION = 0x210b, - SOMITEM_DATATYPE_ENTITIES = 0x210c, - SOMITEM_DATATYPE_ENTITY = 0x210d, - SOMITEM_DATATYPE_FLOAT = 0x210e, - SOMITEM_DATATYPE_HEXBINARY = 0x210f, - SOMITEM_DATATYPE_ID = 0x2110, - SOMITEM_DATATYPE_IDREF = 0x2111, - SOMITEM_DATATYPE_IDREFS = 0x2112, - SOMITEM_DATATYPE_INT = 0x2113, - SOMITEM_DATATYPE_INTEGER = 0x2114, - SOMITEM_DATATYPE_LANGUAGE = 0x2115, - SOMITEM_DATATYPE_LONG = 0x2116, - SOMITEM_DATATYPE_MONTH = 0x2117, - SOMITEM_DATATYPE_MONTHDAY = 0x2118, - SOMITEM_DATATYPE_NAME = 0x2119, - SOMITEM_DATATYPE_NCNAME = 0x211a, - SOMITEM_DATATYPE_NEGATIVEINTEGER = 0x211b, - SOMITEM_DATATYPE_NMTOKEN = 0x211c, - SOMITEM_DATATYPE_NMTOKENS = 0x211d, - SOMITEM_DATATYPE_NONNEGATIVEINTEGER = 0x211e, - SOMITEM_DATATYPE_NONPOSITIVEINTEGER = 0x211f, - SOMITEM_DATATYPE_NORMALIZEDSTRING = 0x2120, - SOMITEM_DATATYPE_NOTATION = 0x2121, - SOMITEM_DATATYPE_POSITIVEINTEGER = 0x2122, - SOMITEM_DATATYPE_QNAME = 0x2123, - SOMITEM_DATATYPE_SHORT = 0x2124, - SOMITEM_DATATYPE_STRING = 0x2125, - SOMITEM_DATATYPE_TIME = 0x2126, - SOMITEM_DATATYPE_TOKEN = 0x2127, - SOMITEM_DATATYPE_UNSIGNEDBYTE = 0x2128, - SOMITEM_DATATYPE_UNSIGNEDINT = 0x2129, - SOMITEM_DATATYPE_UNSIGNEDLONG = 0x212a, - SOMITEM_DATATYPE_UNSIGNEDSHORT = 0x212b, - SOMITEM_DATATYPE_YEAR = 0x212c, - SOMITEM_DATATYPE_YEARMONTH = 0x212d, - SOMITEM_DATATYPE_ANYSIMPLETYPE = 0x21ff, - SOMITEM_SIMPLETYPE = 0x2200, - SOMITEM_COMPLEXTYPE = 0x2400, - SOMITEM_PARTICLE = 0x4000, - SOMITEM_ANY = 0x4001, - SOMITEM_ANYATTRIBUTE = 0x4002, - SOMITEM_ELEMENT = 0x4003, - SOMITEM_GROUP = 0x4100, - SOMITEM_ALL = 0x4101, - SOMITEM_CHOICE = 0x4102, - SOMITEM_SEQUENCE = 0x4103, - SOMITEM_EMPTYPARTICLE = 0x4104, - SOMITEM_NULL = 0x800, - SOMITEM_NULL_TYPE = 0x2800, - SOMITEM_NULL_ANY = 0x4801, - SOMITEM_NULL_ANYATTRIBUTE = 0x4802, - SOMITEM_NULL_ELEMENT = 0x4803 - } SOMITEMTYPE; - -typedef /* [helpstring] */ -enum _SCHEMAUSE - { SCHEMAUSE_OPTIONAL = 0, - SCHEMAUSE_PROHIBITED = SCHEMAUSE_OPTIONAL + 1, - SCHEMAUSE_REQUIRED = SCHEMAUSE_PROHIBITED + 1 - } SCHEMAUSE; - -typedef /* [helpstring] */ -enum _SCHEMADERIVATIONMETHOD - { SCHEMADERIVATIONMETHOD_EMPTY = 0, - SCHEMADERIVATIONMETHOD_SUBSTITUTION = 0x1, - SCHEMADERIVATIONMETHOD_EXTENSION = 0x2, - SCHEMADERIVATIONMETHOD_RESTRICTION = 0x4, - SCHEMADERIVATIONMETHOD_LIST = 0x8, - SCHEMADERIVATIONMETHOD_UNION = 0x10, - SCHEMADERIVATIONMETHOD_ALL = 0xff, - SCHEMADERIVATIONMETHOD_NONE = 0x100 - } SCHEMADERIVATIONMETHOD; - -typedef /* [helpstring] */ -enum _SCHEMACONTENTTYPE - { SCHEMACONTENTTYPE_EMPTY = 0, - SCHEMACONTENTTYPE_TEXTONLY = SCHEMACONTENTTYPE_EMPTY + 1, - SCHEMACONTENTTYPE_ELEMENTONLY = SCHEMACONTENTTYPE_TEXTONLY + 1, - SCHEMACONTENTTYPE_MIXED = SCHEMACONTENTTYPE_ELEMENTONLY + 1 - } SCHEMACONTENTTYPE; - -typedef /* [helpstring] */ -enum _SCHEMAPROCESSCONTENTS - { SCHEMAPROCESSCONTENTS_NONE = 0, - SCHEMAPROCESSCONTENTS_SKIP = SCHEMAPROCESSCONTENTS_NONE + 1, - SCHEMAPROCESSCONTENTS_LAX = SCHEMAPROCESSCONTENTS_SKIP + 1, - SCHEMAPROCESSCONTENTS_STRICT = SCHEMAPROCESSCONTENTS_LAX + 1 - } SCHEMAPROCESSCONTENTS; - -typedef /* [helpstring] */ -enum _SCHEMAWHITESPACE - { SCHEMAWHITESPACE_NONE = -1, - SCHEMAWHITESPACE_PRESERVE = 0, - SCHEMAWHITESPACE_REPLACE = 1, - SCHEMAWHITESPACE_COLLAPSE = 2 - } SCHEMAWHITESPACE; - -typedef /* [helpstring] */ -enum _SCHEMATYPEVARIETY - { SCHEMATYPEVARIETY_NONE = -1, - SCHEMATYPEVARIETY_ATOMIC = 0, - SCHEMATYPEVARIETY_LIST = 1, - SCHEMATYPEVARIETY_UNION = 2 - } SCHEMATYPEVARIETY; - -#endif // !defined(__msxml_som_enums__) - -EXTERN_C const IID LIBID_MSXML2; - -#ifndef __IXMLDOMImplementation_INTERFACE_DEFINED__ -#define __IXMLDOMImplementation_INTERFACE_DEFINED__ - -/* interface IXMLDOMImplementation */ -/* [uuid][dual][oleautomation][unique][nonextensible][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMImplementation; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8F-7B36-11d2-B20E-00C04F983E60") - IXMLDOMImplementation : public IDispatch - { - public: - virtual /* [id] */ HRESULT STDMETHODCALLTYPE hasFeature( - /* [in] */ BSTR feature, - /* [in] */ BSTR version, - /* [retval][out] */ VARIANT_BOOL *hasFeature) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMImplementationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMImplementation * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMImplementation * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMImplementation * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMImplementation * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMImplementation * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMImplementation * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMImplementation * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *hasFeature )( - IXMLDOMImplementation * This, - /* [in] */ BSTR feature, - /* [in] */ BSTR version, - /* [retval][out] */ VARIANT_BOOL *hasFeature); - - END_INTERFACE - } IXMLDOMImplementationVtbl; - - interface IXMLDOMImplementation - { - CONST_VTBL struct IXMLDOMImplementationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMImplementation_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMImplementation_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMImplementation_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMImplementation_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMImplementation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMImplementation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMImplementation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMImplementation_hasFeature(This,feature,version,hasFeature) \ - (This)->lpVtbl -> hasFeature(This,feature,version,hasFeature) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMImplementation_hasFeature_Proxy( - IXMLDOMImplementation * This, - /* [in] */ BSTR feature, - /* [in] */ BSTR version, - /* [retval][out] */ VARIANT_BOOL *hasFeature); - - -void __RPC_STUB IXMLDOMImplementation_hasFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMImplementation_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMNode_INTERFACE_DEFINED__ -#define __IXMLDOMNode_INTERFACE_DEFINED__ - -/* interface IXMLDOMNode */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMNode; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF80-7B36-11d2-B20E-00C04F983E60") - IXMLDOMNode : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeName( - /* [retval][out] */ BSTR *name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeValue( - /* [retval][out] */ VARIANT *value) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_nodeValue( - /* [in] */ VARIANT value) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeType( - /* [retval][out] */ DOMNodeType *type) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( - /* [retval][out] */ IXMLDOMNode **parent) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_childNodes( - /* [retval][out] */ IXMLDOMNodeList **childList) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( - /* [retval][out] */ IXMLDOMNode **firstChild) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( - /* [retval][out] */ IXMLDOMNode **lastChild) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( - /* [retval][out] */ IXMLDOMNode **previousSibling) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( - /* [retval][out] */ IXMLDOMNode **nextSibling) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE insertBefore( - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE replaceChild( - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeChild( - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE appendChild( - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE hasChildNodes( - /* [retval][out] */ VARIANT_BOOL *hasChild) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ownerDocument( - /* [retval][out] */ IXMLDOMDocument **DOMDocument) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE cloneNode( - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeTypeString( - /* [out][retval] */ BSTR *nodeType) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_text( - /* [out][retval] */ BSTR *text) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_text( - /* [in] */ BSTR text) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_specified( - /* [retval][out] */ VARIANT_BOOL *isSpecified) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_definition( - /* [out][retval] */ IXMLDOMNode **definitionNode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeTypedValue( - /* [out][retval] */ VARIANT *typedValue) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_nodeTypedValue( - /* [in] */ VARIANT typedValue) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dataType( - /* [out][retval] */ VARIANT *dataTypeName) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_dataType( - /* [in] */ BSTR dataTypeName) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_xml( - /* [out][retval] */ BSTR *xmlString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transformNode( - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE selectNodes( - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE selectSingleNode( - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parsed( - /* [out][retval] */ VARIANT_BOOL *isParsed) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( - /* [out][retval] */ BSTR *namespaceURI) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_prefix( - /* [out][retval] */ BSTR *prefixString) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_baseName( - /* [out][retval] */ BSTR *nameString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transformNodeToObject( - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMNodeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMNode * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMNode * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMNode * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMNode * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMNode * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMNode * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMNode * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMNode * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMNode * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMNode * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMNode * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMNode * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMNode * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMNode * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMNode * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMNode * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMNode * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - END_INTERFACE - } IXMLDOMNodeVtbl; - - interface IXMLDOMNode - { - CONST_VTBL struct IXMLDOMNodeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMNode_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMNode_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMNode_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMNode_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMNode_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMNode_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMNode_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMNode_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMNode_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMNode_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMNode_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMNode_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMNode_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMNode_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMNode_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMNode_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMNode_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMNode_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMNode_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMNode_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMNode_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMNode_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMNode_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMNode_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMNode_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMNode_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMNode_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMNode_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMNode_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMNode_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMNode_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMNode_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMNode_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMNode_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMNode_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMNode_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMNode_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMNode_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMNode_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMNode_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMNode_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMNode_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMNode_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeName_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ BSTR *name); - - -void __RPC_STUB IXMLDOMNode_get_nodeName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeValue_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT *value); - - -void __RPC_STUB IXMLDOMNode_get_nodeValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_nodeValue_Proxy( - IXMLDOMNode * This, - /* [in] */ VARIANT value); - - -void __RPC_STUB IXMLDOMNode_put_nodeValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeType_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ DOMNodeType *type); - - -void __RPC_STUB IXMLDOMNode_get_nodeType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_parentNode_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **parent); - - -void __RPC_STUB IXMLDOMNode_get_parentNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_childNodes_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - -void __RPC_STUB IXMLDOMNode_get_childNodes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_firstChild_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - -void __RPC_STUB IXMLDOMNode_get_firstChild_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_lastChild_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - -void __RPC_STUB IXMLDOMNode_get_lastChild_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_previousSibling_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - -void __RPC_STUB IXMLDOMNode_get_previousSibling_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nextSibling_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - -void __RPC_STUB IXMLDOMNode_get_nextSibling_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_attributes_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - -void __RPC_STUB IXMLDOMNode_get_attributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_insertBefore_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - -void __RPC_STUB IXMLDOMNode_insertBefore_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_replaceChild_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - -void __RPC_STUB IXMLDOMNode_replaceChild_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_removeChild_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - -void __RPC_STUB IXMLDOMNode_removeChild_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_appendChild_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - -void __RPC_STUB IXMLDOMNode_appendChild_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_hasChildNodes_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - -void __RPC_STUB IXMLDOMNode_hasChildNodes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_ownerDocument_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - -void __RPC_STUB IXMLDOMNode_get_ownerDocument_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_cloneNode_Proxy( - IXMLDOMNode * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - -void __RPC_STUB IXMLDOMNode_cloneNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeTypeString_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *nodeType); - - -void __RPC_STUB IXMLDOMNode_get_nodeTypeString_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_text_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *text); - - -void __RPC_STUB IXMLDOMNode_get_text_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_text_Proxy( - IXMLDOMNode * This, - /* [in] */ BSTR text); - - -void __RPC_STUB IXMLDOMNode_put_text_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_specified_Proxy( - IXMLDOMNode * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - -void __RPC_STUB IXMLDOMNode_get_specified_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_definition_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - -void __RPC_STUB IXMLDOMNode_get_definition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_nodeTypedValue_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT *typedValue); - - -void __RPC_STUB IXMLDOMNode_get_nodeTypedValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_nodeTypedValue_Proxy( - IXMLDOMNode * This, - /* [in] */ VARIANT typedValue); - - -void __RPC_STUB IXMLDOMNode_put_nodeTypedValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_dataType_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT *dataTypeName); - - -void __RPC_STUB IXMLDOMNode_get_dataType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_put_dataType_Proxy( - IXMLDOMNode * This, - /* [in] */ BSTR dataTypeName); - - -void __RPC_STUB IXMLDOMNode_put_dataType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_xml_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *xmlString); - - -void __RPC_STUB IXMLDOMNode_get_xml_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_transformNode_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - -void __RPC_STUB IXMLDOMNode_transformNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_selectNodes_Proxy( - IXMLDOMNode * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - -void __RPC_STUB IXMLDOMNode_selectNodes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_selectSingleNode_Proxy( - IXMLDOMNode * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - -void __RPC_STUB IXMLDOMNode_selectSingleNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_parsed_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - -void __RPC_STUB IXMLDOMNode_get_parsed_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_namespaceURI_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *namespaceURI); - - -void __RPC_STUB IXMLDOMNode_get_namespaceURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_prefix_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *prefixString); - - -void __RPC_STUB IXMLDOMNode_get_prefix_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_get_baseName_Proxy( - IXMLDOMNode * This, - /* [out][retval] */ BSTR *nameString); - - -void __RPC_STUB IXMLDOMNode_get_baseName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNode_transformNodeToObject_Proxy( - IXMLDOMNode * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - -void __RPC_STUB IXMLDOMNode_transformNodeToObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMNode_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ -#define __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ - -/* interface IXMLDOMDocumentFragment */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMDocumentFragment; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa413-272f-11d2-836f-0000f87a7782") - IXMLDOMDocumentFragment : public IXMLDOMNode - { - public: - }; - -#else /* C style interface */ - - typedef struct IXMLDOMDocumentFragmentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMDocumentFragment * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMDocumentFragment * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMDocumentFragment * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMDocumentFragment * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMDocumentFragment * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMDocumentFragment * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMDocumentFragment * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMDocumentFragment * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMDocumentFragment * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMDocumentFragment * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMDocumentFragment * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMDocumentFragment * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMDocumentFragment * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMDocumentFragment * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMDocumentFragment * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMDocumentFragment * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMDocumentFragment * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - END_INTERFACE - } IXMLDOMDocumentFragmentVtbl; - - interface IXMLDOMDocumentFragment - { - CONST_VTBL struct IXMLDOMDocumentFragmentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMDocumentFragment_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMDocumentFragment_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMDocumentFragment_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMDocumentFragment_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMDocumentFragment_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMDocumentFragment_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMDocumentFragment_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMDocumentFragment_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMDocumentFragment_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMDocumentFragment_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMDocumentFragment_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMDocumentFragment_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMDocumentFragment_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMDocumentFragment_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMDocumentFragment_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMDocumentFragment_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMDocumentFragment_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMDocumentFragment_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMDocumentFragment_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMDocumentFragment_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMDocumentFragment_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMDocumentFragment_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMDocumentFragment_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMDocumentFragment_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMDocumentFragment_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMDocumentFragment_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMDocumentFragment_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMDocumentFragment_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMDocumentFragment_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMDocumentFragment_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMDocumentFragment_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocumentFragment_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocumentFragment_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMDocumentFragment_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMDocumentFragment_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMDocumentFragment_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMDocumentFragment_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMDocumentFragment_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMDocumentFragment_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMDocumentFragment_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMDocumentFragment_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMDocumentFragment_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMDocumentFragment_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXMLDOMDocumentFragment_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMDocument_INTERFACE_DEFINED__ -#define __IXMLDOMDocument_INTERFACE_DEFINED__ - -/* interface IXMLDOMDocument */ -/* [hidden][unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMDocument; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF81-7B36-11d2-B20E-00C04F983E60") - IXMLDOMDocument : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_doctype( - /* [retval][out] */ IXMLDOMDocumentType **documentType) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_implementation( - /* [retval][out] */ IXMLDOMImplementation **impl) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_documentElement( - /* [retval][out] */ IXMLDOMElement **DOMElement) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_documentElement( - /* [in] */ IXMLDOMElement *DOMElement) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createElement( - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMElement **element) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createDocumentFragment( - /* [retval][out] */ IXMLDOMDocumentFragment **docFrag) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createTextNode( - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMText **text) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createComment( - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMComment **comment) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createCDATASection( - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMCDATASection **cdata) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createProcessingInstruction( - /* [in] */ BSTR target, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMProcessingInstruction **pi) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createAttribute( - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attribute) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createEntityReference( - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMEntityReference **entityRef) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getElementsByTagName( - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createNode( - /* [in] */ VARIANT Type, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [out][retval] */ IXMLDOMNode **node) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nodeFromID( - /* [in] */ BSTR idString, - /* [out][retval] */ IXMLDOMNode **node) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE load( - /* [in] */ VARIANT xmlSource, - /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( - /* [out][retval] */ long *value) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parseError( - /* [out][retval] */ IXMLDOMParseError **errorObj) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_url( - /* [out][retval] */ BSTR *urlString) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_async( - /* [out][retval] */ VARIANT_BOOL *isAsync) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_async( - /* [in] */ VARIANT_BOOL isAsync) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE loadXML( - /* [in] */ BSTR bstrXML, - /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE save( - /* [in] */ VARIANT destination) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_validateOnParse( - /* [out][retval] */ VARIANT_BOOL *isValidating) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_validateOnParse( - /* [in] */ VARIANT_BOOL isValidating) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_resolveExternals( - /* [out][retval] */ VARIANT_BOOL *isResolving) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_resolveExternals( - /* [in] */ VARIANT_BOOL isResolving) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_preserveWhiteSpace( - /* [out][retval] */ VARIANT_BOOL *isPreserving) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_preserveWhiteSpace( - /* [in] */ VARIANT_BOOL isPreserving) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_onreadystatechange( - /* [in] */ VARIANT readystatechangeSink) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ondataavailable( - /* [in] */ VARIANT ondataavailableSink) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ontransformnode( - /* [in] */ VARIANT ontransformnodeSink) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMDocumentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMDocument * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMDocument * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMDocument * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMDocument * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMDocument * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMDocument * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMDocument * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMDocument * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMDocument * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMDocument * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMDocument * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMDocument * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMDocument * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMDocument * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMDocument * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMDocument * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMDocument * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMDocument * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMDocument * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMDocumentType **documentType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMImplementation **impl); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMElement **DOMElement); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMElement *DOMElement); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( - IXMLDOMDocument * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMElement **element); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMText **text); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMComment **comment); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMCDATASection **cdata); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( - IXMLDOMDocument * This, - /* [in] */ BSTR target, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMProcessingInstruction **pi); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( - IXMLDOMDocument * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attribute); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( - IXMLDOMDocument * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMEntityReference **entityRef); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( - IXMLDOMDocument * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( - IXMLDOMDocument * This, - /* [in] */ VARIANT Type, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( - IXMLDOMDocument * This, - /* [in] */ BSTR idString, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( - IXMLDOMDocument * This, - /* [in] */ VARIANT xmlSource, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IXMLDOMDocument * This, - /* [out][retval] */ long *value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( - IXMLDOMDocument * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *urlString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isAsync); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isAsync); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IXMLDOMDocument * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( - IXMLDOMDocument * This, - /* [in] */ BSTR bstrXML, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( - IXMLDOMDocument * This, - /* [in] */ VARIANT destination); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isValidating); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isValidating); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isResolving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isResolving); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IXMLDOMDocument * This, - /* [in] */ VARIANT readystatechangeSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( - IXMLDOMDocument * This, - /* [in] */ VARIANT ondataavailableSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( - IXMLDOMDocument * This, - /* [in] */ VARIANT ontransformnodeSink); - - END_INTERFACE - } IXMLDOMDocumentVtbl; - - interface IXMLDOMDocument - { - CONST_VTBL struct IXMLDOMDocumentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMDocument_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMDocument_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMDocument_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMDocument_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMDocument_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMDocument_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMDocument_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMDocument_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMDocument_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMDocument_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMDocument_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMDocument_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMDocument_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMDocument_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMDocument_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMDocument_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMDocument_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMDocument_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMDocument_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMDocument_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMDocument_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMDocument_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMDocument_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMDocument_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMDocument_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMDocument_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMDocument_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMDocument_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMDocument_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMDocument_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMDocument_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMDocument_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMDocument_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMDocument_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMDocument_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMDocument_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMDocument_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMDocument_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMDocument_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMDocument_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMDocument_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMDocument_get_doctype(This,documentType) \ - (This)->lpVtbl -> get_doctype(This,documentType) - -#define IXMLDOMDocument_get_implementation(This,impl) \ - (This)->lpVtbl -> get_implementation(This,impl) - -#define IXMLDOMDocument_get_documentElement(This,DOMElement) \ - (This)->lpVtbl -> get_documentElement(This,DOMElement) - -#define IXMLDOMDocument_putref_documentElement(This,DOMElement) \ - (This)->lpVtbl -> putref_documentElement(This,DOMElement) - -#define IXMLDOMDocument_createElement(This,tagName,element) \ - (This)->lpVtbl -> createElement(This,tagName,element) - -#define IXMLDOMDocument_createDocumentFragment(This,docFrag) \ - (This)->lpVtbl -> createDocumentFragment(This,docFrag) - -#define IXMLDOMDocument_createTextNode(This,data,text) \ - (This)->lpVtbl -> createTextNode(This,data,text) - -#define IXMLDOMDocument_createComment(This,data,comment) \ - (This)->lpVtbl -> createComment(This,data,comment) - -#define IXMLDOMDocument_createCDATASection(This,data,cdata) \ - (This)->lpVtbl -> createCDATASection(This,data,cdata) - -#define IXMLDOMDocument_createProcessingInstruction(This,target,data,pi) \ - (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) - -#define IXMLDOMDocument_createAttribute(This,name,attribute) \ - (This)->lpVtbl -> createAttribute(This,name,attribute) - -#define IXMLDOMDocument_createEntityReference(This,name,entityRef) \ - (This)->lpVtbl -> createEntityReference(This,name,entityRef) - -#define IXMLDOMDocument_getElementsByTagName(This,tagName,resultList) \ - (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) - -#define IXMLDOMDocument_createNode(This,Type,name,namespaceURI,node) \ - (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) - -#define IXMLDOMDocument_nodeFromID(This,idString,node) \ - (This)->lpVtbl -> nodeFromID(This,idString,node) - -#define IXMLDOMDocument_load(This,xmlSource,isSuccessful) \ - (This)->lpVtbl -> load(This,xmlSource,isSuccessful) - -#define IXMLDOMDocument_get_readyState(This,value) \ - (This)->lpVtbl -> get_readyState(This,value) - -#define IXMLDOMDocument_get_parseError(This,errorObj) \ - (This)->lpVtbl -> get_parseError(This,errorObj) - -#define IXMLDOMDocument_get_url(This,urlString) \ - (This)->lpVtbl -> get_url(This,urlString) - -#define IXMLDOMDocument_get_async(This,isAsync) \ - (This)->lpVtbl -> get_async(This,isAsync) - -#define IXMLDOMDocument_put_async(This,isAsync) \ - (This)->lpVtbl -> put_async(This,isAsync) - -#define IXMLDOMDocument_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IXMLDOMDocument_loadXML(This,bstrXML,isSuccessful) \ - (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) - -#define IXMLDOMDocument_save(This,destination) \ - (This)->lpVtbl -> save(This,destination) - -#define IXMLDOMDocument_get_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> get_validateOnParse(This,isValidating) - -#define IXMLDOMDocument_put_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> put_validateOnParse(This,isValidating) - -#define IXMLDOMDocument_get_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> get_resolveExternals(This,isResolving) - -#define IXMLDOMDocument_put_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> put_resolveExternals(This,isResolving) - -#define IXMLDOMDocument_get_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument_put_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument_put_onreadystatechange(This,readystatechangeSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) - -#define IXMLDOMDocument_put_ondataavailable(This,ondataavailableSink) \ - (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) - -#define IXMLDOMDocument_put_ontransformnode(This,ontransformnodeSink) \ - (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_doctype_Proxy( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMDocumentType **documentType); - - -void __RPC_STUB IXMLDOMDocument_get_doctype_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_implementation_Proxy( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMImplementation **impl); - - -void __RPC_STUB IXMLDOMDocument_get_implementation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_documentElement_Proxy( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMElement **DOMElement); - - -void __RPC_STUB IXMLDOMDocument_get_documentElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_putref_documentElement_Proxy( - IXMLDOMDocument * This, - /* [in] */ IXMLDOMElement *DOMElement); - - -void __RPC_STUB IXMLDOMDocument_putref_documentElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createElement_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMElement **element); - - -void __RPC_STUB IXMLDOMDocument_createElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createDocumentFragment_Proxy( - IXMLDOMDocument * This, - /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); - - -void __RPC_STUB IXMLDOMDocument_createDocumentFragment_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createTextNode_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMText **text); - - -void __RPC_STUB IXMLDOMDocument_createTextNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createComment_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMComment **comment); - - -void __RPC_STUB IXMLDOMDocument_createComment_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createCDATASection_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMCDATASection **cdata); - - -void __RPC_STUB IXMLDOMDocument_createCDATASection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createProcessingInstruction_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR target, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMProcessingInstruction **pi); - - -void __RPC_STUB IXMLDOMDocument_createProcessingInstruction_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createAttribute_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attribute); - - -void __RPC_STUB IXMLDOMDocument_createAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createEntityReference_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMEntityReference **entityRef); - - -void __RPC_STUB IXMLDOMDocument_createEntityReference_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_getElementsByTagName_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - -void __RPC_STUB IXMLDOMDocument_getElementsByTagName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_createNode_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT Type, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [out][retval] */ IXMLDOMNode **node); - - -void __RPC_STUB IXMLDOMDocument_createNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_nodeFromID_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR idString, - /* [out][retval] */ IXMLDOMNode **node); - - -void __RPC_STUB IXMLDOMDocument_nodeFromID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_load_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT xmlSource, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - -void __RPC_STUB IXMLDOMDocument_load_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_readyState_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ long *value); - - -void __RPC_STUB IXMLDOMDocument_get_readyState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_parseError_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - -void __RPC_STUB IXMLDOMDocument_get_parseError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_url_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ BSTR *urlString); - - -void __RPC_STUB IXMLDOMDocument_get_url_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_async_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isAsync); - - -void __RPC_STUB IXMLDOMDocument_get_async_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_async_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isAsync); - - -void __RPC_STUB IXMLDOMDocument_put_async_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_abort_Proxy( - IXMLDOMDocument * This); - - -void __RPC_STUB IXMLDOMDocument_abort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_loadXML_Proxy( - IXMLDOMDocument * This, - /* [in] */ BSTR bstrXML, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - -void __RPC_STUB IXMLDOMDocument_loadXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_save_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT destination); - - -void __RPC_STUB IXMLDOMDocument_save_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_validateOnParse_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isValidating); - - -void __RPC_STUB IXMLDOMDocument_get_validateOnParse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_validateOnParse_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isValidating); - - -void __RPC_STUB IXMLDOMDocument_put_validateOnParse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_resolveExternals_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isResolving); - - -void __RPC_STUB IXMLDOMDocument_get_resolveExternals_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_resolveExternals_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isResolving); - - -void __RPC_STUB IXMLDOMDocument_put_resolveExternals_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_get_preserveWhiteSpace_Proxy( - IXMLDOMDocument * This, - /* [out][retval] */ VARIANT_BOOL *isPreserving); - - -void __RPC_STUB IXMLDOMDocument_get_preserveWhiteSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_preserveWhiteSpace_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT_BOOL isPreserving); - - -void __RPC_STUB IXMLDOMDocument_put_preserveWhiteSpace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_onreadystatechange_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT readystatechangeSink); - - -void __RPC_STUB IXMLDOMDocument_put_onreadystatechange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_ondataavailable_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT ondataavailableSink); - - -void __RPC_STUB IXMLDOMDocument_put_ondataavailable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument_put_ontransformnode_Proxy( - IXMLDOMDocument * This, - /* [in] */ VARIANT ontransformnodeSink); - - -void __RPC_STUB IXMLDOMDocument_put_ontransformnode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMDocument_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMDocument2_INTERFACE_DEFINED__ -#define __IXMLDOMDocument2_INTERFACE_DEFINED__ - -/* interface IXMLDOMDocument2 */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMDocument2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF95-7B36-11d2-B20E-00C04F983E60") - IXMLDOMDocument2 : public IXMLDOMDocument - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaces( - /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_schemas( - /* [retval][out] */ VARIANT *otherCollection) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_schemas( - /* [in] */ VARIANT otherCollection) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE validate( - /* [out][retval] */ IXMLDOMParseError **errorObj) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProperty( - /* [in] */ BSTR name, - /* [in] */ VARIANT value) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMDocument2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMDocument2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMDocument2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMDocument2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMDocument2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMDocument2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMDocument2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMDocument2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMDocument2 * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMDocument2 * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMDocument2 * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMDocument2 * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMDocument2 * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMDocument2 * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMDocumentType **documentType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMImplementation **impl); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMElement **DOMElement); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( - IXMLDOMDocument2 * This, - /* [in] */ IXMLDOMElement *DOMElement); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMElement **element); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMText **text); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMComment **comment); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMCDATASection **cdata); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR target, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMProcessingInstruction **pi); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attribute); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMEntityReference **entityRef); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT Type, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR idString, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT xmlSource, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IXMLDOMDocument2 * This, - /* [out][retval] */ long *value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( - IXMLDOMDocument2 * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( - IXMLDOMDocument2 * This, - /* [out][retval] */ BSTR *urlString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT_BOOL *isAsync); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT_BOOL isAsync); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IXMLDOMDocument2 * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR bstrXML, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT destination); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT_BOOL *isValidating); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT_BOOL isValidating); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT_BOOL *isResolving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT_BOOL isResolving); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( - IXMLDOMDocument2 * This, - /* [out][retval] */ VARIANT_BOOL *isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT_BOOL isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT readystatechangeSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT ondataavailableSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT ontransformnodeSink); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_schemas )( - IXMLDOMDocument2 * This, - /* [retval][out] */ VARIANT *otherCollection); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_schemas )( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT otherCollection); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validate )( - IXMLDOMDocument2 * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - END_INTERFACE - } IXMLDOMDocument2Vtbl; - - interface IXMLDOMDocument2 - { - CONST_VTBL struct IXMLDOMDocument2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMDocument2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMDocument2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMDocument2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMDocument2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMDocument2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMDocument2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMDocument2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMDocument2_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMDocument2_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMDocument2_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMDocument2_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMDocument2_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMDocument2_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMDocument2_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMDocument2_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMDocument2_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMDocument2_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMDocument2_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMDocument2_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMDocument2_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMDocument2_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMDocument2_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMDocument2_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMDocument2_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMDocument2_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMDocument2_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMDocument2_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMDocument2_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMDocument2_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMDocument2_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMDocument2_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument2_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument2_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMDocument2_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMDocument2_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMDocument2_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMDocument2_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMDocument2_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMDocument2_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMDocument2_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMDocument2_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMDocument2_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMDocument2_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMDocument2_get_doctype(This,documentType) \ - (This)->lpVtbl -> get_doctype(This,documentType) - -#define IXMLDOMDocument2_get_implementation(This,impl) \ - (This)->lpVtbl -> get_implementation(This,impl) - -#define IXMLDOMDocument2_get_documentElement(This,DOMElement) \ - (This)->lpVtbl -> get_documentElement(This,DOMElement) - -#define IXMLDOMDocument2_putref_documentElement(This,DOMElement) \ - (This)->lpVtbl -> putref_documentElement(This,DOMElement) - -#define IXMLDOMDocument2_createElement(This,tagName,element) \ - (This)->lpVtbl -> createElement(This,tagName,element) - -#define IXMLDOMDocument2_createDocumentFragment(This,docFrag) \ - (This)->lpVtbl -> createDocumentFragment(This,docFrag) - -#define IXMLDOMDocument2_createTextNode(This,data,text) \ - (This)->lpVtbl -> createTextNode(This,data,text) - -#define IXMLDOMDocument2_createComment(This,data,comment) \ - (This)->lpVtbl -> createComment(This,data,comment) - -#define IXMLDOMDocument2_createCDATASection(This,data,cdata) \ - (This)->lpVtbl -> createCDATASection(This,data,cdata) - -#define IXMLDOMDocument2_createProcessingInstruction(This,target,data,pi) \ - (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) - -#define IXMLDOMDocument2_createAttribute(This,name,attribute) \ - (This)->lpVtbl -> createAttribute(This,name,attribute) - -#define IXMLDOMDocument2_createEntityReference(This,name,entityRef) \ - (This)->lpVtbl -> createEntityReference(This,name,entityRef) - -#define IXMLDOMDocument2_getElementsByTagName(This,tagName,resultList) \ - (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) - -#define IXMLDOMDocument2_createNode(This,Type,name,namespaceURI,node) \ - (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) - -#define IXMLDOMDocument2_nodeFromID(This,idString,node) \ - (This)->lpVtbl -> nodeFromID(This,idString,node) - -#define IXMLDOMDocument2_load(This,xmlSource,isSuccessful) \ - (This)->lpVtbl -> load(This,xmlSource,isSuccessful) - -#define IXMLDOMDocument2_get_readyState(This,value) \ - (This)->lpVtbl -> get_readyState(This,value) - -#define IXMLDOMDocument2_get_parseError(This,errorObj) \ - (This)->lpVtbl -> get_parseError(This,errorObj) - -#define IXMLDOMDocument2_get_url(This,urlString) \ - (This)->lpVtbl -> get_url(This,urlString) - -#define IXMLDOMDocument2_get_async(This,isAsync) \ - (This)->lpVtbl -> get_async(This,isAsync) - -#define IXMLDOMDocument2_put_async(This,isAsync) \ - (This)->lpVtbl -> put_async(This,isAsync) - -#define IXMLDOMDocument2_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IXMLDOMDocument2_loadXML(This,bstrXML,isSuccessful) \ - (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) - -#define IXMLDOMDocument2_save(This,destination) \ - (This)->lpVtbl -> save(This,destination) - -#define IXMLDOMDocument2_get_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> get_validateOnParse(This,isValidating) - -#define IXMLDOMDocument2_put_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> put_validateOnParse(This,isValidating) - -#define IXMLDOMDocument2_get_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> get_resolveExternals(This,isResolving) - -#define IXMLDOMDocument2_put_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> put_resolveExternals(This,isResolving) - -#define IXMLDOMDocument2_get_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument2_put_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument2_put_onreadystatechange(This,readystatechangeSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) - -#define IXMLDOMDocument2_put_ondataavailable(This,ondataavailableSink) \ - (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) - -#define IXMLDOMDocument2_put_ontransformnode(This,ontransformnodeSink) \ - (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) - - -#define IXMLDOMDocument2_get_namespaces(This,namespaceCollection) \ - (This)->lpVtbl -> get_namespaces(This,namespaceCollection) - -#define IXMLDOMDocument2_get_schemas(This,otherCollection) \ - (This)->lpVtbl -> get_schemas(This,otherCollection) - -#define IXMLDOMDocument2_putref_schemas(This,otherCollection) \ - (This)->lpVtbl -> putref_schemas(This,otherCollection) - -#define IXMLDOMDocument2_validate(This,errorObj) \ - (This)->lpVtbl -> validate(This,errorObj) - -#define IXMLDOMDocument2_setProperty(This,name,value) \ - (This)->lpVtbl -> setProperty(This,name,value) - -#define IXMLDOMDocument2_getProperty(This,name,value) \ - (This)->lpVtbl -> getProperty(This,name,value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_get_namespaces_Proxy( - IXMLDOMDocument2 * This, - /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); - - -void __RPC_STUB IXMLDOMDocument2_get_namespaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_get_schemas_Proxy( - IXMLDOMDocument2 * This, - /* [retval][out] */ VARIANT *otherCollection); - - -void __RPC_STUB IXMLDOMDocument2_get_schemas_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_putref_schemas_Proxy( - IXMLDOMDocument2 * This, - /* [in] */ VARIANT otherCollection); - - -void __RPC_STUB IXMLDOMDocument2_putref_schemas_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_validate_Proxy( - IXMLDOMDocument2 * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - -void __RPC_STUB IXMLDOMDocument2_validate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_setProperty_Proxy( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - -void __RPC_STUB IXMLDOMDocument2_setProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument2_getProperty_Proxy( - IXMLDOMDocument2 * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - -void __RPC_STUB IXMLDOMDocument2_getProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMDocument2_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMDocument3_INTERFACE_DEFINED__ -#define __IXMLDOMDocument3_INTERFACE_DEFINED__ - -/* interface IXMLDOMDocument3 */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMDocument3; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF96-7B36-11d2-B20E-00C04F983E60") - IXMLDOMDocument3 : public IXMLDOMDocument2 - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE validateNode( - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ IXMLDOMParseError **errorObj) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE importNode( - /* [in] */ IXMLDOMNode *node, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **clone) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMDocument3Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMDocument3 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMDocument3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMDocument3 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMDocument3 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMDocument3 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMDocument3 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMDocument3 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMDocument3 * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMDocument3 * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMDocument3 * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMDocument3 * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMDocument3 * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMDocument3 * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_doctype )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMDocumentType **documentType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_implementation )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMImplementation **impl); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_documentElement )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMElement **DOMElement); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentElement )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMElement *DOMElement); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createElement )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMElement **element); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createDocumentFragment )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMDocumentFragment **docFrag); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createTextNode )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMText **text); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createComment )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMComment **comment); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createCDATASection )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMCDATASection **cdata); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessingInstruction )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR target, - /* [in] */ BSTR data, - /* [retval][out] */ IXMLDOMProcessingInstruction **pi); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createAttribute )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attribute); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createEntityReference )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMEntityReference **entityRef); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createNode )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT Type, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nodeFromID )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR idString, - /* [out][retval] */ IXMLDOMNode **node); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *load )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT xmlSource, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IXMLDOMDocument3 * This, - /* [out][retval] */ long *value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parseError )( - IXMLDOMDocument3 * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( - IXMLDOMDocument3 * This, - /* [out][retval] */ BSTR *urlString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_async )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT_BOOL *isAsync); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_async )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT_BOOL isAsync); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IXMLDOMDocument3 * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *loadXML )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR bstrXML, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *save )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT destination); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnParse )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT_BOOL *isValidating); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnParse )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT_BOOL isValidating); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_resolveExternals )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT_BOOL *isResolving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_resolveExternals )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT_BOOL isResolving); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_preserveWhiteSpace )( - IXMLDOMDocument3 * This, - /* [out][retval] */ VARIANT_BOOL *isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_preserveWhiteSpace )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT_BOOL isPreserving); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT readystatechangeSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ondataavailable )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT ondataavailableSink); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ontransformnode )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT ontransformnodeSink); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( - IXMLDOMDocument3 * This, - /* [retval][out] */ IXMLDOMSchemaCollection **namespaceCollection); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_schemas )( - IXMLDOMDocument3 * This, - /* [retval][out] */ VARIANT *otherCollection); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_schemas )( - IXMLDOMDocument3 * This, - /* [in] */ VARIANT otherCollection); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validate )( - IXMLDOMDocument3 * This, - /* [out][retval] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( - IXMLDOMDocument3 * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *validateNode )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ IXMLDOMParseError **errorObj); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *importNode )( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *node, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **clone); - - END_INTERFACE - } IXMLDOMDocument3Vtbl; - - interface IXMLDOMDocument3 - { - CONST_VTBL struct IXMLDOMDocument3Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMDocument3_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMDocument3_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMDocument3_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMDocument3_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMDocument3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMDocument3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMDocument3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMDocument3_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMDocument3_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMDocument3_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMDocument3_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMDocument3_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMDocument3_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMDocument3_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMDocument3_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMDocument3_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMDocument3_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMDocument3_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMDocument3_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMDocument3_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMDocument3_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMDocument3_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMDocument3_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMDocument3_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMDocument3_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMDocument3_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMDocument3_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMDocument3_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMDocument3_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMDocument3_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMDocument3_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument3_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocument3_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMDocument3_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMDocument3_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMDocument3_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMDocument3_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMDocument3_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMDocument3_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMDocument3_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMDocument3_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMDocument3_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMDocument3_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMDocument3_get_doctype(This,documentType) \ - (This)->lpVtbl -> get_doctype(This,documentType) - -#define IXMLDOMDocument3_get_implementation(This,impl) \ - (This)->lpVtbl -> get_implementation(This,impl) - -#define IXMLDOMDocument3_get_documentElement(This,DOMElement) \ - (This)->lpVtbl -> get_documentElement(This,DOMElement) - -#define IXMLDOMDocument3_putref_documentElement(This,DOMElement) \ - (This)->lpVtbl -> putref_documentElement(This,DOMElement) - -#define IXMLDOMDocument3_createElement(This,tagName,element) \ - (This)->lpVtbl -> createElement(This,tagName,element) - -#define IXMLDOMDocument3_createDocumentFragment(This,docFrag) \ - (This)->lpVtbl -> createDocumentFragment(This,docFrag) - -#define IXMLDOMDocument3_createTextNode(This,data,text) \ - (This)->lpVtbl -> createTextNode(This,data,text) - -#define IXMLDOMDocument3_createComment(This,data,comment) \ - (This)->lpVtbl -> createComment(This,data,comment) - -#define IXMLDOMDocument3_createCDATASection(This,data,cdata) \ - (This)->lpVtbl -> createCDATASection(This,data,cdata) - -#define IXMLDOMDocument3_createProcessingInstruction(This,target,data,pi) \ - (This)->lpVtbl -> createProcessingInstruction(This,target,data,pi) - -#define IXMLDOMDocument3_createAttribute(This,name,attribute) \ - (This)->lpVtbl -> createAttribute(This,name,attribute) - -#define IXMLDOMDocument3_createEntityReference(This,name,entityRef) \ - (This)->lpVtbl -> createEntityReference(This,name,entityRef) - -#define IXMLDOMDocument3_getElementsByTagName(This,tagName,resultList) \ - (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) - -#define IXMLDOMDocument3_createNode(This,Type,name,namespaceURI,node) \ - (This)->lpVtbl -> createNode(This,Type,name,namespaceURI,node) - -#define IXMLDOMDocument3_nodeFromID(This,idString,node) \ - (This)->lpVtbl -> nodeFromID(This,idString,node) - -#define IXMLDOMDocument3_load(This,xmlSource,isSuccessful) \ - (This)->lpVtbl -> load(This,xmlSource,isSuccessful) - -#define IXMLDOMDocument3_get_readyState(This,value) \ - (This)->lpVtbl -> get_readyState(This,value) - -#define IXMLDOMDocument3_get_parseError(This,errorObj) \ - (This)->lpVtbl -> get_parseError(This,errorObj) - -#define IXMLDOMDocument3_get_url(This,urlString) \ - (This)->lpVtbl -> get_url(This,urlString) - -#define IXMLDOMDocument3_get_async(This,isAsync) \ - (This)->lpVtbl -> get_async(This,isAsync) - -#define IXMLDOMDocument3_put_async(This,isAsync) \ - (This)->lpVtbl -> put_async(This,isAsync) - -#define IXMLDOMDocument3_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IXMLDOMDocument3_loadXML(This,bstrXML,isSuccessful) \ - (This)->lpVtbl -> loadXML(This,bstrXML,isSuccessful) - -#define IXMLDOMDocument3_save(This,destination) \ - (This)->lpVtbl -> save(This,destination) - -#define IXMLDOMDocument3_get_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> get_validateOnParse(This,isValidating) - -#define IXMLDOMDocument3_put_validateOnParse(This,isValidating) \ - (This)->lpVtbl -> put_validateOnParse(This,isValidating) - -#define IXMLDOMDocument3_get_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> get_resolveExternals(This,isResolving) - -#define IXMLDOMDocument3_put_resolveExternals(This,isResolving) \ - (This)->lpVtbl -> put_resolveExternals(This,isResolving) - -#define IXMLDOMDocument3_get_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> get_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument3_put_preserveWhiteSpace(This,isPreserving) \ - (This)->lpVtbl -> put_preserveWhiteSpace(This,isPreserving) - -#define IXMLDOMDocument3_put_onreadystatechange(This,readystatechangeSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,readystatechangeSink) - -#define IXMLDOMDocument3_put_ondataavailable(This,ondataavailableSink) \ - (This)->lpVtbl -> put_ondataavailable(This,ondataavailableSink) - -#define IXMLDOMDocument3_put_ontransformnode(This,ontransformnodeSink) \ - (This)->lpVtbl -> put_ontransformnode(This,ontransformnodeSink) - - -#define IXMLDOMDocument3_get_namespaces(This,namespaceCollection) \ - (This)->lpVtbl -> get_namespaces(This,namespaceCollection) - -#define IXMLDOMDocument3_get_schemas(This,otherCollection) \ - (This)->lpVtbl -> get_schemas(This,otherCollection) - -#define IXMLDOMDocument3_putref_schemas(This,otherCollection) \ - (This)->lpVtbl -> putref_schemas(This,otherCollection) - -#define IXMLDOMDocument3_validate(This,errorObj) \ - (This)->lpVtbl -> validate(This,errorObj) - -#define IXMLDOMDocument3_setProperty(This,name,value) \ - (This)->lpVtbl -> setProperty(This,name,value) - -#define IXMLDOMDocument3_getProperty(This,name,value) \ - (This)->lpVtbl -> getProperty(This,name,value) - - -#define IXMLDOMDocument3_validateNode(This,node,errorObj) \ - (This)->lpVtbl -> validateNode(This,node,errorObj) - -#define IXMLDOMDocument3_importNode(This,node,deep,clone) \ - (This)->lpVtbl -> importNode(This,node,deep,clone) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument3_validateNode_Proxy( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ IXMLDOMParseError **errorObj); - - -void __RPC_STUB IXMLDOMDocument3_validateNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocument3_importNode_Proxy( - IXMLDOMDocument3 * This, - /* [in] */ IXMLDOMNode *node, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **clone); - - -void __RPC_STUB IXMLDOMDocument3_importNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMDocument3_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMNodeList_INTERFACE_DEFINED__ -#define __IXMLDOMNodeList_INTERFACE_DEFINED__ - -/* interface IXMLDOMNodeList */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMNodeList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF82-7B36-11d2-B20E-00C04F983E60") - IXMLDOMNodeList : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *listLength) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nextNode( - /* [retval][out] */ IXMLDOMNode **nextItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [out][retval] */ IUnknown **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMNodeListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMNodeList * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMNodeList * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMNodeList * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMNodeList * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMNodeList * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMNodeList * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMNodeList * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - IXMLDOMNodeList * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMNodeList * This, - /* [retval][out] */ long *listLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( - IXMLDOMNodeList * This, - /* [retval][out] */ IXMLDOMNode **nextItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IXMLDOMNodeList * This); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMNodeList * This, - /* [out][retval] */ IUnknown **ppUnk); - - END_INTERFACE - } IXMLDOMNodeListVtbl; - - interface IXMLDOMNodeList - { - CONST_VTBL struct IXMLDOMNodeListVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMNodeList_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMNodeList_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMNodeList_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMNodeList_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMNodeList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMNodeList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMNodeList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMNodeList_get_item(This,index,listItem) \ - (This)->lpVtbl -> get_item(This,index,listItem) - -#define IXMLDOMNodeList_get_length(This,listLength) \ - (This)->lpVtbl -> get_length(This,listLength) - -#define IXMLDOMNodeList_nextNode(This,nextItem) \ - (This)->lpVtbl -> nextNode(This,nextItem) - -#define IXMLDOMNodeList_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IXMLDOMNodeList_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get_item_Proxy( - IXMLDOMNodeList * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem); - - -void __RPC_STUB IXMLDOMNodeList_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get_length_Proxy( - IXMLDOMNodeList * This, - /* [retval][out] */ long *listLength); - - -void __RPC_STUB IXMLDOMNodeList_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_nextNode_Proxy( - IXMLDOMNodeList * This, - /* [retval][out] */ IXMLDOMNode **nextItem); - - -void __RPC_STUB IXMLDOMNodeList_nextNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_reset_Proxy( - IXMLDOMNodeList * This); - - -void __RPC_STUB IXMLDOMNodeList_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNodeList_get__newEnum_Proxy( - IXMLDOMNodeList * This, - /* [out][retval] */ IUnknown **ppUnk); - - -void __RPC_STUB IXMLDOMNodeList_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMNodeList_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ -#define __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ - -/* interface IXMLDOMNamedNodeMap */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMNamedNodeMap; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF83-7B36-11d2-B20E-00C04F983E60") - IXMLDOMNamedNodeMap : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getNamedItem( - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setNamedItem( - /* [in] */ IXMLDOMNode *newItem, - /* [retval][out] */ IXMLDOMNode **nameItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeNamedItem( - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *listLength) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getQualifiedItem( - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeQualifiedItem( - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE nextNode( - /* [retval][out] */ IXMLDOMNode **nextItem) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [out][retval] */ IUnknown **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMNamedNodeMapVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMNamedNodeMap * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMNamedNodeMap * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMNamedNodeMap * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMNamedNodeMap * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMNamedNodeMap * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMNamedNodeMap * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMNamedNodeMap * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getNamedItem )( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setNamedItem )( - IXMLDOMNamedNodeMap * This, - /* [in] */ IXMLDOMNode *newItem, - /* [retval][out] */ IXMLDOMNode **nameItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeNamedItem )( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - IXMLDOMNamedNodeMap * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMNamedNodeMap * This, - /* [retval][out] */ long *listLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getQualifiedItem )( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeQualifiedItem )( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( - IXMLDOMNamedNodeMap * This, - /* [retval][out] */ IXMLDOMNode **nextItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IXMLDOMNamedNodeMap * This); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMNamedNodeMap * This, - /* [out][retval] */ IUnknown **ppUnk); - - END_INTERFACE - } IXMLDOMNamedNodeMapVtbl; - - interface IXMLDOMNamedNodeMap - { - CONST_VTBL struct IXMLDOMNamedNodeMapVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMNamedNodeMap_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMNamedNodeMap_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMNamedNodeMap_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMNamedNodeMap_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMNamedNodeMap_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMNamedNodeMap_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMNamedNodeMap_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMNamedNodeMap_getNamedItem(This,name,namedItem) \ - (This)->lpVtbl -> getNamedItem(This,name,namedItem) - -#define IXMLDOMNamedNodeMap_setNamedItem(This,newItem,nameItem) \ - (This)->lpVtbl -> setNamedItem(This,newItem,nameItem) - -#define IXMLDOMNamedNodeMap_removeNamedItem(This,name,namedItem) \ - (This)->lpVtbl -> removeNamedItem(This,name,namedItem) - -#define IXMLDOMNamedNodeMap_get_item(This,index,listItem) \ - (This)->lpVtbl -> get_item(This,index,listItem) - -#define IXMLDOMNamedNodeMap_get_length(This,listLength) \ - (This)->lpVtbl -> get_length(This,listLength) - -#define IXMLDOMNamedNodeMap_getQualifiedItem(This,baseName,namespaceURI,qualifiedItem) \ - (This)->lpVtbl -> getQualifiedItem(This,baseName,namespaceURI,qualifiedItem) - -#define IXMLDOMNamedNodeMap_removeQualifiedItem(This,baseName,namespaceURI,qualifiedItem) \ - (This)->lpVtbl -> removeQualifiedItem(This,baseName,namespaceURI,qualifiedItem) - -#define IXMLDOMNamedNodeMap_nextNode(This,nextItem) \ - (This)->lpVtbl -> nextNode(This,nextItem) - -#define IXMLDOMNamedNodeMap_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IXMLDOMNamedNodeMap_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_getNamedItem_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_getNamedItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_setNamedItem_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ IXMLDOMNode *newItem, - /* [retval][out] */ IXMLDOMNode **nameItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_setNamedItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_removeNamedItem_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMNode **namedItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_removeNamedItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get_item_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get_length_Proxy( - IXMLDOMNamedNodeMap * This, - /* [retval][out] */ long *listLength); - - -void __RPC_STUB IXMLDOMNamedNodeMap_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_getQualifiedItem_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_getQualifiedItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_removeQualifiedItem_Proxy( - IXMLDOMNamedNodeMap * This, - /* [in] */ BSTR baseName, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **qualifiedItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_removeQualifiedItem_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_nextNode_Proxy( - IXMLDOMNamedNodeMap * This, - /* [retval][out] */ IXMLDOMNode **nextItem); - - -void __RPC_STUB IXMLDOMNamedNodeMap_nextNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_reset_Proxy( - IXMLDOMNamedNodeMap * This); - - -void __RPC_STUB IXMLDOMNamedNodeMap_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNamedNodeMap_get__newEnum_Proxy( - IXMLDOMNamedNodeMap * This, - /* [out][retval] */ IUnknown **ppUnk); - - -void __RPC_STUB IXMLDOMNamedNodeMap_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMNamedNodeMap_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMCharacterData_INTERFACE_DEFINED__ -#define __IXMLDOMCharacterData_INTERFACE_DEFINED__ - -/* interface IXMLDOMCharacterData */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMCharacterData; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF84-7B36-11d2-B20E-00C04F983E60") - IXMLDOMCharacterData : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_data( - /* [retval][out] */ BSTR *data) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_data( - /* [in] */ BSTR data) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *dataLength) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE substringData( - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE appendData( - /* [in] */ BSTR data) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE insertData( - /* [in] */ long offset, - /* [in] */ BSTR data) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE deleteData( - /* [in] */ long offset, - /* [in] */ long count) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE replaceData( - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMCharacterDataVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMCharacterData * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMCharacterData * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMCharacterData * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMCharacterData * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMCharacterData * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMCharacterData * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMCharacterData * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMCharacterData * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMCharacterData * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMCharacterData * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMCharacterData * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMCharacterData * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMCharacterData * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMCharacterData * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMCharacterData * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMCharacterData * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMCharacterData * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMCharacterData * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMCharacterData * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMCharacterData * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMCharacterData * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMCharacterData * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( - IXMLDOMCharacterData * This, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR data); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMCharacterData * This, - /* [retval][out] */ long *dataLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( - IXMLDOMCharacterData * This, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data); - - END_INTERFACE - } IXMLDOMCharacterDataVtbl; - - interface IXMLDOMCharacterData - { - CONST_VTBL struct IXMLDOMCharacterDataVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMCharacterData_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMCharacterData_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMCharacterData_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMCharacterData_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMCharacterData_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMCharacterData_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMCharacterData_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMCharacterData_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMCharacterData_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMCharacterData_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMCharacterData_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMCharacterData_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMCharacterData_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMCharacterData_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMCharacterData_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMCharacterData_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMCharacterData_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMCharacterData_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMCharacterData_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMCharacterData_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMCharacterData_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMCharacterData_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMCharacterData_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMCharacterData_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMCharacterData_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMCharacterData_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMCharacterData_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMCharacterData_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMCharacterData_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMCharacterData_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMCharacterData_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMCharacterData_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMCharacterData_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMCharacterData_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMCharacterData_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMCharacterData_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMCharacterData_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMCharacterData_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMCharacterData_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMCharacterData_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMCharacterData_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMCharacterData_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMCharacterData_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMCharacterData_get_data(This,data) \ - (This)->lpVtbl -> get_data(This,data) - -#define IXMLDOMCharacterData_put_data(This,data) \ - (This)->lpVtbl -> put_data(This,data) - -#define IXMLDOMCharacterData_get_length(This,dataLength) \ - (This)->lpVtbl -> get_length(This,dataLength) - -#define IXMLDOMCharacterData_substringData(This,offset,count,data) \ - (This)->lpVtbl -> substringData(This,offset,count,data) - -#define IXMLDOMCharacterData_appendData(This,data) \ - (This)->lpVtbl -> appendData(This,data) - -#define IXMLDOMCharacterData_insertData(This,offset,data) \ - (This)->lpVtbl -> insertData(This,offset,data) - -#define IXMLDOMCharacterData_deleteData(This,offset,count) \ - (This)->lpVtbl -> deleteData(This,offset,count) - -#define IXMLDOMCharacterData_replaceData(This,offset,count,data) \ - (This)->lpVtbl -> replaceData(This,offset,count,data) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_get_data_Proxy( - IXMLDOMCharacterData * This, - /* [retval][out] */ BSTR *data); - - -void __RPC_STUB IXMLDOMCharacterData_get_data_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_put_data_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ BSTR data); - - -void __RPC_STUB IXMLDOMCharacterData_put_data_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_get_length_Proxy( - IXMLDOMCharacterData * This, - /* [retval][out] */ long *dataLength); - - -void __RPC_STUB IXMLDOMCharacterData_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_substringData_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data); - - -void __RPC_STUB IXMLDOMCharacterData_substringData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_appendData_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ BSTR data); - - -void __RPC_STUB IXMLDOMCharacterData_appendData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_insertData_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ BSTR data); - - -void __RPC_STUB IXMLDOMCharacterData_insertData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_deleteData_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count); - - -void __RPC_STUB IXMLDOMCharacterData_deleteData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMCharacterData_replaceData_Proxy( - IXMLDOMCharacterData * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data); - - -void __RPC_STUB IXMLDOMCharacterData_replaceData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMCharacterData_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMAttribute_INTERFACE_DEFINED__ -#define __IXMLDOMAttribute_INTERFACE_DEFINED__ - -/* interface IXMLDOMAttribute */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMAttribute; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF85-7B36-11d2-B20E-00C04F983E60") - IXMLDOMAttribute : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_name( - /* [retval][out] */ BSTR *attributeName) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_value( - /* [retval][out] */ VARIANT *attributeValue) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_value( - /* [in] */ VARIANT attributeValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMAttributeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMAttribute * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMAttribute * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMAttribute * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMAttribute * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMAttribute * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMAttribute * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMAttribute * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMAttribute * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMAttribute * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMAttribute * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMAttribute * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMAttribute * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMAttribute * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMAttribute * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMAttribute * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMAttribute * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMAttribute * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMAttribute * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMAttribute * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMAttribute * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMAttribute * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMAttribute * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMAttribute * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMAttribute * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMAttribute * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMAttribute * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - IXMLDOMAttribute * This, - /* [retval][out] */ BSTR *attributeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_value )( - IXMLDOMAttribute * This, - /* [retval][out] */ VARIANT *attributeValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_value )( - IXMLDOMAttribute * This, - /* [in] */ VARIANT attributeValue); - - END_INTERFACE - } IXMLDOMAttributeVtbl; - - interface IXMLDOMAttribute - { - CONST_VTBL struct IXMLDOMAttributeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMAttribute_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMAttribute_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMAttribute_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMAttribute_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMAttribute_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMAttribute_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMAttribute_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMAttribute_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMAttribute_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMAttribute_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMAttribute_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMAttribute_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMAttribute_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMAttribute_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMAttribute_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMAttribute_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMAttribute_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMAttribute_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMAttribute_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMAttribute_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMAttribute_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMAttribute_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMAttribute_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMAttribute_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMAttribute_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMAttribute_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMAttribute_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMAttribute_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMAttribute_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMAttribute_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMAttribute_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMAttribute_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMAttribute_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMAttribute_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMAttribute_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMAttribute_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMAttribute_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMAttribute_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMAttribute_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMAttribute_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMAttribute_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMAttribute_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMAttribute_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMAttribute_get_name(This,attributeName) \ - (This)->lpVtbl -> get_name(This,attributeName) - -#define IXMLDOMAttribute_get_value(This,attributeValue) \ - (This)->lpVtbl -> get_value(This,attributeValue) - -#define IXMLDOMAttribute_put_value(This,attributeValue) \ - (This)->lpVtbl -> put_value(This,attributeValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_get_name_Proxy( - IXMLDOMAttribute * This, - /* [retval][out] */ BSTR *attributeName); - - -void __RPC_STUB IXMLDOMAttribute_get_name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_get_value_Proxy( - IXMLDOMAttribute * This, - /* [retval][out] */ VARIANT *attributeValue); - - -void __RPC_STUB IXMLDOMAttribute_get_value_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMAttribute_put_value_Proxy( - IXMLDOMAttribute * This, - /* [in] */ VARIANT attributeValue); - - -void __RPC_STUB IXMLDOMAttribute_put_value_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMAttribute_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMElement_INTERFACE_DEFINED__ -#define __IXMLDOMElement_INTERFACE_DEFINED__ - -/* interface IXMLDOMElement */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMElement; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF86-7B36-11d2-B20E-00C04F983E60") - IXMLDOMElement : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_tagName( - /* [retval][out] */ BSTR *tagName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAttribute( - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttribute( - /* [in] */ BSTR name, - /* [in] */ VARIANT value) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttribute( - /* [in] */ BSTR name) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAttributeNode( - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttributeNode( - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttributeNode( - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getElementsByTagName( - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE normalize( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMElementVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMElement * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMElement * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMElement * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMElement * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMElement * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMElement * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMElement * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMElement * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMElement * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMElement * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMElement * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMElement * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMElement * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMElement * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMElement * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMElement * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMElement * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMElement * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMElement * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMElement * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMElement * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMElement * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMElement * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMElement * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMElement * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_tagName )( - IXMLDOMElement * This, - /* [retval][out] */ BSTR *tagName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAttribute )( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttribute )( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttribute )( - IXMLDOMElement * This, - /* [in] */ BSTR name); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAttributeNode )( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttributeNode )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttributeNode )( - IXMLDOMElement * This, - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getElementsByTagName )( - IXMLDOMElement * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *normalize )( - IXMLDOMElement * This); - - END_INTERFACE - } IXMLDOMElementVtbl; - - interface IXMLDOMElement - { - CONST_VTBL struct IXMLDOMElementVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMElement_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMElement_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMElement_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMElement_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMElement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMElement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMElement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMElement_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMElement_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMElement_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMElement_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMElement_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMElement_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMElement_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMElement_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMElement_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMElement_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMElement_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMElement_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMElement_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMElement_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMElement_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMElement_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMElement_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMElement_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMElement_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMElement_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMElement_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMElement_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMElement_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMElement_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMElement_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMElement_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMElement_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMElement_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMElement_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMElement_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMElement_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMElement_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMElement_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMElement_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMElement_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMElement_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMElement_get_tagName(This,tagName) \ - (This)->lpVtbl -> get_tagName(This,tagName) - -#define IXMLDOMElement_getAttribute(This,name,value) \ - (This)->lpVtbl -> getAttribute(This,name,value) - -#define IXMLDOMElement_setAttribute(This,name,value) \ - (This)->lpVtbl -> setAttribute(This,name,value) - -#define IXMLDOMElement_removeAttribute(This,name) \ - (This)->lpVtbl -> removeAttribute(This,name) - -#define IXMLDOMElement_getAttributeNode(This,name,attributeNode) \ - (This)->lpVtbl -> getAttributeNode(This,name,attributeNode) - -#define IXMLDOMElement_setAttributeNode(This,DOMAttribute,attributeNode) \ - (This)->lpVtbl -> setAttributeNode(This,DOMAttribute,attributeNode) - -#define IXMLDOMElement_removeAttributeNode(This,DOMAttribute,attributeNode) \ - (This)->lpVtbl -> removeAttributeNode(This,DOMAttribute,attributeNode) - -#define IXMLDOMElement_getElementsByTagName(This,tagName,resultList) \ - (This)->lpVtbl -> getElementsByTagName(This,tagName,resultList) - -#define IXMLDOMElement_normalize(This) \ - (This)->lpVtbl -> normalize(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_get_tagName_Proxy( - IXMLDOMElement * This, - /* [retval][out] */ BSTR *tagName); - - -void __RPC_STUB IXMLDOMElement_get_tagName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getAttribute_Proxy( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - -void __RPC_STUB IXMLDOMElement_getAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_setAttribute_Proxy( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - -void __RPC_STUB IXMLDOMElement_setAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_removeAttribute_Proxy( - IXMLDOMElement * This, - /* [in] */ BSTR name); - - -void __RPC_STUB IXMLDOMElement_removeAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getAttributeNode_Proxy( - IXMLDOMElement * This, - /* [in] */ BSTR name, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - -void __RPC_STUB IXMLDOMElement_getAttributeNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_setAttributeNode_Proxy( - IXMLDOMElement * This, - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - -void __RPC_STUB IXMLDOMElement_setAttributeNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_removeAttributeNode_Proxy( - IXMLDOMElement * This, - /* [in] */ IXMLDOMAttribute *DOMAttribute, - /* [retval][out] */ IXMLDOMAttribute **attributeNode); - - -void __RPC_STUB IXMLDOMElement_removeAttributeNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_getElementsByTagName_Proxy( - IXMLDOMElement * This, - /* [in] */ BSTR tagName, - /* [retval][out] */ IXMLDOMNodeList **resultList); - - -void __RPC_STUB IXMLDOMElement_getElementsByTagName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMElement_normalize_Proxy( - IXMLDOMElement * This); - - -void __RPC_STUB IXMLDOMElement_normalize_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMElement_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMText_INTERFACE_DEFINED__ -#define __IXMLDOMText_INTERFACE_DEFINED__ - -/* interface IXMLDOMText */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMText; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF87-7B36-11d2-B20E-00C04F983E60") - IXMLDOMText : public IXMLDOMCharacterData - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE splitText( - /* [in] */ long offset, - /* [retval][out] */ IXMLDOMText **rightHandTextNode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMTextVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMText * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMText * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMText * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMText * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMText * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMText * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMText * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMText * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMText * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMText * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMText * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMText * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMText * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMText * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMText * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMText * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMText * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMText * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMText * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMText * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMText * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMText * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMText * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMText * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMText * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMText * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( - IXMLDOMText * This, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( - IXMLDOMText * This, - /* [in] */ BSTR data); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMText * This, - /* [retval][out] */ long *dataLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( - IXMLDOMText * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( - IXMLDOMText * This, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( - IXMLDOMText * This, - /* [in] */ long offset, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( - IXMLDOMText * This, - /* [in] */ long offset, - /* [in] */ long count); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( - IXMLDOMText * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *splitText )( - IXMLDOMText * This, - /* [in] */ long offset, - /* [retval][out] */ IXMLDOMText **rightHandTextNode); - - END_INTERFACE - } IXMLDOMTextVtbl; - - interface IXMLDOMText - { - CONST_VTBL struct IXMLDOMTextVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMText_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMText_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMText_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMText_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMText_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMText_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMText_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMText_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMText_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMText_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMText_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMText_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMText_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMText_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMText_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMText_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMText_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMText_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMText_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMText_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMText_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMText_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMText_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMText_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMText_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMText_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMText_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMText_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMText_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMText_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMText_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMText_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMText_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMText_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMText_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMText_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMText_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMText_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMText_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMText_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMText_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMText_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMText_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMText_get_data(This,data) \ - (This)->lpVtbl -> get_data(This,data) - -#define IXMLDOMText_put_data(This,data) \ - (This)->lpVtbl -> put_data(This,data) - -#define IXMLDOMText_get_length(This,dataLength) \ - (This)->lpVtbl -> get_length(This,dataLength) - -#define IXMLDOMText_substringData(This,offset,count,data) \ - (This)->lpVtbl -> substringData(This,offset,count,data) - -#define IXMLDOMText_appendData(This,data) \ - (This)->lpVtbl -> appendData(This,data) - -#define IXMLDOMText_insertData(This,offset,data) \ - (This)->lpVtbl -> insertData(This,offset,data) - -#define IXMLDOMText_deleteData(This,offset,count) \ - (This)->lpVtbl -> deleteData(This,offset,count) - -#define IXMLDOMText_replaceData(This,offset,count,data) \ - (This)->lpVtbl -> replaceData(This,offset,count,data) - - -#define IXMLDOMText_splitText(This,offset,rightHandTextNode) \ - (This)->lpVtbl -> splitText(This,offset,rightHandTextNode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMText_splitText_Proxy( - IXMLDOMText * This, - /* [in] */ long offset, - /* [retval][out] */ IXMLDOMText **rightHandTextNode); - - -void __RPC_STUB IXMLDOMText_splitText_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMText_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMComment_INTERFACE_DEFINED__ -#define __IXMLDOMComment_INTERFACE_DEFINED__ - -/* interface IXMLDOMComment */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMComment; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF88-7B36-11d2-B20E-00C04F983E60") - IXMLDOMComment : public IXMLDOMCharacterData - { - public: - }; - -#else /* C style interface */ - - typedef struct IXMLDOMCommentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMComment * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMComment * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMComment * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMComment * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMComment * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMComment * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMComment * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMComment * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMComment * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMComment * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMComment * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMComment * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMComment * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMComment * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMComment * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMComment * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMComment * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMComment * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMComment * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMComment * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMComment * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMComment * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMComment * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMComment * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMComment * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMComment * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( - IXMLDOMComment * This, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( - IXMLDOMComment * This, - /* [in] */ BSTR data); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMComment * This, - /* [retval][out] */ long *dataLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( - IXMLDOMComment * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( - IXMLDOMComment * This, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( - IXMLDOMComment * This, - /* [in] */ long offset, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( - IXMLDOMComment * This, - /* [in] */ long offset, - /* [in] */ long count); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( - IXMLDOMComment * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data); - - END_INTERFACE - } IXMLDOMCommentVtbl; - - interface IXMLDOMComment - { - CONST_VTBL struct IXMLDOMCommentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMComment_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMComment_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMComment_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMComment_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMComment_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMComment_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMComment_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMComment_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMComment_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMComment_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMComment_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMComment_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMComment_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMComment_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMComment_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMComment_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMComment_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMComment_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMComment_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMComment_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMComment_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMComment_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMComment_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMComment_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMComment_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMComment_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMComment_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMComment_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMComment_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMComment_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMComment_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMComment_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMComment_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMComment_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMComment_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMComment_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMComment_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMComment_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMComment_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMComment_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMComment_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMComment_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMComment_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMComment_get_data(This,data) \ - (This)->lpVtbl -> get_data(This,data) - -#define IXMLDOMComment_put_data(This,data) \ - (This)->lpVtbl -> put_data(This,data) - -#define IXMLDOMComment_get_length(This,dataLength) \ - (This)->lpVtbl -> get_length(This,dataLength) - -#define IXMLDOMComment_substringData(This,offset,count,data) \ - (This)->lpVtbl -> substringData(This,offset,count,data) - -#define IXMLDOMComment_appendData(This,data) \ - (This)->lpVtbl -> appendData(This,data) - -#define IXMLDOMComment_insertData(This,offset,data) \ - (This)->lpVtbl -> insertData(This,offset,data) - -#define IXMLDOMComment_deleteData(This,offset,count) \ - (This)->lpVtbl -> deleteData(This,offset,count) - -#define IXMLDOMComment_replaceData(This,offset,count,data) \ - (This)->lpVtbl -> replaceData(This,offset,count,data) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXMLDOMComment_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ -#define __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ - -/* interface IXMLDOMProcessingInstruction */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMProcessingInstruction; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF89-7B36-11d2-B20E-00C04F983E60") - IXMLDOMProcessingInstruction : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_target( - /* [retval][out] */ BSTR *name) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_data( - /* [retval][out] */ BSTR *value) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_data( - /* [in] */ BSTR value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMProcessingInstructionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMProcessingInstruction * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMProcessingInstruction * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMProcessingInstruction * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMProcessingInstruction * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMProcessingInstruction * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMProcessingInstruction * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMProcessingInstruction * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMProcessingInstruction * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMProcessingInstruction * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMProcessingInstruction * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMProcessingInstruction * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMProcessingInstruction * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_target )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ BSTR *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR value); - - END_INTERFACE - } IXMLDOMProcessingInstructionVtbl; - - interface IXMLDOMProcessingInstruction - { - CONST_VTBL struct IXMLDOMProcessingInstructionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMProcessingInstruction_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMProcessingInstruction_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMProcessingInstruction_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMProcessingInstruction_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMProcessingInstruction_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMProcessingInstruction_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMProcessingInstruction_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMProcessingInstruction_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMProcessingInstruction_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMProcessingInstruction_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMProcessingInstruction_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMProcessingInstruction_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMProcessingInstruction_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMProcessingInstruction_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMProcessingInstruction_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMProcessingInstruction_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMProcessingInstruction_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMProcessingInstruction_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMProcessingInstruction_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMProcessingInstruction_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMProcessingInstruction_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMProcessingInstruction_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMProcessingInstruction_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMProcessingInstruction_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMProcessingInstruction_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMProcessingInstruction_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMProcessingInstruction_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMProcessingInstruction_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMProcessingInstruction_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMProcessingInstruction_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMProcessingInstruction_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMProcessingInstruction_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMProcessingInstruction_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMProcessingInstruction_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMProcessingInstruction_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMProcessingInstruction_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMProcessingInstruction_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMProcessingInstruction_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMProcessingInstruction_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMProcessingInstruction_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMProcessingInstruction_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMProcessingInstruction_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMProcessingInstruction_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMProcessingInstruction_get_target(This,name) \ - (This)->lpVtbl -> get_target(This,name) - -#define IXMLDOMProcessingInstruction_get_data(This,value) \ - (This)->lpVtbl -> get_data(This,value) - -#define IXMLDOMProcessingInstruction_put_data(This,value) \ - (This)->lpVtbl -> put_data(This,value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_get_target_Proxy( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ BSTR *name); - - -void __RPC_STUB IXMLDOMProcessingInstruction_get_target_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_get_data_Proxy( - IXMLDOMProcessingInstruction * This, - /* [retval][out] */ BSTR *value); - - -void __RPC_STUB IXMLDOMProcessingInstruction_get_data_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMProcessingInstruction_put_data_Proxy( - IXMLDOMProcessingInstruction * This, - /* [in] */ BSTR value); - - -void __RPC_STUB IXMLDOMProcessingInstruction_put_data_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMProcessingInstruction_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMCDATASection_INTERFACE_DEFINED__ -#define __IXMLDOMCDATASection_INTERFACE_DEFINED__ - -/* interface IXMLDOMCDATASection */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMCDATASection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8A-7B36-11d2-B20E-00C04F983E60") - IXMLDOMCDATASection : public IXMLDOMText - { - public: - }; - -#else /* C style interface */ - - typedef struct IXMLDOMCDATASectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMCDATASection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMCDATASection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMCDATASection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMCDATASection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMCDATASection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMCDATASection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMCDATASection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMCDATASection * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMCDATASection * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMCDATASection * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMCDATASection * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMCDATASection * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMCDATASection * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMCDATASection * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMCDATASection * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMCDATASection * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMCDATASection * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMCDATASection * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMCDATASection * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMCDATASection * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMCDATASection * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMCDATASection * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_data )( - IXMLDOMCDATASection * This, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_data )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR data); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMCDATASection * This, - /* [retval][out] */ long *dataLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *substringData )( - IXMLDOMCDATASection * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [retval][out] */ BSTR *data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendData )( - IXMLDOMCDATASection * This, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertData )( - IXMLDOMCDATASection * This, - /* [in] */ long offset, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *deleteData )( - IXMLDOMCDATASection * This, - /* [in] */ long offset, - /* [in] */ long count); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceData )( - IXMLDOMCDATASection * This, - /* [in] */ long offset, - /* [in] */ long count, - /* [in] */ BSTR data); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *splitText )( - IXMLDOMCDATASection * This, - /* [in] */ long offset, - /* [retval][out] */ IXMLDOMText **rightHandTextNode); - - END_INTERFACE - } IXMLDOMCDATASectionVtbl; - - interface IXMLDOMCDATASection - { - CONST_VTBL struct IXMLDOMCDATASectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMCDATASection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMCDATASection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMCDATASection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMCDATASection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMCDATASection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMCDATASection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMCDATASection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMCDATASection_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMCDATASection_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMCDATASection_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMCDATASection_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMCDATASection_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMCDATASection_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMCDATASection_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMCDATASection_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMCDATASection_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMCDATASection_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMCDATASection_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMCDATASection_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMCDATASection_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMCDATASection_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMCDATASection_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMCDATASection_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMCDATASection_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMCDATASection_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMCDATASection_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMCDATASection_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMCDATASection_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMCDATASection_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMCDATASection_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMCDATASection_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMCDATASection_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMCDATASection_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMCDATASection_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMCDATASection_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMCDATASection_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMCDATASection_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMCDATASection_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMCDATASection_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMCDATASection_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMCDATASection_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMCDATASection_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMCDATASection_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMCDATASection_get_data(This,data) \ - (This)->lpVtbl -> get_data(This,data) - -#define IXMLDOMCDATASection_put_data(This,data) \ - (This)->lpVtbl -> put_data(This,data) - -#define IXMLDOMCDATASection_get_length(This,dataLength) \ - (This)->lpVtbl -> get_length(This,dataLength) - -#define IXMLDOMCDATASection_substringData(This,offset,count,data) \ - (This)->lpVtbl -> substringData(This,offset,count,data) - -#define IXMLDOMCDATASection_appendData(This,data) \ - (This)->lpVtbl -> appendData(This,data) - -#define IXMLDOMCDATASection_insertData(This,offset,data) \ - (This)->lpVtbl -> insertData(This,offset,data) - -#define IXMLDOMCDATASection_deleteData(This,offset,count) \ - (This)->lpVtbl -> deleteData(This,offset,count) - -#define IXMLDOMCDATASection_replaceData(This,offset,count,data) \ - (This)->lpVtbl -> replaceData(This,offset,count,data) - - -#define IXMLDOMCDATASection_splitText(This,offset,rightHandTextNode) \ - (This)->lpVtbl -> splitText(This,offset,rightHandTextNode) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXMLDOMCDATASection_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMDocumentType_INTERFACE_DEFINED__ -#define __IXMLDOMDocumentType_INTERFACE_DEFINED__ - -/* interface IXMLDOMDocumentType */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMDocumentType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8B-7B36-11d2-B20E-00C04F983E60") - IXMLDOMDocumentType : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_name( - /* [retval][out] */ BSTR *rootName) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_entities( - /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_notations( - /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMDocumentTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMDocumentType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMDocumentType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMDocumentType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMDocumentType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMDocumentType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMDocumentType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMDocumentType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMDocumentType * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMDocumentType * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMDocumentType * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMDocumentType * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMDocumentType * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMDocumentType * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMDocumentType * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMDocumentType * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMDocumentType * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMDocumentType * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMDocumentType * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMDocumentType * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMDocumentType * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMDocumentType * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMDocumentType * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMDocumentType * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMDocumentType * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMDocumentType * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - IXMLDOMDocumentType * This, - /* [retval][out] */ BSTR *rootName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_entities )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_notations )( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap); - - END_INTERFACE - } IXMLDOMDocumentTypeVtbl; - - interface IXMLDOMDocumentType - { - CONST_VTBL struct IXMLDOMDocumentTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMDocumentType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMDocumentType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMDocumentType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMDocumentType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMDocumentType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMDocumentType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMDocumentType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMDocumentType_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMDocumentType_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMDocumentType_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMDocumentType_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMDocumentType_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMDocumentType_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMDocumentType_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMDocumentType_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMDocumentType_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMDocumentType_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMDocumentType_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMDocumentType_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMDocumentType_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMDocumentType_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMDocumentType_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMDocumentType_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMDocumentType_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMDocumentType_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMDocumentType_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMDocumentType_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMDocumentType_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMDocumentType_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMDocumentType_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMDocumentType_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocumentType_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMDocumentType_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMDocumentType_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMDocumentType_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMDocumentType_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMDocumentType_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMDocumentType_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMDocumentType_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMDocumentType_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMDocumentType_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMDocumentType_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMDocumentType_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMDocumentType_get_name(This,rootName) \ - (This)->lpVtbl -> get_name(This,rootName) - -#define IXMLDOMDocumentType_get_entities(This,entityMap) \ - (This)->lpVtbl -> get_entities(This,entityMap) - -#define IXMLDOMDocumentType_get_notations(This,notationMap) \ - (This)->lpVtbl -> get_notations(This,notationMap) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_name_Proxy( - IXMLDOMDocumentType * This, - /* [retval][out] */ BSTR *rootName); - - -void __RPC_STUB IXMLDOMDocumentType_get_name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_entities_Proxy( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **entityMap); - - -void __RPC_STUB IXMLDOMDocumentType_get_entities_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMDocumentType_get_notations_Proxy( - IXMLDOMDocumentType * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **notationMap); - - -void __RPC_STUB IXMLDOMDocumentType_get_notations_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMDocumentType_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMNotation_INTERFACE_DEFINED__ -#define __IXMLDOMNotation_INTERFACE_DEFINED__ - -/* interface IXMLDOMNotation */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMNotation; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8C-7B36-11d2-B20E-00C04F983E60") - IXMLDOMNotation : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( - /* [retval][out] */ VARIANT *publicID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( - /* [retval][out] */ VARIANT *systemID) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMNotationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMNotation * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMNotation * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMNotation * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMNotation * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMNotation * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMNotation * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMNotation * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMNotation * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMNotation * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMNotation * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMNotation * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMNotation * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMNotation * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMNotation * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMNotation * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMNotation * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMNotation * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMNotation * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMNotation * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMNotation * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMNotation * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMNotation * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMNotation * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT *publicID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT *systemID); - - END_INTERFACE - } IXMLDOMNotationVtbl; - - interface IXMLDOMNotation - { - CONST_VTBL struct IXMLDOMNotationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMNotation_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMNotation_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMNotation_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMNotation_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMNotation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMNotation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMNotation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMNotation_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMNotation_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMNotation_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMNotation_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMNotation_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMNotation_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMNotation_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMNotation_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMNotation_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMNotation_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMNotation_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMNotation_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMNotation_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMNotation_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMNotation_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMNotation_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMNotation_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMNotation_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMNotation_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMNotation_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMNotation_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMNotation_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMNotation_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMNotation_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMNotation_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMNotation_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMNotation_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMNotation_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMNotation_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMNotation_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMNotation_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMNotation_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMNotation_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMNotation_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMNotation_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMNotation_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMNotation_get_publicId(This,publicID) \ - (This)->lpVtbl -> get_publicId(This,publicID) - -#define IXMLDOMNotation_get_systemId(This,systemID) \ - (This)->lpVtbl -> get_systemId(This,systemID) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNotation_get_publicId_Proxy( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT *publicID); - - -void __RPC_STUB IXMLDOMNotation_get_publicId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMNotation_get_systemId_Proxy( - IXMLDOMNotation * This, - /* [retval][out] */ VARIANT *systemID); - - -void __RPC_STUB IXMLDOMNotation_get_systemId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMNotation_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMEntity_INTERFACE_DEFINED__ -#define __IXMLDOMEntity_INTERFACE_DEFINED__ - -/* interface IXMLDOMEntity */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMEntity; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8D-7B36-11d2-B20E-00C04F983E60") - IXMLDOMEntity : public IXMLDOMNode - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( - /* [retval][out] */ VARIANT *publicID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( - /* [retval][out] */ VARIANT *systemID) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_notationName( - /* [retval][out] */ BSTR *name) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMEntityVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMEntity * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMEntity * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMEntity * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMEntity * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMEntity * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMEntity * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMEntity * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMEntity * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMEntity * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMEntity * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMEntity * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMEntity * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMEntity * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMEntity * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMEntity * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMEntity * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMEntity * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMEntity * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMEntity * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMEntity * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMEntity * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMEntity * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMEntity * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT *publicID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT *systemID); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_notationName )( - IXMLDOMEntity * This, - /* [retval][out] */ BSTR *name); - - END_INTERFACE - } IXMLDOMEntityVtbl; - - interface IXMLDOMEntity - { - CONST_VTBL struct IXMLDOMEntityVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMEntity_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMEntity_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMEntity_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMEntity_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMEntity_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMEntity_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMEntity_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMEntity_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMEntity_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMEntity_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMEntity_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMEntity_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMEntity_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMEntity_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMEntity_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMEntity_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMEntity_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMEntity_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMEntity_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMEntity_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMEntity_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMEntity_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMEntity_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMEntity_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMEntity_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMEntity_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMEntity_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMEntity_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMEntity_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMEntity_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMEntity_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMEntity_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMEntity_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMEntity_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMEntity_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMEntity_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMEntity_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMEntity_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMEntity_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMEntity_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMEntity_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMEntity_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMEntity_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXMLDOMEntity_get_publicId(This,publicID) \ - (This)->lpVtbl -> get_publicId(This,publicID) - -#define IXMLDOMEntity_get_systemId(This,systemID) \ - (This)->lpVtbl -> get_systemId(This,systemID) - -#define IXMLDOMEntity_get_notationName(This,name) \ - (This)->lpVtbl -> get_notationName(This,name) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_publicId_Proxy( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT *publicID); - - -void __RPC_STUB IXMLDOMEntity_get_publicId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_systemId_Proxy( - IXMLDOMEntity * This, - /* [retval][out] */ VARIANT *systemID); - - -void __RPC_STUB IXMLDOMEntity_get_systemId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMEntity_get_notationName_Proxy( - IXMLDOMEntity * This, - /* [retval][out] */ BSTR *name); - - -void __RPC_STUB IXMLDOMEntity_get_notationName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMEntity_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMEntityReference_INTERFACE_DEFINED__ -#define __IXMLDOMEntityReference_INTERFACE_DEFINED__ - -/* interface IXMLDOMEntityReference */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMEntityReference; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF8E-7B36-11d2-B20E-00C04F983E60") - IXMLDOMEntityReference : public IXMLDOMNode - { - public: - }; - -#else /* C style interface */ - - typedef struct IXMLDOMEntityReferenceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMEntityReference * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMEntityReference * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMEntityReference * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMEntityReference * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMEntityReference * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMEntityReference * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMEntityReference * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXMLDOMEntityReference * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXMLDOMEntityReference * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXMLDOMEntityReference * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXMLDOMEntityReference * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXMLDOMEntityReference * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXMLDOMEntityReference * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXMLDOMEntityReference * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXMLDOMEntityReference * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXMLDOMEntityReference * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXMLDOMEntityReference * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXMLDOMEntityReference * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXMLDOMEntityReference * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXMLDOMEntityReference * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXMLDOMEntityReference * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXMLDOMEntityReference * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXMLDOMEntityReference * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXMLDOMEntityReference * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXMLDOMEntityReference * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXMLDOMEntityReference * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - END_INTERFACE - } IXMLDOMEntityReferenceVtbl; - - interface IXMLDOMEntityReference - { - CONST_VTBL struct IXMLDOMEntityReferenceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMEntityReference_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMEntityReference_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMEntityReference_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMEntityReference_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMEntityReference_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMEntityReference_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMEntityReference_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMEntityReference_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXMLDOMEntityReference_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXMLDOMEntityReference_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXMLDOMEntityReference_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXMLDOMEntityReference_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXMLDOMEntityReference_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXMLDOMEntityReference_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXMLDOMEntityReference_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXMLDOMEntityReference_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXMLDOMEntityReference_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXMLDOMEntityReference_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXMLDOMEntityReference_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXMLDOMEntityReference_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXMLDOMEntityReference_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXMLDOMEntityReference_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXMLDOMEntityReference_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXMLDOMEntityReference_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXMLDOMEntityReference_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXMLDOMEntityReference_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXMLDOMEntityReference_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXMLDOMEntityReference_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXMLDOMEntityReference_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXMLDOMEntityReference_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXMLDOMEntityReference_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXMLDOMEntityReference_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXMLDOMEntityReference_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXMLDOMEntityReference_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXMLDOMEntityReference_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXMLDOMEntityReference_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXMLDOMEntityReference_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXMLDOMEntityReference_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXMLDOMEntityReference_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXMLDOMEntityReference_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXMLDOMEntityReference_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXMLDOMEntityReference_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXMLDOMEntityReference_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXMLDOMEntityReference_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMParseError_INTERFACE_DEFINED__ -#define __IXMLDOMParseError_INTERFACE_DEFINED__ - -/* interface IXMLDOMParseError */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMParseError; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa426-272f-11d2-836f-0000f87a7782") - IXMLDOMParseError : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_errorCode( - /* [out][retval] */ long *errorCode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_url( - /* [out][retval] */ BSTR *urlString) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_reason( - /* [out][retval] */ BSTR *reasonString) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_srcText( - /* [out][retval] */ BSTR *sourceString) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_line( - /* [out][retval] */ long *lineNumber) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_linepos( - /* [out][retval] */ long *linePosition) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_filepos( - /* [out][retval] */ long *filePosition) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMParseErrorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMParseError * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMParseError * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMParseError * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMParseError * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMParseError * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMParseError * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMParseError * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorCode )( - IXMLDOMParseError * This, - /* [out][retval] */ long *errorCode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *urlString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_reason )( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *reasonString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_srcText )( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *sourceString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_line )( - IXMLDOMParseError * This, - /* [out][retval] */ long *lineNumber); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_linepos )( - IXMLDOMParseError * This, - /* [out][retval] */ long *linePosition); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_filepos )( - IXMLDOMParseError * This, - /* [out][retval] */ long *filePosition); - - END_INTERFACE - } IXMLDOMParseErrorVtbl; - - interface IXMLDOMParseError - { - CONST_VTBL struct IXMLDOMParseErrorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMParseError_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMParseError_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMParseError_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMParseError_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMParseError_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMParseError_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMParseError_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMParseError_get_errorCode(This,errorCode) \ - (This)->lpVtbl -> get_errorCode(This,errorCode) - -#define IXMLDOMParseError_get_url(This,urlString) \ - (This)->lpVtbl -> get_url(This,urlString) - -#define IXMLDOMParseError_get_reason(This,reasonString) \ - (This)->lpVtbl -> get_reason(This,reasonString) - -#define IXMLDOMParseError_get_srcText(This,sourceString) \ - (This)->lpVtbl -> get_srcText(This,sourceString) - -#define IXMLDOMParseError_get_line(This,lineNumber) \ - (This)->lpVtbl -> get_line(This,lineNumber) - -#define IXMLDOMParseError_get_linepos(This,linePosition) \ - (This)->lpVtbl -> get_linepos(This,linePosition) - -#define IXMLDOMParseError_get_filepos(This,filePosition) \ - (This)->lpVtbl -> get_filepos(This,filePosition) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_errorCode_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ long *errorCode); - - -void __RPC_STUB IXMLDOMParseError_get_errorCode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_url_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *urlString); - - -void __RPC_STUB IXMLDOMParseError_get_url_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_reason_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *reasonString); - - -void __RPC_STUB IXMLDOMParseError_get_reason_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_srcText_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ BSTR *sourceString); - - -void __RPC_STUB IXMLDOMParseError_get_srcText_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_line_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ long *lineNumber); - - -void __RPC_STUB IXMLDOMParseError_get_line_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_linepos_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ long *linePosition); - - -void __RPC_STUB IXMLDOMParseError_get_linepos_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError_get_filepos_Proxy( - IXMLDOMParseError * This, - /* [out][retval] */ long *filePosition); - - -void __RPC_STUB IXMLDOMParseError_get_filepos_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMParseError_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMParseError2_INTERFACE_DEFINED__ -#define __IXMLDOMParseError2_INTERFACE_DEFINED__ - -/* interface IXMLDOMParseError2 */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMParseError2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa428-272f-11d2-836f-0000f87a7782") - IXMLDOMParseError2 : public IXMLDOMParseError - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_errorXPath( - /* [retval][out] */ BSTR *xpathexpr) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_allErrors( - /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE errorParameters( - /* [in] */ long index, - /* [retval][out] */ BSTR *param) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_errorParametersCount( - /* [retval][out] */ long *count) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMParseError2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMParseError2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMParseError2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMParseError2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMParseError2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMParseError2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMParseError2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMParseError2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorCode )( - IXMLDOMParseError2 * This, - /* [out][retval] */ long *errorCode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_url )( - IXMLDOMParseError2 * This, - /* [out][retval] */ BSTR *urlString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_reason )( - IXMLDOMParseError2 * This, - /* [out][retval] */ BSTR *reasonString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_srcText )( - IXMLDOMParseError2 * This, - /* [out][retval] */ BSTR *sourceString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_line )( - IXMLDOMParseError2 * This, - /* [out][retval] */ long *lineNumber); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_linepos )( - IXMLDOMParseError2 * This, - /* [out][retval] */ long *linePosition); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_filepos )( - IXMLDOMParseError2 * This, - /* [out][retval] */ long *filePosition); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorXPath )( - IXMLDOMParseError2 * This, - /* [retval][out] */ BSTR *xpathexpr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_allErrors )( - IXMLDOMParseError2 * This, - /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *errorParameters )( - IXMLDOMParseError2 * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *param); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorParametersCount )( - IXMLDOMParseError2 * This, - /* [retval][out] */ long *count); - - END_INTERFACE - } IXMLDOMParseError2Vtbl; - - interface IXMLDOMParseError2 - { - CONST_VTBL struct IXMLDOMParseError2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMParseError2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMParseError2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMParseError2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMParseError2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMParseError2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMParseError2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMParseError2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMParseError2_get_errorCode(This,errorCode) \ - (This)->lpVtbl -> get_errorCode(This,errorCode) - -#define IXMLDOMParseError2_get_url(This,urlString) \ - (This)->lpVtbl -> get_url(This,urlString) - -#define IXMLDOMParseError2_get_reason(This,reasonString) \ - (This)->lpVtbl -> get_reason(This,reasonString) - -#define IXMLDOMParseError2_get_srcText(This,sourceString) \ - (This)->lpVtbl -> get_srcText(This,sourceString) - -#define IXMLDOMParseError2_get_line(This,lineNumber) \ - (This)->lpVtbl -> get_line(This,lineNumber) - -#define IXMLDOMParseError2_get_linepos(This,linePosition) \ - (This)->lpVtbl -> get_linepos(This,linePosition) - -#define IXMLDOMParseError2_get_filepos(This,filePosition) \ - (This)->lpVtbl -> get_filepos(This,filePosition) - - -#define IXMLDOMParseError2_get_errorXPath(This,xpathexpr) \ - (This)->lpVtbl -> get_errorXPath(This,xpathexpr) - -#define IXMLDOMParseError2_get_allErrors(This,allErrors) \ - (This)->lpVtbl -> get_allErrors(This,allErrors) - -#define IXMLDOMParseError2_errorParameters(This,index,param) \ - (This)->lpVtbl -> errorParameters(This,index,param) - -#define IXMLDOMParseError2_get_errorParametersCount(This,count) \ - (This)->lpVtbl -> get_errorParametersCount(This,count) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_errorXPath_Proxy( - IXMLDOMParseError2 * This, - /* [retval][out] */ BSTR *xpathexpr); - - -void __RPC_STUB IXMLDOMParseError2_get_errorXPath_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_allErrors_Proxy( - IXMLDOMParseError2 * This, - /* [retval][out] */ IXMLDOMParseErrorCollection **allErrors); - - -void __RPC_STUB IXMLDOMParseError2_get_allErrors_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_errorParameters_Proxy( - IXMLDOMParseError2 * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *param); - - -void __RPC_STUB IXMLDOMParseError2_errorParameters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseError2_get_errorParametersCount_Proxy( - IXMLDOMParseError2 * This, - /* [retval][out] */ long *count); - - -void __RPC_STUB IXMLDOMParseError2_get_errorParametersCount_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMParseError2_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ -#define __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ - -/* interface IXMLDOMParseErrorCollection */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMParseErrorCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa429-272f-11d2-836f-0000f87a7782") - IXMLDOMParseErrorCollection : public IDispatch - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ IXMLDOMParseError2 **error) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *length) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_next( - /* [retval][out] */ IXMLDOMParseError2 **error) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [retval][out] */ IUnknown **ppunk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMParseErrorCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMParseErrorCollection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMParseErrorCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMParseErrorCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMParseErrorCollection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMParseErrorCollection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMParseErrorCollection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMParseErrorCollection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - IXMLDOMParseErrorCollection * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMParseError2 **error); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ long *length); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_next )( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ IXMLDOMParseError2 **error); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IXMLDOMParseErrorCollection * This); - - /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - END_INTERFACE - } IXMLDOMParseErrorCollectionVtbl; - - interface IXMLDOMParseErrorCollection - { - CONST_VTBL struct IXMLDOMParseErrorCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMParseErrorCollection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMParseErrorCollection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMParseErrorCollection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMParseErrorCollection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMParseErrorCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMParseErrorCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMParseErrorCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMParseErrorCollection_get_item(This,index,error) \ - (This)->lpVtbl -> get_item(This,index,error) - -#define IXMLDOMParseErrorCollection_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define IXMLDOMParseErrorCollection_get_next(This,error) \ - (This)->lpVtbl -> get_next(This,error) - -#define IXMLDOMParseErrorCollection_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IXMLDOMParseErrorCollection_get__newEnum(This,ppunk) \ - (This)->lpVtbl -> get__newEnum(This,ppunk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_item_Proxy( - IXMLDOMParseErrorCollection * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMParseError2 **error); - - -void __RPC_STUB IXMLDOMParseErrorCollection_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_length_Proxy( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ long *length); - - -void __RPC_STUB IXMLDOMParseErrorCollection_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get_next_Proxy( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ IXMLDOMParseError2 **error); - - -void __RPC_STUB IXMLDOMParseErrorCollection_get_next_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_reset_Proxy( - IXMLDOMParseErrorCollection * This); - - -void __RPC_STUB IXMLDOMParseErrorCollection_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMParseErrorCollection_get__newEnum_Proxy( - IXMLDOMParseErrorCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - -void __RPC_STUB IXMLDOMParseErrorCollection_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMParseErrorCollection_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ -#define __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ - -/* interface IXMLDOMSchemaCollection */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMSchemaCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("373984c8-b845-449b-91e7-45ac83036ade") - IXMLDOMSchemaCollection : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE add( - /* [in] */ BSTR namespaceURI, - /* [in] */ VARIANT var) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE get( - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **schemaNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE remove( - /* [in] */ BSTR namespaceURI) = 0; - - virtual /* [propget][helpstring][id] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *length) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( - /* [in] */ long index, - /* [retval][out] */ BSTR *length) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addCollection( - /* [in] */ IXMLDOMSchemaCollection *otherCollection) = 0; - - virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [out][retval] */ IUnknown **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMSchemaCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMSchemaCollection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMSchemaCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMSchemaCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMSchemaCollection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMSchemaCollection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMSchemaCollection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMSchemaCollection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *add )( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI, - /* [in] */ VARIANT var); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get )( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **schemaNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *remove )( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI); - - /* [propget][helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMSchemaCollection * This, - /* [retval][out] */ long *length); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMSchemaCollection * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *length); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addCollection )( - IXMLDOMSchemaCollection * This, - /* [in] */ IXMLDOMSchemaCollection *otherCollection); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMSchemaCollection * This, - /* [out][retval] */ IUnknown **ppUnk); - - END_INTERFACE - } IXMLDOMSchemaCollectionVtbl; - - interface IXMLDOMSchemaCollection - { - CONST_VTBL struct IXMLDOMSchemaCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMSchemaCollection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMSchemaCollection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMSchemaCollection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMSchemaCollection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMSchemaCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMSchemaCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMSchemaCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMSchemaCollection_add(This,namespaceURI,var) \ - (This)->lpVtbl -> add(This,namespaceURI,var) - -#define IXMLDOMSchemaCollection_get(This,namespaceURI,schemaNode) \ - (This)->lpVtbl -> get(This,namespaceURI,schemaNode) - -#define IXMLDOMSchemaCollection_remove(This,namespaceURI) \ - (This)->lpVtbl -> remove(This,namespaceURI) - -#define IXMLDOMSchemaCollection_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define IXMLDOMSchemaCollection_get_namespaceURI(This,index,length) \ - (This)->lpVtbl -> get_namespaceURI(This,index,length) - -#define IXMLDOMSchemaCollection_addCollection(This,otherCollection) \ - (This)->lpVtbl -> addCollection(This,otherCollection) - -#define IXMLDOMSchemaCollection_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_add_Proxy( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI, - /* [in] */ VARIANT var); - - -void __RPC_STUB IXMLDOMSchemaCollection_add_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_Proxy( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **schemaNode); - - -void __RPC_STUB IXMLDOMSchemaCollection_get_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_remove_Proxy( - IXMLDOMSchemaCollection * This, - /* [in] */ BSTR namespaceURI); - - -void __RPC_STUB IXMLDOMSchemaCollection_remove_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_length_Proxy( - IXMLDOMSchemaCollection * This, - /* [retval][out] */ long *length); - - -void __RPC_STUB IXMLDOMSchemaCollection_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get_namespaceURI_Proxy( - IXMLDOMSchemaCollection * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *length); - - -void __RPC_STUB IXMLDOMSchemaCollection_get_namespaceURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_addCollection_Proxy( - IXMLDOMSchemaCollection * This, - /* [in] */ IXMLDOMSchemaCollection *otherCollection); - - -void __RPC_STUB IXMLDOMSchemaCollection_addCollection_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection_get__newEnum_Proxy( - IXMLDOMSchemaCollection * This, - /* [out][retval] */ IUnknown **ppUnk); - - -void __RPC_STUB IXMLDOMSchemaCollection_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMSchemaCollection_INTERFACE_DEFINED__ */ - - -#ifndef __IXTLRuntime_INTERFACE_DEFINED__ -#define __IXTLRuntime_INTERFACE_DEFINED__ - -/* interface IXTLRuntime */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXTLRuntime; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa425-272f-11d2-836f-0000f87a7782") - IXTLRuntime : public IXMLDOMNode - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE uniqueID( - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pID) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE depth( - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pDepth) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE childNumber( - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ancestorChildNumber( - /* [in] */ BSTR bstrNodeName, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE absoluteChildNumber( - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatIndex( - /* [in] */ long lIndex, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatNumber( - /* [in] */ double dblNumber, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatDate( - /* [in] */ VARIANT varDate, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE formatTime( - /* [in] */ VARIANT varTime, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXTLRuntimeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXTLRuntime * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXTLRuntime * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXTLRuntime * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXTLRuntime * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXTLRuntime * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXTLRuntime * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXTLRuntime * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeName )( - IXTLRuntime * This, - /* [retval][out] */ BSTR *name); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeValue )( - IXTLRuntime * This, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeValue )( - IXTLRuntime * This, - /* [in] */ VARIANT value); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeType )( - IXTLRuntime * This, - /* [retval][out] */ DOMNodeType *type); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parentNode )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNode **parent); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_childNodes )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNodeList **childList); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_firstChild )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNode **firstChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lastChild )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNode **lastChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_previousSibling )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNode **previousSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nextSibling )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNode **nextSibling); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMNamedNodeMap **attributeMap); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *insertBefore )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ VARIANT refChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *replaceChild )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *newChild, - /* [in] */ IXMLDOMNode *oldChild, - /* [retval][out] */ IXMLDOMNode **outOldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeChild )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *childNode, - /* [retval][out] */ IXMLDOMNode **oldChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *appendChild )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *newChild, - /* [retval][out] */ IXMLDOMNode **outNewChild); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *hasChildNodes )( - IXTLRuntime * This, - /* [retval][out] */ VARIANT_BOOL *hasChild); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerDocument )( - IXTLRuntime * This, - /* [retval][out] */ IXMLDOMDocument **DOMDocument); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *cloneNode )( - IXTLRuntime * This, - /* [in] */ VARIANT_BOOL deep, - /* [retval][out] */ IXMLDOMNode **cloneRoot); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypeString )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *nodeType); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_text )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *text); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_text )( - IXTLRuntime * This, - /* [in] */ BSTR text); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_specified )( - IXTLRuntime * This, - /* [retval][out] */ VARIANT_BOOL *isSpecified); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_definition )( - IXTLRuntime * This, - /* [out][retval] */ IXMLDOMNode **definitionNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_nodeTypedValue )( - IXTLRuntime * This, - /* [out][retval] */ VARIANT *typedValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_nodeTypedValue )( - IXTLRuntime * This, - /* [in] */ VARIANT typedValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dataType )( - IXTLRuntime * This, - /* [out][retval] */ VARIANT *dataTypeName); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_dataType )( - IXTLRuntime * This, - /* [in] */ BSTR dataTypeName); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_xml )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNode )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [out][retval] */ BSTR *xmlString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectNodes )( - IXTLRuntime * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNodeList **resultList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *selectSingleNode )( - IXTLRuntime * This, - /* [in] */ BSTR queryString, - /* [out][retval] */ IXMLDOMNode **resultNode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parsed )( - IXTLRuntime * This, - /* [out][retval] */ VARIANT_BOOL *isParsed); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_prefix )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *prefixString); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseName )( - IXTLRuntime * This, - /* [out][retval] */ BSTR *nameString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transformNodeToObject )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *stylesheet, - /* [in] */ VARIANT outputObject); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *uniqueID )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pID); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *depth )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pDepth); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *childNumber )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ancestorChildNumber )( - IXTLRuntime * This, - /* [in] */ BSTR bstrNodeName, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *absoluteChildNumber )( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatIndex )( - IXTLRuntime * This, - /* [in] */ long lIndex, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatNumber )( - IXTLRuntime * This, - /* [in] */ double dblNumber, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatDate )( - IXTLRuntime * This, - /* [in] */ VARIANT varDate, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *formatTime )( - IXTLRuntime * This, - /* [in] */ VARIANT varTime, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString); - - END_INTERFACE - } IXTLRuntimeVtbl; - - interface IXTLRuntime - { - CONST_VTBL struct IXTLRuntimeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXTLRuntime_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXTLRuntime_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXTLRuntime_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXTLRuntime_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXTLRuntime_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXTLRuntime_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXTLRuntime_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXTLRuntime_get_nodeName(This,name) \ - (This)->lpVtbl -> get_nodeName(This,name) - -#define IXTLRuntime_get_nodeValue(This,value) \ - (This)->lpVtbl -> get_nodeValue(This,value) - -#define IXTLRuntime_put_nodeValue(This,value) \ - (This)->lpVtbl -> put_nodeValue(This,value) - -#define IXTLRuntime_get_nodeType(This,type) \ - (This)->lpVtbl -> get_nodeType(This,type) - -#define IXTLRuntime_get_parentNode(This,parent) \ - (This)->lpVtbl -> get_parentNode(This,parent) - -#define IXTLRuntime_get_childNodes(This,childList) \ - (This)->lpVtbl -> get_childNodes(This,childList) - -#define IXTLRuntime_get_firstChild(This,firstChild) \ - (This)->lpVtbl -> get_firstChild(This,firstChild) - -#define IXTLRuntime_get_lastChild(This,lastChild) \ - (This)->lpVtbl -> get_lastChild(This,lastChild) - -#define IXTLRuntime_get_previousSibling(This,previousSibling) \ - (This)->lpVtbl -> get_previousSibling(This,previousSibling) - -#define IXTLRuntime_get_nextSibling(This,nextSibling) \ - (This)->lpVtbl -> get_nextSibling(This,nextSibling) - -#define IXTLRuntime_get_attributes(This,attributeMap) \ - (This)->lpVtbl -> get_attributes(This,attributeMap) - -#define IXTLRuntime_insertBefore(This,newChild,refChild,outNewChild) \ - (This)->lpVtbl -> insertBefore(This,newChild,refChild,outNewChild) - -#define IXTLRuntime_replaceChild(This,newChild,oldChild,outOldChild) \ - (This)->lpVtbl -> replaceChild(This,newChild,oldChild,outOldChild) - -#define IXTLRuntime_removeChild(This,childNode,oldChild) \ - (This)->lpVtbl -> removeChild(This,childNode,oldChild) - -#define IXTLRuntime_appendChild(This,newChild,outNewChild) \ - (This)->lpVtbl -> appendChild(This,newChild,outNewChild) - -#define IXTLRuntime_hasChildNodes(This,hasChild) \ - (This)->lpVtbl -> hasChildNodes(This,hasChild) - -#define IXTLRuntime_get_ownerDocument(This,DOMDocument) \ - (This)->lpVtbl -> get_ownerDocument(This,DOMDocument) - -#define IXTLRuntime_cloneNode(This,deep,cloneRoot) \ - (This)->lpVtbl -> cloneNode(This,deep,cloneRoot) - -#define IXTLRuntime_get_nodeTypeString(This,nodeType) \ - (This)->lpVtbl -> get_nodeTypeString(This,nodeType) - -#define IXTLRuntime_get_text(This,text) \ - (This)->lpVtbl -> get_text(This,text) - -#define IXTLRuntime_put_text(This,text) \ - (This)->lpVtbl -> put_text(This,text) - -#define IXTLRuntime_get_specified(This,isSpecified) \ - (This)->lpVtbl -> get_specified(This,isSpecified) - -#define IXTLRuntime_get_definition(This,definitionNode) \ - (This)->lpVtbl -> get_definition(This,definitionNode) - -#define IXTLRuntime_get_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> get_nodeTypedValue(This,typedValue) - -#define IXTLRuntime_put_nodeTypedValue(This,typedValue) \ - (This)->lpVtbl -> put_nodeTypedValue(This,typedValue) - -#define IXTLRuntime_get_dataType(This,dataTypeName) \ - (This)->lpVtbl -> get_dataType(This,dataTypeName) - -#define IXTLRuntime_put_dataType(This,dataTypeName) \ - (This)->lpVtbl -> put_dataType(This,dataTypeName) - -#define IXTLRuntime_get_xml(This,xmlString) \ - (This)->lpVtbl -> get_xml(This,xmlString) - -#define IXTLRuntime_transformNode(This,stylesheet,xmlString) \ - (This)->lpVtbl -> transformNode(This,stylesheet,xmlString) - -#define IXTLRuntime_selectNodes(This,queryString,resultList) \ - (This)->lpVtbl -> selectNodes(This,queryString,resultList) - -#define IXTLRuntime_selectSingleNode(This,queryString,resultNode) \ - (This)->lpVtbl -> selectSingleNode(This,queryString,resultNode) - -#define IXTLRuntime_get_parsed(This,isParsed) \ - (This)->lpVtbl -> get_parsed(This,isParsed) - -#define IXTLRuntime_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define IXTLRuntime_get_prefix(This,prefixString) \ - (This)->lpVtbl -> get_prefix(This,prefixString) - -#define IXTLRuntime_get_baseName(This,nameString) \ - (This)->lpVtbl -> get_baseName(This,nameString) - -#define IXTLRuntime_transformNodeToObject(This,stylesheet,outputObject) \ - (This)->lpVtbl -> transformNodeToObject(This,stylesheet,outputObject) - - -#define IXTLRuntime_uniqueID(This,pNode,pID) \ - (This)->lpVtbl -> uniqueID(This,pNode,pID) - -#define IXTLRuntime_depth(This,pNode,pDepth) \ - (This)->lpVtbl -> depth(This,pNode,pDepth) - -#define IXTLRuntime_childNumber(This,pNode,pNumber) \ - (This)->lpVtbl -> childNumber(This,pNode,pNumber) - -#define IXTLRuntime_ancestorChildNumber(This,bstrNodeName,pNode,pNumber) \ - (This)->lpVtbl -> ancestorChildNumber(This,bstrNodeName,pNode,pNumber) - -#define IXTLRuntime_absoluteChildNumber(This,pNode,pNumber) \ - (This)->lpVtbl -> absoluteChildNumber(This,pNode,pNumber) - -#define IXTLRuntime_formatIndex(This,lIndex,bstrFormat,pbstrFormattedString) \ - (This)->lpVtbl -> formatIndex(This,lIndex,bstrFormat,pbstrFormattedString) - -#define IXTLRuntime_formatNumber(This,dblNumber,bstrFormat,pbstrFormattedString) \ - (This)->lpVtbl -> formatNumber(This,dblNumber,bstrFormat,pbstrFormattedString) - -#define IXTLRuntime_formatDate(This,varDate,bstrFormat,varDestLocale,pbstrFormattedString) \ - (This)->lpVtbl -> formatDate(This,varDate,bstrFormat,varDestLocale,pbstrFormattedString) - -#define IXTLRuntime_formatTime(This,varTime,bstrFormat,varDestLocale,pbstrFormattedString) \ - (This)->lpVtbl -> formatTime(This,varTime,bstrFormat,varDestLocale,pbstrFormattedString) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_uniqueID_Proxy( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pID); - - -void __RPC_STUB IXTLRuntime_uniqueID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_depth_Proxy( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pDepth); - - -void __RPC_STUB IXTLRuntime_depth_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_childNumber_Proxy( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - -void __RPC_STUB IXTLRuntime_childNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_ancestorChildNumber_Proxy( - IXTLRuntime * This, - /* [in] */ BSTR bstrNodeName, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - -void __RPC_STUB IXTLRuntime_ancestorChildNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_absoluteChildNumber_Proxy( - IXTLRuntime * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ long *pNumber); - - -void __RPC_STUB IXTLRuntime_absoluteChildNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatIndex_Proxy( - IXTLRuntime * This, - /* [in] */ long lIndex, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString); - - -void __RPC_STUB IXTLRuntime_formatIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatNumber_Proxy( - IXTLRuntime * This, - /* [in] */ double dblNumber, - /* [in] */ BSTR bstrFormat, - /* [retval][out] */ BSTR *pbstrFormattedString); - - -void __RPC_STUB IXTLRuntime_formatNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatDate_Proxy( - IXTLRuntime * This, - /* [in] */ VARIANT varDate, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString); - - -void __RPC_STUB IXTLRuntime_formatDate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXTLRuntime_formatTime_Proxy( - IXTLRuntime * This, - /* [in] */ VARIANT varTime, - /* [in] */ BSTR bstrFormat, - /* [optional][in] */ VARIANT varDestLocale, - /* [retval][out] */ BSTR *pbstrFormattedString); - - -void __RPC_STUB IXTLRuntime_formatTime_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXTLRuntime_INTERFACE_DEFINED__ */ - - -#ifndef __IXSLTemplate_INTERFACE_DEFINED__ -#define __IXSLTemplate_INTERFACE_DEFINED__ - -/* interface IXSLTemplate */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXSLTemplate; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF93-7B36-11d2-B20E-00C04F983E60") - IXSLTemplate : public IDispatch - { - public: - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_stylesheet( - /* [in] */ IXMLDOMNode *stylesheet) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_stylesheet( - /* [retval][out] */ IXMLDOMNode **stylesheet) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE createProcessor( - /* [retval][out] */ IXSLProcessor **ppProcessor) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXSLTemplateVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXSLTemplate * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXSLTemplate * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXSLTemplate * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXSLTemplate * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXSLTemplate * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXSLTemplate * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXSLTemplate * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_stylesheet )( - IXSLTemplate * This, - /* [in] */ IXMLDOMNode *stylesheet); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_stylesheet )( - IXSLTemplate * This, - /* [retval][out] */ IXMLDOMNode **stylesheet); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *createProcessor )( - IXSLTemplate * This, - /* [retval][out] */ IXSLProcessor **ppProcessor); - - END_INTERFACE - } IXSLTemplateVtbl; - - interface IXSLTemplate - { - CONST_VTBL struct IXSLTemplateVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXSLTemplate_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXSLTemplate_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXSLTemplate_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXSLTemplate_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXSLTemplate_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXSLTemplate_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXSLTemplate_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXSLTemplate_putref_stylesheet(This,stylesheet) \ - (This)->lpVtbl -> putref_stylesheet(This,stylesheet) - -#define IXSLTemplate_get_stylesheet(This,stylesheet) \ - (This)->lpVtbl -> get_stylesheet(This,stylesheet) - -#define IXSLTemplate_createProcessor(This,ppProcessor) \ - (This)->lpVtbl -> createProcessor(This,ppProcessor) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_putref_stylesheet_Proxy( - IXSLTemplate * This, - /* [in] */ IXMLDOMNode *stylesheet); - - -void __RPC_STUB IXSLTemplate_putref_stylesheet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_get_stylesheet_Proxy( - IXSLTemplate * This, - /* [retval][out] */ IXMLDOMNode **stylesheet); - - -void __RPC_STUB IXSLTemplate_get_stylesheet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLTemplate_createProcessor_Proxy( - IXSLTemplate * This, - /* [retval][out] */ IXSLProcessor **ppProcessor); - - -void __RPC_STUB IXSLTemplate_createProcessor_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXSLTemplate_INTERFACE_DEFINED__ */ - - -#ifndef __IXSLProcessor_INTERFACE_DEFINED__ -#define __IXSLProcessor_INTERFACE_DEFINED__ - -/* interface IXSLProcessor */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXSLProcessor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2933BF92-7B36-11d2-B20E-00C04F983E60") - IXSLProcessor : public IDispatch - { - public: - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_input( - /* [in] */ VARIANT var) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_input( - /* [retval][out] */ VARIANT *pVar) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ownerTemplate( - /* [retval][out] */ IXSLTemplate **ppTemplate) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setStartMode( - /* [in] */ BSTR mode, - /* [defaultvalue][in] */ BSTR namespaceURI = L"") = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_startMode( - /* [retval][out] */ BSTR *mode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_startModeURI( - /* [retval][out] */ BSTR *namespaceURI) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_output( - /* [in] */ VARIANT output) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_output( - /* [retval][out] */ VARIANT *pOutput) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE transform( - /* [retval][out] */ VARIANT_BOOL *pDone) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( - /* [retval][out] */ long *pReadyState) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addParameter( - /* [in] */ BSTR baseName, - /* [in] */ VARIANT parameter, - /* [defaultvalue][in] */ BSTR namespaceURI = L"") = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addObject( - /* [in] */ IDispatch *obj, - /* [in] */ BSTR namespaceURI) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_stylesheet( - /* [retval][out] */ IXMLDOMNode **stylesheet) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXSLProcessorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXSLProcessor * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXSLProcessor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXSLProcessor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXSLProcessor * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXSLProcessor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXSLProcessor * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXSLProcessor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_input )( - IXSLProcessor * This, - /* [in] */ VARIANT var); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_input )( - IXSLProcessor * This, - /* [retval][out] */ VARIANT *pVar); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ownerTemplate )( - IXSLProcessor * This, - /* [retval][out] */ IXSLTemplate **ppTemplate); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setStartMode )( - IXSLProcessor * This, - /* [in] */ BSTR mode, - /* [defaultvalue][in] */ BSTR namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_startMode )( - IXSLProcessor * This, - /* [retval][out] */ BSTR *mode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_startModeURI )( - IXSLProcessor * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_output )( - IXSLProcessor * This, - /* [in] */ VARIANT output); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( - IXSLProcessor * This, - /* [retval][out] */ VARIANT *pOutput); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *transform )( - IXSLProcessor * This, - /* [retval][out] */ VARIANT_BOOL *pDone); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IXSLProcessor * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IXSLProcessor * This, - /* [retval][out] */ long *pReadyState); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addParameter )( - IXSLProcessor * This, - /* [in] */ BSTR baseName, - /* [in] */ VARIANT parameter, - /* [defaultvalue][in] */ BSTR namespaceURI); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addObject )( - IXSLProcessor * This, - /* [in] */ IDispatch *obj, - /* [in] */ BSTR namespaceURI); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_stylesheet )( - IXSLProcessor * This, - /* [retval][out] */ IXMLDOMNode **stylesheet); - - END_INTERFACE - } IXSLProcessorVtbl; - - interface IXSLProcessor - { - CONST_VTBL struct IXSLProcessorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXSLProcessor_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXSLProcessor_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXSLProcessor_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXSLProcessor_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXSLProcessor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXSLProcessor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXSLProcessor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXSLProcessor_put_input(This,var) \ - (This)->lpVtbl -> put_input(This,var) - -#define IXSLProcessor_get_input(This,pVar) \ - (This)->lpVtbl -> get_input(This,pVar) - -#define IXSLProcessor_get_ownerTemplate(This,ppTemplate) \ - (This)->lpVtbl -> get_ownerTemplate(This,ppTemplate) - -#define IXSLProcessor_setStartMode(This,mode,namespaceURI) \ - (This)->lpVtbl -> setStartMode(This,mode,namespaceURI) - -#define IXSLProcessor_get_startMode(This,mode) \ - (This)->lpVtbl -> get_startMode(This,mode) - -#define IXSLProcessor_get_startModeURI(This,namespaceURI) \ - (This)->lpVtbl -> get_startModeURI(This,namespaceURI) - -#define IXSLProcessor_put_output(This,output) \ - (This)->lpVtbl -> put_output(This,output) - -#define IXSLProcessor_get_output(This,pOutput) \ - (This)->lpVtbl -> get_output(This,pOutput) - -#define IXSLProcessor_transform(This,pDone) \ - (This)->lpVtbl -> transform(This,pDone) - -#define IXSLProcessor_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IXSLProcessor_get_readyState(This,pReadyState) \ - (This)->lpVtbl -> get_readyState(This,pReadyState) - -#define IXSLProcessor_addParameter(This,baseName,parameter,namespaceURI) \ - (This)->lpVtbl -> addParameter(This,baseName,parameter,namespaceURI) - -#define IXSLProcessor_addObject(This,obj,namespaceURI) \ - (This)->lpVtbl -> addObject(This,obj,namespaceURI) - -#define IXSLProcessor_get_stylesheet(This,stylesheet) \ - (This)->lpVtbl -> get_stylesheet(This,stylesheet) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_put_input_Proxy( - IXSLProcessor * This, - /* [in] */ VARIANT var); - - -void __RPC_STUB IXSLProcessor_put_input_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_input_Proxy( - IXSLProcessor * This, - /* [retval][out] */ VARIANT *pVar); - - -void __RPC_STUB IXSLProcessor_get_input_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_ownerTemplate_Proxy( - IXSLProcessor * This, - /* [retval][out] */ IXSLTemplate **ppTemplate); - - -void __RPC_STUB IXSLProcessor_get_ownerTemplate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_setStartMode_Proxy( - IXSLProcessor * This, - /* [in] */ BSTR mode, - /* [defaultvalue][in] */ BSTR namespaceURI); - - -void __RPC_STUB IXSLProcessor_setStartMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_startMode_Proxy( - IXSLProcessor * This, - /* [retval][out] */ BSTR *mode); - - -void __RPC_STUB IXSLProcessor_get_startMode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_startModeURI_Proxy( - IXSLProcessor * This, - /* [retval][out] */ BSTR *namespaceURI); - - -void __RPC_STUB IXSLProcessor_get_startModeURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_put_output_Proxy( - IXSLProcessor * This, - /* [in] */ VARIANT output); - - -void __RPC_STUB IXSLProcessor_put_output_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_output_Proxy( - IXSLProcessor * This, - /* [retval][out] */ VARIANT *pOutput); - - -void __RPC_STUB IXSLProcessor_get_output_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_transform_Proxy( - IXSLProcessor * This, - /* [retval][out] */ VARIANT_BOOL *pDone); - - -void __RPC_STUB IXSLProcessor_transform_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_reset_Proxy( - IXSLProcessor * This); - - -void __RPC_STUB IXSLProcessor_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_readyState_Proxy( - IXSLProcessor * This, - /* [retval][out] */ long *pReadyState); - - -void __RPC_STUB IXSLProcessor_get_readyState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_addParameter_Proxy( - IXSLProcessor * This, - /* [in] */ BSTR baseName, - /* [in] */ VARIANT parameter, - /* [defaultvalue][in] */ BSTR namespaceURI); - - -void __RPC_STUB IXSLProcessor_addParameter_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_addObject_Proxy( - IXSLProcessor * This, - /* [in] */ IDispatch *obj, - /* [in] */ BSTR namespaceURI); - - -void __RPC_STUB IXSLProcessor_addObject_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXSLProcessor_get_stylesheet_Proxy( - IXSLProcessor * This, - /* [retval][out] */ IXMLDOMNode **stylesheet); - - -void __RPC_STUB IXSLProcessor_get_stylesheet_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXSLProcessor_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXXMLReader_INTERFACE_DEFINED__ -#define __ISAXXMLReader_INTERFACE_DEFINED__ - -/* interface ISAXXMLReader */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXXMLReader; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a4f96ed0-f829-476e-81c0-cdc7bd2a0802") - ISAXXMLReader : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE getFeature( - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT_BOOL *pvfValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE putFeature( - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT_BOOL vfValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE getProperty( - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT *pvarValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE putProperty( - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT varValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE getEntityResolver( - /* [retval][out] */ ISAXEntityResolver **ppResolver) = 0; - - virtual HRESULT STDMETHODCALLTYPE putEntityResolver( - /* [in] */ ISAXEntityResolver *pResolver) = 0; - - virtual HRESULT STDMETHODCALLTYPE getContentHandler( - /* [retval][out] */ ISAXContentHandler **ppHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE putContentHandler( - /* [in] */ ISAXContentHandler *pHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE getDTDHandler( - /* [retval][out] */ ISAXDTDHandler **ppHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE putDTDHandler( - /* [in] */ ISAXDTDHandler *pHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE getErrorHandler( - /* [retval][out] */ ISAXErrorHandler **ppHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE putErrorHandler( - /* [in] */ ISAXErrorHandler *pHandler) = 0; - - virtual HRESULT STDMETHODCALLTYPE getBaseURL( - /* [retval][out] */ const wchar_t **ppwchBaseUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE putBaseURL( - /* [in] */ const wchar_t *pwchBaseUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE getSecureBaseURL( - /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE putSecureBaseURL( - /* [in] */ const wchar_t *pwchSecureBaseUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE parse( - /* [optional][in] */ VARIANT varInput) = 0; - - virtual HRESULT STDMETHODCALLTYPE parseURL( - /* [in] */ const wchar_t *pwchUrl) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXXMLReaderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXXMLReader * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXXMLReader * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXXMLReader * This); - - HRESULT ( STDMETHODCALLTYPE *getFeature )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT_BOOL *pvfValue); - - HRESULT ( STDMETHODCALLTYPE *putFeature )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT_BOOL vfValue); - - HRESULT ( STDMETHODCALLTYPE *getProperty )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT *pvarValue); - - HRESULT ( STDMETHODCALLTYPE *putProperty )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT varValue); - - HRESULT ( STDMETHODCALLTYPE *getEntityResolver )( - ISAXXMLReader * This, - /* [retval][out] */ ISAXEntityResolver **ppResolver); - - HRESULT ( STDMETHODCALLTYPE *putEntityResolver )( - ISAXXMLReader * This, - /* [in] */ ISAXEntityResolver *pResolver); - - HRESULT ( STDMETHODCALLTYPE *getContentHandler )( - ISAXXMLReader * This, - /* [retval][out] */ ISAXContentHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putContentHandler )( - ISAXXMLReader * This, - /* [in] */ ISAXContentHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getDTDHandler )( - ISAXXMLReader * This, - /* [retval][out] */ ISAXDTDHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putDTDHandler )( - ISAXXMLReader * This, - /* [in] */ ISAXDTDHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getErrorHandler )( - ISAXXMLReader * This, - /* [retval][out] */ ISAXErrorHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putErrorHandler )( - ISAXXMLReader * This, - /* [in] */ ISAXErrorHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getBaseURL )( - ISAXXMLReader * This, - /* [retval][out] */ const wchar_t **ppwchBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *putBaseURL )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *getSecureBaseURL )( - ISAXXMLReader * This, - /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *putSecureBaseURL )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchSecureBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *parse )( - ISAXXMLReader * This, - /* [optional][in] */ VARIANT varInput); - - HRESULT ( STDMETHODCALLTYPE *parseURL )( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchUrl); - - END_INTERFACE - } ISAXXMLReaderVtbl; - - interface ISAXXMLReader - { - CONST_VTBL struct ISAXXMLReaderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXXMLReader_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXXMLReader_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXXMLReader_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXXMLReader_getFeature(This,pwchName,pvfValue) \ - (This)->lpVtbl -> getFeature(This,pwchName,pvfValue) - -#define ISAXXMLReader_putFeature(This,pwchName,vfValue) \ - (This)->lpVtbl -> putFeature(This,pwchName,vfValue) - -#define ISAXXMLReader_getProperty(This,pwchName,pvarValue) \ - (This)->lpVtbl -> getProperty(This,pwchName,pvarValue) - -#define ISAXXMLReader_putProperty(This,pwchName,varValue) \ - (This)->lpVtbl -> putProperty(This,pwchName,varValue) - -#define ISAXXMLReader_getEntityResolver(This,ppResolver) \ - (This)->lpVtbl -> getEntityResolver(This,ppResolver) - -#define ISAXXMLReader_putEntityResolver(This,pResolver) \ - (This)->lpVtbl -> putEntityResolver(This,pResolver) - -#define ISAXXMLReader_getContentHandler(This,ppHandler) \ - (This)->lpVtbl -> getContentHandler(This,ppHandler) - -#define ISAXXMLReader_putContentHandler(This,pHandler) \ - (This)->lpVtbl -> putContentHandler(This,pHandler) - -#define ISAXXMLReader_getDTDHandler(This,ppHandler) \ - (This)->lpVtbl -> getDTDHandler(This,ppHandler) - -#define ISAXXMLReader_putDTDHandler(This,pHandler) \ - (This)->lpVtbl -> putDTDHandler(This,pHandler) - -#define ISAXXMLReader_getErrorHandler(This,ppHandler) \ - (This)->lpVtbl -> getErrorHandler(This,ppHandler) - -#define ISAXXMLReader_putErrorHandler(This,pHandler) \ - (This)->lpVtbl -> putErrorHandler(This,pHandler) - -#define ISAXXMLReader_getBaseURL(This,ppwchBaseUrl) \ - (This)->lpVtbl -> getBaseURL(This,ppwchBaseUrl) - -#define ISAXXMLReader_putBaseURL(This,pwchBaseUrl) \ - (This)->lpVtbl -> putBaseURL(This,pwchBaseUrl) - -#define ISAXXMLReader_getSecureBaseURL(This,ppwchSecureBaseUrl) \ - (This)->lpVtbl -> getSecureBaseURL(This,ppwchSecureBaseUrl) - -#define ISAXXMLReader_putSecureBaseURL(This,pwchSecureBaseUrl) \ - (This)->lpVtbl -> putSecureBaseURL(This,pwchSecureBaseUrl) - -#define ISAXXMLReader_parse(This,varInput) \ - (This)->lpVtbl -> parse(This,varInput) - -#define ISAXXMLReader_parseURL(This,pwchUrl) \ - (This)->lpVtbl -> parseURL(This,pwchUrl) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getFeature_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT_BOOL *pvfValue); - - -void __RPC_STUB ISAXXMLReader_getFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putFeature_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT_BOOL vfValue); - - -void __RPC_STUB ISAXXMLReader_putFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getProperty_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT *pvarValue); - - -void __RPC_STUB ISAXXMLReader_getProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putProperty_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT varValue); - - -void __RPC_STUB ISAXXMLReader_putProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getEntityResolver_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ ISAXEntityResolver **ppResolver); - - -void __RPC_STUB ISAXXMLReader_getEntityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putEntityResolver_Proxy( - ISAXXMLReader * This, - /* [in] */ ISAXEntityResolver *pResolver); - - -void __RPC_STUB ISAXXMLReader_putEntityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getContentHandler_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ ISAXContentHandler **ppHandler); - - -void __RPC_STUB ISAXXMLReader_getContentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putContentHandler_Proxy( - ISAXXMLReader * This, - /* [in] */ ISAXContentHandler *pHandler); - - -void __RPC_STUB ISAXXMLReader_putContentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getDTDHandler_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ ISAXDTDHandler **ppHandler); - - -void __RPC_STUB ISAXXMLReader_getDTDHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putDTDHandler_Proxy( - ISAXXMLReader * This, - /* [in] */ ISAXDTDHandler *pHandler); - - -void __RPC_STUB ISAXXMLReader_putDTDHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getErrorHandler_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ ISAXErrorHandler **ppHandler); - - -void __RPC_STUB ISAXXMLReader_getErrorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putErrorHandler_Proxy( - ISAXXMLReader * This, - /* [in] */ ISAXErrorHandler *pHandler); - - -void __RPC_STUB ISAXXMLReader_putErrorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getBaseURL_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ const wchar_t **ppwchBaseUrl); - - -void __RPC_STUB ISAXXMLReader_getBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putBaseURL_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchBaseUrl); - - -void __RPC_STUB ISAXXMLReader_putBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_getSecureBaseURL_Proxy( - ISAXXMLReader * This, - /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); - - -void __RPC_STUB ISAXXMLReader_getSecureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_putSecureBaseURL_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchSecureBaseUrl); - - -void __RPC_STUB ISAXXMLReader_putSecureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_parse_Proxy( - ISAXXMLReader * This, - /* [optional][in] */ VARIANT varInput); - - -void __RPC_STUB ISAXXMLReader_parse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLReader_parseURL_Proxy( - ISAXXMLReader * This, - /* [in] */ const wchar_t *pwchUrl); - - -void __RPC_STUB ISAXXMLReader_parseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXXMLReader_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXXMLFilter_INTERFACE_DEFINED__ -#define __ISAXXMLFilter_INTERFACE_DEFINED__ - -/* interface ISAXXMLFilter */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXXMLFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("70409222-ca09-4475-acb8-40312fe8d145") - ISAXXMLFilter : public ISAXXMLReader - { - public: - virtual HRESULT STDMETHODCALLTYPE getParent( - /* [retval][out] */ ISAXXMLReader **ppReader) = 0; - - virtual HRESULT STDMETHODCALLTYPE putParent( - /* [in] */ ISAXXMLReader *pReader) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXXMLFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXXMLFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXXMLFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXXMLFilter * This); - - HRESULT ( STDMETHODCALLTYPE *getFeature )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT_BOOL *pvfValue); - - HRESULT ( STDMETHODCALLTYPE *putFeature )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT_BOOL vfValue); - - HRESULT ( STDMETHODCALLTYPE *getProperty )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchName, - /* [retval][out] */ VARIANT *pvarValue); - - HRESULT ( STDMETHODCALLTYPE *putProperty )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ VARIANT varValue); - - HRESULT ( STDMETHODCALLTYPE *getEntityResolver )( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXEntityResolver **ppResolver); - - HRESULT ( STDMETHODCALLTYPE *putEntityResolver )( - ISAXXMLFilter * This, - /* [in] */ ISAXEntityResolver *pResolver); - - HRESULT ( STDMETHODCALLTYPE *getContentHandler )( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXContentHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putContentHandler )( - ISAXXMLFilter * This, - /* [in] */ ISAXContentHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getDTDHandler )( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXDTDHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putDTDHandler )( - ISAXXMLFilter * This, - /* [in] */ ISAXDTDHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getErrorHandler )( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXErrorHandler **ppHandler); - - HRESULT ( STDMETHODCALLTYPE *putErrorHandler )( - ISAXXMLFilter * This, - /* [in] */ ISAXErrorHandler *pHandler); - - HRESULT ( STDMETHODCALLTYPE *getBaseURL )( - ISAXXMLFilter * This, - /* [retval][out] */ const wchar_t **ppwchBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *putBaseURL )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *getSecureBaseURL )( - ISAXXMLFilter * This, - /* [retval][out] */ const wchar_t **ppwchSecureBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *putSecureBaseURL )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchSecureBaseUrl); - - HRESULT ( STDMETHODCALLTYPE *parse )( - ISAXXMLFilter * This, - /* [optional][in] */ VARIANT varInput); - - HRESULT ( STDMETHODCALLTYPE *parseURL )( - ISAXXMLFilter * This, - /* [in] */ const wchar_t *pwchUrl); - - HRESULT ( STDMETHODCALLTYPE *getParent )( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXXMLReader **ppReader); - - HRESULT ( STDMETHODCALLTYPE *putParent )( - ISAXXMLFilter * This, - /* [in] */ ISAXXMLReader *pReader); - - END_INTERFACE - } ISAXXMLFilterVtbl; - - interface ISAXXMLFilter - { - CONST_VTBL struct ISAXXMLFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXXMLFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXXMLFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXXMLFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXXMLFilter_getFeature(This,pwchName,pvfValue) \ - (This)->lpVtbl -> getFeature(This,pwchName,pvfValue) - -#define ISAXXMLFilter_putFeature(This,pwchName,vfValue) \ - (This)->lpVtbl -> putFeature(This,pwchName,vfValue) - -#define ISAXXMLFilter_getProperty(This,pwchName,pvarValue) \ - (This)->lpVtbl -> getProperty(This,pwchName,pvarValue) - -#define ISAXXMLFilter_putProperty(This,pwchName,varValue) \ - (This)->lpVtbl -> putProperty(This,pwchName,varValue) - -#define ISAXXMLFilter_getEntityResolver(This,ppResolver) \ - (This)->lpVtbl -> getEntityResolver(This,ppResolver) - -#define ISAXXMLFilter_putEntityResolver(This,pResolver) \ - (This)->lpVtbl -> putEntityResolver(This,pResolver) - -#define ISAXXMLFilter_getContentHandler(This,ppHandler) \ - (This)->lpVtbl -> getContentHandler(This,ppHandler) - -#define ISAXXMLFilter_putContentHandler(This,pHandler) \ - (This)->lpVtbl -> putContentHandler(This,pHandler) - -#define ISAXXMLFilter_getDTDHandler(This,ppHandler) \ - (This)->lpVtbl -> getDTDHandler(This,ppHandler) - -#define ISAXXMLFilter_putDTDHandler(This,pHandler) \ - (This)->lpVtbl -> putDTDHandler(This,pHandler) - -#define ISAXXMLFilter_getErrorHandler(This,ppHandler) \ - (This)->lpVtbl -> getErrorHandler(This,ppHandler) - -#define ISAXXMLFilter_putErrorHandler(This,pHandler) \ - (This)->lpVtbl -> putErrorHandler(This,pHandler) - -#define ISAXXMLFilter_getBaseURL(This,ppwchBaseUrl) \ - (This)->lpVtbl -> getBaseURL(This,ppwchBaseUrl) - -#define ISAXXMLFilter_putBaseURL(This,pwchBaseUrl) \ - (This)->lpVtbl -> putBaseURL(This,pwchBaseUrl) - -#define ISAXXMLFilter_getSecureBaseURL(This,ppwchSecureBaseUrl) \ - (This)->lpVtbl -> getSecureBaseURL(This,ppwchSecureBaseUrl) - -#define ISAXXMLFilter_putSecureBaseURL(This,pwchSecureBaseUrl) \ - (This)->lpVtbl -> putSecureBaseURL(This,pwchSecureBaseUrl) - -#define ISAXXMLFilter_parse(This,varInput) \ - (This)->lpVtbl -> parse(This,varInput) - -#define ISAXXMLFilter_parseURL(This,pwchUrl) \ - (This)->lpVtbl -> parseURL(This,pwchUrl) - - -#define ISAXXMLFilter_getParent(This,ppReader) \ - (This)->lpVtbl -> getParent(This,ppReader) - -#define ISAXXMLFilter_putParent(This,pReader) \ - (This)->lpVtbl -> putParent(This,pReader) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXXMLFilter_getParent_Proxy( - ISAXXMLFilter * This, - /* [retval][out] */ ISAXXMLReader **ppReader); - - -void __RPC_STUB ISAXXMLFilter_getParent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXXMLFilter_putParent_Proxy( - ISAXXMLFilter * This, - /* [in] */ ISAXXMLReader *pReader); - - -void __RPC_STUB ISAXXMLFilter_putParent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXXMLFilter_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXLocator_INTERFACE_DEFINED__ -#define __ISAXLocator_INTERFACE_DEFINED__ - -/* interface ISAXLocator */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9b7e472a-0de4-4640-bff3-84d38a051c31") - ISAXLocator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE getColumnNumber( - /* [retval][out] */ int *pnColumn) = 0; - - virtual HRESULT STDMETHODCALLTYPE getLineNumber( - /* [retval][out] */ int *pnLine) = 0; - - virtual HRESULT STDMETHODCALLTYPE getPublicId( - /* [retval][out] */ const wchar_t **ppwchPublicId) = 0; - - virtual HRESULT STDMETHODCALLTYPE getSystemId( - /* [retval][out] */ const wchar_t **ppwchSystemId) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXLocator * This); - - HRESULT ( STDMETHODCALLTYPE *getColumnNumber )( - ISAXLocator * This, - /* [retval][out] */ int *pnColumn); - - HRESULT ( STDMETHODCALLTYPE *getLineNumber )( - ISAXLocator * This, - /* [retval][out] */ int *pnLine); - - HRESULT ( STDMETHODCALLTYPE *getPublicId )( - ISAXLocator * This, - /* [retval][out] */ const wchar_t **ppwchPublicId); - - HRESULT ( STDMETHODCALLTYPE *getSystemId )( - ISAXLocator * This, - /* [retval][out] */ const wchar_t **ppwchSystemId); - - END_INTERFACE - } ISAXLocatorVtbl; - - interface ISAXLocator - { - CONST_VTBL struct ISAXLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXLocator_getColumnNumber(This,pnColumn) \ - (This)->lpVtbl -> getColumnNumber(This,pnColumn) - -#define ISAXLocator_getLineNumber(This,pnLine) \ - (This)->lpVtbl -> getLineNumber(This,pnLine) - -#define ISAXLocator_getPublicId(This,ppwchPublicId) \ - (This)->lpVtbl -> getPublicId(This,ppwchPublicId) - -#define ISAXLocator_getSystemId(This,ppwchSystemId) \ - (This)->lpVtbl -> getSystemId(This,ppwchSystemId) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXLocator_getColumnNumber_Proxy( - ISAXLocator * This, - /* [retval][out] */ int *pnColumn); - - -void __RPC_STUB ISAXLocator_getColumnNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLocator_getLineNumber_Proxy( - ISAXLocator * This, - /* [retval][out] */ int *pnLine); - - -void __RPC_STUB ISAXLocator_getLineNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLocator_getPublicId_Proxy( - ISAXLocator * This, - /* [retval][out] */ const wchar_t **ppwchPublicId); - - -void __RPC_STUB ISAXLocator_getPublicId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLocator_getSystemId_Proxy( - ISAXLocator * This, - /* [retval][out] */ const wchar_t **ppwchSystemId); - - -void __RPC_STUB ISAXLocator_getSystemId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXLocator_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXEntityResolver_INTERFACE_DEFINED__ -#define __ISAXEntityResolver_INTERFACE_DEFINED__ - -/* interface ISAXEntityResolver */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXEntityResolver; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("99bca7bd-e8c4-4d5f-a0cf-6d907901ff07") - ISAXEntityResolver : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE resolveEntity( - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [retval][out] */ VARIANT *pvarInput) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXEntityResolverVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXEntityResolver * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXEntityResolver * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXEntityResolver * This); - - HRESULT ( STDMETHODCALLTYPE *resolveEntity )( - ISAXEntityResolver * This, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [retval][out] */ VARIANT *pvarInput); - - END_INTERFACE - } ISAXEntityResolverVtbl; - - interface ISAXEntityResolver - { - CONST_VTBL struct ISAXEntityResolverVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXEntityResolver_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXEntityResolver_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXEntityResolver_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXEntityResolver_resolveEntity(This,pwchPublicId,pwchSystemId,pvarInput) \ - (This)->lpVtbl -> resolveEntity(This,pwchPublicId,pwchSystemId,pvarInput) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXEntityResolver_resolveEntity_Proxy( - ISAXEntityResolver * This, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [retval][out] */ VARIANT *pvarInput); - - -void __RPC_STUB ISAXEntityResolver_resolveEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXEntityResolver_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXContentHandler_INTERFACE_DEFINED__ -#define __ISAXContentHandler_INTERFACE_DEFINED__ - -/* interface ISAXContentHandler */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXContentHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1545cdfa-9e4e-4497-a8a4-2bf7d0112c44") - ISAXContentHandler : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE putDocumentLocator( - /* [in] */ ISAXLocator *pLocator) = 0; - - virtual HRESULT STDMETHODCALLTYPE startDocument( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE endDocument( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE startPrefixMapping( - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri) = 0; - - virtual HRESULT STDMETHODCALLTYPE endPrefixMapping( - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix) = 0; - - virtual HRESULT STDMETHODCALLTYPE startElement( - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [in] */ ISAXAttributes *pAttributes) = 0; - - virtual HRESULT STDMETHODCALLTYPE endElement( - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName) = 0; - - virtual HRESULT STDMETHODCALLTYPE characters( - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars) = 0; - - virtual HRESULT STDMETHODCALLTYPE ignorableWhitespace( - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars) = 0; - - virtual HRESULT STDMETHODCALLTYPE processingInstruction( - /* [in] */ const wchar_t *pwchTarget, - /* [in] */ int cchTarget, - /* [in] */ const wchar_t *pwchData, - /* [in] */ int cchData) = 0; - - virtual HRESULT STDMETHODCALLTYPE skippedEntity( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXContentHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXContentHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXContentHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXContentHandler * This); - - HRESULT ( STDMETHODCALLTYPE *putDocumentLocator )( - ISAXContentHandler * This, - /* [in] */ ISAXLocator *pLocator); - - HRESULT ( STDMETHODCALLTYPE *startDocument )( - ISAXContentHandler * This); - - HRESULT ( STDMETHODCALLTYPE *endDocument )( - ISAXContentHandler * This); - - HRESULT ( STDMETHODCALLTYPE *startPrefixMapping )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri); - - HRESULT ( STDMETHODCALLTYPE *endPrefixMapping )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix); - - HRESULT ( STDMETHODCALLTYPE *startElement )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [in] */ ISAXAttributes *pAttributes); - - HRESULT ( STDMETHODCALLTYPE *endElement )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName); - - HRESULT ( STDMETHODCALLTYPE *characters )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - HRESULT ( STDMETHODCALLTYPE *ignorableWhitespace )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - HRESULT ( STDMETHODCALLTYPE *processingInstruction )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchTarget, - /* [in] */ int cchTarget, - /* [in] */ const wchar_t *pwchData, - /* [in] */ int cchData); - - HRESULT ( STDMETHODCALLTYPE *skippedEntity )( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - END_INTERFACE - } ISAXContentHandlerVtbl; - - interface ISAXContentHandler - { - CONST_VTBL struct ISAXContentHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXContentHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXContentHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXContentHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXContentHandler_putDocumentLocator(This,pLocator) \ - (This)->lpVtbl -> putDocumentLocator(This,pLocator) - -#define ISAXContentHandler_startDocument(This) \ - (This)->lpVtbl -> startDocument(This) - -#define ISAXContentHandler_endDocument(This) \ - (This)->lpVtbl -> endDocument(This) - -#define ISAXContentHandler_startPrefixMapping(This,pwchPrefix,cchPrefix,pwchUri,cchUri) \ - (This)->lpVtbl -> startPrefixMapping(This,pwchPrefix,cchPrefix,pwchUri,cchUri) - -#define ISAXContentHandler_endPrefixMapping(This,pwchPrefix,cchPrefix) \ - (This)->lpVtbl -> endPrefixMapping(This,pwchPrefix,cchPrefix) - -#define ISAXContentHandler_startElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName,pAttributes) \ - (This)->lpVtbl -> startElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName,pAttributes) - -#define ISAXContentHandler_endElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName) \ - (This)->lpVtbl -> endElement(This,pwchNamespaceUri,cchNamespaceUri,pwchLocalName,cchLocalName,pwchQName,cchQName) - -#define ISAXContentHandler_characters(This,pwchChars,cchChars) \ - (This)->lpVtbl -> characters(This,pwchChars,cchChars) - -#define ISAXContentHandler_ignorableWhitespace(This,pwchChars,cchChars) \ - (This)->lpVtbl -> ignorableWhitespace(This,pwchChars,cchChars) - -#define ISAXContentHandler_processingInstruction(This,pwchTarget,cchTarget,pwchData,cchData) \ - (This)->lpVtbl -> processingInstruction(This,pwchTarget,cchTarget,pwchData,cchData) - -#define ISAXContentHandler_skippedEntity(This,pwchName,cchName) \ - (This)->lpVtbl -> skippedEntity(This,pwchName,cchName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_putDocumentLocator_Proxy( - ISAXContentHandler * This, - /* [in] */ ISAXLocator *pLocator); - - -void __RPC_STUB ISAXContentHandler_putDocumentLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_startDocument_Proxy( - ISAXContentHandler * This); - - -void __RPC_STUB ISAXContentHandler_startDocument_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_endDocument_Proxy( - ISAXContentHandler * This); - - -void __RPC_STUB ISAXContentHandler_endDocument_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_startPrefixMapping_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri); - - -void __RPC_STUB ISAXContentHandler_startPrefixMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_endPrefixMapping_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ int cchPrefix); - - -void __RPC_STUB ISAXContentHandler_endPrefixMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_startElement_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [in] */ ISAXAttributes *pAttributes); - - -void __RPC_STUB ISAXContentHandler_startElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_endElement_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchNamespaceUri, - /* [in] */ int cchNamespaceUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName); - - -void __RPC_STUB ISAXContentHandler_endElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_characters_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - -void __RPC_STUB ISAXContentHandler_characters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_ignorableWhitespace_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - -void __RPC_STUB ISAXContentHandler_ignorableWhitespace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_processingInstruction_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchTarget, - /* [in] */ int cchTarget, - /* [in] */ const wchar_t *pwchData, - /* [in] */ int cchData); - - -void __RPC_STUB ISAXContentHandler_processingInstruction_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXContentHandler_skippedEntity_Proxy( - ISAXContentHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - -void __RPC_STUB ISAXContentHandler_skippedEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXContentHandler_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXDTDHandler_INTERFACE_DEFINED__ -#define __ISAXDTDHandler_INTERFACE_DEFINED__ - -/* interface ISAXDTDHandler */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXDTDHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e15c1baf-afb3-4d60-8c36-19a8c45defed") - ISAXDTDHandler : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE notationDecl( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId) = 0; - - virtual HRESULT STDMETHODCALLTYPE unparsedEntityDecl( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId, - /* [in] */ const wchar_t *pwchNotationName, - /* [in] */ int cchNotationName) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXDTDHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXDTDHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXDTDHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXDTDHandler * This); - - HRESULT ( STDMETHODCALLTYPE *notationDecl )( - ISAXDTDHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - HRESULT ( STDMETHODCALLTYPE *unparsedEntityDecl )( - ISAXDTDHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId, - /* [in] */ const wchar_t *pwchNotationName, - /* [in] */ int cchNotationName); - - END_INTERFACE - } ISAXDTDHandlerVtbl; - - interface ISAXDTDHandler - { - CONST_VTBL struct ISAXDTDHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXDTDHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXDTDHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXDTDHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXDTDHandler_notationDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ - (This)->lpVtbl -> notationDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) - -#define ISAXDTDHandler_unparsedEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId,pwchNotationName,cchNotationName) \ - (This)->lpVtbl -> unparsedEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId,pwchNotationName,cchNotationName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXDTDHandler_notationDecl_Proxy( - ISAXDTDHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - -void __RPC_STUB ISAXDTDHandler_notationDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXDTDHandler_unparsedEntityDecl_Proxy( - ISAXDTDHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId, - /* [in] */ const wchar_t *pwchNotationName, - /* [in] */ int cchNotationName); - - -void __RPC_STUB ISAXDTDHandler_unparsedEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXDTDHandler_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXErrorHandler_INTERFACE_DEFINED__ -#define __ISAXErrorHandler_INTERFACE_DEFINED__ - -/* interface ISAXErrorHandler */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXErrorHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a60511c4-ccf5-479e-98a3-dc8dc545b7d0") - ISAXErrorHandler : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE error( - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE fatalError( - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode) = 0; - - virtual HRESULT STDMETHODCALLTYPE ignorableWarning( - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXErrorHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXErrorHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXErrorHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXErrorHandler * This); - - HRESULT ( STDMETHODCALLTYPE *error )( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - HRESULT ( STDMETHODCALLTYPE *fatalError )( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - HRESULT ( STDMETHODCALLTYPE *ignorableWarning )( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - END_INTERFACE - } ISAXErrorHandlerVtbl; - - interface ISAXErrorHandler - { - CONST_VTBL struct ISAXErrorHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXErrorHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXErrorHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXErrorHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXErrorHandler_error(This,pLocator,pwchErrorMessage,hrErrorCode) \ - (This)->lpVtbl -> error(This,pLocator,pwchErrorMessage,hrErrorCode) - -#define ISAXErrorHandler_fatalError(This,pLocator,pwchErrorMessage,hrErrorCode) \ - (This)->lpVtbl -> fatalError(This,pLocator,pwchErrorMessage,hrErrorCode) - -#define ISAXErrorHandler_ignorableWarning(This,pLocator,pwchErrorMessage,hrErrorCode) \ - (This)->lpVtbl -> ignorableWarning(This,pLocator,pwchErrorMessage,hrErrorCode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXErrorHandler_error_Proxy( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - -void __RPC_STUB ISAXErrorHandler_error_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXErrorHandler_fatalError_Proxy( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - -void __RPC_STUB ISAXErrorHandler_fatalError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXErrorHandler_ignorableWarning_Proxy( - ISAXErrorHandler * This, - /* [in] */ ISAXLocator *pLocator, - /* [in] */ const wchar_t *pwchErrorMessage, - /* [in] */ HRESULT hrErrorCode); - - -void __RPC_STUB ISAXErrorHandler_ignorableWarning_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXErrorHandler_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXLexicalHandler_INTERFACE_DEFINED__ -#define __ISAXLexicalHandler_INTERFACE_DEFINED__ - -/* interface ISAXLexicalHandler */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXLexicalHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7f85d5f5-47a8-4497-bda5-84ba04819ea6") - ISAXLexicalHandler : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE startDTD( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId) = 0; - - virtual HRESULT STDMETHODCALLTYPE endDTD( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE startEntity( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName) = 0; - - virtual HRESULT STDMETHODCALLTYPE endEntity( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName) = 0; - - virtual HRESULT STDMETHODCALLTYPE startCDATA( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE endCDATA( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE comment( - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXLexicalHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXLexicalHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXLexicalHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXLexicalHandler * This); - - HRESULT ( STDMETHODCALLTYPE *startDTD )( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - HRESULT ( STDMETHODCALLTYPE *endDTD )( - ISAXLexicalHandler * This); - - HRESULT ( STDMETHODCALLTYPE *startEntity )( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - HRESULT ( STDMETHODCALLTYPE *endEntity )( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - HRESULT ( STDMETHODCALLTYPE *startCDATA )( - ISAXLexicalHandler * This); - - HRESULT ( STDMETHODCALLTYPE *endCDATA )( - ISAXLexicalHandler * This); - - HRESULT ( STDMETHODCALLTYPE *comment )( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - END_INTERFACE - } ISAXLexicalHandlerVtbl; - - interface ISAXLexicalHandler - { - CONST_VTBL struct ISAXLexicalHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXLexicalHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXLexicalHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXLexicalHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXLexicalHandler_startDTD(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ - (This)->lpVtbl -> startDTD(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) - -#define ISAXLexicalHandler_endDTD(This) \ - (This)->lpVtbl -> endDTD(This) - -#define ISAXLexicalHandler_startEntity(This,pwchName,cchName) \ - (This)->lpVtbl -> startEntity(This,pwchName,cchName) - -#define ISAXLexicalHandler_endEntity(This,pwchName,cchName) \ - (This)->lpVtbl -> endEntity(This,pwchName,cchName) - -#define ISAXLexicalHandler_startCDATA(This) \ - (This)->lpVtbl -> startCDATA(This) - -#define ISAXLexicalHandler_endCDATA(This) \ - (This)->lpVtbl -> endCDATA(This) - -#define ISAXLexicalHandler_comment(This,pwchChars,cchChars) \ - (This)->lpVtbl -> comment(This,pwchChars,cchChars) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startDTD_Proxy( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - -void __RPC_STUB ISAXLexicalHandler_startDTD_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endDTD_Proxy( - ISAXLexicalHandler * This); - - -void __RPC_STUB ISAXLexicalHandler_endDTD_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startEntity_Proxy( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - -void __RPC_STUB ISAXLexicalHandler_startEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endEntity_Proxy( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName); - - -void __RPC_STUB ISAXLexicalHandler_endEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_startCDATA_Proxy( - ISAXLexicalHandler * This); - - -void __RPC_STUB ISAXLexicalHandler_startCDATA_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_endCDATA_Proxy( - ISAXLexicalHandler * This); - - -void __RPC_STUB ISAXLexicalHandler_endCDATA_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXLexicalHandler_comment_Proxy( - ISAXLexicalHandler * This, - /* [in] */ const wchar_t *pwchChars, - /* [in] */ int cchChars); - - -void __RPC_STUB ISAXLexicalHandler_comment_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXLexicalHandler_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXDeclHandler_INTERFACE_DEFINED__ -#define __ISAXDeclHandler_INTERFACE_DEFINED__ - -/* interface ISAXDeclHandler */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXDeclHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("862629ac-771a-47b2-8337-4e6843c1be90") - ISAXDeclHandler : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE elementDecl( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchModel, - /* [in] */ int cchModel) = 0; - - virtual HRESULT STDMETHODCALLTYPE attributeDecl( - /* [in] */ const wchar_t *pwchElementName, - /* [in] */ int cchElementName, - /* [in] */ const wchar_t *pwchAttributeName, - /* [in] */ int cchAttributeName, - /* [in] */ const wchar_t *pwchType, - /* [in] */ int cchType, - /* [in] */ const wchar_t *pwchValueDefault, - /* [in] */ int cchValueDefault, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE internalEntityDecl( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE externalEntityDecl( - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXDeclHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXDeclHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXDeclHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXDeclHandler * This); - - HRESULT ( STDMETHODCALLTYPE *elementDecl )( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchModel, - /* [in] */ int cchModel); - - HRESULT ( STDMETHODCALLTYPE *attributeDecl )( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchElementName, - /* [in] */ int cchElementName, - /* [in] */ const wchar_t *pwchAttributeName, - /* [in] */ int cchAttributeName, - /* [in] */ const wchar_t *pwchType, - /* [in] */ int cchType, - /* [in] */ const wchar_t *pwchValueDefault, - /* [in] */ int cchValueDefault, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue); - - HRESULT ( STDMETHODCALLTYPE *internalEntityDecl )( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue); - - HRESULT ( STDMETHODCALLTYPE *externalEntityDecl )( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - END_INTERFACE - } ISAXDeclHandlerVtbl; - - interface ISAXDeclHandler - { - CONST_VTBL struct ISAXDeclHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXDeclHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXDeclHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXDeclHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXDeclHandler_elementDecl(This,pwchName,cchName,pwchModel,cchModel) \ - (This)->lpVtbl -> elementDecl(This,pwchName,cchName,pwchModel,cchModel) - -#define ISAXDeclHandler_attributeDecl(This,pwchElementName,cchElementName,pwchAttributeName,cchAttributeName,pwchType,cchType,pwchValueDefault,cchValueDefault,pwchValue,cchValue) \ - (This)->lpVtbl -> attributeDecl(This,pwchElementName,cchElementName,pwchAttributeName,cchAttributeName,pwchType,cchType,pwchValueDefault,cchValueDefault,pwchValue,cchValue) - -#define ISAXDeclHandler_internalEntityDecl(This,pwchName,cchName,pwchValue,cchValue) \ - (This)->lpVtbl -> internalEntityDecl(This,pwchName,cchName,pwchValue,cchValue) - -#define ISAXDeclHandler_externalEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) \ - (This)->lpVtbl -> externalEntityDecl(This,pwchName,cchName,pwchPublicId,cchPublicId,pwchSystemId,cchSystemId) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXDeclHandler_elementDecl_Proxy( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchModel, - /* [in] */ int cchModel); - - -void __RPC_STUB ISAXDeclHandler_elementDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXDeclHandler_attributeDecl_Proxy( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchElementName, - /* [in] */ int cchElementName, - /* [in] */ const wchar_t *pwchAttributeName, - /* [in] */ int cchAttributeName, - /* [in] */ const wchar_t *pwchType, - /* [in] */ int cchType, - /* [in] */ const wchar_t *pwchValueDefault, - /* [in] */ int cchValueDefault, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue); - - -void __RPC_STUB ISAXDeclHandler_attributeDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXDeclHandler_internalEntityDecl_Proxy( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchValue, - /* [in] */ int cchValue); - - -void __RPC_STUB ISAXDeclHandler_internalEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXDeclHandler_externalEntityDecl_Proxy( - ISAXDeclHandler * This, - /* [in] */ const wchar_t *pwchName, - /* [in] */ int cchName, - /* [in] */ const wchar_t *pwchPublicId, - /* [in] */ int cchPublicId, - /* [in] */ const wchar_t *pwchSystemId, - /* [in] */ int cchSystemId); - - -void __RPC_STUB ISAXDeclHandler_externalEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXDeclHandler_INTERFACE_DEFINED__ */ - - -#ifndef __ISAXAttributes_INTERFACE_DEFINED__ -#define __ISAXAttributes_INTERFACE_DEFINED__ - -/* interface ISAXAttributes */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_ISAXAttributes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("f078abe1-45d2-4832-91ea-4466ce2f25c9") - ISAXAttributes : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE getLength( - /* [retval][out] */ int *pnLength) = 0; - - virtual HRESULT STDMETHODCALLTYPE getURI( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri) = 0; - - virtual HRESULT STDMETHODCALLTYPE getLocalName( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName) = 0; - - virtual HRESULT STDMETHODCALLTYPE getQName( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName) = 0; - - virtual HRESULT STDMETHODCALLTYPE getName( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName) = 0; - - virtual HRESULT STDMETHODCALLTYPE getIndexFromName( - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [retval][out] */ int *pnIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE getIndexFromQName( - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [retval][out] */ int *pnIndex) = 0; - - virtual HRESULT STDMETHODCALLTYPE getType( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType) = 0; - - virtual HRESULT STDMETHODCALLTYPE getTypeFromName( - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType) = 0; - - virtual HRESULT STDMETHODCALLTYPE getTypeFromQName( - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType) = 0; - - virtual HRESULT STDMETHODCALLTYPE getValue( - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE getValueFromName( - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE getValueFromQName( - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISAXAttributesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISAXAttributes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISAXAttributes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISAXAttributes * This); - - HRESULT ( STDMETHODCALLTYPE *getLength )( - ISAXAttributes * This, - /* [retval][out] */ int *pnLength); - - HRESULT ( STDMETHODCALLTYPE *getURI )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri); - - HRESULT ( STDMETHODCALLTYPE *getLocalName )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName); - - HRESULT ( STDMETHODCALLTYPE *getQName )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName); - - HRESULT ( STDMETHODCALLTYPE *getName )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName); - - HRESULT ( STDMETHODCALLTYPE *getIndexFromName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [retval][out] */ int *pnIndex); - - HRESULT ( STDMETHODCALLTYPE *getIndexFromQName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [retval][out] */ int *pnIndex); - - HRESULT ( STDMETHODCALLTYPE *getType )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - HRESULT ( STDMETHODCALLTYPE *getTypeFromName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - HRESULT ( STDMETHODCALLTYPE *getTypeFromQName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - HRESULT ( STDMETHODCALLTYPE *getValue )( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - HRESULT ( STDMETHODCALLTYPE *getValueFromName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - HRESULT ( STDMETHODCALLTYPE *getValueFromQName )( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - END_INTERFACE - } ISAXAttributesVtbl; - - interface ISAXAttributes - { - CONST_VTBL struct ISAXAttributesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISAXAttributes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISAXAttributes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISAXAttributes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISAXAttributes_getLength(This,pnLength) \ - (This)->lpVtbl -> getLength(This,pnLength) - -#define ISAXAttributes_getURI(This,nIndex,ppwchUri,pcchUri) \ - (This)->lpVtbl -> getURI(This,nIndex,ppwchUri,pcchUri) - -#define ISAXAttributes_getLocalName(This,nIndex,ppwchLocalName,pcchLocalName) \ - (This)->lpVtbl -> getLocalName(This,nIndex,ppwchLocalName,pcchLocalName) - -#define ISAXAttributes_getQName(This,nIndex,ppwchQName,pcchQName) \ - (This)->lpVtbl -> getQName(This,nIndex,ppwchQName,pcchQName) - -#define ISAXAttributes_getName(This,nIndex,ppwchUri,pcchUri,ppwchLocalName,pcchLocalName,ppwchQName,pcchQName) \ - (This)->lpVtbl -> getName(This,nIndex,ppwchUri,pcchUri,ppwchLocalName,pcchLocalName,ppwchQName,pcchQName) - -#define ISAXAttributes_getIndexFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,pnIndex) \ - (This)->lpVtbl -> getIndexFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,pnIndex) - -#define ISAXAttributes_getIndexFromQName(This,pwchQName,cchQName,pnIndex) \ - (This)->lpVtbl -> getIndexFromQName(This,pwchQName,cchQName,pnIndex) - -#define ISAXAttributes_getType(This,nIndex,ppwchType,pcchType) \ - (This)->lpVtbl -> getType(This,nIndex,ppwchType,pcchType) - -#define ISAXAttributes_getTypeFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchType,pcchType) \ - (This)->lpVtbl -> getTypeFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchType,pcchType) - -#define ISAXAttributes_getTypeFromQName(This,pwchQName,cchQName,ppwchType,pcchType) \ - (This)->lpVtbl -> getTypeFromQName(This,pwchQName,cchQName,ppwchType,pcchType) - -#define ISAXAttributes_getValue(This,nIndex,ppwchValue,pcchValue) \ - (This)->lpVtbl -> getValue(This,nIndex,ppwchValue,pcchValue) - -#define ISAXAttributes_getValueFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchValue,pcchValue) \ - (This)->lpVtbl -> getValueFromName(This,pwchUri,cchUri,pwchLocalName,cchLocalName,ppwchValue,pcchValue) - -#define ISAXAttributes_getValueFromQName(This,pwchQName,cchQName,ppwchValue,pcchValue) \ - (This)->lpVtbl -> getValueFromQName(This,pwchQName,cchQName,ppwchValue,pcchValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getLength_Proxy( - ISAXAttributes * This, - /* [retval][out] */ int *pnLength); - - -void __RPC_STUB ISAXAttributes_getLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getURI_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri); - - -void __RPC_STUB ISAXAttributes_getURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getLocalName_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName); - - -void __RPC_STUB ISAXAttributes_getLocalName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getQName_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName); - - -void __RPC_STUB ISAXAttributes_getQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getName_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchUri, - /* [out] */ int *pcchUri, - /* [out] */ const wchar_t **ppwchLocalName, - /* [out] */ int *pcchLocalName, - /* [out] */ const wchar_t **ppwchQName, - /* [out] */ int *pcchQName); - - -void __RPC_STUB ISAXAttributes_getName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getIndexFromName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [retval][out] */ int *pnIndex); - - -void __RPC_STUB ISAXAttributes_getIndexFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getIndexFromQName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [retval][out] */ int *pnIndex); - - -void __RPC_STUB ISAXAttributes_getIndexFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getType_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - -void __RPC_STUB ISAXAttributes_getType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getTypeFromName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - -void __RPC_STUB ISAXAttributes_getTypeFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getTypeFromQName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchType, - /* [out] */ int *pcchType); - - -void __RPC_STUB ISAXAttributes_getTypeFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getValue_Proxy( - ISAXAttributes * This, - /* [in] */ int nIndex, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - -void __RPC_STUB ISAXAttributes_getValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getValueFromName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchUri, - /* [in] */ int cchUri, - /* [in] */ const wchar_t *pwchLocalName, - /* [in] */ int cchLocalName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - -void __RPC_STUB ISAXAttributes_getValueFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE ISAXAttributes_getValueFromQName_Proxy( - ISAXAttributes * This, - /* [in] */ const wchar_t *pwchQName, - /* [in] */ int cchQName, - /* [out] */ const wchar_t **ppwchValue, - /* [out] */ int *pcchValue); - - -void __RPC_STUB ISAXAttributes_getValueFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISAXAttributes_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXXMLReader_INTERFACE_DEFINED__ -#define __IVBSAXXMLReader_INTERFACE_DEFINED__ - -/* interface IVBSAXXMLReader */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXXMLReader; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8c033caa-6cd6-4f73-b728-4531af74945f") - IVBSAXXMLReader : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getFeature( - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE putFeature( - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE putProperty( - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_entityResolver( - /* [retval][out] */ IVBSAXEntityResolver **oResolver) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_entityResolver( - /* [in] */ IVBSAXEntityResolver *oResolver) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_contentHandler( - /* [retval][out] */ IVBSAXContentHandler **oHandler) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_contentHandler( - /* [in] */ IVBSAXContentHandler *oHandler) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dtdHandler( - /* [retval][out] */ IVBSAXDTDHandler **oHandler) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_dtdHandler( - /* [in] */ IVBSAXDTDHandler *oHandler) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_errorHandler( - /* [retval][out] */ IVBSAXErrorHandler **oHandler) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_errorHandler( - /* [in] */ IVBSAXErrorHandler *oHandler) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_baseURL( - /* [retval][out] */ BSTR *strBaseURL) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_baseURL( - /* [in] */ BSTR strBaseURL) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_secureBaseURL( - /* [retval][out] */ BSTR *strSecureBaseURL) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_secureBaseURL( - /* [in] */ BSTR strSecureBaseURL) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE parse( - /* [optional][in] */ VARIANT varInput) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE parseURL( - /* [in] */ BSTR strURL) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXXMLReaderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXXMLReader * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXXMLReader * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXXMLReader * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXXMLReader * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXXMLReader * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXXMLReader * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXXMLReader * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getFeature )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *putFeature )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *putProperty )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_entityResolver )( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXEntityResolver **oResolver); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_entityResolver )( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXEntityResolver *oResolver); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_contentHandler )( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXContentHandler **oHandler); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_contentHandler )( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXContentHandler *oHandler); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_dtdHandler )( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXDTDHandler **oHandler); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_dtdHandler )( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXDTDHandler *oHandler); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_errorHandler )( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXErrorHandler **oHandler); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_errorHandler )( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXErrorHandler *oHandler); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_baseURL )( - IVBSAXXMLReader * This, - /* [retval][out] */ BSTR *strBaseURL); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_baseURL )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strBaseURL); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_secureBaseURL )( - IVBSAXXMLReader * This, - /* [retval][out] */ BSTR *strSecureBaseURL); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_secureBaseURL )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strSecureBaseURL); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *parse )( - IVBSAXXMLReader * This, - /* [optional][in] */ VARIANT varInput); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *parseURL )( - IVBSAXXMLReader * This, - /* [in] */ BSTR strURL); - - END_INTERFACE - } IVBSAXXMLReaderVtbl; - - interface IVBSAXXMLReader - { - CONST_VTBL struct IVBSAXXMLReaderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXXMLReader_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXXMLReader_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXXMLReader_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXXMLReader_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXXMLReader_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXXMLReader_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXXMLReader_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXXMLReader_getFeature(This,strName,fValue) \ - (This)->lpVtbl -> getFeature(This,strName,fValue) - -#define IVBSAXXMLReader_putFeature(This,strName,fValue) \ - (This)->lpVtbl -> putFeature(This,strName,fValue) - -#define IVBSAXXMLReader_getProperty(This,strName,varValue) \ - (This)->lpVtbl -> getProperty(This,strName,varValue) - -#define IVBSAXXMLReader_putProperty(This,strName,varValue) \ - (This)->lpVtbl -> putProperty(This,strName,varValue) - -#define IVBSAXXMLReader_get_entityResolver(This,oResolver) \ - (This)->lpVtbl -> get_entityResolver(This,oResolver) - -#define IVBSAXXMLReader_putref_entityResolver(This,oResolver) \ - (This)->lpVtbl -> putref_entityResolver(This,oResolver) - -#define IVBSAXXMLReader_get_contentHandler(This,oHandler) \ - (This)->lpVtbl -> get_contentHandler(This,oHandler) - -#define IVBSAXXMLReader_putref_contentHandler(This,oHandler) \ - (This)->lpVtbl -> putref_contentHandler(This,oHandler) - -#define IVBSAXXMLReader_get_dtdHandler(This,oHandler) \ - (This)->lpVtbl -> get_dtdHandler(This,oHandler) - -#define IVBSAXXMLReader_putref_dtdHandler(This,oHandler) \ - (This)->lpVtbl -> putref_dtdHandler(This,oHandler) - -#define IVBSAXXMLReader_get_errorHandler(This,oHandler) \ - (This)->lpVtbl -> get_errorHandler(This,oHandler) - -#define IVBSAXXMLReader_putref_errorHandler(This,oHandler) \ - (This)->lpVtbl -> putref_errorHandler(This,oHandler) - -#define IVBSAXXMLReader_get_baseURL(This,strBaseURL) \ - (This)->lpVtbl -> get_baseURL(This,strBaseURL) - -#define IVBSAXXMLReader_put_baseURL(This,strBaseURL) \ - (This)->lpVtbl -> put_baseURL(This,strBaseURL) - -#define IVBSAXXMLReader_get_secureBaseURL(This,strSecureBaseURL) \ - (This)->lpVtbl -> get_secureBaseURL(This,strSecureBaseURL) - -#define IVBSAXXMLReader_put_secureBaseURL(This,strSecureBaseURL) \ - (This)->lpVtbl -> put_secureBaseURL(This,strSecureBaseURL) - -#define IVBSAXXMLReader_parse(This,varInput) \ - (This)->lpVtbl -> parse(This,varInput) - -#define IVBSAXXMLReader_parseURL(This,strURL) \ - (This)->lpVtbl -> parseURL(This,strURL) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_getFeature_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue); - - -void __RPC_STUB IVBSAXXMLReader_getFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putFeature_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue); - - -void __RPC_STUB IVBSAXXMLReader_putFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_getProperty_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue); - - -void __RPC_STUB IVBSAXXMLReader_getProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putProperty_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue); - - -void __RPC_STUB IVBSAXXMLReader_putProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_entityResolver_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXEntityResolver **oResolver); - - -void __RPC_STUB IVBSAXXMLReader_get_entityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_entityResolver_Proxy( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXEntityResolver *oResolver); - - -void __RPC_STUB IVBSAXXMLReader_putref_entityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_contentHandler_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXContentHandler **oHandler); - - -void __RPC_STUB IVBSAXXMLReader_get_contentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_contentHandler_Proxy( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXContentHandler *oHandler); - - -void __RPC_STUB IVBSAXXMLReader_putref_contentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_dtdHandler_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXDTDHandler **oHandler); - - -void __RPC_STUB IVBSAXXMLReader_get_dtdHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_dtdHandler_Proxy( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXDTDHandler *oHandler); - - -void __RPC_STUB IVBSAXXMLReader_putref_dtdHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_errorHandler_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ IVBSAXErrorHandler **oHandler); - - -void __RPC_STUB IVBSAXXMLReader_get_errorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_putref_errorHandler_Proxy( - IVBSAXXMLReader * This, - /* [in] */ IVBSAXErrorHandler *oHandler); - - -void __RPC_STUB IVBSAXXMLReader_putref_errorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_baseURL_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ BSTR *strBaseURL); - - -void __RPC_STUB IVBSAXXMLReader_get_baseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_put_baseURL_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strBaseURL); - - -void __RPC_STUB IVBSAXXMLReader_put_baseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_get_secureBaseURL_Proxy( - IVBSAXXMLReader * This, - /* [retval][out] */ BSTR *strSecureBaseURL); - - -void __RPC_STUB IVBSAXXMLReader_get_secureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_put_secureBaseURL_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strSecureBaseURL); - - -void __RPC_STUB IVBSAXXMLReader_put_secureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_parse_Proxy( - IVBSAXXMLReader * This, - /* [optional][in] */ VARIANT varInput); - - -void __RPC_STUB IVBSAXXMLReader_parse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLReader_parseURL_Proxy( - IVBSAXXMLReader * This, - /* [in] */ BSTR strURL); - - -void __RPC_STUB IVBSAXXMLReader_parseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXXMLReader_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXXMLFilter_INTERFACE_DEFINED__ -#define __IVBSAXXMLFilter_INTERFACE_DEFINED__ - -/* interface IVBSAXXMLFilter */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXXMLFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1299eb1b-5b88-433e-82de-82ca75ad4e04") - IVBSAXXMLFilter : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_parent( - /* [retval][out] */ IVBSAXXMLReader **oReader) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_parent( - /* [in] */ IVBSAXXMLReader *oReader) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXXMLFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXXMLFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXXMLFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXXMLFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXXMLFilter * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXXMLFilter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXXMLFilter * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXXMLFilter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_parent )( - IVBSAXXMLFilter * This, - /* [retval][out] */ IVBSAXXMLReader **oReader); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_parent )( - IVBSAXXMLFilter * This, - /* [in] */ IVBSAXXMLReader *oReader); - - END_INTERFACE - } IVBSAXXMLFilterVtbl; - - interface IVBSAXXMLFilter - { - CONST_VTBL struct IVBSAXXMLFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXXMLFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXXMLFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXXMLFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXXMLFilter_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXXMLFilter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXXMLFilter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXXMLFilter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXXMLFilter_get_parent(This,oReader) \ - (This)->lpVtbl -> get_parent(This,oReader) - -#define IVBSAXXMLFilter_putref_parent(This,oReader) \ - (This)->lpVtbl -> putref_parent(This,oReader) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLFilter_get_parent_Proxy( - IVBSAXXMLFilter * This, - /* [retval][out] */ IVBSAXXMLReader **oReader); - - -void __RPC_STUB IVBSAXXMLFilter_get_parent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXXMLFilter_putref_parent_Proxy( - IVBSAXXMLFilter * This, - /* [in] */ IVBSAXXMLReader *oReader); - - -void __RPC_STUB IVBSAXXMLFilter_putref_parent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXXMLFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXLocator_INTERFACE_DEFINED__ -#define __IVBSAXLocator_INTERFACE_DEFINED__ - -/* interface IVBSAXLocator */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("796e7ac5-5aa2-4eff-acad-3faaf01a3288") - IVBSAXLocator : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_columnNumber( - /* [retval][out] */ int *nColumn) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_lineNumber( - /* [retval][out] */ int *nLine) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_publicId( - /* [retval][out] */ BSTR *strPublicId) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_systemId( - /* [retval][out] */ BSTR *strSystemId) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXLocator * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXLocator * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXLocator * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_columnNumber )( - IVBSAXLocator * This, - /* [retval][out] */ int *nColumn); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_lineNumber )( - IVBSAXLocator * This, - /* [retval][out] */ int *nLine); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_publicId )( - IVBSAXLocator * This, - /* [retval][out] */ BSTR *strPublicId); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_systemId )( - IVBSAXLocator * This, - /* [retval][out] */ BSTR *strSystemId); - - END_INTERFACE - } IVBSAXLocatorVtbl; - - interface IVBSAXLocator - { - CONST_VTBL struct IVBSAXLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXLocator_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXLocator_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXLocator_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXLocator_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXLocator_get_columnNumber(This,nColumn) \ - (This)->lpVtbl -> get_columnNumber(This,nColumn) - -#define IVBSAXLocator_get_lineNumber(This,nLine) \ - (This)->lpVtbl -> get_lineNumber(This,nLine) - -#define IVBSAXLocator_get_publicId(This,strPublicId) \ - (This)->lpVtbl -> get_publicId(This,strPublicId) - -#define IVBSAXLocator_get_systemId(This,strSystemId) \ - (This)->lpVtbl -> get_systemId(This,strSystemId) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_columnNumber_Proxy( - IVBSAXLocator * This, - /* [retval][out] */ int *nColumn); - - -void __RPC_STUB IVBSAXLocator_get_columnNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_lineNumber_Proxy( - IVBSAXLocator * This, - /* [retval][out] */ int *nLine); - - -void __RPC_STUB IVBSAXLocator_get_lineNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_publicId_Proxy( - IVBSAXLocator * This, - /* [retval][out] */ BSTR *strPublicId); - - -void __RPC_STUB IVBSAXLocator_get_publicId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXLocator_get_systemId_Proxy( - IVBSAXLocator * This, - /* [retval][out] */ BSTR *strSystemId); - - -void __RPC_STUB IVBSAXLocator_get_systemId_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXLocator_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXEntityResolver_INTERFACE_DEFINED__ -#define __IVBSAXEntityResolver_INTERFACE_DEFINED__ - -/* interface IVBSAXEntityResolver */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXEntityResolver; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0c05d096-f45b-4aca-ad1a-aa0bc25518dc") - IVBSAXEntityResolver : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE resolveEntity( - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [retval][out] */ VARIANT *varInput) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXEntityResolverVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXEntityResolver * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXEntityResolver * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXEntityResolver * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXEntityResolver * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXEntityResolver * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXEntityResolver * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXEntityResolver * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *resolveEntity )( - IVBSAXEntityResolver * This, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [retval][out] */ VARIANT *varInput); - - END_INTERFACE - } IVBSAXEntityResolverVtbl; - - interface IVBSAXEntityResolver - { - CONST_VTBL struct IVBSAXEntityResolverVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXEntityResolver_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXEntityResolver_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXEntityResolver_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXEntityResolver_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXEntityResolver_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXEntityResolver_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXEntityResolver_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXEntityResolver_resolveEntity(This,strPublicId,strSystemId,varInput) \ - (This)->lpVtbl -> resolveEntity(This,strPublicId,strSystemId,varInput) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXEntityResolver_resolveEntity_Proxy( - IVBSAXEntityResolver * This, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [retval][out] */ VARIANT *varInput); - - -void __RPC_STUB IVBSAXEntityResolver_resolveEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXEntityResolver_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXContentHandler_INTERFACE_DEFINED__ -#define __IVBSAXContentHandler_INTERFACE_DEFINED__ - -/* interface IVBSAXContentHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXContentHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2ed7290a-4dd5-4b46-bb26-4e4155e77faa") - IVBSAXContentHandler : public IDispatch - { - public: - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_documentLocator( - /* [in] */ IVBSAXLocator *oLocator) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startDocument( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endDocument( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startPrefixMapping( - /* [out][in] */ BSTR *strPrefix, - /* [out][in] */ BSTR *strURI) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endPrefixMapping( - /* [out][in] */ BSTR *strPrefix) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startElement( - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName, - /* [in] */ IVBSAXAttributes *oAttributes) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endElement( - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE characters( - /* [out][in] */ BSTR *strChars) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ignorableWhitespace( - /* [out][in] */ BSTR *strChars) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE processingInstruction( - /* [out][in] */ BSTR *strTarget, - /* [out][in] */ BSTR *strData) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE skippedEntity( - /* [out][in] */ BSTR *strName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXContentHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXContentHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXContentHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXContentHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXContentHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXContentHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXContentHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXContentHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_documentLocator )( - IVBSAXContentHandler * This, - /* [in] */ IVBSAXLocator *oLocator); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startDocument )( - IVBSAXContentHandler * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endDocument )( - IVBSAXContentHandler * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startPrefixMapping )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strPrefix, - /* [out][in] */ BSTR *strURI); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endPrefixMapping )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strPrefix); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startElement )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName, - /* [in] */ IVBSAXAttributes *oAttributes); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endElement )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *characters )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strChars); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ignorableWhitespace )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strChars); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *processingInstruction )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strTarget, - /* [out][in] */ BSTR *strData); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *skippedEntity )( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strName); - - END_INTERFACE - } IVBSAXContentHandlerVtbl; - - interface IVBSAXContentHandler - { - CONST_VTBL struct IVBSAXContentHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXContentHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXContentHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXContentHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXContentHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXContentHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXContentHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXContentHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXContentHandler_putref_documentLocator(This,oLocator) \ - (This)->lpVtbl -> putref_documentLocator(This,oLocator) - -#define IVBSAXContentHandler_startDocument(This) \ - (This)->lpVtbl -> startDocument(This) - -#define IVBSAXContentHandler_endDocument(This) \ - (This)->lpVtbl -> endDocument(This) - -#define IVBSAXContentHandler_startPrefixMapping(This,strPrefix,strURI) \ - (This)->lpVtbl -> startPrefixMapping(This,strPrefix,strURI) - -#define IVBSAXContentHandler_endPrefixMapping(This,strPrefix) \ - (This)->lpVtbl -> endPrefixMapping(This,strPrefix) - -#define IVBSAXContentHandler_startElement(This,strNamespaceURI,strLocalName,strQName,oAttributes) \ - (This)->lpVtbl -> startElement(This,strNamespaceURI,strLocalName,strQName,oAttributes) - -#define IVBSAXContentHandler_endElement(This,strNamespaceURI,strLocalName,strQName) \ - (This)->lpVtbl -> endElement(This,strNamespaceURI,strLocalName,strQName) - -#define IVBSAXContentHandler_characters(This,strChars) \ - (This)->lpVtbl -> characters(This,strChars) - -#define IVBSAXContentHandler_ignorableWhitespace(This,strChars) \ - (This)->lpVtbl -> ignorableWhitespace(This,strChars) - -#define IVBSAXContentHandler_processingInstruction(This,strTarget,strData) \ - (This)->lpVtbl -> processingInstruction(This,strTarget,strData) - -#define IVBSAXContentHandler_skippedEntity(This,strName) \ - (This)->lpVtbl -> skippedEntity(This,strName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_putref_documentLocator_Proxy( - IVBSAXContentHandler * This, - /* [in] */ IVBSAXLocator *oLocator); - - -void __RPC_STUB IVBSAXContentHandler_putref_documentLocator_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startDocument_Proxy( - IVBSAXContentHandler * This); - - -void __RPC_STUB IVBSAXContentHandler_startDocument_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endDocument_Proxy( - IVBSAXContentHandler * This); - - -void __RPC_STUB IVBSAXContentHandler_endDocument_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startPrefixMapping_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strPrefix, - /* [out][in] */ BSTR *strURI); - - -void __RPC_STUB IVBSAXContentHandler_startPrefixMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endPrefixMapping_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strPrefix); - - -void __RPC_STUB IVBSAXContentHandler_endPrefixMapping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_startElement_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName, - /* [in] */ IVBSAXAttributes *oAttributes); - - -void __RPC_STUB IVBSAXContentHandler_startElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_endElement_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strNamespaceURI, - /* [out][in] */ BSTR *strLocalName, - /* [out][in] */ BSTR *strQName); - - -void __RPC_STUB IVBSAXContentHandler_endElement_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_characters_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strChars); - - -void __RPC_STUB IVBSAXContentHandler_characters_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_ignorableWhitespace_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strChars); - - -void __RPC_STUB IVBSAXContentHandler_ignorableWhitespace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_processingInstruction_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strTarget, - /* [out][in] */ BSTR *strData); - - -void __RPC_STUB IVBSAXContentHandler_processingInstruction_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXContentHandler_skippedEntity_Proxy( - IVBSAXContentHandler * This, - /* [out][in] */ BSTR *strName); - - -void __RPC_STUB IVBSAXContentHandler_skippedEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXContentHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXDTDHandler_INTERFACE_DEFINED__ -#define __IVBSAXDTDHandler_INTERFACE_DEFINED__ - -/* interface IVBSAXDTDHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXDTDHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("24fb3297-302d-4620-ba39-3a732d850558") - IVBSAXDTDHandler : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE notationDecl( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE unparsedEntityDecl( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [out][in] */ BSTR *strNotationName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXDTDHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXDTDHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXDTDHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXDTDHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXDTDHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXDTDHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXDTDHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXDTDHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *notationDecl )( - IVBSAXDTDHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *unparsedEntityDecl )( - IVBSAXDTDHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [out][in] */ BSTR *strNotationName); - - END_INTERFACE - } IVBSAXDTDHandlerVtbl; - - interface IVBSAXDTDHandler - { - CONST_VTBL struct IVBSAXDTDHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXDTDHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXDTDHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXDTDHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXDTDHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXDTDHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXDTDHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXDTDHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXDTDHandler_notationDecl(This,strName,strPublicId,strSystemId) \ - (This)->lpVtbl -> notationDecl(This,strName,strPublicId,strSystemId) - -#define IVBSAXDTDHandler_unparsedEntityDecl(This,strName,strPublicId,strSystemId,strNotationName) \ - (This)->lpVtbl -> unparsedEntityDecl(This,strName,strPublicId,strSystemId,strNotationName) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDTDHandler_notationDecl_Proxy( - IVBSAXDTDHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - -void __RPC_STUB IVBSAXDTDHandler_notationDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDTDHandler_unparsedEntityDecl_Proxy( - IVBSAXDTDHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId, - /* [out][in] */ BSTR *strNotationName); - - -void __RPC_STUB IVBSAXDTDHandler_unparsedEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXDTDHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXErrorHandler_INTERFACE_DEFINED__ -#define __IVBSAXErrorHandler_INTERFACE_DEFINED__ - -/* interface IVBSAXErrorHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXErrorHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d963d3fe-173c-4862-9095-b92f66995f52") - IVBSAXErrorHandler : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE error( - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE fatalError( - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ignorableWarning( - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXErrorHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXErrorHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXErrorHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXErrorHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXErrorHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXErrorHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXErrorHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXErrorHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *error )( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *fatalError )( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ignorableWarning )( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - END_INTERFACE - } IVBSAXErrorHandlerVtbl; - - interface IVBSAXErrorHandler - { - CONST_VTBL struct IVBSAXErrorHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXErrorHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXErrorHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXErrorHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXErrorHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXErrorHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXErrorHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXErrorHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXErrorHandler_error(This,oLocator,strErrorMessage,nErrorCode) \ - (This)->lpVtbl -> error(This,oLocator,strErrorMessage,nErrorCode) - -#define IVBSAXErrorHandler_fatalError(This,oLocator,strErrorMessage,nErrorCode) \ - (This)->lpVtbl -> fatalError(This,oLocator,strErrorMessage,nErrorCode) - -#define IVBSAXErrorHandler_ignorableWarning(This,oLocator,strErrorMessage,nErrorCode) \ - (This)->lpVtbl -> ignorableWarning(This,oLocator,strErrorMessage,nErrorCode) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_error_Proxy( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - -void __RPC_STUB IVBSAXErrorHandler_error_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_fatalError_Proxy( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - -void __RPC_STUB IVBSAXErrorHandler_fatalError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXErrorHandler_ignorableWarning_Proxy( - IVBSAXErrorHandler * This, - /* [in] */ IVBSAXLocator *oLocator, - /* [out][in] */ BSTR *strErrorMessage, - /* [in] */ long nErrorCode); - - -void __RPC_STUB IVBSAXErrorHandler_ignorableWarning_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXErrorHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXLexicalHandler_INTERFACE_DEFINED__ -#define __IVBSAXLexicalHandler_INTERFACE_DEFINED__ - -/* interface IVBSAXLexicalHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXLexicalHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("032aac35-8c0e-4d9d-979f-e3b702935576") - IVBSAXLexicalHandler : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startDTD( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endDTD( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startEntity( - /* [out][in] */ BSTR *strName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endEntity( - /* [out][in] */ BSTR *strName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE startCDATA( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE endCDATA( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE comment( - /* [out][in] */ BSTR *strChars) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXLexicalHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXLexicalHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXLexicalHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXLexicalHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXLexicalHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXLexicalHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXLexicalHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXLexicalHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startDTD )( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endDTD )( - IVBSAXLexicalHandler * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startEntity )( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endEntity )( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *startCDATA )( - IVBSAXLexicalHandler * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *endCDATA )( - IVBSAXLexicalHandler * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *comment )( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strChars); - - END_INTERFACE - } IVBSAXLexicalHandlerVtbl; - - interface IVBSAXLexicalHandler - { - CONST_VTBL struct IVBSAXLexicalHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXLexicalHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXLexicalHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXLexicalHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXLexicalHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXLexicalHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXLexicalHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXLexicalHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXLexicalHandler_startDTD(This,strName,strPublicId,strSystemId) \ - (This)->lpVtbl -> startDTD(This,strName,strPublicId,strSystemId) - -#define IVBSAXLexicalHandler_endDTD(This) \ - (This)->lpVtbl -> endDTD(This) - -#define IVBSAXLexicalHandler_startEntity(This,strName) \ - (This)->lpVtbl -> startEntity(This,strName) - -#define IVBSAXLexicalHandler_endEntity(This,strName) \ - (This)->lpVtbl -> endEntity(This,strName) - -#define IVBSAXLexicalHandler_startCDATA(This) \ - (This)->lpVtbl -> startCDATA(This) - -#define IVBSAXLexicalHandler_endCDATA(This) \ - (This)->lpVtbl -> endCDATA(This) - -#define IVBSAXLexicalHandler_comment(This,strChars) \ - (This)->lpVtbl -> comment(This,strChars) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startDTD_Proxy( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - -void __RPC_STUB IVBSAXLexicalHandler_startDTD_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endDTD_Proxy( - IVBSAXLexicalHandler * This); - - -void __RPC_STUB IVBSAXLexicalHandler_endDTD_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startEntity_Proxy( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName); - - -void __RPC_STUB IVBSAXLexicalHandler_startEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endEntity_Proxy( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strName); - - -void __RPC_STUB IVBSAXLexicalHandler_endEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_startCDATA_Proxy( - IVBSAXLexicalHandler * This); - - -void __RPC_STUB IVBSAXLexicalHandler_startCDATA_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_endCDATA_Proxy( - IVBSAXLexicalHandler * This); - - -void __RPC_STUB IVBSAXLexicalHandler_endCDATA_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXLexicalHandler_comment_Proxy( - IVBSAXLexicalHandler * This, - /* [out][in] */ BSTR *strChars); - - -void __RPC_STUB IVBSAXLexicalHandler_comment_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXLexicalHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXDeclHandler_INTERFACE_DEFINED__ -#define __IVBSAXDeclHandler_INTERFACE_DEFINED__ - -/* interface IVBSAXDeclHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXDeclHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e8917260-7579-4be1-b5dd-7afbfa6f077b") - IVBSAXDeclHandler : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE elementDecl( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strModel) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE attributeDecl( - /* [out][in] */ BSTR *strElementName, - /* [out][in] */ BSTR *strAttributeName, - /* [out][in] */ BSTR *strType, - /* [out][in] */ BSTR *strValueDefault, - /* [out][in] */ BSTR *strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE internalEntityDecl( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE externalEntityDecl( - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXDeclHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXDeclHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXDeclHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXDeclHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXDeclHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXDeclHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXDeclHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXDeclHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *elementDecl )( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strModel); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *attributeDecl )( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strElementName, - /* [out][in] */ BSTR *strAttributeName, - /* [out][in] */ BSTR *strType, - /* [out][in] */ BSTR *strValueDefault, - /* [out][in] */ BSTR *strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *internalEntityDecl )( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *externalEntityDecl )( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - END_INTERFACE - } IVBSAXDeclHandlerVtbl; - - interface IVBSAXDeclHandler - { - CONST_VTBL struct IVBSAXDeclHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXDeclHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXDeclHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXDeclHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXDeclHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXDeclHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXDeclHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXDeclHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXDeclHandler_elementDecl(This,strName,strModel) \ - (This)->lpVtbl -> elementDecl(This,strName,strModel) - -#define IVBSAXDeclHandler_attributeDecl(This,strElementName,strAttributeName,strType,strValueDefault,strValue) \ - (This)->lpVtbl -> attributeDecl(This,strElementName,strAttributeName,strType,strValueDefault,strValue) - -#define IVBSAXDeclHandler_internalEntityDecl(This,strName,strValue) \ - (This)->lpVtbl -> internalEntityDecl(This,strName,strValue) - -#define IVBSAXDeclHandler_externalEntityDecl(This,strName,strPublicId,strSystemId) \ - (This)->lpVtbl -> externalEntityDecl(This,strName,strPublicId,strSystemId) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_elementDecl_Proxy( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strModel); - - -void __RPC_STUB IVBSAXDeclHandler_elementDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_attributeDecl_Proxy( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strElementName, - /* [out][in] */ BSTR *strAttributeName, - /* [out][in] */ BSTR *strType, - /* [out][in] */ BSTR *strValueDefault, - /* [out][in] */ BSTR *strValue); - - -void __RPC_STUB IVBSAXDeclHandler_attributeDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_internalEntityDecl_Proxy( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strValue); - - -void __RPC_STUB IVBSAXDeclHandler_internalEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXDeclHandler_externalEntityDecl_Proxy( - IVBSAXDeclHandler * This, - /* [out][in] */ BSTR *strName, - /* [out][in] */ BSTR *strPublicId, - /* [out][in] */ BSTR *strSystemId); - - -void __RPC_STUB IVBSAXDeclHandler_externalEntityDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXDeclHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IVBSAXAttributes_INTERFACE_DEFINED__ -#define __IVBSAXAttributes_INTERFACE_DEFINED__ - -/* interface IVBSAXAttributes */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IVBSAXAttributes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("10dc0586-132b-4cac-8bb3-db00ac8b7ee0") - IVBSAXAttributes : public IDispatch - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ int *nLength) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getURI( - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strURI) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getLocalName( - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strLocalName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getQName( - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strQName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getIndexFromName( - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ int *nIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getIndexFromQName( - /* [in] */ BSTR strQName, - /* [retval][out] */ int *nIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getType( - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getTypeFromName( - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getTypeFromQName( - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValue( - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValueFromName( - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getValueFromQName( - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBSAXAttributesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBSAXAttributes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBSAXAttributes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBSAXAttributes * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBSAXAttributes * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBSAXAttributes * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBSAXAttributes * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBSAXAttributes * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IVBSAXAttributes * This, - /* [retval][out] */ int *nLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getURI )( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strURI); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getLocalName )( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strLocalName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getQName )( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strQName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getIndexFromName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ int *nIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getIndexFromQName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ int *nIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getType )( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getTypeFromName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getTypeFromQName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValue )( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValueFromName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getValueFromQName )( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strValue); - - END_INTERFACE - } IVBSAXAttributesVtbl; - - interface IVBSAXAttributes - { - CONST_VTBL struct IVBSAXAttributesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBSAXAttributes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBSAXAttributes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBSAXAttributes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBSAXAttributes_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBSAXAttributes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBSAXAttributes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBSAXAttributes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBSAXAttributes_get_length(This,nLength) \ - (This)->lpVtbl -> get_length(This,nLength) - -#define IVBSAXAttributes_getURI(This,nIndex,strURI) \ - (This)->lpVtbl -> getURI(This,nIndex,strURI) - -#define IVBSAXAttributes_getLocalName(This,nIndex,strLocalName) \ - (This)->lpVtbl -> getLocalName(This,nIndex,strLocalName) - -#define IVBSAXAttributes_getQName(This,nIndex,strQName) \ - (This)->lpVtbl -> getQName(This,nIndex,strQName) - -#define IVBSAXAttributes_getIndexFromName(This,strURI,strLocalName,nIndex) \ - (This)->lpVtbl -> getIndexFromName(This,strURI,strLocalName,nIndex) - -#define IVBSAXAttributes_getIndexFromQName(This,strQName,nIndex) \ - (This)->lpVtbl -> getIndexFromQName(This,strQName,nIndex) - -#define IVBSAXAttributes_getType(This,nIndex,strType) \ - (This)->lpVtbl -> getType(This,nIndex,strType) - -#define IVBSAXAttributes_getTypeFromName(This,strURI,strLocalName,strType) \ - (This)->lpVtbl -> getTypeFromName(This,strURI,strLocalName,strType) - -#define IVBSAXAttributes_getTypeFromQName(This,strQName,strType) \ - (This)->lpVtbl -> getTypeFromQName(This,strQName,strType) - -#define IVBSAXAttributes_getValue(This,nIndex,strValue) \ - (This)->lpVtbl -> getValue(This,nIndex,strValue) - -#define IVBSAXAttributes_getValueFromName(This,strURI,strLocalName,strValue) \ - (This)->lpVtbl -> getValueFromName(This,strURI,strLocalName,strValue) - -#define IVBSAXAttributes_getValueFromQName(This,strQName,strValue) \ - (This)->lpVtbl -> getValueFromQName(This,strQName,strValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_get_length_Proxy( - IVBSAXAttributes * This, - /* [retval][out] */ int *nLength); - - -void __RPC_STUB IVBSAXAttributes_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getURI_Proxy( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strURI); - - -void __RPC_STUB IVBSAXAttributes_getURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getLocalName_Proxy( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strLocalName); - - -void __RPC_STUB IVBSAXAttributes_getLocalName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getQName_Proxy( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strQName); - - -void __RPC_STUB IVBSAXAttributes_getQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getIndexFromName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ int *nIndex); - - -void __RPC_STUB IVBSAXAttributes_getIndexFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getIndexFromQName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ int *nIndex); - - -void __RPC_STUB IVBSAXAttributes_getIndexFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getType_Proxy( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strType); - - -void __RPC_STUB IVBSAXAttributes_getType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getTypeFromName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strType); - - -void __RPC_STUB IVBSAXAttributes_getTypeFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getTypeFromQName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strType); - - -void __RPC_STUB IVBSAXAttributes_getTypeFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValue_Proxy( - IVBSAXAttributes * This, - /* [in] */ int nIndex, - /* [retval][out] */ BSTR *strValue); - - -void __RPC_STUB IVBSAXAttributes_getValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValueFromName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [retval][out] */ BSTR *strValue); - - -void __RPC_STUB IVBSAXAttributes_getValueFromName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IVBSAXAttributes_getValueFromQName_Proxy( - IVBSAXAttributes * This, - /* [in] */ BSTR strQName, - /* [retval][out] */ BSTR *strValue); - - -void __RPC_STUB IVBSAXAttributes_getValueFromQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBSAXAttributes_INTERFACE_DEFINED__ */ - - -#ifndef __IMXWriter_INTERFACE_DEFINED__ -#define __IMXWriter_INTERFACE_DEFINED__ - -/* interface IMXWriter */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IMXWriter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4d7ff4ba-1565-4ea8-94e1-6e724a46f98d") - IMXWriter : public IDispatch - { - public: - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_output( - /* [in] */ VARIANT varDestination) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_output( - /* [retval][out] */ VARIANT *varDestination) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_encoding( - /* [in] */ BSTR strEncoding) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_encoding( - /* [retval][out] */ BSTR *strEncoding) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_byteOrderMark( - /* [in] */ VARIANT_BOOL fWriteByteOrderMark) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_byteOrderMark( - /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_indent( - /* [in] */ VARIANT_BOOL fIndentMode) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_indent( - /* [retval][out] */ VARIANT_BOOL *fIndentMode) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_standalone( - /* [in] */ VARIANT_BOOL fValue) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_standalone( - /* [retval][out] */ VARIANT_BOOL *fValue) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_omitXMLDeclaration( - /* [in] */ VARIANT_BOOL fValue) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_omitXMLDeclaration( - /* [retval][out] */ VARIANT_BOOL *fValue) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_version( - /* [in] */ BSTR strVersion) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_version( - /* [retval][out] */ BSTR *strVersion) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_disableOutputEscaping( - /* [in] */ VARIANT_BOOL fValue) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_disableOutputEscaping( - /* [retval][out] */ VARIANT_BOOL *fValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE flush( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXWriterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXWriter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXWriter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXWriter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXWriter * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXWriter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXWriter * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXWriter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_output )( - IMXWriter * This, - /* [in] */ VARIANT varDestination); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_output )( - IMXWriter * This, - /* [retval][out] */ VARIANT *varDestination); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_encoding )( - IMXWriter * This, - /* [in] */ BSTR strEncoding); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_encoding )( - IMXWriter * This, - /* [retval][out] */ BSTR *strEncoding); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_byteOrderMark )( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fWriteByteOrderMark); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_byteOrderMark )( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_indent )( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fIndentMode); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_indent )( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fIndentMode); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_standalone )( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_standalone )( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_omitXMLDeclaration )( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_omitXMLDeclaration )( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_version )( - IMXWriter * This, - /* [in] */ BSTR strVersion); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_version )( - IMXWriter * This, - /* [retval][out] */ BSTR *strVersion); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_disableOutputEscaping )( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_disableOutputEscaping )( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *flush )( - IMXWriter * This); - - END_INTERFACE - } IMXWriterVtbl; - - interface IMXWriter - { - CONST_VTBL struct IMXWriterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXWriter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXWriter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXWriter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXWriter_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXWriter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXWriter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXWriter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXWriter_put_output(This,varDestination) \ - (This)->lpVtbl -> put_output(This,varDestination) - -#define IMXWriter_get_output(This,varDestination) \ - (This)->lpVtbl -> get_output(This,varDestination) - -#define IMXWriter_put_encoding(This,strEncoding) \ - (This)->lpVtbl -> put_encoding(This,strEncoding) - -#define IMXWriter_get_encoding(This,strEncoding) \ - (This)->lpVtbl -> get_encoding(This,strEncoding) - -#define IMXWriter_put_byteOrderMark(This,fWriteByteOrderMark) \ - (This)->lpVtbl -> put_byteOrderMark(This,fWriteByteOrderMark) - -#define IMXWriter_get_byteOrderMark(This,fWriteByteOrderMark) \ - (This)->lpVtbl -> get_byteOrderMark(This,fWriteByteOrderMark) - -#define IMXWriter_put_indent(This,fIndentMode) \ - (This)->lpVtbl -> put_indent(This,fIndentMode) - -#define IMXWriter_get_indent(This,fIndentMode) \ - (This)->lpVtbl -> get_indent(This,fIndentMode) - -#define IMXWriter_put_standalone(This,fValue) \ - (This)->lpVtbl -> put_standalone(This,fValue) - -#define IMXWriter_get_standalone(This,fValue) \ - (This)->lpVtbl -> get_standalone(This,fValue) - -#define IMXWriter_put_omitXMLDeclaration(This,fValue) \ - (This)->lpVtbl -> put_omitXMLDeclaration(This,fValue) - -#define IMXWriter_get_omitXMLDeclaration(This,fValue) \ - (This)->lpVtbl -> get_omitXMLDeclaration(This,fValue) - -#define IMXWriter_put_version(This,strVersion) \ - (This)->lpVtbl -> put_version(This,strVersion) - -#define IMXWriter_get_version(This,strVersion) \ - (This)->lpVtbl -> get_version(This,strVersion) - -#define IMXWriter_put_disableOutputEscaping(This,fValue) \ - (This)->lpVtbl -> put_disableOutputEscaping(This,fValue) - -#define IMXWriter_get_disableOutputEscaping(This,fValue) \ - (This)->lpVtbl -> get_disableOutputEscaping(This,fValue) - -#define IMXWriter_flush(This) \ - (This)->lpVtbl -> flush(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_output_Proxy( - IMXWriter * This, - /* [in] */ VARIANT varDestination); - - -void __RPC_STUB IMXWriter_put_output_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_output_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT *varDestination); - - -void __RPC_STUB IMXWriter_get_output_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_encoding_Proxy( - IMXWriter * This, - /* [in] */ BSTR strEncoding); - - -void __RPC_STUB IMXWriter_put_encoding_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_encoding_Proxy( - IMXWriter * This, - /* [retval][out] */ BSTR *strEncoding); - - -void __RPC_STUB IMXWriter_get_encoding_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_byteOrderMark_Proxy( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fWriteByteOrderMark); - - -void __RPC_STUB IMXWriter_put_byteOrderMark_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_byteOrderMark_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fWriteByteOrderMark); - - -void __RPC_STUB IMXWriter_get_byteOrderMark_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_indent_Proxy( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fIndentMode); - - -void __RPC_STUB IMXWriter_put_indent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_indent_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fIndentMode); - - -void __RPC_STUB IMXWriter_get_indent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_standalone_Proxy( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - -void __RPC_STUB IMXWriter_put_standalone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_standalone_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - -void __RPC_STUB IMXWriter_get_standalone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_omitXMLDeclaration_Proxy( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - -void __RPC_STUB IMXWriter_put_omitXMLDeclaration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_omitXMLDeclaration_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - -void __RPC_STUB IMXWriter_get_omitXMLDeclaration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_version_Proxy( - IMXWriter * This, - /* [in] */ BSTR strVersion); - - -void __RPC_STUB IMXWriter_put_version_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_version_Proxy( - IMXWriter * This, - /* [retval][out] */ BSTR *strVersion); - - -void __RPC_STUB IMXWriter_get_version_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IMXWriter_put_disableOutputEscaping_Proxy( - IMXWriter * This, - /* [in] */ VARIANT_BOOL fValue); - - -void __RPC_STUB IMXWriter_put_disableOutputEscaping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IMXWriter_get_disableOutputEscaping_Proxy( - IMXWriter * This, - /* [retval][out] */ VARIANT_BOOL *fValue); - - -void __RPC_STUB IMXWriter_get_disableOutputEscaping_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXWriter_flush_Proxy( - IMXWriter * This); - - -void __RPC_STUB IMXWriter_flush_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXWriter_INTERFACE_DEFINED__ */ - - -#ifndef __IMXAttributes_INTERFACE_DEFINED__ -#define __IMXAttributes_INTERFACE_DEFINED__ - -/* interface IMXAttributes */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IMXAttributes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("f10d27cc-3ec0-415c-8ed8-77ab1c5e7262") - IMXAttributes : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addAttribute( - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addAttributeFromIndex( - /* [in] */ VARIANT varAtts, - /* [in] */ int nIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE clear( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAttribute( - /* [in] */ int nIndex) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttribute( - /* [in] */ int nIndex, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setAttributes( - /* [in] */ VARIANT varAtts) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setLocalName( - /* [in] */ int nIndex, - /* [in] */ BSTR strLocalName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setQName( - /* [in] */ int nIndex, - /* [in] */ BSTR strQName) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setType( - /* [in] */ int nIndex, - /* [in] */ BSTR strType) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setURI( - /* [in] */ int nIndex, - /* [in] */ BSTR strURI) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setValue( - /* [in] */ int nIndex, - /* [in] */ BSTR strValue) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXAttributesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXAttributes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXAttributes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXAttributes * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXAttributes * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXAttributes * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXAttributes * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXAttributes * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addAttribute )( - IMXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addAttributeFromIndex )( - IMXAttributes * This, - /* [in] */ VARIANT varAtts, - /* [in] */ int nIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *clear )( - IMXAttributes * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAttribute )( - IMXAttributes * This, - /* [in] */ int nIndex); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttribute )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setAttributes )( - IMXAttributes * This, - /* [in] */ VARIANT varAtts); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setLocalName )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strLocalName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setQName )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strQName); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setType )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strType); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setURI )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strURI); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setValue )( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strValue); - - END_INTERFACE - } IMXAttributesVtbl; - - interface IMXAttributes - { - CONST_VTBL struct IMXAttributesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXAttributes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXAttributes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXAttributes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXAttributes_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXAttributes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXAttributes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXAttributes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXAttributes_addAttribute(This,strURI,strLocalName,strQName,strType,strValue) \ - (This)->lpVtbl -> addAttribute(This,strURI,strLocalName,strQName,strType,strValue) - -#define IMXAttributes_addAttributeFromIndex(This,varAtts,nIndex) \ - (This)->lpVtbl -> addAttributeFromIndex(This,varAtts,nIndex) - -#define IMXAttributes_clear(This) \ - (This)->lpVtbl -> clear(This) - -#define IMXAttributes_removeAttribute(This,nIndex) \ - (This)->lpVtbl -> removeAttribute(This,nIndex) - -#define IMXAttributes_setAttribute(This,nIndex,strURI,strLocalName,strQName,strType,strValue) \ - (This)->lpVtbl -> setAttribute(This,nIndex,strURI,strLocalName,strQName,strType,strValue) - -#define IMXAttributes_setAttributes(This,varAtts) \ - (This)->lpVtbl -> setAttributes(This,varAtts) - -#define IMXAttributes_setLocalName(This,nIndex,strLocalName) \ - (This)->lpVtbl -> setLocalName(This,nIndex,strLocalName) - -#define IMXAttributes_setQName(This,nIndex,strQName) \ - (This)->lpVtbl -> setQName(This,nIndex,strQName) - -#define IMXAttributes_setType(This,nIndex,strType) \ - (This)->lpVtbl -> setType(This,nIndex,strType) - -#define IMXAttributes_setURI(This,nIndex,strURI) \ - (This)->lpVtbl -> setURI(This,nIndex,strURI) - -#define IMXAttributes_setValue(This,nIndex,strValue) \ - (This)->lpVtbl -> setValue(This,nIndex,strValue) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_addAttribute_Proxy( - IMXAttributes * This, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue); - - -void __RPC_STUB IMXAttributes_addAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_addAttributeFromIndex_Proxy( - IMXAttributes * This, - /* [in] */ VARIANT varAtts, - /* [in] */ int nIndex); - - -void __RPC_STUB IMXAttributes_addAttributeFromIndex_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_clear_Proxy( - IMXAttributes * This); - - -void __RPC_STUB IMXAttributes_clear_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_removeAttribute_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex); - - -void __RPC_STUB IMXAttributes_removeAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setAttribute_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strURI, - /* [in] */ BSTR strLocalName, - /* [in] */ BSTR strQName, - /* [in] */ BSTR strType, - /* [in] */ BSTR strValue); - - -void __RPC_STUB IMXAttributes_setAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setAttributes_Proxy( - IMXAttributes * This, - /* [in] */ VARIANT varAtts); - - -void __RPC_STUB IMXAttributes_setAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setLocalName_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strLocalName); - - -void __RPC_STUB IMXAttributes_setLocalName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setQName_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strQName); - - -void __RPC_STUB IMXAttributes_setQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setType_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strType); - - -void __RPC_STUB IMXAttributes_setType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setURI_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strURI); - - -void __RPC_STUB IMXAttributes_setURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXAttributes_setValue_Proxy( - IMXAttributes * This, - /* [in] */ int nIndex, - /* [in] */ BSTR strValue); - - -void __RPC_STUB IMXAttributes_setValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXAttributes_INTERFACE_DEFINED__ */ - - -#ifndef __IMXReaderControl_INTERFACE_DEFINED__ -#define __IMXReaderControl_INTERFACE_DEFINED__ - -/* interface IMXReaderControl */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IMXReaderControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("808f4e35-8d5a-4fbe-8466-33a41279ed30") - IMXReaderControl : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE resume( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE suspend( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXReaderControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXReaderControl * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXReaderControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXReaderControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXReaderControl * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXReaderControl * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXReaderControl * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXReaderControl * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IMXReaderControl * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *resume )( - IMXReaderControl * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *suspend )( - IMXReaderControl * This); - - END_INTERFACE - } IMXReaderControlVtbl; - - interface IMXReaderControl - { - CONST_VTBL struct IMXReaderControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXReaderControl_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXReaderControl_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXReaderControl_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXReaderControl_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXReaderControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXReaderControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXReaderControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXReaderControl_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IMXReaderControl_resume(This) \ - (This)->lpVtbl -> resume(This) - -#define IMXReaderControl_suspend(This) \ - (This)->lpVtbl -> suspend(This) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_abort_Proxy( - IMXReaderControl * This); - - -void __RPC_STUB IMXReaderControl_abort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_resume_Proxy( - IMXReaderControl * This); - - -void __RPC_STUB IMXReaderControl_resume_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXReaderControl_suspend_Proxy( - IMXReaderControl * This); - - -void __RPC_STUB IMXReaderControl_suspend_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXReaderControl_INTERFACE_DEFINED__ */ - - -#ifndef __IMXSchemaDeclHandler_INTERFACE_DEFINED__ -#define __IMXSchemaDeclHandler_INTERFACE_DEFINED__ - -/* interface IMXSchemaDeclHandler */ -/* [unique][helpstring][uuid][nonextensible][oleautomation][dual][local][object] */ - - -EXTERN_C const IID IID_IMXSchemaDeclHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("fa4bb38c-faf9-4cca-9302-d1dd0fe520db") - IMXSchemaDeclHandler : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE schemaElementDecl( - /* [in] */ ISchemaElement *oSchemaElement) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXSchemaDeclHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXSchemaDeclHandler * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXSchemaDeclHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXSchemaDeclHandler * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXSchemaDeclHandler * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXSchemaDeclHandler * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXSchemaDeclHandler * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXSchemaDeclHandler * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *schemaElementDecl )( - IMXSchemaDeclHandler * This, - /* [in] */ ISchemaElement *oSchemaElement); - - END_INTERFACE - } IMXSchemaDeclHandlerVtbl; - - interface IMXSchemaDeclHandler - { - CONST_VTBL struct IMXSchemaDeclHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXSchemaDeclHandler_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXSchemaDeclHandler_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXSchemaDeclHandler_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXSchemaDeclHandler_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXSchemaDeclHandler_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXSchemaDeclHandler_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXSchemaDeclHandler_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXSchemaDeclHandler_schemaElementDecl(This,oSchemaElement) \ - (This)->lpVtbl -> schemaElementDecl(This,oSchemaElement) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IMXSchemaDeclHandler_schemaElementDecl_Proxy( - IMXSchemaDeclHandler * This, - /* [in] */ ISchemaElement *oSchemaElement); - - -void __RPC_STUB IMXSchemaDeclHandler_schemaElementDecl_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXSchemaDeclHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IMXXMLFilter_INTERFACE_DEFINED__ -#define __IMXXMLFilter_INTERFACE_DEFINED__ - -/* interface IMXXMLFilter */ -/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ - - -EXTERN_C const IID IID_IMXXMLFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c90352f7-643c-4fbc-bb23-e996eb2d51fd") - IMXXMLFilter : public IDispatch - { - public: - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getFeature( - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE putFeature( - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getProperty( - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE putProperty( - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_entityResolver( - /* [retval][out] */ IUnknown **oResolver) = 0; - - virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_entityResolver( - /* [in] */ IUnknown *oResolver) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentHandler( - /* [retval][out] */ IUnknown **oHandler) = 0; - - virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_contentHandler( - /* [in] */ IUnknown *oHandler) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_dtdHandler( - /* [retval][out] */ IUnknown **oHandler) = 0; - - virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_dtdHandler( - /* [in] */ IUnknown *oHandler) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_errorHandler( - /* [retval][out] */ IUnknown **oHandler) = 0; - - virtual /* [propputref][id] */ HRESULT STDMETHODCALLTYPE putref_errorHandler( - /* [in] */ IUnknown *oHandler) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXXMLFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXXMLFilter * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXXMLFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXXMLFilter * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXXMLFilter * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXXMLFilter * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXXMLFilter * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXXMLFilter * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getFeature )( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *putFeature )( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *putProperty )( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_entityResolver )( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oResolver); - - /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_entityResolver )( - IMXXMLFilter * This, - /* [in] */ IUnknown *oResolver); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentHandler )( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_contentHandler )( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_dtdHandler )( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_dtdHandler )( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_errorHandler )( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - /* [propputref][id] */ HRESULT ( STDMETHODCALLTYPE *putref_errorHandler )( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - END_INTERFACE - } IMXXMLFilterVtbl; - - interface IMXXMLFilter - { - CONST_VTBL struct IMXXMLFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXXMLFilter_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXXMLFilter_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXXMLFilter_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXXMLFilter_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXXMLFilter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXXMLFilter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXXMLFilter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXXMLFilter_getFeature(This,strName,fValue) \ - (This)->lpVtbl -> getFeature(This,strName,fValue) - -#define IMXXMLFilter_putFeature(This,strName,fValue) \ - (This)->lpVtbl -> putFeature(This,strName,fValue) - -#define IMXXMLFilter_getProperty(This,strName,varValue) \ - (This)->lpVtbl -> getProperty(This,strName,varValue) - -#define IMXXMLFilter_putProperty(This,strName,varValue) \ - (This)->lpVtbl -> putProperty(This,strName,varValue) - -#define IMXXMLFilter_get_entityResolver(This,oResolver) \ - (This)->lpVtbl -> get_entityResolver(This,oResolver) - -#define IMXXMLFilter_putref_entityResolver(This,oResolver) \ - (This)->lpVtbl -> putref_entityResolver(This,oResolver) - -#define IMXXMLFilter_get_contentHandler(This,oHandler) \ - (This)->lpVtbl -> get_contentHandler(This,oHandler) - -#define IMXXMLFilter_putref_contentHandler(This,oHandler) \ - (This)->lpVtbl -> putref_contentHandler(This,oHandler) - -#define IMXXMLFilter_get_dtdHandler(This,oHandler) \ - (This)->lpVtbl -> get_dtdHandler(This,oHandler) - -#define IMXXMLFilter_putref_dtdHandler(This,oHandler) \ - (This)->lpVtbl -> putref_dtdHandler(This,oHandler) - -#define IMXXMLFilter_get_errorHandler(This,oHandler) \ - (This)->lpVtbl -> get_errorHandler(This,oHandler) - -#define IMXXMLFilter_putref_errorHandler(This,oHandler) \ - (This)->lpVtbl -> putref_errorHandler(This,oHandler) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_getFeature_Proxy( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT_BOOL *fValue); - - -void __RPC_STUB IMXXMLFilter_getFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putFeature_Proxy( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT_BOOL fValue); - - -void __RPC_STUB IMXXMLFilter_putFeature_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_getProperty_Proxy( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [retval][out] */ VARIANT *varValue); - - -void __RPC_STUB IMXXMLFilter_getProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putProperty_Proxy( - IMXXMLFilter * This, - /* [in] */ BSTR strName, - /* [in] */ VARIANT varValue); - - -void __RPC_STUB IMXXMLFilter_putProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_entityResolver_Proxy( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oResolver); - - -void __RPC_STUB IMXXMLFilter_get_entityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_entityResolver_Proxy( - IMXXMLFilter * This, - /* [in] */ IUnknown *oResolver); - - -void __RPC_STUB IMXXMLFilter_putref_entityResolver_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_contentHandler_Proxy( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - -void __RPC_STUB IMXXMLFilter_get_contentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_contentHandler_Proxy( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - -void __RPC_STUB IMXXMLFilter_putref_contentHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_dtdHandler_Proxy( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - -void __RPC_STUB IMXXMLFilter_get_dtdHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_dtdHandler_Proxy( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - -void __RPC_STUB IMXXMLFilter_putref_dtdHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_get_errorHandler_Proxy( - IMXXMLFilter * This, - /* [retval][out] */ IUnknown **oHandler); - - -void __RPC_STUB IMXXMLFilter_get_errorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propputref][id] */ HRESULT STDMETHODCALLTYPE IMXXMLFilter_putref_errorHandler_Proxy( - IMXXMLFilter * This, - /* [in] */ IUnknown *oHandler); - - -void __RPC_STUB IMXXMLFilter_putref_errorHandler_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXXMLFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ -#define __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ - -/* interface IXMLDOMSchemaCollection2 */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMSchemaCollection2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b0-dd1b-4664-9a50-c2f40f4bd79a") - IXMLDOMSchemaCollection2 : public IXMLDOMSchemaCollection - { - public: - virtual /* [id] */ HRESULT STDMETHODCALLTYPE validate( void) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_validateOnLoad( - /* [in] */ VARIANT_BOOL validateOnLoad) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_validateOnLoad( - /* [retval][out] */ VARIANT_BOOL *validateOnLoad) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getSchema( - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchema **schema) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getDeclaration( - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ ISchemaItem **item) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMSchemaCollection2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMSchemaCollection2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMSchemaCollection2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMSchemaCollection2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *add )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ BSTR namespaceURI, - /* [in] */ VARIANT var); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IXMLDOMNode **schemaNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *remove )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ BSTR namespaceURI); - - /* [propget][helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMSchemaCollection2 * This, - /* [retval][out] */ long *length); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *length); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *addCollection )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ IXMLDOMSchemaCollection *otherCollection); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMSchemaCollection2 * This, - /* [out][retval] */ IUnknown **ppUnk); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *validate )( - IXMLDOMSchemaCollection2 * This); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_validateOnLoad )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ VARIANT_BOOL validateOnLoad); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_validateOnLoad )( - IXMLDOMSchemaCollection2 * This, - /* [retval][out] */ VARIANT_BOOL *validateOnLoad); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getSchema )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchema **schema); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getDeclaration )( - IXMLDOMSchemaCollection2 * This, - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ ISchemaItem **item); - - END_INTERFACE - } IXMLDOMSchemaCollection2Vtbl; - - interface IXMLDOMSchemaCollection2 - { - CONST_VTBL struct IXMLDOMSchemaCollection2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMSchemaCollection2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMSchemaCollection2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMSchemaCollection2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMSchemaCollection2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMSchemaCollection2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMSchemaCollection2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMSchemaCollection2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMSchemaCollection2_add(This,namespaceURI,var) \ - (This)->lpVtbl -> add(This,namespaceURI,var) - -#define IXMLDOMSchemaCollection2_get(This,namespaceURI,schemaNode) \ - (This)->lpVtbl -> get(This,namespaceURI,schemaNode) - -#define IXMLDOMSchemaCollection2_remove(This,namespaceURI) \ - (This)->lpVtbl -> remove(This,namespaceURI) - -#define IXMLDOMSchemaCollection2_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define IXMLDOMSchemaCollection2_get_namespaceURI(This,index,length) \ - (This)->lpVtbl -> get_namespaceURI(This,index,length) - -#define IXMLDOMSchemaCollection2_addCollection(This,otherCollection) \ - (This)->lpVtbl -> addCollection(This,otherCollection) - -#define IXMLDOMSchemaCollection2_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - - -#define IXMLDOMSchemaCollection2_validate(This) \ - (This)->lpVtbl -> validate(This) - -#define IXMLDOMSchemaCollection2_put_validateOnLoad(This,validateOnLoad) \ - (This)->lpVtbl -> put_validateOnLoad(This,validateOnLoad) - -#define IXMLDOMSchemaCollection2_get_validateOnLoad(This,validateOnLoad) \ - (This)->lpVtbl -> get_validateOnLoad(This,validateOnLoad) - -#define IXMLDOMSchemaCollection2_getSchema(This,namespaceURI,schema) \ - (This)->lpVtbl -> getSchema(This,namespaceURI,schema) - -#define IXMLDOMSchemaCollection2_getDeclaration(This,node,item) \ - (This)->lpVtbl -> getDeclaration(This,node,item) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_validate_Proxy( - IXMLDOMSchemaCollection2 * This); - - -void __RPC_STUB IXMLDOMSchemaCollection2_validate_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_put_validateOnLoad_Proxy( - IXMLDOMSchemaCollection2 * This, - /* [in] */ VARIANT_BOOL validateOnLoad); - - -void __RPC_STUB IXMLDOMSchemaCollection2_put_validateOnLoad_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_get_validateOnLoad_Proxy( - IXMLDOMSchemaCollection2 * This, - /* [retval][out] */ VARIANT_BOOL *validateOnLoad); - - -void __RPC_STUB IXMLDOMSchemaCollection2_get_validateOnLoad_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_getSchema_Proxy( - IXMLDOMSchemaCollection2 * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchema **schema); - - -void __RPC_STUB IXMLDOMSchemaCollection2_getSchema_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSchemaCollection2_getDeclaration_Proxy( - IXMLDOMSchemaCollection2 * This, - /* [in] */ IXMLDOMNode *node, - /* [retval][out] */ ISchemaItem **item); - - -void __RPC_STUB IXMLDOMSchemaCollection2_getDeclaration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMSchemaCollection2_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaStringCollection_INTERFACE_DEFINED__ -#define __ISchemaStringCollection_INTERFACE_DEFINED__ - -/* interface ISchemaStringCollection */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaStringCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b1-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaStringCollection : public IDispatch - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ BSTR *bstr) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *length) = 0; - - virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [retval][out] */ IUnknown **ppunk) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaStringCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaStringCollection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaStringCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaStringCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaStringCollection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaStringCollection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaStringCollection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaStringCollection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - ISchemaStringCollection * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *bstr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - ISchemaStringCollection * This, - /* [retval][out] */ long *length); - - /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - ISchemaStringCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - END_INTERFACE - } ISchemaStringCollectionVtbl; - - interface ISchemaStringCollection - { - CONST_VTBL struct ISchemaStringCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaStringCollection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaStringCollection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaStringCollection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaStringCollection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaStringCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaStringCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaStringCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaStringCollection_get_item(This,index,bstr) \ - (This)->lpVtbl -> get_item(This,index,bstr) - -#define ISchemaStringCollection_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define ISchemaStringCollection_get__newEnum(This,ppunk) \ - (This)->lpVtbl -> get__newEnum(This,ppunk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get_item_Proxy( - ISchemaStringCollection * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *bstr); - - -void __RPC_STUB ISchemaStringCollection_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get_length_Proxy( - ISchemaStringCollection * This, - /* [retval][out] */ long *length); - - -void __RPC_STUB ISchemaStringCollection_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ISchemaStringCollection_get__newEnum_Proxy( - ISchemaStringCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - -void __RPC_STUB ISchemaStringCollection_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaStringCollection_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaItemCollection_INTERFACE_DEFINED__ -#define __ISchemaItemCollection_INTERFACE_DEFINED__ - -/* interface ISchemaItemCollection */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaItemCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b2-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaItemCollection : public IDispatch - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ ISchemaItem **item) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE itemByName( - /* [in] */ BSTR name, - /* [retval][out] */ ISchemaItem **item) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE itemByQName( - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchemaItem **item) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *length) = 0; - - virtual /* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [retval][out] */ IUnknown **ppunk) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaItemCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaItemCollection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaItemCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaItemCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaItemCollection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaItemCollection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaItemCollection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaItemCollection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - ISchemaItemCollection * This, - /* [in] */ long index, - /* [retval][out] */ ISchemaItem **item); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *itemByName )( - ISchemaItemCollection * This, - /* [in] */ BSTR name, - /* [retval][out] */ ISchemaItem **item); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *itemByQName )( - ISchemaItemCollection * This, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchemaItem **item); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - ISchemaItemCollection * This, - /* [retval][out] */ long *length); - - /* [propget][restricted][hidden][id] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - ISchemaItemCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - END_INTERFACE - } ISchemaItemCollectionVtbl; - - interface ISchemaItemCollection - { - CONST_VTBL struct ISchemaItemCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaItemCollection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaItemCollection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaItemCollection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaItemCollection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaItemCollection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaItemCollection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaItemCollection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaItemCollection_get_item(This,index,item) \ - (This)->lpVtbl -> get_item(This,index,item) - -#define ISchemaItemCollection_itemByName(This,name,item) \ - (This)->lpVtbl -> itemByName(This,name,item) - -#define ISchemaItemCollection_itemByQName(This,name,namespaceURI,item) \ - (This)->lpVtbl -> itemByQName(This,name,namespaceURI,item) - -#define ISchemaItemCollection_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define ISchemaItemCollection_get__newEnum(This,ppunk) \ - (This)->lpVtbl -> get__newEnum(This,ppunk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get_item_Proxy( - ISchemaItemCollection * This, - /* [in] */ long index, - /* [retval][out] */ ISchemaItem **item); - - -void __RPC_STUB ISchemaItemCollection_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_itemByName_Proxy( - ISchemaItemCollection * This, - /* [in] */ BSTR name, - /* [retval][out] */ ISchemaItem **item); - - -void __RPC_STUB ISchemaItemCollection_itemByName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_itemByQName_Proxy( - ISchemaItemCollection * This, - /* [in] */ BSTR name, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ ISchemaItem **item); - - -void __RPC_STUB ISchemaItemCollection_itemByQName_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get_length_Proxy( - ISchemaItemCollection * This, - /* [retval][out] */ long *length); - - -void __RPC_STUB ISchemaItemCollection_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][restricted][hidden][id] */ HRESULT STDMETHODCALLTYPE ISchemaItemCollection_get__newEnum_Proxy( - ISchemaItemCollection * This, - /* [retval][out] */ IUnknown **ppunk); - - -void __RPC_STUB ISchemaItemCollection_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaItemCollection_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaItem_INTERFACE_DEFINED__ -#define __ISchemaItem_INTERFACE_DEFINED__ - -/* interface ISchemaItem */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b3-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaItem : public IDispatch - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_name( - /* [retval][out] */ BSTR *name) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_namespaceURI( - /* [retval][out] */ BSTR *namespaceURI) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_schema( - /* [retval][out] */ ISchema **schema) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_id( - /* [retval][out] */ BSTR *id) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_itemType( - /* [retval][out] */ SOMITEMTYPE *itemType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_unhandledAttributes( - /* [retval][out] */ IVBSAXAttributes **attributes) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE writeAnnotation( - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaItem * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaItem * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaItem * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaItem * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaItem * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaItem * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaItem * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaItem * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaItem * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaItem * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaItem * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaItem * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaItem * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - END_INTERFACE - } ISchemaItemVtbl; - - interface ISchemaItem - { - CONST_VTBL struct ISchemaItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaItem_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaItem_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaItem_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaItem_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaItem_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaItem_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaItem_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaItem_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaItem_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaItem_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaItem_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaItem_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaItem_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaItem_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_name_Proxy( - ISchemaItem * This, - /* [retval][out] */ BSTR *name); - - -void __RPC_STUB ISchemaItem_get_name_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_namespaceURI_Proxy( - ISchemaItem * This, - /* [retval][out] */ BSTR *namespaceURI); - - -void __RPC_STUB ISchemaItem_get_namespaceURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_schema_Proxy( - ISchemaItem * This, - /* [retval][out] */ ISchema **schema); - - -void __RPC_STUB ISchemaItem_get_schema_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_id_Proxy( - ISchemaItem * This, - /* [retval][out] */ BSTR *id); - - -void __RPC_STUB ISchemaItem_get_id_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_itemType_Proxy( - ISchemaItem * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - -void __RPC_STUB ISchemaItem_get_itemType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_get_unhandledAttributes_Proxy( - ISchemaItem * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - -void __RPC_STUB ISchemaItem_get_unhandledAttributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaItem_writeAnnotation_Proxy( - ISchemaItem * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - -void __RPC_STUB ISchemaItem_writeAnnotation_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaItem_INTERFACE_DEFINED__ */ - - -#ifndef __ISchema_INTERFACE_DEFINED__ -#define __ISchema_INTERFACE_DEFINED__ - -/* interface ISchema */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchema; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b4-dd1b-4664-9a50-c2f40f4bd79a") - ISchema : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_targetNamespace( - /* [retval][out] */ BSTR *targetNamespace) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_version( - /* [retval][out] */ BSTR *version) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_types( - /* [retval][out] */ ISchemaItemCollection **types) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_elements( - /* [retval][out] */ ISchemaItemCollection **elements) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( - /* [retval][out] */ ISchemaItemCollection **attributes) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributeGroups( - /* [retval][out] */ ISchemaItemCollection **attributeGroups) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_modelGroups( - /* [retval][out] */ ISchemaItemCollection **modelGroups) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_notations( - /* [retval][out] */ ISchemaItemCollection **notations) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_schemaLocations( - /* [retval][out] */ ISchemaStringCollection **schemaLocations) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchema * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchema * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchema * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchema * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchema * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchema * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchema * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchema * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchema * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchema * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchema * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchema * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchema * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchema * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_targetNamespace )( - ISchema * This, - /* [retval][out] */ BSTR *targetNamespace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_version )( - ISchema * This, - /* [retval][out] */ BSTR *version); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_types )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **types); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_elements )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **elements); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributeGroups )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **attributeGroups); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_modelGroups )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **modelGroups); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_notations )( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **notations); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schemaLocations )( - ISchema * This, - /* [retval][out] */ ISchemaStringCollection **schemaLocations); - - END_INTERFACE - } ISchemaVtbl; - - interface ISchema - { - CONST_VTBL struct ISchemaVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchema_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchema_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchema_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchema_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchema_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchema_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchema_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchema_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchema_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchema_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchema_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchema_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchema_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchema_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchema_get_targetNamespace(This,targetNamespace) \ - (This)->lpVtbl -> get_targetNamespace(This,targetNamespace) - -#define ISchema_get_version(This,version) \ - (This)->lpVtbl -> get_version(This,version) - -#define ISchema_get_types(This,types) \ - (This)->lpVtbl -> get_types(This,types) - -#define ISchema_get_elements(This,elements) \ - (This)->lpVtbl -> get_elements(This,elements) - -#define ISchema_get_attributes(This,attributes) \ - (This)->lpVtbl -> get_attributes(This,attributes) - -#define ISchema_get_attributeGroups(This,attributeGroups) \ - (This)->lpVtbl -> get_attributeGroups(This,attributeGroups) - -#define ISchema_get_modelGroups(This,modelGroups) \ - (This)->lpVtbl -> get_modelGroups(This,modelGroups) - -#define ISchema_get_notations(This,notations) \ - (This)->lpVtbl -> get_notations(This,notations) - -#define ISchema_get_schemaLocations(This,schemaLocations) \ - (This)->lpVtbl -> get_schemaLocations(This,schemaLocations) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_targetNamespace_Proxy( - ISchema * This, - /* [retval][out] */ BSTR *targetNamespace); - - -void __RPC_STUB ISchema_get_targetNamespace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_version_Proxy( - ISchema * This, - /* [retval][out] */ BSTR *version); - - -void __RPC_STUB ISchema_get_version_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_types_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **types); - - -void __RPC_STUB ISchema_get_types_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_elements_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **elements); - - -void __RPC_STUB ISchema_get_elements_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_attributes_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - -void __RPC_STUB ISchema_get_attributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_attributeGroups_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **attributeGroups); - - -void __RPC_STUB ISchema_get_attributeGroups_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_modelGroups_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **modelGroups); - - -void __RPC_STUB ISchema_get_modelGroups_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_notations_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaItemCollection **notations); - - -void __RPC_STUB ISchema_get_notations_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchema_get_schemaLocations_Proxy( - ISchema * This, - /* [retval][out] */ ISchemaStringCollection **schemaLocations); - - -void __RPC_STUB ISchema_get_schemaLocations_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchema_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaParticle_INTERFACE_DEFINED__ -#define __ISchemaParticle_INTERFACE_DEFINED__ - -/* interface ISchemaParticle */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaParticle; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b5-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaParticle : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minOccurs( - /* [retval][out] */ VARIANT *minOccurs) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxOccurs( - /* [retval][out] */ VARIANT *maxOccurs) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaParticleVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaParticle * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaParticle * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaParticle * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaParticle * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaParticle * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaParticle * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaParticle * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaParticle * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaParticle * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaParticle * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaParticle * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaParticle * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaParticle * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaParticle * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( - ISchemaParticle * This, - /* [retval][out] */ VARIANT *minOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( - ISchemaParticle * This, - /* [retval][out] */ VARIANT *maxOccurs); - - END_INTERFACE - } ISchemaParticleVtbl; - - interface ISchemaParticle - { - CONST_VTBL struct ISchemaParticleVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaParticle_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaParticle_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaParticle_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaParticle_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaParticle_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaParticle_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaParticle_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaParticle_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaParticle_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaParticle_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaParticle_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaParticle_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaParticle_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaParticle_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaParticle_get_minOccurs(This,minOccurs) \ - (This)->lpVtbl -> get_minOccurs(This,minOccurs) - -#define ISchemaParticle_get_maxOccurs(This,maxOccurs) \ - (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaParticle_get_minOccurs_Proxy( - ISchemaParticle * This, - /* [retval][out] */ VARIANT *minOccurs); - - -void __RPC_STUB ISchemaParticle_get_minOccurs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaParticle_get_maxOccurs_Proxy( - ISchemaParticle * This, - /* [retval][out] */ VARIANT *maxOccurs); - - -void __RPC_STUB ISchemaParticle_get_maxOccurs_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaParticle_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaAttribute_INTERFACE_DEFINED__ -#define __ISchemaAttribute_INTERFACE_DEFINED__ - -/* interface ISchemaAttribute */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaAttribute; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b6-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaAttribute : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_type( - /* [retval][out] */ ISchemaType **type) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_scope( - /* [retval][out] */ ISchemaComplexType **scope) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_defaultValue( - /* [retval][out] */ BSTR *defaultValue) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fixedValue( - /* [retval][out] */ BSTR *fixedValue) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_use( - /* [retval][out] */ SCHEMAUSE *use) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isReference( - /* [retval][out] */ VARIANT_BOOL *reference) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaAttributeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaAttribute * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaAttribute * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaAttribute * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaAttribute * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaAttribute * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaAttribute * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaAttribute * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaAttribute * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaAttribute * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaAttribute * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaAttribute * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_type )( - ISchemaAttribute * This, - /* [retval][out] */ ISchemaType **type); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_scope )( - ISchemaAttribute * This, - /* [retval][out] */ ISchemaComplexType **scope); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_defaultValue )( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *defaultValue); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fixedValue )( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *fixedValue); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_use )( - ISchemaAttribute * This, - /* [retval][out] */ SCHEMAUSE *use); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isReference )( - ISchemaAttribute * This, - /* [retval][out] */ VARIANT_BOOL *reference); - - END_INTERFACE - } ISchemaAttributeVtbl; - - interface ISchemaAttribute - { - CONST_VTBL struct ISchemaAttributeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaAttribute_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaAttribute_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaAttribute_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaAttribute_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaAttribute_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaAttribute_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaAttribute_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaAttribute_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaAttribute_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaAttribute_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaAttribute_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaAttribute_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaAttribute_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaAttribute_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaAttribute_get_type(This,type) \ - (This)->lpVtbl -> get_type(This,type) - -#define ISchemaAttribute_get_scope(This,scope) \ - (This)->lpVtbl -> get_scope(This,scope) - -#define ISchemaAttribute_get_defaultValue(This,defaultValue) \ - (This)->lpVtbl -> get_defaultValue(This,defaultValue) - -#define ISchemaAttribute_get_fixedValue(This,fixedValue) \ - (This)->lpVtbl -> get_fixedValue(This,fixedValue) - -#define ISchemaAttribute_get_use(This,use) \ - (This)->lpVtbl -> get_use(This,use) - -#define ISchemaAttribute_get_isReference(This,reference) \ - (This)->lpVtbl -> get_isReference(This,reference) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_type_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ ISchemaType **type); - - -void __RPC_STUB ISchemaAttribute_get_type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_scope_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ ISchemaComplexType **scope); - - -void __RPC_STUB ISchemaAttribute_get_scope_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_defaultValue_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *defaultValue); - - -void __RPC_STUB ISchemaAttribute_get_defaultValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_fixedValue_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ BSTR *fixedValue); - - -void __RPC_STUB ISchemaAttribute_get_fixedValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_use_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ SCHEMAUSE *use); - - -void __RPC_STUB ISchemaAttribute_get_use_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttribute_get_isReference_Proxy( - ISchemaAttribute * This, - /* [retval][out] */ VARIANT_BOOL *reference); - - -void __RPC_STUB ISchemaAttribute_get_isReference_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaAttribute_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaElement_INTERFACE_DEFINED__ -#define __ISchemaElement_INTERFACE_DEFINED__ - -/* interface ISchemaElement */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaElement; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b7-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaElement : public ISchemaParticle - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_type( - /* [retval][out] */ ISchemaType **type) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_scope( - /* [retval][out] */ ISchemaComplexType **scope) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_defaultValue( - /* [retval][out] */ BSTR *defaultValue) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fixedValue( - /* [retval][out] */ BSTR *fixedValue) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isNillable( - /* [retval][out] */ VARIANT_BOOL *nillable) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_identityConstraints( - /* [retval][out] */ ISchemaItemCollection **constraints) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_substitutionGroup( - /* [retval][out] */ ISchemaElement **element) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_substitutionGroupExclusions( - /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_disallowedSubstitutions( - /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isAbstract( - /* [retval][out] */ VARIANT_BOOL *abstract) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isReference( - /* [retval][out] */ VARIANT_BOOL *reference) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaElementVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaElement * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaElement * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaElement * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaElement * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaElement * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaElement * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaElement * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaElement * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaElement * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaElement * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaElement * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaElement * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaElement * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaElement * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( - ISchemaElement * This, - /* [retval][out] */ VARIANT *minOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( - ISchemaElement * This, - /* [retval][out] */ VARIANT *maxOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_type )( - ISchemaElement * This, - /* [retval][out] */ ISchemaType **type); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_scope )( - ISchemaElement * This, - /* [retval][out] */ ISchemaComplexType **scope); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_defaultValue )( - ISchemaElement * This, - /* [retval][out] */ BSTR *defaultValue); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fixedValue )( - ISchemaElement * This, - /* [retval][out] */ BSTR *fixedValue); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isNillable )( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *nillable); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_identityConstraints )( - ISchemaElement * This, - /* [retval][out] */ ISchemaItemCollection **constraints); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_substitutionGroup )( - ISchemaElement * This, - /* [retval][out] */ ISchemaElement **element); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_substitutionGroupExclusions )( - ISchemaElement * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_disallowedSubstitutions )( - ISchemaElement * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isAbstract )( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *abstract); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isReference )( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *reference); - - END_INTERFACE - } ISchemaElementVtbl; - - interface ISchemaElement - { - CONST_VTBL struct ISchemaElementVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaElement_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaElement_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaElement_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaElement_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaElement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaElement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaElement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaElement_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaElement_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaElement_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaElement_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaElement_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaElement_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaElement_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaElement_get_minOccurs(This,minOccurs) \ - (This)->lpVtbl -> get_minOccurs(This,minOccurs) - -#define ISchemaElement_get_maxOccurs(This,maxOccurs) \ - (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) - - -#define ISchemaElement_get_type(This,type) \ - (This)->lpVtbl -> get_type(This,type) - -#define ISchemaElement_get_scope(This,scope) \ - (This)->lpVtbl -> get_scope(This,scope) - -#define ISchemaElement_get_defaultValue(This,defaultValue) \ - (This)->lpVtbl -> get_defaultValue(This,defaultValue) - -#define ISchemaElement_get_fixedValue(This,fixedValue) \ - (This)->lpVtbl -> get_fixedValue(This,fixedValue) - -#define ISchemaElement_get_isNillable(This,nillable) \ - (This)->lpVtbl -> get_isNillable(This,nillable) - -#define ISchemaElement_get_identityConstraints(This,constraints) \ - (This)->lpVtbl -> get_identityConstraints(This,constraints) - -#define ISchemaElement_get_substitutionGroup(This,element) \ - (This)->lpVtbl -> get_substitutionGroup(This,element) - -#define ISchemaElement_get_substitutionGroupExclusions(This,exclusions) \ - (This)->lpVtbl -> get_substitutionGroupExclusions(This,exclusions) - -#define ISchemaElement_get_disallowedSubstitutions(This,disallowed) \ - (This)->lpVtbl -> get_disallowedSubstitutions(This,disallowed) - -#define ISchemaElement_get_isAbstract(This,abstract) \ - (This)->lpVtbl -> get_isAbstract(This,abstract) - -#define ISchemaElement_get_isReference(This,reference) \ - (This)->lpVtbl -> get_isReference(This,reference) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_type_Proxy( - ISchemaElement * This, - /* [retval][out] */ ISchemaType **type); - - -void __RPC_STUB ISchemaElement_get_type_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_scope_Proxy( - ISchemaElement * This, - /* [retval][out] */ ISchemaComplexType **scope); - - -void __RPC_STUB ISchemaElement_get_scope_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_defaultValue_Proxy( - ISchemaElement * This, - /* [retval][out] */ BSTR *defaultValue); - - -void __RPC_STUB ISchemaElement_get_defaultValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_fixedValue_Proxy( - ISchemaElement * This, - /* [retval][out] */ BSTR *fixedValue); - - -void __RPC_STUB ISchemaElement_get_fixedValue_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isNillable_Proxy( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *nillable); - - -void __RPC_STUB ISchemaElement_get_isNillable_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_identityConstraints_Proxy( - ISchemaElement * This, - /* [retval][out] */ ISchemaItemCollection **constraints); - - -void __RPC_STUB ISchemaElement_get_identityConstraints_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_substitutionGroup_Proxy( - ISchemaElement * This, - /* [retval][out] */ ISchemaElement **element); - - -void __RPC_STUB ISchemaElement_get_substitutionGroup_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_substitutionGroupExclusions_Proxy( - ISchemaElement * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *exclusions); - - -void __RPC_STUB ISchemaElement_get_substitutionGroupExclusions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_disallowedSubstitutions_Proxy( - ISchemaElement * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *disallowed); - - -void __RPC_STUB ISchemaElement_get_disallowedSubstitutions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isAbstract_Proxy( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *abstract); - - -void __RPC_STUB ISchemaElement_get_isAbstract_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaElement_get_isReference_Proxy( - ISchemaElement * This, - /* [retval][out] */ VARIANT_BOOL *reference); - - -void __RPC_STUB ISchemaElement_get_isReference_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaElement_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaType_INTERFACE_DEFINED__ -#define __ISchemaType_INTERFACE_DEFINED__ - -/* interface ISchemaType */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b8-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaType : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_baseTypes( - /* [retval][out] */ ISchemaItemCollection **baseTypes) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_final( - /* [retval][out] */ SCHEMADERIVATIONMETHOD *final) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_variety( - /* [retval][out] */ SCHEMATYPEVARIETY *variety) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_derivedBy( - /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE isValid( - /* [in] */ BSTR data, - /* [retval][out] */ VARIANT_BOOL *valid) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minExclusive( - /* [retval][out] */ BSTR *minExclusive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInclusive( - /* [retval][out] */ BSTR *minInclusive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxExclusive( - /* [retval][out] */ BSTR *maxExclusive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxInclusive( - /* [retval][out] */ BSTR *maxInclusive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_totalDigits( - /* [retval][out] */ VARIANT *totalDigits) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fractionDigits( - /* [retval][out] */ VARIANT *fractionDigits) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ VARIANT *length) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minLength( - /* [retval][out] */ VARIANT *minLength) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxLength( - /* [retval][out] */ VARIANT *maxLength) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_enumeration( - /* [retval][out] */ ISchemaStringCollection **enumeration) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_whitespace( - /* [retval][out] */ SCHEMAWHITESPACE *whitespace) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_patterns( - /* [retval][out] */ ISchemaStringCollection **patterns) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaType * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaType * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaType * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaType * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaType * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaType * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaType * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_baseTypes )( - ISchemaType * This, - /* [retval][out] */ ISchemaItemCollection **baseTypes); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_final )( - ISchemaType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_variety )( - ISchemaType * This, - /* [retval][out] */ SCHEMATYPEVARIETY *variety); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_derivedBy )( - ISchemaType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *isValid )( - ISchemaType * This, - /* [in] */ BSTR data, - /* [retval][out] */ VARIANT_BOOL *valid); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minExclusive )( - ISchemaType * This, - /* [retval][out] */ BSTR *minExclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInclusive )( - ISchemaType * This, - /* [retval][out] */ BSTR *minInclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxExclusive )( - ISchemaType * This, - /* [retval][out] */ BSTR *maxExclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxInclusive )( - ISchemaType * This, - /* [retval][out] */ BSTR *maxInclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_totalDigits )( - ISchemaType * This, - /* [retval][out] */ VARIANT *totalDigits); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fractionDigits )( - ISchemaType * This, - /* [retval][out] */ VARIANT *fractionDigits); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - ISchemaType * This, - /* [retval][out] */ VARIANT *length); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minLength )( - ISchemaType * This, - /* [retval][out] */ VARIANT *minLength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxLength )( - ISchemaType * This, - /* [retval][out] */ VARIANT *maxLength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_enumeration )( - ISchemaType * This, - /* [retval][out] */ ISchemaStringCollection **enumeration); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_whitespace )( - ISchemaType * This, - /* [retval][out] */ SCHEMAWHITESPACE *whitespace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_patterns )( - ISchemaType * This, - /* [retval][out] */ ISchemaStringCollection **patterns); - - END_INTERFACE - } ISchemaTypeVtbl; - - interface ISchemaType - { - CONST_VTBL struct ISchemaTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaType_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaType_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaType_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaType_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaType_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaType_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaType_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaType_get_baseTypes(This,baseTypes) \ - (This)->lpVtbl -> get_baseTypes(This,baseTypes) - -#define ISchemaType_get_final(This,final) \ - (This)->lpVtbl -> get_final(This,final) - -#define ISchemaType_get_variety(This,variety) \ - (This)->lpVtbl -> get_variety(This,variety) - -#define ISchemaType_get_derivedBy(This,derivedBy) \ - (This)->lpVtbl -> get_derivedBy(This,derivedBy) - -#define ISchemaType_isValid(This,data,valid) \ - (This)->lpVtbl -> isValid(This,data,valid) - -#define ISchemaType_get_minExclusive(This,minExclusive) \ - (This)->lpVtbl -> get_minExclusive(This,minExclusive) - -#define ISchemaType_get_minInclusive(This,minInclusive) \ - (This)->lpVtbl -> get_minInclusive(This,minInclusive) - -#define ISchemaType_get_maxExclusive(This,maxExclusive) \ - (This)->lpVtbl -> get_maxExclusive(This,maxExclusive) - -#define ISchemaType_get_maxInclusive(This,maxInclusive) \ - (This)->lpVtbl -> get_maxInclusive(This,maxInclusive) - -#define ISchemaType_get_totalDigits(This,totalDigits) \ - (This)->lpVtbl -> get_totalDigits(This,totalDigits) - -#define ISchemaType_get_fractionDigits(This,fractionDigits) \ - (This)->lpVtbl -> get_fractionDigits(This,fractionDigits) - -#define ISchemaType_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define ISchemaType_get_minLength(This,minLength) \ - (This)->lpVtbl -> get_minLength(This,minLength) - -#define ISchemaType_get_maxLength(This,maxLength) \ - (This)->lpVtbl -> get_maxLength(This,maxLength) - -#define ISchemaType_get_enumeration(This,enumeration) \ - (This)->lpVtbl -> get_enumeration(This,enumeration) - -#define ISchemaType_get_whitespace(This,whitespace) \ - (This)->lpVtbl -> get_whitespace(This,whitespace) - -#define ISchemaType_get_patterns(This,patterns) \ - (This)->lpVtbl -> get_patterns(This,patterns) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_baseTypes_Proxy( - ISchemaType * This, - /* [retval][out] */ ISchemaItemCollection **baseTypes); - - -void __RPC_STUB ISchemaType_get_baseTypes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_final_Proxy( - ISchemaType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); - - -void __RPC_STUB ISchemaType_get_final_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_variety_Proxy( - ISchemaType * This, - /* [retval][out] */ SCHEMATYPEVARIETY *variety); - - -void __RPC_STUB ISchemaType_get_variety_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_derivedBy_Proxy( - ISchemaType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); - - -void __RPC_STUB ISchemaType_get_derivedBy_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE ISchemaType_isValid_Proxy( - ISchemaType * This, - /* [in] */ BSTR data, - /* [retval][out] */ VARIANT_BOOL *valid); - - -void __RPC_STUB ISchemaType_isValid_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minExclusive_Proxy( - ISchemaType * This, - /* [retval][out] */ BSTR *minExclusive); - - -void __RPC_STUB ISchemaType_get_minExclusive_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minInclusive_Proxy( - ISchemaType * This, - /* [retval][out] */ BSTR *minInclusive); - - -void __RPC_STUB ISchemaType_get_minInclusive_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxExclusive_Proxy( - ISchemaType * This, - /* [retval][out] */ BSTR *maxExclusive); - - -void __RPC_STUB ISchemaType_get_maxExclusive_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxInclusive_Proxy( - ISchemaType * This, - /* [retval][out] */ BSTR *maxInclusive); - - -void __RPC_STUB ISchemaType_get_maxInclusive_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_totalDigits_Proxy( - ISchemaType * This, - /* [retval][out] */ VARIANT *totalDigits); - - -void __RPC_STUB ISchemaType_get_totalDigits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_fractionDigits_Proxy( - ISchemaType * This, - /* [retval][out] */ VARIANT *fractionDigits); - - -void __RPC_STUB ISchemaType_get_fractionDigits_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_length_Proxy( - ISchemaType * This, - /* [retval][out] */ VARIANT *length); - - -void __RPC_STUB ISchemaType_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_minLength_Proxy( - ISchemaType * This, - /* [retval][out] */ VARIANT *minLength); - - -void __RPC_STUB ISchemaType_get_minLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_maxLength_Proxy( - ISchemaType * This, - /* [retval][out] */ VARIANT *maxLength); - - -void __RPC_STUB ISchemaType_get_maxLength_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_enumeration_Proxy( - ISchemaType * This, - /* [retval][out] */ ISchemaStringCollection **enumeration); - - -void __RPC_STUB ISchemaType_get_enumeration_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_whitespace_Proxy( - ISchemaType * This, - /* [retval][out] */ SCHEMAWHITESPACE *whitespace); - - -void __RPC_STUB ISchemaType_get_whitespace_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaType_get_patterns_Proxy( - ISchemaType * This, - /* [retval][out] */ ISchemaStringCollection **patterns); - - -void __RPC_STUB ISchemaType_get_patterns_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaType_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaComplexType_INTERFACE_DEFINED__ -#define __ISchemaComplexType_INTERFACE_DEFINED__ - -/* interface ISchemaComplexType */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaComplexType; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08b9-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaComplexType : public ISchemaType - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_isAbstract( - /* [retval][out] */ VARIANT_BOOL *abstract) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_anyAttribute( - /* [retval][out] */ ISchemaAny **anyAttribute) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( - /* [retval][out] */ ISchemaItemCollection **attributes) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentType( - /* [retval][out] */ SCHEMACONTENTTYPE *contentType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_contentModel( - /* [retval][out] */ ISchemaModelGroup **contentModel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_prohibitedSubstitutions( - /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaComplexTypeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaComplexType * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaComplexType * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaComplexType * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaComplexType * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaComplexType * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaComplexType * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaComplexType * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaComplexType * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaComplexType * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaComplexType * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaComplexType * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_baseTypes )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaItemCollection **baseTypes); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_final )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *final); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_variety )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMATYPEVARIETY *variety); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_derivedBy )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *derivedBy); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *isValid )( - ISchemaComplexType * This, - /* [in] */ BSTR data, - /* [retval][out] */ VARIANT_BOOL *valid); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minExclusive )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *minExclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInclusive )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *minInclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxExclusive )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *maxExclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxInclusive )( - ISchemaComplexType * This, - /* [retval][out] */ BSTR *maxInclusive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_totalDigits )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT *totalDigits); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fractionDigits )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT *fractionDigits); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT *length); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minLength )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT *minLength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxLength )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT *maxLength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_enumeration )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaStringCollection **enumeration); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_whitespace )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMAWHITESPACE *whitespace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_patterns )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaStringCollection **patterns); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_isAbstract )( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT_BOOL *abstract); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_anyAttribute )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaAny **anyAttribute); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentType )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMACONTENTTYPE *contentType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_contentModel )( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaModelGroup **contentModel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_prohibitedSubstitutions )( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited); - - END_INTERFACE - } ISchemaComplexTypeVtbl; - - interface ISchemaComplexType - { - CONST_VTBL struct ISchemaComplexTypeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaComplexType_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaComplexType_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaComplexType_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaComplexType_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaComplexType_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaComplexType_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaComplexType_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaComplexType_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaComplexType_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaComplexType_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaComplexType_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaComplexType_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaComplexType_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaComplexType_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaComplexType_get_baseTypes(This,baseTypes) \ - (This)->lpVtbl -> get_baseTypes(This,baseTypes) - -#define ISchemaComplexType_get_final(This,final) \ - (This)->lpVtbl -> get_final(This,final) - -#define ISchemaComplexType_get_variety(This,variety) \ - (This)->lpVtbl -> get_variety(This,variety) - -#define ISchemaComplexType_get_derivedBy(This,derivedBy) \ - (This)->lpVtbl -> get_derivedBy(This,derivedBy) - -#define ISchemaComplexType_isValid(This,data,valid) \ - (This)->lpVtbl -> isValid(This,data,valid) - -#define ISchemaComplexType_get_minExclusive(This,minExclusive) \ - (This)->lpVtbl -> get_minExclusive(This,minExclusive) - -#define ISchemaComplexType_get_minInclusive(This,minInclusive) \ - (This)->lpVtbl -> get_minInclusive(This,minInclusive) - -#define ISchemaComplexType_get_maxExclusive(This,maxExclusive) \ - (This)->lpVtbl -> get_maxExclusive(This,maxExclusive) - -#define ISchemaComplexType_get_maxInclusive(This,maxInclusive) \ - (This)->lpVtbl -> get_maxInclusive(This,maxInclusive) - -#define ISchemaComplexType_get_totalDigits(This,totalDigits) \ - (This)->lpVtbl -> get_totalDigits(This,totalDigits) - -#define ISchemaComplexType_get_fractionDigits(This,fractionDigits) \ - (This)->lpVtbl -> get_fractionDigits(This,fractionDigits) - -#define ISchemaComplexType_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define ISchemaComplexType_get_minLength(This,minLength) \ - (This)->lpVtbl -> get_minLength(This,minLength) - -#define ISchemaComplexType_get_maxLength(This,maxLength) \ - (This)->lpVtbl -> get_maxLength(This,maxLength) - -#define ISchemaComplexType_get_enumeration(This,enumeration) \ - (This)->lpVtbl -> get_enumeration(This,enumeration) - -#define ISchemaComplexType_get_whitespace(This,whitespace) \ - (This)->lpVtbl -> get_whitespace(This,whitespace) - -#define ISchemaComplexType_get_patterns(This,patterns) \ - (This)->lpVtbl -> get_patterns(This,patterns) - - -#define ISchemaComplexType_get_isAbstract(This,abstract) \ - (This)->lpVtbl -> get_isAbstract(This,abstract) - -#define ISchemaComplexType_get_anyAttribute(This,anyAttribute) \ - (This)->lpVtbl -> get_anyAttribute(This,anyAttribute) - -#define ISchemaComplexType_get_attributes(This,attributes) \ - (This)->lpVtbl -> get_attributes(This,attributes) - -#define ISchemaComplexType_get_contentType(This,contentType) \ - (This)->lpVtbl -> get_contentType(This,contentType) - -#define ISchemaComplexType_get_contentModel(This,contentModel) \ - (This)->lpVtbl -> get_contentModel(This,contentModel) - -#define ISchemaComplexType_get_prohibitedSubstitutions(This,prohibited) \ - (This)->lpVtbl -> get_prohibitedSubstitutions(This,prohibited) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_isAbstract_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ VARIANT_BOOL *abstract); - - -void __RPC_STUB ISchemaComplexType_get_isAbstract_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_anyAttribute_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaAny **anyAttribute); - - -void __RPC_STUB ISchemaComplexType_get_anyAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_attributes_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - -void __RPC_STUB ISchemaComplexType_get_attributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_contentType_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMACONTENTTYPE *contentType); - - -void __RPC_STUB ISchemaComplexType_get_contentType_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_contentModel_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ ISchemaModelGroup **contentModel); - - -void __RPC_STUB ISchemaComplexType_get_contentModel_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaComplexType_get_prohibitedSubstitutions_Proxy( - ISchemaComplexType * This, - /* [retval][out] */ SCHEMADERIVATIONMETHOD *prohibited); - - -void __RPC_STUB ISchemaComplexType_get_prohibitedSubstitutions_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaComplexType_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaAttributeGroup_INTERFACE_DEFINED__ -#define __ISchemaAttributeGroup_INTERFACE_DEFINED__ - -/* interface ISchemaAttributeGroup */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaAttributeGroup; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08ba-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaAttributeGroup : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_anyAttribute( - /* [retval][out] */ ISchemaAny **anyAttribute) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_attributes( - /* [retval][out] */ ISchemaItemCollection **attributes) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaAttributeGroupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaAttributeGroup * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaAttributeGroup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaAttributeGroup * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaAttributeGroup * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaAttributeGroup * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaAttributeGroup * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaAttributeGroup * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaAttributeGroup * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaAttributeGroup * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaAttributeGroup * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaAttributeGroup * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaAttributeGroup * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaAttributeGroup * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaAttributeGroup * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_anyAttribute )( - ISchemaAttributeGroup * This, - /* [retval][out] */ ISchemaAny **anyAttribute); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_attributes )( - ISchemaAttributeGroup * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - END_INTERFACE - } ISchemaAttributeGroupVtbl; - - interface ISchemaAttributeGroup - { - CONST_VTBL struct ISchemaAttributeGroupVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaAttributeGroup_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaAttributeGroup_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaAttributeGroup_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaAttributeGroup_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaAttributeGroup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaAttributeGroup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaAttributeGroup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaAttributeGroup_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaAttributeGroup_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaAttributeGroup_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaAttributeGroup_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaAttributeGroup_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaAttributeGroup_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaAttributeGroup_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaAttributeGroup_get_anyAttribute(This,anyAttribute) \ - (This)->lpVtbl -> get_anyAttribute(This,anyAttribute) - -#define ISchemaAttributeGroup_get_attributes(This,attributes) \ - (This)->lpVtbl -> get_attributes(This,attributes) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttributeGroup_get_anyAttribute_Proxy( - ISchemaAttributeGroup * This, - /* [retval][out] */ ISchemaAny **anyAttribute); - - -void __RPC_STUB ISchemaAttributeGroup_get_anyAttribute_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAttributeGroup_get_attributes_Proxy( - ISchemaAttributeGroup * This, - /* [retval][out] */ ISchemaItemCollection **attributes); - - -void __RPC_STUB ISchemaAttributeGroup_get_attributes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaAttributeGroup_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaModelGroup_INTERFACE_DEFINED__ -#define __ISchemaModelGroup_INTERFACE_DEFINED__ - -/* interface ISchemaModelGroup */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaModelGroup; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08bb-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaModelGroup : public ISchemaParticle - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_particles( - /* [retval][out] */ ISchemaItemCollection **particles) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaModelGroupVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaModelGroup * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaModelGroup * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaModelGroup * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaModelGroup * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaModelGroup * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaModelGroup * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaModelGroup * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaModelGroup * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaModelGroup * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaModelGroup * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaModelGroup * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaModelGroup * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaModelGroup * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaModelGroup * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( - ISchemaModelGroup * This, - /* [retval][out] */ VARIANT *minOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( - ISchemaModelGroup * This, - /* [retval][out] */ VARIANT *maxOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_particles )( - ISchemaModelGroup * This, - /* [retval][out] */ ISchemaItemCollection **particles); - - END_INTERFACE - } ISchemaModelGroupVtbl; - - interface ISchemaModelGroup - { - CONST_VTBL struct ISchemaModelGroupVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaModelGroup_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaModelGroup_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaModelGroup_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaModelGroup_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaModelGroup_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaModelGroup_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaModelGroup_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaModelGroup_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaModelGroup_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaModelGroup_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaModelGroup_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaModelGroup_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaModelGroup_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaModelGroup_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaModelGroup_get_minOccurs(This,minOccurs) \ - (This)->lpVtbl -> get_minOccurs(This,minOccurs) - -#define ISchemaModelGroup_get_maxOccurs(This,maxOccurs) \ - (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) - - -#define ISchemaModelGroup_get_particles(This,particles) \ - (This)->lpVtbl -> get_particles(This,particles) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaModelGroup_get_particles_Proxy( - ISchemaModelGroup * This, - /* [retval][out] */ ISchemaItemCollection **particles); - - -void __RPC_STUB ISchemaModelGroup_get_particles_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaModelGroup_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaAny_INTERFACE_DEFINED__ -#define __ISchemaAny_INTERFACE_DEFINED__ - -/* interface ISchemaAny */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaAny; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08bc-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaAny : public ISchemaParticle - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_namespaces( - /* [retval][out] */ ISchemaStringCollection **namespaces) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_processContents( - /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaAnyVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaAny * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaAny * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaAny * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaAny * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaAny * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaAny * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaAny * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaAny * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaAny * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaAny * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaAny * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaAny * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaAny * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaAny * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minOccurs )( - ISchemaAny * This, - /* [retval][out] */ VARIANT *minOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxOccurs )( - ISchemaAny * This, - /* [retval][out] */ VARIANT *maxOccurs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaces )( - ISchemaAny * This, - /* [retval][out] */ ISchemaStringCollection **namespaces); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_processContents )( - ISchemaAny * This, - /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents); - - END_INTERFACE - } ISchemaAnyVtbl; - - interface ISchemaAny - { - CONST_VTBL struct ISchemaAnyVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaAny_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaAny_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaAny_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaAny_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaAny_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaAny_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaAny_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaAny_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaAny_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaAny_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaAny_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaAny_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaAny_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaAny_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaAny_get_minOccurs(This,minOccurs) \ - (This)->lpVtbl -> get_minOccurs(This,minOccurs) - -#define ISchemaAny_get_maxOccurs(This,maxOccurs) \ - (This)->lpVtbl -> get_maxOccurs(This,maxOccurs) - - -#define ISchemaAny_get_namespaces(This,namespaces) \ - (This)->lpVtbl -> get_namespaces(This,namespaces) - -#define ISchemaAny_get_processContents(This,processContents) \ - (This)->lpVtbl -> get_processContents(This,processContents) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAny_get_namespaces_Proxy( - ISchemaAny * This, - /* [retval][out] */ ISchemaStringCollection **namespaces); - - -void __RPC_STUB ISchemaAny_get_namespaces_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaAny_get_processContents_Proxy( - ISchemaAny * This, - /* [retval][out] */ SCHEMAPROCESSCONTENTS *processContents); - - -void __RPC_STUB ISchemaAny_get_processContents_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaAny_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaIdentityConstraint_INTERFACE_DEFINED__ -#define __ISchemaIdentityConstraint_INTERFACE_DEFINED__ - -/* interface ISchemaIdentityConstraint */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaIdentityConstraint; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08bd-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaIdentityConstraint : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_selector( - /* [retval][out] */ BSTR *selector) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_fields( - /* [retval][out] */ ISchemaStringCollection **fields) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_referencedKey( - /* [retval][out] */ ISchemaIdentityConstraint **key) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaIdentityConstraintVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaIdentityConstraint * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaIdentityConstraint * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaIdentityConstraint * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaIdentityConstraint * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaIdentityConstraint * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaIdentityConstraint * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaIdentityConstraint * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaIdentityConstraint * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_selector )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ BSTR *selector); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_fields )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ ISchemaStringCollection **fields); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_referencedKey )( - ISchemaIdentityConstraint * This, - /* [retval][out] */ ISchemaIdentityConstraint **key); - - END_INTERFACE - } ISchemaIdentityConstraintVtbl; - - interface ISchemaIdentityConstraint - { - CONST_VTBL struct ISchemaIdentityConstraintVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaIdentityConstraint_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaIdentityConstraint_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaIdentityConstraint_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaIdentityConstraint_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaIdentityConstraint_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaIdentityConstraint_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaIdentityConstraint_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaIdentityConstraint_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaIdentityConstraint_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaIdentityConstraint_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaIdentityConstraint_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaIdentityConstraint_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaIdentityConstraint_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaIdentityConstraint_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaIdentityConstraint_get_selector(This,selector) \ - (This)->lpVtbl -> get_selector(This,selector) - -#define ISchemaIdentityConstraint_get_fields(This,fields) \ - (This)->lpVtbl -> get_fields(This,fields) - -#define ISchemaIdentityConstraint_get_referencedKey(This,key) \ - (This)->lpVtbl -> get_referencedKey(This,key) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_selector_Proxy( - ISchemaIdentityConstraint * This, - /* [retval][out] */ BSTR *selector); - - -void __RPC_STUB ISchemaIdentityConstraint_get_selector_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_fields_Proxy( - ISchemaIdentityConstraint * This, - /* [retval][out] */ ISchemaStringCollection **fields); - - -void __RPC_STUB ISchemaIdentityConstraint_get_fields_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaIdentityConstraint_get_referencedKey_Proxy( - ISchemaIdentityConstraint * This, - /* [retval][out] */ ISchemaIdentityConstraint **key); - - -void __RPC_STUB ISchemaIdentityConstraint_get_referencedKey_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaIdentityConstraint_INTERFACE_DEFINED__ */ - - -#ifndef __ISchemaNotation_INTERFACE_DEFINED__ -#define __ISchemaNotation_INTERFACE_DEFINED__ - -/* interface ISchemaNotation */ -/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_ISchemaNotation; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("50ea08be-dd1b-4664-9a50-c2f40f4bd79a") - ISchemaNotation : public ISchemaItem - { - public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_systemIdentifier( - /* [retval][out] */ BSTR *uri) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_publicIdentifier( - /* [retval][out] */ BSTR *uri) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISchemaNotationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ISchemaNotation * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ISchemaNotation * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ISchemaNotation * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - ISchemaNotation * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - ISchemaNotation * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - ISchemaNotation * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISchemaNotation * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_name )( - ISchemaNotation * This, - /* [retval][out] */ BSTR *name); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_namespaceURI )( - ISchemaNotation * This, - /* [retval][out] */ BSTR *namespaceURI); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_schema )( - ISchemaNotation * This, - /* [retval][out] */ ISchema **schema); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_id )( - ISchemaNotation * This, - /* [retval][out] */ BSTR *id); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_itemType )( - ISchemaNotation * This, - /* [retval][out] */ SOMITEMTYPE *itemType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_unhandledAttributes )( - ISchemaNotation * This, - /* [retval][out] */ IVBSAXAttributes **attributes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *writeAnnotation )( - ISchemaNotation * This, - /* [in] */ IUnknown *annotationSink, - /* [retval][out] */ VARIANT_BOOL *isWritten); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_systemIdentifier )( - ISchemaNotation * This, - /* [retval][out] */ BSTR *uri); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_publicIdentifier )( - ISchemaNotation * This, - /* [retval][out] */ BSTR *uri); - - END_INTERFACE - } ISchemaNotationVtbl; - - interface ISchemaNotation - { - CONST_VTBL struct ISchemaNotationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISchemaNotation_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define ISchemaNotation_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define ISchemaNotation_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define ISchemaNotation_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define ISchemaNotation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define ISchemaNotation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define ISchemaNotation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define ISchemaNotation_get_name(This,name) \ - (This)->lpVtbl -> get_name(This,name) - -#define ISchemaNotation_get_namespaceURI(This,namespaceURI) \ - (This)->lpVtbl -> get_namespaceURI(This,namespaceURI) - -#define ISchemaNotation_get_schema(This,schema) \ - (This)->lpVtbl -> get_schema(This,schema) - -#define ISchemaNotation_get_id(This,id) \ - (This)->lpVtbl -> get_id(This,id) - -#define ISchemaNotation_get_itemType(This,itemType) \ - (This)->lpVtbl -> get_itemType(This,itemType) - -#define ISchemaNotation_get_unhandledAttributes(This,attributes) \ - (This)->lpVtbl -> get_unhandledAttributes(This,attributes) - -#define ISchemaNotation_writeAnnotation(This,annotationSink,isWritten) \ - (This)->lpVtbl -> writeAnnotation(This,annotationSink,isWritten) - - -#define ISchemaNotation_get_systemIdentifier(This,uri) \ - (This)->lpVtbl -> get_systemIdentifier(This,uri) - -#define ISchemaNotation_get_publicIdentifier(This,uri) \ - (This)->lpVtbl -> get_publicIdentifier(This,uri) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaNotation_get_systemIdentifier_Proxy( - ISchemaNotation * This, - /* [retval][out] */ BSTR *uri); - - -void __RPC_STUB ISchemaNotation_get_systemIdentifier_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [propget][id] */ HRESULT STDMETHODCALLTYPE ISchemaNotation_get_publicIdentifier_Proxy( - ISchemaNotation * This, - /* [retval][out] */ BSTR *uri); - - -void __RPC_STUB ISchemaNotation_get_publicIdentifier_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __ISchemaNotation_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLDOMSelection_INTERFACE_DEFINED__ -#define __IXMLDOMSelection_INTERFACE_DEFINED__ - -/* interface IXMLDOMSelection */ -/* [unique][nonextensible][oleautomation][dual][uuid][object][local] */ - - -EXTERN_C const IID IID_IXMLDOMSelection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AA634FC7-5888-44a7-A257-3A47150D3A0E") - IXMLDOMSelection : public IXMLDOMNodeList - { - public: - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_expr( - /* [retval][out] */ BSTR *expression) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_expr( - /* [in] */ BSTR expression) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_context( - /* [retval][out] */ IXMLDOMNode **ppNode) = 0; - - virtual /* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE putref_context( - /* [in] */ IXMLDOMNode *pNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE peekNode( - /* [retval][out] */ IXMLDOMNode **ppNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE matches( - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ IXMLDOMNode **ppNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeNext( - /* [retval][out] */ IXMLDOMNode **ppNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeAll( void) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE clone( - /* [retval][out] */ IXMLDOMSelection **ppNode) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getProperty( - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProperty( - /* [in] */ BSTR name, - /* [in] */ VARIANT value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLDOMSelectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLDOMSelection * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLDOMSelection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLDOMSelection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLDOMSelection * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLDOMSelection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLDOMSelection * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLDOMSelection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - IXMLDOMSelection * This, - /* [in] */ long index, - /* [retval][out] */ IXMLDOMNode **listItem); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IXMLDOMSelection * This, - /* [retval][out] */ long *listLength); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *nextNode )( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **nextItem); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IXMLDOMSelection * This); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IXMLDOMSelection * This, - /* [out][retval] */ IUnknown **ppUnk); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_expr )( - IXMLDOMSelection * This, - /* [retval][out] */ BSTR *expression); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_expr )( - IXMLDOMSelection * This, - /* [in] */ BSTR expression); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_context )( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - /* [helpstring][id][propputref] */ HRESULT ( STDMETHODCALLTYPE *putref_context )( - IXMLDOMSelection * This, - /* [in] */ IXMLDOMNode *pNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *peekNode )( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *matches )( - IXMLDOMSelection * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ IXMLDOMNode **ppNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeNext )( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *removeAll )( - IXMLDOMSelection * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *clone )( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMSelection **ppNode); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getProperty )( - IXMLDOMSelection * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProperty )( - IXMLDOMSelection * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - END_INTERFACE - } IXMLDOMSelectionVtbl; - - interface IXMLDOMSelection - { - CONST_VTBL struct IXMLDOMSelectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLDOMSelection_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLDOMSelection_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLDOMSelection_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLDOMSelection_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLDOMSelection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLDOMSelection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLDOMSelection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLDOMSelection_get_item(This,index,listItem) \ - (This)->lpVtbl -> get_item(This,index,listItem) - -#define IXMLDOMSelection_get_length(This,listLength) \ - (This)->lpVtbl -> get_length(This,listLength) - -#define IXMLDOMSelection_nextNode(This,nextItem) \ - (This)->lpVtbl -> nextNode(This,nextItem) - -#define IXMLDOMSelection_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IXMLDOMSelection_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - - -#define IXMLDOMSelection_get_expr(This,expression) \ - (This)->lpVtbl -> get_expr(This,expression) - -#define IXMLDOMSelection_put_expr(This,expression) \ - (This)->lpVtbl -> put_expr(This,expression) - -#define IXMLDOMSelection_get_context(This,ppNode) \ - (This)->lpVtbl -> get_context(This,ppNode) - -#define IXMLDOMSelection_putref_context(This,pNode) \ - (This)->lpVtbl -> putref_context(This,pNode) - -#define IXMLDOMSelection_peekNode(This,ppNode) \ - (This)->lpVtbl -> peekNode(This,ppNode) - -#define IXMLDOMSelection_matches(This,pNode,ppNode) \ - (This)->lpVtbl -> matches(This,pNode,ppNode) - -#define IXMLDOMSelection_removeNext(This,ppNode) \ - (This)->lpVtbl -> removeNext(This,ppNode) - -#define IXMLDOMSelection_removeAll(This) \ - (This)->lpVtbl -> removeAll(This) - -#define IXMLDOMSelection_clone(This,ppNode) \ - (This)->lpVtbl -> clone(This,ppNode) - -#define IXMLDOMSelection_getProperty(This,name,value) \ - (This)->lpVtbl -> getProperty(This,name,value) - -#define IXMLDOMSelection_setProperty(This,name,value) \ - (This)->lpVtbl -> setProperty(This,name,value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_get_expr_Proxy( - IXMLDOMSelection * This, - /* [retval][out] */ BSTR *expression); - - -void __RPC_STUB IXMLDOMSelection_get_expr_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_put_expr_Proxy( - IXMLDOMSelection * This, - /* [in] */ BSTR expression); - - -void __RPC_STUB IXMLDOMSelection_put_expr_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_get_context_Proxy( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - -void __RPC_STUB IXMLDOMSelection_get_context_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propputref] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_putref_context_Proxy( - IXMLDOMSelection * This, - /* [in] */ IXMLDOMNode *pNode); - - -void __RPC_STUB IXMLDOMSelection_putref_context_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_peekNode_Proxy( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - -void __RPC_STUB IXMLDOMSelection_peekNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_matches_Proxy( - IXMLDOMSelection * This, - /* [in] */ IXMLDOMNode *pNode, - /* [retval][out] */ IXMLDOMNode **ppNode); - - -void __RPC_STUB IXMLDOMSelection_matches_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_removeNext_Proxy( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMNode **ppNode); - - -void __RPC_STUB IXMLDOMSelection_removeNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_removeAll_Proxy( - IXMLDOMSelection * This); - - -void __RPC_STUB IXMLDOMSelection_removeAll_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_clone_Proxy( - IXMLDOMSelection * This, - /* [retval][out] */ IXMLDOMSelection **ppNode); - - -void __RPC_STUB IXMLDOMSelection_clone_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_getProperty_Proxy( - IXMLDOMSelection * This, - /* [in] */ BSTR name, - /* [retval][out] */ VARIANT *value); - - -void __RPC_STUB IXMLDOMSelection_getProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLDOMSelection_setProperty_Proxy( - IXMLDOMSelection * This, - /* [in] */ BSTR name, - /* [in] */ VARIANT value); - - -void __RPC_STUB IXMLDOMSelection_setProperty_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLDOMSelection_INTERFACE_DEFINED__ */ - - -#ifndef __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ -#define __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ - -/* dispinterface XMLDOMDocumentEvents */ -/* [uuid][hidden] */ - - -EXTERN_C const IID DIID_XMLDOMDocumentEvents; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3efaa427-272f-11d2-836f-0000f87a7782") - XMLDOMDocumentEvents : public IDispatch - { - }; - -#else /* C style interface */ - - typedef struct XMLDOMDocumentEventsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - XMLDOMDocumentEvents * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - XMLDOMDocumentEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - XMLDOMDocumentEvents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - XMLDOMDocumentEvents * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - XMLDOMDocumentEvents * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - XMLDOMDocumentEvents * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - XMLDOMDocumentEvents * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - END_INTERFACE - } XMLDOMDocumentEventsVtbl; - - interface XMLDOMDocumentEvents - { - CONST_VTBL struct XMLDOMDocumentEventsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define XMLDOMDocumentEvents_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define XMLDOMDocumentEvents_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define XMLDOMDocumentEvents_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define XMLDOMDocumentEvents_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define XMLDOMDocumentEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define XMLDOMDocumentEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define XMLDOMDocumentEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - -#endif /* __XMLDOMDocumentEvents_DISPINTERFACE_DEFINED__ */ - - -#ifndef __IXMLHTTPRequest_INTERFACE_DEFINED__ -#define __IXMLHTTPRequest_INTERFACE_DEFINED__ - -/* interface IXMLHTTPRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_IXMLHTTPRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ED8C108D-4349-11D2-91A4-00C04F7969E8") - IXMLHTTPRequest : public IDispatch - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE open( - /* [in] */ BSTR bstrMethod, - /* [in] */ BSTR bstrUrl, - /* [optional][in] */ VARIANT varAsync, - /* [optional][in] */ VARIANT bstrUser, - /* [optional][in] */ VARIANT bstrPassword) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setRequestHeader( - /* [in] */ BSTR bstrHeader, - /* [in] */ BSTR bstrValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getResponseHeader( - /* [in] */ BSTR bstrHeader, - /* [retval][out] */ BSTR *pbstrValue) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getAllResponseHeaders( - /* [retval][out] */ BSTR *pbstrHeaders) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE send( - /* [optional][in] */ VARIANT varBody) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE abort( void) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_status( - /* [retval][out] */ long *plStatus) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_statusText( - /* [retval][out] */ BSTR *pbstrStatus) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseXML( - /* [retval][out] */ IDispatch **ppBody) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseText( - /* [retval][out] */ BSTR *pbstrBody) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseBody( - /* [retval][out] */ VARIANT *pvarBody) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_responseStream( - /* [retval][out] */ VARIANT *pvarBody) = 0; - - virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_readyState( - /* [retval][out] */ long *plState) = 0; - - virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_onreadystatechange( - /* [in] */ IDispatch *pReadyStateSink) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLHTTPRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXMLHTTPRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXMLHTTPRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXMLHTTPRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IXMLHTTPRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IXMLHTTPRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IXMLHTTPRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IXMLHTTPRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrMethod, - /* [in] */ BSTR bstrUrl, - /* [optional][in] */ VARIANT varAsync, - /* [optional][in] */ VARIANT bstrUser, - /* [optional][in] */ VARIANT bstrPassword); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [in] */ BSTR bstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [retval][out] */ BSTR *pbstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrHeaders); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( - IXMLHTTPRequest * This, - /* [optional][in] */ VARIANT varBody); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IXMLHTTPRequest * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( - IXMLHTTPRequest * This, - /* [retval][out] */ long *plStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( - IXMLHTTPRequest * This, - /* [retval][out] */ IDispatch **ppBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( - IXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( - IXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IXMLHTTPRequest * This, - /* [retval][out] */ long *plState); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IXMLHTTPRequest * This, - /* [in] */ IDispatch *pReadyStateSink); - - END_INTERFACE - } IXMLHTTPRequestVtbl; - - interface IXMLHTTPRequest - { - CONST_VTBL struct IXMLHTTPRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLHTTPRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLHTTPRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLHTTPRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLHTTPRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IXMLHTTPRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IXMLHTTPRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IXMLHTTPRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IXMLHTTPRequest_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ - (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) - -#define IXMLHTTPRequest_setRequestHeader(This,bstrHeader,bstrValue) \ - (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) - -#define IXMLHTTPRequest_getResponseHeader(This,bstrHeader,pbstrValue) \ - (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) - -#define IXMLHTTPRequest_getAllResponseHeaders(This,pbstrHeaders) \ - (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) - -#define IXMLHTTPRequest_send(This,varBody) \ - (This)->lpVtbl -> send(This,varBody) - -#define IXMLHTTPRequest_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IXMLHTTPRequest_get_status(This,plStatus) \ - (This)->lpVtbl -> get_status(This,plStatus) - -#define IXMLHTTPRequest_get_statusText(This,pbstrStatus) \ - (This)->lpVtbl -> get_statusText(This,pbstrStatus) - -#define IXMLHTTPRequest_get_responseXML(This,ppBody) \ - (This)->lpVtbl -> get_responseXML(This,ppBody) - -#define IXMLHTTPRequest_get_responseText(This,pbstrBody) \ - (This)->lpVtbl -> get_responseText(This,pbstrBody) - -#define IXMLHTTPRequest_get_responseBody(This,pvarBody) \ - (This)->lpVtbl -> get_responseBody(This,pvarBody) - -#define IXMLHTTPRequest_get_responseStream(This,pvarBody) \ - (This)->lpVtbl -> get_responseStream(This,pvarBody) - -#define IXMLHTTPRequest_get_readyState(This,plState) \ - (This)->lpVtbl -> get_readyState(This,plState) - -#define IXMLHTTPRequest_put_onreadystatechange(This,pReadyStateSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_open_Proxy( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrMethod, - /* [in] */ BSTR bstrUrl, - /* [optional][in] */ VARIANT varAsync, - /* [optional][in] */ VARIANT bstrUser, - /* [optional][in] */ VARIANT bstrPassword); - - -void __RPC_STUB IXMLHTTPRequest_open_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_setRequestHeader_Proxy( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [in] */ BSTR bstrValue); - - -void __RPC_STUB IXMLHTTPRequest_setRequestHeader_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_getResponseHeader_Proxy( - IXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [retval][out] */ BSTR *pbstrValue); - - -void __RPC_STUB IXMLHTTPRequest_getResponseHeader_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_getAllResponseHeaders_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrHeaders); - - -void __RPC_STUB IXMLHTTPRequest_getAllResponseHeaders_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_send_Proxy( - IXMLHTTPRequest * This, - /* [optional][in] */ VARIANT varBody); - - -void __RPC_STUB IXMLHTTPRequest_send_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_abort_Proxy( - IXMLHTTPRequest * This); - - -void __RPC_STUB IXMLHTTPRequest_abort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_status_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ long *plStatus); - - -void __RPC_STUB IXMLHTTPRequest_get_status_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_statusText_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrStatus); - - -void __RPC_STUB IXMLHTTPRequest_get_statusText_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseXML_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ IDispatch **ppBody); - - -void __RPC_STUB IXMLHTTPRequest_get_responseXML_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseText_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrBody); - - -void __RPC_STUB IXMLHTTPRequest_get_responseText_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseBody_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - -void __RPC_STUB IXMLHTTPRequest_get_responseBody_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_responseStream_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - -void __RPC_STUB IXMLHTTPRequest_get_responseStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_get_readyState_Proxy( - IXMLHTTPRequest * This, - /* [retval][out] */ long *plState); - - -void __RPC_STUB IXMLHTTPRequest_get_readyState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE IXMLHTTPRequest_put_onreadystatechange_Proxy( - IXMLHTTPRequest * This, - /* [in] */ IDispatch *pReadyStateSink); - - -void __RPC_STUB IXMLHTTPRequest_put_onreadystatechange_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLHTTPRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IServerXMLHTTPRequest_INTERFACE_DEFINED__ -#define __IServerXMLHTTPRequest_INTERFACE_DEFINED__ - -/* interface IServerXMLHTTPRequest */ -/* [unique][helpstring][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_IServerXMLHTTPRequest; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2e9196bf-13ba-4dd4-91ca-6c571f281495") - IServerXMLHTTPRequest : public IXMLHTTPRequest - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setTimeouts( - /* [in] */ long resolveTimeout, - /* [in] */ long connectTimeout, - /* [in] */ long sendTimeout, - /* [in] */ long receiveTimeout) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE waitForResponse( - /* [optional][in] */ VARIANT timeoutInSeconds, - /* [retval][out] */ VARIANT_BOOL *isSuccessful) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getOption( - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [retval][out] */ VARIANT *value) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setOption( - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [in] */ VARIANT value) = 0; - - }; - -#else /* C style interface */ - - typedef struct IServerXMLHTTPRequestVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IServerXMLHTTPRequest * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IServerXMLHTTPRequest * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IServerXMLHTTPRequest * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IServerXMLHTTPRequest * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IServerXMLHTTPRequest * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IServerXMLHTTPRequest * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IServerXMLHTTPRequest * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( - IServerXMLHTTPRequest * This, - /* [in] */ BSTR bstrMethod, - /* [in] */ BSTR bstrUrl, - /* [optional][in] */ VARIANT varAsync, - /* [optional][in] */ VARIANT bstrUser, - /* [optional][in] */ VARIANT bstrPassword); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( - IServerXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [in] */ BSTR bstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( - IServerXMLHTTPRequest * This, - /* [in] */ BSTR bstrHeader, - /* [retval][out] */ BSTR *pbstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrHeaders); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( - IServerXMLHTTPRequest * This, - /* [optional][in] */ VARIANT varBody); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IServerXMLHTTPRequest * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ long *plStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ IDispatch **ppBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ BSTR *pbstrBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IServerXMLHTTPRequest * This, - /* [retval][out] */ long *plState); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IServerXMLHTTPRequest * This, - /* [in] */ IDispatch *pReadyStateSink); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setTimeouts )( - IServerXMLHTTPRequest * This, - /* [in] */ long resolveTimeout, - /* [in] */ long connectTimeout, - /* [in] */ long sendTimeout, - /* [in] */ long receiveTimeout); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *waitForResponse )( - IServerXMLHTTPRequest * This, - /* [optional][in] */ VARIANT timeoutInSeconds, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getOption )( - IServerXMLHTTPRequest * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setOption )( - IServerXMLHTTPRequest * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [in] */ VARIANT value); - - END_INTERFACE - } IServerXMLHTTPRequestVtbl; - - interface IServerXMLHTTPRequest - { - CONST_VTBL struct IServerXMLHTTPRequestVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IServerXMLHTTPRequest_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IServerXMLHTTPRequest_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IServerXMLHTTPRequest_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IServerXMLHTTPRequest_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IServerXMLHTTPRequest_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IServerXMLHTTPRequest_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IServerXMLHTTPRequest_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IServerXMLHTTPRequest_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ - (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) - -#define IServerXMLHTTPRequest_setRequestHeader(This,bstrHeader,bstrValue) \ - (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) - -#define IServerXMLHTTPRequest_getResponseHeader(This,bstrHeader,pbstrValue) \ - (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) - -#define IServerXMLHTTPRequest_getAllResponseHeaders(This,pbstrHeaders) \ - (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) - -#define IServerXMLHTTPRequest_send(This,varBody) \ - (This)->lpVtbl -> send(This,varBody) - -#define IServerXMLHTTPRequest_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IServerXMLHTTPRequest_get_status(This,plStatus) \ - (This)->lpVtbl -> get_status(This,plStatus) - -#define IServerXMLHTTPRequest_get_statusText(This,pbstrStatus) \ - (This)->lpVtbl -> get_statusText(This,pbstrStatus) - -#define IServerXMLHTTPRequest_get_responseXML(This,ppBody) \ - (This)->lpVtbl -> get_responseXML(This,ppBody) - -#define IServerXMLHTTPRequest_get_responseText(This,pbstrBody) \ - (This)->lpVtbl -> get_responseText(This,pbstrBody) - -#define IServerXMLHTTPRequest_get_responseBody(This,pvarBody) \ - (This)->lpVtbl -> get_responseBody(This,pvarBody) - -#define IServerXMLHTTPRequest_get_responseStream(This,pvarBody) \ - (This)->lpVtbl -> get_responseStream(This,pvarBody) - -#define IServerXMLHTTPRequest_get_readyState(This,plState) \ - (This)->lpVtbl -> get_readyState(This,plState) - -#define IServerXMLHTTPRequest_put_onreadystatechange(This,pReadyStateSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) - - -#define IServerXMLHTTPRequest_setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) \ - (This)->lpVtbl -> setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) - -#define IServerXMLHTTPRequest_waitForResponse(This,timeoutInSeconds,isSuccessful) \ - (This)->lpVtbl -> waitForResponse(This,timeoutInSeconds,isSuccessful) - -#define IServerXMLHTTPRequest_getOption(This,option,value) \ - (This)->lpVtbl -> getOption(This,option,value) - -#define IServerXMLHTTPRequest_setOption(This,option,value) \ - (This)->lpVtbl -> setOption(This,option,value) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_setTimeouts_Proxy( - IServerXMLHTTPRequest * This, - /* [in] */ long resolveTimeout, - /* [in] */ long connectTimeout, - /* [in] */ long sendTimeout, - /* [in] */ long receiveTimeout); - - -void __RPC_STUB IServerXMLHTTPRequest_setTimeouts_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_waitForResponse_Proxy( - IServerXMLHTTPRequest * This, - /* [optional][in] */ VARIANT timeoutInSeconds, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - -void __RPC_STUB IServerXMLHTTPRequest_waitForResponse_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_getOption_Proxy( - IServerXMLHTTPRequest * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [retval][out] */ VARIANT *value); - - -void __RPC_STUB IServerXMLHTTPRequest_getOption_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest_setOption_Proxy( - IServerXMLHTTPRequest * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [in] */ VARIANT value); - - -void __RPC_STUB IServerXMLHTTPRequest_setOption_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IServerXMLHTTPRequest_INTERFACE_DEFINED__ */ - - -#ifndef __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ -#define __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ - -/* interface IServerXMLHTTPRequest2 */ -/* [unique][helpstring][oleautomation][dual][uuid][object] */ - - -EXTERN_C const IID IID_IServerXMLHTTPRequest2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2e01311b-c322-4b0a-bd77-b90cfdc8dce7") - IServerXMLHTTPRequest2 : public IServerXMLHTTPRequest - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProxy( - /* [in] */ SXH_PROXY_SETTING proxySetting, - /* [optional][in] */ VARIANT varProxyServer, - /* [optional][in] */ VARIANT varBypassList) = 0; - - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setProxyCredentials( - /* [in] */ BSTR bstrUserName, - /* [in] */ BSTR bstrPassword) = 0; - - }; - -#else /* C style interface */ - - typedef struct IServerXMLHTTPRequest2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IServerXMLHTTPRequest2 * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IServerXMLHTTPRequest2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IServerXMLHTTPRequest2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IServerXMLHTTPRequest2 * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IServerXMLHTTPRequest2 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IServerXMLHTTPRequest2 * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IServerXMLHTTPRequest2 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *open )( - IServerXMLHTTPRequest2 * This, - /* [in] */ BSTR bstrMethod, - /* [in] */ BSTR bstrUrl, - /* [optional][in] */ VARIANT varAsync, - /* [optional][in] */ VARIANT bstrUser, - /* [optional][in] */ VARIANT bstrPassword); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setRequestHeader )( - IServerXMLHTTPRequest2 * This, - /* [in] */ BSTR bstrHeader, - /* [in] */ BSTR bstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getResponseHeader )( - IServerXMLHTTPRequest2 * This, - /* [in] */ BSTR bstrHeader, - /* [retval][out] */ BSTR *pbstrValue); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getAllResponseHeaders )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ BSTR *pbstrHeaders); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *send )( - IServerXMLHTTPRequest2 * This, - /* [optional][in] */ VARIANT varBody); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *abort )( - IServerXMLHTTPRequest2 * This); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_status )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ long *plStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_statusText )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ BSTR *pbstrStatus); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseXML )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ IDispatch **ppBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseText )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ BSTR *pbstrBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseBody )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_responseStream )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ VARIANT *pvarBody); - - /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_readyState )( - IServerXMLHTTPRequest2 * This, - /* [retval][out] */ long *plState); - - /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_onreadystatechange )( - IServerXMLHTTPRequest2 * This, - /* [in] */ IDispatch *pReadyStateSink); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setTimeouts )( - IServerXMLHTTPRequest2 * This, - /* [in] */ long resolveTimeout, - /* [in] */ long connectTimeout, - /* [in] */ long sendTimeout, - /* [in] */ long receiveTimeout); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *waitForResponse )( - IServerXMLHTTPRequest2 * This, - /* [optional][in] */ VARIANT timeoutInSeconds, - /* [retval][out] */ VARIANT_BOOL *isSuccessful); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *getOption )( - IServerXMLHTTPRequest2 * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [retval][out] */ VARIANT *value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setOption )( - IServerXMLHTTPRequest2 * This, - /* [in] */ SERVERXMLHTTP_OPTION option, - /* [in] */ VARIANT value); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProxy )( - IServerXMLHTTPRequest2 * This, - /* [in] */ SXH_PROXY_SETTING proxySetting, - /* [optional][in] */ VARIANT varProxyServer, - /* [optional][in] */ VARIANT varBypassList); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *setProxyCredentials )( - IServerXMLHTTPRequest2 * This, - /* [in] */ BSTR bstrUserName, - /* [in] */ BSTR bstrPassword); - - END_INTERFACE - } IServerXMLHTTPRequest2Vtbl; - - interface IServerXMLHTTPRequest2 - { - CONST_VTBL struct IServerXMLHTTPRequest2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IServerXMLHTTPRequest2_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IServerXMLHTTPRequest2_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IServerXMLHTTPRequest2_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IServerXMLHTTPRequest2_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IServerXMLHTTPRequest2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IServerXMLHTTPRequest2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IServerXMLHTTPRequest2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IServerXMLHTTPRequest2_open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) \ - (This)->lpVtbl -> open(This,bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword) - -#define IServerXMLHTTPRequest2_setRequestHeader(This,bstrHeader,bstrValue) \ - (This)->lpVtbl -> setRequestHeader(This,bstrHeader,bstrValue) - -#define IServerXMLHTTPRequest2_getResponseHeader(This,bstrHeader,pbstrValue) \ - (This)->lpVtbl -> getResponseHeader(This,bstrHeader,pbstrValue) - -#define IServerXMLHTTPRequest2_getAllResponseHeaders(This,pbstrHeaders) \ - (This)->lpVtbl -> getAllResponseHeaders(This,pbstrHeaders) - -#define IServerXMLHTTPRequest2_send(This,varBody) \ - (This)->lpVtbl -> send(This,varBody) - -#define IServerXMLHTTPRequest2_abort(This) \ - (This)->lpVtbl -> abort(This) - -#define IServerXMLHTTPRequest2_get_status(This,plStatus) \ - (This)->lpVtbl -> get_status(This,plStatus) - -#define IServerXMLHTTPRequest2_get_statusText(This,pbstrStatus) \ - (This)->lpVtbl -> get_statusText(This,pbstrStatus) - -#define IServerXMLHTTPRequest2_get_responseXML(This,ppBody) \ - (This)->lpVtbl -> get_responseXML(This,ppBody) - -#define IServerXMLHTTPRequest2_get_responseText(This,pbstrBody) \ - (This)->lpVtbl -> get_responseText(This,pbstrBody) - -#define IServerXMLHTTPRequest2_get_responseBody(This,pvarBody) \ - (This)->lpVtbl -> get_responseBody(This,pvarBody) - -#define IServerXMLHTTPRequest2_get_responseStream(This,pvarBody) \ - (This)->lpVtbl -> get_responseStream(This,pvarBody) - -#define IServerXMLHTTPRequest2_get_readyState(This,plState) \ - (This)->lpVtbl -> get_readyState(This,plState) - -#define IServerXMLHTTPRequest2_put_onreadystatechange(This,pReadyStateSink) \ - (This)->lpVtbl -> put_onreadystatechange(This,pReadyStateSink) - - -#define IServerXMLHTTPRequest2_setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) \ - (This)->lpVtbl -> setTimeouts(This,resolveTimeout,connectTimeout,sendTimeout,receiveTimeout) - -#define IServerXMLHTTPRequest2_waitForResponse(This,timeoutInSeconds,isSuccessful) \ - (This)->lpVtbl -> waitForResponse(This,timeoutInSeconds,isSuccessful) - -#define IServerXMLHTTPRequest2_getOption(This,option,value) \ - (This)->lpVtbl -> getOption(This,option,value) - -#define IServerXMLHTTPRequest2_setOption(This,option,value) \ - (This)->lpVtbl -> setOption(This,option,value) - - -#define IServerXMLHTTPRequest2_setProxy(This,proxySetting,varProxyServer,varBypassList) \ - (This)->lpVtbl -> setProxy(This,proxySetting,varProxyServer,varBypassList) - -#define IServerXMLHTTPRequest2_setProxyCredentials(This,bstrUserName,bstrPassword) \ - (This)->lpVtbl -> setProxyCredentials(This,bstrUserName,bstrPassword) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest2_setProxy_Proxy( - IServerXMLHTTPRequest2 * This, - /* [in] */ SXH_PROXY_SETTING proxySetting, - /* [optional][in] */ VARIANT varProxyServer, - /* [optional][in] */ VARIANT varBypassList); - - -void __RPC_STUB IServerXMLHTTPRequest2_setProxy_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IServerXMLHTTPRequest2_setProxyCredentials_Proxy( - IServerXMLHTTPRequest2 * This, - /* [in] */ BSTR bstrUserName, - /* [in] */ BSTR bstrPassword); - - -void __RPC_STUB IServerXMLHTTPRequest2_setProxyCredentials_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IServerXMLHTTPRequest2_INTERFACE_DEFINED__ */ - - -#ifndef __IMXNamespacePrefixes_INTERFACE_DEFINED__ -#define __IMXNamespacePrefixes_INTERFACE_DEFINED__ - -/* interface IMXNamespacePrefixes */ -/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ - - -EXTERN_C const IID IID_IMXNamespacePrefixes; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c90352f4-643c-4fbc-bb23-e996eb2d51fd") - IMXNamespacePrefixes : public IDispatch - { - public: - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_item( - /* [in] */ long index, - /* [retval][out] */ BSTR *prefix) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_length( - /* [retval][out] */ long *length) = 0; - - virtual /* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE get__newEnum( - /* [retval][out] */ IUnknown **ppUnk) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXNamespacePrefixesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXNamespacePrefixes * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXNamespacePrefixes * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXNamespacePrefixes * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IMXNamespacePrefixes * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IMXNamespacePrefixes * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IMXNamespacePrefixes * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IMXNamespacePrefixes * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_item )( - IMXNamespacePrefixes * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *prefix); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_length )( - IMXNamespacePrefixes * This, - /* [retval][out] */ long *length); - - /* [id][hidden][restricted][propget] */ HRESULT ( STDMETHODCALLTYPE *get__newEnum )( - IMXNamespacePrefixes * This, - /* [retval][out] */ IUnknown **ppUnk); - - END_INTERFACE - } IMXNamespacePrefixesVtbl; - - interface IMXNamespacePrefixes - { - CONST_VTBL struct IMXNamespacePrefixesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXNamespacePrefixes_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXNamespacePrefixes_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXNamespacePrefixes_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXNamespacePrefixes_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IMXNamespacePrefixes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IMXNamespacePrefixes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IMXNamespacePrefixes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IMXNamespacePrefixes_get_item(This,index,prefix) \ - (This)->lpVtbl -> get_item(This,index,prefix) - -#define IMXNamespacePrefixes_get_length(This,length) \ - (This)->lpVtbl -> get_length(This,length) - -#define IMXNamespacePrefixes_get__newEnum(This,ppUnk) \ - (This)->lpVtbl -> get__newEnum(This,ppUnk) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get_item_Proxy( - IMXNamespacePrefixes * This, - /* [in] */ long index, - /* [retval][out] */ BSTR *prefix); - - -void __RPC_STUB IMXNamespacePrefixes_get_item_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get_length_Proxy( - IMXNamespacePrefixes * This, - /* [retval][out] */ long *length); - - -void __RPC_STUB IMXNamespacePrefixes_get_length_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][hidden][restricted][propget] */ HRESULT STDMETHODCALLTYPE IMXNamespacePrefixes_get__newEnum_Proxy( - IMXNamespacePrefixes * This, - /* [retval][out] */ IUnknown **ppUnk); - - -void __RPC_STUB IMXNamespacePrefixes_get__newEnum_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXNamespacePrefixes_INTERFACE_DEFINED__ */ - - -#ifndef __IVBMXNamespaceManager_INTERFACE_DEFINED__ -#define __IVBMXNamespaceManager_INTERFACE_DEFINED__ - -/* interface IVBMXNamespaceManager */ -/* [unique][nonextensible][oleautomation][dual][helpstring][uuid][object][local] */ - - -EXTERN_C const IID IID_IVBMXNamespaceManager; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c90352f5-643c-4fbc-bb23-e996eb2d51fd") - IVBMXNamespaceManager : public IDispatch - { - public: - virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_allowOverride( - /* [in] */ VARIANT_BOOL fOverride) = 0; - - virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_allowOverride( - /* [retval][out] */ VARIANT_BOOL *fOverride) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE pushContext( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE pushNodeContext( - /* [in] */ IXMLDOMNode *contextNode, - /* [defaultvalue][in] */ VARIANT_BOOL fDeep = -1) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE popContext( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE declarePrefix( - /* [in] */ BSTR prefix, - /* [in] */ BSTR namespaceURI) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getDeclaredPrefixes( - /* [retval][out] */ IMXNamespacePrefixes **prefixes) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getPrefixes( - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IMXNamespacePrefixes **prefixes) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getURI( - /* [in] */ BSTR prefix, - /* [retval][out] */ VARIANT *uri) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE getURIFromNode( - /* [in] */ BSTR strPrefix, - /* [in] */ IXMLDOMNode *contextNode, - /* [retval][out] */ VARIANT *uri) = 0; - - }; - -#else /* C style interface */ - - typedef struct IVBMXNamespaceManagerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IVBMXNamespaceManager * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IVBMXNamespaceManager * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IVBMXNamespaceManager * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - IVBMXNamespaceManager * This, - /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - IVBMXNamespaceManager * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - IVBMXNamespaceManager * This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IVBMXNamespaceManager * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_allowOverride )( - IVBMXNamespaceManager * This, - /* [in] */ VARIANT_BOOL fOverride); - - /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_allowOverride )( - IVBMXNamespaceManager * This, - /* [retval][out] */ VARIANT_BOOL *fOverride); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *reset )( - IVBMXNamespaceManager * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *pushContext )( - IVBMXNamespaceManager * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *pushNodeContext )( - IVBMXNamespaceManager * This, - /* [in] */ IXMLDOMNode *contextNode, - /* [defaultvalue][in] */ VARIANT_BOOL fDeep); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *popContext )( - IVBMXNamespaceManager * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *declarePrefix )( - IVBMXNamespaceManager * This, - /* [in] */ BSTR prefix, - /* [in] */ BSTR namespaceURI); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getDeclaredPrefixes )( - IVBMXNamespaceManager * This, - /* [retval][out] */ IMXNamespacePrefixes **prefixes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getPrefixes )( - IVBMXNamespaceManager * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IMXNamespacePrefixes **prefixes); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getURI )( - IVBMXNamespaceManager * This, - /* [in] */ BSTR prefix, - /* [retval][out] */ VARIANT *uri); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *getURIFromNode )( - IVBMXNamespaceManager * This, - /* [in] */ BSTR strPrefix, - /* [in] */ IXMLDOMNode *contextNode, - /* [retval][out] */ VARIANT *uri); - - END_INTERFACE - } IVBMXNamespaceManagerVtbl; - - interface IVBMXNamespaceManager - { - CONST_VTBL struct IVBMXNamespaceManagerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IVBMXNamespaceManager_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IVBMXNamespaceManager_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IVBMXNamespaceManager_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IVBMXNamespaceManager_GetTypeInfoCount(This,pctinfo) \ - (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) - -#define IVBMXNamespaceManager_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) - -#define IVBMXNamespaceManager_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) - -#define IVBMXNamespaceManager_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) - - -#define IVBMXNamespaceManager_put_allowOverride(This,fOverride) \ - (This)->lpVtbl -> put_allowOverride(This,fOverride) - -#define IVBMXNamespaceManager_get_allowOverride(This,fOverride) \ - (This)->lpVtbl -> get_allowOverride(This,fOverride) - -#define IVBMXNamespaceManager_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IVBMXNamespaceManager_pushContext(This) \ - (This)->lpVtbl -> pushContext(This) - -#define IVBMXNamespaceManager_pushNodeContext(This,contextNode,fDeep) \ - (This)->lpVtbl -> pushNodeContext(This,contextNode,fDeep) - -#define IVBMXNamespaceManager_popContext(This) \ - (This)->lpVtbl -> popContext(This) - -#define IVBMXNamespaceManager_declarePrefix(This,prefix,namespaceURI) \ - (This)->lpVtbl -> declarePrefix(This,prefix,namespaceURI) - -#define IVBMXNamespaceManager_getDeclaredPrefixes(This,prefixes) \ - (This)->lpVtbl -> getDeclaredPrefixes(This,prefixes) - -#define IVBMXNamespaceManager_getPrefixes(This,namespaceURI,prefixes) \ - (This)->lpVtbl -> getPrefixes(This,namespaceURI,prefixes) - -#define IVBMXNamespaceManager_getURI(This,prefix,uri) \ - (This)->lpVtbl -> getURI(This,prefix,uri) - -#define IVBMXNamespaceManager_getURIFromNode(This,strPrefix,contextNode,uri) \ - (This)->lpVtbl -> getURIFromNode(This,strPrefix,contextNode,uri) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [id][propput] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_put_allowOverride_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ VARIANT_BOOL fOverride); - - -void __RPC_STUB IVBMXNamespaceManager_put_allowOverride_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id][propget] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_get_allowOverride_Proxy( - IVBMXNamespaceManager * This, - /* [retval][out] */ VARIANT_BOOL *fOverride); - - -void __RPC_STUB IVBMXNamespaceManager_get_allowOverride_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_reset_Proxy( - IVBMXNamespaceManager * This); - - -void __RPC_STUB IVBMXNamespaceManager_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_pushContext_Proxy( - IVBMXNamespaceManager * This); - - -void __RPC_STUB IVBMXNamespaceManager_pushContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_pushNodeContext_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ IXMLDOMNode *contextNode, - /* [defaultvalue][in] */ VARIANT_BOOL fDeep); - - -void __RPC_STUB IVBMXNamespaceManager_pushNodeContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_popContext_Proxy( - IVBMXNamespaceManager * This); - - -void __RPC_STUB IVBMXNamespaceManager_popContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_declarePrefix_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ BSTR prefix, - /* [in] */ BSTR namespaceURI); - - -void __RPC_STUB IVBMXNamespaceManager_declarePrefix_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getDeclaredPrefixes_Proxy( - IVBMXNamespaceManager * This, - /* [retval][out] */ IMXNamespacePrefixes **prefixes); - - -void __RPC_STUB IVBMXNamespaceManager_getDeclaredPrefixes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getPrefixes_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ BSTR namespaceURI, - /* [retval][out] */ IMXNamespacePrefixes **prefixes); - - -void __RPC_STUB IVBMXNamespaceManager_getPrefixes_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getURI_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ BSTR prefix, - /* [retval][out] */ VARIANT *uri); - - -void __RPC_STUB IVBMXNamespaceManager_getURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [id] */ HRESULT STDMETHODCALLTYPE IVBMXNamespaceManager_getURIFromNode_Proxy( - IVBMXNamespaceManager * This, - /* [in] */ BSTR strPrefix, - /* [in] */ IXMLDOMNode *contextNode, - /* [retval][out] */ VARIANT *uri); - - -void __RPC_STUB IVBMXNamespaceManager_getURIFromNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IVBMXNamespaceManager_INTERFACE_DEFINED__ */ - - -#ifndef __IMXNamespaceManager_INTERFACE_DEFINED__ -#define __IMXNamespaceManager_INTERFACE_DEFINED__ - -/* interface IMXNamespaceManager */ -/* [unique][helpstring][uuid][local][object][hidden] */ - - -EXTERN_C const IID IID_IMXNamespaceManager; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c90352f6-643c-4fbc-bb23-e996eb2d51fd") - IMXNamespaceManager : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE putAllowOverride( - /* [in] */ VARIANT_BOOL fOverride) = 0; - - virtual HRESULT STDMETHODCALLTYPE getAllowOverride( - /* [retval][out] */ VARIANT_BOOL *fOverride) = 0; - - virtual HRESULT STDMETHODCALLTYPE reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE pushContext( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE pushNodeContext( - /* [in] */ IXMLDOMNode *contextNode, - /* [in] */ VARIANT_BOOL fDeep) = 0; - - virtual HRESULT STDMETHODCALLTYPE popContext( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE declarePrefix( - /* [in] */ const wchar_t *prefix, - /* [in] */ const wchar_t *namespaceURI) = 0; - - virtual HRESULT STDMETHODCALLTYPE getDeclaredPrefix( - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix) = 0; - - virtual HRESULT STDMETHODCALLTYPE getPrefix( - /* [in] */ const wchar_t *pwszNamespaceURI, - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix) = 0; - - virtual HRESULT STDMETHODCALLTYPE getURI( - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ IXMLDOMNode *pContextNode, - /* [out][in] */ wchar_t *pwchUri, - /* [out][in] */ int *pcchUri) = 0; - - }; - -#else /* C style interface */ - - typedef struct IMXNamespaceManagerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IMXNamespaceManager * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IMXNamespaceManager * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IMXNamespaceManager * This); - - HRESULT ( STDMETHODCALLTYPE *putAllowOverride )( - IMXNamespaceManager * This, - /* [in] */ VARIANT_BOOL fOverride); - - HRESULT ( STDMETHODCALLTYPE *getAllowOverride )( - IMXNamespaceManager * This, - /* [retval][out] */ VARIANT_BOOL *fOverride); - - HRESULT ( STDMETHODCALLTYPE *reset )( - IMXNamespaceManager * This); - - HRESULT ( STDMETHODCALLTYPE *pushContext )( - IMXNamespaceManager * This); - - HRESULT ( STDMETHODCALLTYPE *pushNodeContext )( - IMXNamespaceManager * This, - /* [in] */ IXMLDOMNode *contextNode, - /* [in] */ VARIANT_BOOL fDeep); - - HRESULT ( STDMETHODCALLTYPE *popContext )( - IMXNamespaceManager * This); - - HRESULT ( STDMETHODCALLTYPE *declarePrefix )( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *prefix, - /* [in] */ const wchar_t *namespaceURI); - - HRESULT ( STDMETHODCALLTYPE *getDeclaredPrefix )( - IMXNamespaceManager * This, - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix); - - HRESULT ( STDMETHODCALLTYPE *getPrefix )( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *pwszNamespaceURI, - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix); - - HRESULT ( STDMETHODCALLTYPE *getURI )( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ IXMLDOMNode *pContextNode, - /* [out][in] */ wchar_t *pwchUri, - /* [out][in] */ int *pcchUri); - - END_INTERFACE - } IMXNamespaceManagerVtbl; - - interface IMXNamespaceManager - { - CONST_VTBL struct IMXNamespaceManagerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IMXNamespaceManager_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IMXNamespaceManager_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IMXNamespaceManager_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IMXNamespaceManager_putAllowOverride(This,fOverride) \ - (This)->lpVtbl -> putAllowOverride(This,fOverride) - -#define IMXNamespaceManager_getAllowOverride(This,fOverride) \ - (This)->lpVtbl -> getAllowOverride(This,fOverride) - -#define IMXNamespaceManager_reset(This) \ - (This)->lpVtbl -> reset(This) - -#define IMXNamespaceManager_pushContext(This) \ - (This)->lpVtbl -> pushContext(This) - -#define IMXNamespaceManager_pushNodeContext(This,contextNode,fDeep) \ - (This)->lpVtbl -> pushNodeContext(This,contextNode,fDeep) - -#define IMXNamespaceManager_popContext(This) \ - (This)->lpVtbl -> popContext(This) - -#define IMXNamespaceManager_declarePrefix(This,prefix,namespaceURI) \ - (This)->lpVtbl -> declarePrefix(This,prefix,namespaceURI) - -#define IMXNamespaceManager_getDeclaredPrefix(This,nIndex,pwchPrefix,pcchPrefix) \ - (This)->lpVtbl -> getDeclaredPrefix(This,nIndex,pwchPrefix,pcchPrefix) - -#define IMXNamespaceManager_getPrefix(This,pwszNamespaceURI,nIndex,pwchPrefix,pcchPrefix) \ - (This)->lpVtbl -> getPrefix(This,pwszNamespaceURI,nIndex,pwchPrefix,pcchPrefix) - -#define IMXNamespaceManager_getURI(This,pwchPrefix,pContextNode,pwchUri,pcchUri) \ - (This)->lpVtbl -> getURI(This,pwchPrefix,pContextNode,pwchUri,pcchUri) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_putAllowOverride_Proxy( - IMXNamespaceManager * This, - /* [in] */ VARIANT_BOOL fOverride); - - -void __RPC_STUB IMXNamespaceManager_putAllowOverride_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getAllowOverride_Proxy( - IMXNamespaceManager * This, - /* [retval][out] */ VARIANT_BOOL *fOverride); - - -void __RPC_STUB IMXNamespaceManager_getAllowOverride_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_reset_Proxy( - IMXNamespaceManager * This); - - -void __RPC_STUB IMXNamespaceManager_reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_pushContext_Proxy( - IMXNamespaceManager * This); - - -void __RPC_STUB IMXNamespaceManager_pushContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_pushNodeContext_Proxy( - IMXNamespaceManager * This, - /* [in] */ IXMLDOMNode *contextNode, - /* [in] */ VARIANT_BOOL fDeep); - - -void __RPC_STUB IMXNamespaceManager_pushNodeContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_popContext_Proxy( - IMXNamespaceManager * This); - - -void __RPC_STUB IMXNamespaceManager_popContext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_declarePrefix_Proxy( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *prefix, - /* [in] */ const wchar_t *namespaceURI); - - -void __RPC_STUB IMXNamespaceManager_declarePrefix_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getDeclaredPrefix_Proxy( - IMXNamespaceManager * This, - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix); - - -void __RPC_STUB IMXNamespaceManager_getDeclaredPrefix_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getPrefix_Proxy( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *pwszNamespaceURI, - /* [in] */ long nIndex, - /* [out][in] */ wchar_t *pwchPrefix, - /* [out][in] */ int *pcchPrefix); - - -void __RPC_STUB IMXNamespaceManager_getPrefix_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IMXNamespaceManager_getURI_Proxy( - IMXNamespaceManager * This, - /* [in] */ const wchar_t *pwchPrefix, - /* [in] */ IXMLDOMNode *pContextNode, - /* [out][in] */ wchar_t *pwchUri, - /* [out][in] */ int *pcchUri); - - -void __RPC_STUB IMXNamespaceManager_getURI_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IMXNamespaceManager_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DOMDocument; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F6D90F11-9C73-11D3-B32E-00C04F990BB4") -DOMDocument; -#endif - -EXTERN_C const CLSID CLSID_DOMDocument26; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f1b-c551-11d3-89b9-0000f81fe221") -DOMDocument26; -#endif - -EXTERN_C const CLSID CLSID_DOMDocument30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f32-c551-11d3-89b9-0000f81fe221") -DOMDocument30; -#endif - -EXTERN_C const CLSID CLSID_DOMDocument40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c0-f192-11d4-a65f-0040963251e5") -DOMDocument40; -#endif - -EXTERN_C const CLSID CLSID_DOMDocument60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a05-f192-11d4-a65f-0040963251e5") -DOMDocument60; -#endif - -EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F6D90F12-9C73-11D3-B32E-00C04F990BB4") -FreeThreadedDOMDocument; -#endif - -EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument26; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f1c-c551-11d3-89b9-0000f81fe221") -FreeThreadedDOMDocument26; -#endif - -EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f33-c551-11d3-89b9-0000f81fe221") -FreeThreadedDOMDocument30; -#endif - -EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c1-f192-11d4-a65f-0040963251e5") -FreeThreadedDOMDocument40; -#endif - -EXTERN_C const CLSID CLSID_FreeThreadedDOMDocument60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a06-f192-11d4-a65f-0040963251e5") -FreeThreadedDOMDocument60; -#endif - -EXTERN_C const CLSID CLSID_XMLSchemaCache; - -#ifdef __cplusplus - -class DECLSPEC_UUID("373984c9-b845-449b-91e7-45ac83036ade") -XMLSchemaCache; -#endif - -EXTERN_C const CLSID CLSID_XMLSchemaCache26; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f1d-c551-11d3-89b9-0000f81fe221") -XMLSchemaCache26; -#endif - -EXTERN_C const CLSID CLSID_XMLSchemaCache30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f34-c551-11d3-89b9-0000f81fe221") -XMLSchemaCache30; -#endif - -EXTERN_C const CLSID CLSID_XMLSchemaCache40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c2-f192-11d4-a65f-0040963251e5") -XMLSchemaCache40; -#endif - -EXTERN_C const CLSID CLSID_XMLSchemaCache60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a07-f192-11d4-a65f-0040963251e5") -XMLSchemaCache60; -#endif - -EXTERN_C const CLSID CLSID_XSLTemplate; - -#ifdef __cplusplus - -class DECLSPEC_UUID("2933BF94-7B36-11d2-B20E-00C04F983E60") -XSLTemplate; -#endif - -EXTERN_C const CLSID CLSID_XSLTemplate26; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f21-c551-11d3-89b9-0000f81fe221") -XSLTemplate26; -#endif - -EXTERN_C const CLSID CLSID_XSLTemplate30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f36-c551-11d3-89b9-0000f81fe221") -XSLTemplate30; -#endif - -EXTERN_C const CLSID CLSID_XSLTemplate40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c3-f192-11d4-a65f-0040963251e5") -XSLTemplate40; -#endif - -EXTERN_C const CLSID CLSID_XSLTemplate60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a08-f192-11d4-a65f-0040963251e5") -XSLTemplate60; -#endif - -EXTERN_C const CLSID CLSID_XMLHTTP; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F6D90F16-9C73-11D3-B32E-00C04F990BB4") -XMLHTTP; -#endif - -EXTERN_C const CLSID CLSID_XMLHTTP26; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f1e-c551-11d3-89b9-0000f81fe221") -XMLHTTP26; -#endif - -EXTERN_C const CLSID CLSID_XMLHTTP30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f5078f35-c551-11d3-89b9-0000f81fe221") -XMLHTTP30; -#endif - -EXTERN_C const CLSID CLSID_XMLHTTP40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c5-f192-11d4-a65f-0040963251e5") -XMLHTTP40; -#endif - -EXTERN_C const CLSID CLSID_XMLHTTP60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a0a-f192-11d4-a65f-0040963251e5") -XMLHTTP60; -#endif - -EXTERN_C const CLSID CLSID_ServerXMLHTTP; - -#ifdef __cplusplus - -class DECLSPEC_UUID("afba6b42-5692-48ea-8141-dc517dcf0ef1") -ServerXMLHTTP; -#endif - -EXTERN_C const CLSID CLSID_ServerXMLHTTP30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("afb40ffd-b609-40a3-9828-f88bbe11e4e3") -ServerXMLHTTP30; -#endif - -EXTERN_C const CLSID CLSID_ServerXMLHTTP40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c6-f192-11d4-a65f-0040963251e5") -ServerXMLHTTP40; -#endif - -EXTERN_C const CLSID CLSID_ServerXMLHTTP60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a0b-f192-11d4-a65f-0040963251e5") -ServerXMLHTTP60; -#endif - -EXTERN_C const CLSID CLSID_SAXXMLReader; - -#ifdef __cplusplus - -class DECLSPEC_UUID("079aa557-4a18-424a-8eee-e39f0a8d41b9") -SAXXMLReader; -#endif - -EXTERN_C const CLSID CLSID_SAXXMLReader30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3124c396-fb13-4836-a6ad-1317f1713688") -SAXXMLReader30; -#endif - -EXTERN_C const CLSID CLSID_SAXXMLReader40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("7c6e29bc-8b8b-4c3d-859e-af6cd158be0f") -SAXXMLReader40; -#endif - -EXTERN_C const CLSID CLSID_SAXXMLReader60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a0c-f192-11d4-a65f-0040963251e5") -SAXXMLReader60; -#endif - -EXTERN_C const CLSID CLSID_MXXMLWriter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("fc220ad8-a72a-4ee8-926e-0b7ad152a020") -MXXMLWriter; -#endif - -EXTERN_C const CLSID CLSID_MXXMLWriter30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3d813dfe-6c91-4a4e-8f41-04346a841d9c") -MXXMLWriter30; -#endif - -EXTERN_C const CLSID CLSID_MXXMLWriter40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c8-f192-11d4-a65f-0040963251e5") -MXXMLWriter40; -#endif - -EXTERN_C const CLSID CLSID_MXXMLWriter60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a0f-f192-11d4-a65f-0040963251e5") -MXXMLWriter60; -#endif - -EXTERN_C const CLSID CLSID_MXHTMLWriter; - -#ifdef __cplusplus - -class DECLSPEC_UUID("a4c23ec3-6b70-4466-9127-550077239978") -MXHTMLWriter; -#endif - -EXTERN_C const CLSID CLSID_MXHTMLWriter30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("853d1540-c1a7-4aa9-a226-4d3bd301146d") -MXHTMLWriter30; -#endif - -EXTERN_C const CLSID CLSID_MXHTMLWriter40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969c9-f192-11d4-a65f-0040963251e5") -MXHTMLWriter40; -#endif - -EXTERN_C const CLSID CLSID_MXHTMLWriter60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a10-f192-11d4-a65f-0040963251e5") -MXHTMLWriter60; -#endif - -EXTERN_C const CLSID CLSID_SAXAttributes; - -#ifdef __cplusplus - -class DECLSPEC_UUID("4dd441ad-526d-4a77-9f1b-9841ed802fb0") -SAXAttributes; -#endif - -EXTERN_C const CLSID CLSID_SAXAttributes30; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3e784a01-f3ae-4dc0-9354-9526b9370eba") -SAXAttributes30; -#endif - -EXTERN_C const CLSID CLSID_SAXAttributes40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969ca-f192-11d4-a65f-0040963251e5") -SAXAttributes40; -#endif - -EXTERN_C const CLSID CLSID_SAXAttributes60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a0e-f192-11d4-a65f-0040963251e5") -SAXAttributes60; -#endif - -EXTERN_C const CLSID CLSID_MXNamespaceManager; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969d5-f192-11d4-a65f-0040963251e5") -MXNamespaceManager; -#endif - -EXTERN_C const CLSID CLSID_MXNamespaceManager40; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d969d6-f192-11d4-a65f-0040963251e5") -MXNamespaceManager40; -#endif - -EXTERN_C const CLSID CLSID_MXNamespaceManager60; - -#ifdef __cplusplus - -class DECLSPEC_UUID("88d96a11-f192-11d4-a65f-0040963251e5") -MXNamespaceManager60; -#endif -#endif /* __MSXML2_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_msxml6_0192 */ -/* [local] */ - -//---------------------------- -// MSXML SPECIFIC ERROR CODES -//---------------------------- -#define E_XML_NOTWF 0xC00CE223L // Validate failed because the document is not well formed. -#define E_XML_NODTD 0xC00CE224L // The node is neither Valid nor Invalid because no DTD/Schema declaration was found. -#define E_XML_INVALID 0xC00CE225L // Validate failed because of a DTD/Schema violation. -#define E_XML_BUFFERTOOSMALL 0xC00CE226L // Buffer passed in is too small to receive the data. -#ifdef __USE_MSXML6_NAMESPACE__ -} -#endif - - -extern RPC_IF_HANDLE __MIDL_itf_msxml6_0192_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msxml6_0192_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/cli/test/include/gtest/msxml6.idl b/cli/test/include/gtest/msxml6.idl deleted file mode 100644 index eab3a05..0000000 --- a/cli/test/include/gtest/msxml6.idl +++ /dev/null @@ -1,3934 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1997-2005. -// -// File: msxml6.idl -// -//-------------------------------------------------------------------------- - -cpp_quote("//+-------------------------------------------------------------------------") -cpp_quote("//") -cpp_quote("// Microsoft Windows") -cpp_quote("// Copyright (C) Microsoft Corporation, 1997-2005.") -cpp_quote("//") -cpp_quote("//--------------------------------------------------------------------------") - -#include "msxml6did.h" -#include - -#ifndef DO_NO_IMPORTS -import "unknwn.idl"; -import "wtypes.idl"; -import "objidl.idl"; -import "oaidl.idl"; -#endif - -// DOMDocument has a different guid in IE5. -// In msxml3 and above it is a version independent guid. -// To avoid compile errors define it to be DOMDocument2 -cpp_quote("#define DOMDocument DOMDocument2") -cpp_quote("#define CLSID_DOMDocument CLSID_DOMDocument2") -cpp_quote("") - -cpp_quote("#if !defined(_W64)") -cpp_quote("#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300") -cpp_quote("#define _W64 __w64") -cpp_quote("#else") -cpp_quote("#define _W64") -cpp_quote("#endif") -cpp_quote("#endif") -cpp_quote("#if defined(_WIN64)") -cpp_quote(" typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;") -cpp_quote("#else") -cpp_quote(" typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;") -cpp_quote("#endif") - - -cpp_quote("#ifdef __ISAXXMLReader_INTERFACE_DEFINED__") -cpp_quote("#undef __MSXML2_LIBRARY_DEFINED__") -cpp_quote("#endif") - -cpp_quote("#ifdef __USE_MSXML6_NAMESPACE__") -cpp_quote("namespace MSXML6 {") -cpp_quote("#endif") - -[ - uuid(f5078f18-c551-11d3-89b9-0000f81fe221), - version(6.0), - helpstring("Microsoft XML, v6.0"), - lcid(0x0000) -] - -library MSXML2 -{ - -importlib("stdole32.tlb"); -importlib("stdole2.tlb"); - -// XMLDOM -interface IXMLDOMImplementation; -interface IXMLDOMNode; -interface IXMLDOMDocumentFragment; -interface IXMLDOMDocument; -interface IXMLDOMDocument2; -interface IXMLDOMDocument3; -interface IXMLDOMNodeList; -interface IXMLDOMNamedNodeMap; -interface IXMLDOMCharacterData; -interface IXMLDOMAttribute; -interface IXMLDOMElement; -interface IXMLDOMText; -interface IXMLDOMComment; -interface IXMLDOMProcessingInstruction; -interface IXMLDOMCDATASection; -interface IXMLDOMDocumentType; -interface IXMLDOMNotation; -interface IXMLDOMEntity; -interface IXMLDOMEntityReference; -interface IXMLDOMParseError; -interface IXMLDOMParseError2; -interface IXMLDOMParseErrorCollection; -interface IXMLDOMSchemaCollection; -interface IXTLRuntime; -interface IXSLTemplate; -interface IXSLProcessor; - -// SAX -interface ISAXXMLReader; -interface ISAXXMLFilter; -interface ISAXLocator; -interface ISAXEntityResolver; -interface ISAXContentHandler; -interface ISAXDTDHandler; -interface ISAXErrorHandler; -interface ISAXLexicalHandler; -interface ISAXDeclHandler; -interface ISAXAttributes; - -interface IVBSAXXMLReader; -interface IVBSAXXMLFilter; -interface IVBSAXLocator; -interface IVBSAXEntityResolver; -interface IVBSAXContentHandler; -interface IVBSAXDTDHandler; -interface IVBSAXErrorHandler; -interface IVBSAXLexicalHandler; -interface IVBSAXDeclHandler; -interface IVBSAXAttributes; - -interface IMXWriter; -interface IMXAttributes; -interface IMXReaderControl; -interface IMXSchemaDeclHandler; -interface IMXXMLFilter; - -// SOM -interface IXMLDOMSchemaCollection2; -interface ISchemaStringCollection; -interface ISchemaItemCollection; -interface ISchemaItem; -interface ISchema; -interface ISchemaParticle; -interface ISchemaAttribute; -interface ISchemaElement; -interface ISchemaType; -interface ISchemaComplexType; -interface ISchemaAttributeGroup; -interface ISchemaModelGroup; -interface ISchemaAny; -interface ISchemaIdentityConstraint; -interface ISchemaNotation; - -/// This is needed to avoid having the (SAX) ParseURL method -/// become the ParseURLA method. -cpp_quote("#undef ParseURL") - -// IE4 msxml.h also defines __msxml_h__. The only way to tell the difference between IE4 msxml.h and IE5 msxml.h is the -// via the obsolete interface __IXMLElementNotificationSink_INTERFACE_DEFINED__ defined by IE4 -cpp_quote("#if !defined(__msxml_h__) || defined(__IXMLElementNotificationSink_INTERFACE_DEFINED__)") - -typedef [ -helpstring("Constants that define a node's type") -] enum tagDOMNodeType -{ - NODE_INVALID, // = 0 - NODE_ELEMENT, // = 1 - NODE_ATTRIBUTE, // = 2 - NODE_TEXT, // = 3 - NODE_CDATA_SECTION, // = 4 - NODE_ENTITY_REFERENCE, // = 5 - NODE_ENTITY, // = 6 - NODE_PROCESSING_INSTRUCTION, // = 7 - NODE_COMMENT, // = 8 - NODE_DOCUMENT, // = 9 - NODE_DOCUMENT_TYPE, // = 10 - NODE_DOCUMENT_FRAGMENT, // = 11 - NODE_NOTATION // = 12 -} DOMNodeType; - -cpp_quote("#endif") - -[ - local, object, - uuid(2933BF80-7B36-11d2-B20E-00C04F983E60), // IID_INode - odl, - dual, - oleautomation, - nonextensible, - helpstring("Core DOM node interface"), - pointer_default(unique) -] -interface IXMLDOMNode : IDispatch -{ - // readonly attribute wstring nodeName; - [propget, id(DISPID_DOM_NODE_NODENAME), - helpstring("name of the node")] - HRESULT nodeName( - [out, retval] BSTR * name); - - // attribute wstring nodeValue; - [propget, id(DISPID_DOM_NODE_NODEVALUE), - helpstring("value stored in the node")] - HRESULT nodeValue( - [out, retval] VARIANT * value); - - [propput, id(DISPID_DOM_NODE_NODEVALUE), - helpstring("value stored in the node")] - HRESULT nodeValue( - [in] VARIANT value); - - // readonly attribute unsigned short nodeType; - [propget, id(DISPID_DOM_NODE_NODETYPE), - helpstring("the node's type")] - HRESULT nodeType( - [out, retval] DOMNodeType * type); - - // readonly attribute Node parentNode; - [propget, id(DISPID_DOM_NODE_PARENTNODE), - helpstring("parent of the node")] - HRESULT parentNode( - [out, retval] IXMLDOMNode ** parent); - - // readonly attribute NodeList childNodes; - [propget, id(DISPID_DOM_NODE_CHILDNODES), - helpstring("the collection of the node's children")] - HRESULT childNodes( - [out, retval] IXMLDOMNodeList ** childList); - - // readonly attribute Node firstChild; - [propget,id(DISPID_DOM_NODE_FIRSTCHILD), - helpstring("first child of the node")] - HRESULT firstChild( - [out, retval] IXMLDOMNode ** firstChild); - - // readonly attribute Node lastChild; - [propget,id(DISPID_DOM_NODE_LASTCHILD), - helpstring("last child of the node")] - HRESULT lastChild( - [out, retval] IXMLDOMNode ** lastChild); - - // readonly attribute Node previousSibling; - [propget,id(DISPID_DOM_NODE_PREVIOUSSIBLING), - helpstring("left sibling of the node")] - HRESULT previousSibling( - [out, retval] IXMLDOMNode ** previousSibling); - - // readonly attribute Node nextSibling; - [propget,id(DISPID_DOM_NODE_NEXTSIBLING), - helpstring("right sibling of the node")] - HRESULT nextSibling( - [out, retval] IXMLDOMNode ** nextSibling); - - // readonly attribute NamedNodeMap attributes; - [propget, id(DISPID_DOM_NODE_ATTRIBUTES), - helpstring("the collection of the node's attributes")] - HRESULT attributes( - [out, retval] IXMLDOMNamedNodeMap ** attributeMap); - - - // Node insertBefore(in Node newChild, - // in Node refChild) - // raises(DOMException); - [id(DISPID_DOM_NODE_INSERTBEFORE), - helpstring("insert a child node")] - HRESULT insertBefore( - [in] IXMLDOMNode * newChild, - [in] VARIANT refChild, - [out, retval] IXMLDOMNode ** outNewChild); - - // Node replaceChild(in Node newChild, - // in Node oldChild) - // raises(DOMException); - [id(DISPID_DOM_NODE_REPLACECHILD), - helpstring("replace a child node")] - HRESULT replaceChild( - [in] IXMLDOMNode * newChild, - [in] IXMLDOMNode * oldChild, - [out, retval] IXMLDOMNode ** outOldChild); - - // Node removeChild(in Node childNode) - // raises(DOMException); - [id(DISPID_DOM_NODE_REMOVECHILD), - helpstring("remove a child node")] - HRESULT removeChild( - [in] IXMLDOMNode * childNode, - [out, retval] IXMLDOMNode ** oldChild); - - // Node appendChild(in Node newChild); - [id(DISPID_DOM_NODE_APPENDCHILD), - helpstring("append a child node")] - HRESULT appendChild( - [in] IXMLDOMNode * newChild, - [out, retval] IXMLDOMNode ** outNewChild); - - // boolean hasChildNodes(); - [id(DISPID_DOM_NODE_HASCHILDNODES), - helpstring("")] - HRESULT hasChildNodes( - [out, retval] VARIANT_BOOL * hasChild); - - // readonly attribute Node ownerDocument; - [propget, id(DISPID_DOM_NODE_OWNERDOC), - helpstring("document that contains the node")] - HRESULT ownerDocument( - [out, retval] IXMLDOMDocument ** DOMDocument); - - // Node cloneNode(in boolean deep); - [id(DISPID_DOM_NODE_CLONENODE), - helpstring("")] - HRESULT cloneNode( - [in] VARIANT_BOOL deep, - [out, retval] IXMLDOMNode ** cloneRoot); - - [propget, id(DISPID_XMLDOM_NODE_STRINGTYPE), - helpstring("the type of node in string form")] - HRESULT nodeTypeString( - [retval, out] BSTR * nodeType); - - [propget, id(DISPID_XMLDOM_NODE_TEXT), - helpstring("text content of the node and subtree")] - HRESULT text( - [retval, out] BSTR * text); - - [propput, id(DISPID_XMLDOM_NODE_TEXT), - helpstring("text content of the node and subtree")] - HRESULT text( - [in] BSTR text); - - [propget, id(DISPID_XMLDOM_NODE_SPECIFIED), - helpstring("indicates whether node is a default value")] - HRESULT specified( - [out, retval] VARIANT_BOOL * isSpecified); - - // DTD Navigation. - [propget, id(DISPID_XMLDOM_NODE_DEFINITION), - helpstring("pointer to the definition of the node in the DTD or schema")] - HRESULT definition( - [retval,out] IXMLDOMNode ** definitionNode); - - [propget, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE), - helpstring("get the strongly typed value of the node")] - HRESULT nodeTypedValue( - [retval, out] VARIANT * typedValue); - - [propput, id(DISPID_XMLDOM_NODE_NODETYPEDVALUE), - helpstring("get the strongly typed value of the node")] - HRESULT nodeTypedValue( - [in] VARIANT typedValue); - - [propget, id(DISPID_XMLDOM_NODE_DATATYPE), - helpstring("the data type of the node")] - HRESULT dataType( - [retval, out] VARIANT * dataTypeName); // BSTR or VT_NULL - - [propput, id(DISPID_XMLDOM_NODE_DATATYPE), - helpstring("the data type of the node")] - HRESULT dataType( - [in] BSTR dataTypeName); - - [propget, id(DISPID_XMLDOM_NODE_XML), - helpstring("return the XML source for the node and each of its descendants")] - HRESULT xml( - [retval, out] BSTR * xmlString); - - [id(DISPID_XMLDOM_NODE_TRANSFORMNODE), - helpstring("apply the stylesheet to the subtree")] - HRESULT transformNode( - [in] IXMLDOMNode * stylesheet, - [retval, out] BSTR * xmlString); - - [id(DISPID_XMLDOM_NODE_SELECTNODES), - helpstring("execute query on the subtree")] - HRESULT selectNodes( - [in] BSTR queryString, - [retval, out] IXMLDOMNodeList** resultList); - - [id(DISPID_XMLDOM_NODE_SELECTSINGLENODE), - helpstring("execute query on the subtree")] - HRESULT selectSingleNode( - [in] BSTR queryString, - [retval, out] IXMLDOMNode** resultNode); - - [propget,id(DISPID_XMLDOM_NODE_PARSED), - helpstring("has sub-tree been completely parsed")] - HRESULT parsed( - [retval, out] VARIANT_BOOL * isParsed); - - [propget, id(DISPID_XMLDOM_NODE_NAMESPACE), - helpstring("the URI for the namespace applying to the node")] - HRESULT namespaceURI( - [retval, out] BSTR * namespaceURI); - - [propget, id(DISPID_XMLDOM_NODE_PREFIX), - helpstring("the prefix for the namespace applying to the node")] - HRESULT prefix( - [retval, out] BSTR * prefixString); - - [propget, id(DISPID_XMLDOM_NODE_BASENAME), - helpstring("the base name of the node (nodename with the prefix stripped off)")] - HRESULT baseName( - [retval, out] BSTR * nameString); - - [id(DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT), - helpstring("apply the stylesheet to the subtree, returning the result through a document or a stream")] - HRESULT transformNodeToObject( - [in] IXMLDOMNode * stylesheet, - [in] VARIANT outputObject); - -}; - -[ - local, object, - uuid(2933BF81-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique), - hidden -] -interface IXMLDOMDocument : IXMLDOMNode -{ - // readonly attribute DocumentType doctype; - [propget, id(DISPID_DOM_DOCUMENT_DOCTYPE), - helpstring("node corresponding to the DOCTYPE")] - HRESULT doctype( - [out, retval] IXMLDOMDocumentType ** documentType); - - // readonly attribute DOMImplementation implementation; - [propget, id(DISPID_DOM_DOCUMENT_IMPLEMENTATION), - helpstring("info on this DOM implementation")] - HRESULT implementation( - [out, retval] IXMLDOMImplementation ** impl); - - // attribute Element documentElement; - [propget, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT), - helpstring("the root of the tree")] - HRESULT documentElement( - [out, retval] IXMLDOMElement ** DOMElement); - - [propputref, id(DISPID_DOM_DOCUMENT_DOCUMENTELEMENT), - helpstring("the root of the tree")] - HRESULT documentElement( - [in] IXMLDOMElement * DOMElement); - - // Element createElement(in wstring tagName); - [id(DISPID_DOM_DOCUMENT_CREATEELEMENT), - helpstring("create an Element node")] - HRESULT createElement( - [in] BSTR tagName, - [out, retval] IXMLDOMElement ** element); - - // DocumentFragment createDocumentFragment(); - [id(DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT), - helpstring("create a DocumentFragment node")] - HRESULT createDocumentFragment( - [out, retval] IXMLDOMDocumentFragment ** docFrag ); - - // Text createTextNode(in wstring data); - [id(DISPID_DOM_DOCUMENT_CREATETEXTNODE), - helpstring("create a text node")] - HRESULT createTextNode( - [in] BSTR data, - [out, retval] IXMLDOMText ** text); - - // Comment createComment(in wstring data); - [id(DISPID_DOM_DOCUMENT_CREATECOMMENT), - helpstring("create a comment node")] - HRESULT createComment( - [in] BSTR data, - [out, retval] IXMLDOMComment ** comment); - - // CDATASection createCDATASection(in wstring data); - [id(DISPID_DOM_DOCUMENT_CREATECDATASECTION), - helpstring("create a CDATA section node")] - HRESULT createCDATASection( - [in] BSTR data, - [out, retval] IXMLDOMCDATASection ** cdata); - - // ProcessingInstruction createProcessingInstruction(in wstring target, - // in wstring data); - [id(DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION), - helpstring("create a processing instruction node")] - HRESULT createProcessingInstruction( - [in] BSTR target, - [in] BSTR data, - [out, retval] IXMLDOMProcessingInstruction ** pi); - - // Attribute createAttribute(in wstring name); - [id(DISPID_DOM_DOCUMENT_CREATEATTRIBUTE), - helpstring("create an attribute node")] - HRESULT createAttribute( - [in] BSTR name, - [out, retval] IXMLDOMAttribute ** attribute); - - // EntityReference createEntityReference(in wstring name); - [id(DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE), - helpstring("create an entity reference node")] - HRESULT createEntityReference( - [in] BSTR name, - [out, retval] IXMLDOMEntityReference ** entityRef); - - // NodeList getElementsByTagName(in wstring tagname); - [id(DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME), - helpstring("build a list of elements by name")] - HRESULT getElementsByTagName( - [in] BSTR tagName, - [out, retval] IXMLDOMNodeList ** resultList); - - [id(DISPID_XMLDOM_DOCUMENT_CREATENODE), - helpstring("create a node of the specified node type and name")] - HRESULT createNode( - [in] VARIANT Type, - [in] BSTR name, - [in] BSTR namespaceURI, - [retval, out] IXMLDOMNode ** node); - - [id(DISPID_XMLDOM_DOCUMENT_NODEFROMID), - helpstring("retrieve node from it's ID")] - HRESULT nodeFromID( - [in] BSTR idString, - [retval, out] IXMLDOMNode ** node); - - [id(DISPID_XMLDOM_DOCUMENT_LOAD), - helpstring("load document from the specified XML source")] - HRESULT load( - [in] VARIANT xmlSource, - [out, retval] VARIANT_BOOL * isSuccessful); - - [propget, id(DISPID_READYSTATE), - helpstring("get the state of the XML document")] - HRESULT readyState( - [retval, out] long * value); - - [propget, id(DISPID_XMLDOM_DOCUMENT_PARSEERROR), - helpstring("get the last parser error")] - HRESULT parseError( - [retval, out] IXMLDOMParseError ** errorObj); - - [propget, id(DISPID_XMLDOM_DOCUMENT_URL), - helpstring("get the URL for the loaded XML document")] - HRESULT url( - [retval, out] BSTR * urlString); - - [propget, id(DISPID_XMLDOM_DOCUMENT_ASYNC), - helpstring("flag for asynchronous download")] - HRESULT async( - [retval, out] VARIANT_BOOL * isAsync); - - [propput, id(DISPID_XMLDOM_DOCUMENT_ASYNC), - helpstring("flag for asynchronous download")] - HRESULT async( - [in] VARIANT_BOOL isAsync); - - [id(DISPID_XMLDOM_DOCUMENT_ABORT), - helpstring("abort an asynchronous download")] - HRESULT abort(); - - [id(DISPID_XMLDOM_DOCUMENT_LOADXML), - helpstring("load the document from a string")] - HRESULT loadXML( - [in] BSTR bstrXML, - [out, retval] VARIANT_BOOL * isSuccessful); - - [id(DISPID_XMLDOM_DOCUMENT_SAVE), - helpstring("save the document to a specified destination")] - HRESULT save( - [in] VARIANT destination); - - [propget, id(DISPID_XMLDOM_DOCUMENT_VALIDATE), - helpstring("indicates whether the parser performs validation")] - HRESULT validateOnParse( - [retval, out] VARIANT_BOOL * isValidating); - - [propput, id(DISPID_XMLDOM_DOCUMENT_VALIDATE), - helpstring("indicates whether the parser performs validation")] - HRESULT validateOnParse( - [in] VARIANT_BOOL isValidating); - - [propget, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE), - helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")] - HRESULT resolveExternals( - [retval,out] VARIANT_BOOL * isResolving); - - [propput, id(DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE), - helpstring("indicates whether the parser resolves references to external DTD/Entities/Schema")] - HRESULT resolveExternals( - [in] VARIANT_BOOL isResolving); - - [propget, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE), - helpstring("indicates whether the parser preserves whitespace")] - HRESULT preserveWhiteSpace( - [retval,out] VARIANT_BOOL * isPreserving); - - [propput, id(DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE), - helpstring("indicates whether the parser preserves whitespace")] - HRESULT preserveWhiteSpace( - [in] VARIANT_BOOL isPreserving); - - [propput, id(DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE), - helpstring("register a readystatechange event handler")] - HRESULT onreadystatechange( - [in] VARIANT readystatechangeSink); - - [propput, id(DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE), - helpstring("register an ondataavailable event handler")] - HRESULT ondataavailable( - [in] VARIANT ondataavailableSink); - - [propput, id(DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE), - helpstring("register an ontransformnode event handler")] - HRESULT ontransformnode( - [in] VARIANT ontransformnodeSink); -}; - - -[ - local, object, - uuid(2933BF95-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument2 - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMDocument2 : IXMLDOMDocument -{ - [propget, id(DISPID_XMLDOM_DOCUMENT2_NAMESPACES), - helpstring("A collection of all namespaces for this document")] - HRESULT namespaces( - [out,retval] IXMLDOMSchemaCollection ** namespaceCollection); - - [propget, id(DISPID_XMLDOM_DOCUMENT2_SCHEMAS), - helpstring("The associated schema cache")] - HRESULT schemas( - [out,retval] VARIANT * otherCollection); - - [propputref, id(DISPID_XMLDOM_DOCUMENT2_SCHEMAS), - helpstring("The associated schema cache")] - HRESULT schemas( - [in] VARIANT otherCollection); - - [id(DISPID_XMLDOM_DOCUMENT2_VALIDATE), - helpstring("perform runtime validation on the currently loaded XML document")] - HRESULT validate( - [retval, out] IXMLDOMParseError ** errorObj); - - [id(DISPID_XMLDOM_DOCUMENT2_SETPROPERTY), - helpstring("set the value of the named property")] - HRESULT setProperty( - [in] BSTR name, - [in] VARIANT value); - - [id(DISPID_XMLDOM_DOCUMENT2_GETPROPERTY), - helpstring("get the value of the named property")] - HRESULT getProperty( - [in] BSTR name, - [out,retval] VARIANT * value); -}; - - -[ - local, object, - uuid(2933BF96-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocument3 - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMDocument3 : IXMLDOMDocument2 -{ - [id(DISPID_XMLDOM_DOCUMENT3_VALIDATENODE), - helpstring("perform runtime validation on the currently loaded XML document node")] - HRESULT validateNode( - [in] IXMLDOMNode* node, - [out, retval] IXMLDOMParseError ** errorObj); - - [id(DISPID_XMLDOM_DOCUMENT3_IMPORTNODE), - helpstring("clone node such that clones ownerDocument is this document")] - HRESULT importNode( - [in] IXMLDOMNode* node, - [in] VARIANT_BOOL deep, - [out, retval] IXMLDOMNode** clone); -}; - -[ - local, object, - uuid(373984c8-b845-449b-91e7-45ac83036ade), - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schemas Collection"), - pointer_default(unique) -] -interface IXMLDOMSchemaCollection : IDispatch -{ - [id(DISPID_XMLDOM_SCHEMACOLLECTION_ADD), - helpstring("add a new schema")] - HRESULT add( - [in] BSTR namespaceURI, - [in] VARIANT var); - - [id(DISPID_XMLDOM_SCHEMACOLLECTION_GET), - helpstring("lookup schema by namespaceURI")] - HRESULT get( - [in] BSTR namespaceURI, - [out,retval] IXMLDOMNode ** schemaNode); - - [id(DISPID_XMLDOM_SCHEMACOLLECTION_REMOVE), - helpstring("remove schema by namespaceURI")] - HRESULT remove( - [in] BSTR namespaceURI); - - [id(DISPID_XMLDOM_SCHEMACOLLECTION_LENGTH), - helpstring("number of schemas in collection"), propget] - HRESULT length( - [out, retval] long * length); - - [propget, id(DISPID_VALUE), - helpstring("Get namespaceURI for schema by index")] - HRESULT namespaceURI( - [in] long index, - [out, retval] BSTR * length); - - [id(DISPID_XMLDOM_SCHEMACOLLECTION_ADDCOLLECTION), - helpstring("copy & merge other collection into this one")] - HRESULT addCollection( - [in] IXMLDOMSchemaCollection * otherCollection); - - [propget, restricted, hidden, - id(DISPID_NEWENUM)] - HRESULT _newEnum( - [retval, out] IUnknown ** ppUnk); -}; - -[ - local, object, - uuid(2933BF82-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNodeList - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMNodeList : IDispatch -{ - // Node item(in unsigned long index); - [propget, id(DISPID_VALUE), - helpstring("collection of nodes")] - HRESULT item( - [in] long index, - [out, retval] IXMLDOMNode ** listItem); - - // readonly attribute unsigned long length; - [propget, id(DISPID_DOM_NODELIST_LENGTH), - helpstring("number of nodes in the collection")] - HRESULT length( - [out, retval] long * listLength); - - [id(DISPID_XMLDOM_NODELIST_NEXTNODE), - helpstring("get next node from iterator")] - HRESULT nextNode( - [out, retval] IXMLDOMNode ** nextItem); - - [id(DISPID_XMLDOM_NODELIST_RESET), - helpstring("reset the position of iterator")] - HRESULT reset(); - - [propget, restricted, hidden, - id(DISPID_NEWENUM)] - HRESULT _newEnum( - [retval, out] IUnknown ** ppUnk); -}; - - -[ - local, object, - uuid(AA634FC7-5888-44a7-A257-3A47150D3A0E), // IID_IXMLDOMSelection - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMSelection : IXMLDOMNodeList -{ - [propget, id(DISPID_XMLDOM_SELECTION_EXPR), - helpstring("selection expression")] - HRESULT expr( - [out, retval] BSTR * expression); - - [propput, id(DISPID_XMLDOM_SELECTION_EXPR), - helpstring("selection expression")] - HRESULT expr( - [in] BSTR expression); - - [propget, id(DISPID_XMLDOM_SELECTION_CONTEXT), - helpstring("nodes to apply selection expression to")] - HRESULT context( - [out, retval] IXMLDOMNode ** ppNode); - - [propputref, id(DISPID_XMLDOM_SELECTION_CONTEXT), - helpstring("nodes to apply selection expression to")] - HRESULT context( - [in] IXMLDOMNode * pNode); - - [id(DISPID_XMLDOM_SELECTION_PEEKNODE), - helpstring("gets the next node without advancing the list position")] - HRESULT peekNode( - [out, retval] IXMLDOMNode ** ppNode); - - [id(DISPID_XMLDOM_SELECTION_MATCHES), - helpstring("checks to see if the node matches the pattern")] - HRESULT matches( - [in] IXMLDOMNode * pNode, - [out, retval] IXMLDOMNode ** ppNode); - - [id(DISPID_XMLDOM_SELECTION_REMOVENEXT), - helpstring("removes the next node")] - HRESULT removeNext( - [out, retval] IXMLDOMNode ** ppNode); - - [id(DISPID_XMLDOM_SELECTION_REMOVEALL), - helpstring("removes all the nodes that match the selection")] - HRESULT removeAll(); - - [id(DISPID_XMLDOM_SELECTION_CLONE), - helpstring("clone this object with the same position and context")] - HRESULT clone( - [out, retval] IXMLDOMSelection ** ppNode); - - [id(DISPID_XMLDOM_SELECTION_GETPROPERTY), - helpstring("get the value of the named property")] - HRESULT getProperty( - [in] BSTR name, - [out,retval] VARIANT * value); - - [id(DISPID_XMLDOM_SELECTION_SETPROPERTY), - helpstring("set the value of the named property")] - HRESULT setProperty( - [in] BSTR name, - [in] VARIANT value); -}; - - -[ - local, object, - uuid(2933BF83-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNamedNodeMap - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMNamedNodeMap : IDispatch -{ - // Node getNamedItem(in wstring name); - [id(DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM), - helpstring("lookup item by name")] - HRESULT getNamedItem( - [in] BSTR name, - [out, retval] IXMLDOMNode ** namedItem); - - // void setNamedItem(in Node arg); - [id(DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM), - helpstring("set item by name")] - HRESULT setNamedItem( - [in] IXMLDOMNode * newItem, - [out, retval] IXMLDOMNode ** nameItem); - - // Node removeNamedItem(in wstring name); - [id(DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM), - helpstring("remove item by name")] - HRESULT removeNamedItem( - [in] BSTR name, - [out, retval] IXMLDOMNode ** namedItem); - - // Node item(in unsigned long index); - [propget, id(DISPID_VALUE), - helpstring("collection of nodes")] - HRESULT item( - [in] long index, - [out, retval] IXMLDOMNode ** listItem); - - // readonly attribute unsigned long length; - [propget, id(DISPID_DOM_NODELIST_LENGTH), - helpstring("number of nodes in the collection")] - HRESULT length( - [out, retval] long * listLength); - - // Node getQualifiedItem(in wstring name,in Node namespace); - [id(DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM), - helpstring("lookup the item by name and namespace")] - HRESULT getQualifiedItem( - [in] BSTR baseName, - [in] BSTR namespaceURI, - [out, retval] IXMLDOMNode ** qualifiedItem); - - // Node removeQualifiedItem(in wstring name,in Node namespace); - [id(DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM), - helpstring("remove the item by name and namespace")] - HRESULT removeQualifiedItem( - [in] BSTR baseName, - [in] BSTR namespaceURI, - [out, retval] IXMLDOMNode ** qualifiedItem); - - [id(DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE), - helpstring("get next node from iterator")] - HRESULT nextNode( - [out, retval] IXMLDOMNode ** nextItem); - - [id(DISPID_XMLDOM_NAMEDNODEMAP_RESET), - helpstring("reset the position of iterator")] - HRESULT reset(); - - [propget, restricted, hidden, - id(DISPID_NEWENUM)] - HRESULT _newEnum( - [retval, out] IUnknown ** ppUnk); -}; - - -[ - local, object, - uuid(3efaa413-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMDocumentFragment - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMDocumentFragment : IXMLDOMNode -{ -}; - - -[ - local, object, - uuid(2933BF84-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCharacterData - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMCharacterData : IXMLDOMNode -{ - // attribute wstring data; - [propget, id(DISPID_DOM_DATA_DATA), - helpstring("value of the node")] - HRESULT data( - [out, retval] BSTR * data); - - [propput, id(DISPID_DOM_DATA_DATA), - helpstring("value of the node")] - HRESULT data( - [in] BSTR data); - - // readonly attribute unsigned long length; - [propget, id(DISPID_DOM_DATA_LENGTH), - helpstring("number of characters in value")] - HRESULT length( - [out, retval] long * dataLength); - - // wstring substring(in unsigned long offset, - // in unsigned long count) - // raises(DOMException); - [id(DISPID_DOM_DATA_SUBSTRING), - helpstring("retrieve substring of value")] - HRESULT substringData( - [in] long offset, - [in] long count, - [out, retval] BSTR * data); - - // void append(in wstring arg); - [id(DISPID_DOM_DATA_APPEND), - helpstring("append string to value")] - HRESULT appendData( - [in] BSTR data); - - // void insert(in unsigned long offset, - // in wstring arg) - // raises(DOMException); - [id(DISPID_DOM_DATA_INSERT), - helpstring("insert string into value")] - HRESULT insertData( - [in] long offset, - [in] BSTR data); - - // void delete(in unsigned long offset, - // in unsigned long count) - // raises(DOMException); - [id(DISPID_DOM_DATA_DELETE), - helpstring("delete string within the value")] - HRESULT deleteData( - [in] long offset, - [in] long count); - - // void replace(in unsigned long offset, - // in unsigned long count, - // in wstring arg) - // raises(DOMException); - [id(DISPID_DOM_DATA_REPLACE), - helpstring("replace string within the value")] - HRESULT replaceData( - [in] long offset, - [in] long count, - [in] BSTR data); -}; - - -[ - local, object, - uuid(2933BF85-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMAttribute - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMAttribute : IXMLDOMNode -{ - // wstring name; - [propget, id(DISPID_DOM_ATTRIBUTE_GETNAME), - helpstring("get name of the attribute")] - HRESULT name( - [out, retval] BSTR * attributeName); - - // attribute boolean specified; - // ! This is defined as an extended property on IXMLDOMNode - - // attribute wstring value; - [propget, id(DISPID_DOM_ATTRIBUTE_VALUE), - helpstring("string value of the attribute")] - HRESULT value( - [out, retval] VARIANT * attributeValue); - - [propput, id(DISPID_DOM_ATTRIBUTE_VALUE), - helpstring("string value of the attribute")] - HRESULT value( - [in] VARIANT attributeValue); -}; - - -[ - local, object, - uuid(2933BF86-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMElement - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMElement : IXMLDOMNode -{ - // readonly attribute wstring tagName; - [propget, id(DISPID_DOM_ELEMENT_GETTAGNAME), - helpstring("get the tagName of the element")] - HRESULT tagName( - [out, retval] BSTR * tagName); - - // wstring getAttribute(in wstring name); - [id(DISPID_DOM_ELEMENT_GETATTRIBUTE), - helpstring("look up the string value of an attribute by name")] - HRESULT getAttribute( - [in] BSTR name, - [out, retval] VARIANT * value); - - // void setAttribute(in string name, - // in string value); - [id(DISPID_DOM_ELEMENT_SETATTRIBUTE), - helpstring("set the string value of an attribute by name")] - HRESULT setAttribute( - [in] BSTR name, - [in] VARIANT value); - - // void removeAttribute(in wstring name); - [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTE), - helpstring("remove an attribute by name")] - HRESULT removeAttribute( - [in] BSTR name); - - // Attribute getAttributeNode(in wstring name); - [id(DISPID_DOM_ELEMENT_GETATTRIBUTENODE), - helpstring("look up the attribute node by name")] - HRESULT getAttributeNode( - [in] BSTR name, - [out, retval] IXMLDOMAttribute ** attributeNode); - - // void setAttributeNode(in Attribute newAttr); - [id(DISPID_DOM_ELEMENT_SETATTRIBUTENODE), - helpstring("set the specified attribute on the element")] - HRESULT setAttributeNode( - [in] IXMLDOMAttribute * DOMAttribute, - [out, retval] IXMLDOMAttribute ** attributeNode); - - // void removeAttributeNode(in Attribute oldAttr); - [id(DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE), - helpstring("remove the specified attribute")] - HRESULT removeAttributeNode( - [in] IXMLDOMAttribute * DOMAttribute, - [out, retval] IXMLDOMAttribute ** attributeNode); - - // NodeList getElementsByTagName(in wstring tagname); - [id(DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME), - helpstring("build a list of elements by name")] - HRESULT getElementsByTagName( - [in] BSTR tagName, - [out, retval] IXMLDOMNodeList ** resultList); - - // void normalize(); - [id(DISPID_DOM_ELEMENT_NORMALIZE), - helpstring("collapse all adjacent text nodes in sub-tree")] - HRESULT normalize(); -}; - - -[ - local, object, - uuid(2933BF87-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMText - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMText : IXMLDOMCharacterData -{ - // Text splitText(in unsigned long offset); - [id(DISPID_DOM_TEXT_SPLITTEXT), - helpstring("split the text node into two text nodes at the position specified")] - HRESULT splitText( - [in] long offset, - [out, retval] IXMLDOMText ** rightHandTextNode); -}; - - -[ - local, object, - uuid(2933BF88-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMComment - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMComment : IXMLDOMCharacterData -{ -}; - - -[ - local, object, - uuid(2933BF89-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMProcessingInstruction - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMProcessingInstruction : IXMLDOMNode -{ - // read-only attribute wstring target; - [propget, id(DISPID_DOM_PI_TARGET), - helpstring("the target")] - HRESULT target( - [out, retval] BSTR * name); - - // attribute wstring data; - [propget, id(DISPID_DOM_PI_DATA), - helpstring("the data")] - HRESULT data( - [out, retval] BSTR * value); - - [propput, id(DISPID_DOM_PI_DATA), - helpstring("the data")] - HRESULT data( - [in] BSTR value); -}; - - -[ - local, object, - uuid(2933BF8A-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMCDATASection - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMCDATASection : IXMLDOMText -{ -}; - - -[ - local, object, - uuid(2933BF8B-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMDocumentType - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMDocumentType : IXMLDOMNode -{ - // readonly attribute wstring name; - [propget, id(DISPID_DOM_DOCUMENTTYPE_NAME), - helpstring("name of the document type (root of the tree)")] - HRESULT name( - [out, retval] BSTR * rootName); - - // readonly attribute NamedNodeMap entities; - [propget, id(DISPID_DOM_DOCUMENTTYPE_ENTITIES), - helpstring("a list of entities in the document")] - HRESULT entities( - [out, retval] IXMLDOMNamedNodeMap ** entityMap); - - // readonly attribute NamedNodeMap notations; - [propget, id(DISPID_DOM_DOCUMENTTYPE_NOTATIONS), - helpstring("a list of notations in the document")] - HRESULT notations( - [out, retval] IXMLDOMNamedNodeMap ** notationMap); -}; - - -[ - local, object, - uuid(2933BF8C-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMNotation - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMNotation : IXMLDOMNode -{ - // attribute wstring publicId; - [propget, id(DISPID_DOM_NOTATION_PUBLICID), - helpstring("the public ID")] - HRESULT publicId( - [out, retval] VARIANT * publicID); - - // attribute wstring systemId; - [propget, id(DISPID_DOM_NOTATION_SYSTEMID), - helpstring("the system ID")] - HRESULT systemId( - [out, retval] VARIANT * systemID); -}; - - -[ - local, object, - uuid(2933BF8D-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntity - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMEntity : IXMLDOMNode -{ - // attribute wstring publicId; - [propget, id(DISPID_DOM_ENTITY_PUBLICID), - helpstring("the public ID")] - HRESULT publicId( - [out, retval] VARIANT * publicID); - - // attribute wstring systemId; - [propget, id(DISPID_DOM_ENTITY_SYSTEMID), - helpstring("the system ID")] - HRESULT systemId( - [out, retval] VARIANT * systemID); - - // attribute wstring notationName; - [propget, id(DISPID_DOM_ENTITY_NOTATIONNAME), - helpstring("the name of the notation")] - HRESULT notationName( - [out, retval] BSTR * name); -}; - - -[ - local, object, - uuid(2933BF8E-7B36-11d2-B20E-00C04F983E60), // IID_IXMLDOMEntityReference - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IXMLDOMEntityReference : IXMLDOMNode -{ -}; - -[ - local, object, - nonextensible, - pointer_default(unique), - odl, - oleautomation, - dual, - uuid(2933BF8F-7B36-11d2-B20E-00C04F983E60) // IID_IXMLDOMImplementation -] -interface IXMLDOMImplementation : IDispatch -{ - // boolean hasFeature(in wstring feature, - // in wstring version); - [id(DISPID_DOM_IMPLEMENTATION_HASFEATURE)] - HRESULT hasFeature( - [in] BSTR feature, - [in] BSTR version, - [out, retval] VARIANT_BOOL * hasFeature); -}; - - -[ - local, object, - uuid(3efaa425-272f-11d2-836f-0000f87a7782), // IID_IXTLRuntime - odl, - dual, - oleautomation, - nonextensible, - helpstring("XTL runtime object"), - pointer_default(unique) -] -interface IXTLRuntime : IXMLDOMNode -{ - [id(DISPID_XTLRUNTIME_UNIQUEID), - helpstring("")] - HRESULT uniqueID( - [in]IXMLDOMNode *pNode, - [out,retval]long *pID); - - [id(DISPID_XTLRUNTIME_DEPTH), - helpstring("")] - HRESULT depth( - [in] IXMLDOMNode *pNode, - [out,retval]long * pDepth); - - [id(DISPID_XTLRUNTIME_CHILDNUMBER), - helpstring("")] - HRESULT childNumber( - [in]IXMLDOMNode *pNode, - [out,retval] long *pNumber); - - [id(DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER), - helpstring("")] - HRESULT ancestorChildNumber( - [in]BSTR bstrNodeName, - [in]IXMLDOMNode *pNode, - [out,retval]long *pNumber); - - [id(DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER), - helpstring("")] - HRESULT absoluteChildNumber( - [in]IXMLDOMNode *pNode, - [out,retval]long *pNumber); - - [id(DISPID_XTLRUNTIME_FORMATINDEX), - helpstring("")] - HRESULT formatIndex( - [in] long lIndex, - [in] BSTR bstrFormat, - [out, retval]BSTR *pbstrFormattedString); - - [id(DISPID_XTLRUNTIME_FORMATNUMBER), - helpstring("")] - HRESULT formatNumber( - [in] double dblNumber, - [in] BSTR bstrFormat, - [out, retval]BSTR *pbstrFormattedString); - - [id(DISPID_XTLRUNTIME_FORMATDATE), - helpstring("")] - HRESULT formatDate( - [in] VARIANT varDate, - [in] BSTR bstrFormat, - [in,optional] VARIANT varDestLocale, - [out, retval]BSTR *pbstrFormattedString); - - [id(DISPID_XTLRUNTIME_FORMATTIME), - helpstring("")] - HRESULT formatTime( - [in] VARIANT varTime, - [in] BSTR bstrFormat, - [in,optional] VARIANT varDestLocale, - [out, retval]BSTR *pbstrFormattedString); -}; - -[ - local, object, - uuid(3efaa426-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseError - odl, - dual, - oleautomation, - nonextensible, - helpstring("structure for reporting parser errors"), - pointer_default(unique) -] -interface IXMLDOMParseError : IDispatch -{ - [propget, id(DISPID_VALUE), - helpstring("the error code")] - HRESULT errorCode( - [retval, out] long * errorCode); - - [propget, id(DISPID_DOM_ERROR_URL), - helpstring("the URL of the XML document containing the error")] - HRESULT url( - [retval, out] BSTR * urlString); - - [propget, id(DISPID_DOM_ERROR_REASON), - helpstring("the cause of the error")] - HRESULT reason( - [retval, out] BSTR * reasonString); - - [propget, id(DISPID_DOM_ERROR_SRCTEXT), - helpstring("the data where the error occurred")] - HRESULT srcText( - [retval, out] BSTR * sourceString); - - [propget, id(DISPID_DOM_ERROR_LINE), - helpstring("the line number in the XML document where the error occurred")] - HRESULT line( - [retval, out] long * lineNumber); - - [propget, id(DISPID_DOM_ERROR_LINEPOS), - helpstring("the character position in the line containing the error")] - HRESULT linepos( - [retval, out] long * linePosition); - - [propget, id(DISPID_DOM_ERROR_FILEPOS), - helpstring("the absolute file position in the XML document containing the error")] - HRESULT filepos( - [retval, out] long * filePosition); -}; - -[ - local, object, - uuid(3efaa428-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseError2 - odl, - dual, - oleautomation, - nonextensible, - helpstring("structure for reporting parser errors"), - pointer_default(unique) -] -interface IXMLDOMParseError2 : IXMLDOMParseError -{ - [propget, id(DISPID_DOM_ERROR2_ERRORXPATH)] - HRESULT errorXPath( - [out, retval] BSTR * xpathexpr); - - [propget, id(DISPID_DOM_ERROR2_ALLERRORS)] - HRESULT allErrors( - [out, retval] IXMLDOMParseErrorCollection ** allErrors); - - [id(DISPID_DOM_ERROR2_ERRORPARAMETERS)] - HRESULT errorParameters( - [in] long index, - [out,retval] BSTR* param); - - [propget, id(DISPID_DOM_ERROR2_ERRORPARAMETERSCOUNT)] - HRESULT errorParametersCount( - [out,retval] long* count); -}; - - -[ - local, object, - uuid(3efaa429-272f-11d2-836f-0000f87a7782), // IID_IXMLDOMParseErrorCollection - odl, - dual, - oleautomation, - nonextensible, - helpstring("structure for reporting parser errors"), - pointer_default(unique) -] -interface IXMLDOMParseErrorCollection : IDispatch -{ - [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]IXMLDOMParseError2 ** error); - [id(DISPID_DOM_ERRORCOLLECTION_LENGTH), propget] HRESULT length([out,retval]long * length); - [id(DISPID_DOM_ERRORCOLLECTION_NEXT), propget] HRESULT next([out, retval] IXMLDOMParseError2 ** error); - [id(DISPID_DOM_ERRORCOLLECTION_RESET)] HRESULT reset(); - [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown ** ppunk); -}; - -// DOM event interface -[ - hidden, - uuid(3efaa427-272f-11d2-836f-0000f87a7782) // IID_IXMLDOMEvent -] -dispinterface XMLDOMDocumentEvents -{ - properties: - methods: - [id (DISPID_XMLDOMEVENT_ONDATAAVAILABLE)] - HRESULT ondataavailable(void); - - [id (DISPID_XMLDOMEVENT_ONREADYSTATECHANGE)] - HRESULT onreadystatechange(void); -}; - - -[ - local, object, - uuid(2933BF92-7B36-11d2-B20E-00C04F983E60), // IXSLProcessor - odl, - dual, - oleautomation, - nonextensible, - helpstring("IXSLProcessor Interface"), - pointer_default(unique) -] -interface IXSLProcessor : IDispatch -{ - [propput, id(DISPID_XMLDOM_PROCESSOR_INPUT), helpstring("XML input tree to transform")] - HRESULT input([in] VARIANT var); - - [propget, id(DISPID_XMLDOM_PROCESSOR_INPUT), helpstring("XML input tree to transform")] - HRESULT input([out,retval] VARIANT * pVar); - - [propget, id(DISPID_XMLDOM_PROCESSOR_XSLTEMPLATE), helpstring("template object used to create this processor object")] - HRESULT ownerTemplate([out,retval] IXSLTemplate** ppTemplate); - - [id(DISPID_XMLDOM_PROCESSOR_SETSTARTMODE), helpstring("set XSL mode and it's namespace")] - HRESULT setStartMode([in] BSTR mode, - [in, defaultvalue("")] BSTR namespaceURI); - - [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODE), helpstring("starting XSL mode")] - HRESULT startMode([out, retval] BSTR * mode); - - [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODEURI), helpstring("namespace of starting XSL mode")] - HRESULT startModeURI([out, retval] BSTR * namespaceURI); - - [propput, id(DISPID_XMLDOM_PROCESSOR_OUTPUT), helpstring("custom stream object for transform output")] - HRESULT output([in] VARIANT output); - - [propget, id(DISPID_XMLDOM_PROCESSOR_OUTPUT), helpstring("transform output")] - HRESULT output([out, retval] VARIANT* pOutput); - - [id(DISPID_XMLDOM_PROCESSOR_TRANSFORM), helpstring("start/resume the XSL transformation process")] - HRESULT transform([out,retval] VARIANT_BOOL* pDone); - - [id(DISPID_XMLDOM_PROCESSOR_RESET), helpstring("reset state of processor and abort current transform")] - HRESULT reset(); - - [propget, id(DISPID_XMLDOM_PROCESSOR_READYSTATE), helpstring("current state of the processor")] - HRESULT readyState([out, retval] long* pReadyState); - - [id(DISPID_XMLDOM_PROCESSOR_ADDPARAMETER), helpstring("set values")] - HRESULT addParameter([in] BSTR baseName, - [in] VARIANT parameter, - [in, defaultvalue("")] BSTR namespaceURI); - - [id(DISPID_XMLDOM_PROCESSOR_ADDOBJECT), helpstring("pass object to stylesheet")] - HRESULT addObject([in] IDispatch* obj, - [in] BSTR namespaceURI); - - [propget, id(DISPID_XMLDOM_PROCESSOR_STYLESHEET), helpstring("current stylesheet being used")] - HRESULT stylesheet([out,retval] IXMLDOMNode** stylesheet); -}; - - -[ - local, object, - uuid(2933BF93-7B36-11d2-B20E-00C04F983E60), // IID_IXSLTemplate - odl, - dual, - oleautomation, - nonextensible, - helpstring("IXSLTemplate Interface"), - pointer_default(unique) -] -interface IXSLTemplate : IDispatch -{ - [propputref, id(DISPID_XMLDOM_TEMPLATE_STYLESHEET), helpstring("stylesheet to use with processors")] - HRESULT stylesheet([in] IXMLDOMNode* stylesheet); - - [propget, id(DISPID_XMLDOM_TEMPLATE_STYLESHEET), helpstring("stylesheet to use with processors")] - HRESULT stylesheet([out, retval] IXMLDOMNode** stylesheet); - - [id(DISPID_XMLDOM_TEMPLATE_CREATEPROCESSOR), helpstring("create a new processor object")] - HRESULT createProcessor([out, retval] IXSLProcessor** ppProcessor); -}; - -[ - object, - uuid(ED8C108D-4349-11D2-91A4-00C04F7969E8), - odl, - dual, - oleautomation, - helpstring("IXMLHTTPRequest Interface"), - pointer_default(unique) -] -interface IXMLHTTPRequest : IDispatch -{ - [id(1), helpstring("Open HTTP connection")] HRESULT open([in] BSTR bstrMethod, [in] BSTR bstrUrl, [in,optional] VARIANT varAsync, [in,optional] VARIANT bstrUser, [in,optional] VARIANT bstrPassword); - [id(2), helpstring("Add HTTP request header")] HRESULT setRequestHeader([in] BSTR bstrHeader, [in] BSTR bstrValue); - [id(3), helpstring("Get HTTP response header")] HRESULT getResponseHeader([in] BSTR bstrHeader, [out, retval] BSTR * pbstrValue); - [id(4), helpstring("Get all HTTP response headers")] HRESULT getAllResponseHeaders([out, retval] BSTR * pbstrHeaders); - [id(5), helpstring("Send HTTP request")] HRESULT send([in, optional] VARIANT varBody); - [id(6), helpstring("Abort HTTP request")] HRESULT abort(); - [propget, id(7), helpstring("Get HTTP status code")] HRESULT status([out, retval] long * plStatus); - [propget, id(8), helpstring("Get HTTP status text")] HRESULT statusText([out, retval] BSTR * pbstrStatus); - [propget, id(9), helpstring("Get response body")] HRESULT responseXML([out, retval] IDispatch ** ppBody); - [propget, id(10), helpstring("Get response body")] HRESULT responseText([out, retval] BSTR * pbstrBody); - [propget, id(11), helpstring("Get response body")] HRESULT responseBody([out, retval] VARIANT * pvarBody); - [propget, id(12), helpstring("Get response body")] HRESULT responseStream([out, retval] VARIANT * pvarBody); - [propget, id(13), helpstring("Get ready state")] HRESULT readyState([out, retval] long * plState); - [propput, id(14), helpstring("Register a complete event handler")] HRESULT onreadystatechange([in] IDispatch * pReadyStateSink); -}; - -cpp_quote("#if !defined(__msxml_sxh_enums__)") -cpp_quote("#define __msxml_sxh_enums__") -typedef [ - helpstring("Options for ServerXMLHTTPRequest Option property") -] -enum _SERVERXMLHTTP_OPTION -{ - SXH_OPTION_URL = -1, - SXH_OPTION_URL_CODEPAGE, - SXH_OPTION_ESCAPE_PERCENT_IN_URL, - SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, - SXH_OPTION_SELECT_CLIENT_SSL_CERT -} SERVERXMLHTTP_OPTION; - -typedef [ - helpstring("Flags for SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS option") -] -enum _SXH_SERVER_CERT_OPTION -{ - SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 0x00000100, - SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 0x00000200, - SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 0x00001000, - SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 0x00002000, - SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = (SXH_SERVER_CERT_IGNORE_UNKNOWN_CA - + SXH_SERVER_CERT_IGNORE_WRONG_USAGE - + SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID - + SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID) -} SXH_SERVER_CERT_OPTION; - -typedef [ - helpstring("Settings for setProxy") -] -enum _SXH_PROXY_SETTING -{ - SXH_PROXY_SET_DEFAULT = 0x00000000, - SXH_PROXY_SET_PRECONFIG = 0x00000000, - SXH_PROXY_SET_DIRECT = 0x00000001, - SXH_PROXY_SET_PROXY = 0x00000002 -} SXH_PROXY_SETTING; -cpp_quote("#endif // !defined(__msxml_sxh_enums__)") - - -[ - object, - uuid(2e9196bf-13ba-4dd4-91ca-6c571f281495), - odl, - dual, - oleautomation, - helpstring("IServerXMLHTTPRequest Interface"), - pointer_default(unique) -] -interface IServerXMLHTTPRequest : IXMLHTTPRequest -{ - [id(15), helpstring("Specify timeout settings (in milliseconds)")] - HRESULT setTimeouts([in] long resolveTimeout, [in] long connectTimeout, [in] long sendTimeout, [in] long receiveTimeout); - - [id(16), helpstring("Wait for asynchronous send to complete, with optional timeout (in seconds)")] - HRESULT waitForResponse([in, optional] VARIANT timeoutInSeconds, [out, retval] VARIANT_BOOL * isSuccessful); - - [id(17), helpstring("Get an option value")] - HRESULT getOption([in] SERVERXMLHTTP_OPTION option, [out, retval] VARIANT * value); - - [id(18), helpstring("Set an option value")] - HRESULT setOption([in] SERVERXMLHTTP_OPTION option, [in] VARIANT value); -}; - -[ - object, - uuid(2e01311b-c322-4b0a-bd77-b90cfdc8dce7), - odl, - dual, - oleautomation, - helpstring("IServerXMLHTTPRequest2 Interface"), - pointer_default(unique) -] -interface IServerXMLHTTPRequest2 : IServerXMLHTTPRequest -{ - [id(19), helpstring("Specify proxy configuration")] - HRESULT setProxy( - [in] SXH_PROXY_SETTING proxySetting, - [in, optional] VARIANT varProxyServer, - [in, optional] VARIANT varBypassList); - - [id(20), helpstring("Specify proxy authentication credentials")] - HRESULT setProxyCredentials( - [in] BSTR bstrUserName, - [in] BSTR bstrPassword); -}; - -//+----------------------------------------------------------------------------- -// -// SAX interfaces -// -//------------------------------------------------------------------------------ - -[ - hidden, - object, - local, - uuid(a4f96ed0-f829-476e-81c0-cdc7bd2a0802), // IID_ISAXXMLReader - helpstring("ISAXXMLReader interface"), - pointer_default(unique) -] -interface ISAXXMLReader : IUnknown -{ - HRESULT getFeature( - [in] const wchar_t * pwchName, - [out, retval] VARIANT_BOOL * pvfValue); - HRESULT putFeature( - [in] const wchar_t * pwchName, - [in] VARIANT_BOOL vfValue); - - HRESULT getProperty( - [in] const wchar_t * pwchName, - [out, retval] VARIANT * pvarValue); - HRESULT putProperty( - [in] const wchar_t * pwchName, - [in] VARIANT varValue); - - HRESULT getEntityResolver( - [out, retval] ISAXEntityResolver ** ppResolver); - HRESULT putEntityResolver( - [in] ISAXEntityResolver * pResolver); - - HRESULT getContentHandler( - [out, retval] ISAXContentHandler ** ppHandler); - HRESULT putContentHandler( - [in] ISAXContentHandler * pHandler); - - HRESULT getDTDHandler( - [out, retval] ISAXDTDHandler ** ppHandler); - HRESULT putDTDHandler( - [in] ISAXDTDHandler * pHandler); - - HRESULT getErrorHandler( - [out, retval] ISAXErrorHandler ** ppHandler); - HRESULT putErrorHandler( - [in] ISAXErrorHandler * pHandler); - - HRESULT getBaseURL( - [out, retval] const wchar_t ** ppwchBaseUrl); - HRESULT putBaseURL( - [in] const wchar_t * pwchBaseUrl); - - HRESULT getSecureBaseURL( - [out, retval] const wchar_t ** ppwchSecureBaseUrl); - HRESULT putSecureBaseURL( - [in] const wchar_t * pwchSecureBaseUrl); - - HRESULT parse( - [in, optional] VARIANT varInput); - HRESULT parseURL( - [in] const wchar_t * pwchUrl); -}; - -[ - hidden, - object, - local, - uuid(70409222-ca09-4475-acb8-40312fe8d145), // IID_ISAXXMLFilter - helpstring("ISAXXMLFilter interface"), - pointer_default(unique) -] -interface ISAXXMLFilter : ISAXXMLReader -{ - HRESULT getParent( - [out, retval] ISAXXMLReader ** ppReader); - HRESULT putParent( - [in] ISAXXMLReader * pReader); -}; - -[ - hidden, - object, - local, - uuid(9b7e472a-0de4-4640-bff3-84d38a051c31), // IID_ISAXLocator - helpstring("ISAXLocator interface"), - pointer_default(unique) -] -interface ISAXLocator : IUnknown -{ - HRESULT getColumnNumber( - [out, retval] int * pnColumn); - - HRESULT getLineNumber( - [out, retval] int * pnLine); - - HRESULT getPublicId( - [out, retval] const wchar_t ** ppwchPublicId); - - HRESULT getSystemId( - [out, retval] const wchar_t ** ppwchSystemId); -}; - -[ - hidden, - object, - local, - uuid(99bca7bd-e8c4-4d5f-a0cf-6d907901ff07), // IID_ISAXEntityResolver - helpstring("ISAXEntityResolver interface"), - pointer_default(unique) -] -interface ISAXEntityResolver : IUnknown -{ - HRESULT resolveEntity( - [in] const wchar_t * pwchPublicId, - [in] const wchar_t * pwchSystemId, - [out, retval] VARIANT * pvarInput); -}; - -[ - hidden, - object, - local, - uuid(1545cdfa-9e4e-4497-a8a4-2bf7d0112c44), // IID_ISAXContentHandler - helpstring("ISAXContentHandler interface"), - pointer_default(unique) -] -interface ISAXContentHandler : IUnknown -{ - HRESULT putDocumentLocator( - [in] ISAXLocator * pLocator); - - HRESULT startDocument(); - - HRESULT endDocument(); - - HRESULT startPrefixMapping( - [in] const wchar_t * pwchPrefix, - [in] int cchPrefix, - [in] const wchar_t * pwchUri, - [in] int cchUri); - - HRESULT endPrefixMapping( - [in] const wchar_t * pwchPrefix, - [in] int cchPrefix); - - HRESULT startElement( - [in] const wchar_t * pwchNamespaceUri, - [in] int cchNamespaceUri, - [in] const wchar_t * pwchLocalName, - [in] int cchLocalName, - [in] const wchar_t * pwchQName, - [in] int cchQName, - [in] ISAXAttributes * pAttributes); - - HRESULT endElement( - [in] const wchar_t * pwchNamespaceUri, - [in] int cchNamespaceUri, - [in] const wchar_t * pwchLocalName, - [in] int cchLocalName, - [in] const wchar_t * pwchQName, - [in] int cchQName); - - HRESULT characters( - [in] const wchar_t * pwchChars, - [in] int cchChars); - - HRESULT ignorableWhitespace( - [in] const wchar_t * pwchChars, - [in] int cchChars); - - HRESULT processingInstruction( - [in] const wchar_t * pwchTarget, - [in] int cchTarget, - [in] const wchar_t * pwchData, - [in] int cchData); - - HRESULT skippedEntity( - [in] const wchar_t * pwchName, - [in] int cchName); -}; - -[ - hidden, - object, - local, - uuid(e15c1baf-afb3-4d60-8c36-19a8c45defed), // IID_ISAXDTDHandler - helpstring("ISAXDTDHandler interface"), - pointer_default(unique) -] -interface ISAXDTDHandler : IUnknown -{ - HRESULT notationDecl( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchPublicId, - [in] int cchPublicId, - [in] const wchar_t * pwchSystemId, - [in] int cchSystemId); - - HRESULT unparsedEntityDecl( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchPublicId, - [in] int cchPublicId, - [in] const wchar_t * pwchSystemId, - [in] int cchSystemId, - [in] const wchar_t * pwchNotationName, - [in] int cchNotationName); -}; - -[ - hidden, - object, - local, - uuid(a60511c4-ccf5-479e-98a3-dc8dc545b7d0), // IID_ISAXErrorHandler - helpstring("ISAXErrorHandler interface"), - pointer_default(unique) -] -interface ISAXErrorHandler : IUnknown -{ - HRESULT error( - [in] ISAXLocator * pLocator, - [in] const wchar_t * pwchErrorMessage, - [in] HRESULT hrErrorCode); - - HRESULT fatalError( - [in] ISAXLocator * pLocator, - [in] const wchar_t * pwchErrorMessage, - [in] HRESULT hrErrorCode); - - HRESULT ignorableWarning( - [in] ISAXLocator * pLocator, - [in] const wchar_t * pwchErrorMessage, - [in] HRESULT hrErrorCode); -}; - -[ - hidden, - object, - local, - uuid(7f85d5f5-47a8-4497-bda5-84ba04819ea6), // IID_ISAXLexicalHandler - helpstring("ISAXLexicalHandler interface"), - pointer_default(unique) -] -interface ISAXLexicalHandler : IUnknown -{ - HRESULT startDTD( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchPublicId, - [in] int cchPublicId, - [in] const wchar_t * pwchSystemId, - [in] int cchSystemId); - - HRESULT endDTD(); - - HRESULT startEntity( - [in] const wchar_t * pwchName, - [in] int cchName); - - HRESULT endEntity( - [in] const wchar_t * pwchName, - [in] int cchName); - - HRESULT startCDATA(); - - HRESULT endCDATA(); - - HRESULT comment( - [in] const wchar_t * pwchChars, - [in] int cchChars); -}; - -[ - hidden, - object, - local, - uuid(862629ac-771a-47b2-8337-4e6843c1be90), // IID_ISAXDeclHandler - helpstring("ISAXDeclHandler interface"), - pointer_default(unique) -] -interface ISAXDeclHandler : IUnknown -{ - HRESULT elementDecl( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchModel, - [in] int cchModel); - - HRESULT attributeDecl( - [in] const wchar_t * pwchElementName, - [in] int cchElementName, - [in] const wchar_t * pwchAttributeName, - [in] int cchAttributeName, - [in] const wchar_t * pwchType, - [in] int cchType, - [in] const wchar_t * pwchValueDefault, - [in] int cchValueDefault, - [in] const wchar_t * pwchValue, - [in] int cchValue); - - HRESULT internalEntityDecl( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchValue, - [in] int cchValue); - - HRESULT externalEntityDecl( - [in] const wchar_t * pwchName, - [in] int cchName, - [in] const wchar_t * pwchPublicId, - [in] int cchPublicId, - [in] const wchar_t * pwchSystemId, - [in] int cchSystemId); -}; - -[ - hidden, - object, - local, - uuid(f078abe1-45d2-4832-91ea-4466ce2f25c9), // IID_ISAXAttributes - helpstring("ISAXAttributes interface"), - pointer_default(unique) -] -interface ISAXAttributes : IUnknown -{ - HRESULT getLength( - [out, retval] int * pnLength); - - HRESULT getURI( - [in] int nIndex, - [out] const wchar_t ** ppwchUri, - [out] int * pcchUri); - - HRESULT getLocalName( - [in] int nIndex, - [out] const wchar_t ** ppwchLocalName, - [out] int * pcchLocalName); - - HRESULT getQName( - [in] int nIndex, - [out] const wchar_t ** ppwchQName, - [out] int * pcchQName); - - HRESULT getName( - [in] int nIndex, - [out] const wchar_t ** ppwchUri, - [out] int * pcchUri, - [out] const wchar_t ** ppwchLocalName, - [out] int * pcchLocalName, - [out] const wchar_t ** ppwchQName, - [out] int * pcchQName); - - HRESULT getIndexFromName( - [in] const wchar_t * pwchUri, - [in] int cchUri, - [in] const wchar_t * pwchLocalName, - [in] int cchLocalName, - [out, retval] int * pnIndex); - - HRESULT getIndexFromQName( - [in] const wchar_t * pwchQName, - [in] int cchQName, - [out, retval] int * pnIndex); - - HRESULT getType( - [in] int nIndex, - [out] const wchar_t ** ppwchType, - [out] int * pcchType); - - HRESULT getTypeFromName( - [in] const wchar_t * pwchUri, - [in] int cchUri, - [in] const wchar_t * pwchLocalName, - [in] int cchLocalName, - [out] const wchar_t ** ppwchType, - [out] int * pcchType); - - HRESULT getTypeFromQName( - [in] const wchar_t * pwchQName, - [in] int cchQName, - [out] const wchar_t ** ppwchType, - [out] int * pcchType); - - HRESULT getValue( - [in] int nIndex, - [out] const wchar_t ** ppwchValue, - [out] int * pcchValue); - - HRESULT getValueFromName( - [in] const wchar_t * pwchUri, - [in] int cchUri, - [in] const wchar_t * pwchLocalName, - [in] int cchLocalName, - [out] const wchar_t ** ppwchValue, - [out] int * pcchValue); - - HRESULT getValueFromQName( - [in] const wchar_t * pwchQName, - [in] int cchQName, - [out] const wchar_t ** ppwchValue, - [out] int * pcchValue); -}; - -//+----------------------------------------------------------------------------- -// -// SAX dispatch interfaces -// -//------------------------------------------------------------------------------ - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(8c033caa-6cd6-4f73-b728-4531af74945f), // IID_IVBSAXXMLReader - helpstring("IVBSAXXMLReader interface"), - pointer_default(unique) -] -interface IVBSAXXMLReader : IDispatch -{ - [id(DISPID_SAX_XMLREADER_GETFEATURE), helpstring("Look up the value of a feature.")] - HRESULT getFeature( - [in] BSTR strName, - [out, retval] VARIANT_BOOL * fValue); - [id(DISPID_SAX_XMLREADER_PUTFEATURE), helpstring("Set the state of a feature.")] - HRESULT putFeature( - [in] BSTR strName, - [in] VARIANT_BOOL fValue); - - [id(DISPID_SAX_XMLREADER_GETPROPERTY), helpstring("Look up the value of a property.")] - HRESULT getProperty( - [in] BSTR strName, - [out, retval] VARIANT * varValue); - [id(DISPID_SAX_XMLREADER_PUTPROPERTY), helpstring("Set the value of a property.")] - HRESULT putProperty( - [in] BSTR strName, - [in] VARIANT varValue); - - [propget, id(DISPID_SAX_XMLREADER_ENTITYRESOLVER), helpstring("Allow an application to register an entity resolver or look up the current entity resolver.")] - HRESULT entityResolver( - [out, retval] IVBSAXEntityResolver ** oResolver); - [propputref, id(DISPID_SAX_XMLREADER_ENTITYRESOLVER), helpstring("Allow an application to register an entity resolver or look up the current entity resolver.")] - HRESULT entityResolver( - [in] IVBSAXEntityResolver * oResolver); - - [propget, id(DISPID_SAX_XMLREADER_CONTENTHANDLER), helpstring("Allow an application to register a content event handler or look up the current content event handler.")] - HRESULT contentHandler( - [out, retval] IVBSAXContentHandler ** oHandler); - [propputref, id(DISPID_SAX_XMLREADER_CONTENTHANDLER), helpstring("Allow an application to register a content event handler or look up the current content event handler")] - HRESULT contentHandler( - [in] IVBSAXContentHandler * oHandler); - - [propget, id(DISPID_SAX_XMLREADER_DTDHANDLER), helpstring("Allow an application to register a DTD event handler or look up the current DTD event handler.")] - HRESULT dtdHandler( - [out, retval] IVBSAXDTDHandler ** oHandler); - [propputref, id(DISPID_SAX_XMLREADER_DTDHANDLER), helpstring("Allow an application to register a DTD event handler or look up the current DTD event handler.")] - HRESULT dtdHandler( - [in] IVBSAXDTDHandler * oHandler); - - [propget, id(DISPID_SAX_XMLREADER_ERRORHANDLER), helpstring("Allow an application to register an error event handler or look up the current error event handler.")] - HRESULT errorHandler( - [out, retval] IVBSAXErrorHandler ** oHandler); - [propputref, id(DISPID_SAX_XMLREADER_ERRORHANDLER), helpstring("Allow an application to register an error event handler or look up the current error event handler.")] - HRESULT errorHandler( - [in] IVBSAXErrorHandler * oHandler); - - [propget, id(DISPID_SAX_XMLREADER_BASEURL), helpstring("Set or get the base URL for the document.")] - HRESULT baseURL( - [out, retval] BSTR * strBaseURL); - [propput, id(DISPID_SAX_XMLREADER_BASEURL), helpstring("Set or get the base URL for the document.")] - HRESULT baseURL( - [in] BSTR strBaseURL); - - [propget, id(DISPID_SAX_XMLREADER_SECUREBASEURL), helpstring("Set or get the secure base URL for the document.")] - HRESULT secureBaseURL( - [out, retval] BSTR * strSecureBaseURL); - [propput, id(DISPID_SAX_XMLREADER_SECUREBASEURL), helpstring("Set or get the secure base URL for the document.")] - HRESULT secureBaseURL( - [in] BSTR strSecureBaseURL); - - [id(DISPID_SAX_XMLREADER_PARSE), helpstring("Parse an XML document.")] - HRESULT parse( - [in, optional] VARIANT varInput); - [id(DISPID_SAX_XMLREADER_PARSEURL), helpstring("Parse an XML document from a system identifier (URI).")] - HRESULT parseURL( - [in] BSTR strURL); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(1299eb1b-5b88-433e-82de-82ca75ad4e04), // IID_IVBSAXXMLFilter - helpstring("IVBSAXXMLFilter interface"), - pointer_default(unique) -] -interface IVBSAXXMLFilter : IDispatch -{ - [propget, id(DISPID_SAX_XMLFILTER_PARENT), helpstring("Set or get the parent reader")] - HRESULT parent( - [out, retval] IVBSAXXMLReader ** oReader); - [propputref, id(DISPID_SAX_XMLFILTER_PARENT), helpstring("Set or get the parent reader")] - HRESULT parent( - [in] IVBSAXXMLReader * oReader); - -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(796e7ac5-5aa2-4eff-acad-3faaf01a3288), // IID_IVBSAXLocator - helpstring("IVBSAXLocator interface"), - pointer_default(unique) -] -interface IVBSAXLocator : IDispatch -{ - [propget, id(DISPID_SAX_LOCATOR_COLUMNNUMBER), helpstring("Get the column number where the current document event ends.")] - HRESULT columnNumber( - [out, retval] int * nColumn); - - [propget, id(DISPID_SAX_LOCATOR_LINENUMBER), helpstring("Get the line number where the current document event ends.")] - HRESULT lineNumber( - [out, retval] int * nLine); - - [propget, id(DISPID_SAX_LOCATOR_PUBLICID), helpstring("Get the public identifier for the current document event.")] - HRESULT publicId( - [out, retval] BSTR * strPublicId); - - [propget, id(DISPID_SAX_LOCATOR_SYSTEMID), helpstring("Get the system identifier for the current document event.")] - HRESULT systemId( - [out, retval] BSTR * strSystemId); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(0c05d096-f45b-4aca-ad1a-aa0bc25518dc), // IID_IVBSAXEntityResolver - helpstring("IVBSAXEntityResolver interface"), - pointer_default(unique) -] -interface IVBSAXEntityResolver : IDispatch -{ - [id(DISPID_SAX_ENTITYRESOLVER_RESOLVEENTITY), helpstring("Allow the application to resolve external entities.")] - HRESULT resolveEntity( - [in, out] BSTR * strPublicId, - [in, out] BSTR * strSystemId, - [out, retval] VARIANT * varInput); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(2ed7290a-4dd5-4b46-bb26-4e4155e77faa), // IID_IVBSAXContentHandler - helpstring("IVBSAXContentHandler interface"), - pointer_default(unique) -] -interface IVBSAXContentHandler : IDispatch -{ - [propputref, id(DISPID_SAX_CONTENTHANDLER_DOCUMENTLOCATOR), helpstring("Receive an object for locating the origin of SAX document events.")] - HRESULT documentLocator( - [in] IVBSAXLocator * oLocator); - - [id(DISPID_SAX_CONTENTHANDLER_STARTDOCUMENT), helpstring("Receive notification of the beginning of a document.")] - HRESULT startDocument(); - - [id(DISPID_SAX_CONTENTHANDLER_ENDDOCUMENT), helpstring("Receive notification of the end of a document.")] - HRESULT endDocument(); - - [id(DISPID_SAX_CONTENTHANDLER_STARTPREFIXMAPPING), helpstring("Begin the scope of a prefix-URI Namespace mapping.")] - HRESULT startPrefixMapping( - [in, out] BSTR * strPrefix, - [in, out] BSTR * strURI); - - [id(DISPID_SAX_CONTENTHANDLER_ENDPREFIXMAPPING), helpstring("End the scope of a prefix-URI mapping.")] - HRESULT endPrefixMapping( - [in, out] BSTR * strPrefix); - - [id(DISPID_SAX_CONTENTHANDLER_STARTELEMENT), helpstring("Receive notification of the beginning of an element.")] - HRESULT startElement( - [in, out] BSTR * strNamespaceURI, - [in, out] BSTR * strLocalName, - [in, out] BSTR * strQName, - [in] IVBSAXAttributes * oAttributes); - - [id(DISPID_SAX_CONTENTHANDLER_ENDELEMENT), helpstring("Receive notification of the end of an element.")] - HRESULT endElement( - [in, out] BSTR * strNamespaceURI, - [in, out] BSTR * strLocalName, - [in, out] BSTR * strQName); - - [id(DISPID_SAX_CONTENTHANDLER_CHARACTERS), helpstring("Receive notification of character data.")] - HRESULT characters( - [in, out] BSTR * strChars); - - [id(DISPID_SAX_CONTENTHANDLER_IGNORABLEWHITESPACE), helpstring("Receive notification of ignorable whitespace in element content.")] - HRESULT ignorableWhitespace( - [in, out] BSTR * strChars); - - [id(DISPID_SAX_CONTENTHANDLER_PROCESSINGINSTRUCTION), helpstring("Receive notification of a processing instruction.")] - HRESULT processingInstruction( - [in, out] BSTR * strTarget, - [in, out] BSTR * strData); - - [id(DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY), helpstring("Receive notification of a skipped entity.")] - HRESULT skippedEntity( - [in, out] BSTR * strName); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(24fb3297-302d-4620-ba39-3a732d850558), // IID_IVBSAXDTDHandler - helpstring("IVBSAXDTDHandler interface"), - pointer_default(unique) -] -interface IVBSAXDTDHandler : IDispatch -{ - [id(DISPID_SAX_DTDHANDLER_NOTATIONDECL), helpstring("Receive notification of a notation declaration event.")] - HRESULT notationDecl( - [in, out] BSTR * strName, - [in, out] BSTR * strPublicId, - [in, out] BSTR * strSystemId); - - [id(DISPID_SAX_DTDHANDLER_UNPARSEDENTITYDECL), helpstring("Receive notification of an unparsed entity declaration event.")] - HRESULT unparsedEntityDecl( - [in, out] BSTR * strName, - [in, out] BSTR * strPublicId, - [in, out] BSTR * strSystemId, - [in, out] BSTR * strNotationName); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(d963d3fe-173c-4862-9095-b92f66995f52), // IID_IVBSAXErrorHandler - helpstring("IVBSAXErrorHandler interface"), - pointer_default(unique) -] -interface IVBSAXErrorHandler : IDispatch -{ - [id(DISPID_SAX_ERRORHANDLER_ERROR), helpstring("Receive notification of a recoverable error.")] - HRESULT error( - [in] IVBSAXLocator * oLocator, - [in, out] BSTR * strErrorMessage, - [in] long nErrorCode); - - [id(DISPID_SAX_ERRORHANDLER_FATALERROR), helpstring("Receive notification of a non-recoverable error.")] - HRESULT fatalError( - [in] IVBSAXLocator * oLocator, - [in, out] BSTR * strErrorMessage, - [in] long nErrorCode); - - [id(DISPID_SAX_ERRORHANDLER_IGNORABLEWARNING), helpstring("Receive notification of an ignorable warning.")] - HRESULT ignorableWarning( - [in] IVBSAXLocator * oLocator, - [in, out] BSTR * strErrorMessage, - [in] long nErrorCode); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(032aac35-8c0e-4d9d-979f-e3b702935576), // IID_IVBSAXLexicalHandler - helpstring("IVBSAXLexicalHandler interface"), - pointer_default(unique) -] -interface IVBSAXLexicalHandler : IDispatch -{ - [id(DISPID_SAX_LEXICALHANDLER_STARTDTD), helpstring("Report the start of DTD declarations, if any.")] - HRESULT startDTD( - [in, out] BSTR * strName, - [in, out] BSTR * strPublicId, - [in, out] BSTR * strSystemId); - [id(DISPID_SAX_LEXICALHANDLER_ENDDTD), helpstring("Report the end of DTD declarations.")] - HRESULT endDTD(); - - [id(DISPID_SAX_LEXICALHANDLER_STARTENTITY), helpstring("Report the beginning of some internal and external XML entities.")] - HRESULT startEntity( - [in, out] BSTR * strName); - [id(DISPID_SAX_LEXICALHANDLER_ENDENTITY), helpstring("Report the end of an entity.")] - HRESULT endEntity( - [in, out] BSTR * strName); - - [id(DISPID_SAX_LEXICALHANDLER_STARTCDATA), helpstring("Report the start of a CDATA section.")] - HRESULT startCDATA(); - [id(DISPID_SAX_LEXICALHANDLER_ENDCDATA), helpstring("Report the end of a CDATA section.")] - HRESULT endCDATA(); - - [id(DISPID_SAX_LEXICALHANDLER_COMMENT), helpstring("Report an XML comment anywhere in the document.")] - HRESULT comment( - [in, out] BSTR * strChars); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(e8917260-7579-4be1-b5dd-7afbfa6f077b), // IID_IVBSAXDeclHandler - helpstring("IVBSAXDeclHandler interface"), - pointer_default(unique) -] -interface IVBSAXDeclHandler : IDispatch -{ - [id(DISPID_SAX_DECLHANDLER_ELEMENTDECL), helpstring("Report an element type declaration.")] - HRESULT elementDecl( - [in, out] BSTR * strName, - [in, out] BSTR * strModel); - - [id(DISPID_SAX_DECLHANDLER_ATTRIBUTEDECL), helpstring("Report an attribute type declaration.")] - HRESULT attributeDecl( - [in, out] BSTR * strElementName, - [in, out] BSTR * strAttributeName, - [in, out] BSTR * strType, - [in, out] BSTR * strValueDefault, - [in, out] BSTR * strValue); - - [id(DISPID_SAX_DECLHANDLER_INTERNALENTITYDECL), helpstring("Report an internal entity declaration.")] - HRESULT internalEntityDecl( - [in, out] BSTR * strName, - [in, out] BSTR * strValue); - - [id(DISPID_SAX_DECLHANDLER_EXTERNALENTITYDECL), helpstring("Report a parsed external entity declaration.")] - HRESULT externalEntityDecl( - [in, out] BSTR * strName, - [in, out] BSTR * strPublicId, - [in, out] BSTR * strSystemId); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(10dc0586-132b-4cac-8bb3-db00ac8b7ee0), // IID_IVBSAXAttributes - helpstring("IVBSAXAttributes interface"), - pointer_default(unique) -] -interface IVBSAXAttributes : IDispatch -{ - [propget, id(DISPID_SAX_ATTRIBUTES_LENGTH), helpstring("Get the number of attributes in the list.")] - HRESULT length( - [out, retval] int * nLength); - - [id(DISPID_SAX_ATTRIBUTES_GETURI), helpstring("Look up an attribute's Namespace URI by index.")] - HRESULT getURI( - [in] int nIndex, - [out, retval] BSTR * strURI); - - [id(DISPID_SAX_ATTRIBUTES_GETLOCALNAME), helpstring("Look up an attribute's local name by index.")] - HRESULT getLocalName( - [in] int nIndex, - [out, retval] BSTR * strLocalName); - - [id(DISPID_SAX_ATTRIBUTES_GETQNAME), helpstring("Look up an attribute's XML 1.0 qualified name by index.")] - HRESULT getQName( - [in] int nIndex, - [out, retval] BSTR * strQName); - - [id(DISPID_SAX_ATTRIBUTES_GETINDEXFROMNAME), helpstring("Look up the index of an attribute by Namespace name.")] - HRESULT getIndexFromName( - [in] BSTR strURI, - [in] BSTR strLocalName, - [out, retval] int * nIndex); - - [id(DISPID_SAX_ATTRIBUTES_GETINDEXFROMQNAME), helpstring("Look up the index of an attribute by XML 1.0 qualified name.")] - HRESULT getIndexFromQName( - [in] BSTR strQName, - [out, retval] int * nIndex); - - [id(DISPID_SAX_ATTRIBUTES_GETTYPE), helpstring("Look up an attribute's type by index.")] - HRESULT getType( - [in] int nIndex, - [out, retval] BSTR * strType); - - [id(DISPID_SAX_ATTRIBUTES_GETTYPEFROMNAME), helpstring("Look up an attribute's type by Namespace name.")] - HRESULT getTypeFromName( - [in] BSTR strURI, - [in] BSTR strLocalName, - [out, retval] BSTR * strType); - - [id(DISPID_SAX_ATTRIBUTES_GETTYPEFROMQNAME), helpstring("Look up an attribute's type by XML 1.0 qualified name.")] - HRESULT getTypeFromQName( - [in] BSTR strQName, - [out, retval] BSTR * strType); - - [id(DISPID_SAX_ATTRIBUTES_GETVALUE), helpstring("Look up an attribute's value by index.")] - HRESULT getValue( - [in] int nIndex, - [out, retval] BSTR * strValue); - - [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMNAME), helpstring("Look up an attribute's value by Namespace name.")] - HRESULT getValueFromName( - [in] BSTR strURI, - [in] BSTR strLocalName, - [out, retval] BSTR * strValue); - - [id(DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME), helpstring("Look up an attribute's value by XML 1.0 qualified name.")] - HRESULT getValueFromQName( - [in] BSTR strQName, - [out, retval] BSTR * strValue); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(4d7ff4ba-1565-4ea8-94e1-6e724a46f98d), // IID_IMXWriter - helpstring("IMXWriter interface"), - pointer_default(unique) -] -interface IMXWriter : IDispatch -{ - [propput, id(DISPID_MX_WRITER_OUTPUT), helpstring("Set or get the output.")] - HRESULT output ( - [in] VARIANT varDestination); - [propget, id(DISPID_MX_WRITER_OUTPUT), helpstring("Set or get the output.")] - HRESULT output ( - [out, retval] VARIANT * varDestination); - - [propput, id(DISPID_MX_WRITER_ENCODING), helpstring("Set or get the output encoding.")] - HRESULT encoding ( - [in] BSTR strEncoding); - [propget, id(DISPID_MX_WRITER_ENCODING), helpstring("Set or get the output encoding.")] - HRESULT encoding ( - [out, retval] BSTR * strEncoding); - - [propput, id(DISPID_MX_WRITER_BYTEORDERMARK), helpstring("Determine whether or not to write the byte order mark")] - HRESULT byteOrderMark ( - [in] VARIANT_BOOL fWriteByteOrderMark); - [propget, id(DISPID_MX_WRITER_BYTEORDERMARK), helpstring("Determine whether or not to write the byte order mark")] - HRESULT byteOrderMark ( - [out, retval] VARIANT_BOOL * fWriteByteOrderMark); - - [propput, id(DISPID_MX_WRITER_INDENT), helpstring("Enable or disable auto indent mode.")] - HRESULT indent ( - [in] VARIANT_BOOL fIndentMode); - [propget, id(DISPID_MX_WRITER_INDENT), helpstring("Enable or disable auto indent mode.")] - HRESULT indent ( - [out, retval] VARIANT_BOOL * fIndentMode); - - [propput, id(DISPID_MX_WRITER_STANDALONE), helpstring("Set or get the standalone document declaration.")] - HRESULT standalone ( - [in] VARIANT_BOOL fValue); - [propget, id(DISPID_MX_WRITER_STANDALONE), helpstring("Set or get the standalone document declaration.")] - HRESULT standalone ( - [out, retval] VARIANT_BOOL * fValue); - - [propput, id(DISPID_MX_WRITER_OMITXMLDECLARATION), helpstring("Determine whether or not to omit the XML declaration.")] - HRESULT omitXMLDeclaration ( - [in] VARIANT_BOOL fValue); - [propget, id(DISPID_MX_WRITER_OMITXMLDECLARATION), helpstring("Determine whether or not to omit the XML declaration.")] - HRESULT omitXMLDeclaration ( - [out, retval] VARIANT_BOOL * fValue); - - [propput, id(DISPID_MX_WRITER_VERSION), helpstring("Set or get the xml version info.")] - HRESULT version ( - [in] BSTR strVersion); - [propget, id(DISPID_MX_WRITER_VERSION), helpstring("Set or get the xml version info.")] - HRESULT version ( - [out, retval] BSTR * strVersion); - - [propput, id(DISPID_MX_WRITER_DISABLEOUTPUTESCAPING), helpstring("When enabled, the writer no longer escapes out its input when writing it out.")] - HRESULT disableOutputEscaping( - [in] VARIANT_BOOL fValue); - [propget, id(DISPID_MX_WRITER_DISABLEOUTPUTESCAPING), helpstring("When enabled, the writer no longer escapes out its input when writing it out.")] - HRESULT disableOutputEscaping( - [out, retval] VARIANT_BOOL * fValue); - - [id(DISPID_MX_WRITER_FLUSH), helpstring("Flushes all writer buffers forcing the writer to write to the underlying output object")] - HRESULT flush(); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(f10d27cc-3ec0-415c-8ed8-77ab1c5e7262), // IID_IMXAttributes - helpstring("IMXAttributes interface"), - pointer_default(unique) -] -interface IMXAttributes : IDispatch -{ - [id(DISPID_MX_ATTRIBUTES_ADDATTRIBUTE), helpstring("Add an attribute to the end of the list.")] - HRESULT addAttribute( - [in] BSTR strURI, - [in] BSTR strLocalName, - [in] BSTR strQName, - [in] BSTR strType, - [in] BSTR strValue); - - [id(DISPID_MX_ATTRIBUTES_ADDATTRIBUTEFROMINDEX), helpstring("Add an attribute, whose value is equal to the indexed attribute in the input attributes object, to the end of the list.")] - HRESULT addAttributeFromIndex( - [in] VARIANT varAtts, - [in] int nIndex); - - [id(DISPID_MX_ATTRIBUTES_CLEAR), helpstring("Clear the attribute list for reuse.")] - HRESULT clear(); - - [id(DISPID_MX_ATTRIBUTES_REMOVEATTRIBUTE), helpstring("Remove an attribute from the list.")] - HRESULT removeAttribute( - [in] int nIndex); - - [id(DISPID_MX_ATTRIBUTES_SETATTRIBUTE), helpstring("Set an attribute in the list.")] - HRESULT setAttribute( - [in] int nIndex, - [in] BSTR strURI, - [in] BSTR strLocalName, - [in] BSTR strQName, - [in] BSTR strType, - [in] BSTR strValue); - - [id(DISPID_MX_ATTRIBUTES_SETATTRIBUTES), helpstring("Copy an entire Attributes object.")] - HRESULT setAttributes( - [in] VARIANT varAtts); - - [id(DISPID_MX_ATTRIBUTES_SETLOCALNAME), helpstring("Set the local name of a specific attribute.")] - HRESULT setLocalName( - [in] int nIndex, - [in] BSTR strLocalName); - - [id(DISPID_MX_ATTRIBUTES_SETQNAME), helpstring("Set the qualified name of a specific attribute.")] - HRESULT setQName( - [in] int nIndex, - [in] BSTR strQName); - - [id(DISPID_MX_ATTRIBUTES_SETTYPE), helpstring("Set the type of a specific attribute.")] - HRESULT setType( - [in] int nIndex, - [in] BSTR strType); - - [id(DISPID_MX_ATTRIBUTES_SETURI), helpstring("Set the Namespace URI of a specific attribute.")] - HRESULT setURI( - [in] int nIndex, - [in] BSTR strURI); - - [id(DISPID_MX_ATTRIBUTES_SETVALUE), helpstring("Set the value of a specific attribute.")] - HRESULT setValue( - [in] int nIndex, - [in] BSTR strValue); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(808f4e35-8d5a-4fbe-8466-33a41279ed30), // IID_IMXReaderControl - helpstring("IMXReaderControl interface"), - pointer_default(unique) -] -interface IMXReaderControl : IDispatch -{ - [id(DISPID_MX_READER_CONTROL_ABORT), helpstring("Abort the reader")] - HRESULT abort(); - - [id(DISPID_MX_READER_CONTROL_RESUME), helpstring("Resume the reader")] - HRESULT resume(); - - [id(DISPID_MX_READER_CONTROL_SUSPEND), helpstring("Suspend the reader")] - HRESULT suspend(); -}; - -[ - object, - local, - odl, - dual, - oleautomation, - nonextensible, - uuid(fa4bb38c-faf9-4cca-9302-d1dd0fe520db), // IID_IMXSchemaDeclHandler - helpstring("IMXSchemaDeclHandler interface"), - pointer_default(unique) -] -interface IMXSchemaDeclHandler : IDispatch -{ - [id(DISPID_MX_SCHEMADECLHANDLER_SCHEMAELEMENTDECL), helpstring("Access schema element declaration")] - HRESULT schemaElementDecl( - [in] ISchemaElement * oSchemaElement); -}; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Namespace Manager -[ - local, object, - uuid(c90352f4-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXNamespacePrefixes - helpstring("IMXNamespacePrefixes interface"), - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IMXNamespacePrefixes : IDispatch -{ - [propget, id(DISPID_VALUE)] HRESULT item([in]long index, [out,retval]BSTR* prefix); - [propget, id(DISPID_MX_NSMGR_LENGTH)] HRESULT length([out,retval]long* length); - [propget, restricted, hidden, id(DISPID_NEWENUM)] HRESULT _newEnum([out,retval]IUnknown** ppUnk); -}; - -[ - local, object, - uuid(c90352f5-643c-4fbc-bb23-e996eb2d51fd), // IID_IVBMXNamespaceManager - helpstring("IVBMXNamespaceManager interface"), - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IVBMXNamespaceManager : IDispatch -{ - [propput, id(DISPID_MX_NSMGR_ALLOWOVERRIDE)] - HRESULT allowOverride([in] VARIANT_BOOL fOverride); - - [propget, id(DISPID_MX_NSMGR_ALLOWOVERRIDE)] - HRESULT allowOverride([out,retval] VARIANT_BOOL* fOverride); - - [id(DISPID_MX_NSMGR_RESET)] - HRESULT reset(); - - [id(DISPID_MX_NSMGR_PUSHCONTEXT)] - HRESULT pushContext(); - - [id(DISPID_MX_NSMGR_PUSHNODECONTEXT)] - HRESULT pushNodeContext( - [in] IXMLDOMNode* contextNode, - [in, defaultvalue(-1)] VARIANT_BOOL fDeep); - - [id(DISPID_MX_NSMGR_POPCONTEXT)] - HRESULT popContext(); - - [id(DISPID_MX_NSMGR_DECLAREPREFIX)] - HRESULT declarePrefix( - [in] BSTR prefix, - [in] BSTR namespaceURI); - - [id(DISPID_MX_NSMGR_GETDECLAREDPREFIXES)] - HRESULT getDeclaredPrefixes( - [out, retval] IMXNamespacePrefixes** prefixes); - - [id(DISPID_MX_NSMGR_GETPREFIXES)] - HRESULT getPrefixes( - [in] BSTR namespaceURI, - [out, retval] IMXNamespacePrefixes** prefixes); - - [id(DISPID_MX_NSMGR_GETURI)] - HRESULT getURI( - [in] BSTR prefix, - [out, retval] VARIANT* uri); - - [id(DISPID_MX_NSMGR_GETURIFROMNODE)] - HRESULT getURIFromNode( - [in] BSTR strPrefix, - [in] IXMLDOMNode* contextNode, - [out, retval] VARIANT* uri); -}; - -[ - hidden, - object, - local, - uuid(c90352f6-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXNamespaceManager - helpstring("IMXNamespaceManager interface"), - pointer_default(unique) -] -interface IMXNamespaceManager : IUnknown -{ - HRESULT putAllowOverride([in] VARIANT_BOOL fOverride); - - HRESULT getAllowOverride([out,retval] VARIANT_BOOL* fOverride); - - HRESULT reset(); - - HRESULT pushContext(); - - HRESULT pushNodeContext( - [in] IXMLDOMNode* contextNode, - [in] VARIANT_BOOL fDeep); - - HRESULT popContext(); - - HRESULT declarePrefix( - [in] const wchar_t* prefix, - [in] const wchar_t* namespaceURI); - - HRESULT getDeclaredPrefix( - [in] long nIndex, - [in, out] wchar_t* pwchPrefix, - [in, out] int* pcchPrefix); - - HRESULT getPrefix( - [in] const wchar_t* pwszNamespaceURI, - [in] long nIndex, - [in, out] wchar_t* pwchPrefix, - [in, out] int* pcchPrefix); - - HRESULT getURI( - [in] const wchar_t* pwchPrefix, - [in] IXMLDOMNode* pContextNode, - [in, out] wchar_t* pwchUri, - [in, out] int* pcchUri); -}; - -[ - local, object, - uuid(c90352f7-643c-4fbc-bb23-e996eb2d51fd), // IID_IMXXMLFilter - helpstring("IMXXMLFilter interface"), - odl, - dual, - oleautomation, - nonextensible, - pointer_default(unique) -] -interface IMXXMLFilter : IDispatch -{ - [id(DISPID_MXXML_FILTER_GETFEATURE)] HRESULT getFeature( [in] BSTR strName, [out, retval] VARIANT_BOOL * fValue); - [id(DISPID_MXXML_FILTER_PUTFEATURE)] HRESULT putFeature( [in] BSTR strName, [in] VARIANT_BOOL fValue); - - [id(DISPID_MXXML_FILTER_GETPROPERTY)] HRESULT getProperty( [in] BSTR strName, [out, retval] VARIANT * varValue); - [id(DISPID_MXXML_FILTER_PUTPROPERTY)] HRESULT putProperty( [in] BSTR strName, [in] VARIANT varValue); - - [id(DISPID_MXXML_FILTER_ENTITYRESOLVER), propget] HRESULT entityResolver( [out, retval] IUnknown ** oResolver); - [id(DISPID_MXXML_FILTER_ENTITYRESOLVER), propputref] HRESULT entityResolver( [in] IUnknown * oResolver); - [id(DISPID_MXXML_FILTER_CONTENTHANDLER), propget] HRESULT contentHandler( [out, retval] IUnknown ** oHandler); - [id(DISPID_MXXML_FILTER_CONTENTHANDLER), propputref] HRESULT contentHandler( [in] IUnknown * oHandler); - [id(DISPID_MXXML_FILTER_DTDHANDLER), propget] HRESULT dtdHandler( [out, retval] IUnknown ** oHandler); - [id(DISPID_MXXML_FILTER_DTDHANDLER), propputref] HRESULT dtdHandler( [in] IUnknown * oHandler); - [id(DISPID_MXXML_FILTER_ERRORHANDLER), propget] HRESULT errorHandler( [out, retval] IUnknown ** oHandler); - [id(DISPID_MXXML_FILTER_ERRORHANDLER), propputref] HRESULT errorHandler( [in] IUnknown * oHandler); -}; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Schema Object Model -cpp_quote("#if !defined(__msxml_som_enums__)") -cpp_quote("#define __msxml_som_enums__") -typedef [ - helpstring("Schema Object Model Item Types") -] -enum _SOMITEMTYPE -{ - SOMITEM_SCHEMA = 0x1000, - SOMITEM_ATTRIBUTE = 0x1001, - SOMITEM_ATTRIBUTEGROUP = 0x1002, - SOMITEM_NOTATION = 0x1003, - SOMITEM_ANNOTATION = 0x1004, - - SOMITEM_IDENTITYCONSTRAINT = 0x1100, // identity constraints - SOMITEM_KEY = 0x1101, - SOMITEM_KEYREF = 0x1102, - SOMITEM_UNIQUE = 0x1103, - - SOMITEM_ANYTYPE = 0x2000, // Types - SOMITEM_DATATYPE = 0x2100, - SOMITEM_DATATYPE_ANYTYPE = 0x2101, - SOMITEM_DATATYPE_ANYURI = 0x2102, - SOMITEM_DATATYPE_BASE64BINARY = 0x2103, - SOMITEM_DATATYPE_BOOLEAN = 0x2104, - SOMITEM_DATATYPE_BYTE = 0x2105, - SOMITEM_DATATYPE_DATE = 0x2106, - SOMITEM_DATATYPE_DATETIME = 0x2107, - SOMITEM_DATATYPE_DAY = 0x2108, - SOMITEM_DATATYPE_DECIMAL = 0x2109, - SOMITEM_DATATYPE_DOUBLE = 0x210A, - SOMITEM_DATATYPE_DURATION = 0x210B, - SOMITEM_DATATYPE_ENTITIES = 0x210C, - SOMITEM_DATATYPE_ENTITY = 0x210D, - SOMITEM_DATATYPE_FLOAT = 0x210E, - SOMITEM_DATATYPE_HEXBINARY = 0x210F, - SOMITEM_DATATYPE_ID = 0x2110, - SOMITEM_DATATYPE_IDREF = 0x2111, - SOMITEM_DATATYPE_IDREFS = 0x2112, - SOMITEM_DATATYPE_INT = 0x2113, - SOMITEM_DATATYPE_INTEGER = 0x2114, - SOMITEM_DATATYPE_LANGUAGE = 0x2115, - SOMITEM_DATATYPE_LONG = 0x2116, - SOMITEM_DATATYPE_MONTH = 0x2117, - SOMITEM_DATATYPE_MONTHDAY = 0x2118, - SOMITEM_DATATYPE_NAME = 0x2119, - SOMITEM_DATATYPE_NCNAME = 0x211A, - SOMITEM_DATATYPE_NEGATIVEINTEGER = 0x211B, - SOMITEM_DATATYPE_NMTOKEN = 0x211C, - SOMITEM_DATATYPE_NMTOKENS = 0x211D, - SOMITEM_DATATYPE_NONNEGATIVEINTEGER = 0x211E, - SOMITEM_DATATYPE_NONPOSITIVEINTEGER = 0x211F, - SOMITEM_DATATYPE_NORMALIZEDSTRING = 0x2120, - SOMITEM_DATATYPE_NOTATION = 0x2121, - SOMITEM_DATATYPE_POSITIVEINTEGER = 0x2122, - SOMITEM_DATATYPE_QNAME = 0x2123, - SOMITEM_DATATYPE_SHORT = 0x2124, - SOMITEM_DATATYPE_STRING = 0x2125, - SOMITEM_DATATYPE_TIME = 0x2126, - SOMITEM_DATATYPE_TOKEN = 0x2127, - SOMITEM_DATATYPE_UNSIGNEDBYTE = 0x2128, - SOMITEM_DATATYPE_UNSIGNEDINT = 0x2129, - SOMITEM_DATATYPE_UNSIGNEDLONG = 0x212A, - SOMITEM_DATATYPE_UNSIGNEDSHORT = 0x212B, - SOMITEM_DATATYPE_YEAR = 0x212C, - SOMITEM_DATATYPE_YEARMONTH = 0x212D, - SOMITEM_DATATYPE_ANYSIMPLETYPE = 0x21FF, - - SOMITEM_SIMPLETYPE = 0x2200, - SOMITEM_COMPLEXTYPE = 0x2400, - - SOMITEM_PARTICLE = 0x4000, // particles - SOMITEM_ANY = 0x4001, - SOMITEM_ANYATTRIBUTE = 0x4002, - SOMITEM_ELEMENT = 0x4003, - - SOMITEM_GROUP = 0x4100, // groups : particles - SOMITEM_ALL = 0x4101, - SOMITEM_CHOICE = 0x4102, - SOMITEM_SEQUENCE = 0x4103, - SOMITEM_EMPTYPARTICLE = 0x4104, - - SOMITEM_NULL = 0x0800, // null items - SOMITEM_NULL_TYPE = 0x2800, - SOMITEM_NULL_ANY = 0x4801, - SOMITEM_NULL_ANYATTRIBUTE = 0x4802, - SOMITEM_NULL_ELEMENT = 0x4803, -} SOMITEMTYPE; - -typedef [ - helpstring("Schema Object Model Attribute Uses") -] -enum _SCHEMAUSE -{ - SCHEMAUSE_OPTIONAL, // 0 - SCHEMAUSE_PROHIBITED, // 1 - SCHEMAUSE_REQUIRED, // 2 -} SCHEMAUSE; - -typedef [ - helpstring("Schema Object Model Filters") -] enum _SCHEMADERIVATIONMETHOD -{ - SCHEMADERIVATIONMETHOD_EMPTY = 0x0000, - SCHEMADERIVATIONMETHOD_SUBSTITUTION = 0x0001, - SCHEMADERIVATIONMETHOD_EXTENSION = 0x0002, - SCHEMADERIVATIONMETHOD_RESTRICTION = 0x0004, - SCHEMADERIVATIONMETHOD_LIST = 0x0008, - SCHEMADERIVATIONMETHOD_UNION = 0x0010, - SCHEMADERIVATIONMETHOD_ALL = 0x00FF, - SCHEMADERIVATIONMETHOD_NONE = 0x0100, -} SCHEMADERIVATIONMETHOD; - -typedef [ - helpstring("Schema Object Model Content Types") -] enum _SCHEMACONTENTTYPE -{ - SCHEMACONTENTTYPE_EMPTY, - SCHEMACONTENTTYPE_TEXTONLY, - SCHEMACONTENTTYPE_ELEMENTONLY, - SCHEMACONTENTTYPE_MIXED, -} SCHEMACONTENTTYPE; - -typedef [ - helpstring("Schema Object Model Process Contents") -] enum _SCHEMAPROCESSCONTENTS -{ - SCHEMAPROCESSCONTENTS_NONE, - SCHEMAPROCESSCONTENTS_SKIP, - SCHEMAPROCESSCONTENTS_LAX, - SCHEMAPROCESSCONTENTS_STRICT, -} SCHEMAPROCESSCONTENTS; - -typedef [ - helpstring("Schema Object Model Whitespace facet values") -] enum _SCHEMAWHITESPACE -{ - SCHEMAWHITESPACE_NONE = -1, - SCHEMAWHITESPACE_PRESERVE = 0, - SCHEMAWHITESPACE_REPLACE = 1, - SCHEMAWHITESPACE_COLLAPSE = 2, -} SCHEMAWHITESPACE; - - -typedef [ - helpstring("Schema Object Model Type variety values") -] enum _SCHEMATYPEVARIETY -{ - SCHEMATYPEVARIETY_NONE = -1, - SCHEMATYPEVARIETY_ATOMIC = 0, - SCHEMATYPEVARIETY_LIST = 1, - SCHEMATYPEVARIETY_UNION = 2, -}SCHEMATYPEVARIETY; -cpp_quote("#endif // !defined(__msxml_som_enums__)") - -[ - local, object, - uuid(50ea08b0-dd1b-4664-9a50-c2f40f4bd79a), // IID_IXMLDOMSchemaCollection2 - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schemas Collection 2"), - pointer_default(unique) -] -interface IXMLDOMSchemaCollection2 : IXMLDOMSchemaCollection -{ - [id(DISPID_SOM_VALIDATE)] HRESULT validate(); - [id(DISPID_SOM_VALIDATEONLOAD), propput] HRESULT validateOnLoad([in]VARIANT_BOOL validateOnLoad); - [id(DISPID_SOM_VALIDATEONLOAD), propget] HRESULT validateOnLoad([out,retval]VARIANT_BOOL* validateOnLoad); - [id(DISPID_SOM_GETSCHEMA)] HRESULT getSchema([in]BSTR namespaceURI, [out,retval]ISchema** schema); - [id(DISPID_SOM_GETDECLARATION)] HRESULT getDeclaration([in]IXMLDOMNode* node, [out,retval]ISchemaItem** item); -}; - -[ - local, object, - uuid(50ea08b1-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaStringCollection - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema String Collection"), - pointer_default(unique) -] -interface ISchemaStringCollection : IDispatch -{ - [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]BSTR* bstr); - [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]long* length); - [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown** ppunk); -}; - -[ - local, object, - uuid(50ea08b2-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaItemCollection - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Item Collection"), - pointer_default(unique) -] -interface ISchemaItemCollection : IDispatch -{ - [id(DISPID_VALUE), propget] HRESULT item([in]long index, [out,retval]ISchemaItem** item); - [id(DISPID_SOM_ITEMBYNAME)] HRESULT itemByName([in]BSTR name, [out,retval]ISchemaItem** item); - [id(DISPID_SOM_ITEMBYQNAME)] HRESULT itemByQName([in]BSTR name, [in]BSTR namespaceURI, [out,retval]ISchemaItem** item); - [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]long* length); - [id(DISPID_NEWENUM), hidden, restricted, propget] HRESULT _newEnum([out,retval]IUnknown** ppunk); -}; - -[ - local, object, - uuid(50ea08b3-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaItem - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Item"), - pointer_default(unique) -] -interface ISchemaItem : IDispatch -{ - [id(DISPID_SOM_NAME), propget] HRESULT name([out,retval]BSTR* name); - [id(DISPID_SOM_NAMESPACEURI), propget] HRESULT namespaceURI([out,retval]BSTR* namespaceURI); - [id(DISPID_SOM_SCHEMA), propget] HRESULT schema([out,retval]ISchema** schema); - [id(DISPID_SOM_ID), propget] HRESULT id([out,retval]BSTR* id); - [id(DISPID_SOM_ITEMTYPE), propget] HRESULT itemType([out,retval]SOMITEMTYPE* itemType); - [id(DISPID_SOM_UNHANDLEDATTRS), propget] HRESULT unhandledAttributes([out,retval]IVBSAXAttributes** attributes); - [id(DISPID_SOM_WRITEANNOTATION)] HRESULT writeAnnotation([in]IUnknown* annotationSink, [out,retval]VARIANT_BOOL* isWritten); -}; - -[ - local, object, - uuid(50ea08b4-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchema - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema"), - pointer_default(unique) -] -interface ISchema : ISchemaItem -{ - [id(DISPID_SOM_TARGETNAMESPACE), propget] HRESULT targetNamespace([out,retval]BSTR* targetNamespace); - [id(DISPID_SOM_VERSION), propget] HRESULT version([out,retval]BSTR* version); - [id(DISPID_SOM_TYPES), propget] HRESULT types([out,retval]ISchemaItemCollection** types); - [id(DISPID_SOM_ELEMENTS), propget] HRESULT elements([out,retval]ISchemaItemCollection** elements); - [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); - [id(DISPID_SOM_ATTRIBUTEGROUPS), propget] HRESULT attributeGroups([out,retval]ISchemaItemCollection** attributeGroups); - [id(DISPID_SOM_MODELGROUPS), propget] HRESULT modelGroups([out,retval]ISchemaItemCollection** modelGroups); - [id(DISPID_SOM_NOTATIONS), propget] HRESULT notations([out,retval]ISchemaItemCollection** notations); - [id(DISPID_SOM_SCHEMALOCATIONS), propget] HRESULT schemaLocations([out,retval]ISchemaStringCollection** schemaLocations); -}; - -[ - local, object, - uuid(50ea08b5-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaParticle - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Particle"), - pointer_default(unique) -] -interface ISchemaParticle : ISchemaItem -{ - [id(DISPID_SOM_MINOCCURS), propget] HRESULT minOccurs([out,retval]VARIANT* minOccurs); - [id(DISPID_SOM_MAXOCCURS), propget] HRESULT maxOccurs([out,retval]VARIANT* maxOccurs); -}; - -[ - local, object, - uuid(50ea08b6-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAttribute - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Attribute"), - pointer_default(unique) -] -interface ISchemaAttribute : ISchemaItem -{ - [id(DISPID_SOM_TYPE), propget] HRESULT type([out,retval]ISchemaType** type); - [id(DISPID_SOM_SCOPE), propget] HRESULT scope([out,retval]ISchemaComplexType** scope); - [id(DISPID_SOM_DEFAULTVALUE), propget] HRESULT defaultValue([out,retval]BSTR* defaultValue); - [id(DISPID_SOM_FIXEDVALUE), propget] HRESULT fixedValue([out,retval]BSTR* fixedValue); - [id(DISPID_SOM_USE), propget] HRESULT use([out,retval]SCHEMAUSE* use); - [id(DISPID_SOM_ISREFERENCE), propget] HRESULT isReference([out,retval]VARIANT_BOOL* reference); -}; - -[ - local, object, - uuid(50ea08b7-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaElement - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Element"), - pointer_default(unique) -] -interface ISchemaElement : ISchemaParticle -{ - [id(DISPID_SOM_TYPE), propget] HRESULT type([out,retval]ISchemaType** type); - [id(DISPID_SOM_SCOPE), propget] HRESULT scope([out,retval]ISchemaComplexType** scope); - [id(DISPID_SOM_DEFAULTVALUE), propget] HRESULT defaultValue([out,retval]BSTR* defaultValue); - [id(DISPID_SOM_FIXEDVALUE), propget] HRESULT fixedValue([out,retval]BSTR* fixedValue); - [id(DISPID_SOM_ISNILLABLE), propget] HRESULT isNillable([out,retval]VARIANT_BOOL* nillable); - [id(DISPID_SOM_IDCONSTRAINTS), propget] HRESULT identityConstraints([out,retval]ISchemaItemCollection** constraints); - [id(DISPID_SOM_SUBSTITUTIONGROUP), propget] HRESULT substitutionGroup([out,retval]ISchemaElement** element); - [id(DISPID_SOM_EXCLUSIONS), propget] HRESULT substitutionGroupExclusions([out,retval]SCHEMADERIVATIONMETHOD* exclusions); - [id(DISPID_SOM_DISALLOWED), propget] HRESULT disallowedSubstitutions([out,retval]SCHEMADERIVATIONMETHOD* disallowed); - [id(DISPID_SOM_ISABSTRACT), propget] HRESULT isAbstract([out,retval]VARIANT_BOOL* abstract); - [id(DISPID_SOM_ISREFERENCE), propget] HRESULT isReference([out,retval]VARIANT_BOOL* reference); -}; - -[ - local, object, - uuid(50ea08b8-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaType - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Type"), - pointer_default(unique) -] -interface ISchemaType : ISchemaItem -{ - [id(DISPID_SOM_BASETYPES), propget] HRESULT baseTypes([out,retval]ISchemaItemCollection** baseTypes); - [id(DISPID_SOM_FINAL), propget] HRESULT final([out,retval]SCHEMADERIVATIONMETHOD* final); - [id(DISPID_SOM_VARIETY), propget] HRESULT variety([out,retval]SCHEMATYPEVARIETY* variety); - [id(DISPID_SOM_DERIVEDBY), propget] HRESULT derivedBy([out,retval]SCHEMADERIVATIONMETHOD* derivedBy); - [id(DISPID_SOM_ISVALID)] HRESULT isValid([in]BSTR data, [out,retval]VARIANT_BOOL* valid); - // Facets - [id(DISPID_SOM_MINEXCLUSIVE), propget] HRESULT minExclusive([out,retval]BSTR* minExclusive); - [id(DISPID_SOM_MININCLUSIVE), propget] HRESULT minInclusive([out,retval]BSTR* minInclusive); - [id(DISPID_SOM_MAXEXCLUSIVE), propget] HRESULT maxExclusive([out,retval]BSTR* maxExclusive); - [id(DISPID_SOM_MAXINCLUSIVE), propget] HRESULT maxInclusive([out,retval]BSTR* maxInclusive); - [id(DISPID_SOM_TOTALDIGITS), propget] HRESULT totalDigits([out,retval]VARIANT* totalDigits); - [id(DISPID_SOM_FRACTIONDIGITS), propget] HRESULT fractionDigits([out,retval]VARIANT* fractionDigits); - [id(DISPID_SOM_LENGTH), propget] HRESULT length([out,retval]VARIANT* length); - [id(DISPID_SOM_MINLENGTH), propget] HRESULT minLength([out,retval]VARIANT* minLength); - [id(DISPID_SOM_MAXLENGTH), propget] HRESULT maxLength([out,retval]VARIANT* maxLength); - [id(DISPID_SOM_ENUMERATION), propget] HRESULT enumeration([out,retval]ISchemaStringCollection** enumeration); - [id(DISPID_SOM_WHITESPACE), propget] HRESULT whitespace([out,retval]SCHEMAWHITESPACE* whitespace); - [id(DISPID_SOM_PATTERNS), propget] HRESULT patterns([out,retval]ISchemaStringCollection** patterns); -}; - -[ - local, object, - uuid(50ea08b9-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaComplexType - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Complex Type"), - pointer_default(unique) -] -interface ISchemaComplexType : ISchemaType -{ - [id(DISPID_SOM_ISABSTRACT), propget] HRESULT isAbstract([out,retval]VARIANT_BOOL* abstract); - [id(DISPID_SOM_ANYATTRIBUTE), propget] HRESULT anyAttribute([out,retval]ISchemaAny** anyAttribute); - [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); - [id(DISPID_SOM_CONTENTTYPE), propget] HRESULT contentType([out,retval]SCHEMACONTENTTYPE* contentType); - [id(DISPID_SOM_CONTENTMODEL), propget] HRESULT contentModel([out,retval]ISchemaModelGroup** contentModel); - [id(DISPID_SOM_PROHIBITED), propget] HRESULT prohibitedSubstitutions([out,retval]SCHEMADERIVATIONMETHOD* prohibited); -}; - -[ - local, object, - uuid(50ea08ba-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAttributeGroup - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Attribute Group"), - pointer_default(unique) -] -interface ISchemaAttributeGroup : ISchemaItem -{ - [id(DISPID_SOM_ANYATTRIBUTE), propget] HRESULT anyAttribute([out,retval]ISchemaAny** anyAttribute); - [id(DISPID_SOM_ATTRIBUTES), propget] HRESULT attributes([out,retval]ISchemaItemCollection** attributes); -}; - -[ - local, object, - uuid(50ea08bb-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaModelGroup - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Type"), - pointer_default(unique) -] -interface ISchemaModelGroup : ISchemaParticle -{ - [id(DISPID_SOM_PARTICLES), propget] HRESULT particles([out,retval]ISchemaItemCollection** particles); -}; - -[ - local, object, - uuid(50ea08bc-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaAny - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Any"), - pointer_default(unique) -] -interface ISchemaAny : ISchemaParticle -{ - [id(DISPID_SOM_NAMESPACES), propget] HRESULT namespaces([out,retval]ISchemaStringCollection** namespaces); - [id(DISPID_SOM_PROCESSCONTENTS), propget] HRESULT processContents([out,retval]SCHEMAPROCESSCONTENTS* processContents); -}; - -[ - local, object, - uuid(50ea08bd-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaIdentityConstraint - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Any"), - pointer_default(unique) -] -interface ISchemaIdentityConstraint : ISchemaItem -{ - [id(DISPID_SOM_SELECTOR), propget] HRESULT selector([out,retval]BSTR* selector); - [id(DISPID_SOM_FIELDS), propget] HRESULT fields([out,retval]ISchemaStringCollection** fields); - [id(DISPID_SOM_REFERENCEDKEY), propget] HRESULT referencedKey([out,retval]ISchemaIdentityConstraint** key); -}; - -[ - local, object, - uuid(50ea08be-dd1b-4664-9a50-c2f40f4bd79a), // IID_ISchemaNotation - odl, - dual, - oleautomation, - nonextensible, - helpstring("XML Schema Notation"), - pointer_default(unique) -] -interface ISchemaNotation : ISchemaItem -{ - [id(DISPID_SOM_SYSTEMIDENTIFIER), propget] HRESULT systemIdentifier([out,retval]BSTR* uri); - [id(DISPID_SOM_PUBLICIDENTIFIER), propget] HRESULT publicIdentifier([out,retval]BSTR* uri); -}; - -//+------------------------------------------------------------------------- -// -// CoClasses -// -//-------------------------------------------------------------------------- - - -// DOM Document rental-model co-Class, version independent -[ - uuid(F6D90F11-9C73-11D3-B32E-00C04F990BB4), // CLSID_DOMDocument - helpstring("W3C-DOM XML Document (Apartment)") -] -coclass DOMDocument -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document rental-model co-Class, 2.6 version dependent -[ - uuid(f5078f1b-c551-11d3-89b9-0000f81fe221), // CLSID_DOMDocument26 - helpstring("W3C-DOM XML Document (Apartment)") -] -coclass DOMDocument26 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document rental-model co-Class, 3.0 version dependent -[ - uuid(f5078f32-c551-11d3-89b9-0000f81fe221), // CLSID_DOMDocument30 - helpstring("W3C-DOM XML Document (Apartment)") -] -coclass DOMDocument30 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document rental-model co-Class, 4.0 version dependent -[ - uuid(88d969c0-f192-11d4-a65f-0040963251e5), // CLSID_DOMDocument40 - helpstring("W3C-DOM XML Document (Apartment)") -] -coclass DOMDocument40 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -[ - uuid(88d96a05-f192-11d4-a65f-0040963251e5), // CLSID_DOMDocument60 - helpstring("W3C-DOM XML Document 6.0 (Apartment)") -] -coclass DOMDocument60 -{ - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document free-threaded co-Class, version independent -[ - uuid(F6D90F12-9C73-11D3-B32E-00C04F990BB4), // CLSID_FreeThreadedDOMDocument - helpstring("W3C-DOM XML Document (Free threaded)") -] -coclass FreeThreadedDOMDocument -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document free-threaded co-Class, 2.6 version dependent -[ - uuid(f5078f1c-c551-11d3-89b9-0000f81fe221), // CLSID_FreeThreadedDOMDocument26 - helpstring("W3C-DOM XML Document (Free threaded)") -] -coclass FreeThreadedDOMDocument26 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document free-threaded co-Class, 3.0 version dependent -[ - uuid(f5078f33-c551-11d3-89b9-0000f81fe221), // CLSID_FreeThreadedDOMDocument30 - helpstring("W3C-DOM XML Document (Free threaded)") -] -coclass FreeThreadedDOMDocument30 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// DOM Document free-threaded co-Class, 4.0 version dependent -[ - uuid(88d969c1-f192-11d4-a65f-0040963251e5), // CLSID_FreeThreadedDOMDocument40 - helpstring("W3C-DOM XML Document (Free threaded)") -] -coclass FreeThreadedDOMDocument40 -{ - [default] interface IXMLDOMDocument2; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -[ - uuid(88d96a06-f192-11d4-a65f-0040963251e5), // CLSID_FreeThreadedDOMDocument60 - helpstring("W3C-DOM XML Document 6.0 (Free threaded)") -] -coclass FreeThreadedDOMDocument60 -{ - [default] interface IXMLDOMDocument3; - [default, source] dispinterface XMLDOMDocumentEvents; -}; - -// XML Schema Cache, version independent -[ - uuid(373984c9-b845-449b-91e7-45ac83036ade), - helpstring("XML Schema Cache") -] -coclass XMLSchemaCache -{ - [default] interface IXMLDOMSchemaCollection; -}; - -// XML Schema Cache, version 2.6 dependent -[ - uuid(f5078f1d-c551-11d3-89b9-0000f81fe221), - helpstring("XML Schema Cache 2.6") -] -coclass XMLSchemaCache26 -{ - [default] interface IXMLDOMSchemaCollection; -}; - -// XML Schema Cache, version 3.0 dependent -[ - uuid(f5078f34-c551-11d3-89b9-0000f81fe221), - helpstring("XML Schema Cache 3.0") -] -coclass XMLSchemaCache30 -{ - [default] interface IXMLDOMSchemaCollection; -}; - -// XML Schema Cache, version 4.0 dependent -[ - uuid(88d969c2-f192-11d4-a65f-0040963251e5), - helpstring("XML Schema Cache 4.0") -] -coclass XMLSchemaCache40 -{ - [default] interface IXMLDOMSchemaCollection2; -}; - -[ - uuid(88d96a07-f192-11d4-a65f-0040963251e5), // CLSID_XMLSchemaCache60 - helpstring("XML Schema Cache 6.0") -] -coclass XMLSchemaCache60 -{ - [default] interface IXMLDOMSchemaCollection2; -}; - -// XSLTemplate, version independent -[ - uuid(2933BF94-7B36-11d2-B20E-00C04F983E60), // CLSID_XMLDOMXSLTemplate (Progid=Msxml2.XMLDOMXSLTemplate) - helpstring("Compiled XSL Stylesheet Cache") -] -coclass XSLTemplate -{ - [default] interface IXSLTemplate; -}; - -// XSLTemplate, 2.6 version dependent -[ - uuid(f5078f21-c551-11d3-89b9-0000f81fe221), // CLSID_XMLDOMXSLTemplate (Progid=Microsoft.XMLDOMXSLTemplate) - helpstring("Compiled XSL Stylesheet Cache 2.6") -] -coclass XSLTemplate26 -{ - [default] interface IXSLTemplate; -}; - -// XSLTemplate, 3.0 version dependent -[ - uuid(f5078f36-c551-11d3-89b9-0000f81fe221), // CLSID_XMLDOMXSLTemplate30 (Progid=Msxml2.XMLDOMXSLTemplate.3.0) - helpstring("Compiled XSL Stylesheet Cache 3.0") -] -coclass XSLTemplate30 -{ - [default] interface IXSLTemplate; -}; - -// XSLTemplate, 4.0 version dependent -[ - uuid(88d969c3-f192-11d4-a65f-0040963251e5), // CLSID_XMLDOMXSLTemplate40 (Progid=Msxml2.XMLDOMXSLTemplate.4.0) - helpstring("Compiled XSL Stylesheet Cache 4.0") -] -coclass XSLTemplate40 -{ - [default] interface IXSLTemplate; -}; - -[ - uuid(88d96a08-f192-11d4-a65f-0040963251e5), // CLSID_XSLTemplate60 - helpstring("XSL Stylesheet Cache 6.0") -] -coclass XSLTemplate60 -{ - [default] interface IXSLTemplate; -}; - -// XML HTTP Request Class, version independent -[ - uuid(F6D90F16-9C73-11D3-B32E-00C04F990BB4), // CLSID_XMLHTTP - helpstring("XML HTTP Request class.") -] -coclass XMLHTTP -{ - [default] interface IXMLHTTPRequest; -}; - -// XML HTTP Request Class, 2.6, version dependent -[ - uuid(f5078f1e-c551-11d3-89b9-0000f81fe221), // CLSID_XMLHTTP26 - helpstring("XML HTTP Request class.") -] -coclass XMLHTTP26 -{ - [default] interface IXMLHTTPRequest; -}; - -// XML HTTP Request Class, 3.0, version dependent -[ - uuid(f5078f35-c551-11d3-89b9-0000f81fe221), // CLSID_XMLHTTP30 - helpstring("XML HTTP Request class.") -] -coclass XMLHTTP30 -{ - [default] interface IXMLHTTPRequest; -}; - -// XML HTTP Request Class, 4.0, version dependent -[ - uuid(88d969c5-f192-11d4-a65f-0040963251e5), // CLSID_XMLHTTP40 - helpstring("XML HTTP Request class.") -] -coclass XMLHTTP40 -{ - [default] interface IXMLHTTPRequest; -}; - -[ - uuid(88d96a0a-f192-11d4-a65f-0040963251e5), // CLSID_XMLHTTP60 - helpstring("XML HTTP Request class 6.0") -] -coclass XMLHTTP60 -{ - [default] interface IXMLHTTPRequest; -}; - -// Server XML HTTP Request Class, version independent -[ - uuid(afba6b42-5692-48ea-8141-dc517dcf0ef1), // CLSID_ServerXMLHTTP - helpstring("Server XML HTTP Request class.") -] -coclass ServerXMLHTTP -{ - [default] interface IServerXMLHTTPRequest; -} - -// Server XML HTTP Request Class, 3.0, version dependent -[ - uuid(afb40ffd-b609-40a3-9828-f88bbe11e4e3), // CLSID_ServerXMLHTTP30 - helpstring("Server XML HTTP Request class.") -] -coclass ServerXMLHTTP30 -{ - [default] interface IServerXMLHTTPRequest; -} - -// Server XML HTTP Request Class, 4.0, version dependent -[ - uuid(88d969c6-f192-11d4-a65f-0040963251e5), // CLSID_ServerXMLHTTP40 - helpstring("Server XML HTTP Request class.") -] -coclass ServerXMLHTTP40 -{ - [default] interface IServerXMLHTTPRequest2; -} - -[ - uuid(88d96a0b-f192-11d4-a65f-0040963251e5), // CLSID_ServerXMLHTTP60 - helpstring("Server XML HTTP Request 6.0 ") -] -coclass ServerXMLHTTP60 -{ - [default] interface IServerXMLHTTPRequest2; -} - -// SAXXMLReader co-class, version independent -[ - uuid(079aa557-4a18-424a-8eee-e39f0a8d41b9), // CLSID_SAXXMLReader - helpstring("SAX XML Reader (version independent) coclass") -] -coclass SAXXMLReader -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; - interface IMXReaderControl; -}; - -// SAXXMLReader co-class, 3.0 version dependent -[ - uuid(3124c396-fb13-4836-a6ad-1317f1713688), // CLSID_SAXXMLReader30 - helpstring("SAX XML Reader 3.0 coclass") -] -coclass SAXXMLReader30 -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; - interface IMXReaderControl; -}; - -// SAXXMLReader co-class, 4.0 version dependent -[ - uuid(7c6e29bc-8b8b-4c3d-859e-af6cd158be0f), // CLSID_SAXXMLReader40 - helpstring("SAX XML Reader 4.0 coclass") -] -coclass SAXXMLReader40 -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; -}; - -[ - uuid(88d96a0c-f192-11d4-a65f-0040963251e5), // CLSID_SAXXMLReader60 - helpstring("SAX XML Reader 6.0") -] -coclass SAXXMLReader60 -{ - [default] interface IVBSAXXMLReader; - interface ISAXXMLReader; -}; - -// MXXMLWriter co-class, version independent -[ - uuid(fc220ad8-a72a-4ee8-926e-0b7ad152a020), // CLSID_MXXMLWriter - helpstring("Microsoft XML Writer (version independent) coclass") -] -coclass MXXMLWriter -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXErrorHandler; - interface ISAXDTDHandler; - interface ISAXLexicalHandler; - interface ISAXDeclHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// MXXMLWriter co-class, 3.0 version dependent -[ - uuid(3d813dfe-6c91-4a4e-8f41-04346a841d9c), // CLSID_MXXMLWriter30 - helpstring("Microsoft XML Writer 3.0 coclass") -] -coclass MXXMLWriter30 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// MXXMLWriter co-class, 4.0 version dependent -[ - uuid(88d969c8-f192-11d4-a65f-0040963251e5), // CLSID_MXXMLWriter40 - helpstring("Microsoft XML Writer 4.0 coclass") -] -coclass MXXMLWriter40 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -[ - uuid(88d96a0f-f192-11d4-a65f-0040963251e5), // CLSID_MXXMLWriter60 - helpstring("Microsoft XML Writer 6.0") -] -coclass MXXMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// MXHTMLWriter co-class, version independent -[ - uuid(a4c23ec3-6b70-4466-9127-550077239978), // CLSID_MXHTMLWriter - helpstring("Microsoft HTML Writer (version independent) coclass") -] -coclass MXHTMLWriter -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXErrorHandler; - interface ISAXDTDHandler; - interface ISAXLexicalHandler; - interface ISAXDeclHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// MXHTMLWriter co-class, 3.0 version dependent -[ - uuid(853d1540-c1a7-4aa9-a226-4d3bd301146d), // CLSID_MXHTMLWriter30 - helpstring("Microsoft HTML Writer 3.0 coclass") -] -coclass MXHTMLWriter30 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// MXHTMLWriter co-class, 4.0 version dependent -[ - uuid(88d969c9-f192-11d4-a65f-0040963251e5), // CLSID_MXHTMLWriter40 - helpstring("Microsoft HTML Writer 4.0 coclass") -] -coclass MXHTMLWriter40 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -[ - uuid(88d96a10-f192-11d4-a65f-0040963251e5), // CLSID_MXHTMLWriter60 - helpstring("Microsoft HTML Writer 6.0") -] -coclass MXHTMLWriter60 -{ - [default] interface IMXWriter; - - interface ISAXContentHandler; - interface ISAXDeclHandler; - interface ISAXDTDHandler; - interface ISAXErrorHandler; - interface ISAXLexicalHandler; - - interface IVBSAXContentHandler; - interface IVBSAXDeclHandler; - interface IVBSAXDTDHandler; - interface IVBSAXErrorHandler; - interface IVBSAXLexicalHandler; -}; - -// SAXAttributes co-class, version independent -[ - uuid(4dd441ad-526d-4a77-9f1b-9841ed802fb0), // CLSID_SAXAttributes - helpstring("SAX Attributes (version independent) coclass") -] -coclass SAXAttributes -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -}; - -// SAXAttributes co-class, 3.0 version dependent -[ - uuid(3e784a01-f3ae-4dc0-9354-9526b9370eba), // CLSID_SAXAttributes30 - helpstring("SAX Attributes 3.0 coclass") -] -coclass SAXAttributes30 -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -}; - -// SAXAttributes co-class, 4.0 version dependent -[ - uuid(88d969ca-f192-11d4-a65f-0040963251e5), // CLSID_SAXAttributes40 - helpstring("SAX Attributes 4.0 coclass") -] -coclass SAXAttributes40 -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -}; - -[ - uuid(88d96a0e-f192-11d4-a65f-0040963251e5), // CLSID_SAXAttributes60 - helpstring("SAX Attributes 6.0") -] -coclass SAXAttributes60 -{ - [default] interface IMXAttributes; - interface IVBSAXAttributes; - interface ISAXAttributes; -}; - -// MXNamespaceManager co-class version independent -[ - uuid(88d969d5-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager - helpstring("MX Namespace Manager coclass") -] -coclass MXNamespaceManager -{ - [default] interface IVBMXNamespaceManager; - interface IMXNamespaceManager; -}; - -// MXNamespaceManager co-class, 4.0 version dependent -[ - uuid(88d969d6-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager40 - helpstring("MX Namespace Manager 4.0 coclass") -] -coclass MXNamespaceManager40 -{ - [default] interface IVBMXNamespaceManager; - interface IMXNamespaceManager; -}; - -[ - uuid(88d96a11-f192-11d4-a65f-0040963251e5), // CLSID_MXNamespaceManager60 - helpstring("MX Namespace Manager 6.0") -] -coclass MXNamespaceManager60 -{ - [default] interface IVBMXNamespaceManager; - interface IMXNamespaceManager; -}; - -} - -cpp_quote("//----------------------------") -cpp_quote("// MSXML SPECIFIC ERROR CODES ") -cpp_quote("//----------------------------") -cpp_quote("#define E_XML_NOTWF 0xC00CE223L // Validate failed because the document is not well formed.") -cpp_quote("#define E_XML_NODTD 0xC00CE224L // The node is neither Valid nor Invalid because no DTD/Schema declaration was found.") -cpp_quote("#define E_XML_INVALID 0xC00CE225L // Validate failed because of a DTD/Schema violation.") -cpp_quote("#define E_XML_BUFFERTOOSMALL 0xC00CE226L // Buffer passed in is too small to receive the data.") - - -cpp_quote("#ifdef __USE_MSXML6_NAMESPACE__") -cpp_quote("}") -cpp_quote("#endif") - diff --git a/cli/test/include/gtest/msxml6did.h b/cli/test/include/gtest/msxml6did.h deleted file mode 100644 index 36b62f8..0000000 --- a/cli/test/include/gtest/msxml6did.h +++ /dev/null @@ -1,660 +0,0 @@ -//************************************************************************** -//* Microsoft Windows ** -//* Copyright (c) 1996 - 2001 Microsoft Corporation. All rights reserved. ** -//************************************************************************** - -//;begin_internal -/*********************************************************************************************** - - This is a distributed SDK component - do not put any #includes or other directives that rely - upon files not dropped. If in doubt - build iedev - - If you add comments please include either ;BUGBUG at the beginning of a single line OR - enclose in a ;begin_internal, ;end_internal block - such as this one! - - ***********************************************************************************************/ -//;end_internal - -//;begin_internal -#ifndef __MSXML2DID_H__ -#define __MSXML2DID_H__ -//;end_internal - -#define DISPID_XOBJ_MIN 0x00010000 -#define DISPID_XOBJ_MAX 0x0001FFFF -#define DISPID_XOBJ_BASE DISPID_XOBJ_MIN - - -#define DISPID_XMLELEMENTCOLLECTION DISPID_XOBJ_BASE - -#define DISPID_XMLELEMENTCOLLECTION_LENGTH DISPID_XMLELEMENTCOLLECTION + 1 -#define DISPID_XMLELEMENTCOLLECTION_NEWENUM DISPID_NEWENUM -#define DISPID_XMLELEMENTCOLLECTION_ITEM DISPID_XMLELEMENTCOLLECTION + 3 - - -#define DISPID_XMLDOCUMENT DISPID_XMLELEMENTCOLLECTION + 100 - -#define DISPID_XMLDOCUMENT_ROOT DISPID_XMLDOCUMENT + 1 -#define DISPID_XMLDOCUMENT_FILESIZE DISPID_XMLDOCUMENT + 2 -#define DISPID_XMLDOCUMENT_FILEMODIFIEDDATE DISPID_XMLDOCUMENT + 3 -#define DISPID_XMLDOCUMENT_FILEUPDATEDDATE DISPID_XMLDOCUMENT + 4 -#define DISPID_XMLDOCUMENT_URL DISPID_XMLDOCUMENT + 5 -#define DISPID_XMLDOCUMENT_MIMETYPE DISPID_XMLDOCUMENT + 6 -#define DISPID_XMLDOCUMENT_READYSTATE DISPID_XMLDOCUMENT + 7 -#define DISPID_XMLDOCUMENT_CREATEELEMENT DISPID_XMLDOCUMENT + 8 -#define DISPID_XMLDOCUMENT_CHARSET DISPID_XMLDOCUMENT + 9 -#define DISPID_XMLDOCUMENT_VERSION DISPID_XMLDOCUMENT + 10 -#define DISPID_XMLDOCUMENT_DOCTYPE DISPID_XMLDOCUMENT + 11 -#define DISPID_XMLDOCUMENT_DTDURL DISPID_XMLDOCUMENT + 12 -#define DISPID_XMLDOCUMENT_ASYNC DISPID_XMLDOCUMENT + 13 -#define DISPID_XMLDOCUMENT_CASEINSENSITIVE DISPID_XMLDOCUMENT + 14 -#define DISPID_XMLDOCUMENT_BASEURL DISPID_XMLDOCUMENT + 15 -#define DISPID_XMLDOCUMENT_XML DISPID_XMLDOCUMENT + 16 -#define DISPID_XMLDOCUMENT_LASTERROR DISPID_XMLDOCUMENT + 17 -#define DISPID_XMLDOCUMENT_TRIMWHITESPACE DISPID_XMLDOCUMENT + 18 -#define DISPID_XMLDOCUMENT_COMMIT DISPID_XMLDOCUMENT + 19 - -#define DISPID_XMLELEMENT DISPID_XMLDOCUMENT + 100 - -#define DISPID_XMLELEMENT_TAGNAME DISPID_XMLELEMENT + 1 -#define DISPID_XMLELEMENT_PARENT DISPID_XMLELEMENT + 2 -#define DISPID_XMLELEMENT_SETATTRIBUTE DISPID_XMLELEMENT + 3 -#define DISPID_XMLELEMENT_GETATTRIBUTE DISPID_XMLELEMENT + 4 -#define DISPID_XMLELEMENT_REMOVEATTRIBUTE DISPID_XMLELEMENT + 5 -#define DISPID_XMLELEMENT_CHILDREN DISPID_XMLELEMENT + 6 -#define DISPID_XMLELEMENT_TYPE DISPID_XMLELEMENT + 7 -#define DISPID_XMLELEMENT_TEXT DISPID_XMLELEMENT + 8 -#define DISPID_XMLELEMENT_ADDCHILD DISPID_XMLELEMENT + 9 -#define DISPID_XMLELEMENT_REMOVECHILD DISPID_XMLELEMENT + 10 -#define DISPID_XMLELEMENT_ATTRIBUTES DISPID_XMLELEMENT + 11 - -#define DISPID_XMLNOTIFSINK DISPID_XMLELEMENT + 100 - -#define DISPID_XMLNOTIFSINK_CHILDADDED DISPID_XMLNOTIFSINK + 1 - -#define DISPID_XMLATTRIBUTE DISPID_XMLNOTIFSINK + 100 - -#define DISPID_XMLATTRIBUTE_NAME DISPID_XMLATTRIBUTE + 1 -#define DISPID_XMLATTRIBUTE_VALUE DISPID_XMLATTRIBUTE + 2 - - -// IXMLError2 -#define DISPID_XMLERROR DISPID_XMLNOTIFSINK + 100 -#define DISPID_XMLERROR_REASON DISPID_XMLERROR + 1 -#define DISPID_XMLERROR_LINE DISPID_XMLERROR + 2 -#define DISPID_XMLERROR_POS DISPID_XMLERROR + 3 - -// INode -#define DISPID_NODE DISPID_XMLERROR + 100 -#define DISPID_NODE_NAME DISPID_NODE + 1 -#define DISPID_NODE_PARENT DISPID_NODE + 2 -#define DISPID_NODE_TYPE DISPID_NODE + 3 - -#define DISPID_NODE_VALUE DISPID_NODE + 4 - -#define DISPID_NODE_SETATTRIBUTE DISPID_NODE + 5 -#define DISPID_NODE_GETATTRIBUTE DISPID_NODE + 6 -#define DISPID_NODE_REMOVEATTRIBUTE DISPID_NODE + 7 -#define DISPID_NODE_ATTRIBUTES DISPID_NODE + 8 - -#define DISPID_NODE_ADD DISPID_NODE + 9 -#define DISPID_NODE_REMOVE DISPID_NODE + 10 -#define DISPID_NODE_CHILDREN DISPID_NODE + 11 - -// INodeList -#define DISPID_NODELIST DISPID_NODE + 100 -#define DISPID_NODELIST_NEWENUM DISPID_NODELIST + 1 -#define DISPID_NODELIST_NEXT DISPID_NODELIST + 2 -#define DISPID_NODELIST_CURRENT DISPID_NODELIST + 3 -#define DISPID_NODELIST_MOVE DISPID_NODELIST + 4 -#define DISPID_NODELIST_MOVETONODE DISPID_NODELIST + 5 - -#define DISPID_NODELIST_LENGTH DISPID_NODELIST + 6 -#define DISPID_NODELIST_ITEM DISPID_NODELIST + 7 - - -// Our dispids need to be mapped into the range 1..9999 to keep Trident happy -// specifically, to make the XML tag more efficient. (simonb, 09-18-1998) -#define DISPID_DOM_BASE 0x00000001 - -#define DISPID_DOM_COLLECTION_BASE 1000000 -#define DISPID_DOM_COLLECTION_MAX 2999999 - -#define DISPID_DOM_NODE (DISPID_DOM_BASE) -#define DISPID_DOM_NODE_NODENAME (DISPID_DOM_NODE + 1) -#define DISPID_DOM_NODE_NODEVALUE (DISPID_DOM_NODE + 2) -#define DISPID_DOM_NODE_NODETYPE (DISPID_DOM_NODE + 3) -#define DISPID_DOM_NODE_NODETYPEENUM (DISPID_DOM_NODE + 4) -#define DISPID_DOM_NODE_PARENTNODE (DISPID_DOM_NODE + 5) -#define DISPID_DOM_NODE_CHILDNODES (DISPID_DOM_NODE + 6) -#define DISPID_DOM_NODE_FIRSTCHILD (DISPID_DOM_NODE + 7) -#define DISPID_DOM_NODE_LASTCHILD (DISPID_DOM_NODE + 8) -#define DISPID_DOM_NODE_PREVIOUSSIBLING (DISPID_DOM_NODE + 9) -#define DISPID_DOM_NODE_NEXTSIBLING (DISPID_DOM_NODE + 10) -#define DISPID_DOM_NODE_ATTRIBUTES (DISPID_DOM_NODE + 11) -#define DISPID_DOM_NODE_INSERTBEFORE (DISPID_DOM_NODE + 12) -#define DISPID_DOM_NODE_REPLACECHILD (DISPID_DOM_NODE + 13) -#define DISPID_DOM_NODE_REMOVECHILD (DISPID_DOM_NODE + 14) -#define DISPID_DOM_NODE_APPENDCHILD (DISPID_DOM_NODE + 15) -#define DISPID_DOM_NODE_HASCHILDNODES (DISPID_DOM_NODE + 16) -#define DISPID_DOM_NODE_OWNERDOC (DISPID_DOM_NODE + 17) -#define DISPID_DOM_NODE_CLONENODE (DISPID_DOM_NODE + 18) -#define DISPID_XMLDOM_NODE (DISPID_DOM_NODE + 19) -#define DISPID_XMLDOM_NODE_STRINGTYPE (DISPID_XMLDOM_NODE + 1) -#define DISPID_XMLDOM_NODE_SPECIFIED (DISPID_XMLDOM_NODE + 2) -#define DISPID_XMLDOM_NODE_DEFINITION (DISPID_XMLDOM_NODE + 3) -#define DISPID_XMLDOM_NODE_TEXT (DISPID_XMLDOM_NODE + 4) -#define DISPID_XMLDOM_NODE_NODETYPEDVALUE (DISPID_XMLDOM_NODE + 5) -#define DISPID_XMLDOM_NODE_DATATYPE (DISPID_XMLDOM_NODE + 6) -#define DISPID_XMLDOM_NODE_XML (DISPID_XMLDOM_NODE + 7) -#define DISPID_XMLDOM_NODE_TRANSFORMNODE (DISPID_XMLDOM_NODE + 8) -#define DISPID_XMLDOM_NODE_SELECTNODES (DISPID_XMLDOM_NODE + 9) -#define DISPID_XMLDOM_NODE_SELECTSINGLENODE (DISPID_XMLDOM_NODE + 10) -#define DISPID_XMLDOM_NODE_PARSED (DISPID_XMLDOM_NODE + 11) -#define DISPID_XMLDOM_NODE_NAMESPACE (DISPID_XMLDOM_NODE + 12) -#define DISPID_XMLDOM_NODE_PREFIX (DISPID_XMLDOM_NODE + 13) -#define DISPID_XMLDOM_NODE_BASENAME (DISPID_XMLDOM_NODE + 14) -#define DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT (DISPID_XMLDOM_NODE + 15) -#define DISPID_XMLDOM_NODE__TOP (DISPID_XMLDOM_NODE + 16) - -#define DISPID_DOM_DOCUMENT (DISPID_XMLDOM_NODE__TOP + 1) -#define DISPID_DOM_DOCUMENT_DOCTYPE (DISPID_DOM_DOCUMENT + 1) -#define DISPID_DOM_DOCUMENT_IMPLEMENTATION (DISPID_DOM_DOCUMENT + 2) -#define DISPID_DOM_DOCUMENT_DOCUMENTELEMENT (DISPID_DOM_DOCUMENT + 3) -#define DISPID_DOM_DOCUMENT_CREATEELEMENT (DISPID_DOM_DOCUMENT + 4) -#define DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT (DISPID_DOM_DOCUMENT + 5) -#define DISPID_DOM_DOCUMENT_CREATETEXTNODE (DISPID_DOM_DOCUMENT + 6) -#define DISPID_DOM_DOCUMENT_CREATECOMMENT (DISPID_DOM_DOCUMENT + 7) -#define DISPID_DOM_DOCUMENT_CREATECDATASECTION (DISPID_DOM_DOCUMENT + 8) -#define DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION (DISPID_DOM_DOCUMENT + 9) -#define DISPID_DOM_DOCUMENT_CREATEATTRIBUTE (DISPID_DOM_DOCUMENT + 10) -#define DISPID_DOM_DOCUMENT_CREATEENTITY (DISPID_DOM_DOCUMENT + 11) -#define DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE (DISPID_DOM_DOCUMENT + 12) -#define DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME (DISPID_DOM_DOCUMENT + 13) -#define DISPID_DOM_DOCUMENT_TOP (DISPID_DOM_DOCUMENT + 14) -#define DISPID_XMLDOM_DOCUMENT (DISPID_DOM_DOCUMENT + 15) -#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNODE (DISPID_XMLDOM_DOCUMENT + 1) -#define DISPID_XMLDOM_DOCUMENT_CREATENODE (DISPID_XMLDOM_DOCUMENT + 2) -#define DISPID_XMLDOM_DOCUMENT_CREATENODEEX (DISPID_XMLDOM_DOCUMENT + 3) -#define DISPID_XMLDOM_DOCUMENT_NODEFROMID (DISPID_XMLDOM_DOCUMENT + 4) -#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNAMESPACES (DISPID_XMLDOM_DOCUMENT + 5) -#define DISPID_XMLDOM_DOCUMENT_LOAD (DISPID_XMLDOM_DOCUMENT + 6) -#define DISPID_XMLDOM_DOCUMENT_PARSEERROR (DISPID_XMLDOM_DOCUMENT + 7) -#define DISPID_XMLDOM_DOCUMENT_URL (DISPID_XMLDOM_DOCUMENT + 8) -#define DISPID_XMLDOM_DOCUMENT_ASYNC (DISPID_XMLDOM_DOCUMENT + 9) -#define DISPID_XMLDOM_DOCUMENT_ABORT (DISPID_XMLDOM_DOCUMENT + 10) -#define DISPID_XMLDOM_DOCUMENT_LOADXML (DISPID_XMLDOM_DOCUMENT + 11) -#define DISPID_XMLDOM_DOCUMENT_SAVE (DISPID_XMLDOM_DOCUMENT + 12) -#define DISPID_XMLDOM_DOCUMENT_VALIDATE (DISPID_XMLDOM_DOCUMENT + 13) -#define DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE (DISPID_XMLDOM_DOCUMENT + 14) -#define DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE (DISPID_XMLDOM_DOCUMENT + 15) -#define DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE (DISPID_XMLDOM_DOCUMENT + 16) -#define DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE (DISPID_XMLDOM_DOCUMENT + 17) -#define DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE (DISPID_XMLDOM_DOCUMENT + 18) -#define DISPID_XMLDOM_DOCUMENT__TOP (DISPID_XMLDOM_DOCUMENT + 19) - -#define DISPID_DOM_NODELIST (DISPID_XMLDOM_DOCUMENT__TOP + 1) -#define DISPID_DOM_NODELIST_ITEM (DISPID_DOM_NODELIST + 1) -#define DISPID_DOM_NODELIST_LENGTH (DISPID_DOM_NODELIST + 2) -#define DISPID_XMLDOM_NODELIST (DISPID_DOM_NODELIST + 3) -#define DISPID_XMLDOM_NODELIST_NEXTNODE (DISPID_XMLDOM_NODELIST + 1) -#define DISPID_XMLDOM_NODELIST_RESET (DISPID_XMLDOM_NODELIST + 2) -#define DISPID_XMLDOM_NODELIST_NEWENUM (DISPID_XMLDOM_NODELIST + 3) -#define DISPID_XMLDOM_NODELIST__TOP (DISPID_XMLDOM_NODELIST + 4) - - -#define DISPID_DOM_NAMEDNODEMAP (DISPID_XMLDOM_NODELIST__TOP + 1) -#define DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 3) -#define DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 4) -#define DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM (DISPID_DOM_NAMEDNODEMAP + 5) -#define DISPID_XMLDOM_NAMEDNODEMAP (DISPID_DOM_NAMEDNODEMAP + 6) -#define DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM (DISPID_XMLDOM_NAMEDNODEMAP + 1) -#define DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM (DISPID_XMLDOM_NAMEDNODEMAP + 2) -#define DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE (DISPID_XMLDOM_NAMEDNODEMAP + 3) -#define DISPID_XMLDOM_NAMEDNODEMAP_RESET (DISPID_XMLDOM_NAMEDNODEMAP + 4) -#define DISPID_XMLDOM_NAMEDNODEMAP_NEWENUM (DISPID_XMLDOM_NAMEDNODEMAP + 5) -#define DISPID_XMLDOM_NAMEDNODEMAP__TOP (DISPID_XMLDOM_NAMEDNODEMAP + 6) - - -#define DISPID_DOM_W3CWRAPPERS (DISPID_XMLDOM_NAMEDNODEMAP__TOP + 1) - -#define DISPID_DOM_DOCUMENTFRAGMENT (DISPID_DOM_W3CWRAPPERS + 1) -#define DISPID_DOM_DOCUMENTFRAGMENT__TOP (DISPID_DOM_DOCUMENTFRAGMENT + 1) - -#define DISPID_DOM_ELEMENT (DISPID_DOM_DOCUMENTFRAGMENT__TOP + 1) -#define DISPID_DOM_ELEMENT_GETTAGNAME (DISPID_DOM_ELEMENT + 1) -#define DISPID_DOM_ELEMENT_GETATTRIBUTES (DISPID_DOM_ELEMENT + 2) -#define DISPID_DOM_ELEMENT_GETATTRIBUTE (DISPID_DOM_ELEMENT + 3) -#define DISPID_DOM_ELEMENT_SETATTRIBUTE (DISPID_DOM_ELEMENT + 4) -#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTE (DISPID_DOM_ELEMENT + 5) -#define DISPID_DOM_ELEMENT_GETATTRIBUTENODE (DISPID_DOM_ELEMENT + 6) -#define DISPID_DOM_ELEMENT_SETATTRIBUTENODE (DISPID_DOM_ELEMENT + 7) -#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE (DISPID_DOM_ELEMENT + 8) -#define DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME (DISPID_DOM_ELEMENT + 9) -#define DISPID_DOM_ELEMENT_NORMALIZE (DISPID_DOM_ELEMENT + 10) -#define DISPID_DOM_ELEMENT__TOP (DISPID_DOM_ELEMENT + 11) - -#define DISPID_DOM_DATA (DISPID_DOM_ELEMENT__TOP + 1) -#define DISPID_DOM_DATA_DATA (DISPID_DOM_DATA + 1) -#define DISPID_DOM_DATA_LENGTH (DISPID_DOM_DATA + 2) -#define DISPID_DOM_DATA_SUBSTRING (DISPID_DOM_DATA + 3) -#define DISPID_DOM_DATA_APPEND (DISPID_DOM_DATA + 4) -#define DISPID_DOM_DATA_INSERT (DISPID_DOM_DATA + 5) -#define DISPID_DOM_DATA_DELETE (DISPID_DOM_DATA + 6) -#define DISPID_DOM_DATA_REPLACE (DISPID_DOM_DATA + 7) -#define DISPID_DOM_DATA__TOP (DISPID_DOM_DATA + 8) - -#define DISPID_DOM_ATTRIBUTE (DISPID_DOM_DATA__TOP + 1) -#define DISPID_DOM_ATTRIBUTE_GETNAME (DISPID_DOM_ATTRIBUTE + 1) -#define DISPID_DOM_ATTRIBUTE_SPECIFIED (DISPID_DOM_ATTRIBUTE + 2) -#define DISPID_DOM_ATTRIBUTE_VALUE (DISPID_DOM_ATTRIBUTE + 3) -#define DISPID_DOM_ATTRIBUTE__TOP (DISPID_DOM_ATTRIBUTE + 4) - -#define DISPID_DOM_TEXT (DISPID_DOM_ATTRIBUTE__TOP + 1) -#define DISPID_DOM_TEXT_SPLITTEXT (DISPID_DOM_TEXT + 1) -#define DISPID_DOM_TEXT_JOINTEXT (DISPID_DOM_TEXT + 2) -#define DISPID_DOM_TEXT__TOP (DISPID_DOM_TEXT + 3) - -#define DISPID_DOM_PI (DISPID_DOM_TEXT__TOP + 1) -#define DISPID_DOM_PI_TARGET (DISPID_DOM_PI + 1) -#define DISPID_DOM_PI_DATA (DISPID_DOM_PI + 2) -#define DISPID_DOM_PI__TOP (DISPID_DOM_PI + 3) - -#define DISPID_DOM_DOCUMENTTYPE (DISPID_DOM_PI__TOP + 1) -#define DISPID_DOM_DOCUMENTTYPE_NAME (DISPID_DOM_DOCUMENTTYPE + 1) -#define DISPID_DOM_DOCUMENTTYPE_ENTITIES (DISPID_DOM_DOCUMENTTYPE + 2) -#define DISPID_DOM_DOCUMENTTYPE_NOTATIONS (DISPID_DOM_DOCUMENTTYPE + 3) -#define DISPID_DOM_DOCUMENTTYPE__TOP (DISPID_DOM_DOCUMENTTYPE + 4) - -#define DISPID_DOM_NOTATION (DISPID_DOM_DOCUMENTTYPE__TOP + 1) -#define DISPID_DOM_NOTATION_PUBLICID (DISPID_DOM_NOTATION + 1) -#define DISPID_DOM_NOTATION_SYSTEMID (DISPID_DOM_NOTATION + 2) -#define DISPID_DOM_NOTATION__TOP (DISPID_DOM_NOTATION + 3) - -#define DISPID_DOM_ENTITY (DISPID_DOM_NOTATION__TOP + 1) -#define DISPID_DOM_ENTITY_PUBLICID (DISPID_DOM_ENTITY + 1) -#define DISPID_DOM_ENTITY_SYSTEMID (DISPID_DOM_ENTITY + 2) -#define DISPID_DOM_ENTITY_NOTATIONNAME (DISPID_DOM_ENTITY + 3) -#define DISPID_DOM_ENTITY__TOP (DISPID_DOM_ENTITY + 4) - -//define DISPID_DOM_COMMENT -//define DISPID_DOM_CDATASECTION -//define DISPID_DOM_ENTITYREFERENCE - -#define DISPID_DOM_W3CWRAPPERS_TOP (DISPID_DOM_ENTITY__TOP) - - -#define DISPID_DOM_IMPLEMENTATION (DISPID_DOM_W3CWRAPPERS_TOP + 1) -#define DISPID_DOM_IMPLEMENTATION_HASFEATURE (DISPID_DOM_IMPLEMENTATION + 1) -#define DISPID_DOM_IMPLEMENTATION__TOP (DISPID_DOM_IMPLEMENTATION + 2) - -#define DISPID_DOM__TOP (DISPID_DOM_IMPLEMENTATION + 0x20) - - -#define DISPID_DOM_ERROR (DISPID_DOM__TOP + 1) -#define DISPID_DOM_ERROR_ERRORCODE (DISPID_DOM_ERROR + 1) -#define DISPID_DOM_ERROR_URL (DISPID_DOM_ERROR + 2) -#define DISPID_DOM_ERROR_REASON (DISPID_DOM_ERROR + 3) -#define DISPID_DOM_ERROR_SRCTEXT (DISPID_DOM_ERROR + 4) -#define DISPID_DOM_ERROR_LINE (DISPID_DOM_ERROR + 5) -#define DISPID_DOM_ERROR_LINEPOS (DISPID_DOM_ERROR + 6) -#define DISPID_DOM_ERROR_FILEPOS (DISPID_DOM_ERROR + 7) -#define DISPID_DOM_ERROR__TOP (DISPID_DOM_ERROR + 8) - -#define DISPID_DOM_ERROR2 (DISPID_DOM_ERROR__TOP + 1) -#define DISPID_DOM_ERROR2_ALLERRORS (DISPID_DOM_ERROR2 + 1) -#define DISPID_DOM_ERROR2_ERRORPARAMETERS (DISPID_DOM_ERROR2 + 2) -#define DISPID_DOM_ERROR2_ERRORPARAMETERSCOUNT (DISPID_DOM_ERROR2 + 3) -#define DISPID_DOM_ERROR2_ERRORXPATH (DISPID_DOM_ERROR2 + 4) -#define DISPID_DOM_ERROR2__TOP (DISPID_DOM_ERROR2 + 5) - -#define DISPID_DOM_ERRORCOLLECTION (DISPID_DOM_ERROR2__TOP + 1) -#define DISPID_DOM_ERRORCOLLECTION_LENGTH (DISPID_DOM_ERRORCOLLECTION + 1) -#define DISPID_DOM_ERRORCOLLECTION_NEXT (DISPID_DOM_ERRORCOLLECTION + 2) -#define DISPID_DOM_ERRORCOLLECTION_RESET (DISPID_DOM_ERRORCOLLECTION + 3) -#define DISPID_DOM_ERRORCOLLECTION__TOP (DISPID_DOM_ERRORCOLLECTION + 4) - -#define DISPID_XTLRUNTIME (DISPID_DOM_ERROR__TOP + 1) -#define DISPID_XTLRUNTIME_UNIQUEID (DISPID_XTLRUNTIME + 1) -#define DISPID_XTLRUNTIME_DEPTH (DISPID_XTLRUNTIME + 2) -#define DISPID_XTLRUNTIME_CHILDNUMBER (DISPID_XTLRUNTIME + 3) -#define DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER (DISPID_XTLRUNTIME + 4) -#define DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER (DISPID_XTLRUNTIME + 5) -#define DISPID_XTLRUNTIME_FORMATINDEX (DISPID_XTLRUNTIME + 6) -#define DISPID_XTLRUNTIME_FORMATNUMBER (DISPID_XTLRUNTIME + 7) -#define DISPID_XTLRUNTIME_FORMATDATE (DISPID_XTLRUNTIME + 8) -#define DISPID_XTLRUNTIME_FORMATTIME (DISPID_XTLRUNTIME + 9) -#define DISPID_XTLRUNTIME__TOP (DISPID_XTLRUNTIME + 10) - -#define DISPID_XMLDOMEVENT (DISPID_XTLRUNTIME__TOP + 1) -#define DISPID_XMLDOMEVENT_ONREADYSTATECHANGE (DISPID_READYSTATECHANGE) -#define DISPID_XMLDOMEVENT_ONDATAAVAILABLE (DISPID_XMLDOMEVENT + 1) -#define DISPID_XMLDOMEVENT__TOP (DISPID_XMLDOMEVENT + 2) - -#define DISPID_XMLDOM_DOCUMENT2 (DISPID_XMLDOMEVENT__TOP + 1) -#define DISPID_XMLDOM_DOCUMENT2_NAMESPACES (DISPID_XMLDOM_DOCUMENT2 + 1) -#define DISPID_XMLDOM_DOCUMENT2_SCHEMAS (DISPID_XMLDOM_DOCUMENT2 + 2) -#define DISPID_XMLDOM_DOCUMENT2_VALIDATE (DISPID_XMLDOM_DOCUMENT2 + 3) -#define DISPID_XMLDOM_DOCUMENT2_SETPROPERTY (DISPID_XMLDOM_DOCUMENT2 + 4) -#define DISPID_XMLDOM_DOCUMENT2_GETPROPERTY (DISPID_XMLDOM_DOCUMENT2 + 5) -#define DISPID_XMLDOM_DOCUMENT2__TOP (DISPID_XMLDOM_DOCUMENT2 + 6) - -#define DISPID_XMLDOM_DOCUMENT3 (DISPID_XMLDOM_DOCUMENT2__TOP + 1) -#define DISPID_XMLDOM_DOCUMENT3_VALIDATENODE (DISPID_XMLDOM_DOCUMENT3 + 1) -#define DISPID_XMLDOM_DOCUMENT3_IMPORTNODE (DISPID_XMLDOM_DOCUMENT3 + 2) -#define DISPID_XMLDOM_DOCUMENT3__TOP (DISPID_XMLDOM_DOCUMENT3 + 3) - -#define DISPID_XMLDOM_SCHEMACOLLECTION (DISPID_DOM_BASE + 1) -#define DISPID_XMLDOM_SCHEMACOLLECTION_ADD (DISPID_XMLDOM_SCHEMACOLLECTION + 1) -#define DISPID_XMLDOM_SCHEMACOLLECTION_GET (DISPID_XMLDOM_SCHEMACOLLECTION + 2) -#define DISPID_XMLDOM_SCHEMACOLLECTION_REMOVE (DISPID_XMLDOM_SCHEMACOLLECTION + 3) -#define DISPID_XMLDOM_SCHEMACOLLECTION_LENGTH (DISPID_XMLDOM_SCHEMACOLLECTION + 4) -#define DISPID_XMLDOM_SCHEMACOLLECTION_NAMESPACEURI (DISPID_XMLDOM_SCHEMACOLLECTION + 5) -#define DISPID_XMLDOM_SCHEMACOLLECTION_ADDCOLLECTION (DISPID_XMLDOM_SCHEMACOLLECTION + 6) -#define DISPID_XMLDOM_SCHEMACOLLECTION__TOP (DISPID_XMLDOM_SCHEMACOLLECTION + 7) - -#define DISPID_XMLDOM_SELECTION (DISPID_XMLDOM_NODELIST__TOP + 1) -#define DISPID_XMLDOM_SELECTION_EXPR (DISPID_XMLDOM_SELECTION + 1) -#define DISPID_XMLDOM_SELECTION_CONTEXT (DISPID_XMLDOM_SELECTION + 2) -#define DISPID_XMLDOM_SELECTION_PEEKNODE (DISPID_XMLDOM_SELECTION + 3) -#define DISPID_XMLDOM_SELECTION_MATCHES (DISPID_XMLDOM_SELECTION + 4) -#define DISPID_XMLDOM_SELECTION_REMOVENEXT (DISPID_XMLDOM_SELECTION + 5) -#define DISPID_XMLDOM_SELECTION_REMOVEALL (DISPID_XMLDOM_SELECTION + 6) -#define DISPID_XMLDOM_SELECTION_CLONE (DISPID_XMLDOM_SELECTION + 7) -#define DISPID_XMLDOM_SELECTION_GETPROPERTY (DISPID_XMLDOM_SELECTION + 8) -#define DISPID_XMLDOM_SELECTION_SETPROPERTY (DISPID_XMLDOM_SELECTION + 9) -#define DISPID_XMLDOM_SELECTION__TOP (DISPID_XMLDOM_SELECTION + 10) - -#define DISPID_XMLDOM_TEMPLATE (DISPID_DOM_BASE) -#define DISPID_XMLDOM_TEMPLATE_STYLESHEET (DISPID_XMLDOM_TEMPLATE + 1) -#define DISPID_XMLDOM_TEMPLATE_CREATEPROCESSOR (DISPID_XMLDOM_TEMPLATE + 2) -#define DISPID_XMLDOM_TEMPLATE__TOP (DISPID_XMLDOM_TEMPLATE + 3) - -#define DISPID_XMLDOM_PROCESSOR (DISPID_DOM_BASE) -#define DISPID_XMLDOM_PROCESSOR_INPUT (DISPID_XMLDOM_PROCESSOR + 1) -#define DISPID_XMLDOM_PROCESSOR_XSLTEMPLATE (DISPID_XMLDOM_PROCESSOR + 2) -#define DISPID_XMLDOM_PROCESSOR_SETSTARTMODE (DISPID_XMLDOM_PROCESSOR + 3) -#define DISPID_XMLDOM_PROCESSOR_STARTMODE (DISPID_XMLDOM_PROCESSOR + 4) -#define DISPID_XMLDOM_PROCESSOR_STARTMODEURI (DISPID_XMLDOM_PROCESSOR + 5) -#define DISPID_XMLDOM_PROCESSOR_OUTPUT (DISPID_XMLDOM_PROCESSOR + 6) -#define DISPID_XMLDOM_PROCESSOR_TRANSFORM (DISPID_XMLDOM_PROCESSOR + 7) -#define DISPID_XMLDOM_PROCESSOR_RESET (DISPID_XMLDOM_PROCESSOR + 8) -#define DISPID_XMLDOM_PROCESSOR_READYSTATE (DISPID_XMLDOM_PROCESSOR + 9) -#define DISPID_XMLDOM_PROCESSOR_ADDPARAMETER (DISPID_XMLDOM_PROCESSOR + 10) -#define DISPID_XMLDOM_PROCESSOR_ADDOBJECT (DISPID_XMLDOM_PROCESSOR + 11) -#define DISPID_XMLDOM_PROCESSOR_STYLESHEET (DISPID_XMLDOM_PROCESSOR + 12) -#define DISPID_XMLDOM_PROCESSOR__TOP (DISPID_XMLDOM_PROCESSOR + 13) - -#define DISPID_XMLDSO DISPID_XOBJ_BASE -#define DISPID_XMLDSO_DOCUMENT DISPID_XMLDSO + 1 -#define DISPID_XMLDSO_JAVADSOCOMPATIBLE DISPID_XMLDSO_DOCUMENT + 1 - - -#define DISPID_SAX_XMLREADER__MIN 0x00000501 -#define DISPID_SAX_XMLREADER__MAX 0x00010000 -#define DISPID_SAX_XMLREADER__BASE DISPID_SAX_XMLREADER__MIN - -#define DISPID_SAX_XMLREADER (DISPID_SAX_XMLREADER__BASE) -#define DISPID_SAX_XMLREADER_GETFEATURE (DISPID_SAX_XMLREADER + 1) -#define DISPID_SAX_XMLREADER_PUTFEATURE (DISPID_SAX_XMLREADER + 2) -#define DISPID_SAX_XMLREADER_GETPROPERTY (DISPID_SAX_XMLREADER + 3) -#define DISPID_SAX_XMLREADER_PUTPROPERTY (DISPID_SAX_XMLREADER + 4) -#define DISPID_SAX_XMLREADER_ENTITYRESOLVER (DISPID_SAX_XMLREADER + 5) -#define DISPID_SAX_XMLREADER_CONTENTHANDLER (DISPID_SAX_XMLREADER + 6) -#define DISPID_SAX_XMLREADER_DTDHANDLER (DISPID_SAX_XMLREADER + 7) -#define DISPID_SAX_XMLREADER_ERRORHANDLER (DISPID_SAX_XMLREADER + 8) -#define DISPID_SAX_XMLREADER_BASEURL (DISPID_SAX_XMLREADER + 9) -#define DISPID_SAX_XMLREADER_SECUREBASEURL (DISPID_SAX_XMLREADER + 10) -#define DISPID_SAX_XMLREADER_PARSE (DISPID_SAX_XMLREADER + 11) -#define DISPID_SAX_XMLREADER_PARSEURL (DISPID_SAX_XMLREADER + 12) -#define DISPID_SAX_XMLREADER_PARENT (DISPID_SAX_XMLREADER + 13) -#define DISPID_SAX_XMLREADER__TOP (DISPID_SAX_XMLREADER + 14) - -#define DISPID_SAX_XMLFILTER__BASE (DISPID_SAX_XMLREADER__TOP + 1) -#define DISPID_SAX_XMLFILTER (DISPID_SAX_XMLFILTER__BASE) -#define DISPID_SAX_XMLFILTER_GETFEATURE (DISPID_SAX_XMLFILTER + 1) -#define DISPID_SAX_XMLFILTER_PUTFEATURE (DISPID_SAX_XMLFILTER + 2) -#define DISPID_SAX_XMLFILTER_GETPROPERTY (DISPID_SAX_XMLFILTER + 3) -#define DISPID_SAX_XMLFILTER_PUTPROPERTY (DISPID_SAX_XMLFILTER + 4) -#define DISPID_SAX_XMLFILTER_ENTITYRESOLVER (DISPID_SAX_XMLFILTER + 5) -#define DISPID_SAX_XMLFILTER_CONTENTHANDLER (DISPID_SAX_XMLFILTER + 6) -#define DISPID_SAX_XMLFILTER_DTDHANDLER (DISPID_SAX_XMLFILTER + 7) -#define DISPID_SAX_XMLFILTER_ERRORHANDLER (DISPID_SAX_XMLFILTER + 8) -#define DISPID_SAX_XMLFILTER_BASEURL (DISPID_SAX_XMLFILTER + 9) -#define DISPID_SAX_XMLFILTER_SECUREBASEURL (DISPID_SAX_XMLFILTER + 10) -#define DISPID_SAX_XMLFILTER_PARSE (DISPID_SAX_XMLFILTER + 11) -#define DISPID_SAX_XMLFILTER_PARSEURL (DISPID_SAX_XMLFILTER + 12) -#define DISPID_SAX_XMLFILTER_PARENT (DISPID_SAX_XMLFILTER + 13) -#define DISPID_SAX_XMLFILTER__TOP (DISPID_SAX_XMLFILTER + 15) - -#define DISPID_SAX_LOCATOR__BASE (DISPID_SAX_XMLFILTER__TOP + 1) -#define DISPID_SAX_LOCATOR (DISPID_SAX_LOCATOR__BASE) -#define DISPID_SAX_LOCATOR_COLUMNNUMBER (DISPID_SAX_LOCATOR + 1) -#define DISPID_SAX_LOCATOR_LINENUMBER (DISPID_SAX_LOCATOR + 2) -#define DISPID_SAX_LOCATOR_PUBLICID (DISPID_SAX_LOCATOR + 3) -#define DISPID_SAX_LOCATOR_SYSTEMID (DISPID_SAX_LOCATOR + 4) -#define DISPID_SAX_LOCATOR__TOP (DISPID_SAX_LOCATOR + 5) - -#define DISPID_SAX_ENTITYRESOLVER__BASE (DISPID_SAX_LOCATOR__TOP + 1) -#define DISPID_SAX_ENTITYRESOLVER (DISPID_SAX_ENTITYRESOLVER__BASE) -#define DISPID_SAX_ENTITYRESOLVER_RESOLVEENTITY (DISPID_SAX_ENTITYRESOLVER + 1) -#define DISPID_SAX_ENTITYRESOLVER__TOP (DISPID_SAX_ENTITYRESOLVER + 2) - -#define DISPID_SAX_CONTENTHANDLER__BASE (DISPID_SAX_ENTITYRESOLVER__TOP + 1) -#define DISPID_SAX_CONTENTHANDLER (DISPID_SAX_CONTENTHANDLER__BASE) -#define DISPID_SAX_CONTENTHANDLER_DOCUMENTLOCATOR (DISPID_SAX_CONTENTHANDLER + 1) -#define DISPID_SAX_CONTENTHANDLER_STARTDOCUMENT (DISPID_SAX_CONTENTHANDLER + 2) -#define DISPID_SAX_CONTENTHANDLER_ENDDOCUMENT (DISPID_SAX_CONTENTHANDLER + 3) -#define DISPID_SAX_CONTENTHANDLER_STARTPREFIXMAPPING (DISPID_SAX_CONTENTHANDLER + 4) -#define DISPID_SAX_CONTENTHANDLER_ENDPREFIXMAPPING (DISPID_SAX_CONTENTHANDLER + 5) -#define DISPID_SAX_CONTENTHANDLER_STARTELEMENT (DISPID_SAX_CONTENTHANDLER + 6) -#define DISPID_SAX_CONTENTHANDLER_ENDELEMENT (DISPID_SAX_CONTENTHANDLER + 7) -#define DISPID_SAX_CONTENTHANDLER_CHARACTERS (DISPID_SAX_CONTENTHANDLER + 8) -#define DISPID_SAX_CONTENTHANDLER_IGNORABLEWHITESPACE (DISPID_SAX_CONTENTHANDLER + 9) -#define DISPID_SAX_CONTENTHANDLER_PROCESSINGINSTRUCTION (DISPID_SAX_CONTENTHANDLER + 10) -#define DISPID_SAX_CONTENTHANDLER_SKIPPEDENTITY (DISPID_SAX_CONTENTHANDLER + 11) -#define DISPID_SAX_CONTENTHANDLER__TOP (DISPID_SAX_CONTENTHANDLER + 12) - -#define DISPID_SAX_DTDHANDLER__BASE (DISPID_SAX_CONTENTHANDLER__TOP + 1) -#define DISPID_SAX_DTDHANDLER (DISPID_SAX_DTDHANDLER__BASE) -#define DISPID_SAX_DTDHANDLER_NOTATIONDECL (DISPID_SAX_DTDHANDLER + 1) -#define DISPID_SAX_DTDHANDLER_UNPARSEDENTITYDECL (DISPID_SAX_DTDHANDLER + 2) -#define DISPID_SAX_DTDHANDLER__TOP (DISPID_SAX_DTDHANDLER + 3) - -#define DISPID_SAX_ERRORHANDLER__BASE (DISPID_SAX_DTDHANDLER__TOP + 1) -#define DISPID_SAX_ERRORHANDLER (DISPID_SAX_ERRORHANDLER__BASE) -#define DISPID_SAX_ERRORHANDLER_ERROR (DISPID_SAX_ERRORHANDLER + 1) -#define DISPID_SAX_ERRORHANDLER_FATALERROR (DISPID_SAX_ERRORHANDLER + 2) -#define DISPID_SAX_ERRORHANDLER_IGNORABLEWARNING (DISPID_SAX_ERRORHANDLER + 3) -#define DISPID_SAX_ERRORHANDLER__TOP (DISPID_SAX_ERRORHANDLER + 4) - -#define DISPID_SAX_ATTRIBUTES__BASE (DISPID_SAX_ERRORHANDLER__TOP + 1) -#define DISPID_SAX_ATTRIBUTES (DISPID_SAX_ATTRIBUTES__BASE) -#define DISPID_SAX_ATTRIBUTES_LENGTH (DISPID_SAX_ATTRIBUTES + 1) -#define DISPID_SAX_ATTRIBUTES_GETURI (DISPID_SAX_ATTRIBUTES + 2) -#define DISPID_SAX_ATTRIBUTES_GETLOCALNAME (DISPID_SAX_ATTRIBUTES + 3) -#define DISPID_SAX_ATTRIBUTES_GETQNAME (DISPID_SAX_ATTRIBUTES + 4) -#define DISPID_SAX_ATTRIBUTES_GETINDEXFROMNAME (DISPID_SAX_ATTRIBUTES + 5) -#define DISPID_SAX_ATTRIBUTES_GETINDEXFROMQNAME (DISPID_SAX_ATTRIBUTES + 6) -#define DISPID_SAX_ATTRIBUTES_GETTYPE (DISPID_SAX_ATTRIBUTES + 7) -#define DISPID_SAX_ATTRIBUTES_GETTYPEFROMNAME (DISPID_SAX_ATTRIBUTES + 8) -#define DISPID_SAX_ATTRIBUTES_GETTYPEFROMQNAME (DISPID_SAX_ATTRIBUTES + 9) -#define DISPID_SAX_ATTRIBUTES_GETVALUE (DISPID_SAX_ATTRIBUTES + 10) -#define DISPID_SAX_ATTRIBUTES_GETVALUEFROMNAME (DISPID_SAX_ATTRIBUTES + 11) -#define DISPID_SAX_ATTRIBUTES_GETVALUEFROMQNAME (DISPID_SAX_ATTRIBUTES + 12) -#define DISPID_SAX_ATTRIBUTES__TOP (DISPID_SAX_ATTRIBUTES + 13) - -#define DISPID_SAX_LEXICALHANDLER__BASE (DISPID_SAX_ATTRIBUTES__TOP + 1) -#define DISPID_SAX_LEXICALHANDLER (DISPID_SAX_LEXICALHANDLER__BASE) -#define DISPID_SAX_LEXICALHANDLER_STARTDTD (DISPID_SAX_LEXICALHANDLER + 1) -#define DISPID_SAX_LEXICALHANDLER_ENDDTD (DISPID_SAX_LEXICALHANDLER + 2) -#define DISPID_SAX_LEXICALHANDLER_STARTENTITY (DISPID_SAX_LEXICALHANDLER + 3) -#define DISPID_SAX_LEXICALHANDLER_ENDENTITY (DISPID_SAX_LEXICALHANDLER + 4) -#define DISPID_SAX_LEXICALHANDLER_STARTCDATA (DISPID_SAX_LEXICALHANDLER + 5) -#define DISPID_SAX_LEXICALHANDLER_ENDCDATA (DISPID_SAX_LEXICALHANDLER + 6) -#define DISPID_SAX_LEXICALHANDLER_COMMENT (DISPID_SAX_LEXICALHANDLER + 7) -#define DISPID_SAX_LEXICALHANDLER__TOP (DISPID_SAX_LEXICALHANDLER + 8) - -#define DISPID_SAX_DECLHANDLER__BASE (DISPID_SAX_LEXICALHANDLER__TOP + 1) -#define DISPID_SAX_DECLHANDLER (DISPID_SAX_DECLHANDLER__BASE) -#define DISPID_SAX_DECLHANDLER_ELEMENTDECL (DISPID_SAX_DECLHANDLER + 1) -#define DISPID_SAX_DECLHANDLER_ATTRIBUTEDECL (DISPID_SAX_DECLHANDLER + 2) -#define DISPID_SAX_DECLHANDLER_INTERNALENTITYDECL (DISPID_SAX_DECLHANDLER + 3) -#define DISPID_SAX_DECLHANDLER_EXTERNALENTITYDECL (DISPID_SAX_DECLHANDLER + 4) -#define DISPID_SAX_DECLHANDLER__TOP (DISPID_SAX_DECLHANDLER + 5) - -#define DISPID_MX_ATTRIBUTES__BASE (DISPID_SAX_DECLHANDLER__TOP + 1) -#define DISPID_MX_ATTRIBUTES (DISPID_MX_ATTRIBUTES__BASE) -#define DISPID_MX_ATTRIBUTES_ADDATTRIBUTE (DISPID_MX_ATTRIBUTES + 1) -#define DISPID_MX_ATTRIBUTES_CLEAR (DISPID_MX_ATTRIBUTES + 2) -#define DISPID_MX_ATTRIBUTES_REMOVEATTRIBUTE (DISPID_MX_ATTRIBUTES + 3) -#define DISPID_MX_ATTRIBUTES_SETATTRIBUTE (DISPID_MX_ATTRIBUTES + 4) -#define DISPID_MX_ATTRIBUTES_SETATTRIBUTES (DISPID_MX_ATTRIBUTES + 5) -#define DISPID_MX_ATTRIBUTES_SETLOCALNAME (DISPID_MX_ATTRIBUTES + 6) -#define DISPID_MX_ATTRIBUTES_SETQNAME (DISPID_MX_ATTRIBUTES + 7) -#define DISPID_MX_ATTRIBUTES_SETTYPE (DISPID_MX_ATTRIBUTES + 8) -#define DISPID_MX_ATTRIBUTES_SETURI (DISPID_MX_ATTRIBUTES + 9) -#define DISPID_MX_ATTRIBUTES_SETVALUE (DISPID_MX_ATTRIBUTES + 10) -#define DISPID_MX_ATTRIBUTES_ADDATTRIBUTEFROMINDEX (DISPID_MX_ATTRIBUTES + 11) -#define DISPID_MX_ATTRIBUTES__TOP (DISPID_MX_ATTRIBUTES + 11) - -#define DISPID_MX_WRITER__BASE (DISPID_MX_ATTRIBUTES__TOP + 1) -#define DISPID_MX_WRITER (DISPID_MX_WRITER__BASE) -#define DISPID_MX_WRITER_OUTPUT (DISPID_MX_WRITER + 1) -#define DISPID_MX_WRITER_DESTINATION (DISPID_MX_WRITER + 2) -#define DISPID_MX_WRITER_ENCODING (DISPID_MX_WRITER + 3) -#define DISPID_MX_WRITER_BYTEORDERMARK (DISPID_MX_WRITER + 4) -#define DISPID_MX_WRITER_INDENT (DISPID_MX_WRITER + 5) -#define DISPID_MX_WRITER_STANDALONE (DISPID_MX_WRITER + 6) -#define DISPID_MX_WRITER_OMITXMLDECLARATION (DISPID_MX_WRITER + 7) -#define DISPID_MX_WRITER_VERSION (DISPID_MX_WRITER + 8) -#define DISPID_MX_WRITER_DISABLEOUTPUTESCAPING (DISPID_MX_WRITER + 9) -#define DISPID_MX_WRITER_FLUSH (DISPID_MX_WRITER + 10) -#define DISPID_MX_WRITER_RESET (DISPID_MX_WRITER + 11) -#define DISPID_MX_WRITER__TOP (DISPID_MX_WRITER + 12) - -#define DISPID_MX_READER_CONTROL__BASE (DISPID_MX_WRITER__TOP + 1) -#define DISPID_MX_READER_CONTROL (DISPID_MX_READER_CONTROL__BASE) -#define DISPID_MX_READER_CONTROL_ABORT (DISPID_MX_READER_CONTROL + 1) -#define DISPID_MX_READER_CONTROL_RESUME (DISPID_MX_READER_CONTROL + 2) -#define DISPID_MX_READER_CONTROL_SUSPEND (DISPID_MX_READER_CONTROL + 3) -#define DISPID_MX_READER_CONTROL__TOP (DISPID_MX_READER_CONTROL + 4) - -#define DISPID_MX_SCHEMADECLHANDLER__BASE (DISPID_MX_READER_CONTROL__TOP + 1) -#define DISPID_MX_SCHEMADECLHANDLER (DISPID_MX_SCHEMADECLHANDLER__BASE) -#define DISPID_MX_SCHEMADECLHANDLER_SCHEMAELEMENTDECL (DISPID_MX_SCHEMADECLHANDLER + 1) -#define DISPID_MX_SCHEMADECLHANDLER__TOP (DISPID_MX_SCHEMADECLHANDLER + 2) - -#define DISPID_MX_NSMGR__BASE (DISPID_MX_SCHEMADECLHANDLER__TOP + 1) -#define DISPID_MX_NSMGR (DISPID_MX_NSMGR__BASE) -#define DISPID_MX_NSMGR_ALLOWOVERRIDE (DISPID_MX_NSMGR + 1) -#define DISPID_MX_NSMGR_RESET (DISPID_MX_NSMGR + 2) -#define DISPID_MX_NSMGR_PUSHCONTEXT (DISPID_MX_NSMGR + 3) -#define DISPID_MX_NSMGR_PUSHNODECONTEXT (DISPID_MX_NSMGR + 4) -#define DISPID_MX_NSMGR_POPCONTEXT (DISPID_MX_NSMGR + 5) -#define DISPID_MX_NSMGR_DECLAREPREFIX (DISPID_MX_NSMGR + 6) -#define DISPID_MX_NSMGR_GETDECLAREDPREFIXES (DISPID_MX_NSMGR + 7) -#define DISPID_MX_NSMGR_GETPREFIXES (DISPID_MX_NSMGR + 8) -#define DISPID_MX_NSMGR_GETURI (DISPID_MX_NSMGR + 9) -#define DISPID_MX_NSMGR_GETURIFROMNODE (DISPID_MX_NSMGR + 10) -#define DISPID_MX_NSMGR_LENGTH (DISPID_MX_NSMGR + 11) -#define DISPID_MX_NSMGR__TOP (DISPID_MX_NSMGR + 12) - -#define DISPID_MXXML_FILTER__BASE (DISPID_MX_NSMGR__TOP + 1) -#define DISPID_MXXML_FILTER (DISPID_MXXML_FILTER__BASE) -#define DISPID_MXXML_FILTER_CONTENTHANDLER (DISPID_MXXML_FILTER + 1) -#define DISPID_MXXML_FILTER_DTDHANDLER (DISPID_MXXML_FILTER + 2) -#define DISPID_MXXML_FILTER_ENTITYRESOLVER (DISPID_MXXML_FILTER + 3) -#define DISPID_MXXML_FILTER_ERRORHANDLER (DISPID_MXXML_FILTER + 4) -#define DISPID_MXXML_FILTER_GETFEATURE (DISPID_MXXML_FILTER + 5) -#define DISPID_MXXML_FILTER_GETPROPERTY (DISPID_MXXML_FILTER + 6) -#define DISPID_MXXML_FILTER_PUTFEATURE (DISPID_MXXML_FILTER + 7) -#define DISPID_MXXML_FILTER_PUTPROPERTY (DISPID_MXXML_FILTER + 8) -#define DISPID_MXXML_FILTER__TOP (DISPID_MXXML_FILTER + 9) - - -// Schema Object Model DISPIDs -#define DISPID_SOM (DISPID_MX_NSMGR__TOP + 1) -#define DISPID_SOM_VALIDATE (DISPID_SOM + 1) -#define DISPID_SOM_VALIDATEONLOAD (DISPID_SOM + 2) -#define DISPID_SOM_GETSCHEMA (DISPID_SOM + 3) -#define DISPID_SOM_GETDECLARATION (DISPID_SOM + 4) -#define DISPID_SOM_ITEMBYNAME (DISPID_SOM + 5) -#define DISPID_SOM_ITEMBYQNAME (DISPID_SOM + 6) -#define DISPID_SOM_ANYATTRIBUTE (DISPID_SOM + 7) -#define DISPID_SOM_ATTRIBUTEGROUPS (DISPID_SOM + 8) -#define DISPID_SOM_ATTRIBUTES (DISPID_SOM + 9) -#define DISPID_SOM_BASETYPES (DISPID_SOM + 10) -#define DISPID_SOM_CONTENTMODEL (DISPID_SOM + 11) -#define DISPID_SOM_CONTENTTYPE (DISPID_SOM + 12) -#define DISPID_SOM_DEFAULTVALUE (DISPID_SOM + 13) -#define DISPID_SOM_DERIVEDBY (DISPID_SOM + 14) -#define DISPID_SOM_DISALLOWED (DISPID_SOM + 15) -#define DISPID_SOM_ELEMENTS (DISPID_SOM + 16) -#define DISPID_SOM_ENUMERATION (DISPID_SOM + 17) -#define DISPID_SOM_FIELDS (DISPID_SOM + 18) -#define DISPID_SOM_FINAL (DISPID_SOM + 19) -#define DISPID_SOM_FIXEDVALUE (DISPID_SOM + 20) -#define DISPID_SOM_FRACTIONDIGITS (DISPID_SOM + 21) -#define DISPID_SOM_ID (DISPID_SOM + 22) -#define DISPID_SOM_IDCONSTRAINTS (DISPID_SOM + 23) -#define DISPID_SOM_ISABSTRACT (DISPID_SOM + 24) -#define DISPID_SOM_ISNILLABLE (DISPID_SOM + 25) -#define DISPID_SOM_ISREFERENCE (DISPID_SOM + 26) -#define DISPID_SOM_ISVALID (DISPID_SOM + 27) -#define DISPID_SOM_ITEMTYPE (DISPID_SOM + 28) -#define DISPID_SOM_LENGTH (DISPID_SOM + 29) -#define DISPID_SOM_MAXEXCLUSIVE (DISPID_SOM + 30) -#define DISPID_SOM_MAXINCLUSIVE (DISPID_SOM + 31) -#define DISPID_SOM_MAXLENGTH (DISPID_SOM + 32) -#define DISPID_SOM_MAXOCCURS (DISPID_SOM + 33) -#define DISPID_SOM_MINEXCLUSIVE (DISPID_SOM + 34) -#define DISPID_SOM_MININCLUSIVE (DISPID_SOM + 35) -#define DISPID_SOM_MINLENGTH (DISPID_SOM + 36) -#define DISPID_SOM_MINOCCURS (DISPID_SOM + 37) -#define DISPID_SOM_MODELGROUPS (DISPID_SOM + 38) -#define DISPID_SOM_NAME (DISPID_SOM + 39) -#define DISPID_SOM_NAMESPACES (DISPID_SOM + 40) -#define DISPID_SOM_NAMESPACEURI (DISPID_SOM + 41) -#define DISPID_SOM_NOTATIONS (DISPID_SOM + 42) -#define DISPID_SOM_PARTICLES (DISPID_SOM + 43) -#define DISPID_SOM_PATTERNS (DISPID_SOM + 44) -#define DISPID_SOM_PROCESSCONTENTS (DISPID_SOM + 45) -#define DISPID_SOM_PROHIBITED (DISPID_SOM + 46) -#define DISPID_SOM_PUBLICIDENTIFIER (DISPID_SOM + 47) -#define DISPID_SOM_REFERENCEDKEY (DISPID_SOM + 48) -#define DISPID_SOM_SCHEMA (DISPID_SOM + 49) -#define DISPID_SOM_SCHEMALOCATIONS (DISPID_SOM + 50) -#define DISPID_SOM_SCOPE (DISPID_SOM + 51) -#define DISPID_SOM_SELECTOR (DISPID_SOM + 52) -#define DISPID_SOM_SUBSTITUTIONGROUP (DISPID_SOM + 53) -#define DISPID_SOM_EXCLUSIONS (DISPID_SOM + 54) -#define DISPID_SOM_SYSTEMIDENTIFIER (DISPID_SOM + 55) -#define DISPID_SOM_TARGETNAMESPACE (DISPID_SOM + 56) -#define DISPID_SOM_TOTALDIGITS (DISPID_SOM + 57) -#define DISPID_SOM_TYPE (DISPID_SOM + 58) -#define DISPID_SOM_TYPES (DISPID_SOM + 59) -#define DISPID_SOM_UNHANDLEDATTRS (DISPID_SOM + 60) -#define DISPID_SOM_USE (DISPID_SOM + 61) -#define DISPID_SOM_VARIETY (DISPID_SOM + 62) -#define DISPID_SOM_VERSION (DISPID_SOM + 63) -#define DISPID_SOM_WHITESPACE (DISPID_SOM + 64) -#define DISPID_SOM_WRITEANNOTATION (DISPID_SOM + 65) -#define DISPID_SOM_TOP (DISPID_SOM + 66) - -// XML DigitalSignature DISPIDs -#define DISPID_XMLDSIG (0x00000001) -#define DISPID_XMLDSIG_CREATEKEYFROMCSP (DISPID_XMLDSIG + 0) -#define DISPID_XMLDSIG_CREATEKEYFROMHMACSECRET (DISPID_XMLDSIG + 1) -#define DISPID_XMLDSIG_CREATEKEYFROMNODE (DISPID_XMLDSIG + 2) -#define DISPID_XMLDSIG_CREATESAXPROXY (DISPID_XMLDSIG + 3) -#define DISPID_XMLDSIG_GETVERIFYINGCERTIFICATE (DISPID_XMLDSIG + 4) -#define DISPID_XMLDSIG_SETREFERENCEDATA (DISPID_XMLDSIG + 5) -#define DISPID_XMLDSIG_SIGN (DISPID_XMLDSIG + 6) -#define DISPID_XMLDSIG_SIGNATURE (DISPID_XMLDSIG + 7) -#define DISPID_XMLDSIG_STORE (DISPID_XMLDSIG + 8) -#define DISPID_XMLDSIG_VERIFY (DISPID_XMLDSIG + 9) - -//;begin_internal -#endif // __MSXMLDID_H__ -//;end_internal diff --git a/cli/test/include/gtest/tinystr.h b/cli/test/include/gtest/tinystr.h deleted file mode 100644 index aedd2f9..0000000 --- a/cli/test/include/gtest/tinystr.h +++ /dev/null @@ -1,294 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original file by Yves Berquin. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -/* - * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. - * - * - completely rewritten. compact, clean, and fast implementation. - * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) - * - fixed reserve() to work as per specification. - * - fixed buggy compares operator==(), operator<(), and operator>() - * - fixed operator+=() to take a const ref argument, following spec. - * - added "copy" constructor with length, and most compare operators. - * - added swap(), clear(), size(), capacity(), operator+(). - */ - -#ifndef TIXML_USE_STL - -#ifndef TIXML_STRING_INCLUDED -#define TIXML_STRING_INCLUDED - -#include -#include - -/* - TiXmlString is an emulation of a subset of the std::string template. - Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. - Only the member functions relevant to the TinyXML project have been implemented. - The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase - a string and there's no more room, we allocate a buffer twice as big as we need. -*/ -class TiXmlString -{ - public : - // The size type used - typedef unsigned int size_type; - - // Error value for find primitive - static const size_type npos; // = -1; - - - // TiXmlString empty constructor - TiXmlString () : rep_(&nullrep_) - { - } - - // TiXmlString copy constructor - TiXmlString (const TiXmlString & copy) - { - init(copy.length()); - memcpy(start(), copy.data(), length()); - } - - // TiXmlString constructor, based on a string - TiXmlString (const char * copy) - { - init( static_cast( strlen(copy) )); - memcpy(start(), copy, length()); - } - - // TiXmlString constructor, based on a string - TiXmlString (const char * str, size_type len) - { - init(len); - memcpy(start(), str, len); - } - - // TiXmlString destructor - ~TiXmlString () - { - quit(); - } - - // = operator - TiXmlString& operator = (const char * copy) - { - return assign( copy, (size_type)strlen(copy)); - } - - // = operator - TiXmlString& operator = (const TiXmlString & copy) - { - return assign(copy.start(), copy.length()); - } - - - // += operator. Maps to append - TiXmlString& operator += (const char * suffix) - { - return append(suffix, static_cast( strlen(suffix) )); - } - - // += operator. Maps to append - TiXmlString& operator += (char single) - { - return append(&single, 1); - } - - // += operator. Maps to append - TiXmlString& operator += (const TiXmlString & suffix) - { - return append(suffix.data(), suffix.length()); - } - - - // Convert a TiXmlString into a null-terminated char * - const char * c_str () const { return rep_->str; } - - // Convert a TiXmlString into a char * (need not be null terminated). - const char * data () const { return rep_->str; } - - // Return the length of a TiXmlString - size_type length () const { return rep_->size; } - - // Alias for length() - size_type size () const { return rep_->size; } - - // Checks if a TiXmlString is empty - bool empty () const { return rep_->size == 0; } - - // Return capacity of string - size_type capacity () const { return rep_->capacity; } - - - // single char extraction - const char& at (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // [] operator - char& operator [] (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // find a char in a string. Return TiXmlString::npos if not found - size_type find (char lookup) const - { - return find(lookup, 0); - } - - // find a char in a string from an offset. Return TiXmlString::npos if not found - size_type find (char tofind, size_type offset) const - { - if (offset >= length()) return npos; - - for (const char* p = c_str() + offset; *p != '\0'; ++p) - { - if (*p == tofind) return static_cast< size_type >( p - c_str() ); - } - return npos; - } - - void clear () - { - //Lee: - //The original was just too strange, though correct: - // TiXmlString().swap(*this); - //Instead use the quit & re-init: - quit(); - init(0,0); - } - - /* Function to reserve a big amount of data when we know we'll need it. Be aware that this - function DOES NOT clear the content of the TiXmlString if any exists. - */ - void reserve (size_type cap); - - TiXmlString& assign (const char* str, size_type len); - - TiXmlString& append (const char* str, size_type len); - - void swap (TiXmlString& other) - { - Rep* r = rep_; - rep_ = other.rep_; - other.rep_ = r; - } - - private: - - void init(size_type sz) { init(sz, sz); } - void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } - char* start() const { return rep_->str; } - char* finish() const { return rep_->str + rep_->size; } - - struct Rep - { - size_type size, capacity; - char str[1]; - }; - - void init(size_type sz, size_type cap) - { - if (cap) - { - rep_ = static_cast(operator new(sizeof(Rep) + cap)); - rep_->str[ rep_->size = sz ] = '\0'; - rep_->capacity = cap; - } - else - { - rep_ = &nullrep_; - } - } - - void quit() - { - if (rep_ != &nullrep_) - { - operator delete(rep_); - } - } - - Rep * rep_; - static Rep nullrep_; - -} ; - - -inline bool operator == (const TiXmlString & a, const TiXmlString & b) -{ - return ( a.length() == b.length() ) // optimization on some platforms - && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare -} -inline bool operator < (const TiXmlString & a, const TiXmlString & b) -{ - return strcmp(a.c_str(), b.c_str()) < 0; -} - -inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } -inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } -inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } -inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } - -inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } -inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } -inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } -inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } - -TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); -TiXmlString operator + (const TiXmlString & a, const char* b); -TiXmlString operator + (const char* a, const TiXmlString & b); - - -/* - TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. - Only the operators that we need for TinyXML have been developped. -*/ -class TiXmlOutStream : public TiXmlString -{ -public : - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const TiXmlString & in) - { - *this += in; - return *this; - } - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const char * in) - { - *this += in; - return *this; - } - -} ; - -#endif // TIXML_STRING_INCLUDED -#endif // TIXML_USE_STL diff --git a/cli/test/include/gtest/tinyxml.h b/cli/test/include/gtest/tinyxml.h deleted file mode 100644 index 18cf94f..0000000 --- a/cli/test/include/gtest/tinyxml.h +++ /dev/null @@ -1,1511 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - - -#ifndef TINYXML_INCLUDED -#define TINYXML_INCLUDED - -#ifdef _MSC_VER -#pragma warning( push ) -#pragma warning( disable : 4530 ) -#pragma warning( disable : 4786 ) -#endif - -#include -#include -#include -#include -#include - -// Help out windows: -#if defined( _DEBUG ) && !defined( DEBUG ) -#define DEBUG -#endif - -#if defined( DEBUG ) && defined( _MSC_VER ) -#include -#define TIXML_LOG OutputDebugString -#else -#define TIXML_LOG printf -#endif - -#ifdef TIXML_USE_STL - #include - #include - #define TIXML_STRING std::string - #define TIXML_ISTREAM std::istream - #define TIXML_OSTREAM std::ostream -#else - #include "tinystr.h" - #define TIXML_STRING TiXmlString - #define TIXML_OSTREAM TiXmlOutStream -#endif - -// Deprecated library function hell. Compilers want to use the -// new safe versions. This probably doesn't fully address the problem, -// but it gets closer. There are too many compilers for me to fully -// test. If you get compilation troubles, undefine TIXML_SAFE - -#define TIXML_SAFE // TinyXml isn't fully buffer overrun protected, safe code. This is work in progress. -#ifdef TIXML_SAFE - #if defined(_MSC_VER) && (_MSC_VER >= 1200 ) - // Microsoft visual studio, version 6 and higher. - //#pragma message( "Using _sn* functions." ) - #define TIXML_SNPRINTF _snprintf - #define TIXML_SNSCANF _snscanf - #elif defined(__GNUC__) && (__GNUC__ >= 3 ) - // GCC version 3 and higher.s - //#warning( "Using sn* functions." ) - #define TIXML_SNPRINTF snprintf - #define TIXML_SNSCANF snscanf - #endif -#endif - -class TiXmlDocument; -class TiXmlElement; -class TiXmlComment; -class TiXmlUnknown; -class TiXmlAttribute; -class TiXmlText; -class TiXmlDeclaration; -class TiXmlParsingData; - -const int TIXML_MAJOR_VERSION = 2; -const int TIXML_MINOR_VERSION = 4; -const int TIXML_PATCH_VERSION = 0; - -/* Internal structure for tracking location of items - in the XML file. -*/ -struct TiXmlCursor -{ - TiXmlCursor() { Clear(); } - void Clear() { row = col = -1; } - - int row; // 0 based. - int col; // 0 based. -}; - - -// Only used by Attribute::Query functions -enum -{ - TIXML_SUCCESS, - TIXML_NO_ATTRIBUTE, - TIXML_WRONG_TYPE -}; - - -// Used by the parsing routines. -enum TiXmlEncoding -{ - TIXML_ENCODING_UNKNOWN, - TIXML_ENCODING_UTF8, - TIXML_ENCODING_LEGACY -}; - -const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; - -/** TiXmlBase is a base class for every class in TinyXml. - It does little except to establish that TinyXml classes - can be printed and provide some utility functions. - - In XML, the document and elements can contain - other elements and other types of nodes. - - @verbatim - A Document can contain: Element (container or leaf) - Comment (leaf) - Unknown (leaf) - Declaration( leaf ) - - An Element can contain: Element (container or leaf) - Text (leaf) - Attributes (not on tree) - Comment (leaf) - Unknown (leaf) - - A Decleration contains: Attributes (not on tree) - @endverbatim -*/ -class TiXmlBase -{ - friend class TiXmlNode; - friend class TiXmlElement; - friend class TiXmlDocument; - -public: - TiXmlBase() : userData(0) {} - virtual ~TiXmlBase() {} - - /** All TinyXml classes can print themselves to a filestream. - This is a formatted print, and will insert tabs and newlines. - - (For an unformatted stream, use the << operator.) - */ - virtual void Print( FILE* cfile, int depth ) const = 0; - - /** The world does not agree on whether white space should be kept or - not. In order to make everyone happy, these global, static functions - are provided to set whether or not TinyXml will condense all white space - into a single space or not. The default is to condense. Note changing this - values is not thread safe. - */ - static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } - - /// Return the current white space setting. - static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } - - /** Return the position, in the original source file, of this node or attribute. - The row and column are 1-based. (That is the first row and first column is - 1,1). If the returns values are 0 or less, then the parser does not have - a row and column value. - - Generally, the row and column value will be set when the TiXmlDocument::Load(), - TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set - when the DOM was created from operator>>. - - The values reflect the initial load. Once the DOM is modified programmatically - (by adding or changing nodes and attributes) the new values will NOT update to - reflect changes in the document. - - There is a minor performance cost to computing the row and column. Computation - can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. - - @sa TiXmlDocument::SetTabSize() - */ - int Row() const { return location.row + 1; } - int Column() const { return location.col + 1; } ///< See Row() - - void SetUserData( void* user ) { userData = user; } - void* GetUserData() { return userData; } - - // Table that returs, for a given lead byte, the total number of bytes - // in the UTF-8 sequence. - static const int utf8ByteTable[256]; - - virtual const char* Parse( const char* p, - TiXmlParsingData* data, - TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; - - enum - { - TIXML_NO_ERROR = 0, - TIXML_ERROR, - TIXML_ERROR_OPENING_FILE, - TIXML_ERROR_OUT_OF_MEMORY, - TIXML_ERROR_PARSING_ELEMENT, - TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, - TIXML_ERROR_READING_ELEMENT_VALUE, - TIXML_ERROR_READING_ATTRIBUTES, - TIXML_ERROR_PARSING_EMPTY, - TIXML_ERROR_READING_END_TAG, - TIXML_ERROR_PARSING_UNKNOWN, - TIXML_ERROR_PARSING_COMMENT, - TIXML_ERROR_PARSING_DECLARATION, - TIXML_ERROR_DOCUMENT_EMPTY, - TIXML_ERROR_EMBEDDED_NULL, - TIXML_ERROR_PARSING_CDATA, - - TIXML_ERROR_STRING_COUNT - }; - -protected: - - // See STL_STRING_BUG - // Utility class to overcome a bug. - class StringToBuffer - { - public: - StringToBuffer( const TIXML_STRING& str ); - ~StringToBuffer(); - char* buffer; - }; - - static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); - inline static bool IsWhiteSpace( char c ) - { - return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); - } - - virtual void StreamOut (TIXML_OSTREAM *) const = 0; - - #ifdef TIXML_USE_STL - static bool StreamWhiteSpace( TIXML_ISTREAM * in, TIXML_STRING * tag ); - static bool StreamTo( TIXML_ISTREAM * in, int character, TIXML_STRING * tag ); - #endif - - /* Reads an XML name into the string provided. Returns - a pointer just past the last character of the name, - or 0 if the function has an error. - */ - static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); - - /* Reads text. Returns a pointer past the given end tag. - Wickedly complex options, but it keeps the (sensitive) code in one place. - */ - static const char* ReadText( const char* in, // where to start - TIXML_STRING* text, // the string read - bool ignoreWhiteSpace, // whether to keep the white space - const char* endTag, // what ends this text - bool ignoreCase, // whether to ignore case in the end tag - TiXmlEncoding encoding ); // the current encoding - - // If an entity has been found, transform it into a character. - static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); - - // Get a character, while interpreting entities. - // The length can be from 0 to 4 bytes. - inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) - { - assert( p ); - if ( encoding == TIXML_ENCODING_UTF8 ) - { - *length = utf8ByteTable[ *((unsigned char*)p) ]; - assert( *length >= 0 && *length < 5 ); - } - else - { - *length = 1; - } - - if ( *length == 1 ) - { - if ( *p == '&' ) - return GetEntity( p, _value, length, encoding ); - *_value = *p; - return p+1; - } - else if ( *length ) - { - //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), - // and the null terminator isn't needed - for( int i=0; p[i] && i<*length; ++i ) { - _value[i] = p[i]; - } - return p + (*length); - } - else - { - // Not valid text. - return 0; - } - } - - // Puts a string to a stream, expanding entities as it goes. - // Note this should not contian the '<', '>', etc, or they will be transformed into entities! - static void PutString( const TIXML_STRING& str, TIXML_OSTREAM* out ); - - static void PutString( const TIXML_STRING& str, TIXML_STRING* out ); - - // Return true if the next characters in the stream are any of the endTag sequences. - // Ignore case only works for english, and should only be relied on when comparing - // to English words: StringEqual( p, "version", true ) is fine. - static bool StringEqual( const char* p, - const char* endTag, - bool ignoreCase, - TiXmlEncoding encoding ); - - static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; - - TiXmlCursor location; - - /// Field containing a generic user pointer - void* userData; - - // None of these methods are reliable for any language except English. - // Good for approximation, not great for accuracy. - static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); - static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); - inline static int ToLower( int v, TiXmlEncoding encoding ) - { - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( v < 128 ) return tolower( v ); - return v; - } - else - { - return tolower( v ); - } - } - static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); - -private: - TiXmlBase( const TiXmlBase& ); // not implemented. - void operator=( const TiXmlBase& base ); // not allowed. - - struct Entity - { - const char* str; - unsigned int strLength; - char chr; - }; - enum - { - NUM_ENTITY = 5, - MAX_ENTITY_LENGTH = 6 - - }; - static Entity entity[ NUM_ENTITY ]; - static bool condenseWhiteSpace; -}; - - -/** The parent class for everything in the Document Object Model. - (Except for attributes). - Nodes have siblings, a parent, and children. A node can be - in a document, or stand on its own. The type of a TiXmlNode - can be queried, and it can be cast to its more defined type. -*/ -class TiXmlNode : public TiXmlBase -{ - friend class TiXmlDocument; - friend class TiXmlElement; - -public: - #ifdef TIXML_USE_STL - - /** An input stream operator, for every class. Tolerant of newlines and - formatting, but doesn't expect them. - */ - friend std::istream& operator >> (std::istream& in, TiXmlNode& base); - - /** An output stream operator, for every class. Note that this outputs - without any newlines or formatting, as opposed to Print(), which - includes tabs and new lines. - - The operator<< and operator>> are not completely symmetric. Writing - a node to a stream is very well defined. You'll get a nice stream - of output, without any extra whitespace or newlines. - - But reading is not as well defined. (As it always is.) If you create - a TiXmlElement (for example) and read that from an input stream, - the text needs to define an element or junk will result. This is - true of all input streams, but it's worth keeping in mind. - - A TiXmlDocument will read nodes until it reads a root element, and - all the children of that root element. - */ - friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); - - /// Appends the XML node or attribute to a std::string. - friend std::string& operator<< (std::string& out, const TiXmlNode& base ); - - #else - // Used internally, not part of the public API. - friend TIXML_OSTREAM& operator<< (TIXML_OSTREAM& out, const TiXmlNode& base); - #endif - - /** The types of XML nodes supported by TinyXml. (All the - unsupported types are picked up by UNKNOWN.) - */ - enum NodeType - { - DOCUMENT, - ELEMENT, - COMMENT, - UNKNOWN, - TEXT, - DECLARATION, - TYPECOUNT - }; - - virtual ~TiXmlNode(); - - /** The meaning of 'value' changes for the specific type of - TiXmlNode. - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - - The subclasses will wrap this function. - */ - const char *Value() const { return value.c_str (); } - - #ifdef TIXML_USE_STL - /** Return Value() as a std::string. If you only use STL, - this is more efficient than calling Value(). - Only available in STL mode. - */ - const std::string& ValueStr() const { return value; } - #endif - - /** Changes the value of the node. Defined as: - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - */ - void SetValue(const char * _value) { value = _value;} - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetValue( const std::string& _value ) - { - StringToBuffer buf( _value ); - SetValue( buf.buffer ? buf.buffer : "" ); - } - #endif - - /// Delete all the children of this node. Does not affect 'this'. - void Clear(); - - /// One step up the DOM. - TiXmlNode* Parent() { return parent; } - const TiXmlNode* Parent() const { return parent; } - - const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. - TiXmlNode* FirstChild() { return firstChild; } - const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. - TiXmlNode* FirstChild( const char * value ); ///< The first child of this node with the matching 'value'. Will be null if none found. - - const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. - TiXmlNode* LastChild() { return lastChild; } - const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. - TiXmlNode* LastChild( const char * value ); - - #ifdef TIXML_USE_STL - const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. - #endif - - /** An alternate way to walk the children of a node. - One way to iterate over nodes is: - @verbatim - for( child = parent->FirstChild(); child; child = child->NextSibling() ) - @endverbatim - - IterateChildren does the same thing with the syntax: - @verbatim - child = 0; - while( child = parent->IterateChildren( child ) ) - @endverbatim - - IterateChildren takes the previous child as input and finds - the next one. If the previous child is null, it returns the - first. IterateChildren will return null when done. - */ - const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( TiXmlNode* previous ); - - /// This flavor of IterateChildren searches for children with a particular 'value' - const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( const char * value, TiXmlNode* previous ); - - #ifdef TIXML_USE_STL - const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - TiXmlNode* IterateChildren( const std::string& _value, TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - #endif - - /** Add a new node related to this. Adds a child past the LastChild. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); - - - /** Add a new node related to this. Adds a child past the LastChild. - - NOTE: the node to be added is passed by pointer, and will be - henceforth owned (and deleted) by tinyXml. This method is efficient - and avoids an extra copy, but should be used with care as it - uses a different memory model than the other insert functions. - - @sa InsertEndChild - */ - TiXmlNode* LinkEndChild( TiXmlNode* addThis ); - - /** Add a new node related to this. Adds a child before the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); - - /** Add a new node related to this. Adds a child after the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); - - /** Replace a child of this node. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); - - /// Delete a child of this node. - bool RemoveChild( TiXmlNode* removeThis ); - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling() const { return prev; } - TiXmlNode* PreviousSibling() { return prev; } - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling( const char * ) const; - TiXmlNode* PreviousSibling( const char * ); - - #ifdef TIXML_USE_STL - const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Navigate to a sibling node. - const TiXmlNode* NextSibling() const { return next; } - TiXmlNode* NextSibling() { return next; } - - /// Navigate to a sibling node with the given 'value'. - const TiXmlNode* NextSibling( const char * ) const; - TiXmlNode* NextSibling( const char * ); - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement() const; - TiXmlElement* NextSiblingElement(); - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement( const char * ) const; - TiXmlElement* NextSiblingElement( const char * ); - - #ifdef TIXML_USE_STL - const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement() const; - TiXmlElement* FirstChildElement(); - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement( const char * value ) const; - TiXmlElement* FirstChildElement( const char * value ); - - #ifdef TIXML_USE_STL - const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /** Query the type (as an enumerated value, above) of this node. - The possible types are: DOCUMENT, ELEMENT, COMMENT, - UNKNOWN, TEXT, and DECLARATION. - */ - virtual int Type() const { return type; } - - /** Return a pointer to the Document this node lives in. - Returns null if not in a document. - */ - const TiXmlDocument* GetDocument() const; - TiXmlDocument* GetDocument(); - - /// Returns true if this node has no children. - bool NoChildren() const { return !firstChild; } - - const TiXmlDocument* ToDocument() const { return ( this && type == DOCUMENT ) ? (const TiXmlDocument*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - const TiXmlElement* ToElement() const { return ( this && type == ELEMENT ) ? (const TiXmlElement*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - const TiXmlComment* ToComment() const { return ( this && type == COMMENT ) ? (const TiXmlComment*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - const TiXmlUnknown* ToUnknown() const { return ( this && type == UNKNOWN ) ? (const TiXmlUnknown*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - const TiXmlText* ToText() const { return ( this && type == TEXT ) ? (const TiXmlText*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - const TiXmlDeclaration* ToDeclaration() const { return ( this && type == DECLARATION ) ? (const TiXmlDeclaration*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - - TiXmlDocument* ToDocument() { return ( this && type == DOCUMENT ) ? (TiXmlDocument*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - TiXmlElement* ToElement() { return ( this && type == ELEMENT ) ? (TiXmlElement*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - TiXmlComment* ToComment() { return ( this && type == COMMENT ) ? (TiXmlComment*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - TiXmlUnknown* ToUnknown() { return ( this && type == UNKNOWN ) ? (TiXmlUnknown*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - TiXmlText* ToText() { return ( this && type == TEXT ) ? (TiXmlText*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - TiXmlDeclaration* ToDeclaration() { return ( this && type == DECLARATION ) ? (TiXmlDeclaration*) this : 0; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Create an exact duplicate of this node and return it. The memory must be deleted - by the caller. - */ - virtual TiXmlNode* Clone() const = 0; - -protected: - TiXmlNode( NodeType _type ); - - // Copy to the allocated object. Shared functionality between Clone, Copy constructor, - // and the assignment operator. - void CopyTo( TiXmlNode* target ) const; - - #ifdef TIXML_USE_STL - // The real work of the input operator. - virtual void StreamIn( TIXML_ISTREAM* in, TIXML_STRING* tag ) = 0; - #endif - - // Figure out what is at *p, and parse it. Returns null if it is not an xml node. - TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); - - TiXmlNode* parent; - NodeType type; - - TiXmlNode* firstChild; - TiXmlNode* lastChild; - - TIXML_STRING value; - - TiXmlNode* prev; - TiXmlNode* next; - -private: - TiXmlNode( const TiXmlNode& ); // not implemented. - void operator=( const TiXmlNode& base ); // not allowed. -}; - - -/** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not TiXmlNodes, since they are not - part of the tinyXML document object model. There are other - suggested ways to look at this problem. -*/ -class TiXmlAttribute : public TiXmlBase -{ - friend class TiXmlAttributeSet; - -public: - /// Construct an empty attribute. - TiXmlAttribute() : TiXmlBase() - { - document = 0; - prev = next = 0; - } - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlAttribute( const std::string& _name, const std::string& _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - #endif - - /// Construct an attribute with a name and value. - TiXmlAttribute( const char * _name, const char * _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - - const char* Name() const { return name.c_str (); } ///< Return the name of this attribute. - const char* Value() const { return value.c_str (); } ///< Return the value of this attribute. - int IntValue() const; ///< Return the value of this attribute, converted to an integer. - double DoubleValue() const; ///< Return the value of this attribute, converted to a double. - - /** QueryIntValue examines the value string. It is an alternative to the - IntValue() method with richer error checking. - If the value is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. - - A specialized but useful call. Note that for success it returns 0, - which is the opposite of almost all other TinyXml calls. - */ - int QueryIntValue( int* _value ) const; - /// QueryDoubleValue examines the value string. See QueryIntValue(). - int QueryDoubleValue( double* _value ) const; - - void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. - void SetValue( const char* _value ) { value = _value; } ///< Set the value. - - void SetIntValue( int _value ); ///< Set the value from an integer. - void SetDoubleValue( double _value ); ///< Set the value from a double. - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetName( const std::string& _name ) - { - StringToBuffer buf( _name ); - SetName ( buf.buffer ? buf.buffer : "error" ); - } - /// STL std::string form. - void SetValue( const std::string& _value ) - { - StringToBuffer buf( _value ); - SetValue( buf.buffer ? buf.buffer : "error" ); - } - #endif - - /// Get the next sibling attribute in the DOM. Returns null at end. - const TiXmlAttribute* Next() const; - TiXmlAttribute* Next(); - /// Get the previous sibling attribute in the DOM. Returns null at beginning. - const TiXmlAttribute* Previous() const; - TiXmlAttribute* Previous(); - - bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } - bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } - bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } - - /* Attribute parsing starts: first letter of the name - returns: the next char after the value end quote - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - // Prints this Attribute to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - virtual void StreamOut( TIXML_OSTREAM * out ) const; - // [internal use] - // Set the document pointer so the attribute can report errors. - void SetDocument( TiXmlDocument* doc ) { document = doc; } - -private: - TiXmlAttribute( const TiXmlAttribute& ); // not implemented. - void operator=( const TiXmlAttribute& base ); // not allowed. - - TiXmlDocument* document; // A pointer back to a document, for error reporting. - TIXML_STRING name; - TIXML_STRING value; - TiXmlAttribute* prev; - TiXmlAttribute* next; -}; - - -/* A class used to manage a group of attributes. - It is only used internally, both by the ELEMENT and the DECLARATION. - - The set can be changed transparent to the Element and Declaration - classes that use it, but NOT transparent to the Attribute - which has to implement a next() and previous() method. Which makes - it a bit problematic and prevents the use of STL. - - This version is implemented with circular lists because: - - I like circular lists - - it demonstrates some independence from the (typical) doubly linked list. -*/ -class TiXmlAttributeSet -{ -public: - TiXmlAttributeSet(); - ~TiXmlAttributeSet(); - - void Add( TiXmlAttribute* attribute ); - void Remove( TiXmlAttribute* attribute ); - - const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - - const TiXmlAttribute* Find( const char * name ) const; - TiXmlAttribute* Find( const char * name ); - -private: - //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), - //*ME: this class must be also use a hidden/disabled copy-constructor !!! - TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed - void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) - - TiXmlAttribute sentinel; -}; - - -/** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. -*/ -class TiXmlElement : public TiXmlNode -{ -public: - /// Construct an element. - TiXmlElement (const char * in_value); - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlElement( const std::string& _value ); - #endif - - TiXmlElement( const TiXmlElement& ); - - void operator=( const TiXmlElement& base ); - - virtual ~TiXmlElement(); - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - */ - const char* Attribute( const char* name ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an integer, - the integer value will be put in the return 'i', if 'i' - is non-null. - */ - const char* Attribute( const char* name, int* i ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an double, - the double value will be put in the return 'd', if 'd' - is non-null. - */ - const char* Attribute( const char* name, double* d ) const; - - /** QueryIntAttribute examines the attribute - it is an alternative to the - Attribute() method with richer error checking. - If the attribute is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. If the attribute - does not exist, then TIXML_NO_ATTRIBUTE is returned. - */ - int QueryIntAttribute( const char* name, int* _value ) const; - /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). - int QueryDoubleAttribute( const char* name, double* _value ) const; - /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). - int QueryFloatAttribute( const char* name, float* _value ) const { - double d; - int result = QueryDoubleAttribute( name, &d ); - if ( result == TIXML_SUCCESS ) { - *_value = (float)d; - } - return result; - } - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char* name, const char * _value ); - - #ifdef TIXML_USE_STL - const char* Attribute( const std::string& name ) const { return Attribute( name.c_str() ); } - const char* Attribute( const std::string& name, int* i ) const { return Attribute( name.c_str(), i ); } - const char* Attribute( const std::string& name, double* d ) const { return Attribute( name.c_str(), d ); } - int QueryIntAttribute( const std::string& name, int* _value ) const { return QueryIntAttribute( name.c_str(), _value ); } - int QueryDoubleAttribute( const std::string& name, double* _value ) const { return QueryDoubleAttribute( name.c_str(), _value ); } - - /// STL std::string form. - void SetAttribute( const std::string& name, const std::string& _value ) - { - StringToBuffer n( name ); - StringToBuffer v( _value ); - if ( n.buffer && v.buffer ) - SetAttribute (n.buffer, v.buffer ); - } - ///< STL std::string form. - void SetAttribute( const std::string& name, int _value ) - { - StringToBuffer n( name ); - if ( n.buffer ) - SetAttribute (n.buffer, _value); - } - #endif - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char * name, int value ); - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetDoubleAttribute( const char * name, double value ); - - /** Deletes an attribute with the given name. - */ - void RemoveAttribute( const char * name ); - #ifdef TIXML_USE_STL - void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. - #endif - - const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. - TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } - const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. - TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the TiXmlText child - and accessing it directly. - - If the first child of 'this' is a TiXmlText, the GetText() - returs the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - - WARNING: GetText() accesses a child node - don't become confused with the - similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are - safe type casts on the referenced node. - */ - const char* GetText() const; - - /// Creates a new Element and returns it - the returned element is a copy. - virtual TiXmlNode* Clone() const; - // Print the Element to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: next char past '<' - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - -protected: - - void CopyTo( TiXmlElement* target ) const; - void ClearThis(); // like clear, but initializes 'this' object as well - - // Used to be public [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - virtual void StreamOut( TIXML_OSTREAM * out ) const; - - /* [internal use] - Reads the "value" of the element -- another element, or text. - This should terminate with the current end tag. - */ - const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - -private: - - TiXmlAttributeSet attributeSet; -}; - - -/** An XML comment. -*/ -class TiXmlComment : public TiXmlNode -{ -public: - /// Constructs an empty comment. - TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} - TiXmlComment( const TiXmlComment& ); - void operator=( const TiXmlComment& base ); - - virtual ~TiXmlComment() {} - - /// Returns a copy of this Comment. - virtual TiXmlNode* Clone() const; - /// Write this Comment to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: at the ! of the !-- - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - -protected: - void CopyTo( TiXmlComment* target ) const; - - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - virtual void StreamOut( TIXML_OSTREAM * out ) const; - -private: - -}; - - -/** XML text. A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCDATA() and query it with CDATA(). -*/ -class TiXmlText : public TiXmlNode -{ - friend class TiXmlElement; -public: - /** Constructor for text element. By default, it is treated as - normal, encoded text. If you want it be output as a CDATA text - element, set the parameter _cdata to 'true' - */ - TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - virtual ~TiXmlText() {} - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - #endif - - TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } - void operator=( const TiXmlText& base ) { base.CopyTo( this ); } - - /// Write this text object to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /// Queries whether this represents text using a CDATA section. - bool CDATA() { return cdata; } - /// Turns on or off a CDATA representation of text. - void SetCDATA( bool _cdata ) { cdata = _cdata; } - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - -protected : - /// [internal use] Creates a new Element and returns it. - virtual TiXmlNode* Clone() const; - void CopyTo( TiXmlText* target ) const; - - virtual void StreamOut ( TIXML_OSTREAM * out ) const; - bool Blank() const; // returns true if all white space and new lines - // [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - -private: - bool cdata; // true if this should be input and output as a CDATA style text element -}; - - -/** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXml will happily read or write files without a declaration, - however. There are 3 possible attributes to the declaration: - version, encoding, and standalone. - - Note: In this version of the code, the attributes are - handled as special cases, not generic attributes, simply - because there can only be at most 3 and they are always the same. -*/ -class TiXmlDeclaration : public TiXmlNode -{ -public: - /// Construct an empty declaration. - TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} - -#ifdef TIXML_USE_STL - /// Constructor. - TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ); -#endif - - /// Construct. - TiXmlDeclaration( const char* _version, - const char* _encoding, - const char* _standalone ); - - TiXmlDeclaration( const TiXmlDeclaration& copy ); - void operator=( const TiXmlDeclaration& copy ); - - virtual ~TiXmlDeclaration() {} - - /// Version. Will return an empty string if none was found. - const char *Version() const { return version.c_str (); } - /// Encoding. Will return an empty string if none was found. - const char *Encoding() const { return encoding.c_str (); } - /// Is this a standalone document? - const char *Standalone() const { return standalone.c_str (); } - - /// Creates a copy of this Declaration and returns it. - virtual TiXmlNode* Clone() const; - /// Print this declaration to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - -protected: - void CopyTo( TiXmlDeclaration* target ) const; - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - virtual void StreamOut ( TIXML_OSTREAM * out) const; - -private: - - TIXML_STRING version; - TIXML_STRING encoding; - TIXML_STRING standalone; -}; - - -/** Any tag that tinyXml doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into TiXmlUnknowns. -*/ -class TiXmlUnknown : public TiXmlNode -{ -public: - TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} - virtual ~TiXmlUnknown() {} - - TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } - void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } - - /// Creates a copy of this Unknown and returns it. - virtual TiXmlNode* Clone() const; - /// Print this Unknown to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - -protected: - void CopyTo( TiXmlUnknown* target ) const; - - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - virtual void StreamOut ( TIXML_OSTREAM * out ) const; - -private: - -}; - - -/** Always the top level node. A document binds together all the - XML pieces. It can be saved, loaded, and printed to the screen. - The 'value' of a document node is the xml file name. -*/ -class TiXmlDocument : public TiXmlNode -{ -public: - /// Create an empty document, that has no name. - TiXmlDocument(); - /// Create a document with a name. The name of the document is also the filename of the xml. - TiXmlDocument( const char * documentName ); - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlDocument( const std::string& documentName ); - #endif - - TiXmlDocument( const TiXmlDocument& copy ); - void operator=( const TiXmlDocument& copy ); - - virtual ~TiXmlDocument() {} - - /** Load a file using the current document value. - Returns true if successful. Will delete any existing - document data before loading. - */ - bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the current document value. Returns true if successful. - bool SaveFile() const; - /// Load a file using the given filename. Returns true if successful. - bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the given filename. Returns true if successful. - bool SaveFile( const char * filename ) const; - - #ifdef TIXML_USE_STL - bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. - { - StringToBuffer f( filename ); - return ( f.buffer && LoadFile( f.buffer, encoding )); - } - bool SaveFile( const std::string& filename ) const ///< STL std::string version. - { - StringToBuffer f( filename ); - return ( f.buffer && SaveFile( f.buffer )); - } - #endif - - /** Parse the given null terminated block of xml data. Passing in an encoding to this - method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml - to use that encoding, regardless of what TinyXml might otherwise try to detect. - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - - /** Get the root element -- the only top level element -- of the document. - In well formed XML, there should only be one. TinyXml is tolerant of - multiple elements at the document level. - */ - const TiXmlElement* RootElement() const { return FirstChildElement(); } - TiXmlElement* RootElement() { return FirstChildElement(); } - - /** If an error occurs, Error will be set to true. Also, - - The ErrorId() will contain the integer identifier of the error (not generally useful) - - The ErrorDesc() method will return the name of the error. (very useful) - - The ErrorRow() and ErrorCol() will return the location of the error (if known) - */ - bool Error() const { return error; } - - /// Contains a textual (english) description of the error if one occurs. - const char * ErrorDesc() const { return errorDesc.c_str (); } - - /** Generally, you probably want the error string ( ErrorDesc() ). But if you - prefer the ErrorId, this function will fetch it. - */ - int ErrorId() const { return errorId; } - - /** Returns the location (if known) of the error. The first column is column 1, - and the first row is row 1. A value of 0 means the row and column wasn't applicable - (memory errors, for example, have no row/column) or the parser lost the error. (An - error in the error reporting, in that case.) - - @sa SetTabSize, Row, Column - */ - int ErrorRow() { return errorLocation.row+1; } - int ErrorCol() { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() - - /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) - to report the correct values for row and column. It does not change the output - or input in any way. - - By calling this method, with a tab size - greater than 0, the row and column of each node and attribute is stored - when the file is loaded. Very useful for tracking the DOM back in to - the source file. - - The tab size is required for calculating the location of nodes. If not - set, the default of 4 is used. The tabsize is set per document. Setting - the tabsize to 0 disables row/column tracking. - - Note that row and column tracking is not supported when using operator>>. - - The tab size needs to be enabled before the parse or load. Correct usage: - @verbatim - TiXmlDocument doc; - doc.SetTabSize( 8 ); - doc.Load( "myfile.xml" ); - @endverbatim - - @sa Row, Column - */ - void SetTabSize( int _tabsize ) { tabsize = _tabsize; } - - int TabSize() const { return tabsize; } - - /** If you have handled the error, it can be reset with this call. The error - state is automatically cleared if you Parse a new XML block. - */ - void ClearError() { error = false; - errorId = 0; - errorDesc = ""; - errorLocation.row = errorLocation.col = 0; - //errorLocation.last = 0; - } - - /** Dump the document to standard out. */ - void Print() const { Print( stdout, 0 ); } - - /// Print this Document to a FILE stream. - virtual void Print( FILE* cfile, int depth = 0 ) const; - // [internal use] - void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - -protected : - virtual void StreamOut ( TIXML_OSTREAM * out) const; - // [internal use] - virtual TiXmlNode* Clone() const; - #ifdef TIXML_USE_STL - virtual void StreamIn( TIXML_ISTREAM * in, TIXML_STRING * tag ); - #endif - -private: - void CopyTo( TiXmlDocument* target ) const; - - bool error; - int errorId; - TIXML_STRING errorDesc; - int tabsize; - TiXmlCursor errorLocation; - bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. -}; - - -/** - A TiXmlHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - TiXmlElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - TiXmlElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - TiXmlElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - TiXmlElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity - of such code. A TiXmlHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - TiXmlHandle docHandle( &document ); - TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).Element(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - TiXmlHandle handleCopy = handle; - @endverbatim - - What they should not be used for is iteration: - - @verbatim - int i=0; - while ( true ) - { - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).Element(); - if ( !child ) - break; - // do something - ++i; - } - @endverbatim - - It seems reasonable, but it is in fact two embedded while loops. The Child method is - a linear walk to find the element, so this code would iterate much more than it needs - to. Instead, prefer: - - @verbatim - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).Element(); - - for( child; child; child=child->NextSiblingElement() ) - { - // do something - } - @endverbatim -*/ -class TiXmlHandle -{ -public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } - /// Copy constructor - TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } - TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } - - /// Return a handle to the first child node. - TiXmlHandle FirstChild() const; - /// Return a handle to the first child node with the given name. - TiXmlHandle FirstChild( const char * value ) const; - /// Return a handle to the first child element. - TiXmlHandle FirstChildElement() const; - /// Return a handle to the first child element with the given name. - TiXmlHandle FirstChildElement( const char * value ) const; - - /** Return a handle to the "index" child with the given name. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( const char* value, int index ) const; - /** Return a handle to the "index" child. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( int index ) const; - /** Return a handle to the "index" child element with the given name. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( const char* value, int index ) const; - /** Return a handle to the "index" child element. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( int index ) const; - - #ifdef TIXML_USE_STL - TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } - TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } - - TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } - TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } - #endif - - /// Return the handle as a TiXmlNode. This may return null. - TiXmlNode* Node() const { return node; } - /// Return the handle as a TiXmlElement. This may return null. - TiXmlElement* Element() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } - /// Return the handle as a TiXmlText. This may return null. - TiXmlText* Text() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } - /// Return the handle as a TiXmlUnknown. This may return null; - TiXmlUnknown* Unknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } - -private: - TiXmlNode* node; -}; - -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - -#endif - diff --git a/cli/test/include/mockcpp/AfterMatchBuilder.h b/cli/test/include/mockcpp/AfterMatchBuilder.h deleted file mode 100644 index 8781865..0000000 --- a/cli/test/include/mockcpp/AfterMatchBuilder.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_AFTER_MATCH_BUILDER_H -#define __MOCKCPP_AFTER_MATCH_BUILDER_H - -#include - -#include - -MOCKCPP_NS_START - -struct InvocationMockerNamespace; -struct InvocationMocker; - -template -struct AfterMatchBuilder : public Builder -{ - AfterMatchBuilder& - after(const InvocationMockerNamespace& ns, const std::string& name); - - AfterMatchBuilder& - after(InvocationMockerNamespace* ns, const std::string& name); - - AfterMatchBuilder& - after(const std::string& name); - - virtual ~AfterMatchBuilder() {} - -private: - void - setupOrderingAfterMatchers(InvocationMocker* mocker); - -private: - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#include - -#endif - diff --git a/cli/test/include/mockcpp/AfterMatchBuilder.tcc b/cli/test/include/mockcpp/AfterMatchBuilder.tcc deleted file mode 100644 index a0a40da..0000000 --- a/cli/test/include/mockcpp/AfterMatchBuilder.tcc +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -////////////////////////////////////////////////////////////////////// -template -AfterMatchBuilder& -AfterMatchBuilder::after(const InvocationMockerNamespace& ns, const std::string& name) -{ - return after(&const_cast(ns), name); -} - -////////////////////////////////////////////////////////////////////// -template -AfterMatchBuilder& -AfterMatchBuilder::after(InvocationMockerNamespace* ns, const std::string& id) -{ - getMocker()->addMatcher( - new PendingMatcher( - new AfterMatcher(), ns, id, getMocker())); - return *this; -} - -////////////////////////////////////////////////////////////////////// -template -AfterMatchBuilder& -AfterMatchBuilder::after(const std::string& name) -{ - return after(getMocker()->getMethod()->getNamespace(), name); -} - -////////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - - diff --git a/cli/test/include/mockcpp/AfterMatcher.h b/cli/test/include/mockcpp/AfterMatcher.h deleted file mode 100644 index e54b213..0000000 --- a/cli/test/include/mockcpp/AfterMatcher.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_AFTER_MATCHER_H -#define __MOCKCPP_AFTER_MATCHER_H - -#include - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Invocation; - -struct AfterMatcher : public OrderingMatcher -{ - AfterMatcher(); - - bool matches(const Invocation& inv) const; - - void increaseInvoked(const Invocation& inv); - - std::string toString() const; - - void verify(void); - - bool isCompleted(void) const; - - void setOrderingInvocationMocker(InvocationMocker* mocker); - -private: - - InvocationMocker* previousCall; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHook.h b/cli/test/include/mockcpp/ApiHook.h deleted file mode 100644 index 67a97d4..0000000 --- a/cli/test/include/mockcpp/ApiHook.h +++ /dev/null @@ -1,24 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_H__ -#define __MOCKCPP_API_HOOK_H__ - -#include - -MOCKCPP_NS_START - -struct ApiHookImpl; - -struct ApiHook -{ - ApiHook ( const void* api - , const void* stub ); - - ~ApiHook(); - -private: - ApiHookImpl* This; -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/ApiHookFunctor.h b/cli/test/include/mockcpp/ApiHookFunctor.h deleted file mode 100644 index befc257..0000000 --- a/cli/test/include/mockcpp/ApiHookFunctor.h +++ /dev/null @@ -1,167 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_FUNCTOR_H__ -#define __MOCKCPP_API_HOOK_FUNCTOR_H__ - -#include -#include -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////////////// -template -struct ApiHookFunctor -{ -}; - -const std::string empty_caller(""); - -#define __MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, CallingConvention) \ -template \ -struct ApiHookFunctor \ -{ \ -private: \ - typedef R (CallingConvention *F) (DECL_ARGS(n)); \ - \ - static R CallingConvention hook(DECL_PARAMS_LIST(n)) \ - { \ - return GlobalMockObject::instance.invoke(apiAddress) \ - (empty_caller, RefAny() DECL_REST_PARAMS(n)); \ - } \ - \ - static bool appliedBy(F api) \ - { return apiAddress == reinterpret_cast(api); } \ - \ - static void* getHook() \ - { return reinterpret_cast(hook); } \ - \ - static void freeHook() \ - { if(--refCount == 0) apiAddress = 0; } \ -public: \ - \ - static void* getApiHook(F api) \ - { \ - if(!appliedBy(api)) return 0; \ - ++refCount; \ - return getHook(); \ - } \ - \ - static void* applyApiHook(F api) \ - { \ - if(apiAddress != 0) return 0; \ - apiAddress = reinterpret_cast(api); \ - refCount = 1; \ - return getHook(); \ - } \ - \ - static bool freeApiHook(void* hook) \ - { \ - if(getHook() != hook) return false; \ - freeHook(); \ - return true; \ - } \ -private: \ - static void* apiAddress; \ - static unsigned int refCount; \ -}; \ -template \ -void* ApiHookFunctor::apiAddress = 0; \ -template \ -unsigned int ApiHookFunctor::refCount = 0 - -/* For C++ method */ -#define __MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, CallingConvention, ConstConvention) \ -template \ -struct ApiHookFunctor \ -{ \ -private: \ - typedef ApiHookFunctor ThisType; \ - typedef R (CallingConvention C::*F) (DECL_ARGS(n)) ConstConvention; \ - \ - R CallingConvention hook(DECL_PARAMS_LIST(n)) \ - { \ - C *This = reinterpret_cast(this); \ - return GlobalMockObject::instance.invoke(apiAddress) \ - (empty_caller, This DECL_REST_PARAMS(n)); \ - } \ - \ - static bool appliedBy(F api) \ - { return apiAddress == Details::methodToAddr(api); } \ - \ - static void* getHook() \ - { return Details::methodToAddr(&ThisType::hook); } \ - \ - static void freeHook() \ - { if(--refCount == 0) apiAddress = 0; } \ -public: \ - \ - static void* getApiHook(F api) \ - { \ - if(!appliedBy(api)) return 0; \ - ++refCount; \ - return getHook(); \ - } \ - \ - static void* applyApiHook(F api) \ - { \ - if(apiAddress != 0) return 0; \ - apiAddress = Details::methodToAddr(api); \ - refCount = 1; \ - return getHook(); \ - } \ - \ - static bool freeApiHook(void* hook) \ - { \ - if(getHook() != hook) return false; \ - freeHook(); \ - return true; \ - } \ -private: \ - static void* apiAddress; \ - static unsigned int refCount; \ -}; \ -template \ -void* ApiHookFunctor::apiAddress = 0; \ -template \ -unsigned int ApiHookFunctor::refCount = 0 - -#ifdef WIN32 -#if defined(_MSC_VER) && defined(BUILD_FOR_X86) -#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ -__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ -__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, __stdcall); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, __stdcall, ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, __stdcall, const) -#else -#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ -__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const) -#endif -#else -#define MOCKCPP_API_HOOK_FUNCTOR_DEF(n) \ -__MOCKCPP_C_API_HOOK_FUNCTOR_DEF(n, ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , ); \ -__MOCKCPP_CXX_API_HOOK_FUNCTOR_DEF(n, , const) -#endif - -MOCKCPP_API_HOOK_FUNCTOR_DEF(0); -MOCKCPP_API_HOOK_FUNCTOR_DEF(1); -MOCKCPP_API_HOOK_FUNCTOR_DEF(2); -MOCKCPP_API_HOOK_FUNCTOR_DEF(3); -MOCKCPP_API_HOOK_FUNCTOR_DEF(4); -MOCKCPP_API_HOOK_FUNCTOR_DEF(5); -MOCKCPP_API_HOOK_FUNCTOR_DEF(6); -MOCKCPP_API_HOOK_FUNCTOR_DEF(7); -MOCKCPP_API_HOOK_FUNCTOR_DEF(8); -MOCKCPP_API_HOOK_FUNCTOR_DEF(9); -MOCKCPP_API_HOOK_FUNCTOR_DEF(10); -MOCKCPP_API_HOOK_FUNCTOR_DEF(11); -MOCKCPP_API_HOOK_FUNCTOR_DEF(12); - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHookGenerator.h b/cli/test/include/mockcpp/ApiHookGenerator.h deleted file mode 100644 index 8945813..0000000 --- a/cli/test/include/mockcpp/ApiHookGenerator.h +++ /dev/null @@ -1,75 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_GENERATOR_H__ -#define __MOCKCPP_API_HOOK_GENERATOR_H__ - -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////////////////////////// -template -struct ApiHookGenerator -{ - static void* findApiHook(F api) - { - void* hook; - - (hook = ApiHookFunctor::getApiHook(api)) || - (hook = ApiHookGenerator::findApiHook(api)); - - return hook; - } - - static void* appyApiHook(F api) - { - void* hook; - - (hook = ApiHookFunctor::applyApiHook(api)) || - (hook = ApiHookGenerator::appyApiHook(api)); - - return hook; - } - - static bool freeApiHook(void* hook) - { - return - (ApiHookFunctor::freeApiHook(hook)) || - (ApiHookGenerator::freeApiHook(hook)); - } - -private: - -}; - -///////////////////////////////////////////////////////////////// -template -struct ApiHookGenerator -{ - static void* findApiHook(F api) - { return 0; } - - static void* appyApiHook(F api) - { - oss_t oss; - - oss << "Did you define too many mockers in a testcase? " - << "Probably you should refine your design, " - << "or you can reconfig ParameterizedApiHookHolder::maxSeq bigger, " - << "it's the number of mockers in a testcase that with the same function prototype, " - << "the bigger it is, the slower compiling is."; - - MOCKCPP_REPORT_FAILURE(oss.str()); - - return 0; - } - - static bool freeApiHook(void* hook) - { return true; } -}; - -///////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHookHolder.h b/cli/test/include/mockcpp/ApiHookHolder.h deleted file mode 100644 index ec1b866..0000000 --- a/cli/test/include/mockcpp/ApiHookHolder.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_HOLDER_H__ -#define __MOCKCPP_API_HOOK_HOLDER_H__ - -#include - -MOCKCPP_NS_START - -struct ApiHookHolder -{ - virtual void * getApiHook() const = 0; - - virtual ~ApiHookHolder() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHookHolderFactory.h b/cli/test/include/mockcpp/ApiHookHolderFactory.h deleted file mode 100644 index 2ab9bf0..0000000 --- a/cli/test/include/mockcpp/ApiHookHolderFactory.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_HOLDER_FACTORY_H__ -#define __MOCKCPP_API_HOOK_HOLDER_FACTORY_H__ - -#include - -MOCKCPP_NS_START - -struct ApiHookHolder; - -struct ApiHookHolderFactory -{ - template - static ApiHookHolder* create(F api) - { - return new ParameterizedApiHookHolder(api); - } -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHookKey.h b/cli/test/include/mockcpp/ApiHookKey.h deleted file mode 100644 index 4fa6b5b..0000000 --- a/cli/test/include/mockcpp/ApiHookKey.h +++ /dev/null @@ -1,50 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_API_HOOK_KEY_H__ -#define __MOCKCPP_API_HOOK_KEY_H__ - -#include - -#include - -MOCKCPP_NS_START - -struct ApiHook; -struct ApiHookHolder; - -struct ApiHookKey - : public ChainableMockMethodKey -{ - explicit ApiHookKey(const void* api); - ApiHookKey(const void* api, ApiHookHolder* hookHolder); - - ~ApiHookKey(); - - bool equals(const ChainableMockMethodKey * const rhs) const; - -private: - ApiHook* hook; - ApiHookHolder* hookHolder; - const void* apiAddress; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ApiHookMocker.h b/cli/test/include/mockcpp/ApiHookMocker.h deleted file mode 100644 index 2b244ce..0000000 --- a/cli/test/include/mockcpp/ApiHookMocker.h +++ /dev/null @@ -1,125 +0,0 @@ - -#ifndef __MOCKCPP_API_HOOK_MOCKER_H__ -#define __MOCKCPP_API_HOOK_MOCKER_H__ - -#include -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -struct mockAPIauto {}; -template struct mockAPI; - -template struct mockAPI -{ - static InvocationMockBuilderGetter get( - const std::string& name, const std::string& type, API api) - { - return MOCKCPP_NS::GlobalMockObject::instance.method - ( type.empty() ? name : name + " #" + type + "#" - , Details::methodToAddr(api) - , ApiHookHolderFactory::create(api)); - } - - template - static InvocationMockBuilderGetter get_virtual( - const std::string& name, const std::string& type, const C *c, API api) - { - void ***vtbl = (void ***)c; - std::pair indices = - getIndicesOfMethod(api); - union { void *_addr; API _api; }; - _addr = (*vtbl)[indices.second]; - return MOCKCPP_NS::GlobalMockObject::instance.method - ( type.empty() ? name : name + " #" + type + "#" - , _addr - , ApiHookHolderFactory::create(_api)); - } - - template - static InvocationMockBuilderGetter get_virtual( - const std::string& name, const std::string& type, const C &c, API api) - { - return get_virtual(name, type, &c, api); - } -}; // struct mockAPI - -template<> struct mockAPI -{ -#define __MOCKCPP_C_API_GET_FUNCTION_DEF(n, CallingConvention) \ - template \ - static InvocationMockBuilderGetter get( \ - const std::string& name, const std::string& type, R (CallingConvention *api)(DECL_ARGS(n))) \ - { \ - typedef R (CallingConvention *API)(DECL_ARGS(n)); \ - return mockAPI::get(name, type, api); \ - } - -#define __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, CallingConvention, ConstMethod) \ - template \ - static InvocationMockBuilderGetter get( \ - const std::string& name, const std::string& type, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ - { \ - typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ - return mockAPI::get(name, type, api); \ - } \ - template \ - static InvocationMockBuilderGetter get_virtual( \ - const std::string& name, const std::string& type, const C *c, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ - { \ - typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ - return mockAPI::get_virtual(name, type, c, api); \ - } \ - template \ - static InvocationMockBuilderGetter get_virtual( \ - const std::string& name, const std::string& type, const C &c, R (CallingConvention C::*api)(DECL_ARGS(n)) ConstMethod) \ - { \ - typedef R (CallingConvention C::*API)(DECL_ARGS(n)) ConstMethod; \ - return mockAPI::get_virtual(name, type, c, api); \ - } - -#ifdef WIN32 -#if defined(_MSC_VER) && defined(BUILD_FOR_X86) -#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ - __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ - __MOCKCPP_C_API_GET_FUNCTION_DEF(n, __stdcall); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, __stdcall, ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, __stdcall, const) -#else -#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ - __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const) -#endif -#else -#define MOCKCPP_API_GET_FUNCTION_DEF(n) \ - __MOCKCPP_C_API_GET_FUNCTION_DEF(n, ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , ); \ - __MOCKCPP_CXX_API_GET_FUNCTION_DEF(n, , const) -#endif - - MOCKCPP_API_GET_FUNCTION_DEF(0); - MOCKCPP_API_GET_FUNCTION_DEF(1); - MOCKCPP_API_GET_FUNCTION_DEF(2); - MOCKCPP_API_GET_FUNCTION_DEF(3); - MOCKCPP_API_GET_FUNCTION_DEF(4); - MOCKCPP_API_GET_FUNCTION_DEF(5); - MOCKCPP_API_GET_FUNCTION_DEF(6); - MOCKCPP_API_GET_FUNCTION_DEF(7); - MOCKCPP_API_GET_FUNCTION_DEF(8); - MOCKCPP_API_GET_FUNCTION_DEF(9); - MOCKCPP_API_GET_FUNCTION_DEF(10); - MOCKCPP_API_GET_FUNCTION_DEF(11); - MOCKCPP_API_GET_FUNCTION_DEF(12); -}; // struct mockAPI - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ArgumentsList.h b/cli/test/include/mockcpp/ArgumentsList.h deleted file mode 100644 index 36a3ec6..0000000 --- a/cli/test/include/mockcpp/ArgumentsList.h +++ /dev/null @@ -1,43 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ARGUMENTS_LIST_H_ -#define __MOCKCPP_ARGUMENTS_LIST_H_ - -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////////// -struct UselessType {}; - -//////////////////////////////////////////////////// -template - > -struct ArgumentsList {}; - - -template - > -struct ArgumentsListConst {}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/ArgumentsListDef.h b/cli/test/include/mockcpp/ArgumentsListDef.h deleted file mode 100644 index 46ac85c..0000000 --- a/cli/test/include/mockcpp/ArgumentsListDef.h +++ /dev/null @@ -1,13 +0,0 @@ -, typename P0 = UselessType -, typename P1 = UselessType -, typename P2 = UselessType -, typename P3 = UselessType -, typename P4 = UselessType -, typename P5 = UselessType -, typename P6 = UselessType -, typename P7 = UselessType -, typename P8 = UselessType -, typename P9 = UselessType -, typename P10 = UselessType -, typename P11 = UselessType -, typename P12 = UselessType diff --git a/cli/test/include/mockcpp/ArgumentsListDef.h.rule b/cli/test/include/mockcpp/ArgumentsListDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/ArgumentsListDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/ArgumentsMacroHelpers.h b/cli/test/include/mockcpp/ArgumentsMacroHelpers.h deleted file mode 100644 index fb58532..0000000 --- a/cli/test/include/mockcpp/ArgumentsMacroHelpers.h +++ /dev/null @@ -1,67 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ARGUMENTS_MACRO_HELPERS_H -#define __MOCKCPP_ARGUMENTS_MACRO_HELPERS_H - -#include - -#define __ARG(n) MOCKP ## n -#define END_ARGS(n) __ARG(n) -#define ARGS(n) __ARG(n) , -#define REST_ARGS(n) , __ARG(n) - -#define __PARAM(n) p ## n -#define END_PARAMS(n) __PARAM(n) -#define PARAMS(n) __PARAM(n) , -#define REST_PARAMS(n) , __PARAM(n) - -#define TEMPLATE_ARG(n) typename __ARG(n) -#define TEMPLATE_ARGS(n) , TEMPLATE_ARG(n) -#define VOID_TEMPLATE_ARGS(n) typename __ARG(n), - -#define __ARG_DECL(n) __ARG(n) __PARAM(n) -#define ARG_DECL(n) __ARG_DECL(n) , -#define END_ARG_DECL(n) __ARG_DECL(n) -#define REST_ARG_DECL(n) , __ARG_DECL(n) - -#define DECL_TEMPLATE_ARGS(n) SIMPLE_REPEAT(n, TEMPLATE_ARGS) -#define DECL_VARDIC_ARGS(n) SIMPLE_REPEAT(n, ARGS) -#define DECL_VARDIC_PARAM_LIST(n) SIMPLE_REPEAT(n, ARG_DECL) -#define DECL_VOID_TEMPLATE_ARGS(n) REPEAT(n, VOID_TEMPLATE_ARGS, TEMPLATE_ARG) -#define DECL_ARGS(n) REPEAT(n, ARGS, END_ARGS) -#define DECL_PARAMS(n) REPEAT(n, PARAMS, END_PARAMS) -#define DECL_PARAMS_LIST(n) REPEAT(n, ARG_DECL, END_ARG_DECL) - -#define DECL_REST_ARGS(n) SIMPLE_REPEAT(n, REST_ARGS) -#define DECL_REST_PARAMS(n) SIMPLE_REPEAT(n, REST_PARAMS) -#define DECL_REST_ARG_DECL(n) SIMPLE_REPEAT(n, REST_ARG_DECL) - -#define MOCKER_PP_CAT(a, b) MOCKER_PP_CAT_I(a, b) -#define MOCKER_PP_CAT_I(a, b) MOCKER_PP_CAT_II(~, a ## b) -#define MOCKER_PP_CAT_II(p, res) res - -#define MOCKER_PP_VARIADIC_SIZE(...) MOCKER_PP_VARIADIC_SIZE_I(__VA_ARGS__) -#define MOCKER_PP_VARIADIC_SIZE_I(...) MOCKER_PP_VARIADIC_SIZE_II(MOCKER_PP_VARIADIC_SIZE_S(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,)) -#define MOCKER_PP_VARIADIC_SIZE_II(res) res -#define MOCKER_PP_VARIADIC_SIZE_S(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, size, ...) size - -#define MOCKER_PP_OVERLOAD(prefix, ...) MOCKER_PP_CAT(prefix, MOCKER_PP_VARIADIC_SIZE(__VA_ARGS__)) - -#endif - diff --git a/cli/test/include/mockcpp/ArgumentsMatchBuilder.h b/cli/test/include/mockcpp/ArgumentsMatchBuilder.h deleted file mode 100644 index f9ca673..0000000 --- a/cli/test/include/mockcpp/ArgumentsMatchBuilder.h +++ /dev/null @@ -1,77 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ARGUMENTS_MATCH_BUILDER_H -#define __MOCKCPP_ARGUMENTS_MATCH_BUILDER_H - -#include -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Constraint; - -template -struct ArgumentsMatchBuilder : public Builder -{ - - Builder& with( const Any& c01 = any() - , const Any& c02 = any() - , const Any& c03 = any() - , const Any& c04 = any() - , const Any& c05 = any() - , const Any& c06 = any() - , const Any& c07 = any() - , const Any& c08 = any() - , const Any& c09 = any() - , const Any& c10 = any() - , const Any& c11 = any() - , const Any& c12 = any() - ); -#if 0 - Builder& with( Constraint* c01 = any() - , Constraint* c02 = any() - , Constraint* c03 = any() - , Constraint* c04 = any() - , Constraint* c05 = any() - , Constraint* c06 = any() - , Constraint* c07 = any() - , Constraint* c08 = any() - , Constraint* c09 = any() - , Constraint* c10 = any() - , Constraint* c11 = any() - , Constraint* c12 = any() - ); -#endif - - virtual ~ArgumentsMatchBuilder() {} - -private: - - virtual InvocationMocker* getMocker() const = 0; - -}; - -MOCKCPP_NS_END - -#include - -#endif - diff --git a/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc b/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc deleted file mode 100644 index 8f5135c..0000000 --- a/cli/test/include/mockcpp/ArgumentsMatchBuilder.tcc +++ /dev/null @@ -1,87 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include -#include -#include - -MOCKCPP_NS_START - -template -Builder& -ArgumentsMatchBuilder:: -with( const Any& c01 - , const Any& c02 - , const Any& c03 - , const Any& c04 - , const Any& c05 - , const Any& c06 - , const Any& c07 - , const Any& c08 - , const Any& c09 - , const Any& c10 - , const Any& c11 - , const Any& c12 -) -{ - getMocker()->addMatcher( - new ConstraintSet( c01.getConstraint() - , c02.getConstraint() - , c03.getConstraint() - , c04.getConstraint() - , c05.getConstraint() - , c06.getConstraint() - , c07.getConstraint() - , c08.getConstraint() - , c09.getConstraint() - , c10.getConstraint() - , c11.getConstraint() - , c12.getConstraint())); - return *this; -} - -#if 0 -template -Builder& -ArgumentsMatchBuilder:: -with( Constraint* c01 - , Constraint* c02 - , Constraint* c03 - , Constraint* c04 - , Constraint* c05 - , Constraint* c06 - , Constraint* c07 - , Constraint* c08 - , Constraint* c09 - , Constraint* c10 - , Constraint* c11 - , Constraint* c12 -) -{ - getMocker()->addMatcher( - new ConstraintSet(c01, c02, c03, c04, c05, c06, - c07, c08, c09, c10, c11, c12)); - return *this; -} - -#endif - -MOCKCPP_NS_END - - diff --git a/cli/test/include/mockcpp/Asserter.h b/cli/test/include/mockcpp/Asserter.h deleted file mode 100644 index 7243687..0000000 --- a/cli/test/include/mockcpp/Asserter.h +++ /dev/null @@ -1,61 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ASSERTER_H -#define __MOCKCPP_ASSERTER_H - -#include - -#include - -MOCKCPP_NS_START - -void assertTrue( unsigned srcline, const char* srcfile - , const std::string &message, bool condition); - -void assertTrue( unsigned srcline, const char* srcfile - , bool condition); - -void assertFalse(unsigned srcline, const char* srcfile - , const std::string &message , bool condition); - -void assertFalse(unsigned srcline, const char* srcfile - , bool condition); - -void fail(unsigned srcline, const char* srcfile, - const std::string &message); - -void fail(unsigned srcline, const char* srcfile); - -void assertEquals(unsigned srcline, const char* srcfile, - const std::string& message, - const char *expected, const char *actual); - -void assertEquals(unsigned srcline, const char* srcfile, - const char *expected, const char *actual); - -#define MOCKCPP_ASSERT_EQUALS_MESSAGE(msg, a, b) MOCKCPP_NS::assertEquals(__LINE__, __FILE__, msg, a, b) -#define MOCKCPP_ASSERT_EQUALS(a, b) MOCKCPP_NS::assertEquals(__LINE__, __FILE__, "invalid: " #a " == " #b, a, b) -#define MOCKCPP_ASSERT_TRUE_MESSAGE(msg, cond) MOCKCPP_NS::assertTrue(__LINE__, __FILE__, msg, cond) -#define MOCKCPP_ASSERT_FALSE_MESSAGE(msg, cond) MOCKCPP_NS::assertFalse(__LINE__, __FILE__, msg, cond) -#define MOCKCPP_FAIL(msg) MOCKCPP_NS::fail(__LINE__, __FILE__, msg) - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/AssertionFailedError.h b/cli/test/include/mockcpp/AssertionFailedError.h deleted file mode 100644 index 80b693d..0000000 --- a/cli/test/include/mockcpp/AssertionFailedError.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ASSERTION_FAILED_ERROR_H -#define __MOCKCPP_ASSERTION_FAILED_ERROR_H - -#include - -#include - -MOCKCPP_NS_START - -struct AssertionFailedError : public Exception -{ - AssertionFailedError (unsigned srcline, const char* srcfile, - const std::string& message); - - virtual ~AssertionFailedError() throw(); -}; - -void -assertionFailed - ( unsigned int line - , const char* file - , const std::string& message); - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/BeforeMatchBuilder.h b/cli/test/include/mockcpp/BeforeMatchBuilder.h deleted file mode 100644 index 919f6f0..0000000 --- a/cli/test/include/mockcpp/BeforeMatchBuilder.h +++ /dev/null @@ -1,59 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_BEFORE_MATCH_BUILDER_H -#define __MOCKCPP_BEFORE_MATCH_BUILDER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMockerNamespace; -struct InvocationMocker; - -template -struct BeforeMatchBuilder : public Builder -{ - BeforeMatchBuilder& - before(const InvocationMockerNamespace& ns, const std::string& name); - - BeforeMatchBuilder& - before(InvocationMockerNamespace* ns, const std::string& name); - - BeforeMatchBuilder& - before(const std::string& name); - - virtual ~BeforeMatchBuilder() {} - -private: - - void - setupOrderingBeforeMatchers(InvocationMocker* mocker); - -private: - - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#include - -#endif - diff --git a/cli/test/include/mockcpp/BeforeMatchBuilder.tcc b/cli/test/include/mockcpp/BeforeMatchBuilder.tcc deleted file mode 100644 index 71ec9dd..0000000 --- a/cli/test/include/mockcpp/BeforeMatchBuilder.tcc +++ /dev/null @@ -1,59 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -////////////////////////////////////////////////////////////////////// -template -BeforeMatchBuilder& -BeforeMatchBuilder::before(const InvocationMockerNamespace& ns, const std::string& name) -{ - return before(&const_cast(ns), name); -} - -////////////////////////////////////////////////////////////////////// -template -BeforeMatchBuilder& -BeforeMatchBuilder::before(InvocationMockerNamespace* ns, const std::string& id) -{ - getMocker()->addMatcher( - new PendingMatcher( - new BeforeMatcher(), ns , id , getMocker())); - - return *this; -} - -////////////////////////////////////////////////////////////////////// -template -BeforeMatchBuilder& -BeforeMatchBuilder::before(const std::string& name) -{ - return before(getMocker()->getMethod()->getNamespace(), name); -} - -////////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - - diff --git a/cli/test/include/mockcpp/BeforeMatcher.h b/cli/test/include/mockcpp/BeforeMatcher.h deleted file mode 100644 index caf292c..0000000 --- a/cli/test/include/mockcpp/BeforeMatcher.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_BEFORE_MATCHER_H -#define __MOCKCPP_BEFORE_MATCHER_H - -#include -#include - -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Invocation; - -struct BeforeMatcher : public OrderingMatcher -{ - BeforeMatcher(); - - bool matches(const Invocation& inv) const; - - void increaseInvoked(const Invocation& inv); - - std::string toString() const; - - void verify(); - - bool isCompleted(void) const; - - void setOrderingInvocationMocker(InvocationMocker* mocker); - -private: - - InvocationMocker* previousCall; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/CallerMatchBuilder.h b/cli/test/include/mockcpp/CallerMatchBuilder.h deleted file mode 100644 index fffdb6c..0000000 --- a/cli/test/include/mockcpp/CallerMatchBuilder.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CALLER_MATCH_BUILDER_H -#define __MOCKCPP_CALLER_MATCH_BUILDER_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct InvocationMocker; - -template -struct CallerMatchBuilder : public Builder -{ - Builder& caller(const std::string& nameOfCaller); - - virtual ~CallerMatchBuilder() {} - -private: - - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#include - -#endif diff --git a/cli/test/include/mockcpp/CallerMatchBuilder.tcc b/cli/test/include/mockcpp/CallerMatchBuilder.tcc deleted file mode 100644 index 44992df..0000000 --- a/cli/test/include/mockcpp/CallerMatchBuilder.tcc +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include - - -MOCKCPP_NS_START - - -////////////////////////////////////////////////////////////////////// -template -Builder& -CallerMatchBuilder::caller(const std::string& nameOfCaller) -{ - getMocker()->addMatcher(new CallerMatcher(nameOfCaller)); - return *this; -} - -////////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END diff --git a/cli/test/include/mockcpp/CallerMatcher.h b/cli/test/include/mockcpp/CallerMatcher.h deleted file mode 100644 index f90cf21..0000000 --- a/cli/test/include/mockcpp/CallerMatcher.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CALLER_MATCHER_H -#define __MOCKCPP_CALLER_MATCHER_H - -#include -#include -#include - -MOCKCPP_NS_START - -struct Invocation; - -struct CallerMatcher : public Matcher -{ - CallerMatcher(const std::string& name); - - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - void verify() ; - std::string toString() const ; - -private: - std::string nameOfCaller; -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/ChainableMockMethod.h b/cli/test/include/mockcpp/ChainableMockMethod.h deleted file mode 100644 index 61ef647..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethod.h +++ /dev/null @@ -1,133 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_H - -#include -#include -#include -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -struct SelfDescribe; - -template -struct ChainableMockMethodBase -{ - ChainableMockMethodBase(Invokable* invokable_) - : invokable(invokable_) - {} - - RT operator()(const std::string& nameOfCaller - , const RefAny& pThisPointer = RefAny() - , const RefAny& p01 = RefAny() - , const RefAny& p02 = RefAny() - , const RefAny& p03 = RefAny() - , const RefAny& p04 = RefAny() - , const RefAny& p05 = RefAny() - , const RefAny& p06 = RefAny() - , const RefAny& p07 = RefAny() - , const RefAny& p08 = RefAny() - , const RefAny& p09 = RefAny() - , const RefAny& p10 = RefAny() - , const RefAny& p11 = RefAny() - , const RefAny& p12 = RefAny() - ) - { - SelfDescribe* resultProvider = 0; - - try { - const Any& result = \ - invokable->invoke(nameOfCaller, pThisPointer - , p01, p02, p03, p04, p05, p06 - , p07, p08, p09, p10, p11, p12 - , resultProvider); - return getResult(result, resultProvider); - } catch (std::exception& ex) - { - MOCKCPP_REPORT_FAILURE(ex.what()); - } - const Any& dummyResult = Any(); - return getResult(dummyResult, resultProvider); - } - - virtual ~ChainableMockMethodBase() {} - -protected: - - virtual RT getResult(const Any& result, SelfDescribe*) = 0; - -private: - - Invokable* invokable; -}; - - -////////////////////////////////////////////////////////////////// -template -struct ChainableMockMethod : public ChainableMockMethodBase -{ - RT getResult(const Any& anyResult, SelfDescribe* resultProvider) - { - const Any& result = \ - Result(any_castable(anyResult) - , typeid(RT) - , TypeString::value() - , resultProvider).getResult(anyResult); - - MOCKCPP_ASSERT_FALSE_MESSAGE( - "The return value for a non-void method was not specified", - result.empty()); - - return any_cast(result); - } - -public: - - ChainableMockMethod(Invokable* invokable) - : ChainableMockMethodBase(invokable) - {} -}; - -////////////////////////////////////////////////////////////////// -template <> -struct ChainableMockMethod : public ChainableMockMethodBase -{ - void getResult(const Any& result, SelfDescribe*) - { - } - -public: - - ChainableMockMethod(Invokable* invokable) - : ChainableMockMethodBase(invokable) - {} -}; - -////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockMethodContainer.h b/cli/test/include/mockcpp/ChainableMockMethodContainer.h deleted file mode 100644 index d9577e1..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethodContainer.h +++ /dev/null @@ -1,54 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_CONTAINER_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_CONTAINER_H - -#include - -#include - -MOCKCPP_NS_START - -struct ChainableMockMethodContainerImpl; -struct ChainableMockMethodKey; -struct ChainableMockMethodCore; -struct InvocationMocker; - -/////////////////////////////////////////////////////////////// -struct ChainableMockMethodContainer -{ - ChainableMockMethodContainer(); - ~ChainableMockMethodContainer(); - - ChainableMockMethodCore* getMethod(ChainableMockMethodKey* key) const; - void addMethod(ChainableMockMethodKey* key, ChainableMockMethodCore* method); - - InvocationMocker* findInvocationMocker(const std::string& id) const; - - void reset(); - void reset(ChainableMockMethodKey* key); - void verify(); - -private: - ChainableMockMethodContainerImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockMethodCore.h b/cli/test/include/mockcpp/ChainableMockMethodCore.h deleted file mode 100644 index d041a44..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethodCore.h +++ /dev/null @@ -1,89 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_CORE_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_CORE_H - -#include - -#include -#include - -#include - -MOCKCPP_NS_START - -struct Stub; -struct ChainableMockMethodCoreImpl; -struct SelfDescribe; -struct InvokedRecorder; -struct InvocationMockerNamespace; - -struct ChainableMockMethodCore - : public Method, - public InvocationMockerContainer -{ -public: - - ChainableMockMethodCore(const std::string& name, - InvocationMockerNamespace* ns); - ~ChainableMockMethodCore(); - - // Method - const Any& - invoke( const std::string& nameOfCaller - , const RefAny& pThisPointer - , const RefAny& p1 - , const RefAny& p2 - , const RefAny& p3 - , const RefAny& p4 - , const RefAny& p5 - , const RefAny& p6 - , const RefAny& p7 - , const RefAny& p8 - , const RefAny& p9 - , const RefAny& p10 - , const RefAny& p11 - , const RefAny& p12 - , SelfDescribe* &resultProvider); - - std::string& getName(void) const; - - InvocationMockerNamespace* getNamespace() const; - -public: - - // InvocationMockContainer - InvocationMocker* getInvocationMocker(const std::string& id); - void addInvocationMocker(InvocationMocker* mocker); - void addDefaultInvocationMocker(InvocationMocker* mocker); - -public: - // Others - void reset(); - void verify(); - -private: - - ChainableMockMethodCoreImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h b/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h deleted file mode 100644 index 5a6c3e1..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethodIndexKey.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_INDEX_KEY_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_INDEX_KEY_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct ChainableMockMethodIndexKey - : public ChainableMockMethodKey -{ - ChainableMockMethodIndexKey(unsigned int vptrIndex, unsigned int vtblIndex); - - bool equals(const ChainableMockMethodKey * const rhs) const; - - unsigned int getIndex() const; - -private: - unsigned int index; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockMethodKey.h b/cli/test/include/mockcpp/ChainableMockMethodKey.h deleted file mode 100644 index 0162ac7..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethodKey.h +++ /dev/null @@ -1,36 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_KEY_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_KEY_H - -#include - -MOCKCPP_NS_START - -struct ChainableMockMethodKey -{ - virtual bool equals(const ChainableMockMethodKey * const rhs) const = 0; - - virtual ~ChainableMockMethodKey() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockMethodNameKey.h b/cli/test/include/mockcpp/ChainableMockMethodNameKey.h deleted file mode 100644 index 173a8f7..0000000 --- a/cli/test/include/mockcpp/ChainableMockMethodNameKey.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_METHOD_NAME_KEY_H -#define __MOCKCPP_CHAINABLE_MOCK_METHOD_NAME_KEY_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct ChainableMockMethodNameKey - : public ChainableMockMethodKey -{ - ChainableMockMethodNameKey(const std::string& name); - - bool equals(const ChainableMockMethodKey * const rhs) const; - - std::string& getMethodName() const; - -private: - std::string methodName; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockObject.h b/cli/test/include/mockcpp/ChainableMockObject.h deleted file mode 100644 index a3ed846..0000000 --- a/cli/test/include/mockcpp/ChainableMockObject.h +++ /dev/null @@ -1,69 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_OBJECT_H_ -#define __MOCKCPP_CHAINABLE_MOCK_OBJECT_H_ - -#include - -#include -#include -#include - -#include - -MOCKCPP_NS_START - -struct ChainableMockObjectImpl; -struct Invokable; - -struct ChainableMockObject - : public ChainableMockObjectBase -{ -public: - - ChainableMockObject(const std::string& name); - - ~ChainableMockObject(); - - // Building-invocation-mocker interface -- Used in test case - InvocationMockBuilderGetter method(const std::string& name); - - // Invoking interface -- Used in Functor - template - ChainableMockMethod invoke(const std::string& name) - { - return ChainableMockMethod(getInvokable(name)); - } - - void reset(); - -private: - - // It's only for template-method invoke. we have to make it visible. - Invokable* getInvokable(const std::string& name); - -private: - - ChainableMockObjectImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainableMockObjectBase.h b/cli/test/include/mockcpp/ChainableMockObjectBase.h deleted file mode 100644 index ad9197d..0000000 --- a/cli/test/include/mockcpp/ChainableMockObjectBase.h +++ /dev/null @@ -1,75 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINABLE_MOCK_OBJECT_BASE_H -#define __MOCKCPP_CHAINABLE_MOCK_OBJECT_BASE_H - -#include - -#include -#include - -#include - -MOCKCPP_NS_START - -struct ChainableMockObjectBaseImpl; -struct InvocationMocker; - - -struct ChainableMockObjectBase - : public InvocationMockerNamespace -{ -public: - - ~ChainableMockObjectBase(); - - const std::string& getName(void) const; - - // InvocationMockerNamespace -- id("id"); - InvocationMocker* getInvocationMocker(const std::string& id) const; - - virtual void verify(); - -protected: - - ChainableMockMethodContainer* getMethodContainer() const; - -protected: - - explicit ChainableMockObjectBase(const std::string& name); - - ChainableMockObjectBase(const ChainableMockObjectBase&); - -private: - - ChainableMockObjectBase& operator=(const ChainableMockObjectBase&); - -protected: - - bool shared; - -private: - - ChainableMockObjectBaseImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ChainingMockHelper.h b/cli/test/include/mockcpp/ChainingMockHelper.h deleted file mode 100644 index 5adea69..0000000 --- a/cli/test/include/mockcpp/ChainingMockHelper.h +++ /dev/null @@ -1,254 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHAINING_MOCK_HELPER_H -#define __MOCKCPP_CHAINING_MOCK_HELPER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -struct Matcher; -struct Stub; - -Matcher* once(); -Matcher* never(); -Matcher* atLeast(unsigned int times); -Matcher* atMost(unsigned int times); -Matcher* exactly(unsigned int times); - -template -Constraint* eq(const T& val) -{ - return new IsEqual(val); -} - -template -Constraint* neq(const T& val) -{ - return new IsNotEqual(val); -} - -template -Constraint* gt(const T& val) -{ - return new IsGreaterThan(val); -} - -template -Constraint* lt(const T& val) -{ - return new IsLessThan(val); -} - -//////////////////////////////////////////////////////////////// -#if 0 -static inline Constraint* eq(const char* s) -{ - return new IsEqual(s); -} -#endif - -template -Constraint* spy(T& val) -{ - return new Spy(val); -} - -template -struct PredictTypeTraits -{ -}; - -template -struct PredictTypeTraits -{ - typedef T ParaType; -}; - -template -Constraint* checkWith(Predict pred) -{ - typedef typename PredictTypeTraits::ParaType T; - return new CheckWith(pred); -} - -//////////////////////////////////////////////////////////////// -template -Constraint* checkWith(bool (*pred)(T)) -{ - return new CheckWith(pred); -} - -//////////////////////////////////////////////////////////////// -template -Constraint* processWith(Proc proc) -{ - typedef typename PredictTypeTraits::ParaType T; - return new ProcessWith(proc); -} - -//////////////////////////////////////////////////////////////// -template -Constraint* processWith(void (*proc)(T)) -{ - return new ProcessWith(proc); -} - -//////////////////////////////////////////////////////////////// -template -Constraint* outBound(const T& val, Constraint* constraint = 0) -{ - return new OutBound(val, constraint); -} - -//////////////////////////////////////////////////////////////// -// outBoundP -//////////////////////////////////////////////////////////////// -template -Constraint* outBoundP(T* p, size_t size, Constraint* constraint = 0) -{ - return new OutBoundPointer(p, size, constraint); -} - -//////////////////////////////////////////////////////////////// -Constraint* outBoundP(void* p, size_t size, Constraint* constraint = 0); - -//////////////////////////////////////////////////////////////// -template -Constraint* outBoundP(T* p, Constraint* constraint = 0) -{ - return new OutBoundPointer(p, sizeof(T), constraint); -} - -/////////////////////////////////////////////////////////////////// -// mirror -/////////////////////////////////////////////////////////////////// -#if defined(__GNUC__) && (__GNUC__ > 3) -template -Constraint* mirror(const T& obj) -{ - return new IsMirror(obj); -} -#endif - -/////////////////////////////////////////////////////////////////// -template -Constraint* mirror(T* p, size_t size = 0) -{ - return new IsMirror(p, size); -} - -/////////////////////////////////////////////////////////////////// -Constraint* mirror(void* p, size_t size); - -#if 0 -Constraint* startWith(char*); -Constraint* startWith(const char*); -Constraint* startWith(unsigned char*); -Constraint* startWith(unsigned const char*); -#endif -Constraint* startWith(const std::string&); - -#if 0 -Constraint* endWith(char*); -Constraint* endWith(const char*); -Constraint* endWith(unsigned char*); -Constraint* endWith(unsigned const char*); -#endif - -Constraint* endWith(const std::string&); - -#if 0 -Constraint* contains(char*); -Constraint* contains(const char*); -Constraint* contains(unsigned char*); -Constraint* contains(unsigned const char*); -#endif - -Constraint* contains(const std::string&); -/////////////////////////////////////////////////////////////////// -// smirror -/////////////////////////////////////////////////////////////////// -Constraint* smirror(char* s); -Constraint* smirror(const char* s); -Constraint* smirror(unsigned char* s); -Constraint* smirror(const unsigned char* s); -/////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////// -Stub* die(int code = 0); - -Stub* returnValue(const Any& val); - -Stub* repeat(const Any& val, unsigned int repeatTimes); - -Stub* ignoreReturnValue(); - -Stub* returnObjectList( const Any& o01 - , const Any& o02 = Any() - , const Any& o03 = Any() - , const Any& o04 = Any() - , const Any& o05 = Any() - , const Any& o06 = Any() - , const Any& o07 = Any() - , const Any& o08 = Any() - , const Any& o09 = Any() - , const Any& o10 = Any() - , const Any& o11 = Any() - , const Any& o12 = Any()); - - -template -Stub* increase(const T& from, const T& to) -{ - return new TypelessStubAdapter(new IncrementStub(from, to)); -} - -template -Stub* increase(const T& from) -{ - return new TypelessStubAdapter(new IncrementStub(from)); -} - -template -Stub* throws(const T& ex) -{ - return new TypelessStubAdapter(new ThrowExceptionStub(ex)); -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/CheckWith.h b/cli/test/include/mockcpp/CheckWith.h deleted file mode 100644 index 101b14f..0000000 --- a/cli/test/include/mockcpp/CheckWith.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CHECK_WITH_H -#define __MOCKCPP_CHECK_WITH_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct CheckWith : public Constraint -{ - CheckWith(Predict pred) - : predict(pred) - {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - - return predict(any_cast(val)); - } - - std::string toString() const - { - return std::string("check(") + - MOCKCPP_NS::toTypeAndValueString(predict) + - std::string(")"); - } - -private: - - mutable Predict predict; -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/CodeModifier.h b/cli/test/include/mockcpp/CodeModifier.h deleted file mode 100644 index 212350b..0000000 --- a/cli/test/include/mockcpp/CodeModifier.h +++ /dev/null @@ -1,35 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2010> - - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CODEMODIFIER_H__ -#define __MOCKCPP_CODEMODIFIER_H__ - -#include - -MOCKCPP_NS_START - -struct CodeModifier -{ - // @TODO: 在modify里面加入Cache刷新 - static bool modify(void *dest, const void *src, size_t size); -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/Constraint.h b/cli/test/include/mockcpp/Constraint.h deleted file mode 100644 index 6e33961..0000000 --- a/cli/test/include/mockcpp/Constraint.h +++ /dev/null @@ -1,40 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CONSTRAINT_H -#define __MOCKCPP_CONSTRAINT_H - -#include -#include - -MOCKCPP_NS_START - -struct RefAny; - -struct Constraint -{ - virtual ~Constraint() {} - - virtual bool eval(const RefAny& inv) const = 0; - virtual std::string toString() const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ConstraintSet.h b/cli/test/include/mockcpp/ConstraintSet.h deleted file mode 100644 index 4f65813..0000000 --- a/cli/test/include/mockcpp/ConstraintSet.h +++ /dev/null @@ -1,64 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_CONSTRAINT_SET_H -#define __MOCKCPP_CONSTRAINT_SET_H - -#include -#include -#include - -MOCKCPP_NS_START - -struct Invocation; -struct Constraint; -struct ConstraintSetImpl; - -struct ConstraintSet: public StatelessMatcher -{ - ConstraintSet( Constraint* p01 = any() - , Constraint* p02 = any() - , Constraint* p03 = any() - , Constraint* p04 = any() - , Constraint* p05 = any() - , Constraint* p06 = any() - , Constraint* p07 = any() - , Constraint* p08 = any() - , Constraint* p09 = any() - , Constraint* p10 = any() - , Constraint* p11 = any() - , Constraint* p12 = any() - ); - - ~ConstraintSet(); - - virtual bool matches(const Invocation& inv) const; - - virtual std::string toString() const; - - virtual void verify(void); - -private: - - ConstraintSetImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DecoratedConstraint.h b/cli/test/include/mockcpp/DecoratedConstraint.h deleted file mode 100644 index aa67e18..0000000 --- a/cli/test/include/mockcpp/DecoratedConstraint.h +++ /dev/null @@ -1,57 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DECORATED_CONSTRAINT_H -#define __MOCKCPP_DECORATED_CONSTRAINT_H - -#include -#include - -MOCKCPP_NS_START - - -struct DecoratedConstraint : public Constraint -{ - DecoratedConstraint(Constraint* constraint); - - ~DecoratedConstraint(); - - bool eval(const RefAny& val) const; - std::string toString() const; - - virtual bool evalSelf(const RefAny& val) const = 0; - virtual std::string getName() const = 0; - virtual std::string getTypeAndValueString() const = 0; - -protected: - - bool hasDecoratedConstraint() const; - -private: - - std::string getDecoratedConstraintString() const; - -private: - - Constraint* decoratedConstraint; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DefaultBuilder.h b/cli/test/include/mockcpp/DefaultBuilder.h deleted file mode 100644 index e056998..0000000 --- a/cli/test/include/mockcpp/DefaultBuilder.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DEFAULT_BUIDLER_H_ -#define __MOCKCPP_DEFAULT_BUIDLER_H_ - -#include - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -typedef InvocationMockBuilder< - CallerMatchBuilder< - ArgumentsMatchBuilder< - StubBuilder< - MoreStubBuilder<> - > - > - > - > DefaultBuilder; -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DefaultMatcher.h b/cli/test/include/mockcpp/DefaultMatcher.h deleted file mode 100644 index bcd1236..0000000 --- a/cli/test/include/mockcpp/DefaultMatcher.h +++ /dev/null @@ -1,40 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DEFAULT_MATCHER_H -#define __MOCKCPP_DEFAULT_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct Invocation; - -struct DefaultMatcher : public Matcher -{ - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - void verify(); - std::string toString() const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h deleted file mode 100644 index f5bf5fd..0000000 --- a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h +++ /dev/null @@ -1,500 +0,0 @@ -MOCKCPP_SET_DEFAULT_METHOD(0, 0); -MOCKCPP_SET_DEFAULT_METHOD(0, 1); -MOCKCPP_SET_DEFAULT_METHOD(0, 2); -MOCKCPP_SET_DEFAULT_METHOD(0, 3); -MOCKCPP_SET_DEFAULT_METHOD(0, 4); -MOCKCPP_SET_DEFAULT_METHOD(0, 5); -MOCKCPP_SET_DEFAULT_METHOD(0, 6); -MOCKCPP_SET_DEFAULT_METHOD(0, 7); -MOCKCPP_SET_DEFAULT_METHOD(0, 8); -MOCKCPP_SET_DEFAULT_METHOD(0, 9); -MOCKCPP_SET_DEFAULT_METHOD(0, 10); -MOCKCPP_SET_DEFAULT_METHOD(0, 11); -MOCKCPP_SET_DEFAULT_METHOD(0, 12); -MOCKCPP_SET_DEFAULT_METHOD(0, 13); -MOCKCPP_SET_DEFAULT_METHOD(0, 14); -MOCKCPP_SET_DEFAULT_METHOD(0, 15); -MOCKCPP_SET_DEFAULT_METHOD(0, 16); -MOCKCPP_SET_DEFAULT_METHOD(0, 17); -MOCKCPP_SET_DEFAULT_METHOD(0, 18); -MOCKCPP_SET_DEFAULT_METHOD(0, 19); -MOCKCPP_SET_DEFAULT_METHOD(0, 20); -MOCKCPP_SET_DEFAULT_METHOD(0, 21); -MOCKCPP_SET_DEFAULT_METHOD(0, 22); -MOCKCPP_SET_DEFAULT_METHOD(0, 23); -MOCKCPP_SET_DEFAULT_METHOD(0, 24); -MOCKCPP_SET_DEFAULT_METHOD(0, 25); -MOCKCPP_SET_DEFAULT_METHOD(0, 26); -MOCKCPP_SET_DEFAULT_METHOD(0, 27); -MOCKCPP_SET_DEFAULT_METHOD(0, 28); -MOCKCPP_SET_DEFAULT_METHOD(0, 29); -MOCKCPP_SET_DEFAULT_METHOD(0, 30); -MOCKCPP_SET_DEFAULT_METHOD(0, 31); -MOCKCPP_SET_DEFAULT_METHOD(0, 32); -MOCKCPP_SET_DEFAULT_METHOD(0, 33); -MOCKCPP_SET_DEFAULT_METHOD(0, 34); -MOCKCPP_SET_DEFAULT_METHOD(0, 35); -MOCKCPP_SET_DEFAULT_METHOD(0, 36); -MOCKCPP_SET_DEFAULT_METHOD(0, 37); -MOCKCPP_SET_DEFAULT_METHOD(0, 38); -MOCKCPP_SET_DEFAULT_METHOD(0, 39); -MOCKCPP_SET_DEFAULT_METHOD(0, 40); -MOCKCPP_SET_DEFAULT_METHOD(0, 41); -MOCKCPP_SET_DEFAULT_METHOD(0, 42); -MOCKCPP_SET_DEFAULT_METHOD(0, 43); -MOCKCPP_SET_DEFAULT_METHOD(0, 44); -MOCKCPP_SET_DEFAULT_METHOD(0, 45); -MOCKCPP_SET_DEFAULT_METHOD(0, 46); -MOCKCPP_SET_DEFAULT_METHOD(0, 47); -MOCKCPP_SET_DEFAULT_METHOD(0, 48); -MOCKCPP_SET_DEFAULT_METHOD(0, 49); -MOCKCPP_SET_DEFAULT_METHOD(0, 50); -MOCKCPP_SET_DEFAULT_METHOD(0, 51); -MOCKCPP_SET_DEFAULT_METHOD(0, 52); -MOCKCPP_SET_DEFAULT_METHOD(0, 53); -MOCKCPP_SET_DEFAULT_METHOD(0, 54); -MOCKCPP_SET_DEFAULT_METHOD(0, 55); -MOCKCPP_SET_DEFAULT_METHOD(0, 56); -MOCKCPP_SET_DEFAULT_METHOD(0, 57); -MOCKCPP_SET_DEFAULT_METHOD(0, 58); -MOCKCPP_SET_DEFAULT_METHOD(0, 59); -MOCKCPP_SET_DEFAULT_METHOD(0, 60); -MOCKCPP_SET_DEFAULT_METHOD(0, 61); -MOCKCPP_SET_DEFAULT_METHOD(0, 62); -MOCKCPP_SET_DEFAULT_METHOD(0, 63); -MOCKCPP_SET_DEFAULT_METHOD(0, 64); -MOCKCPP_SET_DEFAULT_METHOD(0, 65); -MOCKCPP_SET_DEFAULT_METHOD(0, 66); -MOCKCPP_SET_DEFAULT_METHOD(0, 67); -MOCKCPP_SET_DEFAULT_METHOD(0, 68); -MOCKCPP_SET_DEFAULT_METHOD(0, 69); -MOCKCPP_SET_DEFAULT_METHOD(0, 70); -MOCKCPP_SET_DEFAULT_METHOD(0, 71); -MOCKCPP_SET_DEFAULT_METHOD(0, 72); -MOCKCPP_SET_DEFAULT_METHOD(0, 73); -MOCKCPP_SET_DEFAULT_METHOD(0, 74); -MOCKCPP_SET_DEFAULT_METHOD(0, 75); -MOCKCPP_SET_DEFAULT_METHOD(0, 76); -MOCKCPP_SET_DEFAULT_METHOD(0, 77); -MOCKCPP_SET_DEFAULT_METHOD(0, 78); -MOCKCPP_SET_DEFAULT_METHOD(0, 79); -MOCKCPP_SET_DEFAULT_METHOD(0, 80); -MOCKCPP_SET_DEFAULT_METHOD(0, 81); -MOCKCPP_SET_DEFAULT_METHOD(0, 82); -MOCKCPP_SET_DEFAULT_METHOD(0, 83); -MOCKCPP_SET_DEFAULT_METHOD(0, 84); -MOCKCPP_SET_DEFAULT_METHOD(0, 85); -MOCKCPP_SET_DEFAULT_METHOD(0, 86); -MOCKCPP_SET_DEFAULT_METHOD(0, 87); -MOCKCPP_SET_DEFAULT_METHOD(0, 88); -MOCKCPP_SET_DEFAULT_METHOD(0, 89); -MOCKCPP_SET_DEFAULT_METHOD(0, 90); -MOCKCPP_SET_DEFAULT_METHOD(0, 91); -MOCKCPP_SET_DEFAULT_METHOD(0, 92); -MOCKCPP_SET_DEFAULT_METHOD(0, 93); -MOCKCPP_SET_DEFAULT_METHOD(0, 94); -MOCKCPP_SET_DEFAULT_METHOD(0, 95); -MOCKCPP_SET_DEFAULT_METHOD(0, 96); -MOCKCPP_SET_DEFAULT_METHOD(0, 97); -MOCKCPP_SET_DEFAULT_METHOD(0, 98); -MOCKCPP_SET_DEFAULT_METHOD(0, 99); -MOCKCPP_SET_DEFAULT_METHOD(1, 0); -MOCKCPP_SET_DEFAULT_METHOD(1, 1); -MOCKCPP_SET_DEFAULT_METHOD(1, 2); -MOCKCPP_SET_DEFAULT_METHOD(1, 3); -MOCKCPP_SET_DEFAULT_METHOD(1, 4); -MOCKCPP_SET_DEFAULT_METHOD(1, 5); -MOCKCPP_SET_DEFAULT_METHOD(1, 6); -MOCKCPP_SET_DEFAULT_METHOD(1, 7); -MOCKCPP_SET_DEFAULT_METHOD(1, 8); -MOCKCPP_SET_DEFAULT_METHOD(1, 9); -MOCKCPP_SET_DEFAULT_METHOD(1, 10); -MOCKCPP_SET_DEFAULT_METHOD(1, 11); -MOCKCPP_SET_DEFAULT_METHOD(1, 12); -MOCKCPP_SET_DEFAULT_METHOD(1, 13); -MOCKCPP_SET_DEFAULT_METHOD(1, 14); -MOCKCPP_SET_DEFAULT_METHOD(1, 15); -MOCKCPP_SET_DEFAULT_METHOD(1, 16); -MOCKCPP_SET_DEFAULT_METHOD(1, 17); -MOCKCPP_SET_DEFAULT_METHOD(1, 18); -MOCKCPP_SET_DEFAULT_METHOD(1, 19); -MOCKCPP_SET_DEFAULT_METHOD(1, 20); -MOCKCPP_SET_DEFAULT_METHOD(1, 21); -MOCKCPP_SET_DEFAULT_METHOD(1, 22); -MOCKCPP_SET_DEFAULT_METHOD(1, 23); -MOCKCPP_SET_DEFAULT_METHOD(1, 24); -MOCKCPP_SET_DEFAULT_METHOD(1, 25); -MOCKCPP_SET_DEFAULT_METHOD(1, 26); -MOCKCPP_SET_DEFAULT_METHOD(1, 27); -MOCKCPP_SET_DEFAULT_METHOD(1, 28); -MOCKCPP_SET_DEFAULT_METHOD(1, 29); -MOCKCPP_SET_DEFAULT_METHOD(1, 30); -MOCKCPP_SET_DEFAULT_METHOD(1, 31); -MOCKCPP_SET_DEFAULT_METHOD(1, 32); -MOCKCPP_SET_DEFAULT_METHOD(1, 33); -MOCKCPP_SET_DEFAULT_METHOD(1, 34); -MOCKCPP_SET_DEFAULT_METHOD(1, 35); -MOCKCPP_SET_DEFAULT_METHOD(1, 36); -MOCKCPP_SET_DEFAULT_METHOD(1, 37); -MOCKCPP_SET_DEFAULT_METHOD(1, 38); -MOCKCPP_SET_DEFAULT_METHOD(1, 39); -MOCKCPP_SET_DEFAULT_METHOD(1, 40); -MOCKCPP_SET_DEFAULT_METHOD(1, 41); -MOCKCPP_SET_DEFAULT_METHOD(1, 42); -MOCKCPP_SET_DEFAULT_METHOD(1, 43); -MOCKCPP_SET_DEFAULT_METHOD(1, 44); -MOCKCPP_SET_DEFAULT_METHOD(1, 45); -MOCKCPP_SET_DEFAULT_METHOD(1, 46); -MOCKCPP_SET_DEFAULT_METHOD(1, 47); -MOCKCPP_SET_DEFAULT_METHOD(1, 48); -MOCKCPP_SET_DEFAULT_METHOD(1, 49); -MOCKCPP_SET_DEFAULT_METHOD(1, 50); -MOCKCPP_SET_DEFAULT_METHOD(1, 51); -MOCKCPP_SET_DEFAULT_METHOD(1, 52); -MOCKCPP_SET_DEFAULT_METHOD(1, 53); -MOCKCPP_SET_DEFAULT_METHOD(1, 54); -MOCKCPP_SET_DEFAULT_METHOD(1, 55); -MOCKCPP_SET_DEFAULT_METHOD(1, 56); -MOCKCPP_SET_DEFAULT_METHOD(1, 57); -MOCKCPP_SET_DEFAULT_METHOD(1, 58); -MOCKCPP_SET_DEFAULT_METHOD(1, 59); -MOCKCPP_SET_DEFAULT_METHOD(1, 60); -MOCKCPP_SET_DEFAULT_METHOD(1, 61); -MOCKCPP_SET_DEFAULT_METHOD(1, 62); -MOCKCPP_SET_DEFAULT_METHOD(1, 63); -MOCKCPP_SET_DEFAULT_METHOD(1, 64); -MOCKCPP_SET_DEFAULT_METHOD(1, 65); -MOCKCPP_SET_DEFAULT_METHOD(1, 66); -MOCKCPP_SET_DEFAULT_METHOD(1, 67); -MOCKCPP_SET_DEFAULT_METHOD(1, 68); -MOCKCPP_SET_DEFAULT_METHOD(1, 69); -MOCKCPP_SET_DEFAULT_METHOD(1, 70); -MOCKCPP_SET_DEFAULT_METHOD(1, 71); -MOCKCPP_SET_DEFAULT_METHOD(1, 72); -MOCKCPP_SET_DEFAULT_METHOD(1, 73); -MOCKCPP_SET_DEFAULT_METHOD(1, 74); -MOCKCPP_SET_DEFAULT_METHOD(1, 75); -MOCKCPP_SET_DEFAULT_METHOD(1, 76); -MOCKCPP_SET_DEFAULT_METHOD(1, 77); -MOCKCPP_SET_DEFAULT_METHOD(1, 78); -MOCKCPP_SET_DEFAULT_METHOD(1, 79); -MOCKCPP_SET_DEFAULT_METHOD(1, 80); -MOCKCPP_SET_DEFAULT_METHOD(1, 81); -MOCKCPP_SET_DEFAULT_METHOD(1, 82); -MOCKCPP_SET_DEFAULT_METHOD(1, 83); -MOCKCPP_SET_DEFAULT_METHOD(1, 84); -MOCKCPP_SET_DEFAULT_METHOD(1, 85); -MOCKCPP_SET_DEFAULT_METHOD(1, 86); -MOCKCPP_SET_DEFAULT_METHOD(1, 87); -MOCKCPP_SET_DEFAULT_METHOD(1, 88); -MOCKCPP_SET_DEFAULT_METHOD(1, 89); -MOCKCPP_SET_DEFAULT_METHOD(1, 90); -MOCKCPP_SET_DEFAULT_METHOD(1, 91); -MOCKCPP_SET_DEFAULT_METHOD(1, 92); -MOCKCPP_SET_DEFAULT_METHOD(1, 93); -MOCKCPP_SET_DEFAULT_METHOD(1, 94); -MOCKCPP_SET_DEFAULT_METHOD(1, 95); -MOCKCPP_SET_DEFAULT_METHOD(1, 96); -MOCKCPP_SET_DEFAULT_METHOD(1, 97); -MOCKCPP_SET_DEFAULT_METHOD(1, 98); -MOCKCPP_SET_DEFAULT_METHOD(1, 99); -MOCKCPP_SET_DEFAULT_METHOD(2, 0); -MOCKCPP_SET_DEFAULT_METHOD(2, 1); -MOCKCPP_SET_DEFAULT_METHOD(2, 2); -MOCKCPP_SET_DEFAULT_METHOD(2, 3); -MOCKCPP_SET_DEFAULT_METHOD(2, 4); -MOCKCPP_SET_DEFAULT_METHOD(2, 5); -MOCKCPP_SET_DEFAULT_METHOD(2, 6); -MOCKCPP_SET_DEFAULT_METHOD(2, 7); -MOCKCPP_SET_DEFAULT_METHOD(2, 8); -MOCKCPP_SET_DEFAULT_METHOD(2, 9); -MOCKCPP_SET_DEFAULT_METHOD(2, 10); -MOCKCPP_SET_DEFAULT_METHOD(2, 11); -MOCKCPP_SET_DEFAULT_METHOD(2, 12); -MOCKCPP_SET_DEFAULT_METHOD(2, 13); -MOCKCPP_SET_DEFAULT_METHOD(2, 14); -MOCKCPP_SET_DEFAULT_METHOD(2, 15); -MOCKCPP_SET_DEFAULT_METHOD(2, 16); -MOCKCPP_SET_DEFAULT_METHOD(2, 17); -MOCKCPP_SET_DEFAULT_METHOD(2, 18); -MOCKCPP_SET_DEFAULT_METHOD(2, 19); -MOCKCPP_SET_DEFAULT_METHOD(2, 20); -MOCKCPP_SET_DEFAULT_METHOD(2, 21); -MOCKCPP_SET_DEFAULT_METHOD(2, 22); -MOCKCPP_SET_DEFAULT_METHOD(2, 23); -MOCKCPP_SET_DEFAULT_METHOD(2, 24); -MOCKCPP_SET_DEFAULT_METHOD(2, 25); -MOCKCPP_SET_DEFAULT_METHOD(2, 26); -MOCKCPP_SET_DEFAULT_METHOD(2, 27); -MOCKCPP_SET_DEFAULT_METHOD(2, 28); -MOCKCPP_SET_DEFAULT_METHOD(2, 29); -MOCKCPP_SET_DEFAULT_METHOD(2, 30); -MOCKCPP_SET_DEFAULT_METHOD(2, 31); -MOCKCPP_SET_DEFAULT_METHOD(2, 32); -MOCKCPP_SET_DEFAULT_METHOD(2, 33); -MOCKCPP_SET_DEFAULT_METHOD(2, 34); -MOCKCPP_SET_DEFAULT_METHOD(2, 35); -MOCKCPP_SET_DEFAULT_METHOD(2, 36); -MOCKCPP_SET_DEFAULT_METHOD(2, 37); -MOCKCPP_SET_DEFAULT_METHOD(2, 38); -MOCKCPP_SET_DEFAULT_METHOD(2, 39); -MOCKCPP_SET_DEFAULT_METHOD(2, 40); -MOCKCPP_SET_DEFAULT_METHOD(2, 41); -MOCKCPP_SET_DEFAULT_METHOD(2, 42); -MOCKCPP_SET_DEFAULT_METHOD(2, 43); -MOCKCPP_SET_DEFAULT_METHOD(2, 44); -MOCKCPP_SET_DEFAULT_METHOD(2, 45); -MOCKCPP_SET_DEFAULT_METHOD(2, 46); -MOCKCPP_SET_DEFAULT_METHOD(2, 47); -MOCKCPP_SET_DEFAULT_METHOD(2, 48); -MOCKCPP_SET_DEFAULT_METHOD(2, 49); -MOCKCPP_SET_DEFAULT_METHOD(2, 50); -MOCKCPP_SET_DEFAULT_METHOD(2, 51); -MOCKCPP_SET_DEFAULT_METHOD(2, 52); -MOCKCPP_SET_DEFAULT_METHOD(2, 53); -MOCKCPP_SET_DEFAULT_METHOD(2, 54); -MOCKCPP_SET_DEFAULT_METHOD(2, 55); -MOCKCPP_SET_DEFAULT_METHOD(2, 56); -MOCKCPP_SET_DEFAULT_METHOD(2, 57); -MOCKCPP_SET_DEFAULT_METHOD(2, 58); -MOCKCPP_SET_DEFAULT_METHOD(2, 59); -MOCKCPP_SET_DEFAULT_METHOD(2, 60); -MOCKCPP_SET_DEFAULT_METHOD(2, 61); -MOCKCPP_SET_DEFAULT_METHOD(2, 62); -MOCKCPP_SET_DEFAULT_METHOD(2, 63); -MOCKCPP_SET_DEFAULT_METHOD(2, 64); -MOCKCPP_SET_DEFAULT_METHOD(2, 65); -MOCKCPP_SET_DEFAULT_METHOD(2, 66); -MOCKCPP_SET_DEFAULT_METHOD(2, 67); -MOCKCPP_SET_DEFAULT_METHOD(2, 68); -MOCKCPP_SET_DEFAULT_METHOD(2, 69); -MOCKCPP_SET_DEFAULT_METHOD(2, 70); -MOCKCPP_SET_DEFAULT_METHOD(2, 71); -MOCKCPP_SET_DEFAULT_METHOD(2, 72); -MOCKCPP_SET_DEFAULT_METHOD(2, 73); -MOCKCPP_SET_DEFAULT_METHOD(2, 74); -MOCKCPP_SET_DEFAULT_METHOD(2, 75); -MOCKCPP_SET_DEFAULT_METHOD(2, 76); -MOCKCPP_SET_DEFAULT_METHOD(2, 77); -MOCKCPP_SET_DEFAULT_METHOD(2, 78); -MOCKCPP_SET_DEFAULT_METHOD(2, 79); -MOCKCPP_SET_DEFAULT_METHOD(2, 80); -MOCKCPP_SET_DEFAULT_METHOD(2, 81); -MOCKCPP_SET_DEFAULT_METHOD(2, 82); -MOCKCPP_SET_DEFAULT_METHOD(2, 83); -MOCKCPP_SET_DEFAULT_METHOD(2, 84); -MOCKCPP_SET_DEFAULT_METHOD(2, 85); -MOCKCPP_SET_DEFAULT_METHOD(2, 86); -MOCKCPP_SET_DEFAULT_METHOD(2, 87); -MOCKCPP_SET_DEFAULT_METHOD(2, 88); -MOCKCPP_SET_DEFAULT_METHOD(2, 89); -MOCKCPP_SET_DEFAULT_METHOD(2, 90); -MOCKCPP_SET_DEFAULT_METHOD(2, 91); -MOCKCPP_SET_DEFAULT_METHOD(2, 92); -MOCKCPP_SET_DEFAULT_METHOD(2, 93); -MOCKCPP_SET_DEFAULT_METHOD(2, 94); -MOCKCPP_SET_DEFAULT_METHOD(2, 95); -MOCKCPP_SET_DEFAULT_METHOD(2, 96); -MOCKCPP_SET_DEFAULT_METHOD(2, 97); -MOCKCPP_SET_DEFAULT_METHOD(2, 98); -MOCKCPP_SET_DEFAULT_METHOD(2, 99); -MOCKCPP_SET_DEFAULT_METHOD(3, 0); -MOCKCPP_SET_DEFAULT_METHOD(3, 1); -MOCKCPP_SET_DEFAULT_METHOD(3, 2); -MOCKCPP_SET_DEFAULT_METHOD(3, 3); -MOCKCPP_SET_DEFAULT_METHOD(3, 4); -MOCKCPP_SET_DEFAULT_METHOD(3, 5); -MOCKCPP_SET_DEFAULT_METHOD(3, 6); -MOCKCPP_SET_DEFAULT_METHOD(3, 7); -MOCKCPP_SET_DEFAULT_METHOD(3, 8); -MOCKCPP_SET_DEFAULT_METHOD(3, 9); -MOCKCPP_SET_DEFAULT_METHOD(3, 10); -MOCKCPP_SET_DEFAULT_METHOD(3, 11); -MOCKCPP_SET_DEFAULT_METHOD(3, 12); -MOCKCPP_SET_DEFAULT_METHOD(3, 13); -MOCKCPP_SET_DEFAULT_METHOD(3, 14); -MOCKCPP_SET_DEFAULT_METHOD(3, 15); -MOCKCPP_SET_DEFAULT_METHOD(3, 16); -MOCKCPP_SET_DEFAULT_METHOD(3, 17); -MOCKCPP_SET_DEFAULT_METHOD(3, 18); -MOCKCPP_SET_DEFAULT_METHOD(3, 19); -MOCKCPP_SET_DEFAULT_METHOD(3, 20); -MOCKCPP_SET_DEFAULT_METHOD(3, 21); -MOCKCPP_SET_DEFAULT_METHOD(3, 22); -MOCKCPP_SET_DEFAULT_METHOD(3, 23); -MOCKCPP_SET_DEFAULT_METHOD(3, 24); -MOCKCPP_SET_DEFAULT_METHOD(3, 25); -MOCKCPP_SET_DEFAULT_METHOD(3, 26); -MOCKCPP_SET_DEFAULT_METHOD(3, 27); -MOCKCPP_SET_DEFAULT_METHOD(3, 28); -MOCKCPP_SET_DEFAULT_METHOD(3, 29); -MOCKCPP_SET_DEFAULT_METHOD(3, 30); -MOCKCPP_SET_DEFAULT_METHOD(3, 31); -MOCKCPP_SET_DEFAULT_METHOD(3, 32); -MOCKCPP_SET_DEFAULT_METHOD(3, 33); -MOCKCPP_SET_DEFAULT_METHOD(3, 34); -MOCKCPP_SET_DEFAULT_METHOD(3, 35); -MOCKCPP_SET_DEFAULT_METHOD(3, 36); -MOCKCPP_SET_DEFAULT_METHOD(3, 37); -MOCKCPP_SET_DEFAULT_METHOD(3, 38); -MOCKCPP_SET_DEFAULT_METHOD(3, 39); -MOCKCPP_SET_DEFAULT_METHOD(3, 40); -MOCKCPP_SET_DEFAULT_METHOD(3, 41); -MOCKCPP_SET_DEFAULT_METHOD(3, 42); -MOCKCPP_SET_DEFAULT_METHOD(3, 43); -MOCKCPP_SET_DEFAULT_METHOD(3, 44); -MOCKCPP_SET_DEFAULT_METHOD(3, 45); -MOCKCPP_SET_DEFAULT_METHOD(3, 46); -MOCKCPP_SET_DEFAULT_METHOD(3, 47); -MOCKCPP_SET_DEFAULT_METHOD(3, 48); -MOCKCPP_SET_DEFAULT_METHOD(3, 49); -MOCKCPP_SET_DEFAULT_METHOD(3, 50); -MOCKCPP_SET_DEFAULT_METHOD(3, 51); -MOCKCPP_SET_DEFAULT_METHOD(3, 52); -MOCKCPP_SET_DEFAULT_METHOD(3, 53); -MOCKCPP_SET_DEFAULT_METHOD(3, 54); -MOCKCPP_SET_DEFAULT_METHOD(3, 55); -MOCKCPP_SET_DEFAULT_METHOD(3, 56); -MOCKCPP_SET_DEFAULT_METHOD(3, 57); -MOCKCPP_SET_DEFAULT_METHOD(3, 58); -MOCKCPP_SET_DEFAULT_METHOD(3, 59); -MOCKCPP_SET_DEFAULT_METHOD(3, 60); -MOCKCPP_SET_DEFAULT_METHOD(3, 61); -MOCKCPP_SET_DEFAULT_METHOD(3, 62); -MOCKCPP_SET_DEFAULT_METHOD(3, 63); -MOCKCPP_SET_DEFAULT_METHOD(3, 64); -MOCKCPP_SET_DEFAULT_METHOD(3, 65); -MOCKCPP_SET_DEFAULT_METHOD(3, 66); -MOCKCPP_SET_DEFAULT_METHOD(3, 67); -MOCKCPP_SET_DEFAULT_METHOD(3, 68); -MOCKCPP_SET_DEFAULT_METHOD(3, 69); -MOCKCPP_SET_DEFAULT_METHOD(3, 70); -MOCKCPP_SET_DEFAULT_METHOD(3, 71); -MOCKCPP_SET_DEFAULT_METHOD(3, 72); -MOCKCPP_SET_DEFAULT_METHOD(3, 73); -MOCKCPP_SET_DEFAULT_METHOD(3, 74); -MOCKCPP_SET_DEFAULT_METHOD(3, 75); -MOCKCPP_SET_DEFAULT_METHOD(3, 76); -MOCKCPP_SET_DEFAULT_METHOD(3, 77); -MOCKCPP_SET_DEFAULT_METHOD(3, 78); -MOCKCPP_SET_DEFAULT_METHOD(3, 79); -MOCKCPP_SET_DEFAULT_METHOD(3, 80); -MOCKCPP_SET_DEFAULT_METHOD(3, 81); -MOCKCPP_SET_DEFAULT_METHOD(3, 82); -MOCKCPP_SET_DEFAULT_METHOD(3, 83); -MOCKCPP_SET_DEFAULT_METHOD(3, 84); -MOCKCPP_SET_DEFAULT_METHOD(3, 85); -MOCKCPP_SET_DEFAULT_METHOD(3, 86); -MOCKCPP_SET_DEFAULT_METHOD(3, 87); -MOCKCPP_SET_DEFAULT_METHOD(3, 88); -MOCKCPP_SET_DEFAULT_METHOD(3, 89); -MOCKCPP_SET_DEFAULT_METHOD(3, 90); -MOCKCPP_SET_DEFAULT_METHOD(3, 91); -MOCKCPP_SET_DEFAULT_METHOD(3, 92); -MOCKCPP_SET_DEFAULT_METHOD(3, 93); -MOCKCPP_SET_DEFAULT_METHOD(3, 94); -MOCKCPP_SET_DEFAULT_METHOD(3, 95); -MOCKCPP_SET_DEFAULT_METHOD(3, 96); -MOCKCPP_SET_DEFAULT_METHOD(3, 97); -MOCKCPP_SET_DEFAULT_METHOD(3, 98); -MOCKCPP_SET_DEFAULT_METHOD(3, 99); -MOCKCPP_SET_DEFAULT_METHOD(4, 0); -MOCKCPP_SET_DEFAULT_METHOD(4, 1); -MOCKCPP_SET_DEFAULT_METHOD(4, 2); -MOCKCPP_SET_DEFAULT_METHOD(4, 3); -MOCKCPP_SET_DEFAULT_METHOD(4, 4); -MOCKCPP_SET_DEFAULT_METHOD(4, 5); -MOCKCPP_SET_DEFAULT_METHOD(4, 6); -MOCKCPP_SET_DEFAULT_METHOD(4, 7); -MOCKCPP_SET_DEFAULT_METHOD(4, 8); -MOCKCPP_SET_DEFAULT_METHOD(4, 9); -MOCKCPP_SET_DEFAULT_METHOD(4, 10); -MOCKCPP_SET_DEFAULT_METHOD(4, 11); -MOCKCPP_SET_DEFAULT_METHOD(4, 12); -MOCKCPP_SET_DEFAULT_METHOD(4, 13); -MOCKCPP_SET_DEFAULT_METHOD(4, 14); -MOCKCPP_SET_DEFAULT_METHOD(4, 15); -MOCKCPP_SET_DEFAULT_METHOD(4, 16); -MOCKCPP_SET_DEFAULT_METHOD(4, 17); -MOCKCPP_SET_DEFAULT_METHOD(4, 18); -MOCKCPP_SET_DEFAULT_METHOD(4, 19); -MOCKCPP_SET_DEFAULT_METHOD(4, 20); -MOCKCPP_SET_DEFAULT_METHOD(4, 21); -MOCKCPP_SET_DEFAULT_METHOD(4, 22); -MOCKCPP_SET_DEFAULT_METHOD(4, 23); -MOCKCPP_SET_DEFAULT_METHOD(4, 24); -MOCKCPP_SET_DEFAULT_METHOD(4, 25); -MOCKCPP_SET_DEFAULT_METHOD(4, 26); -MOCKCPP_SET_DEFAULT_METHOD(4, 27); -MOCKCPP_SET_DEFAULT_METHOD(4, 28); -MOCKCPP_SET_DEFAULT_METHOD(4, 29); -MOCKCPP_SET_DEFAULT_METHOD(4, 30); -MOCKCPP_SET_DEFAULT_METHOD(4, 31); -MOCKCPP_SET_DEFAULT_METHOD(4, 32); -MOCKCPP_SET_DEFAULT_METHOD(4, 33); -MOCKCPP_SET_DEFAULT_METHOD(4, 34); -MOCKCPP_SET_DEFAULT_METHOD(4, 35); -MOCKCPP_SET_DEFAULT_METHOD(4, 36); -MOCKCPP_SET_DEFAULT_METHOD(4, 37); -MOCKCPP_SET_DEFAULT_METHOD(4, 38); -MOCKCPP_SET_DEFAULT_METHOD(4, 39); -MOCKCPP_SET_DEFAULT_METHOD(4, 40); -MOCKCPP_SET_DEFAULT_METHOD(4, 41); -MOCKCPP_SET_DEFAULT_METHOD(4, 42); -MOCKCPP_SET_DEFAULT_METHOD(4, 43); -MOCKCPP_SET_DEFAULT_METHOD(4, 44); -MOCKCPP_SET_DEFAULT_METHOD(4, 45); -MOCKCPP_SET_DEFAULT_METHOD(4, 46); -MOCKCPP_SET_DEFAULT_METHOD(4, 47); -MOCKCPP_SET_DEFAULT_METHOD(4, 48); -MOCKCPP_SET_DEFAULT_METHOD(4, 49); -MOCKCPP_SET_DEFAULT_METHOD(4, 50); -MOCKCPP_SET_DEFAULT_METHOD(4, 51); -MOCKCPP_SET_DEFAULT_METHOD(4, 52); -MOCKCPP_SET_DEFAULT_METHOD(4, 53); -MOCKCPP_SET_DEFAULT_METHOD(4, 54); -MOCKCPP_SET_DEFAULT_METHOD(4, 55); -MOCKCPP_SET_DEFAULT_METHOD(4, 56); -MOCKCPP_SET_DEFAULT_METHOD(4, 57); -MOCKCPP_SET_DEFAULT_METHOD(4, 58); -MOCKCPP_SET_DEFAULT_METHOD(4, 59); -MOCKCPP_SET_DEFAULT_METHOD(4, 60); -MOCKCPP_SET_DEFAULT_METHOD(4, 61); -MOCKCPP_SET_DEFAULT_METHOD(4, 62); -MOCKCPP_SET_DEFAULT_METHOD(4, 63); -MOCKCPP_SET_DEFAULT_METHOD(4, 64); -MOCKCPP_SET_DEFAULT_METHOD(4, 65); -MOCKCPP_SET_DEFAULT_METHOD(4, 66); -MOCKCPP_SET_DEFAULT_METHOD(4, 67); -MOCKCPP_SET_DEFAULT_METHOD(4, 68); -MOCKCPP_SET_DEFAULT_METHOD(4, 69); -MOCKCPP_SET_DEFAULT_METHOD(4, 70); -MOCKCPP_SET_DEFAULT_METHOD(4, 71); -MOCKCPP_SET_DEFAULT_METHOD(4, 72); -MOCKCPP_SET_DEFAULT_METHOD(4, 73); -MOCKCPP_SET_DEFAULT_METHOD(4, 74); -MOCKCPP_SET_DEFAULT_METHOD(4, 75); -MOCKCPP_SET_DEFAULT_METHOD(4, 76); -MOCKCPP_SET_DEFAULT_METHOD(4, 77); -MOCKCPP_SET_DEFAULT_METHOD(4, 78); -MOCKCPP_SET_DEFAULT_METHOD(4, 79); -MOCKCPP_SET_DEFAULT_METHOD(4, 80); -MOCKCPP_SET_DEFAULT_METHOD(4, 81); -MOCKCPP_SET_DEFAULT_METHOD(4, 82); -MOCKCPP_SET_DEFAULT_METHOD(4, 83); -MOCKCPP_SET_DEFAULT_METHOD(4, 84); -MOCKCPP_SET_DEFAULT_METHOD(4, 85); -MOCKCPP_SET_DEFAULT_METHOD(4, 86); -MOCKCPP_SET_DEFAULT_METHOD(4, 87); -MOCKCPP_SET_DEFAULT_METHOD(4, 88); -MOCKCPP_SET_DEFAULT_METHOD(4, 89); -MOCKCPP_SET_DEFAULT_METHOD(4, 90); -MOCKCPP_SET_DEFAULT_METHOD(4, 91); -MOCKCPP_SET_DEFAULT_METHOD(4, 92); -MOCKCPP_SET_DEFAULT_METHOD(4, 93); -MOCKCPP_SET_DEFAULT_METHOD(4, 94); -MOCKCPP_SET_DEFAULT_METHOD(4, 95); -MOCKCPP_SET_DEFAULT_METHOD(4, 96); -MOCKCPP_SET_DEFAULT_METHOD(4, 97); -MOCKCPP_SET_DEFAULT_METHOD(4, 98); -MOCKCPP_SET_DEFAULT_METHOD(4, 99); diff --git a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule b/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/DefaultMethodAddrGetterDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DefaultStub.h b/cli/test/include/mockcpp/DefaultStub.h deleted file mode 100644 index cbc2b75..0000000 --- a/cli/test/include/mockcpp/DefaultStub.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DEFAULT_STUB_H -#define __MOCKCPP_DEFAULT_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct Invocation; - -struct DefaultStub : public Stub -{ - DefaultStub(Stub* stub); - - ~DefaultStub(); - - Any& invoke(const Invocation& inv); - - std::string toString() const; - -private: - - Stub* defaultStub; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DelegatedMethod.h b/cli/test/include/mockcpp/DelegatedMethod.h deleted file mode 100644 index 5954afb..0000000 --- a/cli/test/include/mockcpp/DelegatedMethod.h +++ /dev/null @@ -1,76 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DELEGATED_METHOD_H -#define __MOCKCPP_DELEGATED_METHOD_H - -#include - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////////////////////////// -template -struct DelegatedMethod; - -///////////////////////////////////////////////////////////////// -#define MOCKCPP_DELEGATED_METHOD_DEF(n) \ -template \ -struct DelegatedMethod > \ -{ \ - enum { IsConst = 0 }; \ - enum { NumberOfParameters = n }; \ - \ - R operator()(DECL_PARAMS_LIST(n)) \ - { \ - IndexInvokableGetter* getter = \ - VirtualTable::getInvokableGetter(this, VPTRIndex); \ - return ChainableMockMethod(getter->getInvokable(VPTRIndex, VTBLIndex)) \ - ("", RefAny() DECL_REST_PARAMS(n)); \ - } \ -} - -///////////////////////////////////////////////////////////////// -#define MOCKCPP_CONST_DELEGATED_METHOD_DEF(n) \ -template \ -struct DelegatedMethod > \ -{ \ - enum { IsConst = 1 }; \ - enum { NumberOfParameters = n }; \ - \ - R operator()(DECL_PARAMS_LIST(n)) \ - { \ - IndexInvokableGetter* getter = \ - VirtualTable::getInvokableGetter(this, VPTRIndex); \ - return ChainableMockMethod(getter->getInvokable(VPTRIndex, VTBLIndex)) \ - ("", RefAny() DECL_REST_PARAMS(n)); \ - } \ -} - -///////////////////////////////////////////////////////////////// -#include - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DelegatedMethodDef.h b/cli/test/include/mockcpp/DelegatedMethodDef.h deleted file mode 100644 index a5c6bf6..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodDef.h +++ /dev/null @@ -1,26 +0,0 @@ -MOCKCPP_DELEGATED_METHOD_DEF(0); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(0); -MOCKCPP_DELEGATED_METHOD_DEF(1); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(1); -MOCKCPP_DELEGATED_METHOD_DEF(2); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(2); -MOCKCPP_DELEGATED_METHOD_DEF(3); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(3); -MOCKCPP_DELEGATED_METHOD_DEF(4); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(4); -MOCKCPP_DELEGATED_METHOD_DEF(5); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(5); -MOCKCPP_DELEGATED_METHOD_DEF(6); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(6); -MOCKCPP_DELEGATED_METHOD_DEF(7); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(7); -MOCKCPP_DELEGATED_METHOD_DEF(8); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(8); -MOCKCPP_DELEGATED_METHOD_DEF(9); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(9); -MOCKCPP_DELEGATED_METHOD_DEF(10); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(10); -MOCKCPP_DELEGATED_METHOD_DEF(11); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(11); -MOCKCPP_DELEGATED_METHOD_DEF(12); -MOCKCPP_CONST_DELEGATED_METHOD_DEF(12); diff --git a/cli/test/include/mockcpp/DelegatedMethodDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h deleted file mode 100644 index 3fe6dd0..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h +++ /dev/null @@ -1,5 +0,0 @@ -DELEGATED_METHOD_GET_BY_VPTR(0, vtblIndex) -DELEGATED_METHOD_GET_BY_VPTR(1, vtblIndex) -DELEGATED_METHOD_GET_BY_VPTR(2, vtblIndex) -DELEGATED_METHOD_GET_BY_VPTR(3, vtblIndex) -DELEGATED_METHOD_GET_BY_VPTR(4, vtblIndex) diff --git a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodGetByVptrDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetDef.h b/cli/test/include/mockcpp/DelegatedMethodGetDef.h deleted file mode 100644 index def5212..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodGetDef.h +++ /dev/null @@ -1,100 +0,0 @@ -DELEGATED_METHOD_GET(VPTRIndex, 0) -DELEGATED_METHOD_GET(VPTRIndex, 1) -DELEGATED_METHOD_GET(VPTRIndex, 2) -DELEGATED_METHOD_GET(VPTRIndex, 3) -DELEGATED_METHOD_GET(VPTRIndex, 4) -DELEGATED_METHOD_GET(VPTRIndex, 5) -DELEGATED_METHOD_GET(VPTRIndex, 6) -DELEGATED_METHOD_GET(VPTRIndex, 7) -DELEGATED_METHOD_GET(VPTRIndex, 8) -DELEGATED_METHOD_GET(VPTRIndex, 9) -DELEGATED_METHOD_GET(VPTRIndex, 10) -DELEGATED_METHOD_GET(VPTRIndex, 11) -DELEGATED_METHOD_GET(VPTRIndex, 12) -DELEGATED_METHOD_GET(VPTRIndex, 13) -DELEGATED_METHOD_GET(VPTRIndex, 14) -DELEGATED_METHOD_GET(VPTRIndex, 15) -DELEGATED_METHOD_GET(VPTRIndex, 16) -DELEGATED_METHOD_GET(VPTRIndex, 17) -DELEGATED_METHOD_GET(VPTRIndex, 18) -DELEGATED_METHOD_GET(VPTRIndex, 19) -DELEGATED_METHOD_GET(VPTRIndex, 20) -DELEGATED_METHOD_GET(VPTRIndex, 21) -DELEGATED_METHOD_GET(VPTRIndex, 22) -DELEGATED_METHOD_GET(VPTRIndex, 23) -DELEGATED_METHOD_GET(VPTRIndex, 24) -DELEGATED_METHOD_GET(VPTRIndex, 25) -DELEGATED_METHOD_GET(VPTRIndex, 26) -DELEGATED_METHOD_GET(VPTRIndex, 27) -DELEGATED_METHOD_GET(VPTRIndex, 28) -DELEGATED_METHOD_GET(VPTRIndex, 29) -DELEGATED_METHOD_GET(VPTRIndex, 30) -DELEGATED_METHOD_GET(VPTRIndex, 31) -DELEGATED_METHOD_GET(VPTRIndex, 32) -DELEGATED_METHOD_GET(VPTRIndex, 33) -DELEGATED_METHOD_GET(VPTRIndex, 34) -DELEGATED_METHOD_GET(VPTRIndex, 35) -DELEGATED_METHOD_GET(VPTRIndex, 36) -DELEGATED_METHOD_GET(VPTRIndex, 37) -DELEGATED_METHOD_GET(VPTRIndex, 38) -DELEGATED_METHOD_GET(VPTRIndex, 39) -DELEGATED_METHOD_GET(VPTRIndex, 40) -DELEGATED_METHOD_GET(VPTRIndex, 41) -DELEGATED_METHOD_GET(VPTRIndex, 42) -DELEGATED_METHOD_GET(VPTRIndex, 43) -DELEGATED_METHOD_GET(VPTRIndex, 44) -DELEGATED_METHOD_GET(VPTRIndex, 45) -DELEGATED_METHOD_GET(VPTRIndex, 46) -DELEGATED_METHOD_GET(VPTRIndex, 47) -DELEGATED_METHOD_GET(VPTRIndex, 48) -DELEGATED_METHOD_GET(VPTRIndex, 49) -DELEGATED_METHOD_GET(VPTRIndex, 50) -DELEGATED_METHOD_GET(VPTRIndex, 51) -DELEGATED_METHOD_GET(VPTRIndex, 52) -DELEGATED_METHOD_GET(VPTRIndex, 53) -DELEGATED_METHOD_GET(VPTRIndex, 54) -DELEGATED_METHOD_GET(VPTRIndex, 55) -DELEGATED_METHOD_GET(VPTRIndex, 56) -DELEGATED_METHOD_GET(VPTRIndex, 57) -DELEGATED_METHOD_GET(VPTRIndex, 58) -DELEGATED_METHOD_GET(VPTRIndex, 59) -DELEGATED_METHOD_GET(VPTRIndex, 60) -DELEGATED_METHOD_GET(VPTRIndex, 61) -DELEGATED_METHOD_GET(VPTRIndex, 62) -DELEGATED_METHOD_GET(VPTRIndex, 63) -DELEGATED_METHOD_GET(VPTRIndex, 64) -DELEGATED_METHOD_GET(VPTRIndex, 65) -DELEGATED_METHOD_GET(VPTRIndex, 66) -DELEGATED_METHOD_GET(VPTRIndex, 67) -DELEGATED_METHOD_GET(VPTRIndex, 68) -DELEGATED_METHOD_GET(VPTRIndex, 69) -DELEGATED_METHOD_GET(VPTRIndex, 70) -DELEGATED_METHOD_GET(VPTRIndex, 71) -DELEGATED_METHOD_GET(VPTRIndex, 72) -DELEGATED_METHOD_GET(VPTRIndex, 73) -DELEGATED_METHOD_GET(VPTRIndex, 74) -DELEGATED_METHOD_GET(VPTRIndex, 75) -DELEGATED_METHOD_GET(VPTRIndex, 76) -DELEGATED_METHOD_GET(VPTRIndex, 77) -DELEGATED_METHOD_GET(VPTRIndex, 78) -DELEGATED_METHOD_GET(VPTRIndex, 79) -DELEGATED_METHOD_GET(VPTRIndex, 80) -DELEGATED_METHOD_GET(VPTRIndex, 81) -DELEGATED_METHOD_GET(VPTRIndex, 82) -DELEGATED_METHOD_GET(VPTRIndex, 83) -DELEGATED_METHOD_GET(VPTRIndex, 84) -DELEGATED_METHOD_GET(VPTRIndex, 85) -DELEGATED_METHOD_GET(VPTRIndex, 86) -DELEGATED_METHOD_GET(VPTRIndex, 87) -DELEGATED_METHOD_GET(VPTRIndex, 88) -DELEGATED_METHOD_GET(VPTRIndex, 89) -DELEGATED_METHOD_GET(VPTRIndex, 90) -DELEGATED_METHOD_GET(VPTRIndex, 91) -DELEGATED_METHOD_GET(VPTRIndex, 92) -DELEGATED_METHOD_GET(VPTRIndex, 93) -DELEGATED_METHOD_GET(VPTRIndex, 94) -DELEGATED_METHOD_GET(VPTRIndex, 95) -DELEGATED_METHOD_GET(VPTRIndex, 96) -DELEGATED_METHOD_GET(VPTRIndex, 97) -DELEGATED_METHOD_GET(VPTRIndex, 98) -DELEGATED_METHOD_GET(VPTRIndex, 99) diff --git a/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule b/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodGetDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DelegatedMethodGetter.h b/cli/test/include/mockcpp/DelegatedMethodGetter.h deleted file mode 100644 index 9a8c388..0000000 --- a/cli/test/include/mockcpp/DelegatedMethodGetter.h +++ /dev/null @@ -1,84 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DELEGATED_METHOD_GETTER_H -#define __MOCKCPP_DELEGATED_METHOD_GETTER_H - -#include - -#include -#include -#include - -MOCKCPP_NS_START - -#define DELEGATED_METHOD_GET(N, I) \ -case I: \ -{ \ - return getAddrOfMethod(&DelegatedMethod::operator()); \ -} \ - -void maxVtblSizeTooBigError(unsigned int index); - -template -struct DelegatedMethodGetter -{ - static void* get(unsigned int index) - { - switch(index) - { -# include - default: break; - } - - maxVtblSizeTooBigError(index); - - return 0; - } -}; - -//////////////////////////////////////////////// -#define DELEGATED_METHOD_GET_BY_VPTR(N, I) \ -case N: \ -{ \ - return DelegatedMethodGetter::get(I); \ -} - -void maxInheritanceTooBigError(unsigned int index); - -template -void* getDelegatedFunction(unsigned int vptrIndex, unsigned int vtblIndex, Method m) -{ - typedef typename MethodTypeTraits::MethodArgumentsList MethodArgumentsList; - - switch(vptrIndex) - { -# include - default: - break; - } - - maxInheritanceTooBigError(vptrIndex); - - return 0; -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DestructorAddrGetterDef.h b/cli/test/include/mockcpp/DestructorAddrGetterDef.h deleted file mode 100644 index dfe68f6..0000000 --- a/cli/test/include/mockcpp/DestructorAddrGetterDef.h +++ /dev/null @@ -1,5 +0,0 @@ -MOCKCPP_GET_DESTRUCTOR_ADDR(0) -MOCKCPP_GET_DESTRUCTOR_ADDR(1) -MOCKCPP_GET_DESTRUCTOR_ADDR(2) -MOCKCPP_GET_DESTRUCTOR_ADDR(3) -MOCKCPP_GET_DESTRUCTOR_ADDR(4) diff --git a/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule b/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/DestructorAddrGetterDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/DestructorChecker.h b/cli/test/include/mockcpp/DestructorChecker.h deleted file mode 100644 index b2fbd2d..0000000 --- a/cli/test/include/mockcpp/DestructorChecker.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DESTRUCTOR_CHECKER_H -#define __MOCKCPP_DESTRUCTOR_CHECKER_H - -#include -#include - -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -template -std::pair getIndexOfDestructor() -{ - MethodIndiceChecker* checker = createMethodIndiceChecker(typeid(Original)); - - Interface* iface = (Original*) checker->getObject(); - - delete iface; - - unsigned int vptrIndex = 0; - unsigned int vtblIndex = 0; - - bool result = checker->getIndice(true, vptrIndex, vtblIndex); - delete checker; - - MOCKCPP_ASSERT_TRUE("You are trying to mock an interface without virtual destructor", result); - - return std::pair - (vptrIndex, vtblIndex); -}; - -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DieStub.h b/cli/test/include/mockcpp/DieStub.h deleted file mode 100644 index 38fd6a3..0000000 --- a/cli/test/include/mockcpp/DieStub.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DIE_STUB_H -#define __MOCKCPP_DIE_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct DieStub : public TypelessStub -{ - DieStub(int exitCode = 0); - - bool isCompleted() const; - - Any& invoke(void); - - std::string toString(void) const; - - const std::type_info& type() const; - -private: - - int code; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/DummyBuilder.h b/cli/test/include/mockcpp/DummyBuilder.h deleted file mode 100644 index da935f9..0000000 --- a/cli/test/include/mockcpp/DummyBuilder.h +++ /dev/null @@ -1,31 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_DUMMY_BUILDER_H -#define __MOCKCPP_DUMMY_BUILDER_H - -#include - -MOCKCPP_NS_START - -struct DummyBuilder {}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/EqualityUtil.h b/cli/test/include/mockcpp/EqualityUtil.h deleted file mode 100644 index 568707a..0000000 --- a/cli/test/include/mockcpp/EqualityUtil.h +++ /dev/null @@ -1,43 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_EQUALITY_UTIL_H -#define __MOCKCPP_EQUALITY_UTIL_H - -#include - -#include - -MOCKCPP_NS_START - -template -bool isEqualComparison(const T &left, const T &right) -{ - return left == right; -} - -inline -bool isEqualComparison(const char* left, const char* right) -{ - return !::strcmp(left, right); -} - -MOCKCPP_NS_END - -#endif // __MOCKCPP_EQUALITY_UTIL_H - diff --git a/cli/test/include/mockcpp/Exception.h b/cli/test/include/mockcpp/Exception.h deleted file mode 100644 index 814a36d..0000000 --- a/cli/test/include/mockcpp/Exception.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_EXCEPTION_H -#define __MOCKCPP_EXCEPTION_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct Exception - : public std::exception -{ - Exception (unsigned srcline, const char* srcfile, const std::string &message); - - virtual ~Exception() throw(); - - virtual std::string getMessage() const; - - unsigned getSrcLine() const; - - std::string getSrcFile() const; - - virtual const char *what() const throw(); - -private: - - std::string message; - unsigned srcline; - std::string srcfile; - mutable std::string what_helper; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ExpectsMatcher.h b/cli/test/include/mockcpp/ExpectsMatcher.h deleted file mode 100644 index 5aa631b..0000000 --- a/cli/test/include/mockcpp/ExpectsMatcher.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_EXPECTS_MATCHER_H -#define __MOCKCPP_EXPECTS_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct Invocation; -struct Matcher; - -struct ExpectsMatcher : public Matcher -{ - ExpectsMatcher(Matcher*); - ~ExpectsMatcher(); - - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - void verify(); - std::string toString() const; - -private: - - Matcher* matcher; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Formatter.h b/cli/test/include/mockcpp/Formatter.h deleted file mode 100644 index 5fa73bf..0000000 --- a/cli/test/include/mockcpp/Formatter.h +++ /dev/null @@ -1,92 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_FORMATTER_H -#define __MOCKCPP_FORMATTER_H - -#include - -#include - -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////// -std::string toBufferString(void* buf, size_t size); - -/////////////////////////////////////////////////////// -template -std::string toString(const T& val) -{ - return MOCKCPP_NS::toBufferString((void*)&val, sizeof(val)); -} - -/////////////////////////////////////////////////////// -std::string toPointerString(void*); - -/////////////////////////////////////////////////////// -template -std::string toString(T* p) -{ - return MOCKCPP_NS::toPointerString((void*)p); -} - -/////////////////////////////////////////////////////// -template -std::string toString(const T* s) -{ - return MOCKCPP_NS::toPointerString((void*)s); -} - -/////////////////////////////////////////////////////// -std::string toString(std::string s); -std::string toString(char* s); -std::string toString(const char* s); -std::string toString(float f); -std::string toString(double d); -std::string toString(bool b); -std::string toString(char c); -std::string toString(unsigned char c); -std::string toString(short s); -std::string toString(unsigned short s); -std::string toString(int i); -std::string toString(unsigned int i); -std::string toString(long l); -std::string toString(unsigned long l); - -#if (MOCKCPP_SUPPORT_LONG_LONG == 1) -std::string toString(long long ll); -std::string toString(unsigned long long ll); -#endif - -///////////////////////////////////////////////////////////////// -template -std::string toTypeAndValueString(const T& val) -{ - oss_t oss; - oss << "(" << MOCKCPP_NS::TypeString::value() << ")" - << MOCKCPP_NS::toString(val); - return oss.str(); -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Functor.h b/cli/test/include/mockcpp/Functor.h deleted file mode 100644 index d7154d3..0000000 --- a/cli/test/include/mockcpp/Functor.h +++ /dev/null @@ -1,124 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_FUNCTOR_H -#define __MOCKCPP_FUNCTOR_H - -#include - -#include - -#include -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////// -struct BaseFunctor -{ - BaseFunctor(const std::string& fName, const char* cName) - : name(fName), nameOfCaller(cName) {} - - std::string getName() const - { - return name; - } - - std::string getNameOfCaller() const - { - return nameOfCaller; - } - -private: - std::string name; - std::string nameOfCaller; -}; - -//////////////////////////////////////////// -template -struct Functor; - -#define FUNCTOR_CONS() \ - Functor(const std::string& name, const char* cName) \ - : BaseFunctor(name, cName) \ - {} - -//////////////////////////////////////////// -#define FUNCTOR_DEF(n) \ -template \ -struct Functor : public BaseFunctor \ -{ \ - FUNCTOR_CONS() \ - \ - R operator()(DECL_PARAMS_LIST(n)) \ - { \ - return GlobalMockObject::instance.invoke(getName()) \ - (getNameOfCaller() DECL_REST_PARAMS(n)); \ - } \ -} - - -FUNCTOR_DEF(0); -FUNCTOR_DEF(1); -FUNCTOR_DEF(2); -FUNCTOR_DEF(3); -FUNCTOR_DEF(4); -FUNCTOR_DEF(5); -FUNCTOR_DEF(6); -FUNCTOR_DEF(7); -FUNCTOR_DEF(8); -FUNCTOR_DEF(9); -FUNCTOR_DEF(10); -FUNCTOR_DEF(11); -FUNCTOR_DEF(12); - -/////////////////////////////////////////////////////// -#define VARDIC_FUNCTOR_DEF(n) \ -template \ -struct Functor : public BaseFunctor \ -{ \ - FUNCTOR_CONS() \ - \ - R operator()(const RefAny& p1 = RefAny(), const RefAny& p2 = RefAny(), \ - const RefAny& p3 = RefAny(), const RefAny& p4 = RefAny(), \ - const RefAny& p5 = RefAny(), const RefAny& p6 = RefAny(), \ - const RefAny& p7 = RefAny(), const RefAny& p8 = RefAny(), \ - const RefAny& p9 = RefAny(), const RefAny& p10 = RefAny(), \ - const RefAny& p11 = RefAny(), const RefAny& p12 = RefAny()) \ - { \ - return GlobalMockObject::instance.invoke(getName()) \ - (getNameOfCaller() DECL_REST_PARAMS(12)); \ - } \ -} - -VARDIC_FUNCTOR_DEF(0); -VARDIC_FUNCTOR_DEF(1); -VARDIC_FUNCTOR_DEF(2); -VARDIC_FUNCTOR_DEF(3); -VARDIC_FUNCTOR_DEF(4); -VARDIC_FUNCTOR_DEF(5); -VARDIC_FUNCTOR_DEF(6); -VARDIC_FUNCTOR_DEF(7); -VARDIC_FUNCTOR_DEF(8); - -///////////////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/GenericMethodIndicesChecker.h b/cli/test/include/mockcpp/GenericMethodIndicesChecker.h deleted file mode 100644 index 3e2e11c..0000000 --- a/cli/test/include/mockcpp/GenericMethodIndicesChecker.h +++ /dev/null @@ -1,65 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include - -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////// -template -std::pair -getIndicesOfMethod(Method m) -{ - typedef typename MethodTypeTraits::MethodType ExpectedMethodType; - ExpectedMethodType expectedMethod = m; - - typedef void (Interface::*Checker)(void*); - - Checker check = \ - reinterpret_cast(expectedMethod); - - MethodIndiceChecker* checker = createMethodIndiceChecker(typeid(Interface)); - - Interface* iface = (Interface*)checker->getObject(); - - (iface->*check)(0); - - unsigned int vptrIndex = 0; - unsigned int vtblIndex = 0; - - bool result = checker->getIndice(false, vptrIndex, vtblIndex); - - delete checker; - - MOCKCPP_ASSERT_TRUE("You are trying to mock a non-pure-virtual object", result); - - return std::pair - (vptrIndex, vtblIndex); -}; - - -/////////////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - diff --git a/cli/test/include/mockcpp/GlobalMockObject.h b/cli/test/include/mockcpp/GlobalMockObject.h deleted file mode 100644 index a98fb05..0000000 --- a/cli/test/include/mockcpp/GlobalMockObject.h +++ /dev/null @@ -1,65 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_GLOBAL_MOCK_OBJECT_H -#define __MOCKCPP_GLOBAL_MOCK_OBJECT_H - -#include - -#if defined(MOCKCPP_USE_MOCKABLE) -# include -#else -# include -#endif - -MOCKCPP_NS_START - -#if defined(MOCKCPP_USE_MOCKABLE) -typedef ChainableMockObject MockObjectType; -#else -typedef HookMockObject MockObjectType; -#endif - -struct GlobalMockObject -{ - static void verify(); - static void reset(); - static void reset(const void* api); - - static MockObjectType instance; -}; - -namespace Details { - template - void *methodToAddr(Method m) - { - union - { - void *addr_; - Method m_; - }; - - m_ = m; - return addr_; - } -} // namespace Details - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/GnuMethodIndicesChecker.h b/cli/test/include/mockcpp/GnuMethodIndicesChecker.h deleted file mode 100644 index 0531a63..0000000 --- a/cli/test/include/mockcpp/GnuMethodIndicesChecker.h +++ /dev/null @@ -1,40 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_GNU_METHOD_INDICES_CHECKER_H -#define __MOCKCPP_GNU_METHOD_INDICES_CHECKER_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -std::pair -getIndicesOfMethod(Method m) -{ - unsigned int vptrIndex = getDeltaOfMethod(m); - unsigned int vtblIndex = getIndexOfMethod(m); - return std::pair - (vptrIndex, vtblIndex); -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/GnuMethodInfoReader.h b/cli/test/include/mockcpp/GnuMethodInfoReader.h deleted file mode 100644 index d79854f..0000000 --- a/cli/test/include/mockcpp/GnuMethodInfoReader.h +++ /dev/null @@ -1,105 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_GNU_METHOD_INFO_READER_H -#define __MOCKCPP_GNU_METHOD_INFO_READER_H - -#include -#include - -#include -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////////// -struct GnuMethodDescription -{ - union { - void* addr; - int index; - }u; - - int delta; -}; - -/////////////////////////////////////////////////////////// -template -union MethodDescriptionUnion -{ - GnuMethodDescription desc; - Method method; -}; - -/////////////////////////////////////////////////////////// -template -void* getAddrOfMethod(Method input) -{ - MethodDescriptionUnion m; - m.method = input; - - oss_t oss; - oss << "Method address should be even, please make sure the method " - << TypeString::value() << " is NOT a virtual method"; - - MOCKCPP_ASSERT_TRUE( - oss.str(), - !(m.desc.u.index%2)); - - - return m.desc.u.addr; -} - -/////////////////////////////////////////////////////////// -template -GnuMethodDescription getGnuDescOfVirtualMethod(Method input) -{ - typedef typename MethodTypeTraits::MethodType ExpectedMethodType; - MethodDescriptionUnion m; - m.method = input; - - oss_t oss; - oss << "Virtual method address should be odd, please make sure the method " - << TypeString::value() << " is a virtual method"; - - MOCKCPP_ASSERT_TRUE( - oss.str(), - (m.desc.u.index%2)); - - return m.desc; -} - -/////////////////////////////////////////////////////////// -template -unsigned int getIndexOfMethod(Method method) -{ - return (getGnuDescOfVirtualMethod(method).u.index - 1)/sizeof(void*); -} - -/////////////////////////////////////////////////////////// -template -unsigned int getDeltaOfMethod(Method method) -{ - return getGnuDescOfVirtualMethod(method).delta/sizeof(void*); -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/HookMockObject.h b/cli/test/include/mockcpp/HookMockObject.h deleted file mode 100644 index 6c240f4..0000000 --- a/cli/test/include/mockcpp/HookMockObject.h +++ /dev/null @@ -1,64 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_HOOK_MOCK_OBJECT_H__ -#define __MOCKCPP_HOOK_MOCK_OBJECT_H__ - -#include -#include -#include -#include - -MOCKCPP_NS_START - -struct ApiHookHolder; -struct HookMockObjectImpl; - -struct HookMockObject : public ChainableMockObjectBase -{ - HookMockObject(const std::string& name); - ~HookMockObject(); - - // Building-invocation-mocker interface -- Used in test case - InvocationMockBuilderGetter method - ( const std::string& name - , const void* api - , ApiHookHolder* holder); - - // Invoking interface -- Used in Functor - template - ChainableMockMethod invoke(const void* api) - { - return ChainableMockMethod(getInvokable(api)); - } - - void reset(); - void reset(const void* api); - -private: - - // It's only for template-method invoke. we have to make it visible. - Invokable* getInvokable(const void* api); - -private: - HookMockObjectImpl* This; -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/IdentityBuilder.h b/cli/test/include/mockcpp/IdentityBuilder.h deleted file mode 100644 index 99deddf..0000000 --- a/cli/test/include/mockcpp/IdentityBuilder.h +++ /dev/null @@ -1,42 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IDENTITY_BUILDER_H -#define __MOCKCPP_IDENTITY_BUILDER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; - -struct IdentityBuilder -{ - void id(const std::string& id); - - virtual ~IdentityBuilder() {} - -private: - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Ignore.h b/cli/test/include/mockcpp/Ignore.h deleted file mode 100644 index 2eda4a2..0000000 --- a/cli/test/include/mockcpp/Ignore.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IGNORE_H -#define __MOCKCPP_IGNORE_H - -#include -#include - -MOCKCPP_NS_START - -struct Ignore -{ - bool operator==(const Ignore& rhs) const - { - return true; - } -}; - -const Any ignore = Any(Ignore()); - -inline static -Any& getIgnore() -{ - return const_cast(ignore); -} - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IgnoreHandler.h b/cli/test/include/mockcpp/IgnoreHandler.h deleted file mode 100644 index c7a846e..0000000 --- a/cli/test/include/mockcpp/IgnoreHandler.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RESULT_HANDLER_H -#define __MOCKCPP_RESULT_HANDLER_H - -#include -#include -#include - -MOCKCPP_NS_START - -struct Any; - -struct IgnoreHandler : public ResultHandler -{ - bool matches(const Any& val) const - { - return any_castable(val); - } - - Any& getResult() const - { - return getEmtpyHandler(); - } -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IgnoreResultHandler.h b/cli/test/include/mockcpp/IgnoreResultHandler.h deleted file mode 100644 index 5481851..0000000 --- a/cli/test/include/mockcpp/IgnoreResultHandler.h +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IGNORE_RESULT_HANDLER_H -#define __MOCKCPP_IGNORE_RESULT_HANDLER_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; - -struct IgnoreResultHandler : public ResultHandler -{ - bool matches(const Any& result) const; - - const Any& getResult(const Any& result) const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h b/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h deleted file mode 100644 index 5135560..0000000 --- a/cli/test/include/mockcpp/IgnoreResultHandlerFactory.h +++ /dev/null @@ -1,43 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IGNORE_RESULT_HANDLER_FACTORY_H -#define __MOCKCPP_IGNORE_RESULT_HANDLER_FACTORY_H - -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////////// -struct IgnoreResultHandlerFactory - : public ResultHandlerFactory -{ - ResultHandler* create( - bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber); -}; - -/////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IgnoreReturnStub.h b/cli/test/include/mockcpp/IgnoreReturnStub.h deleted file mode 100644 index 89d1d64..0000000 --- a/cli/test/include/mockcpp/IgnoreReturnStub.h +++ /dev/null @@ -1,44 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IGNORE_RETURN_STUB_H -#define __MOCKCPP_IGNORE_RETURN_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct IgnoreReturnStub : public TypelessStub -{ - IgnoreReturnStub(); - - bool isCompleted(void) const; - Any& invoke(void); - - std::string toString(void) const; - - const std::type_info& type() const; -private: - bool hasBeenInvoked; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IncrementStub.h b/cli/test/include/mockcpp/IncrementStub.h deleted file mode 100644 index 83a37f2..0000000 --- a/cli/test/include/mockcpp/IncrementStub.h +++ /dev/null @@ -1,110 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INCREAMENT_STUB_H -#define __MOCKCPP_INCREAMENT_STUB_H - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -template -struct IncrementStub : public TypelessStub -{ - IncrementStub(T startValue, T endValue) - : from(startValue), to(endValue), current(startValue), hasEnd(true) - {} - - IncrementStub(T startValue) - : from(startValue), current(startValue), hasEnd(false) - {} - - bool isCompleted() const - { - if(!hasEnd) - { - return false; - } - - return current > to; - } - - Any& invoke(void) - { - checkEnd(); - value = Any(current); - current++; - return value; - } - - std::string toString(void) const - { - oss_t oss; - - oss << "increase(" << from; - - if(hasEnd) - { - oss << " ," << to; - } - - oss << ")"; - - return oss.str(); - } - - const std::type_info& type() const - { - return typeid(T); - } - -private: - - void checkEnd() - { - if(!hasEnd) - { - return; - } - oss_t oss; - oss << "Returned value has increased to specified end value" - << "(" << to << ")"; - MOCKCPP_ASSERT_TRUE_MESSAGE( - oss.str(), - current <= to); - } - -private: - - Any value; - - bool hasEnd; - - T current; - T from; - T to; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IndexInvokableGetter.h b/cli/test/include/mockcpp/IndexInvokableGetter.h deleted file mode 100644 index 3272d16..0000000 --- a/cli/test/include/mockcpp/IndexInvokableGetter.h +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INDEX_INVOKABLE_GETTER_H -#define __MOCKCPP_INDEX_INVOKABLE_GETTER_H - -#include - -MOCKCPP_NS_START - -struct Invokable; - -struct IndexInvokableGetter -{ - virtual Invokable* getInvokable(unsigned int indexOfVtbl, \ - unsigned int indexOfVptr = 0) const = 0; - - virtual ~IndexInvokableGetter() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InterfaceInfo.h b/cli/test/include/mockcpp/InterfaceInfo.h deleted file mode 100644 index 08e53da..0000000 --- a/cli/test/include/mockcpp/InterfaceInfo.h +++ /dev/null @@ -1,39 +0,0 @@ - -#ifndef __MOCKCPP_INTERFACE_INFO_H_ -#define __MOCKCPP_INTERFACE_INFO_H_ - -#if defined(__GNUC__) -#include -#endif - -#include - -MOCKCPP_NS_START - -#if defined(__GNUC__) - -////////////////////////////////////////////////////// -unsigned int -getNumberOfBaseClasses(const std::type_info& info); - -////////////////////////////////////////////////////// -template -unsigned int getNumberOfVtbls() -{ - return getNumberOfBaseClasses(typeid(Interface)); -} - -#else - -template -unsigned int getNumberOfVtbls() -{ - return sizeof(Interface)/sizeof(void*); -} - -#endif - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Invocation.h b/cli/test/include/mockcpp/Invocation.h deleted file mode 100644 index 96598f8..0000000 --- a/cli/test/include/mockcpp/Invocation.h +++ /dev/null @@ -1,73 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_H -#define __MOCKCPP_INVOCATION_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct Stub; -struct InvocationImpl; - -struct Invocation -{ - Invocation(const std::string nameOfCaller - , const RefAny& pThisPointer = RefAny() - , const RefAny& p01 = RefAny() - , const RefAny& p02 = RefAny() - , const RefAny& p03 = RefAny() - , const RefAny& p04 = RefAny() - , const RefAny& p05 = RefAny() - , const RefAny& p06 = RefAny() - , const RefAny& p07 = RefAny() - , const RefAny& p08 = RefAny() - , const RefAny& p09 = RefAny() - , const RefAny& p10 = RefAny() - , const RefAny& p11 = RefAny() - , const RefAny& p12 = RefAny() - ); - - virtual ~Invocation(); - - RefAny& getThisPointer(void) const; - - // i is beginning with 1 - RefAny& getParameter(const unsigned int i) const; - - // return in follow order: - // 'this' pointer(if it is exist), p1, p2, p3, p4 ... pN - RefAny& getParameterWithThis(const unsigned int i) const; - - std::string getNameOfCaller() const; - - std::string toString(void) const; - -private: - InvocationImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationId.h b/cli/test/include/mockcpp/InvocationId.h deleted file mode 100644 index bd44c78..0000000 --- a/cli/test/include/mockcpp/InvocationId.h +++ /dev/null @@ -1,41 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_ID_H -#define __MOCKCPP_INVOCATION_ID_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationId -{ - InvocationId(const std::string& identity); - std::string getId(void) const; - std::string toString(void) const; - -private: - std::string id; -}; - -MOCKCPP_NS_END - -#endif - - diff --git a/cli/test/include/mockcpp/InvocationMockBuilder.h b/cli/test/include/mockcpp/InvocationMockBuilder.h deleted file mode 100644 index cf60bce..0000000 --- a/cli/test/include/mockcpp/InvocationMockBuilder.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_MOCK_BUILDER_H -#define __MOCKCPP_INVOCATION_MOCK_BUILDER_H - -#include -#include - -MOCKCPP_NS_START - -struct Matcher; -struct InvocationMocker; - -template -struct InvocationMockBuilder : public Builder -{ - InvocationMockBuilder(InvocationMocker* mocker); - -private: - virtual InvocationMocker* getMocker() const; - -private: - InvocationMocker* invocationMocker; -}; - -MOCKCPP_NS_END - -#include - -#endif - diff --git a/cli/test/include/mockcpp/InvocationMockBuilder.tcc b/cli/test/include/mockcpp/InvocationMockBuilder.tcc deleted file mode 100644 index cea53c3..0000000 --- a/cli/test/include/mockcpp/InvocationMockBuilder.tcc +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include - -MOCKCPP_NS_START - -////////////////////////////////////////////////////// -template -InvocationMockBuilder::InvocationMockBuilder(InvocationMocker* mocker) - : invocationMocker(mocker) -{ -} - -////////////////////////////////////////////////////// -template -InvocationMocker* InvocationMockBuilder::getMocker() const -{ - return invocationMocker; -} - -MOCKCPP_NS_END - - diff --git a/cli/test/include/mockcpp/InvocationMockBuilderGetter.h b/cli/test/include/mockcpp/InvocationMockBuilderGetter.h deleted file mode 100644 index 70a0900..0000000 --- a/cli/test/include/mockcpp/InvocationMockBuilderGetter.h +++ /dev/null @@ -1,59 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_MOCK_BUILDER_GETTER_H -#define __MOCKCPP_INVOCATION_MOCK_BUILDER_GETTER_H - -#include - -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -struct Matcher; -struct InvocationMockerContainer; -struct Method; - -/////////////////////////////////////////////// -struct InvocationMockBuilderGetter -{ - InvocationMockBuilderGetter( - InvocationMockerContainer* container, Method* method, const void* addr); - ~InvocationMockBuilderGetter(); - - StubsBuilder stubs(); - MockBuilder expects(Matcher* matcher); - MockBuilder times(unsigned int n); // same as expects(exactly(n)) - DefaultBuilder defaults(); - InvocationMockBuilderGetter &reset(); - -private: - InvocationMockerContainer* invocationMockerContainer; - Method* method; - const void* addr; -}; - -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationMocker.h b/cli/test/include/mockcpp/InvocationMocker.h deleted file mode 100644 index 1e174f4..0000000 --- a/cli/test/include/mockcpp/InvocationMocker.h +++ /dev/null @@ -1,63 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_MOCKER_H -#define __MOCKCPP_INVOCATION_MOCKER_H - -#include - -#include - -MOCKCPP_NS_START - -struct Method; -struct Matcher; -struct Stub; -struct InvocationMockerImpl; -struct Invocation; -struct InvocationId; -struct Any; - -struct InvocationMocker : public SelfDescribe -{ - InvocationMocker(Method* core); - ~InvocationMocker(); - - Method* getMethod() const; - void addStub(Stub* stub); - void addMatcher(Matcher* matcher); - bool hasBeenInvoked(void) const ; - - void setId(InvocationId* id); - const InvocationId* const getId(void) const; - - bool matches(const Invocation& inv) const; - Any& invoke(const Invocation& inv); - - void verify(); - - std::string toString() const; - -private: - InvocationMockerImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationMockerContainer.h b/cli/test/include/mockcpp/InvocationMockerContainer.h deleted file mode 100644 index df5fc3f..0000000 --- a/cli/test/include/mockcpp/InvocationMockerContainer.h +++ /dev/null @@ -1,44 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_INVOCATION_MOCKER_CONTAINER_H -#define __MOCKPP_INVOCATION_MOCKER_CONTAINER_H - -#include - -#include - -MOCKCPP_NS_START - -struct InvocationMocker; - -struct InvocationMockerContainer -{ - virtual void addInvocationMocker(InvocationMocker* mocker) = 0; - virtual void addDefaultInvocationMocker(InvocationMocker* mocker) = 0; - virtual InvocationMocker* getInvocationMocker(const std::string& id) = 0; - - virtual ~InvocationMockerContainer() {} -}; - - -MOCKCPP_NS_END - - -#endif - diff --git a/cli/test/include/mockcpp/InvocationMockerNamespace.h b/cli/test/include/mockcpp/InvocationMockerNamespace.h deleted file mode 100644 index ef57ad6..0000000 --- a/cli/test/include/mockcpp/InvocationMockerNamespace.h +++ /dev/null @@ -1,41 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_MOCKER_NAMESPACE_H -#define __MOCKCPP_INVOCATION_MOCKER_NAMESPACE_H - -#include - -#include - -MOCKCPP_NS_START - -struct InvocationMocker; - -struct InvocationMockerNamespace - : public ObjectNameGetter -{ - virtual InvocationMocker* getInvocationMocker(const std::string& id) const = 0; - - virtual ~InvocationMockerNamespace() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationMockerSet.h b/cli/test/include/mockcpp/InvocationMockerSet.h deleted file mode 100644 index 7b2f68b..0000000 --- a/cli/test/include/mockcpp/InvocationMockerSet.h +++ /dev/null @@ -1,61 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_MOCKER_SET_H -#define __MOCKCPP_INVOCATION_MOCKER_SET_H - -#include - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Invocation; -struct SelfDescribe; -struct Any; - -////////////////////////////////////////////////////////// -struct InvocationMockerSet -{ -private: - typedef std::list List; - typedef List::iterator Iterator; - typedef List::const_iterator ConstIterator; - -public: - InvocationMocker* getInvocationMocker(const std::string& id) const; - void addInvocationMocker(InvocationMocker* mocker); - - void reset(); - void verify(); - - const Any& invoke(const Invocation& inv, SelfDescribe* &resultProvider); - - std::string toString() const; - -private: - - List mockers; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationTimesMatcher.h b/cli/test/include/mockcpp/InvocationTimesMatcher.h deleted file mode 100644 index cb17018..0000000 --- a/cli/test/include/mockcpp/InvocationTimesMatcher.h +++ /dev/null @@ -1,51 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_TIMES_MATCHER_H -#define __MOCKCPP_INVOCATION_TIMES_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedTimesReader; -struct Invocation; - -struct InvocationTimesMatcher : public Matcher -{ - InvocationTimesMatcher(); - ~InvocationTimesMatcher(); - - void increaseInvoked(const Invocation& inv); - - void setInvokedTimesReader(InvokedTimesReader* recorder); - -protected: - - unsigned int getInvokedTimes() const; - -private: - - InvokedTimesReader* invokedTimesReader; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvocationWithReturnType.h b/cli/test/include/mockcpp/InvocationWithReturnType.h deleted file mode 100644 index 1c81037..0000000 --- a/cli/test/include/mockcpp/InvocationWithReturnType.h +++ /dev/null @@ -1,52 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOCATION_WITH_RETURN_TYPE_H -#define __MOCKCPP_INVOCATION_WITH_RETURN_TYPE_H - -#include - -#include - -MOCKCPP_NS_START - -template -struct InvocationWithReturnType : public Invocation -{ - InvocationWithReturnType( - const RefAny& p1 = RefAny() - , const RefAny& p2 = RefAny() - , const RefAny& p3 = RefAny() - , const RefAny& p4 = RefAny() - , const RefAny& p5 = RefAny() - , const RefAny& p6 = RefAny()) - : Invocation(p1, p2, p3, p4, p5, p6) - {} - - std::string toString(void) const; - - bool matches(Stub* stub) const - { - return stub->type() == typeid(RT); - } -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Invokable.h b/cli/test/include/mockcpp/Invokable.h deleted file mode 100644 index 92b65bf..0000000 --- a/cli/test/include/mockcpp/Invokable.h +++ /dev/null @@ -1,65 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKABLE_H -#define __MOCKCPP_INVOKABLE_H - -#include - -#include -#include - -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -struct SelfDescribe; - -/////////////////////////////////////////////// -struct Invokable -{ - // isMemberMethod used to sign the callee function is a C++ member method, - // if isMemberMethod is true, p01 is 'this' pointer - virtual const Any& - invoke( const std::string& nameOfCaller - , const RefAny& pThisPointer - , const RefAny& p1 - , const RefAny& p2 - , const RefAny& p3 - , const RefAny& p4 - , const RefAny& p5 - , const RefAny& p6 - , const RefAny& p7 - , const RefAny& p8 - , const RefAny& p9 - , const RefAny& p10 - , const RefAny& p11 - , const RefAny& p12 - , SelfDescribe* &resultProvider) = 0; - - - virtual ~Invokable() {} -}; - -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedAtLeast.h b/cli/test/include/mockcpp/InvokedAtLeast.h deleted file mode 100644 index e29700c..0000000 --- a/cli/test/include/mockcpp/InvokedAtLeast.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_ATLEAST_H -#define __MOCKCPP_INVOKED_ATLEAST_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedAtLeast : public InvocationTimesMatcher -{ - InvokedAtLeast(const unsigned int times); - - bool matches(const Invocation& inv) const; - - void verify(void); - - std::string toString() const; - -private: - - unsigned int lowLimit; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedAtMost.h b/cli/test/include/mockcpp/InvokedAtMost.h deleted file mode 100644 index f118c94..0000000 --- a/cli/test/include/mockcpp/InvokedAtMost.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_ATMOST_H -#define __MOCKCPP_INVOKED_ATMOST_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedAtMost - : public InvocationTimesMatcher -{ - InvokedAtMost(const unsigned int times); - - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - - void verify(void); - - std::string toString(void) const; - -private: - - unsigned int highLimit; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedExactly.h b/cli/test/include/mockcpp/InvokedExactly.h deleted file mode 100644 index dc5ed0f..0000000 --- a/cli/test/include/mockcpp/InvokedExactly.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_EXACTLY_H -#define __MOCKCPP_INVOKED_EXACTLY_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedExactly : public InvocationTimesMatcher -{ - InvokedExactly(const unsigned int times); - - bool matches(const Invocation& inv) const; - - void verify(void); - - std::string toString(void) const; - -private: - - unsigned int expectedInvokedTimes; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedOnce.h b/cli/test/include/mockcpp/InvokedOnce.h deleted file mode 100644 index c277eb3..0000000 --- a/cli/test/include/mockcpp/InvokedOnce.h +++ /dev/null @@ -1,42 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_ONCE_H -#define __MOCKCPP_INVOKED_ONCE_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedOnce : public InvocationTimesMatcher -{ - InvokedOnce(); - - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - - void verify(void); - - std::string toString(void) const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedTimesMatcher.h b/cli/test/include/mockcpp/InvokedTimesMatcher.h deleted file mode 100644 index be8ef16..0000000 --- a/cli/test/include/mockcpp/InvokedTimesMatcher.h +++ /dev/null @@ -1,52 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_TIMES_MATCHER_H -#define __MOCKCPP_INVOKED_TIMES_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedTimesRecorder; -struct Invocation; - -struct InvokedTimesMatcher : public Matcher -{ - InvokedTimesMatcher(InvokedTimesRecorder* recorder); - - ~InvokedTimesMatcher(); - - bool matches(const Invocation& inv) const; - - void increaseInvoked(const Invocation& inv); - - std::string toString(void) const; - - void verify(); - -private: - - InvokedTimesRecorder* invokedTimesRecorder; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedTimesReader.h b/cli/test/include/mockcpp/InvokedTimesReader.h deleted file mode 100644 index 0818f60..0000000 --- a/cli/test/include/mockcpp/InvokedTimesReader.h +++ /dev/null @@ -1,36 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_TIMES_READER_H -#define __MOCKCPP_INVOKED_TIMES_READER_H - -#include - -MOCKCPP_NS_START - -struct InvokedTimesReader -{ - virtual ~InvokedTimesReader() {} - - virtual unsigned int getInvokedTimes() const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/InvokedTimesRecorder.h b/cli/test/include/mockcpp/InvokedTimesRecorder.h deleted file mode 100644 index 7325ca6..0000000 --- a/cli/test/include/mockcpp/InvokedTimesRecorder.h +++ /dev/null @@ -1,36 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_INVOKED_TIMES_RECORDER_H -#define __MOCKCPP_INVOKED_TIMES_RECORDER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvokedTimesRecorder : public InvokedTimesReader -{ - virtual ~InvokedTimesRecorder() {} - virtual void increaseInvoked() = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsAnything.h b/cli/test/include/mockcpp/IsAnything.h deleted file mode 100644 index d4f3146..0000000 --- a/cli/test/include/mockcpp/IsAnything.h +++ /dev/null @@ -1,42 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_ANYTHING_H -#define __MOCKCPP_IS_ANYTHING_H - -#include -#include - -MOCKCPP_NS_START - -struct IsAnything : public TypelessConstraint -{ - virtual bool eval(void) const - { return true; } - - virtual std::string toString() const - { - return std::string("any()"); - } -}; - - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsAnythingHelper.h b/cli/test/include/mockcpp/IsAnythingHelper.h deleted file mode 100644 index 80929d5..0000000 --- a/cli/test/include/mockcpp/IsAnythingHelper.h +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_ANYTHING_HELPER_H -#define __MOCKCPP_IS_ANYTHING_HELPER_H - -#include - -MOCKCPP_NS_START - -struct Constraint; - -Constraint* any(); - -static const Constraint* _ = 0; - -bool isAnyConstraint(Constraint* c); - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsConst.h b/cli/test/include/mockcpp/IsConst.h deleted file mode 100644 index d7478d4..0000000 --- a/cli/test/include/mockcpp/IsConst.h +++ /dev/null @@ -1,49 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef MOCKCPP_IS_CONST_H -#define MOCKCPP_IS_CONST_H - -#include - -MOCKCPP_NS_START - -///////////////////////////////////// -template -struct IsConst -{ - static const bool isTrue = false; -}; - -template -struct IsConst -{ - static const bool isTrue = true; -}; - -template -struct IsConst -{ - static const bool isTrue = true; -}; - -MOCKCPP_NS_END - - -#endif - diff --git a/cli/test/include/mockcpp/IsEqual.h b/cli/test/include/mockcpp/IsEqual.h deleted file mode 100644 index 694e51c..0000000 --- a/cli/test/include/mockcpp/IsEqual.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_EQUAL_H -#define __MOCKCPP_IS_EQUAL_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct IsEqual : public Constraint -{ - IsEqual(const T& expected) - : expectedValue(expected) - {} - - ~IsEqual() {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - return any_cast(val) == expectedValue; - } - - std::string toString() const - { - return std::string("eq(") + - MOCKCPP_NS::toTypeAndValueString(expectedValue) + - std::string(")"); - } - -private: - - T expectedValue; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsGreaterThan.h b/cli/test/include/mockcpp/IsGreaterThan.h deleted file mode 100644 index c1784bc..0000000 --- a/cli/test/include/mockcpp/IsGreaterThan.h +++ /dev/null @@ -1,59 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_GREATER_THAN_H -#define __MOCKCPP_IS_GREATER_THAN_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct IsGreaterThan : public Constraint -{ -public: - IsGreaterThan(const T& expected) - : expectedValue(expected) - {} - - ~IsGreaterThan() {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - return any_cast(val) > expectedValue; - } - - std::string toString() const - { - return std::string("gt(") + - MOCKCPP_NS::toTypeAndValueString(expectedValue) + - std::string(")"); - } - -private: - - T expectedValue; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsLessThan.h b/cli/test/include/mockcpp/IsLessThan.h deleted file mode 100644 index beb9e6c..0000000 --- a/cli/test/include/mockcpp/IsLessThan.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_LESS_THAN_H -#define __MOCKCPP_IS_LESS_THAN_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct IsLessThan : public Constraint -{ - IsLessThan(const T& expected) - : expectedValue(expected) - {} - - ~IsLessThan() {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - return any_cast(val) < expectedValue; - } - - std::string toString() const - { - return std::string("lt(") + - MOCKCPP_NS::toTypeAndValueString(expectedValue) + - std::string(")"); - } - -private: - - T expectedValue; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsMirror.h b/cli/test/include/mockcpp/IsMirror.h deleted file mode 100644 index d8e7d06..0000000 --- a/cli/test/include/mockcpp/IsMirror.h +++ /dev/null @@ -1,181 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_MIRROR_H -#define __MOCKCPP_IS_MIRROR_H - -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////// -template -struct IsMirrorBase -{ -}; - -/////////////////////////////////////////////////////// -template -struct IsMirrorBase: public Constraint -{ -public: - - IsMirrorBase(T* p, size_t size) - : pointer(0), sizeOfBuffer(size) - { - if (size != 0) - { - pointer = (T*)(new char [sizeOfBuffer+1]); - ::memset((void*)pointer, 0, sizeOfBuffer+1); - ::memcpy((void*)pointer, (void*)p, sizeOfBuffer); - } - } - - ~IsMirrorBase() - { - if (pointer != 0) - { - delete [] (char*)pointer; - } - } - - bool eval(const RefAny& val) const - { - if (!any_castable(val)) - { - return false; - } - - T* p = any_cast(val); - if (p == 0) - { - return false; - } - - return !memcmp((void*)p, (void*)pointer, sizeOfBuffer); - } - - std::string toString() const - { - oss_t oss; - - oss << "mirror(" - << MOCKCPP_NS::toTypeAndValueString(pointer) - << ", " << sizeOfBuffer - << ")"; - - return oss.str(); - } - -private: - - T* pointer; - - size_t sizeOfBuffer; -}; - -////////////////////////////////////////////////////////////////////// -template -struct IsMirror : public Constraint -{ - -#if defined(__GNUC__) && (__GNUC__ > 3) -public: - - IsMirror(const T& obj) - : object(obj) - { - } - - bool eval(const RefAny& val) const - { - if (!any_castable(val)) - { - return false; - } - - T p = any_cast(val); - return !memcmp((void*)&p, (void*)&object, sizeof(object)); - } - - std::string toString(void) const - { - oss_t oss; - - oss << "mirror(" - << MOCKCPP_NS::toTypeAndValueString(object) - << ")"; - - return oss.str(); - } - -private: - - T object; -#endif - -}; - -////////////////////////////////////////////////////////////////////// -template -struct IsMirror : public IsMirrorBase -{ -public: - - IsMirror(T* p, size_t size = 0) - : IsMirrorBase(p, size == 0 ? sizeof(T) : size) - { - } -}; - -////////////////////////////////////////////////////////////////////// -template <> -struct IsMirror : public IsMirrorBase -{ -public: - - IsMirror(void* p, size_t size) - : IsMirrorBase(p, size) - { - MOCKCPP_ASSERT_TRUE_MESSAGE( - "parameter \"size\" of IsMirror cannot be specified as 0", - size > 0); - } -}; - -////////////////////////////////////////////////////////////////////// -template <> -struct IsMirror : public IsMirrorBase -{ -public: - - IsMirror(const void* p, size_t size) - : IsMirrorBase(p, size) - { - MOCKCPP_ASSERT_TRUE_MESSAGE( - "parameter \"size\" of IsMirror cannot be specified as 0", - size > 0); - } -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsNotEqual.h b/cli/test/include/mockcpp/IsNotEqual.h deleted file mode 100644 index f5fb1f0..0000000 --- a/cli/test/include/mockcpp/IsNotEqual.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_NOT_EQUAL_H -#define __MOCKCPP_IS_NOT_EQUAL_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct IsNotEqual : public Constraint -{ - IsNotEqual(const T& expected) - : expectedValue(expected) - {} - - ~IsNotEqual() {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - return !(any_cast(val) == expectedValue); - } - - std::string toString() const - { - return std::string("neq(") + - MOCKCPP_NS::toTypeAndValueString(expectedValue) + - std::string(")"); - } - -private: - - T expectedValue; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsRef.h b/cli/test/include/mockcpp/IsRef.h deleted file mode 100644 index a1c6223..0000000 --- a/cli/test/include/mockcpp/IsRef.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef MOCKCPP_IS_REF_H -#define MOCKCPP_IS_REF_H - -#include - -MOCKCPP_NS_START - -////////////////////////////////////////// -template -struct IsRef -{ - static const bool isTrue = false; - static const bool outBoundable = false; -}; - -////////////////////////////////////////// -template -struct IsRef -{ - static const bool isTrue = true; - static const bool outBoundable = true; -}; - -////////////////////////////////////////// -template -struct IsRef -{ - static const bool isTrue = true; - static const bool outBoundable = false; -}; - -////////////////////////////////////////// - -MOCKCPP_NS_END - - -#endif - diff --git a/cli/test/include/mockcpp/IsStringContains.h b/cli/test/include/mockcpp/IsStringContains.h deleted file mode 100644 index d937b36..0000000 --- a/cli/test/include/mockcpp/IsStringContains.h +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_STRING_CONTAINS_H -#define __MOCKCPP_IS_STRING_CONTAINS_H - -#include - -#include - -MOCKCPP_NS_START - -struct IsStringContains : public StringPredict -{ - bool predict(const std::string& input, const std::string& target) const; - std::string toString(const std::string& target) const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsStringEndWith.h b/cli/test/include/mockcpp/IsStringEndWith.h deleted file mode 100644 index e75262f..0000000 --- a/cli/test/include/mockcpp/IsStringEndWith.h +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_STRING_END_WITH_H -#define __MOCKCPP_IS_STRING_END_WITH_H - -#include - -#include - -MOCKCPP_NS_START - -struct IsStringEndWith : public StringPredict -{ - bool predict(const std::string& input, const std::string& target) const; - std::string toString(const std::string& target) const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/IsStringStartWith.h b/cli/test/include/mockcpp/IsStringStartWith.h deleted file mode 100644 index 1325e9e..0000000 --- a/cli/test/include/mockcpp/IsStringStartWith.h +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_IS_STRING_START_WITH_H -#define __MOCKCPP_IS_STRING_START_WITH_H - -#include - -#include - -MOCKCPP_NS_START - -struct IsStringStartWith : public StringPredict -{ - bool predict(const std::string& input, const std::string& target) const; - std::string toString(const std::string& target) const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/JmpCode.h b/cli/test/include/mockcpp/JmpCode.h deleted file mode 100644 index 93164da..0000000 --- a/cli/test/include/mockcpp/JmpCode.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_JMP_CODE_H__ -#define __MOCKCPP_JMP_CODE_H__ - -#include - -#include - -MOCKCPP_NS_START - -struct JmpCodeImpl; - -struct JmpCode -{ - JmpCode(const void* from, const void* to); - ~JmpCode(); - - void* getCodeData() const; - size_t getCodeSize() const; - void flushCache() const; -private: - JmpCodeImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Matcher.h b/cli/test/include/mockcpp/Matcher.h deleted file mode 100644 index 501b226..0000000 --- a/cli/test/include/mockcpp/Matcher.h +++ /dev/null @@ -1,42 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MATCHER_H -#define __MOCKCPP_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct Invocation; - -struct Matcher -{ - virtual bool matches(const Invocation& inv) const = 0; - virtual void increaseInvoked(const Invocation& inv) = 0; - virtual void verify() = 0; - virtual std::string toString() const = 0; - - virtual ~Matcher() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Method.h b/cli/test/include/mockcpp/Method.h deleted file mode 100644 index 80ae0d0..0000000 --- a/cli/test/include/mockcpp/Method.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_METHOD_H -#define __MOCKCPP_METHOD_H - -#include - -#include - -#include - -MOCKCPP_NS_START - -struct SelfDescribe; -struct InvocationMockerNamespace; - -///////////////////////////////////////////// -struct Method - : public Invokable -{ - virtual std::string& getName() const = 0; - - virtual InvocationMockerNamespace* getNamespace() const = 0; - - virtual ~Method() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MethodIndiceChecker.h b/cli/test/include/mockcpp/MethodIndiceChecker.h deleted file mode 100644 index 013c3b1..0000000 --- a/cli/test/include/mockcpp/MethodIndiceChecker.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_METHOD_INDICE_CHECKER_H -#define __MOCKCPP_METHOD_INDICE_CHECKER_H - -#include - -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -struct MethodIndiceChecker -{ - virtual void* getObject() const = 0; - - virtual bool getIndice - ( bool objDeleted - , unsigned int& vptrIndex - , unsigned int& vtblIndex) = 0; - - virtual ~MethodIndiceChecker() {} -}; - -/////////////////////////////////////////////// -MethodIndiceChecker* -createMethodIndiceChecker(const std::type_info& info); - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h deleted file mode 100644 index c29005a..0000000 --- a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h +++ /dev/null @@ -1,500 +0,0 @@ -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 0); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 1); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 2); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 3); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 4); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 5); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 6); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 7); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 8); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 9); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 10); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 11); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 12); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 13); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 14); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 15); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 16); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 17); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 18); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 19); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 20); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 21); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 22); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 23); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 24); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 25); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 26); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 27); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 28); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 29); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 30); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 31); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 32); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 33); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 34); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 35); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 36); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 37); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 38); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 39); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 40); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 41); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 42); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 43); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 44); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 45); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 46); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 47); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 48); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 49); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 50); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 51); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 52); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 53); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 54); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 55); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 56); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 57); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 58); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 59); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 60); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 61); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 62); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 63); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 64); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 65); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 66); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 67); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 68); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 69); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 70); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 71); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 72); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 73); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 74); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 75); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 76); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 77); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 78); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 79); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 80); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 81); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 82); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 83); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 84); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 85); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 86); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 87); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 88); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 89); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 90); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 91); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 92); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 93); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 94); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 95); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 96); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 97); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 98); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(0, 99); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 0); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 1); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 2); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 3); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 4); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 5); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 6); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 7); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 8); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 9); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 10); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 11); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 12); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 13); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 14); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 15); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 16); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 17); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 18); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 19); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 20); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 21); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 22); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 23); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 24); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 25); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 26); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 27); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 28); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 29); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 30); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 31); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 32); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 33); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 34); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 35); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 36); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 37); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 38); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 39); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 40); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 41); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 42); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 43); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 44); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 45); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 46); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 47); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 48); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 49); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 50); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 51); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 52); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 53); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 54); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 55); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 56); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 57); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 58); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 59); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 60); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 61); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 62); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 63); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 64); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 65); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 66); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 67); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 68); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 69); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 70); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 71); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 72); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 73); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 74); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 75); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 76); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 77); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 78); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 79); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 80); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 81); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 82); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 83); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 84); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 85); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 86); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 87); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 88); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 89); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 90); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 91); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 92); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 93); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 94); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 95); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 96); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 97); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 98); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(1, 99); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 0); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 1); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 2); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 3); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 4); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 5); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 6); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 7); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 8); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 9); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 10); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 11); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 12); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 13); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 14); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 15); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 16); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 17); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 18); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 19); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 20); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 21); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 22); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 23); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 24); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 25); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 26); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 27); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 28); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 29); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 30); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 31); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 32); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 33); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 34); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 35); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 36); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 37); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 38); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 39); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 40); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 41); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 42); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 43); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 44); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 45); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 46); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 47); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 48); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 49); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 50); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 51); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 52); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 53); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 54); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 55); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 56); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 57); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 58); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 59); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 60); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 61); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 62); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 63); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 64); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 65); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 66); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 67); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 68); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 69); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 70); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 71); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 72); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 73); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 74); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 75); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 76); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 77); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 78); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 79); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 80); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 81); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 82); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 83); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 84); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 85); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 86); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 87); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 88); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 89); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 90); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 91); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 92); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 93); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 94); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 95); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 96); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 97); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 98); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(2, 99); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 0); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 1); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 2); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 3); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 4); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 5); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 6); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 7); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 8); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 9); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 10); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 11); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 12); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 13); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 14); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 15); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 16); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 17); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 18); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 19); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 20); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 21); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 22); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 23); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 24); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 25); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 26); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 27); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 28); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 29); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 30); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 31); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 32); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 33); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 34); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 35); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 36); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 37); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 38); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 39); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 40); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 41); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 42); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 43); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 44); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 45); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 46); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 47); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 48); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 49); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 50); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 51); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 52); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 53); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 54); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 55); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 56); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 57); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 58); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 59); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 60); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 61); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 62); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 63); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 64); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 65); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 66); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 67); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 68); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 69); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 70); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 71); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 72); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 73); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 74); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 75); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 76); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 77); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 78); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 79); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 80); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 81); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 82); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 83); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 84); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 85); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 86); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 87); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 88); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 89); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 90); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 91); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 92); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 93); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 94); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 95); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 96); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 97); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 98); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(3, 99); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 0); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 1); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 2); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 3); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 4); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 5); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 6); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 7); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 8); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 9); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 10); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 11); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 12); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 13); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 14); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 15); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 16); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 17); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 18); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 19); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 20); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 21); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 22); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 23); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 24); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 25); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 26); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 27); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 28); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 29); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 30); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 31); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 32); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 33); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 34); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 35); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 36); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 37); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 38); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 39); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 40); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 41); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 42); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 43); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 44); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 45); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 46); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 47); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 48); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 49); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 50); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 51); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 52); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 53); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 54); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 55); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 56); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 57); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 58); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 59); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 60); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 61); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 62); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 63); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 64); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 65); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 66); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 67); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 68); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 69); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 70); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 71); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 72); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 73); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 74); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 75); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 76); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 77); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 78); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 79); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 80); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 81); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 82); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 83); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 84); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 85); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 86); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 87); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 88); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 89); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 90); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 91); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 92); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 93); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 94); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 95); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 96); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 97); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 98); -MOCKCPP_SET_METHOD_INDICE_CHECKER_VTBL(4, 99); diff --git a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule b/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/MethodIndiceCheckerDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/MethodInfoReader.h b/cli/test/include/mockcpp/MethodInfoReader.h deleted file mode 100644 index 168b936..0000000 --- a/cli/test/include/mockcpp/MethodInfoReader.h +++ /dev/null @@ -1,35 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_METHOD_INFO_READER_H -#define __MOCKCPP_METHOD_INFO_READER_H - -#if defined(__GNUC__) -#include -#include -#endif - -#if defined(_MSC_VER) -#include -#endif - -#if !defined(__GNUC__) -#include -#endif - -#endif - diff --git a/cli/test/include/mockcpp/MethodTypeTraits.h b/cli/test/include/mockcpp/MethodTypeTraits.h deleted file mode 100644 index aef4828..0000000 --- a/cli/test/include/mockcpp/MethodTypeTraits.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_METHOD_TYPE_TRAITS_H -#define __MOCKCPP_METHOD_TYPE_TRAITS_H - -#include - -#include -#include - -MOCKCPP_NS_START - -template -struct MethodTypeTraits; - -#define MOCKCPP_METHOD_TYPE_TRAITS_DEF(n) \ -template \ -struct MethodTypeTraits \ -{ \ - typedef C1 OrignalClass; \ - typedef R (C::*MethodType)(DECL_ARGS(n)); \ - \ - typedef ArgumentsList MethodArgumentsList; \ -} - -#define MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(n) \ -template \ -struct MethodTypeTraits \ -{ \ - typedef C1 OrignalClass; \ - typedef R (C::*MethodType)(DECL_ARGS(n)) const; \ - \ - typedef ArgumentsListConst MethodArgumentsList; \ -} - -#include - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/MethodTypeTraitsDef.h b/cli/test/include/mockcpp/MethodTypeTraitsDef.h deleted file mode 100644 index 1c46b0d..0000000 --- a/cli/test/include/mockcpp/MethodTypeTraitsDef.h +++ /dev/null @@ -1,26 +0,0 @@ -MOCKCPP_METHOD_TYPE_TRAITS_DEF(0); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(0); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(1); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(1); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(2); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(2); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(3); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(3); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(4); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(4); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(5); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(5); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(6); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(6); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(7); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(7); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(8); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(8); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(9); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(9); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(10); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(10); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(11); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(11); -MOCKCPP_METHOD_TYPE_TRAITS_DEF(12); -MOCKCPP_CONST_METHOD_TYPE_TRAITS_DEF(12); diff --git a/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule b/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule deleted file mode 100644 index 4bbe599..0000000 --- a/cli/test/include/mockcpp/MethodTypeTraitsDef.h.rule +++ /dev/null @@ -1 +0,0 @@ -Artificial dependency for a custom command. diff --git a/cli/test/include/mockcpp/MismatchResultHandler.h b/cli/test/include/mockcpp/MismatchResultHandler.h deleted file mode 100644 index b98e8fc..0000000 --- a/cli/test/include/mockcpp/MismatchResultHandler.h +++ /dev/null @@ -1,51 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MISMATCH_RESULT_HANDLER_H -#define __MOCKCPP_MISMATCH_RESULT_HANDLER_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct SelfDescribe; - -struct MismatchResultHandler: public ResultHandler -{ - MismatchResultHandler( bool castable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* resultProvider); - - bool matches(const Any& result) const; - - const Any& getResult(const Any& result) const; - -private: - const bool isCastable; - const std::type_info& expectedTypeInfo; - const std::string expectedTypeString; - const SelfDescribe* resultProvider; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MismatchResultHandlerFactory.h b/cli/test/include/mockcpp/MismatchResultHandlerFactory.h deleted file mode 100644 index 1aaa140..0000000 --- a/cli/test/include/mockcpp/MismatchResultHandlerFactory.h +++ /dev/null @@ -1,43 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MISMATCH_RESULT_HANDLER_FACTORY_H -#define __MOCKCPP_MISMATCH_RESULT_HANDLER_FACTORY_H - -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////////// -struct MismatchResultHandlerFactory - : public ResultHandlerFactory -{ - ResultHandler* create( - bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber); -}; - -/////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MockBuilder.h b/cli/test/include/mockcpp/MockBuilder.h deleted file mode 100644 index d6bcd6e..0000000 --- a/cli/test/include/mockcpp/MockBuilder.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOCK_BUILDER_H -#define __MOCKCPP_MOCK_BUILDER_H - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -typedef InvocationMockBuilder< - CallerMatchBuilder< - BeforeMatchBuilder< - ArgumentsMatchBuilder< - AfterMatchBuilder< - StubBuilder< - MoreStubBuilder< - IdentityBuilder - > - > - > - > - > - > - > MockBuilder; -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MockObject.h b/cli/test/include/mockcpp/MockObject.h deleted file mode 100644 index cbf4956..0000000 --- a/cli/test/include/mockcpp/MockObject.h +++ /dev/null @@ -1,181 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOCK_OBJECT_H -#define __MOCKCPP_MOCK_OBJECT_H - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -//////////////////////////////////////////////////////////////// -template -struct MockObject : public MockObjectBase -{ - typedef Interface MockedInterface; - - ///////////////////////////////////////////////////////////// - MockObject() - : MockObjectBase(TypeString::value() - , getNumberOfVtbls() - , typeid(Interface)) - { - identifyDestructor(); - } - - ///////////////////////////////////////////////////////////// - MockObject(const MockObject& obj) - : MockObjectBase(obj) - { - } - - MockObject& getObject() - { - return *this; - } - - Interface* getInterface() - { - return (Interface*)toPointerToInterface(); - } - - ///////////////////////////////////////////////////////////// - operator Interface* () - { - return (Interface*)toPointerToInterface(); - } - - ///////////////////////////////////////////////////////////// - Interface* operator->() - { - return (Interface*)toPointerToInterface(); - } - - ///////////////////////////////////////////////////////////// - template - void mightBeUsedAs() - { - TargetInterface* target = \ - dynamic_cast - ((Interface*)toPointerToInterface()); - if(target == 0) - { - oss_t oss; - oss << TypeString::value() - << " can not be used as " - << TypeString::value() - << "."; - - MOCKCPP_REPORT_FAILURE(oss.str()); - } - - identifyDestructor(); - } - - ///////////////////////////////////////////////////////////// - void willBeDeleted() - { - expectsBeingDeleted(); - } - - ///////////////////////////////////////////////////////////// - void willKeepAlive() - { - expectsKeepAlive(); - } - - void verify() - { - try - { - MockObjectBase::verify(); - } - catch(...) - { - __RUN_NOTHROW({ - reset(); - }); - throw; - } - - __RUN_THROW({ - reset(); - }); - } - - void reset() - { - MockObjectBase::reset(); - identifyDestructor(); - } - ///////////////////////////////////////////////////////////// - template - InvocationMockBuilderGetter method(Method m, const char* name = 0) - { - std::string methodName(name == 0 ? \ - TypeString::value():name); - - std::pair indices = \ - getIndicesOfMethod(m); - - void * addr = getDelegatedFunction( \ - indices.first, indices.second, m); - - return createInvocationMockerBuilderGetter( \ - methodName, addr, indices.first, indices.second); - } - -//////////////////////////////////////////////////////////////// -private: - - MockObject& operator=(const MockObject&); - -//////////////////////////////////////////////////////////////// -// Template methods: it's ugly, but we have to make them visible. -private: - - template - void identifyDestructor() - { - std::pair indices = \ - getIndexOfDestructor(); - - setDestructor(indices.first, indices.second); - } - - template - void* getAddrOfDelegatedMethod(Method m) - { return getAddrOfMethod(m); } - -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MockObjectBase.h b/cli/test/include/mockcpp/MockObjectBase.h deleted file mode 100644 index b57e6b4..0000000 --- a/cli/test/include/mockcpp/MockObjectBase.h +++ /dev/null @@ -1,72 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOCK_OBJECT_BASE_H -#define __MOCKCPP_MOCK_OBJECT_BASE_H - -#include - -#include -#include -#include - -MOCKCPP_NS_START - -struct MockObjectBaseImpl; - -struct MockObjectBase : public ChainableMockObjectBase -{ - ~MockObjectBase(); - - virtual void reset(); - virtual void verify(); - -protected: - - MockObjectBase( const std::string& objName - , unsigned int numberOfVptr - , const std::type_info& info); - - MockObjectBase(const MockObjectBase&); - -protected: - - InvocationMockBuilderGetter - createInvocationMockerBuilderGetter(const std::string& name, \ - void* addr, unsigned int vptrIndex, unsigned int vtblIndex); - - void* toPointerToInterface() const; - - void setDestructor(unsigned int vptrIndex, unsigned int vtblIndex); - - void expectsBeingDeleted(); - void expectsKeepAlive(); - -private: - - MockObjectBase& operator=(const MockObjectBase&); - -private: - - MockObjectBaseImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/MockObjectHelper.h b/cli/test/include/mockcpp/MockObjectHelper.h deleted file mode 100644 index 0b9dba9..0000000 --- a/cli/test/include/mockcpp/MockObjectHelper.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOCK_OBJECT_HELPER_H__ -#define __MOCKCPP_MOCK_OBJECT_HELPER_H__ - -#include -#include - -#include - -MOCKCPP_NS_START - -template -struct MockObjectTraits -{ - typedef typename MockObjectClass::MockedInterface TYPE; -}; - -MOCKCPP_NS_END - -#define METHOD(m) method(&m, #m) - -#define MOCK_METHOD(obj, m) \ - obj.method(&MOCKCPP_NS::MockObjectTraits::TYPE::m, \ - (MOCKCPP_NS::TypeString< \ - MOCKCPP_NS::MockObjectTraits::TYPE \ - >::value() + "::"#m).c_str()) - -#endif - diff --git a/cli/test/include/mockcpp/MoreStubBuilder.h b/cli/test/include/mockcpp/MoreStubBuilder.h deleted file mode 100644 index 2a72553..0000000 --- a/cli/test/include/mockcpp/MoreStubBuilder.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MORE_STUB_BUILDER_H -#define __MOCKCPP_MORE_STUB_BUILDER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Stub; - -template -struct MoreStubBuilder : public Builder -{ - MoreStubBuilder& then(Stub* stub); - - virtual ~MoreStubBuilder() {} - -private: - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#include - -#endif - - diff --git a/cli/test/include/mockcpp/MoreStubBuilder.tcc b/cli/test/include/mockcpp/MoreStubBuilder.tcc deleted file mode 100644 index 5ae8b45..0000000 --- a/cli/test/include/mockcpp/MoreStubBuilder.tcc +++ /dev/null @@ -1,33 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include - -MOCKCPP_NS_START - -template -MoreStubBuilder& -MoreStubBuilder::then(Stub* stub) -{ - getMocker()->addStub(new ThenStub(stub)); - return *this; -} - -MOCKCPP_NS_END - diff --git a/cli/test/include/mockcpp/MsvcMethodInfoReader.h b/cli/test/include/mockcpp/MsvcMethodInfoReader.h deleted file mode 100644 index 4a7d92d..0000000 --- a/cli/test/include/mockcpp/MsvcMethodInfoReader.h +++ /dev/null @@ -1,85 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_MSVC_METHOD_INFO_READER_H -#define __MOCKCPP_MSVC_METHOD_INFO_READER_H - -#include -#include - -MOCKCPP_NS_START - -#ifdef MSVC_VMG_ENABLED - -struct MsvcVmgMFP -{ - void* m_func_address; - int m_delta; - int m_vtordisp; - int m_vtable_index; -}; - -template -union MsvcMethodUnion -{ - MsvcVmgMFP mfp; - Method method; -}; - -/////////////////////////////////////////////// -template -void* getAddrOfMethod(Method input) -{ - MsvcMethodUnion m; - m.method = input; - return m.mfp.m_func_address; -} - -/////////////////////////////////////////////////////////// - -#else - -// TODO -template -void* getAddrOfMethod(Method input) -{ - MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); - return 0; -} - -/////////////////////////////////////////////////////////// -// TODO -template -unsigned int getIndexOfMethod(Method method) -{ - MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); - return 0; -} - -/////////////////////////////////////////////////////////// -// TODO -template -unsigned int getDeltaOfMethod(Method method) -{ - MOCKCPP_REPORT_FAILURE("please add /D MSVC_VMG_ENABLED and /vmg to your compiler option"); - return 0; -} -#endif - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/MsvcRtti.h b/cli/test/include/mockcpp/MsvcRtti.h deleted file mode 100644 index c94f1ca..0000000 --- a/cli/test/include/mockcpp/MsvcRtti.h +++ /dev/null @@ -1,76 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_MSVC_RTTI_H_ -#define __MOCKCPP_MSVC_RTTI_H_ - -#ifdef _MSC_VER - -#include - -#include - -MOCKCPP_NS_START - -struct PMD -{ - int mdisp; //member displacement - int pdisp; //vbtable displacement - int vdisp; //displacement inside vbtable -}; - -struct RTTIBaseClassDescriptor -{ - std::type_info* typeInfo; //type descriptor of the class - unsigned int numContainedBases; //number of nested classes following in the Base Class Array - PMD where; //pointer-to-member displacement info - unsigned int attributes; //flags, usually 0 -}; - -struct RTTIClassHierarchyDescriptor -{ - unsigned int signature; //always zero? - unsigned int attributes; //bit 0 set = multiple inheritance, bit 1 set = virtual inheritance - unsigned int numBaseClasses; //number of classes in pBaseClassArray - RTTIBaseClassDescriptor** pBaseClassArray; - - RTTIClassHierarchyDescriptor(bool mi = false) - : signature(0),attributes(mi?1:0),numBaseClasses(0), pBaseClassArray(0) - { - } -}; - -struct RTTICompleteObjectLocator -{ - unsigned int signature; //always zero ? - unsigned int offset; //offset of this vtable in the complete class - unsigned int cdOffset; //constructor displacement offset - const std::type_info* typeInfo; //TypeDescriptor of the complete class - RTTIClassHierarchyDescriptor* pClassDescriptor; //describes inheritance hierarchy - - RTTICompleteObjectLocator(unsigned int index, - const std::type_info& info, RTTIClassHierarchyDescriptor* desc) - : signature(0), offset(index*sizeof(void*)), cdOffset(0) - , typeInfo(&info), pClassDescriptor(desc) - {} -}; - -MOCKCPP_NS_END - -#endif - -#endif diff --git a/cli/test/include/mockcpp/NormalResultHandler.h b/cli/test/include/mockcpp/NormalResultHandler.h deleted file mode 100644 index a662bf1..0000000 --- a/cli/test/include/mockcpp/NormalResultHandler.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_NORMAL_RESULT_HANDLER_H -#define __MOCKCPP_NORMAL_RESULT_HANDLER_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; - -struct NormalResultHandler : public ResultHandler -{ - NormalResultHandler(bool castable); - - bool matches(const Any& result) const; - - const Any& getResult(const Any& result) const; - -private: - - const bool isCastable; - -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/NormalResultHandlerFactory.h b/cli/test/include/mockcpp/NormalResultHandlerFactory.h deleted file mode 100644 index 792b451..0000000 --- a/cli/test/include/mockcpp/NormalResultHandlerFactory.h +++ /dev/null @@ -1,43 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_NORMAL_RESULT_HANDLER_FACTORY_H -#define __MOCKCPP_NORMAL_RESULT_HANDLER_FACTORY_H - -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////////////////// -struct NormalResultHandlerFactory - : public ResultHandlerFactory -{ - ResultHandler* create( - bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber); -}; - -/////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ObjNameGetter.h b/cli/test/include/mockcpp/ObjNameGetter.h deleted file mode 100644 index 9d3e9df..0000000 --- a/cli/test/include/mockcpp/ObjNameGetter.h +++ /dev/null @@ -1,38 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_OBJ_NAME_GETTER_H -#define __MOCKCPP_OBJ_NAME_GETTER_H - -#include - -#include - -MOCKCPP_NS_START - -struct ObjectNameGetter -{ - virtual const std::string& getName() const = 0; - - virtual ~ObjectNameGetter() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/OrderingMatcher.h b/cli/test/include/mockcpp/OrderingMatcher.h deleted file mode 100644 index a4967dd..0000000 --- a/cli/test/include/mockcpp/OrderingMatcher.h +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_ORDERING_MATCHER_H -#define __MOCKCPP_ORDERING_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; - -struct OrderingMatcher : public Matcher -{ - virtual ~OrderingMatcher() {} - virtual bool isCompleted(void) const = 0; - virtual void setOrderingInvocationMocker(InvocationMocker* mocker) = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/OutBound.h b/cli/test/include/mockcpp/OutBound.h deleted file mode 100644 index bbc2729..0000000 --- a/cli/test/include/mockcpp/OutBound.h +++ /dev/null @@ -1,60 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_OUTBOUND_H -#define __MOCKCPP_OUTBOUND_H - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -template -struct OutBound : public DecoratedConstraint -{ - OutBound(const T& val, Constraint* constraint = 0) - : ref(val), DecoratedConstraint(constraint) - {} - - bool evalSelf(const RefAny& val) const - { - return const_cast(val).changeValue(ref); - } - - std::string getName() const - { - return "outBound"; - } - - std::string getTypeAndValueString() const - { - return MOCKCPP_NS::toTypeAndValueString(ref); - } - -private: - - T ref; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/OutBoundPointer.h b/cli/test/include/mockcpp/OutBoundPointer.h deleted file mode 100644 index 93587d6..0000000 --- a/cli/test/include/mockcpp/OutBoundPointer.h +++ /dev/null @@ -1,129 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_OUTBOUND_POINTER_H -#define __MOCKCPP_OUTBOUND_POINTER_H - -#include -#include -#include -#include - -MOCKCPP_NS_START - -void OutBoundPointerCheckConst(const std::string& typeString, bool isConst); - -/////////////////////////////////////////////////////// -template -struct OutBoundPointerBase -{ -}; - -/////////////////////////////////////////////////////// -template -struct OutBoundPointerBase: public DecoratedConstraint -{ -public: - OutBoundPointerBase(T* p, size_t size, Constraint* constraint) - : DecoratedConstraint(constraint), sizeOfBuffer(size) - { - if (size != 0) - { - pointer = (T*)(new char [size+1]); - ::memset((void*)pointer, 0, size+1); - ::memcpy((void*)pointer, (void*)p, size); - } - } - - ~OutBoundPointerBase() - { - if (pointer != 0) - { - delete [] (char*)pointer; - } - } - - bool evalSelf(const RefAny& val) const - { - T* p = any_cast(val); - if (p == 0) - { - return false; - } - - checkConst(); - - (void) memcpy((void*)p, (void*)pointer, sizeOfBuffer); - - return true; - } - - std::string getName() const - { - return "outBoundP"; - } - - std::string getTypeAndValueString() const - { - return MOCKCPP_NS::toTypeAndValueString(pointer); - } - -private: - - void checkConst() const - { - OutBoundPointerCheckConst(TypeString::value(), IsConst::isTrue); - } - -private: - - size_t sizeOfBuffer; - T* pointer; -}; - -////////////////////////////////////////////////////////////////////// -template -struct OutBoundPointer -{ -}; - -////////////////////////////////////////////////////////////////////// -template -struct OutBoundPointer : public OutBoundPointerBase -{ -public: - - OutBoundPointer(T* p, size_t size = 0, Constraint* constraint = 0) - : OutBoundPointerBase(p, size == 0 ? sizeof(T) : size, constraint) - { - } -}; - -////////////////////////////////////////////////////////////////////// -template <> -struct OutBoundPointer: public OutBoundPointerBase -{ -public: - - OutBoundPointer(void* p, size_t size, Constraint* constraint = 0); -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/OutputStringStream.h b/cli/test/include/mockcpp/OutputStringStream.h deleted file mode 100644 index aac48eb..0000000 --- a/cli/test/include/mockcpp/OutputStringStream.h +++ /dev/null @@ -1,25 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ -#ifndef __MOCKCPP_OUTPUT_STRING_STREAM_H -#define __MOCKCPP_OUTPUT_STRING_STREAM_H - -#include - -typedef std::ostringstream oss_t; - -#endif diff --git a/cli/test/include/mockcpp/ParameterizedApiHookHolder.h b/cli/test/include/mockcpp/ParameterizedApiHookHolder.h deleted file mode 100644 index 3d418d9..0000000 --- a/cli/test/include/mockcpp/ParameterizedApiHookHolder.h +++ /dev/null @@ -1,38 +0,0 @@ - -#ifndef __MOCKCPP_PARAMETERIZED_API_HOOK_HOLDER_H__ -#define __MOCKCPP_PARAMETERIZED_API_HOOK_HOLDER_H__ - -#include -#include - -MOCKCPP_NS_START - -///////////////////////////////////////////////////// -template -struct ParameterizedApiHookHolder - : public ApiHookHolder -{ - const static unsigned int maxSeq = 25; - - ParameterizedApiHookHolder(F api) - { - (m_hook = ApiHookGenerator::findApiHook(api)) || - (m_hook = ApiHookGenerator::appyApiHook(api)); - } - - void * getApiHook() const - { return m_hook; } - - ~ParameterizedApiHookHolder() - { - ApiHookGenerator::freeApiHook(m_hook); - } - -private: - void* m_hook; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/PendingMatcher.h b/cli/test/include/mockcpp/PendingMatcher.h deleted file mode 100644 index c1e3cd4..0000000 --- a/cli/test/include/mockcpp/PendingMatcher.h +++ /dev/null @@ -1,66 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_PENDING_MATCHER_H -#define __MOCKCPP_PENDING_MATCHER_H - -#include -#include - -#include - -MOCKCPP_NS_START - -struct Invocation; -struct OrderingMatcher; -struct InvocationMockerNamespace; -struct InvocationMocker; - -struct PendingMatcher : public Matcher -{ - PendingMatcher(OrderingMatcher* orderingMatcher - , InvocationMockerNamespace* ns - , const std::string& identity - , InvocationMocker* ThisMocker); - - ~PendingMatcher(); - - bool matches(const Invocation& inv) const; - - void increaseInvoked(const Invocation& inv); - - std::string toString() const; - - void verify(); - -private: - - void setUpOrderingMatcher() const; - -private: - - mutable OrderingMatcher* matcher; - InvocationMockerNamespace* scope; - std::string id; - InvocationMocker* mocker; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ProcStub.h b/cli/test/include/mockcpp/ProcStub.h deleted file mode 100644 index 75b060a..0000000 --- a/cli/test/include/mockcpp/ProcStub.h +++ /dev/null @@ -1,196 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_PROC_STUB_H -#define __MOCKCPP_PROC_STUB_H - -#include -#include - -#include -#include -#include -#include - -MOCKCPP_NS_START - -template -struct ProcStub; - -struct ProcStubBaseImpl; - -struct ProcStubBase : public Stub -{ - ProcStubBase(const std::string& name, void* addr); - - ~ProcStubBase(); - - bool isCompleted() const; - - std::string toString() const; - -private: - - ProcStubBaseImpl* This; -}; - -//////////////////////////////////////////////////// -std::string getParameterMismatchString(int n - , std::string p - , const Invocation& inv); - -//////////////////////////////////////////////////// -#define MOCKCPP_CHECK_AND_ASSIGN_PARAMETER(N) \ - MOCKCPP_ASSERT_TRUE_MESSAGE( \ - getParameterMismatchString(N, TypeString::value(), inv) \ - , any_castable(inv.getParameterWithThis(N))); \ - MOCKP##N p##N = any_cast(inv.getParameterWithThis(N)); - -#define PROC_STUB_CONS() \ - ProcStub(Func f, std::string name) \ - : ProcStubBase(name, (void*)f), func(f) \ - {} - - -/////////////////////////////////////////////////////////// -#define PROC_STUB_DEF(n) \ -template \ -struct ProcStub : public ProcStubBase \ -{ \ - typedef R (*Func)(DECL_ARGS(n)); \ - \ - PROC_STUB_CONS() \ - \ - Any& invoke(const Invocation& inv) \ - { \ - SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ - \ - result = func(DECL_PARAMS(n)); \ - return result; \ - } \ - \ -private: \ - Func func; \ - Any result; \ -}; \ -template \ -Stub* invoke(R(*f)(DECL_ARGS(n)), const char* name = 0) \ -{ \ - return new ProcStub(f, name?name:""); \ -} \ -template \ -struct ProcStub : public ProcStubBase \ -{ \ - typedef void (*Func)(DECL_ARGS(n)); \ - \ - PROC_STUB_CONS() \ - \ - Any& invoke(const Invocation& inv) \ - { \ - SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ - \ - func(DECL_PARAMS(n)); \ - return getVoidAny(); \ - } \ - \ -private: \ - Func func; \ -} - -///////////////////////////////////////////////////// - -PROC_STUB_DEF(0); -PROC_STUB_DEF(1); -PROC_STUB_DEF(2); -PROC_STUB_DEF(3); -PROC_STUB_DEF(4); -PROC_STUB_DEF(5); -PROC_STUB_DEF(6); -PROC_STUB_DEF(7); -PROC_STUB_DEF(8); -PROC_STUB_DEF(9); -PROC_STUB_DEF(10); -PROC_STUB_DEF(11); -PROC_STUB_DEF(12); -// one more for C++ Member Method(1 'this' pointer + 12 parameters = 13) -PROC_STUB_DEF(13); - -#define VARDIC_PROC_STUB_DEF(n) \ -template \ -struct ProcStub : public ProcStubBase \ -{ \ - typedef R (*Func)(DECL_VARDIC_ARGS(n) ...); \ - \ - PROC_STUB_CONS() \ - \ - Any& invoke(const Invocation& inv) \ - { \ - SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ - \ - result = func(DECL_PARAMS(n)); \ - return result; \ - } \ - \ -private: \ - Func func; \ - Any result; \ -}; \ -template \ -Stub* invoke(R(*f)(DECL_VARDIC_ARGS(n) ...), const char* name = 0) \ -{ \ - return new ProcStub(f, name?name:""); \ -} \ -template \ -struct ProcStub : public ProcStubBase \ -{ \ - typedef void (*Func)(DECL_VARDIC_ARGS(n) ...); \ - \ - PROC_STUB_CONS() \ - \ - Any& invoke(const Invocation& inv) \ - { \ - SIMPLE_REPEAT(n, MOCKCPP_CHECK_AND_ASSIGN_PARAMETER); \ - \ - func(DECL_PARAMS(n)); \ - return getVoidAny(); \ - } \ - \ -private: \ - Func func; \ -} -///////////////////////////////////////////////////// -VARDIC_PROC_STUB_DEF(0); -VARDIC_PROC_STUB_DEF(1); -VARDIC_PROC_STUB_DEF(2); -VARDIC_PROC_STUB_DEF(3); -VARDIC_PROC_STUB_DEF(4); -VARDIC_PROC_STUB_DEF(5); -VARDIC_PROC_STUB_DEF(6); -VARDIC_PROC_STUB_DEF(7); -VARDIC_PROC_STUB_DEF(8); - -///////////////////////////////////////////////////// - -#define PROC(function) function, #function - -///////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ProcessWith.h b/cli/test/include/mockcpp/ProcessWith.h deleted file mode 100644 index e123fc6..0000000 --- a/cli/test/include/mockcpp/ProcessWith.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_PROCESS_WITH_H -#define __MOCKCPP_PROCESS_WITH_H - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct ProcessWith: public Constraint -{ - ProcessWith(Proc proc) - : proc(proc) - {} - - bool eval(const RefAny& val) const - { - if(!any_castable(val)) return false; - - proc(any_cast(val)); - - return true; - } - - std::string toString() const - { - return std::string("operate(") + - MOCKCPP_NS::toTypeAndValueString(proc) + - std::string(")"); - } - -private: - - mutable Proc proc; -}; - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/RepeatMacros.h b/cli/test/include/mockcpp/RepeatMacros.h deleted file mode 100644 index 4a5397d..0000000 --- a/cli/test/include/mockcpp/RepeatMacros.h +++ /dev/null @@ -1,70 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_REPEAT_MACROS_H -#define __MOCKCPP_REPEAT_MACROS_H - -#define REPEAT_0(macro) -#define REPEAT_1(macro) REPEAT_0(macro) -#define REPEAT_2(macro) REPEAT_1(macro) macro(1) -#define REPEAT_3(macro) REPEAT_2(macro) macro(2) -#define REPEAT_4(macro) REPEAT_3(macro) macro(3) -#define REPEAT_5(macro) REPEAT_4(macro) macro(4) -#define REPEAT_6(macro) REPEAT_5(macro) macro(5) -#define REPEAT_7(macro) REPEAT_6(macro) macro(6) -#define REPEAT_8(macro) REPEAT_7(macro) macro(7) -#define REPEAT_9(macro) REPEAT_8(macro) macro(8) -#define REPEAT_10(macro) REPEAT_9(macro) macro(9) -#define REPEAT_11(macro) REPEAT_10(macro) macro(10) -#define REPEAT_12(macro) REPEAT_11(macro) macro(11) -#define REPEAT_13(macro) REPEAT_12(macro) macro(12) -#define REPEAT_14(macro) REPEAT_13(macro) macro(13) -#define REPEAT_15(macro) REPEAT_14(macro) macro(14) -#define REPEAT_16(macro) REPEAT_15(macro) macro(15) -#define REPEAT_17(macro) REPEAT_16(macro) macro(16) -#define REPEAT_18(macro) REPEAT_17(macro) macro(17) -#define REPEAT_19(macro) REPEAT_18(macro) macro(18) -#define REPEAT_20(macro) REPEAT_19(macro) macro(19) - -#define END_MACRO_0(macro) -#define END_MACRO_1(macro) macro(1) -#define END_MACRO_2(macro) macro(2) -#define END_MACRO_3(macro) macro(3) -#define END_MACRO_4(macro) macro(4) -#define END_MACRO_5(macro) macro(5) -#define END_MACRO_6(macro) macro(6) -#define END_MACRO_7(macro) macro(7) -#define END_MACRO_8(macro) macro(8) -#define END_MACRO_9(macro) macro(9) -#define END_MACRO_10(macro) macro(10) -#define END_MACRO_11(macro) macro(11) -#define END_MACRO_12(macro) macro(12) -#define END_MACRO_13(macro) macro(13) -#define END_MACRO_14(macro) macro(14) -#define END_MACRO_15(macro) macro(15) -#define END_MACRO_16(macro) macro(16) -#define END_MACRO_17(macro) macro(17) -#define END_MACRO_18(macro) macro(18) -#define END_MACRO_19(macro) macro(19) -#define END_MACRO_20(macro) macro(20) - -#define REPEAT(n, macro, end_macro) REPEAT_##n (macro) END_MACRO_##n(end_macro) -#define SIMPLE_REPEAT(n, macro) REPEAT(n, macro, macro) - -#endif - diff --git a/cli/test/include/mockcpp/RepeatStub.h b/cli/test/include/mockcpp/RepeatStub.h deleted file mode 100644 index 63e35df..0000000 --- a/cli/test/include/mockcpp/RepeatStub.h +++ /dev/null @@ -1,49 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_REPEAT_STUB_H -#define __MOCKCPP_REPEAT_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct RepeatStub : public TypelessStub -{ - RepeatStub(const Any& value, unsigned int times); - - bool isCompleted() const; - - Any& invoke(void); - - std::string toString(void) const; - - const std::type_info& type() const; - -private: - - Any returnValue; - unsigned int repeatedTimes; - const unsigned int repeatTimes; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ReportFailure.h b/cli/test/include/mockcpp/ReportFailure.h deleted file mode 100644 index c5bf030..0000000 --- a/cli/test/include/mockcpp/ReportFailure.h +++ /dev/null @@ -1,51 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_REPORT_FAILURE_H -#define __MOCKCPP_REPORT_FAILURE_H - -#include -#include - -MOCKCPP_NS_START - -void -reportFailure - ( unsigned int line - , const char* file - , const std::string& message); - -#define MOCKCPP_REPORT_FAILURE(msg) \ - MOCKCPP_NS::reportFailure(__LINE__, __FILE__, msg) - -#define MOCKCPP_ASSERT_FALSE(msg, expr) do {\ - if(expr) { \ - MOCKCPP_REPORT_FAILURE(msg); \ - } \ -} while(0) - -#define MOCKCPP_ASSERT_TRUE(msg, expr) do {\ - if(!(expr)) { \ - MOCKCPP_REPORT_FAILURE(msg); \ - } \ -} while(0) - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Result.h b/cli/test/include/mockcpp/Result.h deleted file mode 100644 index 40cc6c5..0000000 --- a/cli/test/include/mockcpp/Result.h +++ /dev/null @@ -1,50 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RESULT_H -#define __MOCKCPP_RESULT_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct SelfDescribe; -struct ResultImpl; - -struct Result -{ - Result( bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber); - - ~Result(); - - const Any& getResult(const Any& result) const; - -private: - - ResultImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ResultHandler.h b/cli/test/include/mockcpp/ResultHandler.h deleted file mode 100644 index a047349..0000000 --- a/cli/test/include/mockcpp/ResultHandler.h +++ /dev/null @@ -1,40 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RESULT_HANDLER_H -#define __MOCKCPP_RESULT_HANDLER_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; - -struct ResultHandler -{ - virtual ~ResultHandler() {} - - virtual bool matches(const Any& val) const = 0; - virtual const Any& getResult(const Any& val) const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ResultHandlerFactory.h b/cli/test/include/mockcpp/ResultHandlerFactory.h deleted file mode 100644 index 88a0df0..0000000 --- a/cli/test/include/mockcpp/ResultHandlerFactory.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RESULT_HANDLER_FACTORY_H -#define __MOCKCPP_RESULT_HANDLER_FACTORY_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct SelfDescribe; -struct ResultHandler; -struct ResultImpl; - -struct ResultHandlerFactory -{ - virtual ResultHandler* create( - bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber) = 0; - - virtual ~ResultHandlerFactory() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ReturnObjectList.h b/cli/test/include/mockcpp/ReturnObjectList.h deleted file mode 100644 index c101dba..0000000 --- a/cli/test/include/mockcpp/ReturnObjectList.h +++ /dev/null @@ -1,64 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RETURN_OBJECT_LIST_H -#define __MOCKCPP_RETURN_OBJECT_LIST_H - -#include -#include - -MOCKCPP_NS_START - -struct ReturnObjectListImpl; - -struct ReturnObjectList : public TypelessStub -{ -public: - - ReturnObjectList( const Any& o01 = Any() - , const Any& o02 = Any() - , const Any& o03 = Any() - , const Any& o04 = Any() - , const Any& o05 = Any() - , const Any& o06 = Any() - , const Any& o07 = Any() - , const Any& o08 = Any() - , const Any& o09 = Any() - , const Any& o10 = Any() - , const Any& o11 = Any() - , const Any& o12 = Any() - ); - - ~ReturnObjectList(); - - bool isCompleted(void) const; - Any& invoke(void); - - std::string toString(void) const; - - const std::type_info& type() const; - -private: - - ReturnObjectListImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ReturnStub.h b/cli/test/include/mockcpp/ReturnStub.h deleted file mode 100644 index 06b88a1..0000000 --- a/cli/test/include/mockcpp/ReturnStub.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_RETURN_STUB_H -#define __MOCKCPP_RETURN_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct ReturnStub : public TypelessStub -{ - ReturnStub(const Any& value); - - bool isCompleted() const; - - Any& invoke(void); - - std::string toString(void) const; - - const std::type_info& type() const; - -private: - Any returnValue; - bool hasBeenInvoked; - -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/SelfDescribe.h b/cli/test/include/mockcpp/SelfDescribe.h deleted file mode 100644 index 1a222e9..0000000 --- a/cli/test/include/mockcpp/SelfDescribe.h +++ /dev/null @@ -1,36 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_SELF_DESCRIBE_H -#define __MOCKCPP_SELF_DESCRIBE_H - -#include -#include - -MOCKCPP_NS_START - -struct SelfDescribe -{ - virtual ~SelfDescribe() {} - virtual std::string toString() const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/SimpleInvocationRecorder.h b/cli/test/include/mockcpp/SimpleInvocationRecorder.h deleted file mode 100644 index a5ac8a1..0000000 --- a/cli/test/include/mockcpp/SimpleInvocationRecorder.h +++ /dev/null @@ -1,44 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_SIMPLE_INVOCATION_RECORDER_H -#define __MOCKCPP_SIMPLE_INVOCATION_RECORDER_H - -#include -#include - -MOCKCPP_NS_START - -struct SimpleInvocationRecorder - : public InvokedTimesRecorder -{ - SimpleInvocationRecorder(); - - unsigned int getInvokedTimes() const; - - void increaseInvoked(); - -protected: - - unsigned int invokedTimes; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/Spy.h b/cli/test/include/mockcpp/Spy.h deleted file mode 100644 index 250cffb..0000000 --- a/cli/test/include/mockcpp/Spy.h +++ /dev/null @@ -1,55 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_SPY_H -#define __MOCKCPP_SPY_H - -#include -#include - -MOCKCPP_NS_START - -struct RefAny; - -template -struct Spy : public Constraint -{ - Spy(T& reference) - : ref(reference) - {} - - bool eval(const RefAny& inv) const - { - if(!any_castable(inv)) return false; - ref = any_cast(inv); - return true; - } - - std::string toString() const - { - return "spy(" + toTypeAndValueString(ref) + ")"; - } - -private: - T& ref; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/StatelessMatcher.h b/cli/test/include/mockcpp/StatelessMatcher.h deleted file mode 100644 index 02ec5cb..0000000 --- a/cli/test/include/mockcpp/StatelessMatcher.h +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STATELESS_MATCHER_H -#define __MOCKCPP_STATELESS_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct Invocation; - -struct StatelessMatcher : public Matcher -{ - virtual ~StatelessMatcher() {} - virtual bool matches(const Invocation& inv) const = 0; - virtual void increaseInvoked(const Invocation& inv) {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/StringConstraint.h b/cli/test/include/mockcpp/StringConstraint.h deleted file mode 100644 index dfc6c27..0000000 --- a/cli/test/include/mockcpp/StringConstraint.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STRING_CONSTRAINT_H -#define __MOCKCPP_STRING_CONSTRAINT_H - -#include -#include - -MOCKCPP_NS_START - -struct StringPredict; - -struct StringConstraint: public Constraint -{ - StringConstraint(const std::string& s, StringPredict* pred); - ~StringConstraint(); - - bool eval(const RefAny& val) const; - - std::string toString() const; - -private: - std::string str; - StringPredict* predict; -}; - -MOCKCPP_NS_END - -#endif - - diff --git a/cli/test/include/mockcpp/StringPredict.h b/cli/test/include/mockcpp/StringPredict.h deleted file mode 100644 index a7a11ea..0000000 --- a/cli/test/include/mockcpp/StringPredict.h +++ /dev/null @@ -1,39 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STRING_PREDICT_H -#define __MOCKCPP_STRING_PREDICT_H - -#include -#include - -MOCKCPP_NS_START - -struct StringPredict -{ - virtual bool predict(const std::string& input, const std::string& target) const = 0; - virtual std::string toString(const std::string& target) const = 0; - - virtual ~StringPredict() {} -}; - -MOCKCPP_NS_END - -#endif - - diff --git a/cli/test/include/mockcpp/Stub.h b/cli/test/include/mockcpp/Stub.h deleted file mode 100644 index 038c04c..0000000 --- a/cli/test/include/mockcpp/Stub.h +++ /dev/null @@ -1,41 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STUB_H -#define __MOCKCPP_STUB_H - -#include - -#include - -MOCKCPP_NS_START - -struct Any; -struct Invocation; - -struct Stub : public SelfDescribe -{ - virtual ~Stub() {} - virtual bool isCompleted() const = 0; - virtual Any& invoke(const Invocation& inv) = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/StubBuilder.h b/cli/test/include/mockcpp/StubBuilder.h deleted file mode 100644 index c9aaabf..0000000 --- a/cli/test/include/mockcpp/StubBuilder.h +++ /dev/null @@ -1,47 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STUB_BUILDER_H -#define __MOCKCPP_STUB_BUILDER_H - -#include -#include - -MOCKCPP_NS_START - -struct InvocationMocker; -struct Stub; - -template -struct StubBuilder : public Builder -{ - Builder& will(Stub* stub); - - virtual ~StubBuilder() {} - -private: - - virtual InvocationMocker* getMocker() const = 0; -}; - -MOCKCPP_NS_END - -#include - -#endif - diff --git a/cli/test/include/mockcpp/StubBuilder.tcc b/cli/test/include/mockcpp/StubBuilder.tcc deleted file mode 100644 index 3c8cc2c..0000000 --- a/cli/test/include/mockcpp/StubBuilder.tcc +++ /dev/null @@ -1,33 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#include -#include - -MOCKCPP_NS_START - -template -Builder& StubBuilder::will(Stub* stub) -{ - getMocker()->addStub(new WillStub(stub)); - return *this; -} - -MOCKCPP_NS_END - - diff --git a/cli/test/include/mockcpp/StubContainer.h b/cli/test/include/mockcpp/StubContainer.h deleted file mode 100644 index d0f3786..0000000 --- a/cli/test/include/mockcpp/StubContainer.h +++ /dev/null @@ -1,52 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STUB_CONTAINER_H -#define __MOCKCPP_STUB_CONTAINER_H - -#include - -#include - -MOCKCPP_NS_START - -struct Stub; -struct StubContainerImpl; - -struct StubContainer -{ - StubContainer(const std::string& space); - ~StubContainer(); - - void addStub(Stub* stub); - - Stub* getStub() const; - - void reset(); - - std::string toString() const; - -private: - - StubContainerImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/StubsBuilder.h b/cli/test/include/mockcpp/StubsBuilder.h deleted file mode 100644 index 5baaf36..0000000 --- a/cli/test/include/mockcpp/StubsBuilder.h +++ /dev/null @@ -1,44 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STUBS_BUILDER_H -#define __MOCKCPP_STUBS_BUILDER_H - -#include - -#include -#include -#include -#include - -MOCKCPP_NS_START - -/////////////////////////////////////////////// -typedef InvocationMockBuilder< - ArgumentsMatchBuilder< - StubBuilder< - MoreStubBuilder<> - > - > - > StubsBuilder; -/////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/StubsMatcher.h b/cli/test/include/mockcpp/StubsMatcher.h deleted file mode 100644 index d88a904..0000000 --- a/cli/test/include/mockcpp/StubsMatcher.h +++ /dev/null @@ -1,40 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_STUBS_MATCHER_H -#define __MOCKCPP_STUBS_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct Invocation; - -struct StubsMatcher : public Matcher -{ - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - void verify(); - std::string toString() const; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TestFailureMatcher.h b/cli/test/include/mockcpp/TestFailureMatcher.h deleted file mode 100644 index e631288..0000000 --- a/cli/test/include/mockcpp/TestFailureMatcher.h +++ /dev/null @@ -1,45 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TEST_FAILURE_MATCHER_H -#define __MOCKCPP_TEST_FAILURE_MATCHER_H - -#include -#include - -MOCKCPP_NS_START - -struct TestFailureMatcher : public Matcher -{ - TestFailureMatcher(const std::string& msg - ,const std::string& str); - - bool matches(const Invocation& inv) const; - void increaseInvoked(const Invocation& inv); - std::string toString(void) const; - void verify(void); - -private: - std::string msg; - std::string str; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ThenStub.h b/cli/test/include/mockcpp/ThenStub.h deleted file mode 100644 index 151e08f..0000000 --- a/cli/test/include/mockcpp/ThenStub.h +++ /dev/null @@ -1,49 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_THEN_STUB_H -#define __MOCKCPP_THEN_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct Invocation; - -struct ThenStub : public Stub -{ - ThenStub(Stub* stub); - - ~ThenStub(); - - bool isCompleted(void) const; - Any& invoke(const Invocation& inv); - - std::string toString() const; - -private: - - Stub* expectedStub; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/ThrowExceptionStub.h b/cli/test/include/mockcpp/ThrowExceptionStub.h deleted file mode 100644 index 510a195..0000000 --- a/cli/test/include/mockcpp/ThrowExceptionStub.h +++ /dev/null @@ -1,74 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_THROW_EXCEPTION_STUB_H -#define __MOCKCPP_THROW_EXCEPTION_STUB_H - -#include -#include -#include -#include - -MOCKCPP_NS_START - -template -struct ThrowExceptionStub : public TypelessStub -{ - ThrowExceptionStub(T ex) - : excep(ex), hasBeenInvoked(false) - {} - - bool isCompleted() const - { - return hasBeenInvoked; - } - - Any& invoke(void) - { - hasBeenInvoked = true; - - throw excep; - - return getEmptyAny(); - } - - std::string toString(void) const - { - oss_t oss; - - oss << "throws(" << MOCKCPP_NS::toString(excep) << ")"; - - return oss.str(); - } - - const std::type_info& type() const - { - return typeid(T); - } - -private: - - bool hasBeenInvoked; - - T excep; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TypeString.h b/cli/test/include/mockcpp/TypeString.h deleted file mode 100644 index bf838b3..0000000 --- a/cli/test/include/mockcpp/TypeString.h +++ /dev/null @@ -1,53 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TYPE_STRING_H -#define __MOCKCPP_TYPE_STRING_H - -#include - -#include - -#include -#include - -MOCKCPP_NS_START - -std::string getDemangledName(const std::type_info& typeInfo); - -template struct TypeString -{ - static std::string value() - { - return getDemangledName(typeid(T)); - } -}; - -template <> -struct TypeString -{ - static std::string value() - { - return "std::string"; - } -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TypeTraits.h b/cli/test/include/mockcpp/TypeTraits.h deleted file mode 100644 index ba79b8e..0000000 --- a/cli/test/include/mockcpp/TypeTraits.h +++ /dev/null @@ -1,108 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - - -#ifndef __MOCKCPP_TYPE_TRAITS_H -#define __MOCKCPP_TYPE_TRAITS_H - -#include - -MOCKCPP_NS_START - -/* - * For non-reference type - */ -template -struct TypeTraits -{ - typedef T Raw; - typedef T& RefRaw; - - typedef T Type; - typedef T& Ref; -}; - -/* - * For non-reference type - */ -template -struct TypeTraits -{ - typedef T Raw; - typedef T& RefRaw; - - typedef T Type; - typedef const T& Ref; -}; - -/* - * For non-reference type - */ -template -struct TypeTraits -{ - typedef T* Raw; - typedef T*& RefRaw; - - typedef const T* Type; - typedef const T*& Ref; -}; - -/* - * For reference type - */ -template -struct TypeTraits -{ - typedef T Raw; - typedef T& RefRawx; - - typedef T Type; - typedef T& Ref; -}; - -/* - * For reference type - */ -template -struct TypeTraits -{ - typedef T Raw; - typedef T& RefRaw; - - typedef T Type; - typedef const T& Ref; -}; - -/* - * For non-reference type - */ -template <> -struct TypeTraits -{ - typedef void Raw; - typedef void RefRaw; - - typedef void Type; - typedef void Ref; -}; - -MOCKCPP_NS_END - -#endif // __MOCKCPP_TYPE_TRAITS_H - diff --git a/cli/test/include/mockcpp/TypelessConstraint.h b/cli/test/include/mockcpp/TypelessConstraint.h deleted file mode 100644 index bf89ae1..0000000 --- a/cli/test/include/mockcpp/TypelessConstraint.h +++ /dev/null @@ -1,37 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TYPELESS_CONSTRAINT_H -#define __MOCKCPP_TYPELESS_CONSTRAINT_H - -#include -#include - -MOCKCPP_NS_START - -struct TypelessConstraint -{ - virtual ~TypelessConstraint() {} - virtual bool eval(void) const = 0; - virtual std::string toString() const = 0; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TypelessConstraintAdapter.h b/cli/test/include/mockcpp/TypelessConstraintAdapter.h deleted file mode 100644 index 901540f..0000000 --- a/cli/test/include/mockcpp/TypelessConstraintAdapter.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TYPELESS_CONSTRAINT_ADAPTER_H -#define __MOCKCPP_TYPELESS_CONSTRAINT_ADAPTER_H - -#include -#include - -MOCKCPP_NS_START - -struct RefAny; -struct TypelessConstraint; -struct TypelessConstraintAdapterImpl; - -struct TypelessConstraintAdapter : public Constraint -{ - TypelessConstraintAdapter(TypelessConstraint* tc); - ~TypelessConstraintAdapter(); - - virtual bool eval(const RefAny& p) const; - virtual std::string toString() const; - - TypelessConstraint* getAdaptedConstraint() const; - -private: - TypelessConstraintAdapterImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TypelessStub.h b/cli/test/include/mockcpp/TypelessStub.h deleted file mode 100644 index 6d4cbb8..0000000 --- a/cli/test/include/mockcpp/TypelessStub.h +++ /dev/null @@ -1,42 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TYPELESS_STUB_H -#define __MOCKCPP_TYPELESS_STUB_H - -#include -#include -#include - -MOCKCPP_NS_START - -struct Any; - -struct TypelessStub -{ - virtual bool isCompleted() const = 0; - virtual Any& invoke(void) = 0; - virtual std::string toString(void) const = 0; - - virtual ~TypelessStub() {} -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/TypelessStubAdapter.h b/cli/test/include/mockcpp/TypelessStubAdapter.h deleted file mode 100644 index 6703025..0000000 --- a/cli/test/include/mockcpp/TypelessStubAdapter.h +++ /dev/null @@ -1,50 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_TYPELESS_STUB_ADAPTER_H -#define __MOCKCPP_TYPELESS_STUB_ADAPTER_H - -#include -#include - -MOCKCPP_NS_START - -struct TypelessStub; -struct Invocation; - -struct TypelessStubAdapter : public Stub -{ - TypelessStubAdapter(TypelessStub* ts); - - ~TypelessStubAdapter(); - - bool isCompleted() const; - - Any& invoke(const Invocation& inv); - - std::string toString(void) const; - -private: - - TypelessStub* stub; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/VirtualTable.h b/cli/test/include/mockcpp/VirtualTable.h deleted file mode 100644 index ab85970..0000000 --- a/cli/test/include/mockcpp/VirtualTable.h +++ /dev/null @@ -1,61 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_VIRTUAL_TABLE_H -#define __MOCKCPP_VIRTUAL_TABLE_H - -#include - -#include - -MOCKCPP_NS_START - -struct ObjectNameGetter; -struct IndexInvokableGetter; -struct VirtualTableImpl; - -struct VirtualTable -{ - VirtualTable( IndexInvokableGetter* getter - , ObjectNameGetter* nameGetter - , unsigned int numberOfVptr - , const std::type_info&); - - ~VirtualTable(); - - void* toPointerToInterface() const; - - void addMethod(void* methodAddr, unsigned int indexOfVtbl, unsigned int indexofVptr = 0); - void setDestructor(unsigned int vptrIndex, unsigned int vtblIndex); - - void expectsBeingDeleted(); - void expectsKeepAlive(); - - void verify(); - void reset(); - - static IndexInvokableGetter* getInvokableGetter(void* Caller, unsigned int indexOfVptr); - -private: - VirtualTableImpl* This; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/VirtualTableUtils.h b/cli/test/include/mockcpp/VirtualTableUtils.h deleted file mode 100644 index e7f8fb9..0000000 --- a/cli/test/include/mockcpp/VirtualTableUtils.h +++ /dev/null @@ -1,34 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_VIRTUAL_TABLE_UTILS_H -#define __MOCKCPP_VIRTUAL_TABLE_UTILS_H - -#include -#include - -MOCKCPP_NS_START - -void** createVtbls(unsigned int numberOfVptr); -void freeVtbls(void** vtbl, unsigned int numberOfVtpr); -unsigned int getRealVtblIndex(unsigned int indexOfVptr, unsigned int indexOfVtbl); -void initializeVtbls(void** vptr, void**vtbl, unsigned int numberOfVtpr, const std::type_info& info, bool hasRtti); - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/Void.h b/cli/test/include/mockcpp/Void.h deleted file mode 100644 index 89951dc..0000000 --- a/cli/test/include/mockcpp/Void.h +++ /dev/null @@ -1,31 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_VOID_H -#define __MOCKCPP_VOID_H - -#include - -MOCKCPP_NS_START - -struct Void {}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/VoidResultHandler.h b/cli/test/include/mockcpp/VoidResultHandler.h deleted file mode 100644 index 5e3c30f..0000000 --- a/cli/test/include/mockcpp/VoidResultHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_VOID_RESULT_HANDLER_H -#define __MOCKCPP_VOID_RESULT_HANDLER_H - -#include -#include - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct SelfDescribe; - -/////////////////////////////////////////////////////////// -struct VoidResultHandler: public ResultHandler -{ - VoidResultHandler( const std::type_info& typeInfo - , const std::string& expectedTypeString - , const SelfDescribe* resultProvider); - - bool matches(const Any& val) const; - - const Any& getResult(const Any& val) const; - -private: - - const std::type_info& expectedTypeInfo; - const std::string expectedTypeString; - const SelfDescribe* resultProvider; -}; - -/////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/VoidResultHandlerFactory.h b/cli/test/include/mockcpp/VoidResultHandlerFactory.h deleted file mode 100644 index ecfb508..0000000 --- a/cli/test/include/mockcpp/VoidResultHandlerFactory.h +++ /dev/null @@ -1,46 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_VOID_RESULT_HANDLER_FACTORY_H -#define __MOCKCPP_VOID_RESULT_HANDLER_FACTORY_H - -#include -#include - -MOCKCPP_NS_START - -struct ResultHandler; - -/////////////////////////////////////////////////////////// -struct VoidResultHandlerFactory - : public ResultHandlerFactory -{ -public: - ResultHandler* create( - bool isCastable - , const std::type_info& expectedTypeInfo - , const std::string& expectedTypeString - , const SelfDescribe* selfDescriber); -}; - -/////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/WillStub.h b/cli/test/include/mockcpp/WillStub.h deleted file mode 100644 index 67b8175..0000000 --- a/cli/test/include/mockcpp/WillStub.h +++ /dev/null @@ -1,49 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_WILL_STUB_H -#define __MOCKCPP_WILL_STUB_H - -#include -#include - -MOCKCPP_NS_START - -struct Any; -struct Invocation; - -struct WillStub : public Stub -{ - WillStub(Stub* stub); - - ~WillStub(); - - bool isCompleted(void) const; - Any& invoke(const Invocation& inv); - - std::string toString() const; - -private: - - Stub* expectedStub; -}; - -MOCKCPP_NS_END - -#endif - diff --git a/cli/test/include/mockcpp/WinCodeModifier.h b/cli/test/include/mockcpp/WinCodeModifier.h deleted file mode 100644 index 144b605..0000000 --- a/cli/test/include/mockcpp/WinCodeModifier.h +++ /dev/null @@ -1,35 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2010> - - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_WINCODEMODIFIER_H__ -#define __MOCKCPP_WINCODEMODIFIER_H__ - -#include - -MOCKCPP_NS_START - -struct WinCodeModifier : public CodeModifier -{ - bool modify(void *dest, void *src, size_t size); -}; - - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/include/mockcpp/mockable.h b/cli/test/include/mockcpp/mockable.h deleted file mode 100644 index 25d6ae9..0000000 --- a/cli/test/include/mockcpp/mockable.h +++ /dev/null @@ -1,33 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOCKABLE_H -#define __MOCKCPP_MOCKABLE_H - -#if defined(__cplusplus) && defined(MOCKCPP_USE_MOCKABLE) -# include -# include -# define MOCKABLE(function) MOCKER(function).defaults().will(invoke(function)); \ - MOCKCPP_NS::Functor function(#function, __FUNCTION__) -# define MCALL(function) MOCKCPP_NS::Functor(#function, __FUNCTION__) -#else -# define MOCKABLE(function) -# define MCALL(function) function -#endif - -#endif diff --git a/cli/test/include/mockcpp/mockcpp.h b/cli/test/include/mockcpp/mockcpp.h deleted file mode 100644 index badf31f..0000000 --- a/cli/test/include/mockcpp/mockcpp.h +++ /dev/null @@ -1,92 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_H -#define __MOCKCPP_H - -#ifdef _MSC_VER -#define _MOCKCPP_COMPILER_MSVC _MSC_VER -#elif defined(__GNUC__) -#define _MOCKCPP_COMPILER_GNUC -#else -#error "Unknown compiler!" -#endif - -#if !defined(MOCKCPP_NO_NAMESPACE) || (MOCKCPP_NO_NAMESPACE == 0) -# define MOCKCPP_NS mockcpp -# define MOCKCPP_NS_START namespace MOCKCPP_NS { -# define MOCKCPP_NS_END } -# define USING_MOCKCPP_NS using namespace MOCKCPP_NS; -#else -# define MOCKCPP_NS -# define MOCKCPP_NS_START -# define MOCKCPP_NS_END -# define USING_MOCKCPP_NS -#endif - -#ifdef _MSC_VER -# define MOCKCPP_EXPORT __declspec(dllexport) -#else -# define MOCKCPP_EXPORT -#endif - -#if ( defined (__aarch64__)) - -#define BUILD_FOR_AARCH64 - -#elif ( defined (__arm__)) - -#define BUILD_FOR_AARCH32 - -#elif ( defined (__LP64__) \ - || defined (__64BIT__) \ - || defined (_LP64) \ - || ((defined(__WORDSIZE)) && (__WORDSIZE == 64)) \ - || defined(_WIN64)) - -#define BUILD_FOR_X64 - -#else - -#define BUILD_FOR_X86 - -#endif - -MOCKCPP_NS_START - -namespace __CHECK { - - template - struct STATIC_ASSERT_FAILURE; - - template<> struct STATIC_ASSERT_FAILURE - { - enum { value = 1 }; - }; - - template struct STATIC_ASSERT_TEST; - -#define MOCKCPP_STATIC_ASSERT(C) \ - typedef MOCKCPP_NS::__CHECK::STATIC_ASSERT_TEST< \ - sizeof(MOCKCPP_NS::__CHECK::STATIC_ASSERT_FAILURE)> \ - mockcpp_static_assert_typedef -} - -MOCKCPP_NS_END -#endif // __MOCKCPP_H - diff --git a/cli/test/include/mockcpp/mockcpp.hpp b/cli/test/include/mockcpp/mockcpp.hpp deleted file mode 100644 index f71155b..0000000 --- a/cli/test/include/mockcpp/mockcpp.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_HPP_ -#define __MOCKCPP_HPP_ - -#define MSVC_VMG_ENABLED -#include -#include -#include -#include - -#endif - diff --git a/cli/test/include/mockcpp/mokc.h b/cli/test/include/mockcpp/mokc.h deleted file mode 100644 index 1ec966a..0000000 --- a/cli/test/include/mockcpp/mokc.h +++ /dev/null @@ -1,52 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKCPP_MOKC_H -#define __MOCKCPP_MOKC_H - -#ifdef __cplusplus -# include -# include - -# if defined(MOCKCPP_USE_MOCKABLE) -# include -# define MOCKER(api) MOCKCPP_NS::GlobalMockObject::instance.method(#api) -# else -# include -// @TODO : write instructions -// @TODO : update mockcpp -//# define __MOCKER_MODE_1(api) MOCKCPP_NS::mockAPI<>::get(#api, "", api) -//# define __MOCKER_MODE_2(api, API) MOCKCPP_NS::mockAPI::get(#api, #API, api) -//# define __MOCKER_CPP_MODE_1(api) MOCKCPP_NS::mockAPI<>::get(#api, "", api) -//# define __MOCKER_CPP_MODE_2(api, API) MOCKCPP_NS::mockAPI::get(#api, #API, api) -//# define __MOCKER_CPP_VIRTUAL_MODE_1(obj, api) MOCKCPP_NS::mockAPI<>::get_virtual(#api, "", obj, api) -//# define __MOCKER_CPP_VIRTUAL_MODE_2(obj, api, API) MOCKCPP_NS::mockAPI::get_virtual(#api, #API, obj, api) -# define MOCKER(api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get(#api, ""#__VA_ARGS__, api) -# define MOCKER_CPP(api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get(#api, ""#__VA_ARGS__, api) -# define MOCKER_CPP_VIRTUAL(obj, api, ...) MOCKCPP_NS::mockAPI<__VA_ARGS__>::get_virtual(#api, ""#__VA_ARGS__, obj, api) -// adapter for amock -# define AMOCKER MOCKER -# define LLT_GLOBALOBJMOCKER GlobalMockObject -# endif - -USING_MOCKCPP_NS - -#endif - -#endif - diff --git a/cli/test/include/mockcpp/types/Any.h b/cli/test/include/mockcpp/types/Any.h deleted file mode 100644 index 5ac918a..0000000 --- a/cli/test/include/mockcpp/types/Any.h +++ /dev/null @@ -1,75 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_ANY_H -#define __MOCKPP_ANY_H - -#include - -#include -#include - -MOCKCPP_NS_START - -struct Any : public AnyBase -{ - Any(); - - template - Any(const ValueType& value) - : AnyBase(new ValueHolder(value)) - {} - -#if 0 - Any(const char* value); -#endif - - Any(const Any & other); - -public: - - template - Any& operator=(const ValueType & rhs) - { - Any(rhs).swap(*this); - return *this; - } - - Any& operator=(const Any & rhs); - - Constraint* getConstraint() const - { return getContent()->getConstraint(); } -}; - -///////////////////////////////////////////////////////////////// -const Any EmptyAny; - -const Any VoidAny = Any(Void()); - -Any& getEmptyAny(); -Any& getVoidAny(); -bool isVoidAny(const Any& val); - -///////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - - -#endif // __MOCKPP_ANY_H - - diff --git a/cli/test/include/mockcpp/types/AnyBase.h b/cli/test/include/mockcpp/types/AnyBase.h deleted file mode 100644 index 8e88cd6..0000000 --- a/cli/test/include/mockcpp/types/AnyBase.h +++ /dev/null @@ -1,71 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_ANY_BASE_H -#define __MOCKPP_ANY_BASE_H - -#include - -#include - -MOCKCPP_NS_START - -struct AnyBase -{ -public: - - AnyBase(void); - - AnyBase(PlaceHolder* holder); - - ~AnyBase(); - -public: - - bool empty() const; - - const std::type_info & type() const; - - std::string toString() const; - - std::string toTypeString() const; - - std::string toTypeAndValueString() const; - -protected: - - AnyBase& swap(AnyBase& rhs); - - PlaceHolder* getContent() const; - -private: - - PlaceHolder* content; - -private: - - template - friend ValueType * __any_cast(AnyBase *); -}; - -MOCKCPP_NS_END - - -#endif // __MOCKPP_ANY_BASE_H - - diff --git a/cli/test/include/mockcpp/types/AnyCast.h b/cli/test/include/mockcpp/types/AnyCast.h deleted file mode 100644 index b769d48..0000000 --- a/cli/test/include/mockcpp/types/AnyCast.h +++ /dev/null @@ -1,166 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_ANY_CAST_H -#define __MOCKPP_ANY_CAST_H - -#include - -#include - -#include -#include - -#include -#define MOCKCPP_ASSERT(expr) assert(expr) - -MOCKCPP_NS_START - -///////////////////////////////////////////////////////////////// -template -ValueType* __any_cast(AnyBase* operand) -{ - typedef typename TypeTraits::Type nonref; - typedef Holder holder; - - if (operand == 0 || operand->type() != typeid(ValueType)) - { - return 0; - } - - holder* p = dynamic_cast(operand->getContent()); - - return p ? &const_cast(p->getValue()) : 0; -} - -///////////////////////////////////////////////////////////////// -template -struct AnyCast -{ - static ValueType* cast(AnyBase* operand) - { - return __any_cast(operand); - } -}; - -///////////////////////////////////////////////////////////////// -template -struct AnyCast -{ - static ValueType* cast(AnyBase* operand) - { - ValueType* p = 0; - ( p = __any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) || \ - ( p = (ValueType*)__any_cast(operand)) ; - return p; - } -}; - -///////////////////////////////////////////////////////////////// -template -ValueType* any_cast(AnyBase* operand) -{ - return AnyCast::value>::cast(operand); -} - -///////////////////////////////////////////////////////////////// -template <> -char* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -short* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -int* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -long* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -unsigned char* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -unsigned short* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -unsigned int* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template <> -unsigned long* any_cast(AnyBase* op); - -///////////////////////////////////////////////////////////////// -template -const ValueType * any_cast(const AnyBase* operand) -{ - return any_cast(const_cast(operand)); -} - -///////////////////////////////////////////////////////////////// -template -ValueType any_cast(const AnyBase& operand) -{ - typedef typename TypeTraits::Type nonref; - - const nonref * result = any_cast(&operand); - MOCKCPP_ASSERT(result != 0); - - return *const_cast(result); -} - -///////////////////////////////////////////////////////////////// -template -ValueType any_cast(AnyBase& operand) -{ - typedef typename TypeTraits::Type nonref; - - nonref * result = any_cast(&operand); - MOCKCPP_ASSERT(result != 0); - - return *result; -} - -///////////////////////////////////////////////////////////////// -template -bool any_castable(const AnyBase& val) -{ - typedef typename TypeTraits::Type nonref; - - return (!val.empty()) && (any_cast(&val) != 0); -} - -///////////////////////////////////////////////////////////////// - -MOCKCPP_NS_END - -#endif - - diff --git a/cli/test/include/mockcpp/types/Holder.h b/cli/test/include/mockcpp/types/Holder.h deleted file mode 100644 index 0226d1e..0000000 --- a/cli/test/include/mockcpp/types/Holder.h +++ /dev/null @@ -1,65 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_HOLDER_H -#define __MOCKPP_HOLDER_H - -#include - -#include - -#include -#include -#include - -MOCKCPP_NS_START - -template -struct Holder : public PlaceHolder -{ - typedef ValueType Type; - - const std::type_info & type() const - { - return typeid(ValueType) == typeid(Void) ? typeid(void) : typeid(ValueType); - } - - std::string toString() const - { - return MOCKCPP_NS::toString(getValue()); - } - - std::string toTypeString() const - { - return TypeString::value(); - } - - std::string toTypeAndValueString() const - { - return MOCKCPP_NS::toTypeAndValueString(getValue()); - } - - virtual const ValueType& getValue() const = 0; -}; - -MOCKCPP_NS_END - - -#endif // __MOCKPP_VALUEHOLDER_H - - diff --git a/cli/test/include/mockcpp/types/PlaceHolder.h b/cli/test/include/mockcpp/types/PlaceHolder.h deleted file mode 100644 index 8abd284..0000000 --- a/cli/test/include/mockcpp/types/PlaceHolder.h +++ /dev/null @@ -1,48 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_PLACEHOLDER_H -#define __MOCKPP_PLACEHOLDER_H - -#include -#include - -#include -#include - -MOCKCPP_NS_START - -struct Constraint; - -struct PlaceHolder -{ - virtual ~PlaceHolder() {} - virtual const std::type_info & type() const = 0; - virtual PlaceHolder* clone() const = 0; - virtual std::string toString(void) const = 0; - virtual std::string toTypeString(void) const = 0; - virtual std::string toTypeAndValueString(void) const = 0; - virtual Constraint* getConstraint() const { return NULL; } -}; - -MOCKCPP_NS_END - - -#endif // __MOCKPP_PLACEHOLDER_H - - diff --git a/cli/test/include/mockcpp/types/RefAny.h b/cli/test/include/mockcpp/types/RefAny.h deleted file mode 100644 index 041b21e..0000000 --- a/cli/test/include/mockcpp/types/RefAny.h +++ /dev/null @@ -1,81 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_REF_ANY_H -#define __MOCKPP_REF_ANY_H - -#include -#include - -MOCKCPP_NS_START - -struct RefAny : public AnyBase -{ - RefAny(); - - template - RefAny(const ValueType& value) - : AnyBase(new RefHolder(value)) - {} - -#if 0 - RefAny(const char* value); - RefAny(char* value); -#endif - - RefAny(const RefAny & other); - -public: - - template - RefAny& operator=(const ValueType & rhs) - { - RefAny(rhs).swap(*this); - return *this; - } - - RefAny& operator=(const RefAny & rhs); - - template - bool changeValue(const ValueType& val) - { - RefHolder* p = dynamic_cast*>(getContent()); - if (p == 0) - { - return false; - } - - p->changeValue(val); - - return true; - } -}; - -///////////////////////////////////////////////////// -///////////////////////////////////////////////////// -const RefAny EmptyRefAny; - -RefAny& getEmptyRefAny(); -///////////////////////////////////////////////////// - -MOCKCPP_NS_END - - -#endif // __MOCKPP_REF_ANY_H - - diff --git a/cli/test/include/mockcpp/types/RefHolder.h b/cli/test/include/mockcpp/types/RefHolder.h deleted file mode 100644 index 83e13cd..0000000 --- a/cli/test/include/mockcpp/types/RefHolder.h +++ /dev/null @@ -1,58 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_REFHOLDER_H -#define __MOCKPP_REFHOLDER_H - -#include - -MOCKCPP_NS_START - -template -struct RefHolder : public Holder -{ - RefHolder(const ValueType& value) - : ref(value) - { - } - - PlaceHolder * clone() const - { return new RefHolder(ref); } - - const ValueType& getValue() const - { - return ref; - } - - void changeValue(const ValueType& val) - { - ValueType* addr = &const_cast(ref); - (*addr) = val; - } - -private: - - const ValueType& ref; -}; - -MOCKCPP_NS_END - - -#endif // __MOCKPP_REFHOLDER_H - - diff --git a/cli/test/include/mockcpp/types/ValueHolder.h b/cli/test/include/mockcpp/types/ValueHolder.h deleted file mode 100644 index 1c4b375..0000000 --- a/cli/test/include/mockcpp/types/ValueHolder.h +++ /dev/null @@ -1,298 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - -#ifndef __MOCKPP_VALUEHOLDER_H -#define __MOCKPP_VALUEHOLDER_H - -#include - -#include - -#include - -#include -#include -#include -#include -#include - -MOCKCPP_NS_START - -namespace { - -template -Constraint* constraint(const T& value) -{ - return new IsEqual(value); -} - -Constraint* constraint(Constraint* c) -{ - return c == 0 ? any() : c; -} - -Constraint* constraint(const Constraint* c) -{ - return constraint(const_cast(c)); -} - -Constraint* constraint(const Void& v) -{ - return any(); -} - -} - -template -struct ValueHolderBase : public Holder -{ - Constraint* getConstraint() const - { - return constraint(getValue()); - } - - virtual const ValueType& getValue() const = 0; -}; - -template -struct ValueHolder : public ValueHolderBase -{ - ValueHolder(const ValueType& value) - : held(value) - { - } - - PlaceHolder * clone() const - { return new ValueHolder(held); } - - const ValueType& getValue() const - { - return held; - } - -private: - - ValueType held; -}; - -/////////////////////////////////////////////// -template -struct UnsignedLongHolder : public ValueHolderBase -{ -protected: - union Held{ - unsigned long ul; - unsigned int ui; - unsigned short us; - unsigned char uc; - Held(const unsigned long value) : ul(value) {} - Held(const unsigned int value) : ui(value) {} - Held(const unsigned short value) : us(value) {} - Held(const unsigned char value) : uc(value) {} - } held; -public: - - UnsignedLongHolder(const ValueType& value) - : held(value) - { - } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public UnsignedLongHolder -{ - ValueHolder(unsigned long value) - : UnsignedLongHolder(value) - { - } - - const unsigned long& getValue() const - { - return held.ul; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.ul); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public UnsignedLongHolder -{ - ValueHolder(unsigned int value) - : UnsignedLongHolder(value) - { - } - - const unsigned int& getValue() const - { - return held.ui; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.ui); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public UnsignedLongHolder -{ - ValueHolder(unsigned short value) - : UnsignedLongHolder(value) - { - } - - const unsigned short& getValue() const - { - return held.us; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.us); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public UnsignedLongHolder -{ - ValueHolder(unsigned char value) - : UnsignedLongHolder(value) - { - } - - const unsigned char& getValue() const - { - return held.uc; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.uc); } -}; - -/////////////////////////////////////////////// -template -struct SignedLongHolder : public ValueHolderBase -{ -protected: - union Held{ - long sl; - int si; - short ss; - char sc; - Held(const long value) : sl(value) {} - Held(const int value) : si(value) {} - Held(const short value) : ss(value) {} - Held(const char value) : sc(value) {} - } held; -public: - - SignedLongHolder(const ValueType& value) - : held(value) - { - } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public SignedLongHolder -{ - ValueHolder(const long& value) - : SignedLongHolder(value) - { - } - - const long& getValue() const - { - return held.sl; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.sl); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public SignedLongHolder -{ - ValueHolder(const int& value) - : SignedLongHolder(value) - { - } - - const int& getValue() const - { - return held.si; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.si); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public SignedLongHolder -{ - ValueHolder(const short& value) - : SignedLongHolder(value) - { - } - - const short& getValue() const - { - return held.ss; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.ss); } -}; - -/////////////////////////////////////////////// -template <> -struct ValueHolder - : public SignedLongHolder -{ - ValueHolder(const char& value) - : SignedLongHolder(value) - { - } - - const char& getValue() const - { - return held.sc; - } - - PlaceHolder * clone() const - { return new ValueHolder(held.sc); } -}; - -/////////////////////////////////////////////// - -MOCKCPP_NS_END - - -#endif // __MOCKPP_VALUEHOLDER_H - - diff --git a/cli/test/include/mockcpp/utils.h b/cli/test/include/mockcpp/utils.h deleted file mode 100644 index da2ad6f..0000000 --- a/cli/test/include/mockcpp/utils.h +++ /dev/null @@ -1,59 +0,0 @@ -/*** - mockcpp is a generic C/C++ mock framework. - Copyright (C) <2009> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -***/ - - -#ifndef __MOCKCPP_UTILS_H -#define __MOCKCPP_UTILS_H - -#include -#include -#include -#include - -MOCKCPP_NS_START - -inline std::string getFileName(std::string file) -{ - if (file == "") - { - return "NULL"; - } - - return file.substr(file.find_last_of("/\\") + 1); -} - -#define __RUN_NOTHROW(block) try block \ - catch (std::exception &e) \ - { \ - std::cout << "(" << getFileName(__FILE__) << ", " << __LINE__ << ") exception : " << e.what() << std::endl; \ - } \ - catch (...) \ - { \ - std::cout << "(" << getFileName(__FILE__) << ", " << __LINE__ << ") exception : Unknown" << std::endl; \ - } - -#define __RUN_THROW(block) try block \ - catch (...) \ - { \ - throw; \ - } - - -MOCKCPP_NS_END - -#endif diff --git a/cli/test/testcase/CMakeCache.txt b/cli/test/testcase/CMakeCache.txt deleted file mode 100644 index 7032d9d..0000000 --- a/cli/test/testcase/CMakeCache.txt +++ /dev/null @@ -1,304 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or -// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ - -//Flags used by the compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc - -//Flags used by the compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=demo - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Flags used by the linker during the creation of dll's. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -demo_BINARY_DIR:STATIC=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase - -//Value Computed by CMake -demo_SOURCE_DIR:STATIC=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/zhouhongyu/DTTestNew/ascend-docker-cli/test -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/cli/test/testcase/Makefile b/cli/test/testcase/Makefile deleted file mode 100644 index 5ab3be8..0000000 --- a/cli/test/testcase/Makefile +++ /dev/null @@ -1,208 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.5 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/zhouhongyu/DTTestNew/ascend-docker-cli/test - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." - /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/zhouhongyu/DTTestNew/ascend-docker-cli/test/testcase/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named ut_demo - -# Build rule for target. -ut_demo: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ut_demo -.PHONY : ut_demo - -# fast build rule for target. -ut_demo/fast: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/build -.PHONY : ut_demo/fast - -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o - -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o - -# target to build an object file -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.o - -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i - -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i - -# target to preprocess a source file -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.i - -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s: home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s - -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s - -# target to generate assembly for a file -home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s -.PHONY : home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.c.s - -main.o: main.cpp.o - -.PHONY : main.o - -# target to build an object file -main.cpp.o: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.o -.PHONY : main.cpp.o - -main.i: main.cpp.i - -.PHONY : main.i - -# target to preprocess a source file -main.cpp.i: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.i -.PHONY : main.cpp.i - -main.s: main.cpp.s - -.PHONY : main.s - -# target to generate assembly for a file -main.cpp.s: - $(MAKE) -f CMakeFiles/ut_demo.dir/build.make CMakeFiles/ut_demo.dir/main.cpp.s -.PHONY : main.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... ut_demo" - @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.o" - @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.i" - @echo "... home/zhouhongyu/DTTestNew/ascend-docker-cli/src/main.s" - @echo "... main.o" - @echo "... main.i" - @echo "... main.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - -- Gitee From d2fa001e602a20cc2669139a918f54e69df02720 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 19 Aug 2020 15:25:37 +0800 Subject: [PATCH 060/296] Match-id-b8611df24afc3fdb1b7bcb36d13d844490355051 --- cli/test/dt/Depend/googletest/README | 1 + cli/test/dt/Depend/mockcpp/README | 1 + cli/test/dt/build.sh | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 cli/test/dt/Depend/googletest/README create mode 100644 cli/test/dt/Depend/mockcpp/README diff --git a/cli/test/dt/Depend/googletest/README b/cli/test/dt/Depend/googletest/README new file mode 100644 index 0000000..1887da6 --- /dev/null +++ b/cli/test/dt/Depend/googletest/README @@ -0,0 +1 @@ +googletest \ No newline at end of file diff --git a/cli/test/dt/Depend/mockcpp/README b/cli/test/dt/Depend/mockcpp/README new file mode 100644 index 0000000..ee7b4de --- /dev/null +++ b/cli/test/dt/Depend/mockcpp/README @@ -0,0 +1 @@ +mockcpp \ No newline at end of file diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh index fce8d43..bfec4c9 100644 --- a/cli/test/dt/build.sh +++ b/cli/test/dt/build.sh @@ -97,6 +97,8 @@ run_lcov_cli() cd ${SRC_ROOT}/.. lcov --no-external -o result.info -b . -d . -c genhtml result.info -o Report + cd ${CUR_DIR} + cp -f buildDTCenter.xml test_detail.xml echo "-------------run_ut cli end-------------------" } -- Gitee From 50699eed9c89e0dd26d54b5970b47edef163156c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 20 Aug 2020 17:06:45 +0800 Subject: [PATCH 061/296] Match-id-70e8d6a57c608a90d4919f897da8a90b167c1c57 --- cli/test/dt/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh index bfec4c9..aa5ec4f 100644 --- a/cli/test/dt/build.sh +++ b/cli/test/dt/build.sh @@ -98,7 +98,8 @@ run_lcov_cli() lcov --no-external -o result.info -b . -d . -c genhtml result.info -o Report cd ${CUR_DIR} - cp -f buildDTCenter.xml test_detail.xml + mkdir xml + cp -f buildDTCenter.xml ./xml/test_detail.xml echo "-------------run_ut cli end-------------------" } -- Gitee From 8bfa3f940017c87a0bec6b44b76705ea9f2794fe Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 24 Aug 2020 22:36:23 +0800 Subject: [PATCH 062/296] Match-id-d23b01861e8b27062a1d27792272a26cc174c10a --- cli/src/cgrp.c | 36 ++++++++--------- cli/src/logging.c | 54 ++------------------------ cli/src/logging.h | 29 ++++++++++++-- cli/src/main.c | 59 +++++++++++++--------------- cli/src/mount.c | 62 +++++++++++++++--------------- cli/src/ns.c | 6 +-- cli/src/options.c | 3 +- cli/src/options.h | 2 +- cli/src/utils.c | 6 +-- cli/test/dt/Depend/public_stub.cpp | 4 ++ cli/test/dt/Depend/ut_comm.h | 4 ++ cli/test/dt/Depend/ut_main.cpp | 26 ++----------- 12 files changed, 126 insertions(+), 165 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index c799bb9..d94e2dc 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -70,13 +70,13 @@ int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize path %s.", filepath); + LOG_ERROR("error: cannot canonicalize path %s.", filepath); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - LogError("cannot open file."); + LOG_ERROR("cannot open file."); return -1; } @@ -154,20 +154,20 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - LogError("error: failed to assemble dev path for %s.", devName); + LOG_ERROR("error: failed to assemble dev path for %s.", devName); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - LogError("error: failed to get stat of %s.", devPath); + LOG_ERROR("error: failed to get stat of %s.", devPath); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - LogError("error: write devices failed."); + LOG_ERROR("error: write devices failed."); return -1; } @@ -180,19 +180,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - LogError("error: failed to setup cgroup for %s.", DAVINCI_MANAGER); + LOG_ERROR("error: failed to setup cgroup for %s.", DAVINCI_MANAGER); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - LogError("error: failed to setup cgroup for %s.", DEVMM_SVM); + LOG_ERROR("error: failed to setup cgroup for %s.", DEVMM_SVM); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - LogError("error: failed to setup cgroup for %s.", HISI_HDC); + LOG_ERROR("error: failed to setup cgroup for %s.", HISI_HDC); return -1; } @@ -207,13 +207,13 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - LogError("error: assemble mount info path failed: ppid(%d).", getppid()); + LOG_ERROR("error: assemble mount info path failed: ppid(%d).", getppid()); return -1; } ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - LogError("error: cat file content failed."); + LOG_ERROR("error: cat file content failed."); return -1; } @@ -221,13 +221,13 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) char cgroupPath[BUF_SIZE] = {0x0}; ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { - LogError("error: assemble cgroup path failed: pid(%d).", pid); + LOG_ERROR("error: assemble cgroup path failed: pid(%d).", pid); return -1; } ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - LogError("error: cat file content failed."); + LOG_ERROR("error: cat file content failed."); return -1; } @@ -236,7 +236,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - LogError("error: assemble cgroup device path failed."); + LOG_ERROR("error: assemble cgroup device path failed."); return -1; } @@ -251,20 +251,20 @@ int SetupCgroup(const struct ParsedConfig *config) FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize cgroup path: %s.", config->cgroupPath); + LOG_ERROR("error: cannot canonicalize cgroup path: %s.", config->cgroupPath); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - LogError("error: failed to open cgroup file: %s.", resolvedCgroupPath); + LOG_ERROR("error: failed to open cgroup file: %s.", resolvedCgroupPath); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to setup driver cgroup."); + LOG_ERROR("error: failed to setup driver cgroup."); return -1; } @@ -272,14 +272,14 @@ int SetupCgroup(const struct ParsedConfig *config) ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to assemble device path for no.%u.", config->devices[idx]); + LOG_ERROR("error: failed to assemble device path for no.%u.", config->devices[idx]); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - LogError("error: failed to setup cgroup for %s.", deviceName); + LOG_ERROR("error: failed to setup cgroup for %s.", deviceName); return -1; } } diff --git a/cli/src/logging.c b/cli/src/logging.c index a980460..8d2b779 100644 --- a/cli/src/logging.c +++ b/cli/src/logging.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -32,13 +31,13 @@ int OpenLog(const char *logFile) } if (realpath(logFile, realPath) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize log file path %s.", logFile); + LOG_ERROR("error: cannot canonicalize log file path %s.", logFile); return -1; } g_logFile = fopen((const char *)realPath, "ae"); if (g_logFile == NULL) { - LogError("error: failed to open log file %s.", realPath); + LOG_ERROR("error: failed to open log file %s.", realPath); return -1; } @@ -53,7 +52,7 @@ void CloseLog() } } -static void WriteLog(char level, const char *fmt, va_list args) +void WriteLog(char level, const char *content) { struct timeval tv = {0}; struct tm *tm = NULL; @@ -70,51 +69,6 @@ static void WriteLog(char level, const char *fmt, va_list args) } fprintf(g_logFile, "[%c %s.%06ld %d] ", level, buf, tv.tv_usec, g_pid); - vfprintf(g_logFile, fmt, args); + fprintf(g_logFile, "%s", content); fputc('\n', g_logFile); } - -void LogError(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - va_list argsCopy; - va_copy(argsCopy, args); - WriteLog('E', fmt, argsCopy); - va_end(argsCopy); - - vfprintf(stderr, fmt, args); - va_end(args); -} - -void LogInfo(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - va_list argsCopy; - va_copy(argsCopy, args); - WriteLog('I', fmt, argsCopy); - va_end(argsCopy); - - vfprintf(stdout, fmt, args); - va_end(args); -} - -void LogWarning(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - va_list argsCopy; - va_copy(argsCopy, args); - WriteLog('W', fmt, argsCopy); - va_end(argsCopy); - - vfprintf(stderr, fmt, args); - va_end(args); -} \ No newline at end of file diff --git a/cli/src/logging.h b/cli/src/logging.h index eb25a4e..90b47c6 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -5,12 +5,35 @@ #ifndef _LOGGING_H #define _LOGGING_H +#include +#include +#include "securec.h" +#include "basic.h" + void SetPidForLog(int pid); int OpenLog(const char *logFile); void CloseLog(); +void WriteLog(char level, const char *content); + +#define LOG(level, fmt, ...) \ + do { \ + char content[BUF_SIZE] = {0}; \ + int ret = sprintf_s(content, BUF_SIZE, fmt, ##__VA_ARGS__); \ + if (ret < 0) { \ + break; \ + } \ + WriteLog(level, (const char *)content); \ + fprintf(stderr, "%s", (const char *)content); \ + } while (0) + +#define LOG_ERROR(fmt, ...) \ + do { \ + LOG('E', fmt, ##__VA_ARGS__); \ + } while (0) -void LogError(const char *fmt, ...); -void LogInfo(const char *fmt, ...); -void LogWarning(const char *fmt, ...); +#define LOG_WARNING(fmt, ...) \ + do { \ + LOG('W', fmt, ##__VA_ARGS__); \ + } while (0) #endif diff --git a/cli/src/main.c b/cli/src/main.c index 96bef1a..8cd69f0 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -44,7 +44,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { - LogError("error: failed to get devices from cmd args."); + LOG_ERROR("error: failed to get devices from cmd args."); return false; } @@ -56,12 +56,12 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { - LogError("error: failed to convert pid string from cmd args, pid string: %s.", arg); + LOG_ERROR("error: failed to convert pid string from cmd args, pid string: %s.", arg); return false; } if (args->pid <= 0) { - LogError("error: invalid pid %d.", args->pid); + LOG_ERROR("error: invalid pid %d.", args->pid); return false; } @@ -72,7 +72,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { - LogError("error: failed to get rootfs path from cmd args"); + LOG_ERROR("error: failed to get rootfs path from cmd args"); return false; } @@ -83,7 +83,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { - LogError("error: failed to get options string from cmd args"); + LOG_ERROR("error: failed to get options string from cmd args"); return false; } @@ -93,7 +93,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) #define NUM_OF_CMD_ARGS 4 static struct { - const int c; + const char c; CmdArgParser parser; } g_cmdArgParsers[NUM_OF_CMD_ARGS] = { {'d', DevicesCmdArgParser}, @@ -102,7 +102,7 @@ static struct { {'o', OptionsCmdArgParser} }; -static int ParseOneCmdArg(struct CmdArgs *args, int indicator, const char *value) +static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) { int i; for (i = 0; i < NUM_OF_CMD_ARGS; i++) { @@ -112,13 +112,13 @@ static int ParseOneCmdArg(struct CmdArgs *args, int indicator, const char *value } if (i == NUM_OF_CMD_ARGS) { - LogError("error: unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); + LOG_ERROR("error: unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); return -1; } bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { - LogError("error: failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); + LOG_ERROR("error: failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); return -1; } @@ -140,14 +140,14 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device token = strtok_s(devices, sep, &context); while (token != NULL) { if (idx >= *idListSize) { - LogError("error: too many devices(%u), support %u devices maximally", idx, *idListSize); + LOG_ERROR("error: too many devices(%u), support %u devices maximally", idx, *idListSize); return -1; } errno = 0; idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { - LogError("error: failed to convert device id (%s) from cmd args, caused by: %s.", token, strerror(errno)); + LOG_ERROR("error: failed to convert device id (%s) from cmd args, caused by: %s.", token, strerror(errno)); return -1; } @@ -166,38 +166,38 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { - LogError("error: failed to copy rootfs path to parsed config."); + LOG_ERROR("error: failed to copy rootfs path to parsed config."); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { - LogError("error: failed to parse device ids from cmdline argument"); + LOG_ERROR("error: failed to parse device ids from cmdline argument"); return -1; } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get container mnt ns path: pid(%d).", args->pid); + LOG_ERROR("error: failed to get container mnt ns path: pid(%d).", args->pid); return -1; } ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get cgroup path."); + LOG_ERROR("error: failed to get cgroup path."); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - LogError("error: failed to get self ns path."); + LOG_ERROR("error: failed to get self ns path."); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - LogError("error: failed to get self ns fd: %s.", originNsPath); + LOG_ERROR("error: failed to get self ns fd: %s.", originNsPath); return -1; } @@ -213,28 +213,28 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - LogError("error: failed to prepare nesessary config."); + LOG_ERROR("error: failed to prepare nesessary config."); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - LogError("error: failed to set to container ns: %s.", config.containerNsPath); + LOG_ERROR("error: failed to set to container ns: %s.", config.containerNsPath); close(config.originNsFd); return -1; } ret = DoMounting(&config); if (ret < 0) { - LogError("error: failed to do mounting."); + LOG_ERROR("error: failed to do mounting."); close(config.originNsFd); return -1; } ret = SetupCgroup(&config); if (ret < 0) { - LogError("error: failed to set up cgroup."); + LOG_ERROR("error: failed to set up cgroup."); close(config.originNsFd); return -1; } @@ -242,7 +242,7 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - LogError("error: failed to set ns back."); + LOG_ERROR("error: failed to set ns back."); close(config.originNsFd); return -1; } @@ -259,29 +259,24 @@ int Process(int argc, char **argv) struct CmdArgs args = {0}; while ((c = getopt_long(argc, argv, "d:p:r:o", g_cmdOpts, &optionIndex)) != -1) { - ret = ParseOneCmdArg(&args, c, optarg); + ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { - LogError("error: failed to parse cmd args."); + LOG_ERROR("error: failed to parse cmd args."); return -1; } } if (!IsCmdArgsValid(&args)) { - LogError("error: information not completed or valid."); - return -1; - } - - ret = ParseRuntimeOptions(args.options); - if (ret < 0) { - LogError("error: failed to parse runtime options."); + LOG_ERROR("error: information not completed or valid."); return -1; } + ParseRuntimeOptions(args.options); SetPidForLog(args.pid); ret = OpenLog(DEFAULT_LOG_FILE); if (ret < 0) { - LogError("error: failed to open log file %s.", DEFAULT_LOG_FILE); + LOG_ERROR("error: failed to open log file %s.", DEFAULT_LOG_FILE); return -1; } diff --git a/cli/src/mount.c b/cli/src/mount.c index 6ef04c4..8f514b0 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -22,13 +22,13 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - LogError("error: failed to mount."); + LOG_ERROR("error: failed to mount."); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - LogError("error: failed to re-mount."); + LOG_ERROR("error: failed to re-mount."); return -1; } @@ -64,13 +64,13 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - LogError("error: cannot canonicalize device dst: %s.", dst); + LOG_ERROR("error: cannot canonicalize device dst: %s.", dst); return -1; } err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); if (err != EOK) { - LogError("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); + LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); return -1; } @@ -86,26 +86,26 @@ int MountDevice(const char *rootfs, const char *deviceName) ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); if (ret < 0) { - LogError("error: failed to get device mount src and(or) dst path, device name: %s.", deviceName); + LOG_ERROR("error: failed to get device mount src and(or) dst path, device name: %s.", deviceName); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - LogError("error: failed to stat src: %s.", src); + LOG_ERROR("error: failed to stat src: %s.", src); return -1; } ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - LogError("error: failed to create mount dst file: %s.", dst); + LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; } ret = Mount(src, dst); if (ret < 0) { - LogError("error: failed to mount dev."); + LOG_ERROR("error: failed to mount dev."); return -1; } @@ -119,13 +119,13 @@ int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr) for (size_t idx = 0; idx < idsNr; idx++) { int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (ret < 0) { - LogError("error: assemble device name failed, id: %u.", ids[idx]); + LOG_ERROR("error: assemble device name failed, id: %u.", ids[idx]); return -1; } ret = MountDevice(rootfs, deviceName); if (ret < 0) { - LogError("error: failed to mount device %s.", deviceName); + LOG_ERROR("error: failed to mount device %s.", deviceName); return -1; } } @@ -140,26 +140,26 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - LogError("error: failed to assemble file mounting path, file: %s.", filepath); + LOG_ERROR("error: failed to assemble file mounting path, file: %s.", filepath); return -1; } struct stat srcStat; ret = stat(filepath, &srcStat); if (ret < 0) { - LogWarning("warning: failed to find file %s on host, skipping", filepath); + LOG_WARNING("warning: failed to find file %s on host, skipping", filepath); return 0; } ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { - LogError("error: failed to create mount dst file: %s.", dst); + LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; } ret = Mount(filepath, dst); if (ret < 0) { - LogError("error: failed to mount dev."); + LOG_ERROR("error: failed to mount dev."); return -1; } @@ -179,19 +179,19 @@ int MountDir(const char *rootfs, const char *src) struct stat srcStat; ret = stat(src, &srcStat); if (ret < 0) { - LogWarning("warning: failed to find dir %s on host, skipping", src); + LOG_WARNING("warning: failed to find dir %s on host, skipping", src); return 0; } ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - LogError("error: failed to make dir: %s.", dst); + LOG_ERROR("error: failed to make dir: %s.", dst); return -1; } ret = Mount(src, dst); if (ret < 0) { - LogError("error: failed to mount dir: %s to %s.", src, dst); + LOG_ERROR("error: failed to mount dir: %s to %s.", src, dst); return -1; } @@ -203,19 +203,19 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER); if (ret < 0) { - LogError("error: failed to mount device %s.", DAVINCI_MANAGER); + LOG_ERROR("error: failed to mount device %s.", DAVINCI_MANAGER); return -1; } ret = MountDevice(rootfs, DEVMM_SVM); if (ret < 0) { - LogError("error: failed to mount device %s.", DEVMM_SVM); + LOG_ERROR("error: failed to mount device %s.", DEVMM_SVM); return -1; } ret = MountDevice(rootfs, HISI_HDC); if (ret < 0) { - LogError("error: failed to mount device %s.", HISI_HDC); + LOG_ERROR("error: failed to mount device %s.", HISI_HDC); return -1; } @@ -227,31 +227,31 @@ int DoDirectoryMounting(const char *rootfs) /* directory */ int ret = MountDir(rootfs, ASCEND_DRIVER_LIB64_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); return -1; } ret = MountDir(rootfs, ASCEND_DRIVER_TOOLS_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); return -1; } ret = MountDir(rootfs, ASCEND_DRIVER_INC_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); return -1; } ret = MountDir(rootfs, ASCEND_ADDONS_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_ADDONS_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_ADDONS_PATH); return -1; } ret = MountDir(rootfs, ASCEND_DCMI_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_DCMI_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_DCMI_PATH); return -1; } @@ -262,13 +262,13 @@ int DoFileMounting(const char *rootfs) { int ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); return -1; } MountFile(rootfs, ASCEND_SLOG_CONF_PATH); if (ret < 0) { - LogError("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); + LOG_ERROR("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); return -1; } @@ -281,13 +281,13 @@ int DoMounting(const struct ParsedConfig *config) ret = DoDeviceMounting(config->rootfs, config->devices, config->devicesNr); if (ret < 0) { - LogError("error: failed to mount devices."); + LOG_ERROR("error: failed to mount devices."); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - LogError("error: failed to mount ctrl devices."); + LOG_ERROR("error: failed to mount ctrl devices."); return -1; } @@ -297,13 +297,13 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs); if (ret < 0) { - LogError("error: failed to mount files."); + LOG_ERROR("error: failed to mount files."); return -1; } ret = DoDirectoryMounting(config->rootfs); if (ret < 0) { - LogError("error: failed to do mount directories."); + LOG_ERROR("error: failed to do mount directories."); return -1; } diff --git a/cli/src/ns.c b/cli/src/ns.c index e66f696..bb6c437 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -28,7 +28,7 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - LogError("error: failed to set ns: fd(%d).", fd); + LOG_ERROR("error: failed to set ns: fd(%d).", fd); return -1; } @@ -42,13 +42,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - LogError("error: failed to open ns path: %s.", path); + LOG_ERROR("error: failed to open ns path: %s.", path); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - LogError("error: failed to set ns: %s.", path); + LOG_ERROR("error: failed to set ns: %s.", path); close(fd); return -1; } diff --git a/cli/src/options.c b/cli/src/options.c index db65922..c3ddcaf 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -22,7 +22,7 @@ static struct { {NULL, NULL} }; -int ParseRuntimeOptions(const char *options) +void ParseRuntimeOptions(const char *options) { // set defaults value g_runtimeOptions.noDrv = false; @@ -47,7 +47,6 @@ int ParseRuntimeOptions(const char *options) } free(runtimeOptions); - return 0; } bool IsOptionNoDrvSet() diff --git a/cli/src/options.h b/cli/src/options.h index 178e67c..6c8c0b7 100644 --- a/cli/src/options.h +++ b/cli/src/options.h @@ -7,7 +7,7 @@ #include -int ParseRuntimeOptions(const char *options); +void ParseRuntimeOptions(const char *options); bool IsOptionNoDrvSet(); bool IsOptionVerboseSet(); diff --git a/cli/src/utils.c b/cli/src/utils.c index 56cfc3a..7764b15 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -100,19 +100,19 @@ int CreateFile(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { - LogError("error: failed to make parent dir for file: %s", path); + LOG_ERROR("error: failed to make parent dir for file: %s", path); return -1; } char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - LogError("error: failed to resolve path %s.", path); + LOG_ERROR("error: failed to resolve path %s.", path); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - LogError("error: cannot create file: %s.", resolvedPath); + LOG_ERROR("error: cannot create file: %s.", resolvedPath); return -1; } close(fd); diff --git a/cli/test/dt/Depend/public_stub.cpp b/cli/test/dt/Depend/public_stub.cpp index fa6846b..09ce4c2 100644 --- a/cli/test/dt/Depend/public_stub.cpp +++ b/cli/test/dt/Depend/public_stub.cpp @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: 测试框架 +*/ #ifndef __PUBLIC_STUB_H__ #define __PUBLIC_STUB_H__ diff --git a/cli/test/dt/Depend/ut_comm.h b/cli/test/dt/Depend/ut_comm.h index 72d8e5b..9470563 100644 --- a/cli/test/dt/Depend/ut_comm.h +++ b/cli/test/dt/Depend/ut_comm.h @@ -1,3 +1,7 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: 测试框架 +*/ #ifndef __UT_COMM_H__ #define __UT_COMM_H__ diff --git a/cli/test/dt/Depend/ut_main.cpp b/cli/test/dt/Depend/ut_main.cpp index 2ef8fc2..e63fa43 100644 --- a/cli/test/dt/Depend/ut_main.cpp +++ b/cli/test/dt/Depend/ut_main.cpp @@ -1,33 +1,15 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: 测试框架 +*/ #include "gtest/gtest.h" #include -#include -#include using namespace testing; -void handler(int sig) -{ - void *array[20]; - size_t size; - - // get void*'s for all entries on the stack - size = backtrace(array, 20); - - // print out all the frames to stderr - fprintf(stderr, "Error: signal %d:\n", sig); - backtrace_symbols_fd(array, size, STDERR_FILENO); - exit(sig); -} int main(int argc, char* argv[]) { - signal(SIGABRT, handler); - signal(SIGFPE, handler); - signal(SIGILL, handler); - signal(SIGINT, handler); - signal(SIGSEGV, handler); - signal(SIGTERM, handler); - //testing::InitGoogleTest(&argc, argv); int result = testing::Init_UT(argc, argv,true); -- Gitee From 7713324fc698ed4c15420877e0eb4e17ff15562c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 25 Aug 2020 14:39:54 +0800 Subject: [PATCH 063/296] Match-id-d1204c21247d5873e9265ef24e5257584e0f70b7 --- cli/src/logging.h | 29 ++++++++++------------- cli/test/dt/Depend/ut_comm.h | 28 ---------------------- cli/test/dt/Depend/ut_main.cpp | 2 -- cli/test/dt/testcase/gtest_mytestcase.cpp | 12 ++++++---- 4 files changed, 19 insertions(+), 52 deletions(-) delete mode 100644 cli/test/dt/Depend/ut_comm.h diff --git a/cli/src/logging.h b/cli/src/logging.h index 90b47c6..e65032d 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -15,25 +15,20 @@ int OpenLog(const char *logFile); void CloseLog(); void WriteLog(char level, const char *content); -#define LOG(level, fmt, ...) \ - do { \ - char content[BUF_SIZE] = {0}; \ - int ret = sprintf_s(content, BUF_SIZE, fmt, ##__VA_ARGS__); \ - if (ret < 0) { \ - break; \ - } \ - WriteLog(level, (const char *)content); \ - fprintf(stderr, "%s", (const char *)content); \ +#define LOG(level, fmt, ...) \ + do { \ + char _content[BUF_SIZE] = {0}; \ + int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ + if (_ret < 0) { \ + fprintf(stderr, "cannot assemble log content"); \ + } else { \ + WriteLog(level, (const char *)_content); \ + fprintf(stderr, "%s", (const char *)_content); \ + } \ } while (0) -#define LOG_ERROR(fmt, ...) \ - do { \ - LOG('E', fmt, ##__VA_ARGS__); \ - } while (0) +#define LOG_ERROR(fmt, ...) LOG('E', fmt, ##__VA_ARGS__) -#define LOG_WARNING(fmt, ...) \ - do { \ - LOG('W', fmt, ##__VA_ARGS__); \ - } while (0) +#define LOG_WARNING(fmt, ...) LOG('W', fmt, ##__VA_ARGS__) #endif diff --git a/cli/test/dt/Depend/ut_comm.h b/cli/test/dt/Depend/ut_comm.h deleted file mode 100644 index 9470563..0000000 --- a/cli/test/dt/Depend/ut_comm.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: 测试框架 -*/ -#ifndef __UT_COMM_H__ -#define __UT_COMM_H__ - -#include -#include "gtest/gtest.h" -#include "mockcpp/mockcpp.hpp" - - -#define EXTERN_C extern "C" - -#define ENVIRONMENT_AUTO_REGISTER(Name, Environment) \ -namespace { \ -class Name##AutoRegister { \ -public: \ - Name##AutoRegister() { \ - testing::AddGlobalTestEnvironment(new Environment); \ - } \ -}; \ -Name##AutoRegister global##Name; \ -} - - -#endif - diff --git a/cli/test/dt/Depend/ut_main.cpp b/cli/test/dt/Depend/ut_main.cpp index e63fa43..9af0f43 100644 --- a/cli/test/dt/Depend/ut_main.cpp +++ b/cli/test/dt/Depend/ut_main.cpp @@ -10,8 +10,6 @@ using namespace testing; int main(int argc, char* argv[]) { - //testing::InitGoogleTest(&argc, argv); int result = testing::Init_UT(argc, argv,true); - return result; } diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index af43842..bfdd781 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -131,6 +131,11 @@ int stub_Mount_success(const char *src, const char *dst) return 0; } +int stub_Mount_failed(const char *src, const char *dst) +{ + return -1; +} + int stub_mount_failed(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { @@ -415,18 +420,15 @@ TEST_F(Test_Fhho, GetSelfNsPath) EXPECT_LE(0, GetSelfNsPath("mnt", nsPath, BUF_SIZE)); } - TEST(MountDevice, Status1) { char *rootfs="/home"; - MOCKER(mount).stubs().will(invoke(stub_mount_success)); - MOCKER(stat).stubs().will(invoke(stub_stat_success)); - MOCKER(close).stubs().will(invoke(stub_close_success)); - MOCKER(open).stubs().will(invoke(stub_open_success)); + MOCKER(Mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci100"; EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); } + TEST(MountDevice, Status2) { char *rootfs="/home/notexists"; -- Gitee From ed48aa07fa6e3bc226e944060c09296e215f7b70 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 1 Sep 2020 17:39:29 +0800 Subject: [PATCH 064/296] Match-id-91deb16feebbdd97a054015f467ca4b06dfb1e98 --- ci/dependency.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index 96233a5..1e54be2 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -4,7 +4,7 @@ Component Generic - Atlas Platform + CANN ascend-docker-plugin 20.10.0.B010 -- Gitee From f6ab60592d14d128408dd535604de06a07afbc80 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 4 Sep 2020 15:56:53 +0800 Subject: [PATCH 065/296] Match-id-d11fd9bcdad3aec115a2e77b06b05b7ee421e279 --- cli/test/dt/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh index aa5ec4f..c1b569d 100644 --- a/cli/test/dt/build.sh +++ b/cli/test/dt/build.sh @@ -95,11 +95,14 @@ run_lcov_cli() cd ${CUR_DIR}/build ./ut_demo cd ${SRC_ROOT}/.. - lcov --no-external -o result.info -b . -d . -c - genhtml result.info -o Report + ENABLE_BRANCH_COV="--rc lcov_branch_coverage=1" + lcov --no-external -o result.info -b . -d . -c $ENABLE_BRANCH_COV + genhtml --branch-coverage result.info -o Report $ENABLE_BRANCH_COV cd ${CUR_DIR} mkdir xml cp -f buildDTCenter.xml ./xml/test_detail.xml + mkdir html + cp -rf ${SRC_ROOT}/../Report/* ./html/ echo "-------------run_ut cli end-------------------" } -- Gitee From 4a3a338ea2d6db3201271edfb4f2e8a7879d9543 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 8 Sep 2020 21:12:39 +0800 Subject: [PATCH 066/296] Match-id-38e2eab15a40447f44b5c119a3c68cb14e9a3847 --- cli/src/cgrp.c | 2 +- cli/src/logging.h | 1 - cli/src/main.c | 2 +- cli/src/ns.c | 1 - install/deb/src/main.c | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index d94e2dc..f647e09 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -61,7 +61,7 @@ bool CheckSubStr(char **pLine, const char *subsys) } typedef char *(*ParseFileLine)(char *, const char *); -int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath) +int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) { FILE *fp = NULL; char *result = NULL; diff --git a/cli/src/logging.h b/cli/src/logging.h index e65032d..1361e2f 100644 --- a/cli/src/logging.h +++ b/cli/src/logging.h @@ -6,7 +6,6 @@ #define _LOGGING_H #include -#include #include "securec.h" #include "basic.h" diff --git a/cli/src/main.c b/cli/src/main.c index 8cd69f0..b312edc 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -125,7 +125,7 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu return 0; } -static inline bool IsCmdArgsValid(struct CmdArgs *args) +static inline bool IsCmdArgsValid(const struct CmdArgs *args) { return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } diff --git a/cli/src/ns.c b/cli/src/ns.c index bb6c437..4e06333 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -8,7 +8,6 @@ #include #include #include -#include "basic.h" #include "securec.h" #include "logging.h" diff --git a/install/deb/src/main.c b/install/deb/src/main.c index cf1f350..924596a 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -2,11 +2,11 @@ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker */ -#include "cJSON.h" #include #include #include #include +#include "cJSON.h" #define MAX_JSON_FILE_SIZE 65535 #define NUM_ARGS 4 -- Gitee From df55faf01c7a7b67d2736e3610938c64eb8cd879 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 12 Sep 2020 15:05:05 +0800 Subject: [PATCH 067/296] Match-id-5d05b1d5e3285542013bbd1226e736c312838cf5 --- ci/dependency.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index 1e54be2..bc23abc 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -4,7 +4,7 @@ Component Generic - CANN + MindStudio ascend-docker-plugin 20.10.0.B010 -- Gitee From 694c4a084583d21400ad1ecb1614a63897dc251c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 15 Sep 2020 20:25:32 +0800 Subject: [PATCH 068/296] Match-id-333af697bff0299c9522aeb1f41de79301684546 --- build/build.sh | 231 +++++++++++++------------------ build/scripts/help.info | 5 + build/scripts/mkselfmodify.patch | 228 ++++++++++++++++++++++++++++++ build/scripts/run_main.sh | 158 +++++++++++++++++++++ ci/dependency.xml | 14 ++ hook/main.go | 15 +- install/deb/src/main.c | 44 +++--- runtime/main.go | 19 +-- 8 files changed, 545 insertions(+), 169 deletions(-) create mode 100644 build/scripts/help.info create mode 100644 build/scripts/mkselfmodify.patch create mode 100644 build/scripts/run_main.sh diff --git a/build/build.sh b/build/build.sh index c30d13b..47a4db3 100644 --- a/build/build.sh +++ b/build/build.sh @@ -20,15 +20,6 @@ HOOKSRCNAME="main.go" RUNTIMEDIR=${ROOT}/runtime RUNTIMESRCNAME="main.go" -DEBPACK=${ROOT}/debpack -BINDIR=${DEBPACK}/usr/bin -DEBDIR=${DEBPACK}/DEBIAN - -RPMPACK=${ROOT}/rpmpack -RPMSOURCESDIR=${RPMPACK}/SOURCES -RPMSPECDIR=${RPMPACK}/SPECS - - CLISRCPATH=`find ${CLIDIR} -name "${CLISRCNAME}"` CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} INSTALLHELPERSRCPATH=`find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}"` @@ -38,144 +29,114 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -SOFT_VERSION=`cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2` -VERSION=$SOFT_VERSION -RELEASE="1" -PACKAGENAEM="ascend-docker-runtime" +VERSION=`cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2` +PACKAGENAME="Ascend-docker-runtime" CPUARCH=`uname -m` -funcbuild(){ -echo "make cli" -[ -d "${CLISRCDIR}/build" ]&&rm -rf ${CLISRCDIR}/build -mkdir ${CLISRCDIR}/build&&cd ${CLISRCDIR}/build -cmake ../ -make clean -make - -echo "make installhelper" -[ -d "${INSTALLHELPERSRCDIR}/build" ]&&rm -rf ${INSTALLHELPERSRCDIR}/build -mkdir ${INSTALLHELPERSRCDIR}/build&&cd ${INSTALLHELPERSRCDIR}/build -cmake ../ -make clean -make - -[ -d "${ROOT}/opensource/src" ]&&rm -rf ${ROOT}/opensource/src -mkdir ${ROOT}/opensource/src -/bin/cp -rf ${HOOKSRCDIR}/vendor/* ${ROOT}/opensource/src -export GOPATH="${GOPATH}:${ROOT}/opensource" -export GO111MODULE=off - -echo "make hook" -[ -d "${HOOKSRCDIR}/build" ]&&rm -rf ${HOOKSRCDIR}/build -mkdir ${HOOKSRCDIR}/build&&cd ${HOOKSRCDIR}/build -go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} -mv main ascend-docker-hook - -echo "make runtime" -[ -d "${RUNTIMESRCDIR}/build" ]&&rm -rf ${RUNTIMESRCDIR}/build -mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build -go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} -mv main ascend-docker-runtime -} - -fillcontrol(){ -sed -i "1i\Package: ${PACKAGENAEM}" ${DEBDIR}/control -sed -i "2a\Architecture: all" ${DEBDIR}/control -sed -i "3a\Version: ${VERSION}" ${DEBDIR}/control +function build_bin() +{ + echo "make cli" + [ -d "${CLISRCDIR}/build" ] && rm -rf ${CLISRCDIR}/build + mkdir ${CLISRCDIR}/build && cd ${CLISRCDIR}/build + cmake ../ + make clean + make + + echo "make installhelper" + [ -d "${INSTALLHELPERSRCDIR}/build" ] && rm -rf ${INSTALLHELPERSRCDIR}/build + mkdir ${INSTALLHELPERSRCDIR}/build && cd ${INSTALLHELPERSRCDIR}/build + cmake ../ + make clean + make + + [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src + mkdir ${ROOT}/opensource/src + /bin/cp -rf ${HOOKSRCDIR}/vendor/* ${ROOT}/opensource/src + export GOPATH="${GOPATH}:${ROOT}/opensource" + export GO111MODULE=off + + echo "make hook" + [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build + mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build + go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + mv main ascend-docker-hook + + echo "make runtime" + [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build + mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build + go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + mv main ascend-docker-runtime } -funcmakedeb(){ -cd ${BUILD} -mkdir -pv {${DEBDIR},${BINDIR}} -/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${BINDIR} -FILECNT=`ls -l ${BINDIR} |grep "^-"|wc -l` -echo "prepare package $FILECNT bins" -if [ $FILECNT -ne 4 ]; then -exit 1 -fi -CONPATH=`find ${INSTALLHELPERDIR} -name "control"` -INSTPATH=`find ${INSTALLHELPERDIR} -name "postinst"` -RMPATH=`find ${INSTALLHELPERDIR} -name "prerm"` -/bin/cp -f ${CONPATH} ${INSTPATH} ${RMPATH} ${DEBDIR} -echo ${INSTPATH} -fillcontrol -chmod 555 ${DEBDIR}/postinst -chmod 555 ${DEBDIR}/prerm -dpkg-deb -b ${DEBPACK} ${PACKAGENAEM}_${VERSION}-${RELEASE}_${CPUARCH}.deb -DEBS=`find ${BUILD} -name "*.deb"` -/bin/cp ${DEBS} ${OUTPUT} -} - -funcfillspec(){ -sed -i "4a\BuildArch: $CPUARCH" ${RPMSPECDIR}/*.spec +function build_run_package() +{ + cd ${BUILD} + mkdir run_pkg + + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg + FILECNT=`ls -l run_pkg |grep "^-"|wc -l` + echo "prepare package $FILECNT bins" + if [ $FILECNT -ne 4 ]; then + exit 1 + fi + + /bin/cp -f scripts/run_main.sh run_pkg + chmod 550 run_pkg/run_main.sh + + RUN_PKG_NAME="${PACKAGENAME}-${CPUARCH}.run" + DATE=`date -u "+%Y-%m-%d"` + bash makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ + --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh + mv ${RUN_PKG_NAME} ${OUTPUT} } -funcmakerpm(){ -mkdir -pv ${RPMPACK}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} -/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* ${RPMSOURCESDIR} -FILECNT=`ls -l ${RPMSOURCESDIR} |grep "^-"|wc -l` -echo "prepare package $FILECNT bins" -if [ $FILECNT -ne 4 ]; then -exit 1 -fi -SPECPATH=`find ${INSTALLHELPERDIR} -name "*.spec"` -sed -i "2c Version: ${SOFT_VERSION}" ${SPECPATH} -dos2unix ${SPECPATH} -/bin/cp -f ${SPECPATH} ${RPMSPECDIR} -funcfillspec -rpmbuild --define "_topdir ${RPMPACK}" -rpmbuild --showrc | grep topdir -echo ${RPMPACK} -echo "%_topdir ${RPMPACK}" > ~/.rpmmacros -rpmbuild -bb ${RPMPACK}/SPECS/ascend-docker-plgugin.spec -RPMS=`find ${RPMPACK} -name "*.rpm"` -/bin/cp ${RPMS} ${OUTPUT} - } - -funcmakeclean(){ -[ -d "${RPMPACK}" ]&&rm -rf ${RPMPACK} -[ -d "${DEBPACK}" ]&&rm -rf ${DEBPACK} -[ -d "${OUTPUT}" ]&&cd ${OUTPUT}&&rm -rf * +function make_clean() +{ + [ -d "${OUTPUT}" ] && cd ${OUTPUT}&&rm -rf * } -funcmakepull(){ -cd ${OPENSRC} -wget -O cJSON.tar.gz https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz --no-check-certificate +function make_pull() +{ + cd ${OPENSRC} + wget -O cJSON.tar.gz https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz --no-check-certificate } -funcmakeunzip(){ -cd ${OPENSRC} -tar -xzvf cJSON*.tar.gz -CJSONS=`find . -name "cJSON.*"` -CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson -/bin/cp -f ${CJSONS} ${CJSONSLIB} - -cd ${PLATFORM} -tar -xzvf HuaweiSecureC.tar.gz -SECURECSRC=`find . -name "src"` -SECURECINC=`find . -name "include"` - -SECURECLIB=${INSTALLHELPERDIR}/deb/src/HuaweiSecureC -/bin/cp -f ${SECURECSRC}/* ${SECURECLIB} -/bin/cp -f ${SECURECINC}/* ${SECURECLIB} - -SECURECLIB=${CLIDIR}/src/HuaweiSecureC -/bin/cp -f ${SECURECSRC}/* ${SECURECLIB} -/bin/cp -f ${SECURECINC}/* ${SECURECLIB} +function make_unzip() +{ + cd ${OPENSRC} + tar -xzvf cJSON*.tar.gz + CJSONS=`find . -name "cJSON.*"` + CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson + /bin/cp -f ${CJSONS} ${CJSONSLIB} + + unzip makeself-release-*.zip + rm -f makeself-release-*.zip + MAKESELF_DIR=`find . -name "makeself-release-*"` + /bin/cp -f ${MAKESELF_DIR}/makeself.sh ${BUILD} + /bin/cp -f ${MAKESELF_DIR}/makeself-header.sh ${BUILD} + cd ${BUILD} && /bin/cp -f scripts/mkselfmodify.patch ./ + patch -p0 < mkselfmodify.patch + rm -f mkselfmodify.patch + + cd ${PLATFORM} + tar -xzvf HuaweiSecureC.tar.gz + SECURECSRC=`find . -name "src"` + SECURECINC=`find . -name "include"` + + SECURECLIB=${INSTALLHELPERDIR}/deb/src/HuaweiSecureC + /bin/cp -f ${SECURECSRC}/* ${SECURECLIB} + /bin/cp -f ${SECURECINC}/* ${SECURECLIB} + + SECURECLIB=${CLIDIR}/src/HuaweiSecureC + /bin/cp -f ${SECURECSRC}/* ${SECURECLIB} + /bin/cp -f ${SECURECINC}/* ${SECURECLIB} } -funcmakeclean +make_clean if [ $1 == "pull" ]; then -funcmakepull -fi - -funcmakeunzip -funcbuild - -if [ -f /etc/centos-release ]; then -funcmakerpm + make_pull fi -if [ -f /etc/debian_version ]; then -funcmakedeb -fi \ No newline at end of file +make_unzip +build_bin +build_run_package diff --git a/build/scripts/help.info b/build/scripts/help.info new file mode 100644 index 0000000..2bbe1f1 --- /dev/null +++ b/build/scripts/help.info @@ -0,0 +1,5 @@ + --install Install into this system + --install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime) + --uninstall Uninstall the installed ascend-docker-runtime tool + --upgrade Upgrade the installed ascend-docker-runtime tool + --devel Install as devel mode \ No newline at end of file diff --git a/build/scripts/mkselfmodify.patch b/build/scripts/mkselfmodify.patch new file mode 100644 index 0000000..09c872c --- /dev/null +++ b/build/scripts/mkselfmodify.patch @@ -0,0 +1,228 @@ +--- makeself-header.sh 2020-04-27 18:59:03.000000000 +0800 ++++ makeself-header_new.sh 2020-07-09 18:04:43.044000000 +0800 +@@ -1,12 +1,9 @@ + cat << EOF > "$archname" +-#!/bin/sh ++#!/bin/bash + # This script was generated using Makeself $MS_VERSION + # The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) + + ORIG_UMASK=\`umask\` +-if test "$KEEP_UMASK" = n; then +- umask 077 +-fi + + CRCsum="$CRCsum" + MD5="$MD5sum" +@@ -16,6 +13,9 @@ + export USER_PWD + ARCHIVE_DIR=`dirname \$0` + export ARCHIVE_DIR ++name_of_file="\$0 " ++pwd_of_file="\$PWD " ++ + + label="$LABEL" + script="$SCRIPT" +@@ -148,6 +148,24 @@ + MS_Help() + { + cat << EOH >&2 ++Usage: \$0 [options] ++Options: ++ --help | -h Print this message ++ --info Print embedded info : title, default target directory, embedded script ... ++ --list Print the list of files in the archive ++ --check Checks integrity of the archive ++ --quiet Quiet install mode, skip human-computer interactions ++ --noexec Do not run embedded script ++ --extract= Extract directly to a target directory (absolute or relative) ++ Usually used with --noexec to just extract files without running ++ --tar arg1 [arg2 ...] Access the contents of the archive through the tar command ++\${helpheader} ++EOH ++} ++ ++MS_Help1() ++{ ++ cat << EOH >&2 + \${helpheader}Makeself version $MS_VERSION + 1) Getting help or info about \$0 : + \$0 --help Print this message +@@ -212,7 +230,7 @@ + fi + sha=\`echo \$SHA | cut -d" " -f\$i\` + if test x"\$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then +- test x"\$verb" = xy && echo " \$1 does not contain an embedded SHA256 checksum." >&2 ++ test x"\$verb" = xy + else + shasum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$SHA_PATH \$SHA_ARG" | cut -b-64\`; + if test x"\$shasum" != x"\$sha"; then +@@ -230,7 +248,7 @@ + fi + md5=\`echo \$MD5 | cut -d" " -f\$i\` + if test x"\$md5" = x00000000000000000000000000000000; then +- test x"\$verb" = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 ++ test x"\$verb" = xy + else + md5sum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$MD5_PATH \$MD5_ARG" | cut -b-32\`; + if test x"\$md5sum" != x"\$md5"; then +@@ -243,7 +261,7 @@ + fi + fi + if test x"\$crc" = x0000000000; then +- test x"\$verb" = xy && echo " \$1 does not contain a CRC checksum." >&2 ++ test x"\$verb" = xy + else + sum1=\`MS_dd_Progress "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\` + if test x"\$sum1" != x"\$crc"; then +@@ -300,6 +318,22 @@ + eval \$finish; exit 15 + } + ++Script_Args_Check() ++{ ++ script_supported_args=\$(echo \${helpheader} | grep -o -P "\-\-[^ ]+" | awk -F"=" {'print \$1'}) ++ arg_to_test=\$(echo \$1|awk -F"=" {'print \$1'}) ++ ++ for arg in \${script_supported_args[@]}; ++ do ++ if test x"\$arg_to_test" = x"\$arg" ;then ++ return ++ fi ++ done ++ ++ MS_Help ++ exit 1 ++} ++ + finish=true + xterm_loop= + noprogress=$NOPROGRESS +@@ -312,7 +346,7 @@ + + initargs="\$@" + +-while true ++while [ -n "\$*" ] + do + case "\$1" in + -h | --help) +@@ -324,10 +358,6 @@ + noprogress=y + shift + ;; +- --accept) +- accept=y +- shift +- ;; + --info) + echo Identification: "\$label" + echo Target directory: "\$targetdir" +@@ -372,14 +402,6 @@ + echo SKIP=\"\$skip\" + exit 0 + ;; +- --lsm) +-cat << EOLSM +-EOF +-eval "$LSM_CMD" +-cat << EOF >> "$archname" +-EOLSM +- exit 0 +- ;; + --list) + echo Target directory: \$targetdir + offset=\`head -n "\$skip" "\$0" | wc -c | tr -d " "\` +@@ -422,10 +444,10 @@ + keep=y + shift + ;; +- --target) ++ --extract=*) + keep=y +- targetdir="\${2:-.}" +- if ! shift 2; then MS_Help; exit 1; fi ++ targetdir=\`echo \$1 | cut -d"=" -f2 \` ++ if ! shift; then MS_Help; exit 1; fi + ;; + --noprogress) + noprogress=y +@@ -470,19 +492,34 @@ + cleanupargs="\$2" + if ! shift 2; then MS_help; exit 1; fi + ;; +- --) +- shift +- break ;; +- -*) +- echo Unrecognized flag : "\$1" >&2 +- MS_Help +- exit 1 +- ;; + *) +- break ;; ++ Script_Args_Check \$1 ++ scriptargs="\$scriptargs \$1" ++ shift ++ ;; + esac + done + ++quiet_para="" ++ ++if test x"\$quiet" = xy; then ++ quiet_para="--quiet " ++fi ++ ++keep_para="" ++ ++if test x"\$keep" = xy; then ++ keep_para="--keep " ++fi ++ ++confirm_para="" ++ ++if test x"\$verbose" = xy; then ++ confirm_para="--confirm " ++fi ++ ++ ++scriptargs="--\$name_of_file""--\$pwd_of_file""\$quiet_para""\$keep_para""\$confirm_para""\$scriptargs" + if test x"\$quiet" = xy -a x"\$verbose" = xy; then + echo Cannot be verbose and quiet at the same time. >&2 + exit 1 +@@ -559,7 +596,7 @@ + fi + mkdir \$dashp "\$tmpdir" || { + echo 'Cannot create target directory' \$tmpdir >&2 +- echo 'You should try option --target dir' >&2 ++ echo 'You should try option --extract=' >&2 + eval \$finish + exit 1 + } +@@ -643,11 +680,19 @@ + fi + + if test x"\$verbose" = x"y"; then +- MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " +- read yn +- if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then +- eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; +- fi ++ yn="x" ++ while test x"\$yn" != x -a x"\$yn" != xy -a x"\$yn" != xY -a x"\$yn" != xn -a x"\$yn" != xN ++ do ++ MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " ++ read yn ++ if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then ++ eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; ++ elif test x"\$yn" = xn -o x"\$yn" = xN; then ++ echo "Unable to decompress \$script ,because of aborting! ";res=\$? ++ else ++ echo "Input value is unacceptable,please try again." ++ fi ++ done + else + eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$? + fi diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh new file mode 100644 index 0000000..2c830c2 --- /dev/null +++ b/build/scripts/run_main.sh @@ -0,0 +1,158 @@ +#!/bin/bash + +DOCKER_CONFIG_DIR=/etc/docker +INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime + +function install() +{ + echo 'installing ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + mkdir -p ${INSTALL_PATH} + fi + + cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime + cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook + cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-runtime + chmod 550 ${INSTALL_PATH}/ascend-docker-hook + chmod 550 ${INSTALL_PATH}/ascend-docker-cli + echo 'install executable files success' + + if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then + mkdir -p ${DOCKER_CONFIG_DIR} + fi + + SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" + DST="${DOCKER_CONFIG_DIR}/daemon.json" + ./ascend-docker-plugin-install-helper add ${DST} ${SRC} ${INSTALL_PATH}/ascend-docker-runtime + if [ "$?" != "0" ]; then + echo 'create damon.json failed' + exit 1 + fi + + mv ${SRC} ${DST} + echo 'create damom.json success' + echo 'please reboot docker daemon to take effect' +} + +function uninstall() +{ + echo 'uninstalling ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + echo 'WARNING: the specified install path does not exist, skipping' + exit 0 + fi + + rm -rf ${INSTALL_PATH} + echo 'remove executable files success' + + SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" + DST="${DOCKER_CONFIG_DIR}/daemon.json" + if [ ! -f "${DST}" ]; then + exit 0 + fi + + ./ascend-docker-plugin-install-helper rm ${DST} ${SRC} + if [ "$?" != "0" ]; then + echo 'ERROR: del damon.json failed' + exit 1 + fi + + mv ${SRC} ${DST} + echo 'del damom.json success' +} + +function upgrade() +{ + echo 'upgrading ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + echo 'ERROR: the specified install path does not exist, stopping upgrading' + exit 1 + fi + + cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime + cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook + cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-runtime + chmod 550 ${INSTALL_PATH}/ascend-docker-hook + chmod 550 ${INSTALL_PATH}/ascend-docker-cli + + echo 'upgrade ascend docker runtime success' +} + +INSTALL_FLAG=n +INSTALL_PATH_FLAG=n +UNINSTALL_FLAG=n +UPGRADE_FLAG=n +DEVEL_FLAG=n + +while true +do + case "$3" in + --install) + INSTALL_FLAG=y + shift + ;; + --uninstall) + UNINSTALL_FLAG=y + shift + ;; + --install-path=*) + INSTALL_PATH_FLAG=y + INSTALL_PATH=`echo $3 | cut -d"=" -f2 ` + INSTALL_PATH=`echo ${INSTALL_PATH} | sed "s/\/*$//g"` + shift + ;; + --upgrade) + UPGRADE_FLAG=y + shift + ;; + --devel) + DEVEL_FLAG=y + shift + ;; + *) + break + ;; + esac +done + +# 安装为相对路径时报错 +if [ "${INSTALL_PATH}" == ".." ] || [ "${INSTALL_PATH}" == "." ]; then + echo "error :Please follow the installation address after the --install-path=" + exit 1 +fi + +# 单纯只有--install-path的判定处理 +if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ + [ "${INSTALL_FLAG}" == "n" ] && \ + [ "${UNINSTALL_FLAG}" == "n" ] && \ + [ "${UPGRADE_FLAG}" == "n" ] && \ + [ "${DEVEL_FLAG}" == "n" ]; then + echo "Error:only input command. When use --install-path you also need intput --install or --uninstall or --upgrade or --devel" + exit 1 +fi + +# 需root用户权限 +if [ "${USER}" != "root" ]; then + echo 'please run with root permission' + exit 1 +fi + +if [ "${INSTALL_FLAG}" == "y" ] || [ "${DEVEL_FLAG}" == "y" ]; then + install + exit 0 +fi + +if [ "${UNINSTALL_FLAG}" == "y" ]; then + uninstall + exit 0 +fi + +if [ "${UPGRADE_FLAG}" == "y" ]; then + upgrade + exit 0 +fi diff --git a/ci/dependency.xml b/ci/dependency.xml index bc23abc..bc4f523 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -32,6 +32,20 @@ + + 3rd-party + Generic + + makeself-release-2.4.2.zip + 05836ECT + + + + /* + opensource + + + BVersion diff --git a/hook/main.go b/hook/main.go index 3b9c96e..ab388e8 100644 --- a/hook/main.go +++ b/hook/main.go @@ -10,7 +10,6 @@ import ( "fmt" "log" "os" - "os/exec" "path" "sort" "strconv" @@ -25,7 +24,7 @@ const ( ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" ascendRuntimeOptions = "ASCEND_RUNTIME_OPTIONS" ascendDockerCli = "ascend-docker-cli" - defaultAscendDockerCli = "/usr/bin/ascend-docker-cli" + defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli" borderNum = 2 kvPairSize = 2 @@ -221,14 +220,14 @@ func doPrestartHook() error { return fmt.Errorf("failed to parse runtime options: %w", err) } - cliPath, err := exec.LookPath(ascendDockerCliName) + currentExecPath, err := os.Executable() if err != nil { - _, err = os.Stat(defaultAscendDockerCliName) - if err != nil { - return fmt.Errorf("could not found ascend docker cli") - } + return fmt.Errorf("cannot get the path of ascend-docker-hook: %w", err) + } - cliPath = defaultAscendDockerCliName + cliPath := path.Join(path.Dir(currentExecPath), ascendDockerCliName) + if _, err = os.Stat(cliPath); err != nil { + return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %w", cliPath, err) } args := append([]string{cliPath}, diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 924596a..dbd1070 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -9,13 +9,14 @@ #include "cJSON.h" #define MAX_JSON_FILE_SIZE 65535 -#define NUM_ARGS 4 +#define MIN_ARGS_NUM 4 +#define ADD_CMD_ARGS_NUM 5 #define ADD_CMD "add" #define RM_CMD "rm" #define CMD_INDEX 1 #define FINAL_FILE_INDEX 2 #define TEMP_FILE_INDEX 3 -#define ASCEND_RUNTIME_PATH_VALUE "/usr/bin/ascend-docker-runtime" +#define RUNTIME_PATH_INDEX 4 #define ASCEND_RUNTIME_PATH_KEY "path" #define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" #define RUNTIME_KEY "runtimes" @@ -38,7 +39,7 @@ void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) text[size] = '\0'; } -cJSON *CreateAscendRuntimeInfo() +cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { cJSON *root = NULL; root = cJSON_CreateObject(); @@ -46,15 +47,15 @@ cJSON *CreateAscendRuntimeInfo() fprintf(stderr, "create ascend runtime info root err\n"); return NULL; } - + cJSON *newString = NULL; - newString = cJSON_CreateString(ASCEND_RUNTIME_PATH_VALUE); + newString = cJSON_CreateString(runtimePath); if (newString == NULL) { fprintf(stderr, "create ascend runtime info path value err\n"); cJSON_Delete(root); return NULL; } - + cJSON *paraArray = NULL; paraArray = cJSON_CreateArray(); if (paraArray == NULL) { @@ -70,10 +71,10 @@ cJSON *CreateAscendRuntimeInfo() return root; } -cJSON *CreateRuntimes() +cJSON *CreateRuntimes(const char *runtimePath) { cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(); + ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { fprintf(stderr, "create ascendruntime err\n"); return NULL; @@ -111,11 +112,11 @@ int DelJsonContent(cJSON *root, const char *key) return 0; } -cJSON *CreateContent() +cJSON *CreateContent(const char *runtimePath) { /* 插入ascend runtime */ cJSON *runtimes = NULL; - runtimes = CreateRuntimes(); + runtimes = CreateRuntimes(runtimePath); if (runtimes == NULL) { fprintf(stderr, "create runtimes err\n"); return NULL; @@ -145,7 +146,7 @@ cJSON *CreateContent() return root; } -cJSON *ModifyContent(FILE *pf) +cJSON *ModifyContent(FILE *pf, const char *runtimePath) { char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -161,7 +162,7 @@ cJSON *ModifyContent(FILE *pf) cJSON *runtimes = NULL; runtimes = cJSON_GetObjectItem(root, "runtimes"); if (runtimes == NULL) { - runtimes = CreateRuntimes(); + runtimes = CreateRuntimes(runtimePath); if (runtimes == NULL) { cJSON_Delete(root); return NULL; @@ -174,7 +175,7 @@ cJSON *ModifyContent(FILE *pf) return NULL; } cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(); + ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { cJSON_Delete(root); return NULL; @@ -236,15 +237,15 @@ cJSON *RemoveContent(FILE *pf) } -int DetectAndCreateJsonFile(const char *filePath, const char *tempPath) +int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { - root = CreateContent(); + root = CreateContent(runtimePath); } else { - root = ModifyContent(pf); + root = ModifyContent(pf, runtimePath); fclose(pf); } @@ -302,14 +303,21 @@ int CreateRevisedJsonFile(const char *filePath, const char *tempPath) /* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ int main(int argc, char *argv[]) { - if (argc != NUM_ARGS) { + if (argc < MIN_ARGS_NUM) { return -1; } + printf("%s\n", argv[FINAL_FILE_INDEX]); printf("%s\n", argv[TEMP_FILE_INDEX]); printf("%s\n", argv[CMD_INDEX]); + if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { - return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); + if (argc != ADD_CMD_ARGS_NUM) { + return -1; + } + + return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); } + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); } diff --git a/runtime/main.go b/runtime/main.go index e5c899f..2ad30f9 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -11,6 +11,7 @@ import ( "log" "os" "os/exec" + "path" "strings" "syscall" @@ -20,7 +21,7 @@ import ( const ( loggingPrefix = "ascend-docker-runtime" hookCli = "ascend-docker-hook" - hookDefaultFilePath = "/usr/bin/ascend-docker-hook" + hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" dockerRuncFile = "docker-runc" runcFile = "runc" ) @@ -71,12 +72,14 @@ var execRunc = func() error { } func addHook(spec *specs.Spec) error { - path, err := exec.LookPath(hookCliPath) + currentExecPath, err := os.Executable() if err != nil { - path = hookDefaultFile - if _, err = os.Stat(path); err != nil { - return fmt.Errorf("cannot find the hook") - } + return fmt.Errorf("cannot get the path of ascend-docker-runtime: %w", err) + } + + hookCliPath = path.Join(path.Dir(currentExecPath), hookCli) + if _, err = os.Stat(hookCliPath); err != nil { + return fmt.Errorf("cannot find ascend-docker-hook executable file at %s: %w", hookCliPath, err) } if spec.Hooks == nil { @@ -91,8 +94,8 @@ func addHook(spec *specs.Spec) error { } spec.Hooks.Prestart = append(spec.Hooks.Prestart, specs.Hook{ - Path: path, - Args: []string{path}, + Path: hookCliPath, + Args: []string{hookCliPath}, }) return nil -- Gitee From 6dad957f7524cfb2df77bede6ecdd36a53d5c13a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 16 Sep 2020 09:51:15 +0800 Subject: [PATCH 069/296] Match-id-8246a8ce4463a91ae9777b5f47cd93e4135f15a3 --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 47a4db3..93d13ff 100644 --- a/build/build.sh +++ b/build/build.sh @@ -83,7 +83,7 @@ function build_run_package() /bin/cp -f scripts/run_main.sh run_pkg chmod 550 run_pkg/run_main.sh - RUN_PKG_NAME="${PACKAGENAME}-${CPUARCH}.run" + RUN_PKG_NAME="${PACKAGENAME}-${VERSION}-${CPUARCH}.run" DATE=`date -u "+%Y-%m-%d"` bash makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh -- Gitee From ccc59a6532da693ca24427c6ecad972c5be79aec Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 22 Sep 2020 17:34:31 +0800 Subject: [PATCH 070/296] Match-id-7f74a97ab93ea1b81de4d4e42a86c7d8fc591afc --- cli/src/basic.h | 3 ++- cli/src/mount.c | 18 +++++++++++++++++- cli/test/dt/testcase/gtest_mytestcase.cpp | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 44620b4..c97b389 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -17,7 +17,8 @@ #define ASCEND_DRIVER_INC_PATH "/usr/local/Ascend/driver/include" #define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" #define ASCEND_DCMI_PATH "/usr/local/dcmi" -#define ASCEND_NPU_SMI_PATH "/usr/local/sbin/npu-smi" +#define ASCEND_NPU_SMI_PATH "/usr/local/bin/npu-smi" +#define ASCEND_NPU_SMI_PATH_OLD "/usr/local/sbin/npu-smi" #define ASCEND_SLOG_CONF_PATH "/var/log/npu/conf/slog/slog.conf" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 diff --git a/cli/src/mount.c b/cli/src/mount.c index 8f514b0..333b303 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -151,6 +151,11 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } + if (!S_ISREG(srcStat.st_mode)) { + LOG_ERROR("error: this should be a regular file to be mounted: %s.", filepath); + return -1; + } + ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); @@ -183,6 +188,11 @@ int MountDir(const char *rootfs, const char *src) return 0; } + if (!S_ISDIR(srcStat.st_mode)) { + LOG_ERROR("error: this should be a directory to be mounted: %s.", src); + return -1; + } + ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { LOG_ERROR("error: failed to make dir: %s.", dst); @@ -266,7 +276,13 @@ int DoFileMounting(const char *rootfs) return -1; } - MountFile(rootfs, ASCEND_SLOG_CONF_PATH); + ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH_OLD); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH_OLD); + return -1; + } + + ret = MountFile(rootfs, ASCEND_SLOG_CONF_PATH); if (ret < 0) { LOG_ERROR("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); return -1; diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index bfdd781..c04b2df 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -667,7 +667,7 @@ TEST(MountDir, Status5) unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; int ret = MountDir(rootfs, "/dev/random", reMountRwFlag); GlobalMockObject::verify(); - EXPECT_EQ(0, ret); + EXPECT_EQ(-1, ret); } TEST(DoCtrlDeviceMounting, Status1) -- Gitee From 252fe23bd349e59bf23ab1a16aecf633d22a9c05 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 14 Oct 2020 11:57:20 +0800 Subject: [PATCH 071/296] Match-id-3fdc425ce739d29f9a9ac37dcdbad364e616755e --- build/build.sh | 3 ++- build/scripts/run_main.sh | 27 ++++++++++++++------------- build/scripts/uninstall.sh | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 build/scripts/uninstall.sh diff --git a/build/build.sh b/build/build.sh index 93d13ff..169e926 100644 --- a/build/build.sh +++ b/build/build.sh @@ -74,9 +74,10 @@ function build_run_package() mkdir run_pkg /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg + /bin/cp -f scripts/uninstall.sh run_pkg FILECNT=`ls -l run_pkg |grep "^-"|wc -l` echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 4 ]; then + if [ $FILECNT -ne 5 ]; then exit 1 fi diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 2c830c2..abe9692 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -14,9 +14,16 @@ function install() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + + mkdir -p ${INSTALL_PATH}/script + cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh + chmod 550 ${INSTALL_PATH}/script/uninstall.sh + echo 'install executable files success' if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then @@ -45,22 +52,12 @@ function uninstall() exit 0 fi + ${INSTALL_PATH}/script/uninstall.sh + echo 'remove daemon.json setting success' + rm -rf ${INSTALL_PATH} echo 'remove executable files success' - SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" - DST="${DOCKER_CONFIG_DIR}/daemon.json" - if [ ! -f "${DST}" ]; then - exit 0 - fi - - ./ascend-docker-plugin-install-helper rm ${DST} ${SRC} - if [ "$?" != "0" ]; then - echo 'ERROR: del damon.json failed' - exit 1 - fi - - mv ${SRC} ${DST} echo 'del damom.json success' } @@ -76,9 +73,13 @@ function upgrade() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + chmod 550 ${INSTALL_PATH}/script/uninstall.sh echo 'upgrade ascend docker runtime success' } diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh new file mode 100644 index 0000000..93ba8a2 --- /dev/null +++ b/build/scripts/uninstall.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +ROOT=$(cd `dirname $0`; pwd)/.. +DST='/etc/docker/daemon.json' +SRC="${DST}.${PPID}" + +if [ ! -f "${DST}" ]; then + exit 0 +fi + +${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then + echo 'ERROR: del damon.json failed' + exit 1 +fi + +mv ${SRC} ${DST} -- Gitee From a70c4c07b0c9d212ee30d01622ac6f1a61a42e06 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 19 Oct 2020 11:59:21 +0800 Subject: [PATCH 072/296] Match-id-1dfa3a0229c36252b00c078413911cac87225f79 --- build/build.sh | 3 +- build/scripts/base.list | 7 ++ build/scripts/run_main.sh | 15 +++ build/scripts/uninstall.sh | 3 + cli/src/basic.h | 17 +-- cli/src/main.c | 49 ++++++++- cli/src/mount.c | 75 ++++--------- cli/test/dt/testcase/gtest_mytestcase.cpp | 23 ++-- hook/main.go | 124 +++++++++++++++++++++- 9 files changed, 239 insertions(+), 77 deletions(-) create mode 100644 build/scripts/base.list diff --git a/build/build.sh b/build/build.sh index 169e926..c460b26 100644 --- a/build/build.sh +++ b/build/build.sh @@ -75,9 +75,10 @@ function build_run_package() /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg + /bin/cp -f scripts/base.list run_pkg FILECNT=`ls -l run_pkg |grep "^-"|wc -l` echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 5 ]; then + if [ $FILECNT -ne 6 ]; then exit 1 fi diff --git a/build/scripts/base.list b/build/scripts/base.list new file mode 100644 index 0000000..cf1c56f --- /dev/null +++ b/build/scripts/base.list @@ -0,0 +1,7 @@ +/usr/local/Ascend/driver/lib64 +/usr/local/Ascend/driver/tools +/usr/local/Ascend/driver/include +/usr/local/Ascend/add-ons +/usr/local/dcmi +/usr/local/bin/npu-smi +/var/log/npu/conf/slog/slog.conf \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index abe9692..48bd27f 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -1,5 +1,6 @@ #!/bin/bash +ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d DOCKER_CONFIG_DIR=/etc/docker INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime @@ -24,6 +25,13 @@ function install() cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh chmod 550 ${INSTALL_PATH}/script/uninstall.sh + if [ -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} + fi + mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + echo 'install executable files success' if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then @@ -70,16 +78,23 @@ function upgrade() exit 1 fi + if [ ! -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + echo 'ERROR: the configuration directory does not exist' + exit 1 + fi + cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 550 ${INSTALL_PATH}/script/uninstall.sh + chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list echo 'upgrade ascend docker runtime success' } diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 93ba8a2..cb4fbad 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -3,6 +3,7 @@ ROOT=$(cd `dirname $0`; pwd)/.. DST='/etc/docker/daemon.json' SRC="${DST}.${PPID}" +ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d if [ ! -f "${DST}" ]; then exit 0 @@ -15,3 +16,5 @@ if [ "$?" != "0" ]; then fi mv ${SRC} ${DST} + +rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} diff --git a/cli/src/basic.h b/cli/src/basic.h index c97b389..3a628ac 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -7,23 +7,17 @@ #include #include +#include #define DEVICE_NAME "davinci" #define DAVINCI_MANAGER "davinci_manager" #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" -#define ASCEND_DRIVER_LIB64_PATH "/usr/local/Ascend/driver/lib64" -#define ASCEND_DRIVER_TOOLS_PATH "/usr/local/Ascend/driver/tools" -#define ASCEND_DRIVER_INC_PATH "/usr/local/Ascend/driver/include" -#define ASCEND_ADDONS_PATH "/usr/local/Ascend/add-ons" -#define ASCEND_DCMI_PATH "/usr/local/dcmi" -#define ASCEND_NPU_SMI_PATH "/usr/local/bin/npu-smi" -#define ASCEND_NPU_SMI_PATH_OLD "/usr/local/sbin/npu-smi" -#define ASCEND_SLOG_CONF_PATH "/var/log/npu/conf/slog/slog.conf" #define DEFAULT_DIR_MODE 0755 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define DEFAULT_LOG_FILE "/var/log/ascend-docker-runtime.log" +#define MAX_MOUNT_NR 512 #define ALLOW_PATH "/devices.allow" #define ROOT_GAP 4 @@ -38,6 +32,11 @@ struct PathInfo { size_t dstLen; }; +struct MountList { + unsigned int count; + char list[MAX_MOUNT_NR][PATH_MAX]; +}; + struct ParsedConfig { char rootfs[BUF_SIZE]; unsigned int devices[MAX_DEVICE_NR]; @@ -45,6 +44,8 @@ struct ParsedConfig { char containerNsPath[BUF_SIZE]; char cgroupPath[BUF_SIZE]; int originNsFd; + const struct MountList *files; + const struct MountList *dirs; }; void InitParsedConfig(struct ParsedConfig *parsedConfig); diff --git a/cli/src/main.c b/cli/src/main.c index b312edc..88898bf 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -28,6 +28,8 @@ struct CmdArgs { char rootfs[BUF_SIZE]; int pid; char options[BUF_SIZE]; + struct MountList files; + struct MountList dirs; }; static struct option g_cmdOpts[] = { @@ -35,6 +37,8 @@ static struct option g_cmdOpts[] = { {"pid", required_argument, 0, 'p'}, {"rootfs", required_argument, 0, 'r'}, {"options", required_argument, 0, 'o'}, + {"mount-file", required_argument, 0, 'f'}, + {"mount-dir", required_argument, 0, 'i'}, {0, 0, 0, 0} }; @@ -90,7 +94,41 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) return true; } -#define NUM_OF_CMD_ARGS 4 +static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) +{ + if (args->files.count == MAX_MOUNT_NR) { + LOG_ERROR("error: too many files to mount, max number is %u", MAX_MOUNT_NR); + return -1; + } + + char *dst = &args->files.list[args->files.count++][0]; + errno_t err = strcpy_s(dst, PATH_MAX, arg); + if (err != EOK) { + LOG_ERROR("error: failed to copy mount file path: %s", arg); + return false; + } + + return true; +} + +static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) +{ + if (args->dirs.count == MAX_MOUNT_NR) { + LOG_ERROR("error: too many directories to mount, max number is %u", MAX_MOUNT_NR); + return -1; + } + + char *dst = &args->dirs.list[args->dirs.count++][0]; + errno_t err = strcpy_s(dst, PATH_MAX, arg); + if (err != EOK) { + LOG_ERROR("error: failed to copy mount directory path: %s", arg); + return false; + } + + return true; +} + +#define NUM_OF_CMD_ARGS 6 static struct { const char c; @@ -99,7 +137,9 @@ static struct { {'d', DevicesCmdArgParser}, {'p', PidCmdArgParser}, {'r', RootfsCmdArgParser}, - {'o', OptionsCmdArgParser} + {'o', OptionsCmdArgParser}, + {'f', MountFileCmdArgParser}, + {'i', MountDirCmdArgParser} }; static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) @@ -201,6 +241,9 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) return -1; } + config->files = (const struct MountList *)&args->files; + config->dirs = (const struct MountList *)&args->dirs; + return 0; } @@ -258,7 +301,7 @@ int Process(int argc, char **argv) int optionIndex; struct CmdArgs args = {0}; - while ((c = getopt_long(argc, argv, "d:p:r:o", g_cmdOpts, &optionIndex)) != -1) { + while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { LOG_ERROR("error: failed to parse cmd args."); diff --git a/cli/src/mount.c b/cli/src/mount.c index 333b303..c3e8f79 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -151,11 +151,6 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } - if (!S_ISREG(srcStat.st_mode)) { - LOG_ERROR("error: this should be a regular file to be mounted: %s.", filepath); - return -1; - } - ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); @@ -188,11 +183,6 @@ int MountDir(const char *rootfs, const char *src) return 0; } - if (!S_ISDIR(srcStat.st_mode)) { - LOG_ERROR("error: this should be a directory to be mounted: %s.", src); - return -1; - } - ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { LOG_ERROR("error: failed to make dir: %s.", dst); @@ -232,60 +222,31 @@ int DoCtrlDeviceMounting(const char *rootfs) return 0; } -int DoDirectoryMounting(const char *rootfs) +int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { - /* directory */ - int ret = MountDir(rootfs, ASCEND_DRIVER_LIB64_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_DRIVER_TOOLS_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_DRIVER_INC_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_ADDONS_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_ADDONS_PATH); - return -1; - } + int ret; - ret = MountDir(rootfs, ASCEND_DCMI_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DCMI_PATH); - return -1; + for (unsigned int i = 0; i < list->count; i++) { + ret = MountDir(rootfs, (const char *)&list->list[i][0]); + if (ret < 0) { + LOG_ERROR("error: failed to do directory mounting for %s.", &list->list[i][0]); + return -1; + } } return 0; } -int DoFileMounting(const char *rootfs) +int DoFileMounting(const char *rootfs, const struct MountList *list) { - int ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); - return -1; - } - - ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH_OLD); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH_OLD); - return -1; - } + int ret; - ret = MountFile(rootfs, ASCEND_SLOG_CONF_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); - return -1; + for (unsigned int i = 0; i < list->count; i++) { + ret = MountFile(rootfs, (const char *)&list->list[i][0]); + if (ret < 0) { + LOG_ERROR("error: failed to do file mounting for %s.", &list->list[i][0]); + return -1; + } } return 0; @@ -311,13 +272,13 @@ int DoMounting(const struct ParsedConfig *config) return 0; } - ret = DoFileMounting(config->rootfs); + ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { LOG_ERROR("error: failed to mount files."); return -1; } - ret = DoDirectoryMounting(config->rootfs); + ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { LOG_ERROR("error: failed to do mount directories."); return -1; diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index c04b2df..beea9c9 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -6,6 +6,7 @@ #include #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" +#include #include using namespace std; @@ -14,6 +15,7 @@ using namespace testing; #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 +#define MAX_MOUNT_NR 512 typedef char *(*ParseFileLine)(char *, const char *); extern "C" int IsStrEqual(const char *s1, const char *s2); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); @@ -47,18 +49,25 @@ extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const si extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); -extern "C" int DoFileMounting(const char *rootfs); +extern "C" int DoFileMounting(const char *rootfs, const struct MountList *list); extern "C" int DoMounting(const struct ParsedConfig *config); -extern "C" int DoDirectoryMounting(const char *rootfs); +extern "C" int DoDirectoryMounting(const char *rootfs, const struct MountList *list); extern "C" int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config); extern "C" int ParseRuntimeOptions(const char *options); extern "C" bool IsOptionNoDrvSet(); +struct MountList { + unsigned int count; + char list[MAX_MOUNT_NR][PATH_MAX]; +}; + struct CmdArgs { char devices[BUF_SIZE]; char rootfs[BUF_SIZE]; int pid; char options[BUF_SIZE]; + struct MountList files; + struct MountList dirs; }; struct ParsedConfig { @@ -68,6 +77,8 @@ struct ParsedConfig { char containerNsPath[BUF_SIZE]; char cgroupPath[BUF_SIZE]; int originNsFd; + const struct MountList *files; + const struct MountList *dirs; }; int stub_setns(int fd, int nstype) @@ -222,22 +233,22 @@ int Stub_DoCtrlDeviceMounting_Failed(const char *rootfs) return -1; } -int Stub_DoDirectoryMounting_Success(const char *rootfs) +int Stub_DoDirectoryMounting_Success(const char *rootfs, const struct MountList *list) { return 0; } -int Stub_DoDirectoryMounting_Failed(const char *rootfs) +int Stub_DoDirectoryMounting_Failed(const char *rootfs, const struct MountList *list) { return -1; } -int Stub_DoFileMounting_Success(const char *rootfs) +int Stub_DoFileMounting_Success(const char *rootfs, const struct MountList *list) { return 0; } -int Stub_DoFileMounting_Failed(const char *rootfs) +int Stub_DoFileMounting_Failed(const char *rootfs, const struct MountList *list) { return -1; } diff --git a/hook/main.go b/hook/main.go index ab388e8..61fc22b 100644 --- a/hook/main.go +++ b/hook/main.go @@ -5,12 +5,14 @@ package main import ( + "bufio" "encoding/json" "flag" "fmt" "log" "os" "path" + "path/filepath" "sort" "strconv" "strings" @@ -23,8 +25,12 @@ const ( loggingPrefix = "ascend-docker-hook" ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" ascendRuntimeOptions = "ASCEND_RUNTIME_OPTIONS" + ascendRuntimeMounts = "ASCEND_RUNTIME_MOUNTS" ascendDockerCli = "ascend-docker-cli" defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli" + configDir = "/etc/ascend-docker-runtime.d" + baseConfig = "base" + configFileSuffix = "list" borderNum = 2 kvPairSize = 2 @@ -37,7 +43,7 @@ var ( defaultAscendDockerCliName = defaultAscendDockerCli ) -var validRuntimeOptions = [...]string { +var validRuntimeOptions = [...]string{ "NODRV", "VERBOSE", } @@ -109,6 +115,22 @@ func parseDevices(visibleDevices string) ([]int, error) { return removeDuplication(devices), nil } +func parseMounts(mounts string) []string { + mountConfigs := make([]string, 0) + + if mounts == "" { + return nil + } + + for _, m := range strings.Split(mounts, ",") { + m = strings.TrimSpace(m) + m = strings.ToLower(m) + mountConfigs = append(mountConfigs, m) + } + + return mountConfigs +} + func isRuntimeOptionValid(option string) bool { for _, validOption := range validRuntimeOptions { if option == validOption { @@ -161,7 +183,7 @@ func parseOciSpecFile(file string) (*specs.Spec, error) { return spec, nil } -var getContainerConfig = func () (*containerConfig, error) { +var getContainerConfig = func() (*containerConfig, error) { state := new(specs.State) decoder := json.NewDecoder(containerConfigInputStream) @@ -199,6 +221,89 @@ func getValueByKey(data []string, key string) string { return "" } +func readMountConfig(dir string, name string) ([]string, []string, error) { + configFileName := fmt.Sprintf("%s.%s", name, configFileSuffix) + baseConfigFilePath, err := filepath.Abs(filepath.Join(dir, configFileName)) + if err != nil { + return nil, nil, fmt.Errorf("failed to assemble base config file path: %w", err) + } + + fileInfo, err := os.Stat(baseConfigFilePath) + if err != nil { + return nil, nil, fmt.Errorf("cannot stat base configuration file %s : %w", baseConfigFilePath, err) + } + + if !fileInfo.Mode().IsRegular() { + return nil, nil, fmt.Errorf("base configuration file damaged because is not a regular file") + } + + f, err := os.Open(baseConfigFilePath) + if err != nil { + return nil, nil, fmt.Errorf("failed to open base configuration file %s: %w", baseConfigFilePath, err) + } + defer f.Close() + + fileMountList := make([]string, 0) + dirMountList := make([]string, 0) + + scanner := bufio.NewScanner(f) + for scanner.Scan() { + mountPath := scanner.Text() + absMountPath, err := filepath.Abs(mountPath) + if err != nil { + return nil, nil, fmt.Errorf("failed to get absolute path from %s: %w", mountPath) + } + mountPath = absMountPath + + stat, err := os.Stat(mountPath) + if err != nil { + return nil, nil, fmt.Errorf("failed to stat %s: %w", mountPath, err) + } + + if stat.Mode().IsRegular() || stat.Mode()&os.ModeSocket != 0 { + fileMountList = append(fileMountList, mountPath) + } else if stat.Mode().IsDir() { + dirMountList = append(dirMountList, mountPath) + } else { + return nil, nil, fmt.Errorf("%s is not a file nor a directory, which is illegal", mountPath) + } + } + + return fileMountList, dirMountList, nil +} + +func readConfigsOfDir(dir string, mountConfigs []string) ([]string, []string, error) { + fileInfo, err := os.Stat(dir) + if err != nil { + return nil, nil, fmt.Errorf("cannot stat configuration directory %s : %w", dir, err) + } + + if !fileInfo.Mode().IsDir() { + return nil, nil, fmt.Errorf("%s should be a dir for ascend docker runtime, but now it is not", dir) + } + + fileMountList := make([]string, 0) + dirMountList := make([]string, 0) + + configs := []string{baseConfig} + + if mountConfigs != nil { + configs = append(configs, mountConfigs...) + } + + for _, config := range configs { + fileList, dirList, err := readMountConfig(dir, config) + if err != nil { + return nil, nil, fmt.Errorf("failed to process config %s: %w", config, err) + } + + fileMountList = append(fileMountList, fileList...) + dirMountList = append(dirMountList, dirList...) + } + + return fileMountList, dirMountList, nil +} + func doPrestartHook() error { containerConfig, err := getContainerConfig() if err != nil { @@ -215,6 +320,13 @@ func doPrestartHook() error { return fmt.Errorf("failed to parse device setting: %w", err) } + mountConfigs := parseMounts(getValueByKey(containerConfig.Env, ascendRuntimeMounts)) + + fileMountList, dirMountList, err := readConfigsOfDir(configDir, mountConfigs) + if err != nil { + return fmt.Errorf("failed to read configuration from config directory: %w", err) + } + parsedOptions, err := parseRuntimeOptions(getValueByKey(containerConfig.Env, ascendRuntimeOptions)) if err != nil { return fmt.Errorf("failed to parse runtime options: %w", err) @@ -235,6 +347,14 @@ func doPrestartHook() error { "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) + for _, filePath := range fileMountList { + args = append(args, "--mount-file", filePath) + } + + for _, dirPath := range dirMountList { + args = append(args, "--mount-dir", dirPath) + } + if len(parsedOptions) > 0 { args = append(args, "--options", strings.Join(parsedOptions, ",")) } -- Gitee From f953ae266ef86d8081243c0daa29ac316f4c902e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 19 Oct 2020 20:44:43 +0800 Subject: [PATCH 073/296] Match-id-21505eeceeee7a61c4035c51b51afebfd3b8f86d --- cli/test/dt/CMakeLists.txt | 1 + cli/test/dt/Depend/CMakeLists.txt | 22 -------- cli/test/dt/testcase/gtest_mytestcase.cpp | 69 +++++++++++++---------- hook/main.go | 17 +++--- 4 files changed, 46 insertions(+), 63 deletions(-) diff --git a/cli/test/dt/CMakeLists.txt b/cli/test/dt/CMakeLists.txt index 4c08ab3..ca59ac7 100644 --- a/cli/test/dt/CMakeLists.txt +++ b/cli/test/dt/CMakeLists.txt @@ -82,4 +82,5 @@ target_link_libraries(ut_demo target_link_libraries(ut_demo -fprofile-arcs -pthread) target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/googletest/googletest/include) target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/mockcpp/include) +target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/HuaweiSecureC/include) target_link_libraries(ut_demo demolib) diff --git a/cli/test/dt/Depend/CMakeLists.txt b/cli/test/dt/Depend/CMakeLists.txt index 01f8bac..4754dfa 100644 --- a/cli/test/dt/Depend/CMakeLists.txt +++ b/cli/test/dt/Depend/CMakeLists.txt @@ -36,25 +36,3 @@ TARGET_INCLUDE_DIRECTORIES(ut_main PUBLIC "${mockcpp_SOURCE_DIR}/include") add_subdirectory(${gtest_dir} gtest.out) add_subdirectory(${mockcpp_dir} mockcpp.out) - - -#CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -#PROJECT(depend_lib) -# -#SET(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/lib") -#if(CMAKE_COMPILER_IS_GNUCXX) -# ADD_COMPILE_OPTIONS(-std=c++11) -# message(STATUS "optional:-std=c++11") -#endif(CMAKE_COMPILER_IS_GNUCXX) -# -#FILE(GLOB SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/public_stub.cpp -# ${CMAKE_CURRENT_LIST_DIR}/ut_main.cpp ) -# -## global_stubs -## mian -#ADD_LIBRARY(ut_main STATIC ${SOURCE_FILES}) -# -#INCLUDE_DIRECTORIES("googletest/googletest/include") -#LINK_DIRECTORIES("googletest/lib") -#TARGET_LINK_LIBRARIES(ut_main pthread) -#TARGET_LINK_LIBRARIES(ut_main libgtest) diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index beea9c9..8ae5e4e 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -4,10 +4,12 @@ */ #include #include -#include "gtest/gtest.h" -#include "mockcpp/mockcpp.hpp" #include #include +#include "securec.h" +#include "gtest/gtest.h" +#include "mockcpp/mockcpp.hpp" + using namespace std; using namespace testing; @@ -494,8 +496,10 @@ TEST(DoDeviceMounting, Status2) TEST(DoDirectoryMounting, Status1) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); + struct MountList list = {0}; + list.count = 1; char *rootfs = "/home"; - int ret = DoDirectoryMounting(rootfs); + int ret = DoDirectoryMounting(rootfs, &list); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } @@ -503,8 +507,10 @@ TEST(DoDirectoryMounting, Status1) TEST(DoDirectoryMounting, Status2) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Success)); + struct MountList list = {0}; + list.count = 3; char *rootfs = "/home"; - int ret = DoDirectoryMounting(rootfs); + int ret = DoDirectoryMounting(rootfs, &list); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } @@ -513,7 +519,7 @@ TEST(DoMounting, Status1) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Failed)); struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; @@ -527,7 +533,7 @@ TEST(DoMounting, Status2) MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; @@ -540,9 +546,10 @@ TEST(DoMounting, Status3) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); + MOCKER(DoFileMounting).stubs().will(invoke(Stub_DoFileMounting_Success)); MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Failed)); struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; @@ -559,7 +566,7 @@ TEST(DoMounting, Status4) MOCKER(DoFileMounting).stubs().will(invoke(Stub_DoFileMounting_Success)); MOCKER(DoDirectoryMounting).stubs().will(invoke(Stub_DoDirectoryMounting_Success)); struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; @@ -671,14 +678,14 @@ TEST(MountDir, Status4) TEST(MountDir, Status5) { - MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(MkDir).stubs().will(invoke(stub_MkDir_success)); + MOCKER(stat).stubs().will(invoke(stub_stat_failed)); + MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); MOCKER(Mount).stubs().will(invoke(stub_Mount_success)); char *rootfs = "/rootfs"; unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; int ret = MountDir(rootfs, "/dev/random", reMountRwFlag); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } TEST(DoCtrlDeviceMounting, Status1) @@ -791,7 +798,7 @@ TEST(SetupDriverCgroup, Status2) TEST(GetCgroupPath, Status1) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -806,11 +813,11 @@ TEST(GetCgroupPath, Status1) TEST(SetupCgroup, Status1) { struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; - strcpy(config.cgroupPath, "/not_exist_dir/cgroup_path"); + (void)strcpy_s(config.cgroupPath, sizeof(config.cgroupPath), "/not_exist_dir/cgroup_path"); int ret = SetupCgroup(&config); EXPECT_EQ(-1, ret); } @@ -818,11 +825,11 @@ TEST(SetupCgroup, Status1) TEST(SetupCgroup, Status2) { struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; - strcpy(config.cgroupPath, "devices.allow"); + (void)strcpy_s(config.cgroupPath, sizeof(config.cgroupPath), "devices.allow"); MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Fail)); int ret = SetupCgroup(&config); GlobalMockObject::verify(); @@ -832,11 +839,11 @@ TEST(SetupCgroup, Status2) TEST(SetupCgroup, Status3) { struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; - strcpy(config.cgroupPath, "devices.allow"); + (void)strcpy_s(config.cgroupPath, sizeof(config.cgroupPath), "devices.allow"); MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Failed)); int ret = SetupCgroup(&config); @@ -849,11 +856,11 @@ TEST(SetupCgroup, Status4) MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); struct ParsedConfig config; - strcpy(config.rootfs, "/home"); + (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); config.devices[0] = 1; config.devices[1] = 2; config.devicesNr = 2; - strcpy(config.cgroupPath, "devices.allow"); + (void)strcpy_s(config.cgroupPath, sizeof(config.cgroupPath), "devices.allow"); int ret = SetupCgroup(&config); GlobalMockObject::verify(); EXPECT_EQ(0, ret); @@ -862,7 +869,7 @@ TEST(SetupCgroup, Status4) TEST(SetupContainer, Status1) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -875,7 +882,7 @@ TEST(SetupContainer, Status1) TEST(SetupContainer, Status2) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -889,7 +896,7 @@ TEST(SetupContainer, Status2) TEST(SetupContainer, Status3) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -904,7 +911,7 @@ TEST(SetupContainer, Status3) TEST(SetupContainer, Status4) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -920,7 +927,7 @@ TEST(SetupContainer, Status4) TEST(SetupContainer, Status5) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -937,7 +944,7 @@ TEST(SetupContainer, Status5) TEST(SetupContainer, Status6) { struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -997,7 +1004,7 @@ TEST(DoPrepare, Status1) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -1012,7 +1019,7 @@ TEST(DoPrepare, Status2) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -1027,7 +1034,7 @@ TEST(DoPrepare, Status3) { MOCKER(GetNsPath).stubs().will(invoke(Stub_GetNsPath_Failed)); struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -1043,7 +1050,7 @@ TEST(DoPrepare, Status4) MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(GetSelfNsPath).stubs().will(invoke(Stub_GetSelfNsPath_Failed)); struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; @@ -1059,7 +1066,7 @@ TEST(DoPrepare, Status5) MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(open).stubs().will(invoke(stub_open_failed)); struct CmdArgs args; - strcpy(args.rootfs, "/home"); + (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); args.devices[0] = '1'; args.devices[1] = '2'; args.pid = 1; diff --git a/hook/main.go b/hook/main.go index 61fc22b..2a0653f 100644 --- a/hook/main.go +++ b/hook/main.go @@ -116,12 +116,11 @@ func parseDevices(visibleDevices string) ([]int, error) { } func parseMounts(mounts string) []string { - mountConfigs := make([]string, 0) - if mounts == "" { - return nil + return []string{baseConfig} } + mountConfigs := make([]string, 0) for _, m := range strings.Split(mounts, ",") { m = strings.TrimSpace(m) m = strings.ToLower(m) @@ -272,7 +271,11 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { return fileMountList, dirMountList, nil } -func readConfigsOfDir(dir string, mountConfigs []string) ([]string, []string, error) { +func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) { + if configs == nil || len(configs) == 0 { + panic("mounting configurations are empty, which should be impossible") + } + fileInfo, err := os.Stat(dir) if err != nil { return nil, nil, fmt.Errorf("cannot stat configuration directory %s : %w", dir, err) @@ -285,12 +288,6 @@ func readConfigsOfDir(dir string, mountConfigs []string) ([]string, []string, er fileMountList := make([]string, 0) dirMountList := make([]string, 0) - configs := []string{baseConfig} - - if mountConfigs != nil { - configs = append(configs, mountConfigs...) - } - for _, config := range configs { fileList, dirList, err := readMountConfig(dir, config) if err != nil { -- Gitee From 537bf7f44e6d5a3a4841d2bc194672b980b2e499 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 22 Oct 2020 20:16:38 +0800 Subject: [PATCH 074/296] Match-id-236cab2313de35708a0b6311943905e38e2c9fb1 --- hook/main.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hook/main.go b/hook/main.go index 2a0653f..69a0063 100644 --- a/hook/main.go +++ b/hook/main.go @@ -272,10 +272,6 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { } func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) { - if configs == nil || len(configs) == 0 { - panic("mounting configurations are empty, which should be impossible") - } - fileInfo, err := os.Stat(dir) if err != nil { return nil, nil, fmt.Errorf("cannot stat configuration directory %s : %w", dir, err) -- Gitee From 62c2d9a004ac6368409383e6d209482dd67c18ff Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 26 Oct 2020 11:04:50 +0800 Subject: [PATCH 075/296] Match-id-bb59ee5d1a8d5afaa75ac2bb07db32c8a3a07b1d --- cli/src/basic.h | 30 +++++++++++++------ cli/src/cgrp.c | 1 - cli/src/logging.c | 74 ----------------------------------------------- cli/src/logging.h | 33 --------------------- cli/src/main.c | 12 +------- cli/src/mount.c | 3 -- cli/src/ns.c | 2 +- cli/src/options.c | 8 ----- cli/src/options.h | 1 - cli/src/utils.c | 1 - hook/main.go | 1 - 11 files changed, 23 insertions(+), 143 deletions(-) delete mode 100644 cli/src/logging.c delete mode 100644 cli/src/logging.h diff --git a/cli/src/basic.h b/cli/src/basic.h index 3a628ac..c15a3ff 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -9,15 +9,27 @@ #include #include -#define DEVICE_NAME "davinci" -#define DAVINCI_MANAGER "davinci_manager" -#define DEVMM_SVM "devmm_svm" -#define HISI_HDC "hisi_hdc" -#define DEFAULT_DIR_MODE 0755 -#define BUF_SIZE 1024 -#define MAX_DEVICE_NR 1024 -#define DEFAULT_LOG_FILE "/var/log/ascend-docker-runtime.log" -#define MAX_MOUNT_NR 512 +#define DEVICE_NAME "davinci" +#define DAVINCI_MANAGER "davinci_manager" +#define DEVMM_SVM "devmm_svm" +#define HISI_HDC "hisi_hdc" +#define DEFAULT_DIR_MODE 0755 +#define BUF_SIZE 1024 +#define MAX_DEVICE_NR 1024 +#define MAX_MOUNT_NR 512 + +#define LOG(level, fmt, ...) \ + do { \ + char _content[BUF_SIZE] = {0}; \ + int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ + if (_ret < 0) { \ + fprintf(stderr, "cannot assemble log content"); \ + } else { \ + fprintf(stderr, "%s", (const char *)_content); \ + } \ + } while (0) + +#define LOG_ERROR(fmt, ...) LOG('E', fmt, ##__VA_ARGS__) #define ALLOW_PATH "/devices.allow" #define ROOT_GAP 4 diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index f647e09..dc60394 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -14,7 +14,6 @@ #include #include "securec.h" #include "utils.h" -#include "logging.h" bool TakeNthWord(char **pLine, unsigned int n, char **word) { diff --git a/cli/src/logging.c b/cli/src/logging.c deleted file mode 100644 index 8d2b779..0000000 --- a/cli/src/logging.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具日志模块 -*/ -#include "logging.h" - -#include -#include -#include -#include -#include -#include -#include "securec.h" -#include "basic.h" -#include "options.h" - -static int g_pid = -1; -static FILE *g_logFile = NULL; - -void SetPidForLog(int pid) -{ - g_pid = pid; -} - -int OpenLog(const char *logFile) -{ - char realPath[PATH_MAX] = {0}; - - if (!IsOptionVerboseSet()) { // 日志开关 - return 0; - } - - if (realpath(logFile, realPath) == NULL && errno != ENOENT) { - LOG_ERROR("error: cannot canonicalize log file path %s.", logFile); - return -1; - } - - g_logFile = fopen((const char *)realPath, "ae"); - if (g_logFile == NULL) { - LOG_ERROR("error: failed to open log file %s.", realPath); - return -1; - } - - return 0; -} - -void CloseLog() -{ - if (IsOptionVerboseSet() && g_logFile != NULL) { - (void)fclose(g_logFile); - g_logFile = NULL; - } -} - -void WriteLog(char level, const char *content) -{ - struct timeval tv = {0}; - struct tm *tm = NULL; - char buf[BUF_SIZE] = {0}; - - if (g_logFile == NULL) { - return; - } - - if (gettimeofday(&tv, NULL) < 0 || - (tm = gmtime(&tv.tv_sec)) == NULL || - strftime(buf, sizeof(buf), "%m%d %T", tm) == 0) { - strcpy_s(buf, sizeof(buf), "0000 00:00:00"); - } - - fprintf(g_logFile, "[%c %s.%06ld %d] ", level, buf, tv.tv_usec, g_pid); - fprintf(g_logFile, "%s", content); - fputc('\n', g_logFile); -} diff --git a/cli/src/logging.h b/cli/src/logging.h deleted file mode 100644 index 1361e2f..0000000 --- a/cli/src/logging.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具日志模块头文件 -*/ -#ifndef _LOGGING_H -#define _LOGGING_H - -#include -#include "securec.h" -#include "basic.h" - -void SetPidForLog(int pid); -int OpenLog(const char *logFile); -void CloseLog(); -void WriteLog(char level, const char *content); - -#define LOG(level, fmt, ...) \ - do { \ - char _content[BUF_SIZE] = {0}; \ - int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ - if (_ret < 0) { \ - fprintf(stderr, "cannot assemble log content"); \ - } else { \ - WriteLog(level, (const char *)_content); \ - fprintf(stderr, "%s", (const char *)_content); \ - } \ - } while (0) - -#define LOG_ERROR(fmt, ...) LOG('E', fmt, ##__VA_ARGS__) - -#define LOG_WARNING(fmt, ...) LOG('W', fmt, ##__VA_ARGS__) - -#endif diff --git a/cli/src/main.c b/cli/src/main.c index 88898bf..a793184 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -18,7 +18,6 @@ #include "ns.h" #include "mount.h" #include "cgrp.h" -#include "logging.h" #include "options.h" #define DECIMAL 10 @@ -315,22 +314,13 @@ int Process(int argc, char **argv) } ParseRuntimeOptions(args.options); - SetPidForLog(args.pid); - - ret = OpenLog(DEFAULT_LOG_FILE); - if (ret < 0) { - LOG_ERROR("error: failed to open log file %s.", DEFAULT_LOG_FILE); - return -1; - } ret = SetupContainer(&args); if (ret < 0) { - CloseLog(); + LOG_ERROR("error: failed to setup container."); return ret; } - CloseLog(); - return 0; } diff --git a/cli/src/mount.c b/cli/src/mount.c index c3e8f79..b527aef 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -11,7 +11,6 @@ #include #include "securec.h" #include "utils.h" -#include "logging.h" #include "options.h" int Mount(const char *src, const char *dst) @@ -147,7 +146,6 @@ int MountFile(const char *rootfs, const char *filepath) struct stat srcStat; ret = stat(filepath, &srcStat); if (ret < 0) { - LOG_WARNING("warning: failed to find file %s on host, skipping", filepath); return 0; } @@ -179,7 +177,6 @@ int MountDir(const char *rootfs, const char *src) struct stat srcStat; ret = stat(src, &srcStat); if (ret < 0) { - LOG_WARNING("warning: failed to find dir %s on host, skipping", src); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 4e06333..57ec208 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -8,8 +8,8 @@ #include #include #include +#include "basic.h" #include "securec.h" -#include "logging.h" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { diff --git a/cli/src/options.c b/cli/src/options.c index c3ddcaf..7ab75d9 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -10,7 +10,6 @@ static struct { bool noDrv; - bool verbose; } g_runtimeOptions; static struct { @@ -18,7 +17,6 @@ static struct { bool *flag; } g_optionNameFlagTable[] = { {"NODRV", &g_runtimeOptions.noDrv}, // 不挂载Driver - {"VERBOSE", &g_runtimeOptions.verbose}, // 输出日志 {NULL, NULL} }; @@ -26,7 +24,6 @@ void ParseRuntimeOptions(const char *options) { // set defaults value g_runtimeOptions.noDrv = false; - g_runtimeOptions.verbose = false; static const char *seperator = ","; char *runtimeOptions = strdup(options); @@ -53,8 +50,3 @@ bool IsOptionNoDrvSet() { return g_runtimeOptions.noDrv; } - -bool IsOptionVerboseSet() -{ - return g_runtimeOptions.verbose; -} \ No newline at end of file diff --git a/cli/src/options.h b/cli/src/options.h index 6c8c0b7..ab7ddda 100644 --- a/cli/src/options.h +++ b/cli/src/options.h @@ -9,6 +9,5 @@ void ParseRuntimeOptions(const char *options); bool IsOptionNoDrvSet(); -bool IsOptionVerboseSet(); #endif diff --git a/cli/src/utils.c b/cli/src/utils.c index 7764b15..ab504b3 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -13,7 +13,6 @@ #include #include #include "securec.h" -#include "logging.h" int IsStrEqual(const char *s1, const char *s2) { diff --git a/hook/main.go b/hook/main.go index 69a0063..1b94f97 100644 --- a/hook/main.go +++ b/hook/main.go @@ -45,7 +45,6 @@ var ( var validRuntimeOptions = [...]string{ "NODRV", - "VERBOSE", } type containerConfig struct { -- Gitee From 230b2759a69e0c8f7b3adff86543d0b22befad66 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 27 Oct 2020 15:33:37 +0800 Subject: [PATCH 076/296] Match-id-e09f4bfabe86ff28154841143128cab741c4e76a --- cli/src/basic.h | 4 +--- cli/src/mount.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index c15a3ff..3335cb1 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -18,7 +18,7 @@ #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 -#define LOG(level, fmt, ...) \ +#define LOG_ERROR(fmt, ...) \ do { \ char _content[BUF_SIZE] = {0}; \ int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ @@ -29,8 +29,6 @@ } \ } while (0) -#define LOG_ERROR(fmt, ...) LOG('E', fmt, ##__VA_ARGS__) - #define ALLOW_PATH "/devices.allow" #define ROOT_GAP 4 #define FSTYPE_GAP 2 diff --git a/cli/src/mount.c b/cli/src/mount.c index b527aef..2488d3b 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -96,6 +96,19 @@ int MountDevice(const char *rootfs, const char *deviceName) return -1; } + errno = 0; + struct stat dstStat; + ret = stat((const char *)dst, &dstStat); + if (ret == 0 && S_ISCHR(dstStat.st_mode)) { + return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 + } else if (ret == 0) { + LOG_ERROR("error: %s already exists but not a char device as expected.", dst); + return -1; + } else if (ret < 0 && errno != ENOENT) { + LOG_ERROR("error: failed to check dst %s stat: %s.", dst, strerror(errno)); + return -1; + } + ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); -- Gitee From a628814b785289088f4599cedae8ec3f167f957a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 19 Nov 2020 15:01:58 +0800 Subject: [PATCH 077/296] Match-id-459259903d0c697413a4f884f4e725f7c2ce402f --- build/scripts/base.list | 1 - 1 file changed, 1 deletion(-) diff --git a/build/scripts/base.list b/build/scripts/base.list index cf1c56f..b66432b 100644 --- a/build/scripts/base.list +++ b/build/scripts/base.list @@ -1,7 +1,6 @@ /usr/local/Ascend/driver/lib64 /usr/local/Ascend/driver/tools /usr/local/Ascend/driver/include -/usr/local/Ascend/add-ons /usr/local/dcmi /usr/local/bin/npu-smi /var/log/npu/conf/slog/slog.conf \ No newline at end of file -- Gitee From 17d172a042c2dda7718a17db30bc1dd5f4d4d4da Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 30 Nov 2020 14:47:16 +0800 Subject: [PATCH 078/296] Match-id-097cce7596939db1e5f909c4868a368630de6897 --- cli/test/dt/testcase/gtest_mytestcase.cpp | 2 +- hook/main.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index 8ae5e4e..dea9201 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -455,7 +455,7 @@ TEST(MountDevice, Status3) MOCKER(stat).stubs().will(invoke(stub_stat_success)); MOCKER(close).stubs().will(invoke(stub_close_success)); MOCKER(open).stubs().will(invoke(stub_open_success)); - MOCKER(mount).stubs().will(invoke(stub_mount_failed)); + MOCKER(mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci0"; EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); diff --git a/hook/main.go b/hook/main.go index 1b94f97..94641f0 100644 --- a/hook/main.go +++ b/hook/main.go @@ -249,21 +249,19 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { mountPath := scanner.Text() absMountPath, err := filepath.Abs(mountPath) if err != nil { - return nil, nil, fmt.Errorf("failed to get absolute path from %s: %w", mountPath) + continue // skipping files/dirs with any problems } mountPath = absMountPath stat, err := os.Stat(mountPath) if err != nil { - return nil, nil, fmt.Errorf("failed to stat %s: %w", mountPath, err) + continue // skipping files/dirs with any problems } if stat.Mode().IsRegular() || stat.Mode()&os.ModeSocket != 0 { fileMountList = append(fileMountList, mountPath) } else if stat.Mode().IsDir() { dirMountList = append(dirMountList, mountPath) - } else { - return nil, nil, fmt.Errorf("%s is not a file nor a directory, which is illegal", mountPath) } } -- Gitee From b9ad9a5a3a3d57478ff23cdd82873e4b280b804d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 12:26:21 +0800 Subject: [PATCH 079/296] Match-id-7e50d2245457a3b2a0e94d738bfb2353ba7db6f7 --- cli/src/mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 2488d3b..9c9f458 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,7 +239,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting for %s.", &list->list[i][0]); + LOG_ERROR("error: failed to do directory mounting for %s.", (char *)&list->list[i][0]); return -1; } } @@ -254,7 +254,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do file mounting for %s.", &list->list[i][0]); + LOG_ERROR("error: failed to do file mounting for %s.", (char *)&list->list[i][0]); return -1; } } -- Gitee From b1e80349aff328dc4915745fa8f2a5498b5b980c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 16:27:14 +0800 Subject: [PATCH 080/296] Match-id-d1a7c7fda5ca33322f77185d9291cf702bb2172a --- cli/src/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 9c9f458..300621c 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -105,7 +105,7 @@ int MountDevice(const char *rootfs, const char *deviceName) LOG_ERROR("error: %s already exists but not a char device as expected.", dst); return -1; } else if (ret < 0 && errno != ENOENT) { - LOG_ERROR("error: failed to check dst %s stat: %s.", dst, strerror(errno)); + LOG_ERROR("error: failed to check dst %s stat", dst); return -1; } -- Gitee From 17030a390cd492f65b791146a4808b29db55de94 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 17:29:01 +0800 Subject: [PATCH 081/296] Match-id-72f52ad2eb048cf1d00fabe78210008f63ab9e8f --- cli/src/mount.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 300621c..ea9fa2b 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -89,13 +89,6 @@ int MountDevice(const char *rootfs, const char *deviceName) return -1; } - struct stat srcStat; - ret = stat((const char *)src, &srcStat); - if (ret < 0) { - LOG_ERROR("error: failed to stat src: %s.", src); - return -1; - } - errno = 0; struct stat dstStat; ret = stat((const char *)dst, &dstStat); @@ -109,6 +102,13 @@ int MountDevice(const char *rootfs, const char *deviceName) return -1; } + struct stat srcStat; + ret = stat((const char *)src, &srcStat); + if (ret < 0) { + LOG_ERROR("error: failed to stat src: %s.", src); + return -1; + } + ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); -- Gitee From bee807a655e54a458ea3f56a7d5beca68e8cbf78 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 19:49:56 +0800 Subject: [PATCH 082/296] Match-id-fbc79a67c7cd1d1c749561df9fb6cdb8075df4de --- cli/src/mount.c | 89 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 25 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index ea9fa2b..f86d8dd 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -89,6 +89,13 @@ int MountDevice(const char *rootfs, const char *deviceName) return -1; } + struct stat srcStat; + ret = stat((const char *)src, &srcStat); + if (ret < 0) { + LOG_ERROR("error: failed to stat src: %s.", src); + return -1; + } + errno = 0; struct stat dstStat; ret = stat((const char *)dst, &dstStat); @@ -102,13 +109,6 @@ int MountDevice(const char *rootfs, const char *deviceName) return -1; } - struct stat srcStat; - ret = stat((const char *)src, &srcStat); - if (ret < 0) { - LOG_ERROR("error: failed to stat src: %s.", src); - return -1; - } - ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); @@ -162,6 +162,11 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } + if (!S_ISREG(srcStat.st_mode)) { + LOG_ERROR("error: this should be a regular file to be mounted: %s.", filepath); + return -1; + } + ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); @@ -193,6 +198,11 @@ int MountDir(const char *rootfs, const char *src) return 0; } + if (!S_ISDIR(srcStat.st_mode)) { + LOG_ERROR("error: this should be a directory to be mounted: %s.", src); + return -1; + } + ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { LOG_ERROR("error: failed to make dir: %s.", dst); @@ -232,31 +242,60 @@ int DoCtrlDeviceMounting(const char *rootfs) return 0; } -int DoDirectoryMounting(const char *rootfs, const struct MountList *list) +int DoDirectoryMounting(const char *rootfs) { - int ret; + /* directory */ + int ret = MountDir(rootfs, ASCEND_DRIVER_LIB64_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); + return -1; + } - for (unsigned int i = 0; i < list->count; i++) { - ret = MountDir(rootfs, (const char *)&list->list[i][0]); - if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting for %s.", (char *)&list->list[i][0]); - return -1; - } + ret = MountDir(rootfs, ASCEND_DRIVER_TOOLS_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_DRIVER_INC_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_ADDONS_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_ADDONS_PATH); + return -1; + } + + ret = MountDir(rootfs, ASCEND_DCMI_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_DCMI_PATH); + return -1; } return 0; } -int DoFileMounting(const char *rootfs, const struct MountList *list) +int DoFileMounting(const char *rootfs) { - int ret; + int ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); + return -1; + } - for (unsigned int i = 0; i < list->count; i++) { - ret = MountFile(rootfs, (const char *)&list->list[i][0]); - if (ret < 0) { - LOG_ERROR("error: failed to do file mounting for %s.", (char *)&list->list[i][0]); - return -1; - } + ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH_OLD); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH_OLD); + return -1; + } + + ret = MountFile(rootfs, ASCEND_SLOG_CONF_PATH); + if (ret < 0) { + LOG_ERROR("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); + return -1; } return 0; @@ -282,13 +321,13 @@ int DoMounting(const struct ParsedConfig *config) return 0; } - ret = DoFileMounting(config->rootfs, config->files); + ret = DoFileMounting(config->rootfs); if (ret < 0) { LOG_ERROR("error: failed to mount files."); return -1; } - ret = DoDirectoryMounting(config->rootfs, config->dirs); + ret = DoDirectoryMounting(config->rootfs); if (ret < 0) { LOG_ERROR("error: failed to do mount directories."); return -1; -- Gitee From 4a39786ab1d7bd16fb27ac2682576a7bbe18be12 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 19:59:36 +0800 Subject: [PATCH 083/296] Match-id-9333f06ca7f073902281757367902e97f1f6cdf2 --- cli/src/mount.c | 75 ++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 57 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index f86d8dd..300621c 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -162,11 +162,6 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } - if (!S_ISREG(srcStat.st_mode)) { - LOG_ERROR("error: this should be a regular file to be mounted: %s.", filepath); - return -1; - } - ret = CreateFile(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); @@ -198,11 +193,6 @@ int MountDir(const char *rootfs, const char *src) return 0; } - if (!S_ISDIR(srcStat.st_mode)) { - LOG_ERROR("error: this should be a directory to be mounted: %s.", src); - return -1; - } - ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { LOG_ERROR("error: failed to make dir: %s.", dst); @@ -242,60 +232,31 @@ int DoCtrlDeviceMounting(const char *rootfs) return 0; } -int DoDirectoryMounting(const char *rootfs) +int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { - /* directory */ - int ret = MountDir(rootfs, ASCEND_DRIVER_LIB64_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_LIB64_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_DRIVER_TOOLS_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_TOOLS_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_DRIVER_INC_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DRIVER_INC_PATH); - return -1; - } - - ret = MountDir(rootfs, ASCEND_ADDONS_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_ADDONS_PATH); - return -1; - } + int ret; - ret = MountDir(rootfs, ASCEND_DCMI_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_DCMI_PATH); - return -1; + for (unsigned int i = 0; i < list->count; i++) { + ret = MountDir(rootfs, (const char *)&list->list[i][0]); + if (ret < 0) { + LOG_ERROR("error: failed to do directory mounting for %s.", (char *)&list->list[i][0]); + return -1; + } } return 0; } -int DoFileMounting(const char *rootfs) +int DoFileMounting(const char *rootfs, const struct MountList *list) { - int ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH); - return -1; - } - - ret = MountFile(rootfs, ASCEND_NPU_SMI_PATH_OLD); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_NPU_SMI_PATH_OLD); - return -1; - } + int ret; - ret = MountFile(rootfs, ASCEND_SLOG_CONF_PATH); - if (ret < 0) { - LOG_ERROR("error: failed to do mount %s.", ASCEND_SLOG_CONF_PATH); - return -1; + for (unsigned int i = 0; i < list->count; i++) { + ret = MountFile(rootfs, (const char *)&list->list[i][0]); + if (ret < 0) { + LOG_ERROR("error: failed to do file mounting for %s.", (char *)&list->list[i][0]); + return -1; + } } return 0; @@ -321,13 +282,13 @@ int DoMounting(const struct ParsedConfig *config) return 0; } - ret = DoFileMounting(config->rootfs); + ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { LOG_ERROR("error: failed to mount files."); return -1; } - ret = DoDirectoryMounting(config->rootfs); + ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { LOG_ERROR("error: failed to do mount directories."); return -1; -- Gitee From 7eadbcfbfa23bf10a5ffaf8f2b53b98004595ac1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 3 Dec 2020 20:44:23 +0800 Subject: [PATCH 084/296] Match-id-9037a55df6adf0b23257e60035fbe5fd83afa98d --- cli/src/mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 300621c..a05dc56 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,7 +239,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting for %s.", (char *)&list->list[i][0]); + LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; } } @@ -254,7 +254,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do file mounting for %s.", (char *)&list->list[i][0]); + LOG_ERROR("error: failed to do file mounting for %s.", (const char *)&list->list[i][0]); return -1; } } -- Gitee From 0741782aa628e180f2fa6344a88db7801f555966 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 14 Dec 2020 20:18:01 +0800 Subject: [PATCH 085/296] Match-id-05e74030ea40c1adfec03366d657cb3986a6d517 --- build/build.sh | 38 +++++++++++++++++++------------------- build/scripts/run_main.sh | 9 ++++++--- build/scripts/uninstall.sh | 7 +++++-- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/build/build.sh b/build/build.sh index c460b26..5ca5c26 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,9 @@ #!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# Description: ascend-docker-runtime构建脚本 +set -e -ROOT=$(cd `dirname $0`; pwd)/.. +ROOT=$(cd $(dirname $0); pwd)/.. TOP_DIR=$ROOT/.. OPENSRC=${ROOT}/opensource @@ -20,18 +23,18 @@ HOOKSRCNAME="main.go" RUNTIMEDIR=${ROOT}/runtime RUNTIMESRCNAME="main.go" -CLISRCPATH=`find ${CLIDIR} -name "${CLISRCNAME}"` +CLISRCPATH=$(find ${CLIDIR} -name "${CLISRCNAME}") CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} -INSTALLHELPERSRCPATH=`find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}"` +INSTALLHELPERSRCPATH=$(find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}") INSTALLHELPERSRCDIR=${INSTALLHELPERSRCPATH%/${INSTALLHELPERSRCNAME}} -HOOKSRCPATH=`find ${HOOKDIR} -name "${HOOKSRCNAME}"` +HOOKSRCPATH=$(find ${HOOKDIR} -name "${HOOKSRCNAME}") HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} -RUNTIMESRCPATH=`find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}"` +RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}") RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION=`cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2` +VERSION=$(cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2) PACKAGENAME="Ascend-docker-runtime" -CPUARCH=`uname -m` +CPUARCH=$(uname -m) function build_bin() { @@ -76,7 +79,7 @@ function build_run_package() /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg - FILECNT=`ls -l run_pkg |grep "^-"|wc -l` + FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) echo "prepare package $FILECNT bins" if [ $FILECNT -ne 6 ]; then exit 1 @@ -86,8 +89,8 @@ function build_run_package() chmod 550 run_pkg/run_main.sh RUN_PKG_NAME="${PACKAGENAME}-${VERSION}-${CPUARCH}.run" - DATE=`date -u "+%Y-%m-%d"` - bash makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ + DATE=$(date -u "+%Y-%m-%d") + bash ${OPENSRC}/${MAKESELF_DIR}/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh mv ${RUN_PKG_NAME} ${OUTPUT} } @@ -107,23 +110,20 @@ function make_unzip() { cd ${OPENSRC} tar -xzvf cJSON*.tar.gz - CJSONS=`find . -name "cJSON.*"` + CJSONS=$(find . -name "cJSON.*") CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson /bin/cp -f ${CJSONS} ${CJSONSLIB} unzip makeself-release-*.zip rm -f makeself-release-*.zip - MAKESELF_DIR=`find . -name "makeself-release-*"` - /bin/cp -f ${MAKESELF_DIR}/makeself.sh ${BUILD} - /bin/cp -f ${MAKESELF_DIR}/makeself-header.sh ${BUILD} - cd ${BUILD} && /bin/cp -f scripts/mkselfmodify.patch ./ + MAKESELF_DIR=$(find . -name "makeself-release-*") + cd ${MAKESELF_DIR} && /bin/cp -f ${BUILD}/scripts/mkselfmodify.patch ./ patch -p0 < mkselfmodify.patch rm -f mkselfmodify.patch cd ${PLATFORM} - tar -xzvf HuaweiSecureC.tar.gz - SECURECSRC=`find . -name "src"` - SECURECINC=`find . -name "include"` + SECURECSRC=$(find . -name "src") + SECURECINC=$(find . -name "include") SECURECLIB=${INSTALLHELPERDIR}/deb/src/HuaweiSecureC /bin/cp -f ${SECURECSRC}/* ${SECURECLIB} @@ -135,7 +135,7 @@ function make_unzip() } make_clean -if [ $1 == "pull" ]; then +if [ "$1" == "pull" ]; then make_pull fi diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 48bd27f..adc41c6 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# Description: ascend-docker-runtime run包脚本文件 +set -e ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d DOCKER_CONFIG_DIR=/etc/docker @@ -63,7 +66,7 @@ function uninstall() ${INSTALL_PATH}/script/uninstall.sh echo 'remove daemon.json setting success' - rm -rf ${INSTALL_PATH} + [ -n "${INSTALL_PATH}" ] && rm -rf ${INSTALL_PATH} echo 'remove executable files success' echo 'del damom.json success' @@ -118,8 +121,8 @@ do ;; --install-path=*) INSTALL_PATH_FLAG=y - INSTALL_PATH=`echo $3 | cut -d"=" -f2 ` - INSTALL_PATH=`echo ${INSTALL_PATH} | sed "s/\/*$//g"` + INSTALL_PATH=$(echo $3 | cut -d"=" -f2) + INSTALL_PATH=$(echo ${INSTALL_PATH} | sed "s/\/*$//g") shift ;; --upgrade) diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index cb4fbad..57ef761 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -1,6 +1,9 @@ #!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# Description: ascend-docker-runtime 卸载脚本 +set -e -ROOT=$(cd `dirname $0`; pwd)/.. +ROOT=$(cd $(dirname $0); pwd)/.. DST='/etc/docker/daemon.json' SRC="${DST}.${PPID}" ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d @@ -17,4 +20,4 @@ fi mv ${SRC} ${DST} -rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} +[ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} -- Gitee From c5eaec2ed02c1536b06cdc5421a2257de47f20ae Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 17 Dec 2020 14:36:13 +0800 Subject: [PATCH 086/296] Match-id-b8986154465603b640fb267889bd75f0dffe8fad --- hook/main.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hook/main.go b/hook/main.go index 94641f0..1fcaf6e 100644 --- a/hook/main.go +++ b/hook/main.go @@ -167,7 +167,7 @@ func parseOciSpecFile(file string) (*specs.Spec, error) { spec := new(specs.Spec) if err := json.NewDecoder(f).Decode(spec); err != nil { - return nil, fmt.Errorf("failed to parse OCI config file: %s, caused by: %w", file, err) + return nil, fmt.Errorf("failed to parse OCI config file: %s, caused by: %v", file, err) } if spec.Process == nil { @@ -192,7 +192,7 @@ var getContainerConfig = func() (*containerConfig, error) { configPath := path.Join(state.Bundle, "config.json") ociSpec, err := parseOciSpecFile(configPath) if err != nil { - return nil, fmt.Errorf("failed to parse OCI spec: %w", err) + return nil, fmt.Errorf("failed to parse OCI spec: %v", err) } ret := &containerConfig{ @@ -223,12 +223,12 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { configFileName := fmt.Sprintf("%s.%s", name, configFileSuffix) baseConfigFilePath, err := filepath.Abs(filepath.Join(dir, configFileName)) if err != nil { - return nil, nil, fmt.Errorf("failed to assemble base config file path: %w", err) + return nil, nil, fmt.Errorf("failed to assemble base config file path: %v", err) } fileInfo, err := os.Stat(baseConfigFilePath) if err != nil { - return nil, nil, fmt.Errorf("cannot stat base configuration file %s : %w", baseConfigFilePath, err) + return nil, nil, fmt.Errorf("cannot stat base configuration file %s : %v", baseConfigFilePath, err) } if !fileInfo.Mode().IsRegular() { @@ -237,7 +237,7 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { f, err := os.Open(baseConfigFilePath) if err != nil { - return nil, nil, fmt.Errorf("failed to open base configuration file %s: %w", baseConfigFilePath, err) + return nil, nil, fmt.Errorf("failed to open base configuration file %s: %v", baseConfigFilePath, err) } defer f.Close() @@ -249,13 +249,13 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { mountPath := scanner.Text() absMountPath, err := filepath.Abs(mountPath) if err != nil { - continue // skipping files/dirs with any problems + continue // skipping files/dirs with any problems } mountPath = absMountPath stat, err := os.Stat(mountPath) if err != nil { - continue // skipping files/dirs with any problems + continue // skipping files/dirs with any problems } if stat.Mode().IsRegular() || stat.Mode()&os.ModeSocket != 0 { @@ -271,7 +271,7 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) { fileInfo, err := os.Stat(dir) if err != nil { - return nil, nil, fmt.Errorf("cannot stat configuration directory %s : %w", dir, err) + return nil, nil, fmt.Errorf("cannot stat configuration directory %s : %v", dir, err) } if !fileInfo.Mode().IsDir() { @@ -284,7 +284,7 @@ func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) for _, config := range configs { fileList, dirList, err := readMountConfig(dir, config) if err != nil { - return nil, nil, fmt.Errorf("failed to process config %s: %w", config, err) + return nil, nil, fmt.Errorf("failed to process config %s: %v", config, err) } fileMountList = append(fileMountList, fileList...) @@ -297,7 +297,7 @@ func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) func doPrestartHook() error { containerConfig, err := getContainerConfig() if err != nil { - return fmt.Errorf("failed to get container config: %w", err) + return fmt.Errorf("failed to get container config: %v", err) } visibleDevices := getValueByKey(containerConfig.Env, ascendVisibleDevices) @@ -307,29 +307,29 @@ func doPrestartHook() error { devices, err := parseDevices(visibleDevices) if err != nil { - return fmt.Errorf("failed to parse device setting: %w", err) + return fmt.Errorf("failed to parse device setting: %v", err) } mountConfigs := parseMounts(getValueByKey(containerConfig.Env, ascendRuntimeMounts)) fileMountList, dirMountList, err := readConfigsOfDir(configDir, mountConfigs) if err != nil { - return fmt.Errorf("failed to read configuration from config directory: %w", err) + return fmt.Errorf("failed to read configuration from config directory: %v", err) } parsedOptions, err := parseRuntimeOptions(getValueByKey(containerConfig.Env, ascendRuntimeOptions)) if err != nil { - return fmt.Errorf("failed to parse runtime options: %w", err) + return fmt.Errorf("failed to parse runtime options: %v", err) } currentExecPath, err := os.Executable() if err != nil { - return fmt.Errorf("cannot get the path of ascend-docker-hook: %w", err) + return fmt.Errorf("cannot get the path of ascend-docker-hook: %v", err) } cliPath := path.Join(path.Dir(currentExecPath), ascendDockerCliName) if _, err = os.Stat(cliPath); err != nil { - return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %w", cliPath, err) + return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %v", cliPath, err) } args := append([]string{cliPath}, @@ -350,7 +350,7 @@ func doPrestartHook() error { } if err := doExec(cliPath, args, os.Environ()); err != nil { - return fmt.Errorf("failed to exec ascend-docker-cli %v: %w", args, err) + return fmt.Errorf("failed to exec ascend-docker-cli %v: %v", args, err) } return nil -- Gitee From 017b1ae49f2e367ec5acb0b2a6a3d6f837e37fb6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 25 Dec 2020 11:35:14 +0800 Subject: [PATCH 087/296] Match-id-2e6f7d3b84cefa4fe1b966a4cdb5cf3800ead03a --- cli/test/dt/testcase/gtest_mytestcase.cpp | 157 ++++++++++------------ 1 file changed, 73 insertions(+), 84 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp index dea9201..ee6a339 100644 --- a/cli/test/dt/testcase/gtest_mytestcase.cpp +++ b/cli/test/dt/testcase/gtest_mytestcase.cpp @@ -351,12 +351,7 @@ protected: } }; -TEST_F(Test_Fhho, ClassEQ1) -{ - EXPECT_EQ(1, IsStrEqual("", "")); -} - -TEST_F(Test_Fhho, ClassEQ2) +TEST_F(Test_Fhho, ClassEQ) { int pid = 1; const char* nsType = "mnt"; @@ -366,7 +361,7 @@ TEST_F(Test_Fhho, ClassEQ2) EXPECT_LE(0, ret); } -TEST(EnterNsByFd, Status1) +TEST(EnterNsByFd, StatusOne) { int pid = 1; int nsType = 1; @@ -378,15 +373,16 @@ TEST(EnterNsByFd, Status1) EXPECT_LE(0, ret); } -TEST(EnterNsByFd, Status2) +TEST(EnterNsByFd, StatusTwo) { + // The test does not have a file handle into the namespace int pid = 1; int nsType = 1; int ret = EnterNsByFd(pid, nsType); EXPECT_LE(-1, ret); } -TEST(EnterNsByPath, Status1) +TEST(EnterNsByPath, StatusOne) { char containerNsPath[BUF_SIZE] = {0}; int nsType = 1; @@ -396,44 +392,25 @@ TEST(EnterNsByPath, Status1) EXPECT_LE(-1, ret); } -TEST(EnterNsByPath, Status2) +TEST(EnterNsByPath, StatusTwo) { + // The test has no path into the namespace char containerNsPath[BUF_SIZE] = {0}; int nsType = 1; int ret = EnterNsByPath(containerNsPath, nsType); EXPECT_LE(-1, ret); } -TEST_F(Test_Fhho, StrHasPrefix) -{ - EXPECT_EQ(1, StrHasPrefix("/home/user", "/home")); - EXPECT_EQ(0, StrHasPrefix("/home/user", "/heme")); -} - -TEST(StrHasPrefix, status1) -{ - EXPECT_EQ(1, StrHasPrefix("/home/user", "/home")); -} - -TEST(StrHasPrefix, status2) -{ - EXPECT_EQ(0, StrHasPrefix("/home/user", "/heme")); -} - -TEST_F(Test_Fhho, GetNsPath) +TEST_F(Test_Fhho, GetNsPathAndGetSelfNsPath) { char containerNsPath[BUF_SIZE] = {0}; int containerPid = 1; EXPECT_LE(0, GetNsPath(containerPid, "mnt", containerNsPath, BUF_SIZE)); -} - -TEST_F(Test_Fhho, GetSelfNsPath) -{ char nsPath[BUF_SIZE] = {0}; EXPECT_LE(0, GetSelfNsPath("mnt", nsPath, BUF_SIZE)); } -TEST(MountDevice, Status1) +TEST(MountDevice, StatusOne) { char *rootfs="/home"; MOCKER(Mount).stubs().will(invoke(stub_Mount_failed)); @@ -442,14 +419,16 @@ TEST(MountDevice, Status1) GlobalMockObject::verify(); } -TEST(MountDevice, Status2) +TEST(MountDevice, StatusTwo) { + // Test root file system does not exist mount + // Assign a false file path char *rootfs="/home/notexists"; char *deviceName="davinci0"; EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } -TEST(MountDevice, Status3) +TEST(MountDevice, StatusThree) { char *rootfs="/home"; MOCKER(stat).stubs().will(invoke(stub_stat_success)); @@ -461,7 +440,7 @@ TEST(MountDevice, Status3) GlobalMockObject::verify(); } -TEST(MountDevice, Status4) +TEST(MountDevice, StatusFour) { char *rootfs="/home"; MOCKER(mount).stubs().will(invoke(stub_mount_success)); @@ -471,7 +450,7 @@ TEST(MountDevice, Status4) EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } -TEST(DoDeviceMounting, Status1) +TEST(DoDeviceMounting, StatusOne) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; @@ -482,7 +461,7 @@ TEST(DoDeviceMounting, Status1) EXPECT_EQ(0, ret); } -TEST(DoDeviceMounting, Status2) +TEST(DoDeviceMounting, StatusTwo) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Failed)); char *rootfs = "/home"; @@ -493,7 +472,7 @@ TEST(DoDeviceMounting, Status2) EXPECT_EQ(-1, ret); } -TEST(DoDirectoryMounting, Status1) +TEST(DoDirectoryMounting, StatusOne) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); struct MountList list = {0}; @@ -504,7 +483,7 @@ TEST(DoDirectoryMounting, Status1) EXPECT_EQ(-1, ret); } -TEST(DoDirectoryMounting, Status2) +TEST(DoDirectoryMounting, StatusTwo) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Success)); struct MountList list = {0}; @@ -515,7 +494,7 @@ TEST(DoDirectoryMounting, Status2) EXPECT_EQ(0, ret); } -TEST(DoMounting, Status1) +TEST(DoMounting, StatusOne) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Failed)); struct ParsedConfig config; @@ -528,7 +507,7 @@ TEST(DoMounting, Status1) EXPECT_EQ(-1, ret); } -TEST(DoMounting, Status2) +TEST(DoMounting, StatusTwo) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); @@ -542,7 +521,7 @@ TEST(DoMounting, Status2) EXPECT_EQ(-1, ret); } -TEST(DoMounting, Status3) +TEST(DoMounting, StatusThree) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); @@ -558,7 +537,7 @@ TEST(DoMounting, Status3) EXPECT_EQ(-1, ret); } -TEST(DoMounting, Status4) +TEST(DoMounting, StatusFour) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); @@ -576,39 +555,43 @@ TEST(DoMounting, Status4) } -TEST(CheckDirExists, Status1) +TEST(CheckDirExists, StatusOne) { + // Test directory exists char *dir = "/home"; int len = strlen(dir); int ret = CheckDirExists(dir, len); EXPECT_EQ(0, ret); } -TEST(CheckDirExists, Status2) +TEST(CheckDirExists, StatusTwo) { + // Test directory does not exist char *dir = "/home/notexist"; int len = strlen(dir); int ret = CheckDirExists(dir, len); EXPECT_EQ(-1, ret); } -TEST(GetParentPathStr, Status1) +TEST(GetParentPathStr, StatusOne) { + // Test get path parent directory char *path = "/usr/bin"; char parent[BUF_SIZE] = {0}; int ret = GetParentPathStr(path, parent, BUF_SIZE); EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, Status1) +TEST(MakeDirWithParent, StatusOne) { + // The test create directory contains the parent directory mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; int ret = MakeDirWithParent(parentDir, mode); EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, Status2) +TEST(MakeDirWithParent, StatusTwo) { mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; @@ -618,7 +601,7 @@ TEST(MakeDirWithParent, Status2) EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, Status3) +TEST(MakeDirWithParent, StatusThree) { char *pathData = "/path/abc/abcd"; mode_t mode = 0755; @@ -632,7 +615,7 @@ TEST(MakeDirWithParent, Status3) EXPECT_EQ(0, ret); } -TEST(MountDir, Status1) +TEST(MountDir, StatusOne) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); char *rootfs = "/dev"; @@ -642,7 +625,7 @@ TEST(MountDir, Status1) EXPECT_EQ(0, ret); } -TEST(MountDir, Status2) +TEST(MountDir, StatusTwo) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Failed)); @@ -653,7 +636,7 @@ TEST(MountDir, Status2) EXPECT_EQ(-1, ret); } -TEST(MountDir, Status3) +TEST(MountDir, StatusThree) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MkDir).stubs().will(invoke(stub_MkDir_failed)); @@ -664,7 +647,7 @@ TEST(MountDir, Status3) EXPECT_EQ(-1, ret); } -TEST(MountDir, Status4) +TEST(MountDir, StatusFour) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); @@ -676,7 +659,7 @@ TEST(MountDir, Status4) EXPECT_EQ(-1, ret); } -TEST(MountDir, Status5) +TEST(MountDir, StatusFive) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); @@ -688,7 +671,7 @@ TEST(MountDir, Status5) EXPECT_EQ(0, ret); } -TEST(DoCtrlDeviceMounting, Status1) +TEST(DoCtrlDeviceMounting, StatusOne) { char *rootfs = "/home"; MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); @@ -697,7 +680,7 @@ TEST(DoCtrlDeviceMounting, Status1) EXPECT_EQ(-1, ret); } -TEST(DoCtrlDeviceMounting, Status2) +TEST(DoCtrlDeviceMounting, StatusTwo) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; @@ -706,7 +689,7 @@ TEST(DoCtrlDeviceMounting, Status2) EXPECT_EQ(0, ret); } -TEST(GetCgroupMount, Status1) +TEST(GetCgroupMount, StatusOne) { char *lineData = "406 403 0:27 /docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2 /sys/fs/cgroup/devices ro,nosuid,nodev,noexec,relatime master:15 - cgroup cgroup rw,devices"; char *line = NULL; @@ -717,7 +700,7 @@ TEST(GetCgroupMount, Status1) EXPECT_EQ(0, strcmp(actualRes, expectRes)); } -TEST(GetCgroupRoot, Status1) +TEST(GetCgroupRoot, StatusOne) { char *lineData = "3:devices:/docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2"; char *line = NULL; @@ -728,15 +711,16 @@ TEST(GetCgroupRoot, Status1) EXPECT_EQ(0, strcmp(actualRes, expectRes)); } -TEST(ParseFileByLine, Status1) +TEST(ParseFileByLine, StatusOne) { + // Test parse file content does not exist char *mountPath= "/not_exist_dir/mountinfo.txt"; char mount[BUF_SIZE] = {0x0}; int ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); EXPECT_EQ(-1, ret); } -TEST(SetupDeviceCgroup, Status1) +TEST(SetupDeviceCgroup, StatusOne) { char *cgroupPathData = "devices.allow"; char *cgroupPath = NULL; @@ -751,7 +735,7 @@ TEST(SetupDeviceCgroup, Status1) EXPECT_EQ(-1, ret); } -TEST(SetupDeviceCgroup, Status2) +TEST(SetupDeviceCgroup, StatusTwo) { char *cgroupPathData = "/not_exist_dir/devices1.allow"; char *cgroupPath = NULL; @@ -767,7 +751,7 @@ TEST(SetupDeviceCgroup, Status2) EXPECT_EQ(-1, ret); } -TEST(SetupDriverCgroup, Status1) +TEST(SetupDriverCgroup, StatusOne) { char *cgroupPath = "devices.allow"; FILE *cgroupAllow = NULL; @@ -781,7 +765,7 @@ TEST(SetupDriverCgroup, Status1) EXPECT_EQ(0, ret); } -TEST(SetupDriverCgroup, Status2) +TEST(SetupDriverCgroup, StatusTwo) { char *cgroupPath = "devices1.allow"; FILE *cgroupAllow = NULL; @@ -795,7 +779,7 @@ TEST(SetupDriverCgroup, Status2) EXPECT_EQ(-1, ret); } -TEST(GetCgroupPath, Status1) +TEST(GetCgroupPath, StatusOne) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -810,7 +794,7 @@ TEST(GetCgroupPath, Status1) EXPECT_EQ(0, ret); } -TEST(SetupCgroup, Status1) +TEST(SetupCgroup, StatusOne) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -822,7 +806,7 @@ TEST(SetupCgroup, Status1) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, Status2) +TEST(SetupCgroup, StatusTwo) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -836,7 +820,7 @@ TEST(SetupCgroup, Status2) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, Status3) +TEST(SetupCgroup, StatusThree) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -851,7 +835,7 @@ TEST(SetupCgroup, Status3) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, Status4) +TEST(SetupCgroup, StatusFour) { MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); @@ -866,7 +850,7 @@ TEST(SetupCgroup, Status4) EXPECT_EQ(0, ret); } -TEST(SetupContainer, Status1) +TEST(SetupContainer, StatusOne) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -879,7 +863,7 @@ TEST(SetupContainer, Status1) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, Status2) +TEST(SetupContainer, StatusTwo) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -893,7 +877,7 @@ TEST(SetupContainer, Status2) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, Status3) +TEST(SetupContainer, StatusThree) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -908,7 +892,7 @@ TEST(SetupContainer, Status3) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, Status4) +TEST(SetupContainer, StatusFour) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -924,7 +908,7 @@ TEST(SetupContainer, Status4) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, Status5) +TEST(SetupContainer, StatusFive) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -941,7 +925,7 @@ TEST(SetupContainer, Status5) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, Status6) +TEST(SetupContainer, StatusSix) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -959,31 +943,34 @@ TEST(SetupContainer, Status6) EXPECT_EQ(0, ret); } -TEST(Process, Status1) +TEST(Process, StatusOne) { + // test parameter is null int argc = 0; char **argv = NULL; int ret = Process(argc, argv); EXPECT_EQ(-1, ret); } -TEST(Process, Status2) +TEST(Process, StatusTwo) { + // Test the correct options int argc = 7; const char *argvData[7] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; int ret = Process(argc,const_cast(argvData)); EXPECT_EQ(-1, ret); } -TEST(Process, Status3) +TEST(Process, StatusThree) { + // Test error options int argc = 7; const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; int ret = Process(argc, const_cast(argvData)); EXPECT_EQ(-1, ret); } -TEST(Process, Status4) +TEST(Process, StatusFour) { int argc = 7; const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; @@ -993,14 +980,16 @@ TEST(Process, Status4) EXPECT_EQ(-1, ret); } -TEST(ParseRuntimeOptions, Status1) +TEST(ParseRuntimeOptions, StatusOne) { + // Test the right options const char options[BUF_SIZE] = "1,2"; + // Options is the parameter value of -o int ret = ParseRuntimeOptions(options); EXPECT_EQ(0, ret); } -TEST(DoPrepare, Status1) +TEST(DoPrepare, StatusOne) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; @@ -1015,7 +1004,7 @@ TEST(DoPrepare, Status1) EXPECT_EQ(0, ret); } -TEST(DoPrepare, Status2) +TEST(DoPrepare, StatusTwo) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; @@ -1030,7 +1019,7 @@ TEST(DoPrepare, Status2) EXPECT_EQ(0, ret); } -TEST(DoPrepare, Status3) +TEST(DoPrepare, StatusThree) { MOCKER(GetNsPath).stubs().will(invoke(Stub_GetNsPath_Failed)); struct CmdArgs args; @@ -1045,7 +1034,7 @@ TEST(DoPrepare, Status3) EXPECT_EQ(-1, ret); } -TEST(DoPrepare, Status4) +TEST(DoPrepare, StatusFour) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(GetSelfNsPath).stubs().will(invoke(Stub_GetSelfNsPath_Failed)); @@ -1061,7 +1050,7 @@ TEST(DoPrepare, Status4) EXPECT_EQ(-1, ret); } -TEST(DoPrepare, Status5) +TEST(DoPrepare, StatusFive) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(open).stubs().will(invoke(stub_open_failed)); -- Gitee From 078a3fb6ef172cf6f71058b13f1ed09cb8f910d3 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 25 Dec 2020 13:46:25 +0800 Subject: [PATCH 088/296] Match-id-36c9d11de54a4fd56dcd8366f58f2954416f3a19 --- cli/test/dt/testcase/{gtest_mytestcase.cpp => gtest_mytest.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cli/test/dt/testcase/{gtest_mytestcase.cpp => gtest_mytest.cpp} (100%) diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytest.cpp similarity index 100% rename from cli/test/dt/testcase/gtest_mytestcase.cpp rename to cli/test/dt/testcase/gtest_mytest.cpp -- Gitee From 420c307cc57720f6ec96d5567724b193d079e7f4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 25 Dec 2020 13:56:10 +0800 Subject: [PATCH 089/296] Match-id-c4ae084d0ce6b3a5cad37a17e872da8d91a9cb87 --- cli/test/dt/testcase/{gtest_mytest.cpp => gtest_mytestcase.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cli/test/dt/testcase/{gtest_mytest.cpp => gtest_mytestcase.cpp} (100%) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytestcase.cpp similarity index 100% rename from cli/test/dt/testcase/gtest_mytest.cpp rename to cli/test/dt/testcase/gtest_mytestcase.cpp -- Gitee From 952dc34fc0a24a552c60e32ab8139d4f028ebf0e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 25 Dec 2020 14:00:09 +0800 Subject: [PATCH 090/296] Match-id-333f7123c2729c3d59c4bcc37dde2e29e7a0c27b --- cli/test/dt/CMakeLists.txt | 2 +- cli/test/dt/testcase/{gtest_mytestcase.cpp => gtest_mytest.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename cli/test/dt/testcase/{gtest_mytestcase.cpp => gtest_mytest.cpp} (100%) diff --git a/cli/test/dt/CMakeLists.txt b/cli/test/dt/CMakeLists.txt index ca59ac7..158cd4d 100644 --- a/cli/test/dt/CMakeLists.txt +++ b/cli/test/dt/CMakeLists.txt @@ -72,7 +72,7 @@ add_definitions(-Dgtest) #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector -std=c++11 -D _GNU_SOURCE -fprofile-arcs") add_subdirectory(srclib) -set(UT_DEMO_SRCS testcase/main.cpp testcase/gtest_mytestcase.cpp) +set(UT_DEMO_SRCS testcase/main.cpp testcase/gtest_mytest.cpp) add_executable(ut_demo ${UT_DEMO_SRCS}) target_link_libraries(ut_demo diff --git a/cli/test/dt/testcase/gtest_mytestcase.cpp b/cli/test/dt/testcase/gtest_mytest.cpp similarity index 100% rename from cli/test/dt/testcase/gtest_mytestcase.cpp rename to cli/test/dt/testcase/gtest_mytest.cpp -- Gitee From 415829e2ac20f3017870c65a987b9ede4ffa3433 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Dec 2020 09:47:10 +0800 Subject: [PATCH 091/296] Match-id-65ef56fd55d55b850a27902f751bb036785cc1e2 --- runtime/main.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index 2ad30f9..8de4875 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -27,10 +27,10 @@ const ( ) var ( - hookCliPath = hookCli - hookDefaultFile = hookDefaultFilePath - dockerRuncName = dockerRuncFile - runcName = runcFile + hookCliPath = hookCli + hookDefaultFile = hookDefaultFilePath + dockerRuncName = dockerRuncFile + runcName = runcFile ) type args struct { @@ -60,12 +60,12 @@ var execRunc = func() error { if err != nil { runcPath, err = exec.LookPath(runcName) if err != nil { - return fmt.Errorf("failed to find the path of runc: %w", err) + return fmt.Errorf("failed to find the path of runc: %v", err) } } if err = syscall.Exec(runcPath, append([]string{runcPath}, os.Args[1:]...), os.Environ()); err != nil { - return fmt.Errorf("failed to exec runc: %w", err) + return fmt.Errorf("failed to exec runc: %v", err) } return nil @@ -74,12 +74,12 @@ var execRunc = func() error { func addHook(spec *specs.Spec) error { currentExecPath, err := os.Executable() if err != nil { - return fmt.Errorf("cannot get the path of ascend-docker-runtime: %w", err) + return fmt.Errorf("cannot get the path of ascend-docker-runtime: %v", err) } hookCliPath = path.Join(path.Dir(currentExecPath), hookCli) if _, err = os.Stat(hookCliPath); err != nil { - return fmt.Errorf("cannot find ascend-docker-hook executable file at %s: %w", hookCliPath, err) + return fmt.Errorf("cannot find ascend-docker-hook executable file at %s: %v", hookCliPath, err) } if spec.Hooks == nil { @@ -104,37 +104,37 @@ func addHook(spec *specs.Spec) error { func modifySpecFile(path string) error { stat, err := os.Stat(path) if err != nil { - return fmt.Errorf("spec file doesnt exist %s: %w", path, err) + return fmt.Errorf("spec file doesnt exist %s: %v", path, err) } jsonFile, err := os.OpenFile(path, os.O_RDWR, stat.Mode()) if err != nil { - return fmt.Errorf("cannot open oci spec file %s: %w", path, err) + return fmt.Errorf("cannot open oci spec file %s: %v", path, err) } defer jsonFile.Close() jsonContent, err := ioutil.ReadAll(jsonFile) if err != nil { - return fmt.Errorf("failed to read oci spec file %s: %w", path, err) + return fmt.Errorf("failed to read oci spec file %s: %v", path, err) } var spec specs.Spec if err := json.Unmarshal(jsonContent, &spec); err != nil { - return fmt.Errorf("failed to unmarshal oci spec file %s: %w", path, err) + return fmt.Errorf("failed to unmarshal oci spec file %s: %v", path, err) } if err := addHook(&spec); err != nil { - return fmt.Errorf("failed to inject hook: %w", err) + return fmt.Errorf("failed to inject hook: %v", err) } jsonOutput, err := json.Marshal(spec) if err != nil { - return fmt.Errorf("failed to marshal OCI spec file: %w", err) + return fmt.Errorf("failed to marshal OCI spec file: %v", err) } if _, err := jsonFile.WriteAt(jsonOutput, 0); err != nil { - return fmt.Errorf("failed to write OCI spec file: %w", err) + return fmt.Errorf("failed to write OCI spec file: %v", err) } return nil @@ -143,7 +143,7 @@ func modifySpecFile(path string) error { func doProcess() error { args, err := getArgs() if err != nil { - return fmt.Errorf("failed to get args: %w", err) + return fmt.Errorf("failed to get args: %v", err) } if args.cmd != "create" { @@ -153,14 +153,14 @@ func doProcess() error { if args.bundleDirPath == "" { args.bundleDirPath, err = os.Getwd() if err != nil { - return fmt.Errorf("failed to get current working dir: %w", err) + return fmt.Errorf("failed to get current working dir: %v", err) } } specFilePath := args.bundleDirPath + "/config.json" if err := modifySpecFile(specFilePath); err != nil { - return fmt.Errorf("failed to modify spec file %s: %w", specFilePath, err) + return fmt.Errorf("failed to modify spec file %s: %v", specFilePath, err) } return execRunc() -- Gitee From 4ca1c7d2247292bd19408f87f9c4873fdbfe8787 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 11 Jan 2021 17:31:02 +0800 Subject: [PATCH 092/296] Match-id-9022dc0b85035b9e027ab5a749409c1a758bcbcc --- cli/src/main.c | 2 +- cli/src/mount.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index a793184..50dc311 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -186,7 +186,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device errno = 0; idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { - LOG_ERROR("error: failed to convert device id (%s) from cmd args, caused by: %s.", token, strerror(errno)); + LOG_ERROR("error: failed to convert device id (%s) from cmd args", token); return -1; } diff --git a/cli/src/mount.c b/cli/src/mount.c index a05dc56..c99aa45 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,7 +239,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); + LOG_ERROR("error: failed to do directory mounting "); return -1; } } @@ -254,7 +254,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do file mounting for %s.", (const char *)&list->list[i][0]); + LOG_ERROR("error: failed to do file mounting "); return -1; } } -- Gitee From ed2ee0c4c74c1756732cd97a03a3eaf6814f2b3c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 11 Jan 2021 18:37:20 +0800 Subject: [PATCH 093/296] Match-id-21645298263f560eb89f9dbb6915ce57f642fbf0 --- cli/test/dt/testcase/gtest_mytest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index ee6a339..0a40c6b 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -436,7 +436,7 @@ TEST(MountDevice, StatusThree) MOCKER(open).stubs().will(invoke(stub_open_success)); MOCKER(mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci0"; - EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); + EXPECT_EQ(0, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); } -- Gitee From 79b132100b039fd7fb4cae9be535b45769629c55 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 11 Jan 2021 18:42:54 +0800 Subject: [PATCH 094/296] Match-id-c519ccde68e8b7b5d63d1f8928be00aa904d31d7 --- cli/test/dt/testcase/gtest_mytest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 0a40c6b..22b3558 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -436,8 +436,9 @@ TEST(MountDevice, StatusThree) MOCKER(open).stubs().will(invoke(stub_open_success)); MOCKER(mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci0"; - EXPECT_EQ(0, MountDevice(rootfs, deviceName)); GlobalMockObject::verify(); + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); + } TEST(MountDevice, StatusFour) -- Gitee From 45aa355c3d7993b0d97720924b4c6157eee2275f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 12 Jan 2021 15:26:29 +0800 Subject: [PATCH 095/296] Match-id-1317a00ad8bf13d7fd8e09830d5aa4b8a1deb820 --- cli/src/mount.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index c99aa45..b117c97 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,8 +239,8 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting "); - return -1; + list->list[i][PATH_MAX]='\0'; + LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; } } @@ -254,7 +254,8 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do file mounting "); + list->list[i][PATH_MAX]='\0'; + LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; } } -- Gitee From b1daad354dcfe9218ee439ba15c62fbe612d02b5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 12 Jan 2021 15:37:05 +0800 Subject: [PATCH 096/296] Match-id-5348599bfa43d7db0509963100f6083bf7ec84f8 --- cli/src/mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index b117c97..3f95c66 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,7 +239,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - list->list[i][PATH_MAX]='\0'; + list->list[i][PATH_MAX] = '\0'; LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; } } @@ -254,8 +254,8 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - list->list[i][PATH_MAX]='\0'; - LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); + list->list[i][PATH_MAX] = '\0'; + LOG_ERROR("error: failed to do file mounting for %s.", (const char *)&list->list[i][0]); return -1; } } -- Gitee From 08358ac074a495cb0b7f8e07d572ff79c69896f7 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 12 Jan 2021 15:42:23 +0800 Subject: [PATCH 097/296] Match-id-eb7c5ccb88c12aa5f271de39d94b6abea95d8938 --- cli/src/mount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 3f95c66..2a2e9a3 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -240,7 +240,9 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { list->list[i][PATH_MAX] = '\0'; - LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; + LOG_ERROR("error: failed to do directory mounting for %s.", + (const char *)&list->list[i][0]); + return -1; } } -- Gitee From 5a0ff181081a3c59c8e2c4f0bb04e3ab81e06183 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 12 Jan 2021 19:31:45 +0800 Subject: [PATCH 098/296] Match-id-3f5330807f57dc791a928a15752003434faed7ac --- cli/src/mount.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cli/src/mount.c b/cli/src/mount.c index 2a2e9a3..a05dc56 100644 --- a/cli/src/mount.c +++ b/cli/src/mount.c @@ -239,9 +239,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - list->list[i][PATH_MAX] = '\0'; - LOG_ERROR("error: failed to do directory mounting for %s.", - (const char *)&list->list[i][0]); + LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); return -1; } } @@ -256,7 +254,6 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - list->list[i][PATH_MAX] = '\0'; LOG_ERROR("error: failed to do file mounting for %s.", (const char *)&list->list[i][0]); return -1; } -- Gitee From 028a033621009915e3f0808190e34934203502d4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 28 Jan 2021 20:59:27 +0800 Subject: [PATCH 099/296] Match-id-3089c9ce729c7076dec86ed0ea206173da3ad324 --- ci/dependency.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index bc4f523..ebd3357 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -4,7 +4,7 @@ Component Generic - MindStudio + CANN ascend-docker-plugin 20.10.0.B010 -- Gitee From 2f8e7977e87026f8e6783a9bc62efe73feae34a8 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 7 Feb 2021 10:42:00 +0800 Subject: [PATCH 100/296] Match-id-2cc585b8e7d972e49b1798f0745ac2acaaedd2e2 --- cli/src/basic.h | 1 + cli/src/cgrp.c | 10 ++++-- cli/src/main.c | 2 +- cli/src/options.c | 21 ++++++----- cli/src/options.h | 1 + cli/src/{mount.c => u_mount.c} | 52 ++++++++++++++++----------- cli/src/{mount.h => u_mount.h} | 0 cli/test/dt/testcase/gtest_mytest.cpp | 14 +++++--- hook/main.go | 1 + 9 files changed, 66 insertions(+), 36 deletions(-) rename cli/src/{mount.c => u_mount.c} (80%) rename cli/src/{mount.h => u_mount.h} (100%) diff --git a/cli/src/basic.h b/cli/src/basic.h index 3335cb1..ab5d288 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -10,6 +10,7 @@ #include #define DEVICE_NAME "davinci" +#define VDEVICE_NAME "vdavinci" #define DAVINCI_MANAGER "davinci_manager" #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index dc60394..4783c02 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -8,12 +8,16 @@ #include #include #include -#include #include + +#include #include #include + #include "securec.h" + #include "utils.h" +#include "options.h" bool TakeNthWord(char **pLine, unsigned int n, char **word) { @@ -268,7 +272,9 @@ int SetupCgroup(const struct ParsedConfig *config) } for (size_t idx = 0; idx < config->devicesNr; idx++) { - ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, config->devices[idx]); + int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", + (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), + config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); LOG_ERROR("error: failed to assemble device path for no.%u.", config->devices[idx]); diff --git a/cli/src/main.c b/cli/src/main.c index 50dc311..662d578 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -16,7 +16,7 @@ #include "basic.h" #include "ns.h" -#include "mount.h" +#include "u_mount.h" #include "cgrp.h" #include "options.h" diff --git a/cli/src/options.c b/cli/src/options.c index 7ab75d9..144e3d3 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -10,6 +10,7 @@ static struct { bool noDrv; + bool isVirtual; } g_runtimeOptions; static struct { @@ -17,6 +18,7 @@ static struct { bool *flag; } g_optionNameFlagTable[] = { {"NODRV", &g_runtimeOptions.noDrv}, // 不挂载Driver + {"VIRTUAL", &g_runtimeOptions.isVirtual}, {NULL, NULL} }; @@ -24,23 +26,21 @@ void ParseRuntimeOptions(const char *options) { // set defaults value g_runtimeOptions.noDrv = false; + g_runtimeOptions.isVirtual = false; static const char *seperator = ","; char *runtimeOptions = strdup(options); char *context = NULL; char *token = NULL; - token = strtok_s(runtimeOptions, seperator, &context); - while (token != NULL) { + for (token = strtok_s(runtimeOptions, seperator, &context); + token != NULL; + token = strtok_s(NULL, seperator, &context)) { for (int i = 0; g_optionNameFlagTable[i].name != NULL; i++) { - if (strcmp((const char *)token, g_optionNameFlagTable[i].name)) { - continue; + if (!strcmp((const char *)token, g_optionNameFlagTable[i].name)) { + *g_optionNameFlagTable[i].flag = true; } - - *g_optionNameFlagTable[i].flag = true; } - - token = strtok_s(NULL, seperator, &context); } free(runtimeOptions); @@ -50,3 +50,8 @@ bool IsOptionNoDrvSet() { return g_runtimeOptions.noDrv; } + +bool IsVirtual() +{ + return g_runtimeOptions.isVirtual; +} diff --git a/cli/src/options.h b/cli/src/options.h index ab7ddda..e30eda1 100644 --- a/cli/src/options.h +++ b/cli/src/options.h @@ -9,5 +9,6 @@ void ParseRuntimeOptions(const char *options); bool IsOptionNoDrvSet(); +bool IsVirtual(); #endif diff --git a/cli/src/mount.c b/cli/src/u_mount.c similarity index 80% rename from cli/src/mount.c rename to cli/src/u_mount.c index a05dc56..7670794 100644 --- a/cli/src/mount.c +++ b/cli/src/u_mount.c @@ -2,7 +2,7 @@ * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. * Description: ascend-docker-cli工具容器设备与驱动挂载模块 */ -#include "mount.h" +#include "u_mount.h" #include #include @@ -10,6 +10,8 @@ #include #include #include "securec.h" + +#include "basic.h" #include "utils.h" #include "options.h" @@ -34,8 +36,8 @@ int Mount(const char *src, const char *dst) return 0; } -static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, - struct PathInfo* pathInfo) +static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, + const char *dstDeviceName, struct PathInfo* pathInfo) { int ret; errno_t err; @@ -52,7 +54,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, char *src = pathInfo->src; char *dst = pathInfo->dst; - ret = sprintf_s(src, srcBufSize, "/dev/%s", deviceName); + ret = sprintf_s(src, srcBufSize, "/dev/%s", srcDeviceName); if (ret < 0) { return -1; } @@ -67,7 +69,15 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, return -1; } - err = strcpy_s(dst, dstBufSize, (const char *)resolvedDst); + if (dstDeviceName != NULL) { + ret = sprintf_s(dst, dstBufSize, "%s/dev/%s", rootfs, dstDeviceName); + if (ret < 0) { + return -1; + } + } else { + err = strcpy_s(dst, dstBufSize, resolvedDst); + } + if (err != EOK) { LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); return -1; @@ -76,16 +86,16 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *deviceName, return 0; } -int MountDevice(const char *rootfs, const char *deviceName) +int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { int ret; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, deviceName, &pathInfo); + ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - LOG_ERROR("error: failed to get device mount src and(or) dst path, device name: %s.", deviceName); + LOG_ERROR("error: failed to get device mount src and(or) dst path, device name: %s.", srcDeviceName); return -1; } @@ -124,20 +134,21 @@ int MountDevice(const char *rootfs, const char *deviceName) return 0; } -int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr) +int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { - char deviceName[BUF_SIZE] = {0}; + char srcDeviceName[BUF_SIZE] = {0}; + char dstDeviceName[BUF_SIZE] = {0}; for (size_t idx = 0; idx < idsNr; idx++) { - int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); - if (ret < 0) { + int srcRet = sprintf_s(srcDeviceName, BUF_SIZE, "%s%u", device_name, ids[idx]); + int dstRet = sprintf_s(dstDeviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); + if (srcRet < 0 || dstRet < 0) { LOG_ERROR("error: assemble device name failed, id: %u.", ids[idx]); return -1; } - - ret = MountDevice(rootfs, deviceName); + int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - LOG_ERROR("error: failed to mount device %s.", deviceName); + LOG_ERROR("error: failed to mount device %s.", srcDeviceName); return -1; } } @@ -211,19 +222,19 @@ int MountDir(const char *rootfs, const char *src) int DoCtrlDeviceMounting(const char *rootfs) { /* device */ - int ret = MountDevice(rootfs, DAVINCI_MANAGER); + int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { LOG_ERROR("error: failed to mount device %s.", DAVINCI_MANAGER); return -1; } - ret = MountDevice(rootfs, DEVMM_SVM); + ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { LOG_ERROR("error: failed to mount device %s.", DEVMM_SVM); return -1; } - ret = MountDevice(rootfs, HISI_HDC); + ret = MountDevice(rootfs, HISI_HDC, NULL); if (ret < 0) { LOG_ERROR("error: failed to mount device %s.", HISI_HDC); return -1; @@ -265,8 +276,9 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) int DoMounting(const struct ParsedConfig *config) { int ret; - - ret = DoDeviceMounting(config->rootfs, config->devices, config->devicesNr); + ret = DoDeviceMounting(config->rootfs, + (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), + config->devices, config->devicesNr); if (ret < 0) { LOG_ERROR("error: failed to mount devices."); return -1; diff --git a/cli/src/mount.h b/cli/src/u_mount.h similarity index 100% rename from cli/src/mount.h rename to cli/src/u_mount.h diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 22b3558..3f24791 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -15,6 +15,7 @@ using namespace std; using namespace testing; #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" +#define DEVICE_NAME "davinci" #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 @@ -36,7 +37,7 @@ extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bu extern "C" int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); extern "C" int EnterNsByPath(const char *path, int nsType); extern "C" int MountDevice(const char *rootfs, const char *deviceName); -extern "C" int DoDeviceMounting(const char *rootfs, const unsigned int ids[], size_t idsNr); +extern "C" int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr); extern "C" int CheckDirExists(char *dir, int len); extern "C" int GetParentPathStr(const char *path, char *parent, size_t bufSize); extern "C" int MakeDirWithParent(const char *path, mode_t mode); @@ -57,6 +58,7 @@ extern "C" int DoDirectoryMounting(const char *rootfs, const struct MountList *l extern "C" int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config); extern "C" int ParseRuntimeOptions(const char *options); extern "C" bool IsOptionNoDrvSet(); +extern "C" bool IsVirtual(); struct MountList { unsigned int count; @@ -215,12 +217,12 @@ int Stub_EnterNsByPath_Failed(const char *path, int nsType) return 0; } -int Stub_DoDeviceMounting_Success(const char *rootfs, const unsigned int ids[], size_t idsNr) +int Stub_DoDeviceMounting_Success(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { return 0; } -int Stub_DoDeviceMounting_Failed(const char *rootfs, const unsigned int ids[], size_t idsNr) +int Stub_DoDeviceMounting_Failed(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { return -1; } @@ -457,7 +459,8 @@ TEST(DoDeviceMounting, StatusOne) char *rootfs = "/home"; unsigned int devicesList[2] = {1, 2}; size_t idNr = 2; - int ret = DoDeviceMounting(rootfs, devicesList, idNr); + char *device_name = "davinci"; + int ret = DoDeviceMounting(rootfs, device_name, devicesList, idNr); GlobalMockObject::verify(); EXPECT_EQ(0, ret); } @@ -468,7 +471,8 @@ TEST(DoDeviceMounting, StatusTwo) char *rootfs = "/home"; unsigned int devicesList[2] = {1, 2}; size_t idNr = 2; - int ret = DoDeviceMounting(rootfs, devicesList, idNr); + char *device_name = "davinci"; + int ret = DoDeviceMounting(rootfs, device_name, devicesList, idNr); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); } diff --git a/hook/main.go b/hook/main.go index 1fcaf6e..c3c9453 100644 --- a/hook/main.go +++ b/hook/main.go @@ -45,6 +45,7 @@ var ( var validRuntimeOptions = [...]string{ "NODRV", + "VIRTUAL", } type containerConfig struct { -- Gitee From 541da7868323963a323e847094d7ef6c22497ea6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 22 Feb 2021 10:44:18 +0800 Subject: [PATCH 101/296] Match-id-c1477695285d5edb64350f36ed8f3541f2005cf9 --- cli/src/cgrp.c | 2 +- cli/src/u_mount.c | 2 +- install/deb/src/main.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 4783c02..22f2d9c 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -174,7 +174,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) return -1; } - return 0; + return 0; } int SetupDriverCgroup(FILE *cgroupAllow) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 7670794..c20edc1 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -48,7 +48,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, if (ret < 0) { return -1; } - + size_t srcBufSize = pathInfo->srcLen; size_t dstBufSize = pathInfo->dstLen; char *src = pathInfo->src; diff --git a/install/deb/src/main.c b/install/deb/src/main.c index dbd1070..4ee0919 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -33,7 +33,7 @@ void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) fprintf(stderr, "file size too large\n"); return; } - + fseek(pf, 0, SEEK_SET); fread(text, sizeof(char), size, pf); text[size] = '\0'; @@ -41,14 +41,14 @@ void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { - cJSON *root = NULL; + cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { fprintf(stderr, "create ascend runtime info root err\n"); return NULL; } - cJSON *newString = NULL; + cJSON *newString = NULL; newString = cJSON_CreateString(runtimePath); if (newString == NULL) { fprintf(stderr, "create ascend runtime info path value err\n"); @@ -74,7 +74,7 @@ cJSON *CreateAscendRuntimeInfo(const char *runtimePath) cJSON *CreateRuntimes(const char *runtimePath) { cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(runtimePath); + ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { fprintf(stderr, "create ascendruntime err\n"); return NULL; @@ -97,23 +97,23 @@ int DelJsonContent(cJSON *root, const char *key) { cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); - if (existItem == NULL) { + if (existItem == NULL) { return 0; } - cJSON *removedItem = NULL; + cJSON *removedItem = NULL; removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { fprintf(stderr, "remove %s failed\n", key); return -1; } - cJSON_Delete(removedItem); + cJSON_Delete(removedItem); return 0; } cJSON *CreateContent(const char *runtimePath) -{ +{ /* 插入ascend runtime */ cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); @@ -167,12 +167,12 @@ cJSON *ModifyContent(FILE *pf, const char *runtimePath) cJSON_Delete(root); return NULL; } - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); } else { int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); if (ret != 0) { cJSON_Delete(root); - return NULL; + return NULL; } cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); @@ -180,14 +180,14 @@ cJSON *ModifyContent(FILE *pf, const char *runtimePath) cJSON_Delete(root); return NULL; } - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); } /* 插入defaul runtime */ int ret = DelJsonContent(root, DEFALUT_KEY); if (ret != 0) { cJSON_Delete(root); - return NULL; + return NULL; } cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); if (defaultRuntime == NULL) { @@ -195,7 +195,7 @@ cJSON *ModifyContent(FILE *pf, const char *runtimePath) return NULL; } cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - + return root; } @@ -232,7 +232,7 @@ cJSON *RemoveContent(FILE *pf) cJSON_Delete(root); return NULL; } - + return root; } @@ -240,7 +240,7 @@ cJSON *RemoveContent(FILE *pf) int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { cJSON *root = NULL; - FILE *pf = NULL; + FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { root = CreateContent(runtimePath); @@ -259,7 +259,7 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const ch fprintf(stderr, "error: failed to create file\n"); return -1; } - + fprintf(pf, "%s", cJSON_Print(root)); fclose(pf); @@ -270,7 +270,7 @@ int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const ch int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { - FILE *pf = NULL; + FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { fprintf(stderr, "error: no json files found\n"); @@ -291,13 +291,13 @@ int CreateRevisedJsonFile(const char *filePath, const char *tempPath) cJSON_Delete(newContent); return -1; } - + fprintf(pf, "%s", cJSON_Print(newContent)); fclose(pf); cJSON_Delete(newContent); - return 0; + return 0; } /* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ @@ -319,5 +319,5 @@ int main(int argc, char *argv[]) return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); } - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); } -- Gitee From cc0c19d733b3d1d52e20c26b2789132e5059bcdc Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 3 Mar 2021 09:56:57 +0800 Subject: [PATCH 102/296] Match-id-bd9e66656d6a4c560db29728e252aa3c1bc701ae --- cli/src/u_mount.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index c20edc1..e1ec39e 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -76,11 +76,10 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } } else { err = strcpy_s(dst, dstBufSize, resolvedDst); - } - - if (err != EOK) { - LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); - return -1; + if (err != EOK) { + LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); + return -1; + } } return 0; -- Gitee From 171cdfd74e420e26743285b3b5d38bc40d601980 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 3 Mar 2021 11:01:14 +0800 Subject: [PATCH 103/296] Match-id-2acb6e7a5762e3f8722606de5b3a3bb204e9f1af --- cli/src/u_mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index e1ec39e..0c7170e 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -77,9 +77,9 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); - return -1; - } + LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); + return -1; + } } return 0; -- Gitee From 2271c5ec917d0e2df91e165b6921872c09e9ed3a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 3 Mar 2021 11:09:16 +0800 Subject: [PATCH 104/296] Match-id-c0b2c7a8f522c291c252ba6ffb366f5110a76aee --- cli/src/u_mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 0c7170e..dacf70a 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -77,8 +77,8 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); - return -1; + LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); + return -1; } } -- Gitee From a106fd707665c2581cf6cd67bd3b78dddc246e62 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 12 Mar 2021 09:42:36 +0800 Subject: [PATCH 105/296] Match-id-9324e51805e853ef553cee62a593c17794962446 --- hook/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hook/main.go b/hook/main.go index c3c9453..8a55787 100644 --- a/hook/main.go +++ b/hook/main.go @@ -195,10 +195,15 @@ var getContainerConfig = func() (*containerConfig, error) { if err != nil { return nil, fmt.Errorf("failed to parse OCI spec: %v", err) } + // when use ctr->containerd. the rootfs in config.json is a relative path + rfs := ociSpec.Root.Path + if (!filepath.IsAbs(rfs)) { + rfs = path.Join(state.Bundle, ociSpec.Root.Path) + } ret := &containerConfig{ Pid: state.Pid, - Rootfs: ociSpec.Root.Path, + Rootfs: rfs, Env: ociSpec.Process.Env, } -- Gitee From 4330f9663dc32598bb73a9dd74509114cc5dbcdb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 29 Mar 2021 11:16:39 +0800 Subject: [PATCH 106/296] Match-id-3ebaaddbec99f6f4149173c1362f827341537d35 --- README.md | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21aabf8..df03bdd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,134 @@ -# ascend-docker-plugin + + # 简介 +容器引擎插件(Ascend Docker,又叫昇腾容器)是CANN的基础组件,为所有的AI训练/推理作业提供Ascend NPU(昇腾处理器)容器化支持,使用户AI作业能够以Docker容器的方式平滑运行在昇腾设备之上,如图2-1所示。Ascend Docker配套发布的软件包为Ascend-docker-runtime,已集成至实用工具包toolbox中。 +图2-1 Ascend Docker +![image](/uploads/cd30f5e0-d6bd-4838-8d3d-c2a1aa5fcd0b/1616986155878.png '1616986155878.png') +## Ascend Docker价值 +- 充分解耦:与Docker解耦,无需修改Docker代码,Runtime可以独立演进。 +- 后向兼容:提供可选装的Runtime,不影响原生Docker使用方式。 +- 易适配:与客户现有平台和系统平滑适配,不影响原Docker的命令接口。 +- 易部署:提供rpm包部署,用户安装后即可用Docker创建挂载Ascend NPU的容器。 + +## Ascend Docker设计简介 +Ascend Docker本质上是基于OCI标准实现的Docker Runtime,不修改Docker引擎,对Docker以插件方式提供Ascend NPU适配功能。 +如图2-2所示,Ascend Docker通过OCI接口与原生Docker对接。在原生Docker的runc启动容器过程中,会调用prestart-hook对容器进行配置管理。 +图2-2 Docker适配原理 +![image](/uploads/5a5617b5-a9ef-4df2-b023-bd641d77257f/1616986181176.png '1616986181176.png') +其中,prestart-hook是OCI定义的容器生存状态,即created状态到running状态的一个中间过渡所设置的钩子函数。在这个过渡状态,容器的namespace已经被创建,但容器的作业还没有启动,因此可以对容器进行设备挂载,cgroup配置等操作。这样随后启动的作业便可以使用到这些配置。 +Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置操作: +1.根据ASCEND_VISIBLE_DEVICES,将对应的NPU设备挂载到容器的namespace。 +2.在Host上配置该容器的device cgroup,确保该容器只可以使用指定的NPU,保证设备的隔离。 +3.将Host上的CANN Runtime Library挂载到容器的namespace。 + +# 发行说明 +## Ascend-Docker-Runtime2.0 +### 更新说明 + - 容器内设备序号保持不变 + - 添加NODRV选项不挂载驱动目录 + - 适配驱动--run安装模式 + - 适配训练驱动npu-smi位置从sbin移动到bin + - 挂载列表可配置 + - 适配海思驱动移除add-ons目录修改 + - 跳过不存在的挂载项 + +### 约束 + - Ascend-Docker-Runtime暂不支持Atlas 200 AI加速模块(RC场景)和Atlas 500智能小站 + +# 下载和安装 +## 安装前准备 + +- 安装大于18.03版本的docker + +- 安装驱动:下载链接为https://ascend.huawei.com/zh/#/software/cann/commercial + +- 安装固件:下载链接为https://ascend.huawei.com/zh/#/software/cann/commercial + + + +## 下载 +### run包 +开发人员可从昇腾社区下载Toolbox,下载链接为:https://ascend.huawei.com/zh/#/software/cann/commercial, +下载后安装Toolbox,Ascend-docker-runtime,已集成至实用工具包toolbox中。 + +# 功能 +## 默认挂载目录 +| 挂载项 | 备注 | +|:-----------:| :-------------:| +|/dev/davinciX|NPU设备,X是物理ID号例如davinci0| +|/dev/davinci_manager |管理设备| +| /dev/devmm_svm| 管理设备| +|/dev/hisi_hdc | 管理设备| +|/usr/local/Ascend/driver/{lib64, include, tools} |驱动目录| + |/usr/local/dcmi | DCMI目录| +|/usr/local/bin/npu-smi | npu-smi工具| +## Ascend-Docker-runtime安装 +单独安装 +``` +chmod +x Ascend-cann-toolbox*.run +./Ascend-cann-toolbox*.run --install --whitelist=docker-runtime +systemctl daemon-reload +systenctl restart docker +``` +集成工具toolboox安装 +``` +chmod +x Ascend-cann-toolbox*.run +./Ascend-cann-toolbox*.run --install +systemctl daemon-reload +systemctl restart docker +``` +## 挂载单芯片 +例子: +``` +docker run -it -e ASCEND_VISIBLE_DEVICES=0 imageId /bin/bash +``` +imageId 替换为实际镜像名或者ID + +检查挂载成功: +``` +ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin +``` +![image](/uploads/1e77fb8a-f2ca-4768-a331-934b3da2de44/1616986864390.png '1616986864390.png') + +ASCEND_VISIBLE_DEVICES=0,参数0替换为要挂载的芯片物理ID +## 挂载多芯片 +例子: +``` +docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-3 imageId /bin/bash +或者 +docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0,1,2,3 imageId /bin/bash +或者 +docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-2,3 imageId /bin/bash +``` +检查挂载成功: +``` +ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin +``` +![image](/uploads/96fa6aff-59f9-48bb-ba52-13dcf0ff649b/1616986959639.png '1616986959639.png') +## 在默认的挂载的基础上新增挂载内容 +``` +在/etc/ascend-docker-runtime.d目录下新建挂载文件xxx.list,内容格式例子: +/usr/bin/curl +/usr/bin/gcc +... + +在命令中使用文件例子: +docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=xxx imageId /bin/bash +``` +xxx是新增挂载内容文件名,文件名必须是小写 + +检查挂载成功: + +![image](/uploads/a8f82fea-4075-45e3-b5a1-d9aa7dec267a/1616987709657.png '1616987709657.png') +## 卸载 + +集成工具toolboox安装 +``` +./Ascend-cann-toolbox*.run --uninstall +``` +## 升级 + +集成工具toolboox安装方式升级 +``` +./Ascend-cann-toolbox*.run --upgrade +``` -- Gitee From 70038668d76547eb5233e5e4afa4657d6f5404ae Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 22 Mar 2021 10:41:06 +0800 Subject: [PATCH 107/296] Match-id-9918e413501852b106e090dd2de78eaa1e3aff29 --- build/build.sh | 5 +---- ci/dependency.xml | 29 ----------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/build/build.sh b/build/build.sh index 5ca5c26..8f2afae 100644 --- a/build/build.sh +++ b/build/build.sh @@ -109,19 +109,16 @@ function make_pull() function make_unzip() { cd ${OPENSRC} - tar -xzvf cJSON*.tar.gz CJSONS=$(find . -name "cJSON.*") CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson /bin/cp -f ${CJSONS} ${CJSONSLIB} - unzip makeself-release-*.zip - rm -f makeself-release-*.zip MAKESELF_DIR=$(find . -name "makeself-release-*") cd ${MAKESELF_DIR} && /bin/cp -f ${BUILD}/scripts/mkselfmodify.patch ./ patch -p0 < mkselfmodify.patch rm -f mkselfmodify.patch - cd ${PLATFORM} + cd ${PLATFORM}/HuaweiSecureC SECURECSRC=$(find . -name "src") SECURECINC=$(find . -name "include") diff --git a/ci/dependency.xml b/ci/dependency.xml index ebd3357..c78680d 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -17,35 +17,6 @@ - - - 3rd-party - Generic - - cJSON-1.7.13.tar.gz - 05834SXQ - - - - /* - opensource - - - - - 3rd-party - Generic - - makeself-release-2.4.2.zip - 05836ECT - - - - /* - opensource - - - BVersion -- Gitee From 11f6d4bdb95aaad053fd546dc4c8728518b1c9f1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 31 Mar 2021 15:01:19 +0800 Subject: [PATCH 108/296] Match-id-5a1a6f71dabf293cfa64b2b6086a2eedd110fee1 --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df03bdd..a6c09dd 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,10 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 # 下载和安装 ## 安装前准备 -- 安装大于18.03版本的docker +- 安装大于18.03版本的docker,请参考[安装详情](https://mirrors.huaweicloud.com/) -- 安装驱动:下载链接为https://ascend.huawei.com/zh/#/software/cann/commercial +- 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373)的“准备硬件环境”章节。 -- 安装固件:下载链接为https://ascend.huawei.com/zh/#/software/cann/commercial @@ -76,6 +75,10 @@ chmod +x Ascend-cann-toolbox*.run systemctl daemon-reload systemctl restart docker ``` +安装docker-runtime后修改配置文件/etc/docker/daemon.json +![image](/uploads/39331d5d-9f97-4c87-a158-4d588fb165e4/1617173956504.png '1617173956504.png') +同时生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list +![image](/uploads/611245b0-4902-4f5b-87ba-4d86f9fc2878/1617174009598.png '1617174009598.png') ## 挂载单芯片 例子: ``` -- Gitee From 6aaf18dc72cd4628e9824ca82980f6d2e5525768 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 31 Mar 2021 16:09:52 +0800 Subject: [PATCH 109/296] Match-id-43f34ea461233ae3f21623e94e843727652f88d7 --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6c09dd..82580a9 100644 --- a/README.md +++ b/README.md @@ -122,12 +122,18 @@ xxx是新增挂载内容文件名,文件名必须是小写 检查挂载成功: ![image](/uploads/a8f82fea-4075-45e3-b5a1-d9aa7dec267a/1616987709657.png '1616987709657.png') + +启动容器时docker客户端会根据/etc/docker/daemon.json配置文件调用docker-runtime,容器正常启动时修改 +/proc/当前进程id/cgroup 资源隔离文件 ## 卸载 -集成工具toolboox安装 +集成工具toolboox卸载 ``` ./Ascend-cann-toolbox*.run --uninstall ``` +安装docker-runtime后删除安装时配置文件/etc/docker/daemon.json中新增的内容 +![image](/uploads/cfc84280-2180-4e4b-8feb-6c398b837e54/1617178154877.png '1617178154877.png') +同时删除默认挂载目录文件/etc/ascend-docker-runtime.d/base.list ## 升级 集成工具toolboox安装方式升级 -- Gitee From f839f782206a8f503cbb4e9a5ce8237d0f242c80 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 31 Mar 2021 17:41:17 +0800 Subject: [PATCH 110/296] Match-id-f0da1da80554a23a5ff628c2311b58fd90661e16 --- build/build.sh | 1 + build/scripts/run_main.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/build/build.sh b/build/build.sh index 5ca5c26..432108c 100644 --- a/build/build.sh +++ b/build/build.sh @@ -85,6 +85,7 @@ function build_run_package() exit 1 fi + /bin/cp -f ${ROOT}/README.md run_pkg /bin/cp -f scripts/run_main.sh run_pkg chmod 550 run_pkg/run_main.sh diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index adc41c6..ec0eb6e 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -24,6 +24,7 @@ function install() chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./README.md ${INSTALL_PATH}/README.md mkdir -p ${INSTALL_PATH}/script cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh chmod 550 ${INSTALL_PATH}/script/uninstall.sh -- Gitee From 980ea3ca4b578d3922c874e2f8ca24ba3dcf6f68 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 31 Mar 2021 17:55:00 +0800 Subject: [PATCH 111/296] Match-id-ab11b6392102c03a3fa3df54e278021b360ac088 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 82580a9..a89e44a 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,9 @@ chmod +x Ascend-cann-toolbox*.run systemctl daemon-reload systemctl restart docker ``` -安装docker-runtime后修改配置文件/etc/docker/daemon.json +安装docker-runtime后会修改配置文件/etc/docker/daemon.json ![image](/uploads/39331d5d-9f97-4c87-a158-4d588fb165e4/1617173956504.png '1617173956504.png') -同时生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list +同时自动生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list ![image](/uploads/611245b0-4902-4f5b-87ba-4d86f9fc2878/1617174009598.png '1617174009598.png') ## 挂载单芯片 例子: @@ -131,7 +131,7 @@ xxx是新增挂载内容文件名,文件名必须是小写 ``` ./Ascend-cann-toolbox*.run --uninstall ``` -安装docker-runtime后删除安装时配置文件/etc/docker/daemon.json中新增的内容 +卸载docker-runtime后会自动删除安装时配置文件/etc/docker/daemon.json中新增的内容 ![image](/uploads/cfc84280-2180-4e4b-8feb-6c398b837e54/1617178154877.png '1617178154877.png') 同时删除默认挂载目录文件/etc/ascend-docker-runtime.d/base.list ## 升级 -- Gitee From eb3e66888576883f3defc4b8cbbf908b4d7a1a01 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Apr 2021 10:32:43 +0800 Subject: [PATCH 112/296] Match-id-9ab7667964ef3108b2f75a881d8d7eafaf41301c --- build/build.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/build/build.sh b/build/build.sh index 74f91c3..be396ee 100644 --- a/build/build.sh +++ b/build/build.sh @@ -101,12 +101,6 @@ function make_clean() [ -d "${OUTPUT}" ] && cd ${OUTPUT}&&rm -rf * } -function make_pull() -{ - cd ${OPENSRC} - wget -O cJSON.tar.gz https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz --no-check-certificate -} - function make_unzip() { cd ${OPENSRC} @@ -133,10 +127,6 @@ function make_unzip() } make_clean -if [ "$1" == "pull" ]; then - make_pull -fi - make_unzip build_bin build_run_package -- Gitee From e8e0c8bb1f24c18bdae83efb55e33c0736b5da94 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Apr 2021 14:38:15 +0800 Subject: [PATCH 113/296] Match-id-fc36bbb677992747cd8dadf27deef74378ef92c5 --- build/build.sh | 5 - build/scripts/mkselfmodify.patch | 228 ------------------------------- 2 files changed, 233 deletions(-) delete mode 100644 build/scripts/mkselfmodify.patch diff --git a/build/build.sh b/build/build.sh index be396ee..2ff704e 100644 --- a/build/build.sh +++ b/build/build.sh @@ -108,11 +108,6 @@ function make_unzip() CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson /bin/cp -f ${CJSONS} ${CJSONSLIB} - MAKESELF_DIR=$(find . -name "makeself-release-*") - cd ${MAKESELF_DIR} && /bin/cp -f ${BUILD}/scripts/mkselfmodify.patch ./ - patch -p0 < mkselfmodify.patch - rm -f mkselfmodify.patch - cd ${PLATFORM}/HuaweiSecureC SECURECSRC=$(find . -name "src") SECURECINC=$(find . -name "include") diff --git a/build/scripts/mkselfmodify.patch b/build/scripts/mkselfmodify.patch deleted file mode 100644 index 09c872c..0000000 --- a/build/scripts/mkselfmodify.patch +++ /dev/null @@ -1,228 +0,0 @@ ---- makeself-header.sh 2020-04-27 18:59:03.000000000 +0800 -+++ makeself-header_new.sh 2020-07-09 18:04:43.044000000 +0800 -@@ -1,12 +1,9 @@ - cat << EOF > "$archname" --#!/bin/sh -+#!/bin/bash - # This script was generated using Makeself $MS_VERSION - # The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) - - ORIG_UMASK=\`umask\` --if test "$KEEP_UMASK" = n; then -- umask 077 --fi - - CRCsum="$CRCsum" - MD5="$MD5sum" -@@ -16,6 +13,9 @@ - export USER_PWD - ARCHIVE_DIR=`dirname \$0` - export ARCHIVE_DIR -+name_of_file="\$0 " -+pwd_of_file="\$PWD " -+ - - label="$LABEL" - script="$SCRIPT" -@@ -148,6 +148,24 @@ - MS_Help() - { - cat << EOH >&2 -+Usage: \$0 [options] -+Options: -+ --help | -h Print this message -+ --info Print embedded info : title, default target directory, embedded script ... -+ --list Print the list of files in the archive -+ --check Checks integrity of the archive -+ --quiet Quiet install mode, skip human-computer interactions -+ --noexec Do not run embedded script -+ --extract= Extract directly to a target directory (absolute or relative) -+ Usually used with --noexec to just extract files without running -+ --tar arg1 [arg2 ...] Access the contents of the archive through the tar command -+\${helpheader} -+EOH -+} -+ -+MS_Help1() -+{ -+ cat << EOH >&2 - \${helpheader}Makeself version $MS_VERSION - 1) Getting help or info about \$0 : - \$0 --help Print this message -@@ -212,7 +230,7 @@ - fi - sha=\`echo \$SHA | cut -d" " -f\$i\` - if test x"\$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain an embedded SHA256 checksum." >&2 -+ test x"\$verb" = xy - else - shasum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$SHA_PATH \$SHA_ARG" | cut -b-64\`; - if test x"\$shasum" != x"\$sha"; then -@@ -230,7 +248,7 @@ - fi - md5=\`echo \$MD5 | cut -d" " -f\$i\` - if test x"\$md5" = x00000000000000000000000000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 -+ test x"\$verb" = xy - else - md5sum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$MD5_PATH \$MD5_ARG" | cut -b-32\`; - if test x"\$md5sum" != x"\$md5"; then -@@ -243,7 +261,7 @@ - fi - fi - if test x"\$crc" = x0000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain a CRC checksum." >&2 -+ test x"\$verb" = xy - else - sum1=\`MS_dd_Progress "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\` - if test x"\$sum1" != x"\$crc"; then -@@ -300,6 +318,22 @@ - eval \$finish; exit 15 - } - -+Script_Args_Check() -+{ -+ script_supported_args=\$(echo \${helpheader} | grep -o -P "\-\-[^ ]+" | awk -F"=" {'print \$1'}) -+ arg_to_test=\$(echo \$1|awk -F"=" {'print \$1'}) -+ -+ for arg in \${script_supported_args[@]}; -+ do -+ if test x"\$arg_to_test" = x"\$arg" ;then -+ return -+ fi -+ done -+ -+ MS_Help -+ exit 1 -+} -+ - finish=true - xterm_loop= - noprogress=$NOPROGRESS -@@ -312,7 +346,7 @@ - - initargs="\$@" - --while true -+while [ -n "\$*" ] - do - case "\$1" in - -h | --help) -@@ -324,10 +358,6 @@ - noprogress=y - shift - ;; -- --accept) -- accept=y -- shift -- ;; - --info) - echo Identification: "\$label" - echo Target directory: "\$targetdir" -@@ -372,14 +402,6 @@ - echo SKIP=\"\$skip\" - exit 0 - ;; -- --lsm) --cat << EOLSM --EOF --eval "$LSM_CMD" --cat << EOF >> "$archname" --EOLSM -- exit 0 -- ;; - --list) - echo Target directory: \$targetdir - offset=\`head -n "\$skip" "\$0" | wc -c | tr -d " "\` -@@ -422,10 +444,10 @@ - keep=y - shift - ;; -- --target) -+ --extract=*) - keep=y -- targetdir="\${2:-.}" -- if ! shift 2; then MS_Help; exit 1; fi -+ targetdir=\`echo \$1 | cut -d"=" -f2 \` -+ if ! shift; then MS_Help; exit 1; fi - ;; - --noprogress) - noprogress=y -@@ -470,19 +492,34 @@ - cleanupargs="\$2" - if ! shift 2; then MS_help; exit 1; fi - ;; -- --) -- shift -- break ;; -- -*) -- echo Unrecognized flag : "\$1" >&2 -- MS_Help -- exit 1 -- ;; - *) -- break ;; -+ Script_Args_Check \$1 -+ scriptargs="\$scriptargs \$1" -+ shift -+ ;; - esac - done - -+quiet_para="" -+ -+if test x"\$quiet" = xy; then -+ quiet_para="--quiet " -+fi -+ -+keep_para="" -+ -+if test x"\$keep" = xy; then -+ keep_para="--keep " -+fi -+ -+confirm_para="" -+ -+if test x"\$verbose" = xy; then -+ confirm_para="--confirm " -+fi -+ -+ -+scriptargs="--\$name_of_file""--\$pwd_of_file""\$quiet_para""\$keep_para""\$confirm_para""\$scriptargs" - if test x"\$quiet" = xy -a x"\$verbose" = xy; then - echo Cannot be verbose and quiet at the same time. >&2 - exit 1 -@@ -559,7 +596,7 @@ - fi - mkdir \$dashp "\$tmpdir" || { - echo 'Cannot create target directory' \$tmpdir >&2 -- echo 'You should try option --target dir' >&2 -+ echo 'You should try option --extract=' >&2 - eval \$finish - exit 1 - } -@@ -643,11 +680,19 @@ - fi - - if test x"\$verbose" = x"y"; then -- MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " -- read yn -- if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then -- eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; -- fi -+ yn="x" -+ while test x"\$yn" != x -a x"\$yn" != xy -a x"\$yn" != xY -a x"\$yn" != xn -a x"\$yn" != xN -+ do -+ MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " -+ read yn -+ if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then -+ eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; -+ elif test x"\$yn" = xn -o x"\$yn" = xN; then -+ echo "Unable to decompress \$script ,because of aborting! ";res=\$? -+ else -+ echo "Input value is unacceptable,please try again." -+ fi -+ done - else - eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$? - fi -- Gitee From 1e87648e9b8e11bee7d44c9faad2789195f790bb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Apr 2021 14:38:15 +0800 Subject: [PATCH 114/296] Match-id-3d82e339cdbbfac01b7cc9cd0350ae7c77c43b94 --- build/build.sh | 3 - build/scripts/mkselfmodify.patch | 228 ------------------------------- 2 files changed, 231 deletions(-) delete mode 100644 build/scripts/mkselfmodify.patch diff --git a/build/build.sh b/build/build.sh index be396ee..4807e81 100644 --- a/build/build.sh +++ b/build/build.sh @@ -109,9 +109,6 @@ function make_unzip() /bin/cp -f ${CJSONS} ${CJSONSLIB} MAKESELF_DIR=$(find . -name "makeself-release-*") - cd ${MAKESELF_DIR} && /bin/cp -f ${BUILD}/scripts/mkselfmodify.patch ./ - patch -p0 < mkselfmodify.patch - rm -f mkselfmodify.patch cd ${PLATFORM}/HuaweiSecureC SECURECSRC=$(find . -name "src") diff --git a/build/scripts/mkselfmodify.patch b/build/scripts/mkselfmodify.patch deleted file mode 100644 index 09c872c..0000000 --- a/build/scripts/mkselfmodify.patch +++ /dev/null @@ -1,228 +0,0 @@ ---- makeself-header.sh 2020-04-27 18:59:03.000000000 +0800 -+++ makeself-header_new.sh 2020-07-09 18:04:43.044000000 +0800 -@@ -1,12 +1,9 @@ - cat << EOF > "$archname" --#!/bin/sh -+#!/bin/bash - # This script was generated using Makeself $MS_VERSION - # The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) - - ORIG_UMASK=\`umask\` --if test "$KEEP_UMASK" = n; then -- umask 077 --fi - - CRCsum="$CRCsum" - MD5="$MD5sum" -@@ -16,6 +13,9 @@ - export USER_PWD - ARCHIVE_DIR=`dirname \$0` - export ARCHIVE_DIR -+name_of_file="\$0 " -+pwd_of_file="\$PWD " -+ - - label="$LABEL" - script="$SCRIPT" -@@ -148,6 +148,24 @@ - MS_Help() - { - cat << EOH >&2 -+Usage: \$0 [options] -+Options: -+ --help | -h Print this message -+ --info Print embedded info : title, default target directory, embedded script ... -+ --list Print the list of files in the archive -+ --check Checks integrity of the archive -+ --quiet Quiet install mode, skip human-computer interactions -+ --noexec Do not run embedded script -+ --extract= Extract directly to a target directory (absolute or relative) -+ Usually used with --noexec to just extract files without running -+ --tar arg1 [arg2 ...] Access the contents of the archive through the tar command -+\${helpheader} -+EOH -+} -+ -+MS_Help1() -+{ -+ cat << EOH >&2 - \${helpheader}Makeself version $MS_VERSION - 1) Getting help or info about \$0 : - \$0 --help Print this message -@@ -212,7 +230,7 @@ - fi - sha=\`echo \$SHA | cut -d" " -f\$i\` - if test x"\$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain an embedded SHA256 checksum." >&2 -+ test x"\$verb" = xy - else - shasum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$SHA_PATH \$SHA_ARG" | cut -b-64\`; - if test x"\$shasum" != x"\$sha"; then -@@ -230,7 +248,7 @@ - fi - md5=\`echo \$MD5 | cut -d" " -f\$i\` - if test x"\$md5" = x00000000000000000000000000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 -+ test x"\$verb" = xy - else - md5sum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$MD5_PATH \$MD5_ARG" | cut -b-32\`; - if test x"\$md5sum" != x"\$md5"; then -@@ -243,7 +261,7 @@ - fi - fi - if test x"\$crc" = x0000000000; then -- test x"\$verb" = xy && echo " \$1 does not contain a CRC checksum." >&2 -+ test x"\$verb" = xy - else - sum1=\`MS_dd_Progress "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\` - if test x"\$sum1" != x"\$crc"; then -@@ -300,6 +318,22 @@ - eval \$finish; exit 15 - } - -+Script_Args_Check() -+{ -+ script_supported_args=\$(echo \${helpheader} | grep -o -P "\-\-[^ ]+" | awk -F"=" {'print \$1'}) -+ arg_to_test=\$(echo \$1|awk -F"=" {'print \$1'}) -+ -+ for arg in \${script_supported_args[@]}; -+ do -+ if test x"\$arg_to_test" = x"\$arg" ;then -+ return -+ fi -+ done -+ -+ MS_Help -+ exit 1 -+} -+ - finish=true - xterm_loop= - noprogress=$NOPROGRESS -@@ -312,7 +346,7 @@ - - initargs="\$@" - --while true -+while [ -n "\$*" ] - do - case "\$1" in - -h | --help) -@@ -324,10 +358,6 @@ - noprogress=y - shift - ;; -- --accept) -- accept=y -- shift -- ;; - --info) - echo Identification: "\$label" - echo Target directory: "\$targetdir" -@@ -372,14 +402,6 @@ - echo SKIP=\"\$skip\" - exit 0 - ;; -- --lsm) --cat << EOLSM --EOF --eval "$LSM_CMD" --cat << EOF >> "$archname" --EOLSM -- exit 0 -- ;; - --list) - echo Target directory: \$targetdir - offset=\`head -n "\$skip" "\$0" | wc -c | tr -d " "\` -@@ -422,10 +444,10 @@ - keep=y - shift - ;; -- --target) -+ --extract=*) - keep=y -- targetdir="\${2:-.}" -- if ! shift 2; then MS_Help; exit 1; fi -+ targetdir=\`echo \$1 | cut -d"=" -f2 \` -+ if ! shift; then MS_Help; exit 1; fi - ;; - --noprogress) - noprogress=y -@@ -470,19 +492,34 @@ - cleanupargs="\$2" - if ! shift 2; then MS_help; exit 1; fi - ;; -- --) -- shift -- break ;; -- -*) -- echo Unrecognized flag : "\$1" >&2 -- MS_Help -- exit 1 -- ;; - *) -- break ;; -+ Script_Args_Check \$1 -+ scriptargs="\$scriptargs \$1" -+ shift -+ ;; - esac - done - -+quiet_para="" -+ -+if test x"\$quiet" = xy; then -+ quiet_para="--quiet " -+fi -+ -+keep_para="" -+ -+if test x"\$keep" = xy; then -+ keep_para="--keep " -+fi -+ -+confirm_para="" -+ -+if test x"\$verbose" = xy; then -+ confirm_para="--confirm " -+fi -+ -+ -+scriptargs="--\$name_of_file""--\$pwd_of_file""\$quiet_para""\$keep_para""\$confirm_para""\$scriptargs" - if test x"\$quiet" = xy -a x"\$verbose" = xy; then - echo Cannot be verbose and quiet at the same time. >&2 - exit 1 -@@ -559,7 +596,7 @@ - fi - mkdir \$dashp "\$tmpdir" || { - echo 'Cannot create target directory' \$tmpdir >&2 -- echo 'You should try option --target dir' >&2 -+ echo 'You should try option --extract=' >&2 - eval \$finish - exit 1 - } -@@ -643,11 +680,19 @@ - fi - - if test x"\$verbose" = x"y"; then -- MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " -- read yn -- if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then -- eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; -- fi -+ yn="x" -+ while test x"\$yn" != x -a x"\$yn" != xy -a x"\$yn" != xY -a x"\$yn" != xn -a x"\$yn" != xN -+ do -+ MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " -+ read yn -+ if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then -+ eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; -+ elif test x"\$yn" = xn -o x"\$yn" = xN; then -+ echo "Unable to decompress \$script ,because of aborting! ";res=\$? -+ else -+ echo "Input value is unacceptable,please try again." -+ fi -+ done - else - eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$? - fi -- Gitee From 0f754306dee64b66a69a1b27260ab76b528cfd7d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Apr 2021 14:56:50 +0800 Subject: [PATCH 115/296] Match-id-f8400969da825eac84194727cde8fa2265fb7c38 --- build/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/build.sh b/build/build.sh index be396ee..4807e81 100644 --- a/build/build.sh +++ b/build/build.sh @@ -109,9 +109,6 @@ function make_unzip() /bin/cp -f ${CJSONS} ${CJSONSLIB} MAKESELF_DIR=$(find . -name "makeself-release-*") - cd ${MAKESELF_DIR} && /bin/cp -f ${BUILD}/scripts/mkselfmodify.patch ./ - patch -p0 < mkselfmodify.patch - rm -f mkselfmodify.patch cd ${PLATFORM}/HuaweiSecureC SECURECSRC=$(find . -name "src") -- Gitee From cff1d30fbb8b40a03c6384c5b0c0475e006d4408 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 7 Apr 2021 14:14:03 +0800 Subject: [PATCH 116/296] Match-id-fe49cceaa9589fa7feb5a50ce080aeb02a192a57 --- README.md | 30 ++++++++++++++++++++---------- assets/20210329102949456.png | Bin 0 -> 13050 bytes assets/20210329103157122.png | Bin 0 -> 20847 bytes assets/202103291031571224.png | Bin 0 -> 7614 bytes assets/20210329103157123.png | Bin 0 -> 11384 bytes assets/20210329103157125.png | Bin 0 -> 10673 bytes assets/20210329103157126.png | Bin 0 -> 11357 bytes assets/20210329103157128.png | Bin 0 -> 12910 bytes assets/20210329103157129.png | Bin 0 -> 84027 bytes 9 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 assets/20210329102949456.png create mode 100644 assets/20210329103157122.png create mode 100644 assets/202103291031571224.png create mode 100644 assets/20210329103157123.png create mode 100644 assets/20210329103157125.png create mode 100644 assets/20210329103157126.png create mode 100644 assets/20210329103157128.png create mode 100644 assets/20210329103157129.png diff --git a/README.md b/README.md index a89e44a..9d46a11 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # 简介 容器引擎插件(Ascend Docker,又叫昇腾容器)是CANN的基础组件,为所有的AI训练/推理作业提供Ascend NPU(昇腾处理器)容器化支持,使用户AI作业能够以Docker容器的方式平滑运行在昇腾设备之上,如图2-1所示。Ascend Docker配套发布的软件包为Ascend-docker-runtime,已集成至实用工具包toolbox中。 + 图2-1 Ascend Docker -![image](/uploads/cd30f5e0-d6bd-4838-8d3d-c2a1aa5fcd0b/1616986155878.png '1616986155878.png') + +![image](assets/20210329102949456.png) ## Ascend Docker价值 - 充分解耦:与Docker解耦,无需修改Docker代码,Runtime可以独立演进。 - 后向兼容:提供可选装的Runtime,不影响原生Docker使用方式。 @@ -12,8 +14,11 @@ ## Ascend Docker设计简介 Ascend Docker本质上是基于OCI标准实现的Docker Runtime,不修改Docker引擎,对Docker以插件方式提供Ascend NPU适配功能。 如图2-2所示,Ascend Docker通过OCI接口与原生Docker对接。在原生Docker的runc启动容器过程中,会调用prestart-hook对容器进行配置管理。 + 图2-2 Docker适配原理 -![image](/uploads/5a5617b5-a9ef-4df2-b023-bd641d77257f/1616986181176.png '1616986181176.png') + +![image](assets/20210329103157122.png) + 其中,prestart-hook是OCI定义的容器生存状态,即created状态到running状态的一个中间过渡所设置的钩子函数。在这个过渡状态,容器的namespace已经被创建,但容器的作业还没有启动,因此可以对容器进行设备挂载,cgroup配置等操作。这样随后启动的作业便可以使用到这些配置。 Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置操作: 1.根据ASCEND_VISIBLE_DEVICES,将对应的NPU设备挂载到容器的namespace。 @@ -39,7 +44,7 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 - 安装大于18.03版本的docker,请参考[安装详情](https://mirrors.huaweicloud.com/) -- 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373)的“准备硬件环境”章节。 +- 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373) 的“准备硬件环境”章节。 @@ -76,9 +81,12 @@ systemctl daemon-reload systemctl restart docker ``` 安装docker-runtime后会修改配置文件/etc/docker/daemon.json -![image](/uploads/39331d5d-9f97-4c87-a158-4d588fb165e4/1617173956504.png '1617173956504.png') + +![image](assets/20210329103157123.png) + 同时自动生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list -![image](/uploads/611245b0-4902-4f5b-87ba-4d86f9fc2878/1617174009598.png '1617174009598.png') + +![image](assets/20210329103157125.png) ## 挂载单芯片 例子: ``` @@ -90,7 +98,7 @@ imageId 替换为实际镜像名或者ID ``` ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin ``` -![image](/uploads/1e77fb8a-f2ca-4768-a331-934b3da2de44/1616986864390.png '1616986864390.png') +![image](assets/20210329103157126.png) ASCEND_VISIBLE_DEVICES=0,参数0替换为要挂载的芯片物理ID ## 挂载多芯片 @@ -106,7 +114,7 @@ docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-2,3 imageId /bin/bash ``` ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin ``` -![image](/uploads/96fa6aff-59f9-48bb-ba52-13dcf0ff649b/1616986959639.png '1616986959639.png') +![image](assets/20210329103157128.png) ## 在默认的挂载的基础上新增挂载内容 ``` 在/etc/ascend-docker-runtime.d目录下新建挂载文件xxx.list,内容格式例子: @@ -121,7 +129,7 @@ xxx是新增挂载内容文件名,文件名必须是小写 检查挂载成功: -![image](/uploads/a8f82fea-4075-45e3-b5a1-d9aa7dec267a/1616987709657.png '1616987709657.png') +![image](assets/20210329103157129.png) 启动容器时docker客户端会根据/etc/docker/daemon.json配置文件调用docker-runtime,容器正常启动时修改 /proc/当前进程id/cgroup 资源隔离文件 @@ -131,8 +139,10 @@ xxx是新增挂载内容文件名,文件名必须是小写 ``` ./Ascend-cann-toolbox*.run --uninstall ``` -卸载docker-runtime后会自动删除安装时配置文件/etc/docker/daemon.json中新增的内容 -![image](/uploads/cfc84280-2180-4e4b-8feb-6c398b837e54/1617178154877.png '1617178154877.png') +卸载docker-runtime后会自动删除安装时配置文件/etc/docker/daemon.json中新增的内 + +![image](assets/202103291031571224.png) + 同时删除默认挂载目录文件/etc/ascend-docker-runtime.d/base.list ## 升级 diff --git a/assets/20210329102949456.png b/assets/20210329102949456.png new file mode 100644 index 0000000000000000000000000000000000000000..fa8a759568f3de872d20fee6ee0ab2a6a5baebc9 GIT binary patch literal 13050 zcmche1z1(AmguxJEPLRv}$q`M|12na|>hajL!y1SWl2q+-k(%lod zAL!cq?0wd`=RW7T_dfH1$$-Ha9m{;$c%_LlA@~FDLyNf{?+FP%9=n z_`Z^wU<#fP`Dox6N5W=hav_Ag{JXwvc#;4D;vhtg!@e@7d!4}pDYAi z_+54dUBuZsz==PjaJxc$rR>NQXI1t%2rN~sCfeF87_vtuzD{(GPY}hUX4m?%!e6pZ zV7c7%tsy7m82y+ik|^SqB!V2>7$d~pro|g5GMj(PmJB5WE$NAatOK)+gRJ3=_+9jD za>Z<0=831Mo6jXn4WnOfzSvx_-o#WwR-bAlG43SU45$fd)WZ!XwR+r3)0eyYSFIE0q7;6jUZ( zRvW{RA`@(vW<8l1PIPG;!Ou(KODa=KDm;D`O@3%*Uo&J(y>j$U=6nbk4$ns0f@?&T z6pXlN51-HH8H$Zp6dGD2&|?*At2{H^(dbJrBMZ2o%(xzUMUxAB=53&ZwAD&faRLwa2OI@WCv_4N)=AW82TdnzDBYa3Y}npI=+} zEe3DP%v4N!*PJwy)f+l*P9*G#CT-)SKw&f@-~HHh=x_uX1?|f>WBy$7W&C*AlaXBQA*<0s1~m1fDUX7xpBbS& z?-*tMmiLzXEB1aaL_ZS5z^BGct*L6!1*d&j`SvBwZM~?y=bNU1b-2i;@ZO*z7n;SS zr}cQb^>)u<8oxyp$K}9>hgoyFi3+r&;z;D&hOp01zr5Ejx6;m)VsS)OvX`GHvFF<}p5~~~3{~10Ga?gq7ROkIx5D*s#dHegL+v)X zB~;6;ps|gbgIB$Y0!snJD%>`82O8U9!p?^y`W|_oH49QH1YSN-px)_e+cvv#%dU$x z2h~D;sMJFJi!nL@Eww0f1EyqcNhQf_RZ}R{slTAhrmlLOyA$85iOQJbBmqk^eUFW@ z7;_pCXMTgr(-D7jLWmthuf|!R%yLA~Y3;i}e5j{jh0B({hm!4}JhS$9w@IgwgpKhE z4AWAZ=_y<)!JhqVLu#hk(f7lpZoC(O*%&FeVX>U^eV9)7j!sTj7#d~tYHtn z9E__s>65thL?MdjF@8N(X_xu7X2uUE7dglkBHszp+V*+8-%<}5~C=Dv;=OT9_vY4=Dwv^U}!5Q`*VkSyH7kzGzO zk=FAnrYNhds7cNlVY(X>65h3XqvrjoDUS=LUt`xt)De=+--7!!hx^fpX)uQuPE>ks zSQ?a!&I*ObF+!#^9++q%Szj|{F`QHdwH(DU!5m<XI3*ebk4g-mo3tRG1G?9 zf7ZBc(Zbq%nI`wv3L2(taf!;-xsf`)(I)HWS1nPFi<7#FcItUx-wwNO+Y%;ZjO?ss zTPfkXo!(aL5#7do)vOB1d(Er1u$$0s)0P4(X?IRoaP#@kF+b&JVGixHBY|3Ng>w%a zC;1-e@0g|hp;lrs|6B}hkI*LWeO2(y@Un!16l2ZlTeA1lpzWl2eNSvbn<;iWh`Ga< zf|ov?pT~hOJ~?9k=WNA?TvS-#yTG{OZ8k_ceugLIl&pXziYXlWOSx`V zE&EN2n&-&q$1zRnK!jN4lrlSfIVBq(yA_~}n797q?bP{oYP*%C0U-2L2>74$-#r!w zt4*%5J8r#^UKYw1MJUwo#ujLmh~gxAY!btY!^O-~4TTY6NUJC{`J58$k`o`TbEcQ5 zkBaQ#ly|&$JDGEa^YzZS9tPoiy>YB_KcMshks3i6c)8O~C-hk@6E4A|oVYJN>^Qc1 z_mM77U&^*{4kILdnc_P4hV`^@v8Cxd&CV`+t|I+xZ3>^)=|1G}(GEOG@=Z1kEdv_% zfgUa*m~mwZE&-)~b2|gMWAe#yFY^j8uQsES8_UP0&Zxqvazc+6Wr-3K9^Q`T{k!6wdxzGrI zMP?jgs5XY@;cMjtaiosGI4k3Ry8*I>V;RdPnbnFrGFDHLts-@q+orx07&6Sn;X*7$T6&kYqkM==(dtG-Zx|M0dBup}3t# z;54RN8F=or(Wg3kTKUmXqV%r4jtP?e#5eRl2wJ$CB!umX7I~k6OSsOYyTy&`d?p#k zwE0V9E#2Cw4rFxA6GhxelB~w?+Kuw@$MCyKP}lv#_)7+VeA$>aI=rXI6CXRWaD~I) z)_C5X3%UD+d|AbHeTWEhKAx>wSZ?u6t|)PR9}X3cHT(4>+gS_}L5@&(;4P><9y<0< z*hmeGl^J4PbF`56=WDNMIN!)MqjtVn&mZzqzN=SdmukwEbSQ=D*?zODF9t)M#Otu( zDPazW>^kSqM?Otb;aAd7SL3ZHUKjgbvbMPHt+gQm z9mBhEgxxi;n~L5*(e?I9?r)>v^5lf*jWA3YNm@q)I1QXFiOfTf9N8#Eb_QPP z0Z2xYq}#z+=6aF|2V*Eg<(n}W9ao5^caAPUtIuI z5;fg5{u1oqJ&6LArG*wo#8?;tBxAGd3ZXFn8#tyv%X@}Zru6dB4b&HgKwHi zv|{e$sa3mr*jkV`BLqn>PeRv{MQZfspo~Pj0 z*}42kkd!~Vb`R{Goc-_4wHuNt~An=V2Sx$c&Y>S-~d8&5dlL@*+Pk)kv6_kV z;Uayadp&%tCv&B77eX%v8t;0?&|z-^`rsFMIm`_kL#(C@pN+DSME8T$1hvdRV$n?6*&jVY9sr8s;WKB2i({}Y%?47L zzJ2Vd;U|p!t)P3d0W?YDq(6a=Ig6w9O#1c&e%$3^oPpreFB$^I?cp4;bc+FV@w}!A zgk(8&MuGAvEXpJ}i>J~ZWz2f!fAEoTx^=I7!P$uAJoFF_KK-_bMdM-^>;gFV60ni7QJz2?CiA-hPydHC^><|C~>Q|0*zX5BwX#-b$@=;X*^p;j8cA2etsKy8+c zF2uvPDmJtB`3xmd>HQ7)eH9dX8hugnR_ILYUwpk)QwanFZ)9&61z+y2Uaf1>B?$EI|xqZ zSe|G`;Aj@;Tbtf@S{+Wu%u>>`Cmj5^HdBK1x0``xAhtb^0dI znx?r)j#b>!iH-*Wi@M+W^QULsGrGiIf({6TVoZB}dOYc|4{PPQDSo>Lr{S`ij0h7% zH2T|w%H;hHBr-i?1<^!iawIipZ|7!{DVXmbg%M`;B{<$E<`H>Cg0axFm>^`6>b2xN z-<5%R5#*xs!FB-`MEt)TWsOw-;cS!h$q5lBRhd-rAQ98uFjj6(M-v7LQzH5qhn z&87LYt9|nJsZ0~Fe7_;o7c?t;>2iN@c{wQgWaaz}2?c%h{%G5-sEP;QH^qBe4&<_O z$p!|;;$*Mo9*I>gPzxw$XWr0^2#vVwu`9EJvXVgvY1$<7WNxYP;AjW!f6Lb!AI{Sm z5j|OmHk+>Z(rynfUsL#qD-EF{_8Scf4Sn@y)WTU_aP}Os-|ZubP^S+!XF(?6FPLR` z%k^f*pVBziiLI|wQu z2CM*+P)~8+9NIGLO^kJ?x)uJwX~XdYqd16D$}3+&U5uDy)~Sb@QF|5{Td@e&QbUj!vDj1>RXuOjA0xh#t z_f=L8&(}`9C()Izfh!|*0i80a^hPMDPrn`)SAr0?o)M-V?Nd}jkTj--aBa>cbmhPf z;@=#q<9zLZ!!CY(OzbpHov8{FCPH_3j{d?!8xz7|JlHv<&UXE=M5<_DbX>f%#ZzS; zGb7<}q@}do?A*{Y`#n!5Z|J>GDUnLcmeR&(k#SI2X}as+;ylH9h7YIs^)P7@HYjpd z-DVky-3n6UiOHkY)E6H-HkFR`8Wtbu12df6_>USdL7>XZ~hSsT#)4aGRLWVRmk;eO} zz2AToS@Hs~`lz1$NWPviF>I>NLuXC$n4KEUfA7{b{`NR|eY?G%dVI;B0rMvtZ27jH zLHIPefz1iW=dLC+OjdS3l0HufO}Vz*AX^?@8Clt!H)K&4%V%%){D>9zPVvz0RFW!_ z5E^U)0b_$0>gov4ocXCXR9ZF;^*)%V;DgLD8!5XojE-Fk2vV|6`kw~_J z=)7OpQW}5A+!#Aec*S!^EactD3JYU68tlR$0G1=>ja*A3>AI2?_e}PWV9D~s8UD_3 zOlmI4_@4ygBpoeo4ns@*J{No6XNh*_ITzlb1&-X=#^-`@4bpe^jH>|updHc%jt;=h!t#hJ{2$k9mrnyK9!2UP?y{;Gx}Q?yU~ z%*sDV+{Fgtc@3`9R&-WfKNnJe5r?&m9RBr{tR=yz>=|FFnrP)lMTh>#>l&Zg(rX(A|8v zkd^951R02LPIa>CiH(`iUh2aV&9fow? zNavuJG5t&NxW2`RXFhJ@YpWcu2Rid}i@Cnw>ei{Xvnz=8;85EZ-IkFr;9t~1VJkua zj@p^Au(v$A^^0>=HE@HWVCeSy^Y>1JENP^=0A5+puYVT|{U+htgn(DEsP~^6=CArY z8(t%948h+sY;KijuJ&#;0>ElIIX68rcrE=#>PSgkRMhl`^75VZdQrZ=&>6-ZiHYm@ zDMLbD@~&@dKpep4m)teM?okefRKxT$&1{ zNe3zv$5P_`Mb!YVqkNHwAR;;2b$pdf3FE*YJtJZ7bXMzhTbcy-F^S3k?T^I z?FUPjd~tkA{*J@Ai>#XO`Fd0_DR?NuBPHhj^wz_t76pn_`IkUhlrEm^xJ)|5txVQb zXcwEvtCE>gUkL#GD*+H|@LK?=4+@X5h`O%@m{4h#--3`8O$wjeW9%!U7I9Af2{V37l!Vd-kmpZp$gz|D_0s3H1}ZIG*nn7|}IO_1L_pNSI%{tKcwU z*PdXW>c%9u{DUSdf~#&n>W*M!5^!D*s1sD{V7B>amHVAn zNXt4RvQ=x`z1Kcd)J|K{8YDjC%-pSGQ}->Ln0IxgAk7z|_aG}Mw9gg5qGTq5q2f7b z=?9M{=z%0awtk(v88FzQaRCJ$Gcj zAeMU)q6bM=?WGs~h4s;8f{W9xSU+em?1${grFojy_v_?9ix_iHpsyn;{mb*&TJO4v zoX`f4g6U<=Nq#=tbQ->XC=_kH^zyU&+Be^}&; zN>IaW{P{IAuUTei;Qj6m*dK2xv)1?ZE)iEgF#k2!tNbh2%W7&cAxGk%ED*4*2pxq60;=%B_qWF0pkXK5-y+<94lt$GsB|%Ovceio9 zH=(BGISKMM*m!@W@OA}xE;3v@ySyp)on8*0kC2kh4R_%CT+#cGD4_T6o?E-={F#Se z7dwG-U<5-L-J!|x9(;gL@$k}q13M0nl&fmth6l;apsi!`S6px6nAub|5+oMYs}cR# z_+n=ph->m?E+LJ0C$;rWA%!=4TGXQxd=H#WlQqxG7dcaDgs|~;XHo&J_lrB!?11zE zSWa_T_ez#?<2*F~Ber|GUSYf4-(tI;X>(bgD5~N2TaVt*|nNh+A(WIgQ1wfIYc{NQ$pfKUXv_!6wH6rZ1#P5l3;bpP$BHZk!==#8j=2H{qnIt()9Ke=&Q8C~6~7T9w0c_Wrknpn-ccf%5Ou(3vIK zZ};7uWt-9Ua$E%ep~fxgz1j_i>D!|z5FAFL?gyvTAnI+Ov>dBrT#zL=pG3aSNpnz@)vubm-&t8{M9yz^; zDS)6GWmmNTI^|ZZcXX1=g6E%dhC_(%jUV*)s;-&)#zE39cM)6=mzx=M`f-fj(dj9qAOJ0N4UT;0;gpsQbJDszEzc|mP4bgU;|d1#s@hmw5w-C4oG!k(D1mh zVK5|%;8iw%>0~|_pFNgxpHH+M$ul^R5vivl-jV@jv)j}2$?HIhdzmwK2z$CBsj=e# zdLSzBAZo}>2WmT;4Wgq=-qYH*@F*`*%1M@sxFuVp`Uf=*biRy<#N~-VbrpeagPe8Q z(#y--`+7CDiLI@@JID%eFAULTX~SVgcbfKlPmX#L_>)J>g3uA<%7!VJ~9#p?58ZN+4hY?k<1Iy=ejHiSz5Q-9sdMuJp7PjZsF#+)sP|CIA$d< zpZ*G4)#7IibRr6xg8lUJ=E-)iV<{FeZ*^Gua!M@lCiMrbl{7c&`GUkP5{6THJvT>OO1D-B-iL47Ne;WGuulr1 z4=y@bbUl-;<_(>t&}v*ES(E44m-S+KX@3iu9!4h6ScaLilSjA|=yt`*tgJ*x1JVQ1 zzX|g%ulL7IOHKCQR`S0=FraPQfi^@NBJkQNzIJq5|2nu4j0ARh{Ob6I_=evciwQLB zUkCrNn)k^5a+m)vSk3>LKu<#dqTefZ5d7D{ZxnXq@!|3L4bUMB5S7p?eh@+j?oj*| z445c5q~!Z^JX4VxxJZ&G1mxV3aVFPR`4vy&k{ilL0$J|QEoU?06(Vo&G` z{OkC(P%<(^#wpOeL+m=`?3Ntn_RlQk|$V5dvUQjAN~)OWjMT#rS}H0oGe zfJoW$Y`2=M{>O@cNdWb8)aXlCwa=YZ5$G z?^UB+X=@Y-FZ)WsAUwQsG}}TT!B6M8?VBKM_go<%;Yapzta0BR)8s4Hztr|7H+r^G z!t>*^Zi9>Gpjt$C!1!h$lwJ$!KpLI};ulFZT^v?42wYwqHT3@Z^ozm)f$915<;BR| zi*H{vlR&*g;+D_l*%J6lt2-iF^+my;lxqXBp031ZTKu8AxYOxS+QslX2pl*#&UO|Q%ZDRYMh1c@dFQyeBFe{`O|`viaTVt zz=Xzj-QkjM{G{CO%*O#exSDG5Qsc85wt(%U-lgTzt*G zvX*<7Ni}kbhTjfmZeA7MIOn9UVbZ7UI-1gg9Ls>p5mh(D)&(M!v_*@aDF&0m6HF8?A2&t(_LHd2r8kzr4#{64fy^?hc1tWj(6qf@!NWCoVW3$ z1H4b-=(cot$kXU9kJ}Gf8ne_so#;?pYkk$1NV&L;$`7d2T9cz|>M!QV8sx@iGpO%* zz*l;+7^FWtyxL3}(nEYw%goJ4<}v;w(tLIJ^C5-Z$N8RQnuhL&9V#9mRdtxa<^$^G zSS`BTQD;`09yHOlnw;*h9Mam)&$WCIL2rCKH+Ytfuyyy&obcI8nkLU>MV!cDa*A0D zo=Yj|QfP@6M$SN(34Vko4knJKY$QA^w*e&uLngY0I9Q+LEkhkHj5WjjmYP{Nz>4rN z3~9%WK%w-x8n3r|k7YmaEQ?NijorHw+DV($)+Xk|q6RG5?U18AqttesH1m7}DCXk0 zqwI#&xVzYGEmCME{P+fwkav_h&h@bw3){oDyxZm%LY>+hU=sPxg9VTbhAx zWnp8NMf7k_j<=t~0k|@-u+S_f)lDo%ev{T~yEAvauUf5sJ!-N_tQ~3HWK72RPcsZ0 z3R{CEDn7HYrk%Hk#g_2S-jujZL$3#sp^z$Bw!;+ZjBYXlXrV&+8VZMIMPEU}Fe@wegTfg?D+rQ;jw%chCZ?^Tv92=FUpjaU{ zJ0|I=j^OE!zH*Yhi0)1UG#MQf}V(wWH3v8YM&~~x0YqdCX>xSk^sl_E=q9|TlDNaYJ+uk!Esd< zj~orkRY&LIlrt%<2C(wGr5CFHoZWLBQE~p5tS*8fc$6HOBI1@ZcQl_dq0V$tk}#1O zLwx7$TFzc;e{6f!NO*1GPLd_{O&`bhM_1kz>a~pqGSk29td{3#${BK^w!uF z@6TofU^1o~YpoQmr?1{Gheg%ivAM>TyBJrr`t}HE*x| z-SiiCR3AUSMF*Woc3?$870wt2@$V%llrr3R2!YBe?pYK+Cn$A9IR1pw(* zoHY4iN-o0vmrCGV$Y4_5!erHwi`9t!Qt=)o}-9J3n+vuVal!2~46QD{PwNe!K`4JQ;k$QTt`i(D1 z$VPAl6GHs}>L9W~T}L)3@-%A=CSsjuMz&pVSKa%AR{{=JpfDWyk+#Xx3MS8bZbBx= z6(M9ZHQ~5E`c*0Ae%UanDr0W66}j)SX%%q;Y<+J_jDQ^-u!w16{xLc&)nbYa^NMgy z=u6{Y@^Fx$H={zj1zJVTiHD#Fk1`3`-<%wOh5_I|b}&Crry>#5@BFaAc(Ez>4htog z60BTg+bne35POAPEnwAlpvdS0vwjp6R)Hz};KfLO$^r4r282N4tlNKlR!uKW-?^(X zUG|Cu3EVWqkg$xf+ue|t2wW)u*LqzG!NqmWseSg@`?J5tNHrBX+@};zk&uvZ7386BkdROyz|XB%7{K2F z1j=McNOVXFP)SWs?g4EvLwoc^J z%f>cf*%3e`6Oh23NGMOAg2B%{>7xpsd(t@&Iu@$?6B9H+i|&7ab5(wCdy`RURbsXE z_4iKMVe?*2<(K9AU28CZ3=%^J7AMO8|KBVqf~F!rdl7!5QHDk^gW?PScOwbUP^KcS zRS3EA7{NWGC0E!Wx1o2)f{wC*AX7AMn1nf4czn#U5@%~zj|+udE}tIs&9(7f0V+bh z2qJNs;5>J49HTFwjohBa^Z&x73@&io-@^ubN5lGvCZ8Zr-~WNSdP&$gasL|@S|rl7 z8mK?))f<6#+1}7o3J|p_R4mf^BlV>jc=wwe&ZHj^_*x4#L}a0U(&Qkyp5m;3Garjt zpEucUOe$B%L-`R*SQ}{#0_Dg<)xo=RP{l}VOi<364ovX&BfJNh5Yr5eEU26=Uw(KL z>RLBkH|<|Gg$=vcBzH4WfRchHiJ`oyusFJcCs0i}bfv;pe2`=}QKjTZexk`nPliyz zY`qKLF9tBP2i3`x67)Sar6jXg3^7?Hn=atp&3vQDI7`7&3EzbtJC#_m{!HnGKeZ zNF=EZ;LFS5g}ev|y-QZj^MgIjW~ThD z6)c(Fl#q7)BEkN9Vp_<7?A$CKCh>0)aHb5DC(`;m*MSQ^Xe}0PN149B1BMkU#{#j3 zZTo<`D4&d2Lg7I$S;EOe=qW4cF8<(x15BX|%_EqU0!PW+SjbsM0}DM7ldQA^oqQcaJ9X85Jg~I0iPza`{PfdVpCXk!hB3vb$xcOf9E49AESDa9I?Gfq zl7^mbV;he_IJs8;y{4Ib^K?kMSK*9lYRB@Kc|@BT+NP}7kLWs`rp4Vu?FI(>+c6e! zOxR`n5uqP0NbgHh=7F{e1ZxEand9yHW<=v9!?|bGJvv5@LlJtX#Pf=}!G31&wF%^~ z33{5mM3A2w@_;mIvh)HGEKa*~RxOql-9Z%TNkfdpZQz16RcYv8H0oQsTt9?P;Rbh-N~%K zn;iv5-qZN)VxMC(z!JH?IBJg@d(kNoaC}tZDEuDzS(7*z7G=ja9sT8TSPnA>wqWlL zV-K|3qX6?(5P#zcOF=(u+Y0<*W@t^z1VRRkPDV+ob2e|9_C0te1?Ep*Ad8oowm@AH z+#-*?%z1ChqmD&FlEtbqYrNq@57Hu-WCy>`7v-bu3Xw(a?4}InHXYx_$+sjoGpQt; zjCMy#Ai=_={5MEM7}9k~uahAiQnREVtO&e@Ht(nG+kXBv9875(46IlIvCPt z3=zF=jm>M*Tw?+^FZA_Swo%0RVxv8?abjRLer`q&LF*n|#YZ0g5ld-f^X{R{v~{A& zRKK4$W2|$XugZvkiUoD8vtYUIJj$DwhODR4mFP$Ibr_G0sak~MfloadGB5-z3S=cn z{>pU_tbU%uY~pkNpP+E^y+8SpSGCf8QJ*`oFSZTLvSuy7-s8(C2j|WaK~sCh1YQ|; z^dwhc4kg>p#zYe9MlKmNTzsr)KX*^vt&YP~IWWgZPqV&ELbshM_JM9+@-qgA@uu_F z?|Kd6`%bc2?S-*<-r;w2AhEY1m(x1&{TCEAT$F)V`_T8C4P|o$Pnc&4Vz{Yt@l3^*&iiY28p9;EP_+>bYD36#3lWVBubX8IQ z^XX-DfptW><`JDw{m62s7aA$%swOl9wrNM(JTt_oL-;6%OzpAVPfdqtP@5Kpb5<1T z5j;22MbX^Zc2@6_NXjuKY42ZwmfqRwO60!#+|?_oe=17oHHelNJR@avonbzM+N+QP z-`jQ=DdKFF_ZBk@k-p5Sx;EQGiHKH&^4sgeD3o`*QcdST6#OSyF%bxu|GQFB199~ z-{if$i^_CyBXkf^_|L-0lLuwNbxO3JQrFF3Qp5 z{gsFEatRPiM;ED--QElbM<*^bzh=YiR`)d^292XWs7?O&-_%T=Y4IpV4Xxli6Y zVI%S>$az_GN5Z^}U7~65vJCA15Ol%u4$oAv17Q-434I>WQ+|-yQZ%cm2MB~$jVc-R zlfV&07YV(Ntt6kle%R{i7j-*-3pBte>6p+o+tXpO$V4I`RT^)|dpvmNxUS#_JLk^7 zFW$hm-vwCXEoOuVzeDw7H)i|(6X-hS(-LaX8WWcu0;PbY=ii8MZSDK+OEX;AK&@u+ z3O5T5@2J|F88U?q8DHz)?%I;ZLc#*UO#ZP7Tz(^ZQXyQLOr{I*wxMXD?_$>SMi>TS z6s$FcCpt_Gau!nJpIZH#I}AVYg^h>*^Vmw@z!1Jk@pVg_spX+YWqh;WjJ!NU`FVXE z@6Trii-;)D_LbE84mQXB6i+y=_BHA1=7s!XU#=5SHnqYr);vzaQpSlZP@AHC9xqgN zvk3ya{1I~~C`V(W-js`b2yY~isSk~eCr&|sq?sX3uK}unjX3&J$wu~YON#6^kgd;p zZ<6=0_{q$y_xpQO)3EoBZ8Ri@bo}qHWiEdC{PRpt$&qpVyX|X&B?(#Pcl%=Dt1$ol z(4LZ@Na*P|n!&dIdh=`^bO_4K=}zC?=Gb1bnrinB4F!p{_Nh^>;Kl1auya)UX9Hnl zZgqDyRrwj*e^WTsu7t1uE$6dcA%-kc^W>Fry#P|pd6Y$*+?PO<| zg0mFdLqqGB$|dYvY%Cqr(L`8taFL~aY~|8wZY2ZG5K4nu~!-e2fr93C6j zfz9Jd`>k%*Q;^g0eqw#N8FYBixS=&81=<@BM%gB-HO6B9PnZ`LiBvCJh#z<1EXBIq z=-?;T&tZ3a3=wyWi%s?o8;(^_Y`n*3#|7NSvu7xRJ~DoPOY>ihrQ+hEG%}&-EOG6MFqQ8!%!#kvBgyg-SRK znvzi3vfq^%YCpbij#e{=zcmw>*w3xjp*0L4A9-sIF(qI70?evJ2Eo8v@eBi0*^GN$ zc11O;jWnEh)zuj2f~DP$fvUu7EQ@N|k#EQhOesRn@}Pl#Z{zMf^!L66A_*yJy68Jo z2VAl+X0kB#mBl2<_C9?hBcsQ!UQ+XfV4M`@g>$`o-NQEtBGZmnLwP3R8RfTqpmCRu z&tJa0pcZzuCN_zYtl>r?KS`8UB|nYK@^WnNd+$M3(A=EK(MP98{`s|bjoy9Z68gl& z<^O)a3iAb*>$X}OS%`&Yhw8nUB_|#^o(=&Gujj--PyQP78Cw8bz{iAkwj>gP$@D`d z{fu&S3EeyS=u(`mY!-Y9QEQ906CZ5J{_~hPGeijwg${G@y%d5vUO^ElN4{nXhl)d> z^mCE}FYq!PZDQqeh&Gu7cu;@QnA&9|2NRcumz&GFkqeh^`PRq>$hh{lcQ@WF>vwSEvc&MVlPOV|;A`xu_Wb z=~Ya4Pf@Wxn_;6G4wWF_2hPsgkNYTl%k^q~yU{0}{MM&Yz^C}nP>hq(#0$SG^)n== zv1PZ{xbD0;UJb!7v7c3Go>EO1xEyRR#VL{A)_9$)pjg-VcTA+W6O%TZ8zgwx_^YSN ztow}$OQ4Fdo#l}&Zw2>AQ5Y~`2c0_ix7U(7$jVFIE*%3UC7ZDV%LL;0mxV3-c5`&g zK7YixyiPVcFs~OJzAMMjhzW1H5-I#%aBL@56+6=$@@h_ua4r3lRvG<0@78C?bQetX z;i-RY9RUU|GsK3L?2aP#t0rmiEjs7(h}fd=Z=!7{zi08ApIYzI>^!noRb^Yusk+ex8~d5NuAYr|q;lg;si2e+iKCq&FJ z9TPu3W}@v?t`98__csV!$M%FgQWIZw31i3hJNM)B1;_p_1`ZZ4x0lj1%{PxWzx^V= z%*PXtY@QiH$9|1;b$79Xt>o8Xf4)EeMiKYQ_j;$ac(KzDQKWD}K6S_-7Z=k@E8vj5 z|7#*|IpE>0CLnA*}v~|J0TQUrs*I=EGo}{g{j=0{+ixGpq+Ofgd|`$rsg@t-Tm8y!f;{ys}~e}@1HS1x+Cz@y-W|3EG>%#PX-t^B|?x3oPPD8 z^pq(iGZ(b97y`y!(ifPF83HpYbV}XzO%bnrm{K4)|7pu{JRyzWYw>ou#VZ*0*4cT^ zEJ8sqlGqgkt=-@6_+*%4SU~r( zFz7{qLZuAESrjxQ#IoYn9u2?T=cJaabte#RPEgPwvh0w z+pVnItGh~-npHXdIN{yrlT9waGu+X0802w(Y)&*b4t_P!I~iE{=K=(-lzNtG%D<&q z+Q&h`U!$XBPl%T|Y z8<;LGgOk$gf9E~EL*Fwwn541%;jg0HCZ<7RTKoN3WsT^>ZHK8n?)5pfh&!yGHb7K+ zrk}<~X@9xZ;JxoHV3}l?`EDqYAtVap;@ubiCx2K&A_qKWyRP|Wd?|V9vfcJ(V%?6m zGu#j;+A)$+Wy@>veO2SHZU*`yFVA+TlO56DmEr;O^JLlgQ;E*K+RAL1hTNfAGthhV z3VBBG&wBfp-KO~ng_Njtx%x-DJM&EzZ-4lqKyoXOy)IGr4bf-74y1bets7cl97qfQ zb&MSh6tV18Y_|9(HEgzuyc9VqP{4K7^Fiq7>2M6{?Gk^YB;fO{2E!$~KjqT;Uz$~0 zjnkA_2H~tvfX;r=U2KH@4- z@NO)d{5$8_m!U7VQmf%yNEm*6^5O$}T3T9cqC+=Rs^SWx33=iO>FWtXWC10PGT&N@ zn@5MwOt=2=$?mM~U;Bx`*MylQt%WlR*oR!-3U7YVObO{a247-QeUN|zgd*G6Oymby zFSj&pPkai|6z`&T;#>-qEi%z4QA*s&2#NdXK_hy@N1ZL@CP#P#5zR{9&V z{~0^enRtZ}V$Bi-%x3To6|wew#%>n{rFcN7+_m__ZSCbn`vasj$2F-0F`R$E@}Q*O zwK&iEEuu|LodsgLH4!CISFsx;q?`caH7+mc4_t-ok`!$=?^Ps6Gvf!SG`bPa;Nz0`XJhPVaw~_$IoR`mZlMnFM1@QQyxUD^c+_lo-b&w zZ4GzlM<@^93BM>$K9JE*5Z^@x7p_YY;Sr+PC*_H+)A`w*cgzJhzq(j-sfKH2lEd#d z#2e(JO|pgo$Iyekr-*?|!6+i?dIap6XPDHk3BG;s39f!BhU?QEhH)mOU;XQP*7_5H zlOG7`P1^mPKamS7?vDh1n}M&=V3L|qJduj?)HRI^`yRz+CQ0G`oW5LWy8|-L-Y)y= zMfeqSfd9kSWH!^*DH&2DMoSdO9Ed@EN)P$2Gt1SaLUek|bt+T*t=}dGQBiMAxjmk( zzM&;8&HN0UQA(e)$~=f|{d0~W9p^+)!G`8%CmrsV-pFEw^0w@)LV3-iQJrlT|&5;FDgZ=lO1@ko(C8|lqIuC zjN%r=qSuXP@+Ifc!u{s9_8G;6ZGzgfTD(&k#&3N$IhKmhzef~Iex5p{AE&2Jm&e91 zDyQs(Hxt8kNBiX13j)o> z7Gb!vC`W&cd%9<_SA=qZeM*p99l1Wt(Vn8A_gvs`5>HFt|Nh;zU=5Pn@sw2ADQdmn z=86WE%P5ZtCTX#(%j5VKvU$wh-8WZRYqh8QFCPYnte*cm&QJ8v;8Vc& zWyLX65TJOBj-PF)40{Co6r5?(M>r7cr6ik@A(*jtcodH@{d`J0(p7}Pn_Llr$9VgRgzbi$zNqDd@`u{3 zv7#`{FeD80;&6}J$GGyA$HwdmN8(j-nz#Yy9uQO7#|zixh#HAv;yi}?8E~?L2nB5X zr^q-@9V}#;Sj4P>0R7(!iR}!qZDa6t)FbALh4SXXRJfYeMAzl-0fZ?AI$$nPjkG2N z9oRr@`9j3rb<1`9Re2P!`Z6Dm0YHE}Ab0J#taicvVRlA4Im6i{k5=BDx3I28p_8p~Gn4uq{Lu(pgLWZ$k2w|26SS4$480I0c^o zsBtcHW#t?N*=X4eBsuM}4y9c33C&BOr;KBDMM4XBvgY5ksQxFxQdc~(!+cyerGdN| zd>RF)5A1W7471{gDq2t-T|wc#Pooz(Go%y0N6BHmAHFKDSSI#Cv)X8sOp_%{vP>ub za8t*~X!InVYK!gbL+_~0Jul*o15u*1;l_#SLOTn{t?mz(--cxpGXyxeiqD^^6E8?p zb8XMp{&w!`Bd1(NAwMBhY3GQ&=^1Tln9=3Q6Z$>yFJ;9dn7Hnw;Rgu~6zhJ7C@B^J zTvMA9N_*C!8^Ugj?KktfKs@ z(b+|KjI`!9qt3B90O(1A6LTpPojrI(Pf?xJjm0- z)y(WH@~75k>{1s+4C?!%XELxt9+XJ>4(<#xV{hv|6*&f$KLAO=qVHk1r^}@_nh@P3 z9s3=`%B!sCFql6~>+s-V$Az*Z7ih`p6+`}gqZ(UbWRZeX3PqonqPIy1v28Em(a`E8 zmyR16k!ryG`C*MF^(}`iojq0+4l_Q)JYCeCKJp`gQ{*M0WeaT~!#_!4Wl8gK=gzf( ztRlP!)}$E&P?Ez_XNCHc+H$s#!H3Eiqm#KX#&^J)(j$M<`l@ZEpH??tQ!bWfc~EsQ z`T<`7Hvut6dQ_4D_dt#@`=GXe z8XqpVCnd;eD|p5j>dFV|Jm;Pho=<@hUX|auL0zkL3M6lek-z6h5A1j`Bp9HEdl+%= z8fa?%7^x|T@Y~D>|BfM{3*ZKr(dpjlm#<$HzXE?Q-{QPU2zpa_e!vo9>_mP0lWsQjRVmMe2JlNA%cU25~Ct}P06@U0@k-{WPOWl0Lr-&?b=>D z^XUl+%5pfhYVZ;BjlDst{+h@xZh?b5j@(TH>z(){edXMl-_nv@?bO+qMmc_;4imNH zG>6bH$J`2w0SCYg3SD__Y@aH|uawO`=qZ5d%fcQ|LH6JRehR$_h3KagOa*7qQ}Llr zI)QgoGWyRzo%KT@b&Ybu1VG%$!VD`A|Gs3aFx!HQ^*uB4M1vW0M8ygCU_I=>D(~}l zfag#qmh*%2etGd{B4HT&I&LU}o0rVsR}7%K9|J)O5^>C6suylgL3e|Am?x|5ZtzlX z&dm_GL`)l9!OOZ9Orptl7}mMuxhqH&-v;T}9tW8jvaF9XQ&1EaZ}pJnQp7alYUrRl z)s>k>H36rRh6*$i#H!a@zl4OV=u?0uze7Vgx-(_*OIH}ENREvilT-U6w;4rFjG(;z zZQ@a|LxzGsFzd$g;AJnUYZLV!4k+((+eIA;oo}1hhroUMj!cpnxP`=2k{Gh8+}PuR zS(F7wV{E{D|MOYuhCGC4LN%44IjM#3(&w>5tU&5M3)Gq9*`N?l$2ljiQ8Z;-d4w|bR2A%< z3zQ|Qm`mgpYah>6{e+EF)c;UBLOaCc@HWV7fD?LzBQgW+@A_BwEt^c(@! z=HaJDc%_shTu0}Axac-(v|br-XZw8j{W^`>{Oz@gDmjip2>pM0l;g3?iU)9yl)*ly zerlF*T*@?OVHHO3XKvx*9CU$k*R(7mfMF9j@3Ui!V@Xke%~+IRzyz zNWtD?uj)<0Gd^%}uC*oqC_fIO9Gr3J z%=`bD-!n{@SvfdkNd}5#x|oGAU}oFMZOE@+N_niVZ48I4;@hRg)BuQx#Qyu@Q9N=< zy1gPx08Xw0u=F#R^Vj5dnv6$Cd80lLnv4DHu9mk|JmOS4#Uo@u! z?|x{gMrJv->BW$7Nwr*UWmWV3FIcHlX$-l$9r}zIm0YNuL=!!FOJ4z0(P?FR)|>?E z+mm2F@Tl45dikxEOt~Bcz{2S;PB+)GR!gsZzqF^fsW#R`#B(K1e>JcJv@Th9!(pdB zJlQ1s?G4E07b~Gx>>5}_Iq(q-(dGwzg4@pnk0DyFTr!vM86UM%}WxB1;f4YPk& z%63I4@W~JNL=yD^IPazR*)9`D=ya(cT_7$c|1+y>r*J_a0q>1u$$dUkVf4}!ak5<) zA0-=0(JMcEwAO7&qbs7Jr^gy6dLpl&DIrK9;J_x4oylthK3a<5vz@_e=iZ`Ik4)sX z-fNLXqVa5K)4w>D{YrXE*lVVLG0-%8L{^Z0vTclD&4>8UX?D zD0zg4!__3C3_F z`nBo0H}manZxr#{rDnIsF9ky9)yE+ z|LSI+fzA_VQfVwUc&O!T2^{I>kD&UA(o5Eh!DNeuNe{!Jakk$`8ex3?rq zAjyGVrK%Tab@Kzw{CvwTdHd6m+r~LN2Alvw1n=M|f!1&z0L(}1*m|aIr{+enJ=#fx z`o(}^f{@`B@YVEFIvePyqB9nsv8UGMF~{k^+o)%qR3cmfSDU0jKt}8$r#~?u5glAb zhd$x@*)wA|IH;b=LB%cTyTSaLRT4?1D5o3zKWMT9opcu$mjr?M#jGFD^SF7!ITZ|Z z?>KDrrAlm&Q6oxZXph_w!9GfR+xLzAu6Q$9boa=ZRBFStW)k`oyw-G?0*>rJ1W2b< z^+AqGNkG#24Et~W5vC3DLSO6CKU%WH>=E|kvfZeTCm|LDb9!mh@Xw#O1EQm&<+L<4 zN5t+zBRxjxdjCU zl8N$Y*qQT;5fb_e*jPv<;rT|LKX7^3R($`)`bKJmkz{dM4gfCv~z@#OA(v^Tv4;aCU74=KXO7FJ8Q;kE0Rue#z@Uw-ptHtC8mE(-Vjs zQirPhHLyOY6aR}J8(}uT{m*fr)^SggQs{GW7*JVWo~^5?>8cO7>K|z*irm2Is7$tW<0Qqs>AuASFDtN>@mj7m-MvOTt77N z7xQDUfO*_RF%JK`JOl)tu@t8vS6rxSYK`i|o`Nh=piQFjA)(A1m)DoK<}LF|;A2>VKm~f(HfE_@}Z7t17T!^RF9jvpzFGuxS_3k%{yR2{-e;*p_paBj96?ax_8}hQ>#ZbIf;Zn!=%@pA^N^m?I|oj;-%D!3Hux0lsb-FH7JurV zWtBXshMM&R7O?9Z0jHD7BnMbpA%2T!)D;6ktn4h1t3rUH29kSy>vRoUHm*i@N@}W+ znx5X(1>k}F7P5t0&P}TZQY1yl1V60SBM^vKG4E3{ZGCF$urEtE%(V1>g@)bdo3q3Aw07Dy-FE=hgW{x$|@v#qt%^I;qQX||BH zR`F&R$Y?VFr$jvq9I&dMg`*{%9X!A(wgi+J(<_X=zoLqjoh~KNbeeaUr29?VtF-uEJgV&0R5tc|L+2i2nh@@4z^dEF1UV^q- zQh|zQXFyow>@TK322(fV%f!J+m64GdWgAYyHZ>z9CO%_@K<=yu66n{=U*L`GRD3`D z`Lj%;GysUd>&-D%hvwM;ij#)5L0J8={61X)J2?#rE*3Uz&CLsyEu7o|kcZtu{Q*m> z&&6`g18X{tJ424km{3-;`+=~ybi$?~|6{6zmS4vDKX3aoLUKer{A)EzRXhmPbFwK1 z_fdcXx0i*J)A88V-`@|}iWa?Wdq7Nh>>?x6d((6+UR1mIpLCK-KVtA}9%Tr5hZDmmfA#KZ@=f==sr$w(W!wI<>zL;*_9VM=?4pO7$G z3^Os-YJ~r2pG?6$hfJN{=Je_M=b%64bvw)uf9?#tW4YWRrH|a`8lXH8N#90*%_5~Ivlki=Jw74Gpbkp$iy0Qh#sl~LvWaCXV6ub#6AhzTeAanSR z``dJ*a4;N)@gg3LCR!o7);+L}xpQs(F~<>t06n$U*PS9nQaH2Y_2(wLu-A9`OMXFo?#Rlqe}8)uyG&?GLThTe0R%Adw?<# zoVt?>o#WtV4-`pKyh{fFr)jJDFy7_ z3~p0B?LXGM%_Wb8T%t~H%x>?bv@c)2yzz$3r(EY)RP!l`=u1*78P;ykwW1_k$~S)Rqn7Lv+>6WigAEBAeXW7D$#37?+_O!p54 zKFuuzi}00;2~2hnsj8N350ZUJ87tfHOk!aG&{Bm4z>;zZNFX{dc6UCd zB4V!r{7b;lbyCK}#AC^AWy$Mz&H|0s2I$Jt$=4$+Hi6{^*jnUimUn><7ObZ26~H7Sb4rELlf%fe)ydoAdmK$I46! z?@s1l0lAw1!Q>z-Z(eZx)2rv61aD9S6%^lJI_(2eFv=Xf6AL05w4;EklHv({f6lW} z*$0r)pmg%nJRlX%O@tGEB&%%4OYm(D? zuo)%+NP6FmE&Za~aM*5u?%&5Mk#`)@57#6uiD~A+wg^FXQ~T0T6X3f*$W&tWFDY>* za$5KOH4=LC3jo=^`E1=>kXe&l;d>%zl-4PF@6z<%=6^NMXi7ep1*;lE=ErH{2=g(- zT=1_-&APf{ZQMIf>;oz}VX*txP^$+Py?b0#6y#wQvM)WBfO;NTHlG;Qk%&LBy0zu1wTVQ*Qr9WP`2uDgz zYhi-?#a-tD(&%EBAdvARM{BAb7njg3M$)+vj6zg4IldZ`B#5~`fJ zy6_a7FaRt)lmuXVUW)qJypU$9L#t$pxn`kZIuQrz*26X})xbZsA%T+mH5yoBssEIt zuHXb41oyiUGA_V6;hbTQIodYun;z19tI9i$BDsu-y?Gb4Se{Z z>N&@w3X&(aLFV$jIcTsoN;mc{1AK@g#3NM8qH9OlgbQm*wW+&pzh<~6@BXwjgXon| z;8B&Cg!NH5QI>J5cO<}Q6fdHpo^rka@mW`phvTfgKi-mLLb>BE0SqA}QfC60DMwY% zbN#7K+w_g+ggJuL>z1hW2`3r6e)2k3=mXsun{HoyIuhX7dAIrL>j!=d0~|*tVX3*-=wgovJD^?S z$5Xz*%V0*Up${40q3&bEF=%igUh%syV*AR`e#>2Q%-Ox$g9dtpR;fpixS~D86#zCf zV3~6y_9aTb_eBL8FKvSQ(4gpNVST;4fOcOMG&$;yR(eSp3B<8}%FwM$G9Ft0F#?qN zZEtFgYzMw;$?nyF#CE6>tI)waFp{B4o(hzC!+d zr@jrG`d0t&2Hds2uwq%`_rZ7>3yn==`D3-?IcQZ}^yWeGQ##;VVWLxJKn4wwji-SO z4gv8p1kj-QeH;Z6-ncMU#?>};cWtfLlWt59FWiXz7yp2N}FGA>&5cRyZ$)p zmle&sUntBlaVefL(7qRbPJ;-BYJbyb`c;w~^W%AWzjOz;X%b0mq?e7preNu%AT?=b zM!;MUXX|N9REPUH0hX?NjSgr`=+)y|;IrVRzWUEv7-5KnRlUUAD$VmJ47lv3g#w-v zouvJKlOq5`$ItnQpc?wtZX4bR=RvYB>8?xUXc`>X-!L4I_9mX`grq3-e>I~tGy)73^w1JL3!Sb}*UvM|PT)C;1?cVLvxK%4U21M^>+ zi^fn*S?Iw*6`eTeaHKUC=s*!VJ7=q((3Z(x6H=Xui-wYtWA`lYuhKK*cJW1;&rmlv zzJKanwN0jUpxeX(dg2=&+5aB*(?-9nXq3wKT#sBYPB;FNIvUN<_FP4HhtcW&>UT6C zfYiE{=0W8S@&vq6;(tJSiDMPh6##TdH#axeGi@spZQm~Y{#7QQWh4XEq{4cx%FOQP zpp7ziy{R-qXeT)uhOM2ec}dw#@vm1B)2^G!} z%>5&B0V<_HnnpXM{V;G9PK%tDbMzn=ls54P-wM(7D3i6jjo-u25MfT7VA%D)1{)Hf zEp3lGTwp!)Q98=k1j)49&Q=iL?AOKviWhPg<>BkIJ=;WbVw!qm*(EWf3;#Q{{2UsV zG##v}{f+6B9TW0)@oXTB1|rT#{AuHmwyZoArG&!!eRup5r^~g7Xh0WYNafT6a-Joe z>3r10nqFg_M-jiY&<8j}wkP0rdR89pJ@n{VxC`I!YRhiY!VhNguP!X83e-TR^Q=Dt zmW!AFr~Kjz(+=@xBm_-b!~4($5(q*kaTiAvuf8{#L!OpIndS!EdmVpYxl@5VEa}6o zC#5Qat^j%A%hKRDv2$Ig5w89L+s%Cj{MKEXq8DDfR*N)~s z+r!lxsfMLbOc8o8hNnXhH>>Wt7KAwv^zfgXyM^rMu;5Y zWNCBw;2O=nom8+yM-5Suz7toHY~X+9pPd0Bf*CGBfkESYdZc=ei3e<Dde@I^om(nn14-@E*4ca%#Uob4i8b&#ms)`{TBp1 zg@BCAB5rs{R%ww7a0bn6XqK zk;(-i6b-7}@1tay{s2Jc(vAz;H_9xi#{ja8pbf2I^uJ5cp?!B5J5l1odFFx)GI9u= zq~%I2!b=p9{VVvB`Nc%vK3xHRBo;+hxIS4ME)W+C0dYaM%#lpTAAAl?gmWi4DGZR2 zbI?l#{ux;HjloGk`Y6|yKq5|lO1#d9LZ|vTAX9QAJ>>borPmBxA9yPN+8^5}LPH|A zxxm*WGtDF50v;HkcL~C2wIm|*jmOf@^jCn<$UPwo3bbTdML0PJF|1xh{6?|qoF|fw zz)PJ4q}t|1$WwfR)UHRXoo|73h07x$>Jh7^zSMc0g!}+#&y6I$qlg#H0v!D+Hset{ zK3{94=s~s4XMAqlUs~9 zi%RzM^Cb_HD@!9^BM-n@($HiRgS+uWl<4rfE&z=)%|safeCGq;of5_c7f{S3V5@Pi zKpy=gUK*$m=*lv)>|?!EayH?DA@JLSmtOY?p!5ZE;^uI2EFG zXeP1)wT&u8J)vzk{4v7U-q z61V%KjKSk!70caFkhKngF4ZTJM1@1~%`@K&1o*?yJ(wXXgp_#(^vP-X;o+>)pPt!t{v=Yu zW#t*ly}ycr;c3QYe#45)L^-Jer75R9&dh(sG7|1~K3^^M=GJ|fehT%Jj;>pFAsRMD{A>5f(@3Upd4AKU@f|AB8iOrh*c@)L*!sPxlI25 zQ|mKsEh$(#!mv847y1!y+JGm_QYWv4yUk-YmZFctH;sDnSOMgCKmr^SrYINJhiU0AT$H**Njiy7_-| zgRdiDX#|shU|6;WDK?VO!pLoN5voOEg=0k3b8#6vO>a9ZvLJcJ8Vct^c2TQFtZXBG zg8x~;Kw8%cN$03{K()~MsDF&sTIR^9@s;28K=*RhJzBKUCmVGQ1!h)YH(wu7m85cb)o+2KHhE2NsdWc|W(`pFG^$RdcUGwV|HrfH)nGPHZUilfK&4an>!t!<% zcPZ~bUMhgkEh#jj8~5c;W>)^GZD`n1=y!9j3I!*Q?R0Q1^8(q}T^3N}R0aS}yQY?w zJrFu;K(?ozqi&Ve8~0+Ad369Xo=eZJ45v#WTrAUO1R#b=pq}$ok><~~nEUUDB!KH6 z-OgVy^-};4t#*ikGU*9~-aV|P*O;E1Gg9qRRknMLX0Fb5EMerMM~p(@=RI} z!fQpNk5(|b?K)iJ-i2pR-(=beel)KfxM_YkGrCoYpmJRc5RRefaH9(IvQ7AIV|#PS zRjPuRk}Jr6PwSYZ8swS zHuhHqyk>*xPm;b$+SjVAU3u@_+}z5RFmhI1ZZi*r1g)dRXe3(Wg5T*vCx{DnhVFK%`{p- z6VyF==V*OhWk{n6C?c!|hs|^xco(fv=y*Tb@&XoS-~j};`-`wX%t_s(>+TPmXZ5dDvIU*` zfs{Ror)U$n|8`pjR36hG`S6p9Vwcxu(7+p$!+^ha56T8Uzht{(nO7*4e~;zJ$rh?B z7}wj)6TUt{c>@&n%Z(n%;52Y!rd_5`-8UygIhUd1j^m>JYWV?UIkai=Lm_L5>=Xbv zK>)jb@YpF%cj!B;gUaxZWwyWM~k zM~N$tDP_wG0Mwe67GEwnhrp8SRJ@=#OY+v&%C;^{@qiaEUoQMCR!nb*ii!f>!Wc#V z`!vYzwEcMhEl$4bKvUSaxw=T|VjANt05n_0C02ickXVOX(Lt?O+KU0%qc-&&Vm z!P^Q#i5RUUD#$||RjouZ2PO7L(O1<)QO5jUp>9yj9MfCKL$ojzZ+=w&?jgI%VWJ@h z6|bZA%hn#monR`OW-8&7Yd;3$OBNKG{w?_Nj}L$#CP?WKrX7lMpMaJkJc|GLiO5B> z;=d_ORRtgz!*}xoa|JN1Nk@}MfzkS=kmuS|?baUJ{&ZxdYh|o*Fj7E%r0IS_d8cba zfJ|o6?l%~F4kD=WQU?`8So>b2^_Cawn@mqoW^w{0DNaCG*ZcP@|FQY!YZSw|<87%l zlxUuC{vP{g+RTv`XQ0JN8a7n3JH@AEXJ~JslW-jI^rIH5VBCdw$-!mJmDH8#kSrnH2-IJTH z_l(|#1@_#zX_hJ`3jo4%$B3tfe4!p$$iZA{dMY-Wb6y3{CBSBxEEr%c1D*^jLb})< z@t@bx22k8@2cjYvG)YpIeyv5OuqU3w6b38#yZnr zShD!MQ1Q>UYtO}(LzxysdN9mc^6t(*BY1SC2(@c2{lxqRtyYoAj z!KCV|5h{mXOVHULG#~5VHM^mfFSJ6dPGJeWAl+vYW=IQ~ur^BqozNi0Aw}6`hUD`~ z#pzlm|8K=(8@f22$-l}^+CE5^*T|>X?2^E>y=^ols_Jl7a>6WR zP8MA|4nicU5!955fOLnXBjP$ZV9)EBE0#Zb+2k6vy|A8aELQ>PuMT}_4MFjuWuNgY zNx6?;j*DoRl#(yXPP1?>tLw(5y#MtQLVmJz;&+#emVNFj9H>MiNP#`quG7GV=SY&^ z0-VY6S$u0UnGvru5+51Rb12qOTdJl;2`p`zYrvJEy{GHfuQ86M8Mg!$XB5 zLXw(j1a7c^J`wBJ4Q~DZQ5zCgG`i@dWH(3%mX*z2l>HL8Q}ALrR;LPobvCz1!8vQ} zdKYnJ-$5{klfVoAPAiGJ`a-OG>GWN9?dSL2QD z6FfG*2Q=PAp1h*>qA_Yy)#;Mx78A5Xxn0ka-!J3DbbYa(w>Z3=g%m*kX66KvE8pkm z9)k0az$_<68beiPpD6~Tavz?F2Kka>3SGifh6Ml^b{09stUS)EF=Y1uDt!!zb{-;j zfb7HOa5OP$nO05Pp`AY(GQsce#W&gDE&vPqti-$0@~pMPXoAP{o_F%-FU-SoAxE@D zb?%@s?-bJf3Y@*>K5iE{nr#O&$nF&0O`El>YcLl4$z8@=1%A9H$cL{zP2-ks(EM35 zUqMWnYS-EGms+kj*jdVUS1CN$Raf`r5F8Q#DaRZX%?pKHox*0@3-{C9PC2?4`nCy5 zJ7)rPVz{h5y*|JiC3E59>@C8q?e)>4G*72V4PNmzS4%&gk}wtC!N#=c-Xl`&p}rMi z^g0dMbi-$LzN-VAB5*Fk1o5X64}5kl!IIJ2CeGX)wljb4b-WO8V7?elZ`APuPnysq z$BPAMx&RGJN(I0pRHeY;Cww* zKfr6~;Hb})wxHg)CBQ$*_}&d@rsVkpYtQuO1~X8JjkLI(`MXxhP_0Y^jPC@0Dfz!K z!EH=zM3lR=I%Vzb?BoGURm^yDr^a-9?gR!*{+X9E)sG%UL4qdO5wV#q?HzZb6PtEr zebfJ+{J@BU)p8&P6<}h(@^v7^PM*C9Ufc zraUP190DUs;4B~J_>!><$&zCiknWIYA5vrEJ8yn!&SPqguZjs2fvRtU)~R1zdWHZ@ zVx8>_WzPl#)6HE>=9SP@Gu6imksNPO69s8}>{l6IW_7*`a$LSOATk!mC2R~tbXBgY zAg>mGBH#3vS+lsFbcIMIoA^;-sAnA|^z(kU`HDOZ8{UEz1nQ2b%_=g&G7^j!vK*2@ z@_@*)a51N`mCjw~VK5sfOm*@q7Uj7zU^HFdKsjeDCwTBbNe2{OEfd z#x_RsIKzaV6L+@WSrtXD4|}fB`;WP66Ljo~>R@Jd-E1EKbfQ|M(%c%N$GvDm zQ^*(luI&9Z19rC18|$rRPOeFsyGk8!q7}D)?6SQpMI7Prz(HdYsZB0d(Y+OTnt7~z zg*Ypsw(_b=jX6>a;?I$?92N+L&{35~o>#^l(>eJYp6lkB#r0#%HaeLH_Rw@8mPekn z>;uKDuZep^G3oHXfr9kdMqT=+X)D^ej6$JI98tITy{N_U3g>Y_+$#9*+l}9d)7K@-Fu(C&%W!ruY2t{T^&_&lKUh80FbMzDd_{i&1k$F zOmqVP2xNaorsD?$-ukM~fU0q(UHsr5r>ELa0pL5B^vd=YeoXACX66k56us9k!GK4Z z0{}1^s4G1+46sJzkNBR*+=-YbGV+`+y76JHW;Er#sqT~E&k;C>(7E~~x+%rOc$E~@ z+Jh|B063cBO<#b-eNxeQ_}s|l<>kn-=ikMFDa8%65B8)MlccN~mP!g6YkO$qed-Qh zUcWQTyZ^TM&-vX)r0cfynqQvN?++Xq?@m{Dtg1X_+@0=qr&{e+W{4~OXmwdE8OAh$ z;g1Y);Lh9&CAA?I$o0(Qa}QY-k-+_BEY1y{-*!wYYojJaxF!9AWE+0>jU${K`kt*M zFNesE?*+e0*JKpY<&-UfD786l@v%>kw9VaRt+|t!AJ6_HF zntcd8+mE;jbaR|G-q%JiQy6KXIke8KSWvV8Ae1ns4*NcZ@Hg)iQj}&A*Y3h{U&3{$ zDZcG>A!9jj!YUV`@Pp6>=u$UlqcN9t=d3}@iB4JChSy~NJS57Sw?nQf!AoAaBvshY zuOwdm_Yl*~9CUt=yJITjAKH>{HprWE4p+a_8NQ{yS#Wvxr(uIkJ6@|mL^{j`{?e)D zDJx^ifYu^`B{PLm?@iAOkp{()KY;gRt4A3dT_i)t2kpnGK4V;?m2cGH!NJ*vJGak0 zuIRBHMNWSeo!dN$V5 zrVE%v*pg5Jy|gSq44)i86Z>kuBB#%1jPy4p4++O9T{^cMAf~d-3PW7_A-`u2DFmAi z!w>@@=NIf14x?_M%#q9V!AiMsi!mEWqPq1I(x_YOp0mV;{u$*?!gcZ?@!YoZU2*Y*{fqtf@1f?D_2|Sj{_mUoj{6E&}4vk!c>Ic3Rs- zSM?!5kME)5{E#V`W(U*oZA%u&Q5z`XrH*UHjEoqMT`k2|7%t+^6 z95i8lI|G}D9>+bVBV@3VO-v|NP&`qXezbo0qKWvB`5q*rieQPaPp{dZ0pfX-C!*qS z;C|!ia`?HOz5vxShZv^W!=aKA{i4pi78>}q*Zn(8*wt77(Skm?rB)hSFe=*d$0v_T z)lFw$%hC1K$>R!|{@7in&Wpej1MJVC&xXf-g<*O0IXb1R@^9>+oEwskmAM})E0M)R z${PcfgU*6dDwR@wkxk#cw!f$sKAM|lg^!B1uCUIMVlp&6Tn>;^(r*lYJujSVncXPK zez+qxR`FWef+z~SPuTi=P9d0YJ}VV2)Hmp0P`O|~>AK({|M%R{vF_z-w^wu}uF5U~ z{r1GOC9KBEEelN$;+5V2&Yo|+w{iTNcxx@iSeeIhQJ{RiAJTbf3y&^i+uZ@@%hv%( z1>ZKR=x^~hPpqQ8nppm@S&I_o{~?+IQ~_u$&m$3)^%dLro(`J+9Vm0!?sf!Ac;imw z2;xh^PrU_jW8I%7)*$OT!PD%E3UI>1rUK1Wi@;OS%qIB4-(}O)Z!3-K4Q8D}PC>IB z>28(kg(0V%dHYI6Rig~ikyjS043PDHPDvG`tp2j}jb<_#?(d@fz2h!JYjtn<92p@M za0_dJXkJQts8vfJLv)JlsOmk4Znpx>l5G5cqWFLH>t%=zjuj=jq_C&GjZL~lgf*;f#c$BOFo8*q6h6oPvCUKXyy*uG8a&OE*r7BOF0zHq~4(eu9S~)D7pNg z<+0l8^}a@*$cf-_;Db4Yk2$Iz`}#lykNB4EArx@l>jn`}<^sOg~EyCiNqABGwD? zGPL99nJ|jaIue-N9jSPqeejr>Yl%&&W??VXH$5%Y+|zO|^mA7Of?ce0^j!!`Uin@l z`zt8r9w~B5ie{=|WrqFJV}`?}nu)_*$LbD#zCK=Ksa34>ex{^sXh&xM+>e8!Jbdk0EJrycKAQb4?q--TCO{;fhT(5cby%>fI837&BfX3o^K(vW88o%}&p4kvE2}#WG{YzEr834av>Cc_ zcEC(2MEcX+U$RXVas}!N451uZOK9VZTw#C9!@6Tyw-#0wqlAm)`Qz=oY1qtdL!uT+ z*$>}yM&N$w_KHgnQn2Jzbn5bA5%zp})CFY|;iIb(w#i*vhv>tD9mdJ;dMi|&(sm-R zQ6ANI|2YC*eyKSM{d>1nZE?K|8R`EZb0mPL9^*P|^!t?&`y<=hRQQ*;e0egpRi(i7 z+@mIxcf93Uo!VeVnZBz)i-XSw519POdjzLdLD`XbTG?d9!oF*>&YkS@{ws_87I_A{GN8aw?Sd!3Ct#kDE=mk=$&zJ0&nqn`->H zle{$IOLo#WotvjwnKJBs$VNbncza&E~Ks{Wky4?M)CaQjPq5BOkpE|obNp*ATgr`Y2I-U=KzAJe5MVr7 zjRf!%!Z)B1-uO>I9%(Wyux9yh`aa{l1w5v|Hm=1|GTyz@H9bMfK{sak*m-BCW zAzIb2a=xQ>1pGu|}wFiKBP z6V(uc{z~mJuup^{Ytt1u*y5m8k@^w$Ab4htxqZo%D=B=qyx90~Q>7fXTYqLW;BHh1 zZTf6o=IQ}XHQzpA+acjUN{%Ou z{g+Z%R@~91O{F$4*IlXMw|7o7WWNTzq3_EWQ=90FYB!x1)CjD0=SDy^?^qShTvtFY zo|wrAc(QFhQKmu9jwE7aARl#yAhy@}`-Tk^!xtZ8wdTn&mBMiU2DR9k4GFoTEi}62 znJsU;WUn2B>DO`nN^U`VD60ygs~;BK+G{JZ6Xm5XE#)$%T}gVJcGkP|OQ%DGvTaV^ zG^{^A2=2z!gA69i3@q(T$?aPl^lMN2g@Cr@MxjK^5260HlSf5!z81F7{UeI|pR~G) zU|*~cdq9PM&v4Ef4|#$j;W#&RM~l0AFaINaFLEE=muGs2j93ys>M7vs42B zhJk230C@bVjT|y&!IeMcG2c!bq^^6^iWSJy2^SE;nyKO7q_)wrf4`j%SD|R4OE=AJ zec0FvS-Ew(!;Regem4Hx5Gpu2FtLStpouYS93Ruq@6SZ!i#_z1zLlT6XZV{9neR#1 zB?F%~-KLg%Bt;B~J?wX1ZkRVtoJ)_*t+{3UMzQhgQKQj9qVqp*8-Ek~D{DwadQ0Bg z?o9&ax3}`;so9OKjA3+M^2YCR$L5YB-GoQV?G-Y^W;>Cx1gKi8$^ukP?b=3t=scOB&*M@KG!9V%DRmr+V%CmV15L!3#d-h!{$|aA*4CR? zA|30$$BfM)i?##;=#3`%%#QJ_f}!`nM^3my=D6;>_nbSorN8;Gs!uAv)1%4i!g8<9 zImy=&=YyvX-d^X4?QUJx3>m9smo^e2NO+V*?4UOb9)5 zu5H7F6CC?n-Lb|z28;Y?HL5znKa*!&Ly@@hSln{scI}SZP)OC)LCC4pF9G+G?TaTLCkj(b znLsg74~0WdF~(=M7wh^3(MfKL7h8-B<<(!F^P`vNiAYLTPi&e(YbZZrcSBBLca5bj z8PYR?E7r}L)fwFCW(oKqvn$LW<1wZv`#w*R4|CatIESU)`NwB|>1%<_5D^mK`28If z9(LKngEWFC?_Nhwo+u>|OMp|gHg+0Il1hjO01bC)m9D9ETF_WH5zo@5GrZSXVK3;f zjGEauCcmJdf*qJ;Idg$o>2COHhOCmO%#^Xh#SK8$Gc_L-qE$x*u`**If-LJz`iMv> z4S60&DM+6BKVZaDQWH7Ek7$OvpFh5Tn(gM8h|9tbJJafFtam`pDL_A@a;t|Is9(P` z?a-Y30H}Wuk0*+szCC3+R{go3WJD#~;-84^%^ce^_Shf*Pkt5AdJEM&@i)3@ zdUWK0ZZk{4_(PozUmBp>%Dds(*t|O`rN>9B;mEtn0H8tvpS@w{eJfP zfFd?iIrNQ!EiG_+$o6br@d=EHYt?w9X<=mF3wi%mf1k+W!ac_ZBhY`5Ol)t}>RmkU z8Tt@V|G9XNE-B-za91Z`;gJb9BRa3Y(>?o^<*uMDQJ>CACGXSa-AlNgHrIIK9M!PJ zhxV#1lt&$AwpHNVEW;(-e*N6L@rpKm>||!-W{Z2N!R~~Ua2+yOH*BGraUvLRfA@ni zSD#b&FW*SQm9zGHb_SO09EIbtmUJ;aWjq6YSqbAHsE$!%WX#}^TR?VxA^sm3H0%Ar z8om=wcwdrHlD9bd(-PXP1C=X0Au@x9w2z z;5kCQpHkovJO9T!@5-idUE@JGUvtpBcwp7+J03JK0C@8Bxt>X#Og7Cl7HF4y*44+Z zy=u*7U0(QIi*%kYn0~WWl>@d85SP)v&%Zm?8Ps>Ce5b9H;gcoe_l4saGaS;j#sdJ| z`FHB{GQs1ZMyug0-Sq)WnuOQ5i13vtfoqQ{yxv(OMjN$!^mr!$v+=XAz92A_(*oh;-U#w|4Mz19?8 zC|WBlTPW87NlcE+q7jV;@vznQQi>p(mj-MVlRi$1n`PXpvCA?$g0pQ_!>O}vp=lq! z@V~vUQx-D`{_N44Q<>VCfnfvD^j;{#LQ&~*O|ZrS%jr%zS|MM*Anbm*YsJgjf}5CC z_c`RN^1_!D{AeAVrsUvCRw7+^(R!!r*Yuw{m)|X$tpFf^)=tuV3!-e!M+SG>Kw1jp zG^gL^aGUkeaSbeXC4oRYl=?>dk`GgYk5vOxn&tGVJumqc;@15b{Z!ywC+HRXGr}$% zVWt#iwZo)1V&%0RxxzWEK~0i=1o-b)354v^!JKFA655~iTDWy<4;F;qV4W)DgT}~^ z5V$dpvLP42N%{wugh}=r_{vX`BB)u#V!7bNNbf-p04&j235nZ~r@Yzm8l@9p7nDPt zS6m*I@hRlZq7ana&oXSG9#ja*v$??BtEHJN_<+oa8kENKYkDX^)IW@zliEIWnUeX?=&i*XPsuFb+Zc^i^ zuSnfrR=S0EKZg^di*f04Cay65Pg&2P7k-hQmo~=d7^<9;ah-LiUvB5&ZC2;vn}J^w zmW&-iIYTIw*~Fba{gg6(4Y3@jHPWM26$hq3D>QiVO$NW6WKcs0Er2Dl?T1nfrzYULX(Ca^$`d{LHi4^nPg64d1uYPk zo|TY+(c7Bn3_1N8xqths#t(d@9&))Lyyf0%Jvbi2oG;#o!YUqi8Hu; zxgHbv<*U#mv3K_O0G6bz1nk=oL;K9D2a6uAJvVYN2O0@i!3#t1xxc!gvT`T6E2zp3 zyAI*-PQu8S(*->zPkttD)?z7het^ecOgt}MsQQ(bOUh4zSxaa-Q$&CNQO;T@ESMRI zcBEWQtGU}CC5RjQlh5%=6`-zIRQ zV)UyUq}rUimOYG(1Ep7DHr=3|65)x3L3 zvm1l*Sq#(dh**x7kZ^HUZGy3)+JR4(SF(Zg;A)rIKgN;1pWr*OYBTOib0r{xM|v2^ z1|(nNT-fcHMYrLZ^!32c=HczExAml83d=EHSoZYJJ&ZioygddL2_;a-Sgh+MEa~!{ z#mtE~uf_Clr3J6xHW{4Da~KSEC{G(@MsC+{x2-# z9n%~1!k8#f7(^=*6Z366+&JDZ?63~1K2l#C2$X$lVyq#ZAQp&==or@Ya+7_r#TB{7 zdf}pC-q?!#4ZT1D`So{5C+CLYPdxV%sk>_yHt}2vh$LUbWaB(Ry^X&`;6$&~Vg?GW z(;-ffF&jNfjYf4%b{I?tnYql(-<)dw2VYu%7kFT$fJw~k)!fNSEe19rZlu|z*`Jm@}t5E09U_l#eA zScmM6?^B23>jjrOqbk||Z)v%nY$g_E49y6USRp#A3H~KJbX}jWr0pb8uG`>$Yty?s zb(3k}668;Gm_B^p>$D?hK+1pgAhZq>0Dy%1y25dfY~EZe@FW#q3Qr+j!B{xV1vbp> z7OR7Aw)D7)PQi#Rj?#GP(`-SIB=rS5014)`QAG;U7`3iJ7ZMyktmm2Oetfapotuv4b zKQ3*Iv_V0?xB9fRv(&xG(WxBcpgQmrye^;4Pd--NeC@{1>Z2+nA@#@zj)G%OPVmx0 z!6us4b~iPaq$YTX!zYzA?q{}ir1nV15$t!A%0$6aS&;s@-XN|uXL)hTE(4uNlmZ3c zL}jbA3ChwS==+8yufn7L+uwPZs*jwWS}EB3n2r5GI_oBJhY8}Zt%ZZJd0AlYBUvx3 zlaIWq`RK{_kni;e_g*#CdWR_R2XotU7U3X;+#d9Y9!9Mu^cH?od(VEJnaRf&IvNa@Z(Rle01TQ>)${=X z%2je6dFcWGK;ivo#)4d+@X^;$0hA7KtdR>BogY7c3;K{0{vK{16ru^EY+tQ0}1xX{@5p~lC@Q79A)x(!@vR=eR?$)>aWOUg&Y3M%cE zqr02WJ%r=LJp(GIYh1K?_~YgukMK43p`=qhJ{p^gP7XU(+XUZPIfV3ugPY@=>hXq_ z)1S7Ki4tL@sHy2&rd*Cw9+yl8kg`79_?mj^2p(qlX1%DYUc3Ix=Qc7t%+<_$bWd-% zA62rUMB`F;ws~2nMKrh^hxSZe+b;L8lmkqhcpdF%zniu3?h{VGG)`C3{g@H5dbC_} zZAtCk$!W-M9N}^OEX`IZHxhlW1*Jb`52~BqvMlX0jKLc4di3N6XYl4zbtbr5{*hR( zRu~a6NUg4Kk~#fDun^bmyDvB#!MB;B{;>(`b*8+zJxl78v-~*e?B|LhuQZ5`U! zxQ;S}zHd3oBQG6xc?m52VS?28amR}9V0H%#%u6Rv^vSGZ<}k#!e0@7Q!S;zMPK4+)~M$@9tEUj zo03L4jzYP~3bh=@5iLF==*iMJy&~WTZY~ak;RqwNg5|rit54+#!qK;4C+xZl*nMZx zdzUNQ-rA)GoaLLi)y>9a3c>OEPgAdFFqv(@ ziz+pB5?&{G!Wm|B#L9H97+2<6=-6Y?Q>H5ShV*}&ebzS95uP18kzW~%6&LI+oVJYi zJ6RrWL7#uaEk+}0aVsoOAk@-|k!v~iS$`bt%m;jHs_N>Uy{g_f->ByXE8j`I9+T1e zxa`NLf|g*9scGkYu`k*^=ziJA{EAgv(`*;JHLArkYh>o(gblUku?_@z&DXFXq6wo8^idj#x@^{vd*R4XRfK+}0ddK(nGhE+oBT<0t90TtI3Qunhy zm)|w3rxPGlFQ?ey<>H!XF6WI4EW`VVtJ3DaeV%@dzG&S>`!^0%-e+{y`n*-MT999>oRuNm$U6GNxtJpY_cz5z5a3dP^7^}aC(J@+|&<$f8jM8e=Nm3Mu&s)^(8%d zEiLNvvDb*WD0-R{n>xf&63zWPx0-LR;@rv$af}@B-#F16uT0A2s^2(9%Xatr`XCtw z%uGyOeb(-8NX%MCVk76TXwOBoR?x#E)a5n{O$&B0gr8e3y}~(fZmxvT7XH3{%Iu-& z_A7T*ar@lKCf|e(TMY-acP>5Jfsa1vX8_)Tb%eQ8LBhVg*#l7Wr1c`0@AjuG%WjpTBH-z8SuAv}bdq zCreTV+0Kl0DMFQJhK;Gt8w9iaIR>nzoHgewJEcjs`hGJ8S|iueW0LHO9&qDL1MdlV z6XIxn=K1ApA4Ve`10gXdtf6-YxnlZ5&d2iRtPP4fMxtm|s0Y(}KtKu6KdmxmkZ~rp zY6)zZ+7H&Z@2|`!4#ilneh-mdp%s)?xXf%>^TuP#<|XlR+LOBJJ;B){*D3{$*N}8* zezU6i@~8PvT%9kR6-t-Bt|iF*_%vpR6{&kZZPop3-I^a+pCCFNvVvpJk+UayL4bb* zA3A&f@%&-&d{fVP7_N@AeBSoG$R}{rEDB7BnR%(7h%ujgM{~B`)zui#iKjK$xiI)< zh*5XRM|bCPQqz|&DUwzuGmpKTy5zX79n{=fY`lmo+YPKV@LyBQ_Jb&VE66|F?}KN< zkIxjh-;eu3FtekiVBYyu%Qy9PW)L8&7*pT&0?tFPp6T`QnKR2yM`n($bKKpd*0Uy= zIwYZDJ|`%HDeky3!t-mreP}d;Q`qrzZ9Q~brE~@s=Xq}C^(zx=`Ksn!x=6m1s81EH z^lF2oaYKzBW%8di-%yTOizsVqjttXEHyvmIXmjj1P%~LeC!j64&kNll8p$YVi+vcCw4ClAt_xQNyDPR3YL>tB* z-7ss5_Wf3wyX0+`6`lDwFi$n`XTUQy?g;IQ@BDw9>$ydpq#IE`?DZ;=+kzES=0_4# z`s8w-FP!zrtBq{@4k|6%9Gm7ujr)xObEm3lZanbb( zu)u}gzuqp2!wJmDU7$;PRVSo3Vz`h^{Ku%yEfRk>2u--TAR8#X&kjL)^MUfI%6dHsDx`8pPOA#AE_G))LZSlE&D5|eH4oI582Y3JU&W>_8JtqoD z0D(l!Y?8{tAhb4f+>|&Txw)ZX>W1AYlr=!jewGgo4dpuAm9J?OtqqExLHp|sI6*#3 zITC$CEaF0|)MA=HJFXcIh;GVYCk)4_CTsHX`-et(k=~nhlInH+CY{t7zIysz4XPp1 z3T9&Lu@;M}uv(}ziKq>GkdeBgo~?IIYK8@v% z+GMaC-M>*N&e;NAonr);rpY2A=Wyn{cJ#CLH9tp0V`fbho(&P$Ag`xf9w{gV&8Ta; zO)s65xX4d#7Cvb7^iBhS^nE~acVBD$dDAtB{*)#E8BRLE0UKrso}>`sgI7JD#5AN( zVj6$?MbG$TyKUatl_vsOKRVqc$H0BJ$li4fXYq(@jPI=<12!pZcr;14g4BaAg^`aLdtnZ;o+J zaH-WQXK{n+At21+Y53{;cuv6BT@4&P4p7deExW=9_%bO)4H1n0NKOSZ(`^UT5KqWa zACOo*4PB3m|G1~$5N=KX#e>4ey5@^mKgQi!*^$Rm?I!b9&Rh3;_lT^k-4(4 zb`xESISXScL=f%-SHjqzQNnZJ7?=hq})UZ-HB-+nC^tqJsyKr%S6QeyZs*=-Sil!M$ZUz*rP{0OJp> zA&>d9pxYRA@7|gm#g*(_&0~}m%y@;nH=ZD7i&MeH=m`1rKE$46dfonp>G!xc6FI58 z@BaJfnMs=S_dQOu)RaJZ_yjI4WY4>6D~GaZlixBC-0?GuAK{RZH^aVQ@0m2{9{F)V zF;CN8g(m#;PVQr*yv=D!n`1V<+LNS!DKvqM)>)O`WQeVE*P)M+XDxc~-8SW4|84jF z+tJk<9pAG}NlY`Yv3n4dP>RW2Q5WX0^vvw|@Im?)853=E%?I~Tvpq!TL z`kYF=8{CrCtm=ceQ%=prr@rN$p+J|zPXjyd&1KgxgC;CLxFFyPAQ^fb-5p9hIW~_ISk^9cSlw^?lI_eJ(hS^$R2n0Vp$D-|5S?v~$i2l!9Az`Kt`&?;%9RK2 z2p@@BFB&6MGbuqn<^w^4_=Tn8`c(J$)_1Q}k8?I~&0bQ9;R@x~>2dy(kun!D zu@}eQwVsQ73IlLahMxw2BPkaZ!m#!rAk$riu*eqjY83ue)0)+N3(zq|O`sjOqii`T zc?}XPb+Y|Rv-8VX8bJy8Q%FtN+t@2)X<&sMxoO*6G)je9;Wyop2e9!5tOeS-egGg^ zRoEKxBGeHWx~0sxUt;mm*k)s!9w+{pHUqYD2*6Lz;4OWopRlxum-vEc!dAc|tybS3 z(VZ;C1ZT@UEL4hQz&-n$`qyrFFDcV6;ON7e2!r_|HSPD^?}s;@!;vQ@$X+xWx3}dE zKMj#}XRZfNV7`Or$o;^qlC~v5Qrb zR}BZo(F?9{q-PYNn81@s0fCn?P{Lyu>q@vWR@s)J92nii-fhN%$Vl=!&K{QXKzHVg%z%9boRi{1ajm*2_x!POP=#%$7*bhv9{dL24ErD)KTK{`3fCq=lQ zHymv%i7fY(p5>i|vqypqG|grj8aCZSJ3JH%BqFD0LM!hsu^QkEuX)&xC0zb^`aC*q zrgL~TRCgu5bEe7rL>Xf#L3*nn4>d$gat_BOA{MK?Ute=q&2X*m+RzPorA%DS={IQ# zZAR99?Zz)IN)0f~K$+&>!U$2~Ry?CkfMC>iSsBna;g~c7bXZ2#Gd4++BpUZZgU_lI zt7ZCcEL%G+6Ob0!B(~n;W3d#Hy(9uvxO@*r1Iao)!{A<9qE~O%mLWBO2v1-C!DC$} zT)<8Y%B(JC$G=(p%ZZACk?zXcR?)L@@566X>VbMN6(5l9!4Ue@Aq_z$z<35aaqUb9 z&%M@@@_2H2Uyv!WulfA!w;~T|gDHzdKxJ?6G#_bwY#Wq8C0RS-D+`~}l)v!2^|oii zUHdOSE??1g2VOt-i|sEM5taEZ$KtWh{WE>lB@OUk)QE0{zu!Ej^f|M2R8;~S?x4jg?g!`%V7F@mw8KKsj1mwyn$@7GmFN>a2tTK(U zpUMGkoa6DQ;^FemiYM+NL=3+&)HGr595E|2GCJ#tc5@~Lj}D8mP8ms}cUrgqxKk*W z4$N^epMTAyhV&%re0WzRzA(z!Zp5bC9Gf7%h@$Pnu2?zi?>JR)TJe1s?CL7+OBKt> z!B)5jg$HrD<3|OJh~N9}K%Wwjqq1GPX?qP7dp>kgPH9cVP>X(h1tE0pL`?!U#NAG= z{4DrmBKm^Ar82!IBQE7J_4}QLahqB$jezvoCsBG!TwGG>mk0A5y}1JVu&A8=rwdo> z2xGJm%|X2?^@7@;Gi(Wp-R2?Q@3P4gR8OAm9mJ>L?m_~7p+-0MtPV09PfkwVgSIRg ze%IJ0-6iZaE8W$op$hY?-w3-yX_=X^j5#x~%;__a#Zb(hyce6A3*?m+8{DS!=VDiC zWM82GY=ELAC;?&YRl1`9K#_Qp3nyS_NA^A?IZ{n>B3jtUhW8h@`4=tD*Yu1cTRX^U zDPKdXux@5=2cPNr{m^4is&(=-{Vh`_MW0=Nco0#jq1kMd2V*P}_bn6zkr8*BT_2n6 zs+ltJ!WV1zG<5+nmjSG%lXKSHkVhgkgoV;~S*_Ev>(aw#398Z{8M92zc!e-C#m+gL z=Uqz%9PzNBzjgW!q@Jp@ImX>FrQ7NOg7QmeIt>B&1IWbeOfjebmkg-T;|Pg54Aa-) zmekqg@N4GOc=nJHXHxs4GScUyCGjN)7|s5nz04Jz9DP!-kzbbKAp5v z%hYV(z}>Z8Q*UJtf^CFPatQ(lC`_fO3EQ+oaQdwbNnUjI4*vi;LdIhzfA;3zK`w@$ zMl9T0qjsrRtK`5$M)RNZeSvUbpWlyck* zBRwu!d@Y?2?33aBGQHA0YXuYS>`f$lR%vE1&DUrItFvfT03Oy$6<(j*%v1uoga^-l z^I|_yG)T_rlbS-BE^=_!3~>G#&b=rQ3+ct{%b6`3YTv>PzK$eg{DHB0Y@!I;Uu>2h4pAda2hUf) z*E}nYM{7A$edN9=)AVl>ERq&`3CN5Q?8BSuDQKkU#!3V`hK!2rG6;Gs9cmHnE|R*4 zJxmJ0+W&Gi=_b>YsF-Wu75IT;?^h>yL(P7sM$$P?r8pr+TJUsbr{NMLvFUKDI(&k$ zNvwaAQF+=^7|#k1?_R@KtFBTu;h%TSHNEI;sTd8SzLW*YT0ENb*2fj7%MEur&k3((NCPJpuw+yg@^|A>Xuae?sQk$od z!m)*C)&mATe9M>BN&!05nLG!TBcLM}gu>8~-@@Lq_&^`+dkuwgB`tg3T|FpU?DlqS` zU_E6;y)@2qMLf<}Tfgn>MHBX+G%UI|c{e~!hqWm)_*0GIfQ0?2gYjD_y#af?vfXIr zJZHF=%@KIO&a)!0uF3FV@T}p(^4BqR>bAB|b+|4$wuE{qTrydioNBEyy7mwuX1IC9 zrsZmC`#WNWX{0_WD_63Nfao7F*9`8XGbqL`h`z?R_t5Z-w8lO2sg z^(l@pG?}<1RRP)J@)ZQwVZn;)ni0D?O zPuXjU5bjzTV8Eb>r3*2}`qgKo4WWnlS>yd-@aX~_IabiM&NW$PwT66Qy+%#oQN7fg zd|#RdvKXyIM<#Dq=y9lI8XNZHt;4p_xh4hyR|lumfuU~ybs7j8o^QxQA@lvF>?$Mn zbVR&!E1E7dg@Wr+xPrs=v2QkA9u^nMFZ@^VS>b7*+PQKQGuRIQPN8^_n&9IO9IS1m z1YoGhT<`JUVV<&tUu(LEKjqow2{>vUA&}~+oA%MTR8#|_va{LFSzp)$H4s)(0 zAs`5lGxfQg7&mn1lE$y88!aluWR4kHVpC21RgmC72tVxv-V++YfDK7${pO*s(Qe~x zEqulb2y}jdcr4038~!Z7seU9L!g}F&9j=*AkAtldRL*N62NB5fyos^%u!G0Txhav; zdBqkFUzlT^u~SIS`tzMN>9c`C@<~O&Kt28 z>Q&KvU3N@+-1B^!I4-BC5EiU2HDR8nxTtPAR^bpd`+hJ)mIFH1`higoVpji8T3SRV2bJjYQ@K2aGdHadYmfo z9u(YxWDt;8^bIl#29tTDbJt(~?MtS@x?6b`d+&W}y{wlEZa7y=NjxMcseJTgom=0c zE5`FDWBA|AWREV~9@d#gmif;ODf?etJ4Du>jltqZIAGF8D(Gapf`xrF(k=+`Qo%LkIOrHJj z$0sTac8{3YYUZzNofMUqEI0uXsBYn7yenHk(w6(Zf&4&`xU7`;H}Wg20=lS8Mw&?z zOVCZSH_fz}ct}e*>xD_wxENY{Z*g&BP-8-UVtbolYMIQnk$6TR>W+0$ z>2anSR(F%+MduM)M0`2AgNlz<(6MTob5F&zVs@&bcyhbOwx-=1NmU(R`Rix7s)b&P z*puYimM+c~xhJPJQSX!bOZ_A@4j1S$3Nn4-iZX0Q2s}y-nxk??O~uO2+uoL)Z>aml zib!#kgS;iKQ`D*)W>YhFK3jd!JmjM+pG2J_JEu_}%`i$KpSf)VMOBGV%QQBw-Dn z75MiE%6RYs0Yv+j4Qf|51;bKS$!@nXYn);oEv%Oo0%z#O49QiBWfzGE=)pm+4XZ&i z#h4R3Zd;oXT&m@7Q;y4b#lwe>@A&d)RiJr7h1MM^M;NoaWU_{t;HRL1sxwDz_UFx?wxrZlduz9 zyH-W6mN+`p@jTY}?BadslG+>g@jlV~&_%zb>^MPoC76|;!SQ(>SlKut1NH}tOFf8D;XcZ+HPO~p0s>w)%)y} zd=n}ovHK~g@ky$cZ=!vc(5x(V!plc*-yZ5@TIvXWBhD`I-8bFK@AnS0+TQe+(}Qe0 zj`EW1pjE(RBcRVFH10{BLk-OavxQ6ot|$IE6-?DlwehscFem=ne+J{B`w%y_GNE5! zE#r>jX-p(xh#av+@uB+Dj*i-se@^mb2%!{!7KY%vAPB0Hn`m4|>vr&NvB%|hYNFOp zl1zZ6(?V!_N{P>Qu8y4Jc~MSUL=qb~nFySJdY=2rRXrJH+!aB4>zJ>=MnwTi0_iMs zr{v{2pU_A6n%Ovf#(JD9IGXW{YzUf-MBQnup2Z~U51c>~Qwy_AmgV!Ne#gU;aI4ER zVgLZ*%^eWyF}?R$Pzkh0dw%;Q9=JpF0Yh9LUzIl0wy!-itVF94^wSKpMd=R&Wp3)@ zzpZuBl@e7wOhT_qd-1_^wVon#&9ytfJWV3Uc8!w@+&BsifAHqy?Bu4hTbA1Z03Z{; zIie!(l(*h!VwXUUtf$ksC{#2~f6##UrobO+z{~1v8PH!(=6cG4K&NR8Oi+*uD19oN z<)6P-<05*D7(NFk8-u&A|JF*0l)#Z6EtI$a)94Wk!flny1NZFc?-CK|zW48SxndkM zLi>K&m;X+pUyK*#FA$oJHd0N_u0CtT4{Skg@Fz$q?xwrs@lxzn0LL$~c|hYX-py5R zgox5&ajgHy@S-0v5Yl&KZ*6CJYE56DUirbVq>$s? ztNZu#86%(njd&@xe|s~&j(|w%P@3q0t|ICiMpJI(j8{|@)J5N3Jj0wmdIfA~32R7n8jnfh7DcRz#i?>ZzlU3(-tlt_(hvnj9C zmW!pqdE_K%%iN1#nQpNfuT|RKQ-7Ede1DLw*_!=uMz*G&7TNgq1ONzgKFk7meDuwzB@Vwrg35<9VMi zpRvtugBf({7R$YE^TvH#qI`i%d~bAdH19UqjxUwQZaiW}h-JO&-vvuNW{f_NmaOSg z&nR&*kN8mc5^H$O7pRoo1lINW3IHfZ{1Xdx2L)1JHk|dt8d_3jY581f~#}ae(b`0>W5K|F4Ddia?NlbK~6IDR|!~I5FG&k!YxK3@(n6 zHD0wmRk9j@L%dY1h$RFQ_LA{;K}3r6v-#o;IUF#R4L(?KqyCea-?g$)<~0x9_)vDG zJY9e46KvmIUn=1yiwr%th?tadDD{-j_jXA7bEf@to(4MGD6(14(8-FG| zuSaFbzvL1W*vSDW_ms#pKX5G#QC=O=>4LIM8TC+DR)^aTsymFob{{^G9`CW170vQFM==x)N4&2r7V{Ffjk3%2*m075cJpLOJw^XQc4w*Tno zz&hYhYa-u4R7GhQhT-I z^la0C1H+)=Ct0>7##Wx|BZZg>bD43et{QQhidm1zaG~+|3Lndv&y!_|0cJP3JP64`*As%y5|GjZV6zUVg=j48Dp!H1Bu3i z#rDV?9nUR{C!dK|cSy*-L$z zLS=c01!in0_S%At_3aG6mz{OgSz@ZtV#Dh=kBeX3tgHNwFgi*{xX?0Yj}m=PR4siu zrbajpK4rkaR-yz(SBc~c8QsXpl^PDh?hl81ox1c!U{`4cVfT0~iim-Eg}r7e6G1aV zCEl?GuQ-1VH!PowdAX*`6p}bk2ERCfun7Gitglwzxf8pWp^oGDi15DBjRB4+Qtpb<~ivep3q#s;LZFOk&+0QPu^9a-;<4#9f-iPYgA*m~V-}Zk_sMbi_feXx6+NcT z9t-KXqSsW-!EoZp65}i1m>@Vwa=qYG#JppxhOB{~2VNzIpU`!~k>jTohk5}yNy0Mb zH;k9O^=V6g40svU>qL!ZN`}tl{I>^Z%_cW}AcB%!&&a=LE50Ab3qrCOQFgS~g3nXO zl;ie-hssi1OOO$$-`o$f_ER?0w(S0`d2(PgcKw$tzp=%nog7NtQy>Ot88Q1C++x!@ z;?&EI)>f-?bW2XYA&4NIaZm0G5CA~ypZ7dW^mtkLIOk$gC#!$&Gr74x`)5|L=bY|` zIfH@ub;W$|_k7i7!jo;W$Y**&cb%X6Uegq6wvkAxnq1de;I~~gy;{&ra!fJ}or+;C zG{f!R$tiR;o<@*irRraBjdgQ-muR$~{tv%SigV`4Q1^ipd8zhu@3@rLOh2{JeZy)X zOx08RD`9g?=Ju$u$@ouKUN`yYG=P?E}PksO6pZ zstZab`r9Z9SmS!cJ0o6MNhTSLK@oS&%)0f=r@NE~#)@4*PaMfG7WWS?S|A6M%jn@9 zOBS9$f0GAVRDikvXqrZJ0s8WL1Cf)=7uu&TJiS1O_^_hRNBxPGtlguO|6pKclA9>G z$Tj<~f_laF73Nw>03i6k%0qNcvRE>VKKL)lY|9lV*Y^2mh9=(3zgYXF|8G;W@&U!e z|7Wh-k4$Y|k^kct=3)*wmNf=Uwwsj&I8@ z{sZjvn~#(~3D9B=ST#Scl1WQ;PX}PnwwNC@zMcDC+o9%R>j)xb)|~uHShYOcBjqon zR(~4;ev)T2$b!&qz8G4Cj+8h`wR(9?msEt59V%m4zWcFrp@xhLqON(rz`o(3L`mJh>aQC;*5oT8bsrfVV9n?1Nd_n^nRWzS?$% zZsdGd8EBr&OWa8S3Zy6$&D{KCU!=EdU?+Cp4+i0?S=|~RM$&*Cns4=|3aa3_56wSq zPS$Y7){c7I87n9>zXIO2aQY~J;HkXb#8T*VZwkrnT{QjLd5fA;zbF)4DgXf7OuO<( zIjP!4$l(2OyS~_T=H)1FqL96jPT9>Kuuh-RxX%7z(VD1dwIj6I?>XN4FZVaZmd$_~ z$iWr;JY=Ww#@a6n!tweN**q%<$uP@80Y*&Ry8%BA_C0Map?j$Yjv|DydtIisUh}^S z4M)-2yC?eui*ZS@d}a)3i`lq0T|~5ZxqND%^v#al^Xkm zZBn{{B?H;w2UMRO=SpD%GRlc%%DcGB%dBVuU!fjyxNO7rjebEqmJvWlx z?w8+B9Sj!hAYlHg)ZK=qY(=n?n(XZ-!FckXEzcZB)tfWDdJ;IubN}YQfVoSuJ{DiZ zuj~s!$At5rZM$c=gLgykWcUilpN!q5D#3PFa2oCgW-q+@yR-&>w1j+sy7^r~(*>*2 zdX2$)j8*5Srya=K9q*ZN_adJ~37kBuG>dC<-9(*Xo>0EXy}pyZoEP9UU(v}o#)ewy zFLeI5OiL|F$Z8GB6@j}$`-HY#;ev$&#ZK}K2f!3IB!zow0`IQ>;`=1jwa{Nl*Xu9K z9E)rrhY^53;3AIv_@7+~;Gdax0GG&Dl7KLpNB_=26aoLD!5qaE@_j7;z!diXw`p!r bz%kGvagrOD7Q;#&51^^8qgJZ&^6mcu=N8^g literal 0 HcmV?d00001 diff --git a/assets/20210329103157125.png b/assets/20210329103157125.png new file mode 100644 index 0000000000000000000000000000000000000000..0ef3b88bb59750d88c7fe41bbcda051cc00d1b63 GIT binary patch literal 10673 zcma)i2Q-`S`*-NXw?-uF5uInVv%d9LfeKlkTaPo4-(b%i^m45R=6;Es}_oHhV(-4uW9 zbek9eAS&f0s>Tn9+_e>C0H}V(4gBD`t+bjn08k!7c42t~KPGWiG;#+3$lC}XqE46m z*8l*oypo)>u8;XnMz7~qJ$cxOV&VQFCvEL*L5imycbIE~%)-c?1D8QwWcF;5D@zc{ zuZl*8Pb04OR(y0=Z)>9=ly|wB`~w49On+SZphpA5U`+fcYhMKIv3n;ctD%?G^V7*S zH%NF(%HFqxmF{eQyvuLlU-r=Xk<_}2^n+f>2vHSGR`jyqcCE$my&NS)`+mwBYUkWI zdtQv@GlSfUUfhATdzN#d87;rYv69ap%qu1>{d0u14`+u(er|z+#}TLb>7Qp+x1Zk$ zP)bWq7JLUQNywcqeRDU#MoF7hxCEkzkkSJs<+yzK1YKZI6^qM_;XY2ZXJ;TvhMu<* z%`jfY`Fs}NrwJk_rbpeEWNjvYFikE?pGSfHTzwt4cjJa~P~^ARW3o?z-4AO#0Gg@f z#8c`z4&tmnyS>!wO{$TtxK{kn3xf7-mm$$~(OjapJh@5po*BfjDS@CLm|T5k)90a_ zxU=~y{*(8E$!IWah^<|xLXwGAQldL#WM6l;*EfM25{&K&b%&qz2?1YIjJ3 z0V88(chf{y(bOa!us_=taXH^ue&mM5YvGJ?e(N73Pj)Lg2TMtQv6C4Hb^Jb}T*{K2 zK3p$`+%}Skq%s`_-XKM%4H|jpOwK++Q!fycEQ``WqrP09N&9n$2yk7Jb;(X7m_=4A z&@hR{HT_+lvhdnXei+9oLsc%LM}nz5~PkY&q&o+7V^0h_oj= zYoCsbF^(%FE3CSe}6Ttm*HZ`Heoc;P5Lw>Fs7#F<5z%Mg z`|)vKwZK45mSQMZ!GS^oPz#wnvgEl5)o69OmV5xHr2)Z*k<84R))VNL3M@zc#AQmEjDnK$)K@0BC{-Dd@*$D|B3kF## zSU04#QkZRItgprN9UN&KEU0~EB_i9zETGt&a964LMo{O|4!V<9^F~j~nMvSzR_`TW ze>NGr?@YY^_?V|qK0qcQxF@{%Ll(M6Phs3dbV&P{-Z7$iy>@_m<5klWcJ0EXTE-v+ zp$@upml|Z;vgn;m8cF!*HOjZ6bP+J-_5r&ji-9kJdT-1jm;B!Dtc!n~?gX{8(FRZf zG~mn-hU9f4p^vVkZHA5P1}?h0h`2uJ*wB#;XAPNxx&ClwZ_f3qZ1Y|fqJ3apJDpnR zfE#F8ByapVx_Eu_>loJYZJ_PD(wFt0mSYh?UoY@vEL+&y_zb1ds|DAwFN+MI+;Ext z`?F+>kb$oDY&+1~iMicB(i}&h!WZX0p$|Vq*n9bogKos}bC~*zU+@_FZ|fsKI9(Do zAFp{6DcIcjv`dm->Zq;)SAwQ@x%r^hag*WEyaTprHsDcL#aEq2DyEn9e-xkyDra(w z-ac3*c$?xxVyA4;6wy+U+YPze_ncuowUHL)y`L?o2OqvvO8p99Ga8N9KlnyLYh_JM z(x#o6d-_RgTF_(+U0PR71QXpt-1P3@N|+Q# zh5Q>uYcxA9=M8y1W9xxc$ZzhrG}z3d;>!#!jW%@gX1-KkSaAX~L`i)kN}{he&Y<(_ z)MCor4sMmqAfuZAFp(7en1()-5_^q_-2MqA%L7bl6i(&f+HoB>)39*ede;gpzNaD@ zwi(+UrZ``$WSq6VpodO)=-yN)>(%HLx6DHfCToWPOz}(^lk4B;<|vGpG^9=`NvU#> zAAhCX1h}A?p_|+;`aEncoD7cm*mT)zw7WWkPS9gY`7kN=s*=Cm8>jg`I&%I+Fq!_IqAceQ13d8I% znEsKS8)HhoYs#AO*)O5tCcuY%hEB__&Gx>yWBfGkf8d$S`Th3> zo+P{wM3tT?AtT;*M5NP0yiZq_&4ZABl{J0Ve9Vn8P6+4l>){f3z8)yFu2oBlGm3;k6LWa z7`hra^78yw*QhuAGP3>isYl>aZC&8i2*`Yc#|39ZK-~Ma?1D~L8cALc znsZI#p`_l*0{#rxr1C(tP?E`1aY1z32B(5>Y=^HC6qH%Cz~ie;Nk`<0zq(KS(;@ZJ z{CLrs0mEKVXZI1KJux*xxb(}1{*2$lWLBw+tCP{yPu|7mJrTLqSch3F+b|Vd@4nGY z?siT7)cfw2zA3QVFZY`|aEmD$z_&>`12j&7t&($8qp?)%J-PjNv)iG&7&}Yl@ng-DzVv4uNCPOG=kovk@RaEu;mK8MF7unY?6Nfj#FsvlV z;nE*+>mbdWJ(ucimM8X$qGozt7SdpA>|^2ME8)`FJ$ zrjVawfg*!ofCSlE12X8Rob6AZwao$6zFbG+LkUo((%9vzUlahq%SVa8xLanl+_Fi+ z&vM)hm`fmx6#j48_t*^r*rUEfg*t_W1;l&R)G6ehYuW}B6R96sH?^vlX~_Rc{|9Un z`4Wo_@Dl5`VH?5ST3Vy46?!*m$!!BAUPa>#IU|8cHUnyr{xC&$ z+Z^hx_hck2sXGs)c+*_gkG_aa{*--N#*rRG%TO{u3i?HVBNqO0mab#wBd@`Iiq%TXq_&`#Es0(`)CiH6je0G=&|5S zS)LE5uF}YLPbQ{j3P0w6fR&Hq>aV6shYe&a8z`Bg$8w!grKmO&-7HX3?Y`MeRizv2 zLQUpXt0I0-c5@&`S(Fxnm2(Ni^=sBxlSFkfz*PZZ;NSe$=Cv@ zT{qifj27sU#qwTg>&ElN2Sykg_yt-`T0UrWn(G`ySo<0A`t0xQy## zlJT>6E$V{fNME<__%0z6z7F@Ng}M#fcjsjvMzZ1F>kV?xRJB)xw(we1P*$d%$lp*e z(sV#ndEs?@)95rCviaR6zP5Q*o5X}a(?aVFNoE~Vza6ALG$M%1$I630paFmdOI?&A zOFgwl!t4wrJ;2`HWx!*^1iA3aZ?;iazqeJ3O=xdr@pc=W6N`Kq^A+IpFUOE5N^ z2*chTvGcgwGNB~EB5o4gjXRZ7Z}p8rR@|o>v2zZu4$A!k-Wmn$77CZEWQI|@knvSu z4L@VwTEzc81#MBRzW&J7sy@or!}Qif@DE~VH?0?S?k$6G3hdq3**)?+QR15(Gf5yb z7unLqM2;tqcYw8EU&z6^ThZjERDb~)56G$~Yaly0MW>VuB;#|nigb1xdP^ah+ANlV ze)BB+-mg`%T)pBzB^=k1%(6}2f9Dn_+;Y&$!T;Id&9j+ zIR^`74C4~!GxqDv7(g5QgV+w5EU)us%&<5gad;=!C_59*n8qdd| zf@z+7I01{tpOI_Iv|+rg45R2`1Du9Oh2o&toyZ z;fc_Q-Eb*c-2}79o&qJ{WpR&)X)NcuP8uXc^GGIEL_X|EiZs@#$=w`CJ}*AE0o~7M zagxWqv{ygST>OgD?<#(!v3Wwhe+@fSA-yM#K-z)j4p zAlpT!zhT`pyw_|<8^!tlh=u!e5jfISJvWQDhWgo4`s#U&KQnfD_(&3?Q-`d}K1#{n ze*qpdDb50g7)tE+hT3G5;{-x`B}>D*xIc^BN`FHP2oebe4&TboVbcqDAtxH<%kGn& z*Gqo%5bLhe#?wf5CvjwdYlEjW{P1-+F?ox&*{|seC3(d(Vw!HsgC`B?ub=i82}FEAwxsO+(-F(Epz;Ujt!@%;NP6rq2U~0oOiN@|MlK&G zuPetj>VG0cNb$70@L_;>VjV^jWzBtP;)Flik*ys!QDr;VKK$pX`qy}tugNt|UTGqdn@r-q6LL?oI{cI~EMgzL=nMU>sd z&9<}h?SU^aVKM+J@qlq~0w&5p@ZBPjZlRtwZ#dy?@N zXhON+(qZ;@2KOI%Lk#?seeEjrypMf1chtiV+u#b21R2RNvgSRG?foIUIT~* zwO%e5VYqwd2U`r@)MUqs6+V|L>YLs;G^}3SWtSa96VyUg)o(=w`l>5hiwn%^vP7rV#Wi< zYmC|`K8q)D<2B;DXk`PMWOh}y4GpH;fhusszK?#c-f5iITsy6vvs4Fms_FZ#p9;d{ z{HLl1q_v+1>75HqHNM3WBVJrjjJh4f&0fzQXcVG4=9~~E=soc>KmGPAL;yNPA*S;-cYaqAmDahw*Vl+yXjimed?%pOe7{)gKW!^M; zIzn9aP0No*svh8DdL(k&SXW)m_`p`LdJ)bkjhN!!e7`C4w;rTkL@D0-wV^sbK2%bI z2>Z?EK20rFx@`#3SmgLKn_qg@>;ZVp>t=F-=K_HMGqkh8K9P=T&A@u@yy?lcxQdt8 z@s5=FA*~+oPJjhrd?|_VP@?MDJLC*j0-CVukyXT{dqpRCkLspSC&B(PHDlG*i>l%~ zVrk=JdFH6Vx44?s8`r$q$Nj8DZkfM2_+Bb{e1q2D{ZE9ow}ams=c_k^(Ld|$#0=&a zC0kZ1wgbe@uuTjZu>KZA=Vcs958H;tH?)9S@I4BWhrWxR9n%ysCjJ;)J!WF6kAo$W zvIo7w_|wo0TlvYdy#FRWDl(Zmxs?JUhyaRk9gekB83T8`Pw4h?Td<~r9s&lXl9HgC z148xj@{aXc(nH8eX&1KZs-oo;muso32(+K}CWqcd_5DqSO)Ik|Nuu9yJa=!lh zPGJteD&8Xeuw!4w2O|DpV^8B#lX$i*jvG>k)r*=gMN)AiMc!W#f5YI%4%y&{9wYDI z;1t(NMRI0e=sS^K;8U1%XyK>!BCa37=}EXcOiz}i8Hl?8qZs_jRA?>fo*6SphO>YL zgi+6)OUj5iC9^x_e42H<$K&>JB5!!3-eBwzuKEv7r$U67#vgQ&V0tB79u5(ctKTRmke=-^;5=u89xDSmad9FC@UY=v`Xk zR}+vc1@n3X>X2Eo6lwKR^LJ0D30-OsIFc~`o766gzS6NgnzW*1aEx?+mZa@XNWlp` zg-pUsNDd@9=7vDdYL{YDV#c{Nm0H^Cxx`CJX_wU8qk;r2`@RgPXU9sTHG{wQ_S8)f zav7&&y-3{wscw^<;)i*49`<>*&qhWN54~$8+4C-B-c_6I(1};q3m^O826tHAiGWH9 zdscT|vt3MA4}NiyuIorke72{-wN>QMlfQjCWPYsJi_}x_HAYOY>ANOAPXjLA@-yF6 zP2e7;bx#`L@|QMB{du(WSYTPgY`}5ul2%&XR4T7t)dCE>BNHU;C+_u6rpo9@GT)_E zy)@O3i4-@+b5Mq+cN!WVJq~)t!*1NW=A&T^wpIPHbeK5<=~yahg=RO}ti2YPeQT=a zQiaO5Zkg@R#F=BW8z*uyaWp<( zhW#xu++I$}70;tTFl_2!#zd1)Z(lQvTGE<@A{@c=fB-ij2oXxK69qLkR?|LOG0{#c zpJ9ZH@oB)tYQ!X+)%;9^GK?xoQi;O>p{w0q>5ML?i>Olv{kaOn{ohUGC>6GZVM-{ce{ttki%g4F zUS30YuSq+v&e(TCC5abT(#Y`Z)K5Yt9l1VKs>7m&v>q0mSVdvnN8SZk^X!gIKlwID zW1RO>*-5%amm>tCFT!bERNf-l%P(kO-BM%WNkLvnKel&vHArc>3AyKzpjt66q~Xyn zm!aeArzR}Nuu6(l)NA)wwTIeuZLouaLGUsRS$ysuZx+(9gIx~|^_1%!mESxm(sey%kIJZ+I zk5C0}0`|qW#iEp<@}nYbE&iC^OAXvznA^##w+{G zj`6Iz!<=68yv~0v2RtQEDVExHVoX^0wZOHI`2~+ zarZH6NY^k9HVBcM?MJ~Hu9S?OfT2Sb2;&{PsnZO*IDw?=*rvT2j?(G8;}*KV69veZ z6D(`1#@!kjOjqGmev?#UWM`e7l`{T$JINQ)WHz0mT=XnOBT`ZHVD`Jc0z@l5Sq z6Q@S5y$w*+Yt=x*Df+Dq_B~bXj>O%}Go1dfsS@tQ(>=<+`h%Vj@RHmAr!w6`e`L@h zj*tIVj_NVXHkB&-vld7f!J$7{DD|Kbfr@Ble>jtsRp^N{`*k}yn;j7#-Rp28i>5+bJ zY7ay9Q{z%Dn)Dif)FAUC@Pnznj$5IRUCz#GW;2!FfHd`tk7?Ele9IY8(=JT7p2Ec* z^`^8CWjt!erwUWuwFOytP(e`3eaX}RirT`?5d98qZ56KW0)2Y?0z~L#@L8LR5KI2L zG2W5aS_yH0Vr3Gglkv6bMah6E&Z1{>emVXa-;Utr^Iu07@(=G8u=?;0ck33U@02mJ zvwb$@l(YG&34Ou>Y001q&ce60crm3SxCi}edu3|a@9vzh{8n{hU%!5ff7S2YFJnSI zouq2}%js1&h5V72KySQr&jDN%yDuE#pf4qo!u-DmhOc07(DuszD>QsI?wQ8H>`u6! zqRo`P_ph8Lu48H-1gRjd) zvzth3s=>*KUzyBy_!gBQqJQ`L-($eO1R(&dQ@uBl2#c&oeakr&Y`z#WM-kEuUVNSt zmO?t?%V#m&;vMj8*1wnp-^k!)q4X6Y+;Gbi>(x?LB&EsLlg2Zbq`xd_o2%S%wYqPQ z4!QeZBSFJ&6X+`mp2F$)zP+<2MS6lJQp|?xLdw*MaLA1oV()8|AJpEYJ@In3wLYzka%srBL@A!m}b9vBf4+ZKx1OMZU zzpV(sX8%K0$jT-u|Lt#5)z)5M4RRl$CM7ktR8Yx{y`E( z|DwLI_t&D$V^QXmgrnuTXo*BYX5!A{yxoktGtHTz8mpi$nli>#s;P$*LcS*tH;K8A zxu+38+vhH|rJQg41>bNRtCEo*`nqX#q>sFKAY>x-coh_Z@G89#h z{fF1z5P03vTx0y_n}1RNb;-{2pEdLoczj!e@;adl!pjUjAqGhjn>~BT%1QYrnspep2Ek>%%B%g*jH9r{R_@U}*3VA37@-9Z-Ngvy4vrumK5 zbc!Gbyhs>qzBw=cQJPC8{;@u776@e?YLF3h{$72x7LbnDO zRiB1=PoudxU_$c<%aXEc_!;)sN6=8S@!UWEM5M!uB&JJ^g`D`b$dX(A*<8>q&x+Ys2D7 z>98$iZ9XZC$M@W{oHw@gvSiHIzNM(eM-(@^=6mpvwCVJC`~I*>lS_N*BRfsBo!6kr zZKC;*|63!rUL*PSN~ic0+f}6#VTBjsgn0Y)pEf`;Ip)bqke$YOzfz%894lw?&pLc-(iu&u zwAmTmJd$5yZHvSaW8Au2*l-{jS~C1wZ3L<=jN@JSC3|r0jgq(TRC&+e4zg+JjY#MS z*XwBJSzS5AZ+yY^RBW9+?2`o|S`Uq%Wwc zcnao0B7!f3hg-6B%RgNii4dTJG5wo7XlPS)$+^E-I&0Tm6iB{fsvNK$HRkbgm>i28 zZ&@W)!zPxc3yUTVP`UMuDPezJSevCj%vJpbI+5QRdheEf*(lo-^_uqX(hpqv|93wW zrGI5`5HoxS{$cJ=Y^XHk9@20w3FOf@SAg%2jHNpL_^?VXpMJzN<-$WR1}X@ix4(t2 z2p4uv`44$Am|J1d*Wl-^-GJe*x@sHa1?c+$b{oX&|ALNI0nkQI|u>ybS&ypEQTt literal 0 HcmV?d00001 diff --git a/assets/20210329103157126.png b/assets/20210329103157126.png new file mode 100644 index 0000000000000000000000000000000000000000..f524f47beb52d82cac493afb50c3a39e89518583 GIT binary patch literal 11357 zcmY*<2RNHy*MB;-wOVS_tWvFAJJe`VyR`P+sB!0WWMhGjGa9Nbz3S znw?5=Dbhrhy}rBxrio(Y*T|v!rW%b8A`p(Yk#U$KOR7tpNJFYoDmthmt{Fp8xP$|bnyXIBkCGoUhwVI9@DJf zoe92mM-i)&pLnheAE?p6GLoWAM3l#|Fl^g^b}i2xHPja<2cm96{e zn?@uXTaRZ;FdtqTc#nVDhk-J`?bS~Mx-EW3ARF~c=?I~^<4cZhKeAf*MTi{j0=hRCI z-}m3CM9~mfn{Ka56GkmKb{(&=ZMeQV%*34sK6ef0UgA`rL@%j*xO9=gYSE4#@GsTx z=8P5Q{NN@6x3*DfcuFO+`P%Cp#uGcE1jn*PK0NsyqufQv^e~iZ&?T{d7x`*T47dht zCuJqc#}K(MLEaImg}I2iNF8Hn@|ISsa_{)=dTQAmFp_-TmdJaWWTV&u^<%rFMkK~g z%+1qKcCT~JLAdgO;Eo^A=El;g-0p{-39PoEWHMO7(O-cq` zqC!Sbs3=^*pi|k#GmOZ^jzxayhe7B~(;is_P>r_WBUrO;?fVwU!Sl|~pB!qbnoU3c zWW{}mKG4u}&OV$P{QP@I7($(x0F^L$5t=yi&O0^J(!>)SqR%qm%I9cV?`F=gyXSUy zt@d3cEa`4er%5n3^3Lg`&xZyOHTddYD^Km}M-_9)6HHoUT0lwOQew`Skx@$o5z&+i zK_9SaepsprEPC7NdK+TO?P%7Uia-g)6SU3NZpK+3KnhGn zM_!X=%|Cuvj=4ABJ~x5i1%}T+;;80*tLeLJ`s3mO%5}_yh}YJ?002~jJ=^3_53B`u z9&p($;rrW+QH$)>75X5zJXyrCi7(cTPcbjJ^nGisfC0Y~w>e5=XBS63GN z#TDX~EsI;)?Et5dP2Ih7g@AdZ6S??-;ZUz-DS&jl9L+02g?#*AN$3FPj?A&FjM8QK zN_9?)2NZ2XlHI_7CbLec;wdPGeI9BP!uHTpKAV*xyK|=0=qCpS&iFyXh50Zmn}DjB z00KB*{xUt&oEq+Bue5hx@P2b7t(+ZVq}kYGPIQT;9bf-AV)+KsykQL%DAj2v4&1}s zk8%%FYk3ft4cF^N`IYASKUP+(T7>7-b*`_I#Oy&uGmP>|)ZJUgLt}UOo`$RsxlU+q zFP4N`je}i0!e-64o+IJld0&qN`-pDC9_VDSQ*vV`$Gs~d^v<~_J6ifzZ9QH#b(43` zX1#XLb)WQ)U3Pj+0v*lD3dUEM(ENSXPa2+xKDA(}1+9>63Sn3+*ETWvc z5W-xlnRg>B1%@m_)_bqeEUL3Z13M1F2;yN<%#H!nPCWglO_*TfxOMK_OePyjs8oAQIjr%ZH!!S5ju z4Y~FS;l@J+Yv(}GxZR+FjuQuoOMuX#^InQ2^6~L6H5Zuyzyu5kYl-8{nJYwjbha2y z9u?ytN5HDX7bVtZZetCf=lolZCMIbCzbQl5kSQJPeXIN!YZO&Hk|G^Pu=uPLFaA&} zYZH3TW@&04NZe%yJm~l(`ic+}0*L|JSDM4M+o=ZcD5xcUvA70UKzt2AGYjM!vaQ`$Tf@7{jESBLot{g?G!XzW z6S=63N(?J{LQ~YFxRF42@l`BaR`BizWQgd@CXw**cu?Rd_cGrS^@Rp8Gyn3-F`$SI9v zy5}l>@n#4cV4MjHto6A%v`%#y3j~xV1hD~*;2acf#5Imp%NEtA2ghKR_VmyS1kR(( zDK5ag#pxU_y}En2v1^S(4J(FcYZ|)8Njb9^>U^F&KdkW7$nb*)VE(e%KF~ktATTP@ ztIU-W>7G3z&w8@IGf2%?2J`>(#Xs$mvGb=RCygvYjlgEV0+8+|ZkFhRb zGk-Kr=&&Jvj4S-L{QM`0sAhlG**X2%)iv>n4dWEt)ap^xc7LaP;5VQCR%fu8yJ6hv z@oMvO5c1?bG~zoETZs+NsFe>=^r8)mu9^--dvR&+l`8kl?klk6zDgMjbRMmR{!j_F zwhx^uOg}knR)ZH@m58NH3j(t%d960;-1lL0p^pNh4^`hdKNW|XTpJ54a77sR)CJtF zemxjzY$D?bP6f-S)qWifsK(#8mc^4c0t>fZ@oEfip(!nSFRSiQ{K3s;;w0zp#z>4nB^1w<63?rh|t?60xR0gtNG>{h<^oN^uHtm-Vnwbp5}Tf*GT`9Am9T=!95 zQ=B`WMJu&Fxu)oDBY#?TCAi{BC?&h@#7g1PEJ5$gGEI^DIW%A>q{rGt9uI*EY zOdhC4Olsk(h3Mm{7vSW*kN08fI*hmgGq^%osfKtQ`u0GUR`TKUHHO0jy{w3XML(Qq zcz$Tn3t_FY1i`89yia2vb=5H^=O8-Ln@1Q-Y;&CpwPdvYqz=1rTp7Le;m6&vX$RfCP@38CucE__qC`Hy~kF|Os zpG1ZnZXH%Mm}F+%AqECp$bdxB1?ZR2+9^LVAUL>9Bxj%G))-`{}Ps0D&`khfKIWJ! z-bx)TR>L*8>br-Ps?aJ5ACQEUbuyH}6w%`^H2&BYL(<>GjDyMI6_l0fm5b z-M*CN=ELTmie6>5#^JJ@0$R|4TAkk_g)#u}D)V@_0!V%~A;umA0JKqhD?`>-RqRi$ z=bhf*Cko!(qcs!;|H@qEEDT<#gKY0zG?Q1&^FMEO#aPFzN}}_sCwZ=Y7~`tXD5f!m z+O?&@qt)!k!k`4TDQ`&3c( zkNc31L)R$)05 zW?KnwWOZggDvBQf*m=`c1vFhQ&i_KE*eBq2`3hMP(@kZz=J%i@+q^dcmK=R+lZNY2 z_c-SS_C03OO}DfK$df|~IAiV4Nq-803h&7cyf%e=9JjW13T$ROyEkt_{@8gl$br({ zE0Gdt7d6cb)5!TR|=)^k4yY zG9*iQ_}jM2Q`NQD-m?42mNffP(Atg+3}10y9;5> z^zzy-QL0bKF8g`?i`^m@&3M&006=$$8pLuhB#OTMuGn1QS8oJ4z-`LARY2&d7M4L7 z5@Ute<)j>-BK!Fn$VkSZ>2~B_3=WkcM}bCxN0OeAbF(W8k%n9-_uZNe?82-eR~*l0 zkHv5CJ{9KxZ6bw3s2{e}WUczarJRK=0cd7#sYcH@Xi1tV$}OC9lEx`Y?uq3j6+6g1 zrC;3+QE0*M%79Xaf}Agr>so* z%GSyCd!J+|Yhsikhr!%Gt8>$J1uwZa{gGT3=pbj!t8wwaCyTqb9h`<~Oa-)5Ijd3q z;Yp-2M8aVb?8(DMannP6L5;(i`G>^j{zitxNF7aoT&e6ZmjSL(cw;?Bmhu*JNkAj+ zj&1Y>KwHuAFs)%#&IijAssV1<1q#8lcr<0K%AQ4Mp67!n2i&)H8^sNQgy+UMoHQK8 z;1!GaN9w1rB+t{<1$#m`Y3}yQJ2k6eUV3Qg-7potSV`t;Oc_p82}& zH0^Y6y)s*?hJR}EMF&=%n{&nwA2}_?^U>tJG(G8}nU0~@efQR(%Qg*myP|rf4Fw~WTo{&LdoGB^D!?)XO#Z0yo89`aS&}&sCuUqV8cy~L| zz21~H`*xmUKr+R;k4z;e;rTsZcRx@#@TXQyeZUZx4jf&LsgIaWtDn+8vaH zMflyOS2wxLV(To+CD&ZW2+eeBMjp@FFHBtIilt==id~4097ngHO=N5xa*El4Qa0qK z9VeWPL~EF{{8HvpeqMLE?Rapwj&w@C9Li$p68cWUbGFolKwH}n^7C>x{KMrIds$B= z>3&n?9=x_rf=A~4ToOYkchi{oz^_?OHz!UpOWS@E9Fjf$6lJ65OjNV2y z-|=)bcVo?Bt+v%>!#;U?P|9vF`+8|lUtTDp$mh6bAji0#jc>~T$8s>SmKJGk^)7JE zsBnzaf@n!d1H;F|>zapMYwGX0#(#Y_=tyjJ+iy|m3~Q?iUx=8heaQ)HW)z{^T+X_w z45_|XTk83A5w4VR_hcY1cF68w&c!Dqzfd78D8F~MRY0l3J3~o5QL#vz#@0y=>$sU&^Njn(v-BDkbK;Dz1o%Ks*{mJTPTthTRN_r$S$Jg7j@3p$O zKt4HDB2R5No@{b-DEi zIF})prGNY}MI+~d|h!xF4C6gHizX$OjxV*6u#5Ig;Fjk0$cwjp=o*3eYX z7R3Fb`DSgtpi?#Cxp|Dm%I(?lIav4>>vx5bydkTC0g64RucID$2d75h>hoL(%_8in zu?zAsVF|-NzRFRk%vO*RI@_mFSeIZCS-^XBsUkuX`h37Mjo_2~d@RK6n_vn(?*ZyZ zI%Q*1l~(~OC-b1{YMY!JV$CjEUzu2)Eu4q5@+kCvV1iT4Q zcUt2GCDl^Gv)(juk8mNMa!Va3%&n+}2607IEN!MpWG>J7+ID~NE#cBN_=TbA$P(F? zjS;HJN#KdpjGtJeeKYNYZfsGn*gn3pSWZfe8 z@sUe%%b<}C$ql=1DYHIznce*p`VcuAmFYgZNed=YU_=Bc!y~N6^Sd*cT=vgt&?(3H z?=Qpf;ps4S5rL2Dd?od*;IFlZm_-mQJD`Mf^(`r4YE_sPM zHf4pShNo(eSgn{a$3Ckb{WY~jMt7XxcK?Oipi|SpJ<{nbcS3)dSO>Yd1wMmw4f^hK zkXZ~s7oDpNSyrWuo|HRDFeRVVqf1X81@tsk-61{OfPcjxxOC|;L0ZUwD_R@y7Ar}*X)o-t8pUn@2 zC)|I|<^3QpQ1{g*id;_sx^2{;TtX=U62&#B0=K4=51pWqkEa(OiRf^>&E|13>PJY) z(vs|52eWvtdfwmm=xL!ms`|*3kzeJ8@cEzy2Gb9fY0H)xhF6TYd@~Sr=HJOy{4t0EnrB98z_ZGZeOX0f z7o&hgjm1?O5XyN8i?Dpy-JPZkK`~lWoe{ztLDBY#Qj@fX+djmKb$D2HA9uD_4qMFl zlVvhNd$v3h7#6+g*|QY|T#lRSRy3HTHTgSF)FXP|MyIYo9sqbWvq(c$1rU~EL;YAh zBaGS1eX~?bX!9fD~_%K2I5O34H zg>qY!{W95)_>v*5LSB1Xn*&AuXo`2G0v$ve?N+>}S0s;H`N*s|iYG6a{_^uU&LzVI zX+E;HxnUL*B;pLxK*6x+@Avdd+HD*QkMa?(IDCs2FcNIsn`gBGH`BM}x4dmhev$8` z=n+jH_FA(_Qqr0QbcFWMjW)$OCE=H|< zEeNX|C#Mqq`ayA`#GagWrv)QTLB{3pwrM>3FH}m0ZVTe^ zLx;bP^uv&3*N3|Qxqk7V>ttT%dm$=ygPOb(0UZ5gZbL@t-h3o*WTQE!rD3$i96ae> zm>b;6Z%GDir)Teao?nz#bLWfblZ<}mD9%E1N{j#7oX1hm1({U+^FQ&1uR$WyomD2<4pHVWl)3K-k0pk+cKGKliwAF}M}{F@VJVMlqLnW7>3*OYwOj-Y4#1A>u|Nj!mIjtZE| zWcF!M3@7y`Fq0#kJyov^@sv)Q*mUr%NN#g0`3fX`7LxR@sx?-!+JIhfHH|VzebHPT zWjU+FjQW+zD&%x)oY%FsZGkKP&+qe@+fQkn&fE-?42$Nrk9`pQabA#0vb`MsKSXUE zIjAb+{Js;l|G=&p+55Spy}ca-q^rbvCBm4uUIsRAIf05H4=VMH;+r)6#-7Mjd=&kp z;I!b_MRw?wu|5^Zt^AvE+=HHIc)Wt(o?tvxL_5&_h5a{38*Pk3^_|3^XzpF9SbKeu zJ;9jJx*k^-zw4kJzQ&0-!~wo1$Duz+{2v|fj{-LO`9;$^IljR6>t`RXJ3XDg-f?Q< zU<;KVq%%a%uh{6^LM_Qg)x5JcjyXfHELXN85%h{i3+1LJT2)C!F|U3*LFf~e|M>yV z_|p`sT9paGcy{IFzN?CIor}&E6U$j8l0-2QFvqW)v+yLrv7OvWDH=qaOE%s1*UQAU z|LYcZl_5Uv{-C=39@MYjf0HCoQt=E}fZY9mozy?**0$$brTRog8Oe9ZLK~q0F()@f zGa5JwD*C~(#@)`VBKJBYP$P5PrA^q{WaO%av;a;jySU*&e`VG&YiaPn!sEf+BUi+Z#xBKJh{^1=g7}*VCdK<* zWunYaAohQz^~~}k1%U;>IZME922erRP|Zy7JTh>4qc2KLQ60g(#QurtxG>{sgHVl1 z3GTvLQ~=gtv{}7~vld1BC46=&#T@5wuk`5N!1#tI`To`zZJE6Rsbp@Md)XLWh3VMS)Rlzn@Bxf)Z1&YmtFoS>9#ZCToV0Lyk3L zK8+mq$md@b>gT2!+TWDV$^|r7(9ZT~4rlO#RqZ=zDs!1V!v#pMG~JcNJMQBb^0Qe4 z`(zrhW5MX)-)jyk`&-w*bwzRJsY zqx6(JX;R9be$^^6e^%fssY6+CNFP^LLk|z6ID|1cRlhOxvuHIsIhRrs8Qggv@1Aqw z(9|4-A1eRxk<^A;@MHVjaSJ>8n0xtVNuan()2F5(srxq7Tjg@9?*c@4tvsfGspPcV z?Yz)pLd1XB#+U``TRltgEHO5!rGc$z3KDI^RT&U`MPj_n9>ig9mafUJ_lJMt3cpu_ z-C}cI>*UAE1~p2w{PFbEHYhRZU#4EEG`!|Kx^E-HK!GqOkV|DuA?Cpcw-oDv&FWOG zldoN6k7Oa0s``NZH_x{ zus=6&p`M>of`7&D=T2c|b4ik9i$O`aYh$Dk&}`u60S3#-#ACN-m)LSY%ZT(!U_`7l z+UVrQsKLR0-Tb4{3!S6X(j|sNUl24IEe12C{*fyL`(w)Fq)8gwq+WbDQm| z8R!ptF21=?uS#i#ej0fzJ|~>rNgMS}-8pq9vKNWC_p(#Ky|0o-OX&4vj2h}4m8f0Q zoBSajdEk&lT&qDfgJv=b3!caPL8eDXtPt>kcmg(iPVqIHh6Qv7)jg_v? ztb7=gFbS(BMy;Dqp)oMmla}hEBIU2_dPd+Ia5CDenZY$-FEbtee2^jKCuTB*4AuqV z@2{cx@iAS-Q!=027xutc`IloqIz5Am39q_(mbDZ%Z>RD*?h@w=J4#A)6$@LnMjuKy z-zru_R7Miw{^*nA@T@xaH0|3Q>f>B`$2pGnUo@BL(}wu=66nJ==GLS3Xnmzm#E+Dxf+z&9_%PB$1iM>^Al%!Cy5 ztW2@b`C6ar1Z}WUpvmlt%%F^oGCTNq9W&HWI2>E;RhC%o$h^nS87{}m!D^Aq9nP%8 z?>;iYNe`>e8ZYwFPqM^gxOZp#GZ;T5Kje(va#bK&XuM%g9_0m1s|GXZ-YxntFxO|F9cD*(D*WMlR#erw%CcMPa_0#ojR6jow~0s{(r zoz&^u{ap)hDmFYe#B3SNq@|P@iwXB7`hnji&F1Y7!I!Ilgv6ugyx@hQOhwDVRaR4n z2~OxxwY`rXu!>9K;dy((_-9|<`TcaeCDt9wf3#aq7bBb$ZNl=`gtm14WFW;Bhh$dx zG3%23_|v2}{ZN)B)5u?B0d+Zx$-wEX z|D?>g=znn8xyX_X9C2@=9NqBQx(DLrj7^!z;Gf~P=rGq$C+)$5&n=D`jg*o9or!i# zkTex&!GIgC^j0e%0~35eE5ZMCXB)fI<$Y!YsiCS-mJ@S9{81x_geOOmP>ID%hvp<3 zyn>GR*ngiLPfrFqe{GB9>+HjTLCHv=AQYIqeP5k!lGsSlAen4q??NrxUr_eR! zUAhOV20?Uci^jY7zU`5q!hd<()-MyrGq~21*7xI=LyKieJM|AEYt5@D?|p8NaQ3x&ERT+F zFqkIykCsdnU(#rMX|MjZZdT&j+8v<3 zIS?w00&x~Sk=Yl^R$=bAnJmc}Yk0qjkTC>q5^0rk_HNktp&AmB!}7hCCH!c=;^=ro zD>c590xV`(CaDyBP!kLtM}B3no}1MOqu&>r`RiNT+lPz3{8==(4bR)Nx-FrCp(kyD zbhg(=_*Vl@p135lto*@@;z+qBKH-YOrk^(ak9pz~N2$?4&j|*##)v5VQOsX^+u#p< z=vLqLroGb+9kauDWCAuTtkS4}2XnlHR`G&@ll#p6 z%~dXZifS5KlzDo5qh(e4p0x_Wmp@Twc0ECRchw;!?`e)9CopScB&*9W(H2bOUZ$AE z&m%=T$Qj07R+Ohx(~2(g($`vr>fBYuKt?^`za*etUiqK28~Wd!6t9aqIcd86 zcX7bU_5XW1tzlyebf&d)gZpzNV!rPl&rXdT=UFbBY;XKXyG=7rG3L6H8lZJ;mvZaX z#lISME~IEcewNhkCj#N-UiV}aavc7f;C-dOJT(7R5A!|A_|G|r^V2@-mdGOa`d&sy zdT42bP@dyoKwgE@sr}ErKAw2XXqJ#fP6KC3PqJ7PYKXj=Fm`6cN4ED# zx`htEZ9|F!SOcQ-FY8E_1Kgl?JwKubWLAZ4wducBRzqZB^dDwv;(W>!5_D18dR$2@ zPzDzrl=g}>7wFV$^k2AfOc0Rm;?E^==XoYuD<3r2nySgIdXWOk?(e0Y#?Kw~Da$J% zuuGoa7TQ^%LN9w*;ET4t%8L9jI_}GGbEE*Q~^FE60`${T8 zNz&oxf)a&~^zjX*fBSK6G^1m<_tmzHZH0`a4)-xhKrRr#mznZ|JzAD zSBdsY<_ojU_|EKf?SyC0#+%3KWhZRB(YH#)6$Y-Ye3o0QT%)wy*KuE!`@MIcT{}v% z*UqBONW6A&=p7HqCKcssyssGe8c_t~cIP_5sY z*@;zPO#H#;#@>Xwe?|DDRGb&&X7|Paow|V4`m~a1Qch}H!T++@rNP|FGY%`8)o!Q) zLz$zgiz+2jxkm3ftRcCK)fZj;XbO{oPh=d&$^#9|T94yZTzZqf*JEdGws;l)2gI<| z_Ac8O-MM@_KBKoFKGgpQwg6txPT=MLKiHi-|1zSD-sZnM-uypD1WC96 literal 0 HcmV?d00001 diff --git a/assets/20210329103157128.png b/assets/20210329103157128.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8d2f9ad41b4fc073430b98fef2f2a8148b8dd9 GIT binary patch literal 12910 zcma)jc{r5q`}b5&PfrO&4;2zE)}fF!RJQC%Oqe0rmofI8X_F+BWrT*%Sh8iA8DkqI z>sYcgi+$`{82j+vs_*yr{{DH7_dE_qGxvQh=lMDJ>zX3&8ECPdIDY~J0IplR;>kg=}op%QK@|VMH{o5c=aSY3@^-D}y2{1a;qffKK_wMH&NPoCpAa^&#ElZQ87|5UyD z9QLVp#P){+7;J`eZ61JDJPl2oZR08tCw(i2knn><YMZ@S+B&K&Z`b>( zcEi`J8*4fz3U0a|js0MKNi-f0j}8jbAhfqvLGmhU@-?$;3(pn*Oo%LBUVdYfwN9ee z_|5eD819r@uuS)NzO+;7AjV6K&rOKQ4{*lb_VY@Ds9g8_x@r6hcI_zz%C#5uqgr>3 z>s7Je*S{(VFZ?y`Du%LrAE1uL`?e1+-9$@ocHD8ga}KTKK}%($(GiQUN<(bR5au9 zj?iZ+B5Z@{D}s3=E?)Unmp>iL-+L5{P4?t}%N6ajE|J86FEP9$$hWZ#VlTRPGqat4 z(sVSNT$DlzzMj%XpQ^-tZ@u#5!eef|A8rz>qVo?fTNksuJ;2Jz5S)?}qw zqO~>jU?nq&ht~b@yyJngTqWM$LUQ-IY{4$8a!tG89keSySvn$&ukh`a?RR-xK4ae?R=9Bz{z$BX&nlWnYVxIwLcWbqP6$d-^;AcKHS6$wd5qE8rX-B z*+nFwaIvwE{^$U(%f-RRijbRBdxDa_@{_?2Uy+gR^fMW0-9PKVRfC+AL1@MK4U?31 z%k^YwY#3%mF5hXmw?lco2Q`eto-ErJDQJTqQR_lSwvA84?|*WJ7{wwwBYiZjMO6A* z%2%`%f=ZPLVxM?PW)*puH>6@$)uOU`4#DkfyAK*MajeS5&kNs4j;|`Auec~%@Xhx+ z+|WQ~gz0kglU?di6a#E)nyW*FwHXsmyuuvplTHuQXI7&qF7azc%{-AAv??RtF43Ki z>?rIoLo-$~G@srOa>C=KuG|f!PQ5nSQ``ID=9Jbvl0Mng-C^P|C}5#ogPmtaNyg+N(MGL?G@` zB8I4R6?D@27I&?&_r7?SYVhvy3fYe?$P-%-iPNBK9Pe13WIOsvEM6?z<+e;w>qKRe zo9qac(D}DC8HOSptP{-+#tiw zMd)sT#5Q*%QkZpW{BZfX1MZiV5+(gkPUn$B=WeJ|N{9TvI-0L^+<)X|d}yTNX%ohq zs8Cs#NAv&cmNRRx6;lYhrk_M@!??;W5%>2RrT=L8OxYoC%+&(9)EyQ%yFpXIIzLg)p-mF4cZ+3}ePyx2@nscnr zmYDeSOzqn$T@m`EVL`MpE~t{txn2{N9;&^`RS_)4-|w21Rn(Z!S@epsK9QDC+)`kW z(ywE#xcJmRWPCTxDL~vU1^mquDwUfJyEpD&?qbYv!oSE#K5;oclL`5_^!-D%T-yPXqBKze${W$q|ob$-wDb5 zDXV)Ou}eZ*yo2E|_HfWe8limCt}`{Y()YA}l^226m(Y0&bQgBc>(CR59-mk75hIX$ z*aCFji|AFX`s^DlUEIp@(4+H2uR&KkAm4VF#^3>Kgg>t?+lHs@g&Q)S()v=XmUaS&3s!pq|)X#^Og z6Y4#cF)ryF&aE4cCRyVjPaWQMGH!&fkuz4pI(=QNKnF{D4YXgOnt$E8>eQUomFCU$vEU7FsR()boikd*BUDEq9#(^%Wkb_)e`9?3|$h*g(iij}F(qg>05i1EEPsb&vH) z$2}?`pKZmH@WCK4&h9&kG-!?4ClM2LDK=*p7@msrrs;YwCnf!?MU}WmjsRRO_8>NX z;vp2mw41G8EZ>`xExRG`;{4uX8y~WAF>zfT^Wl zdJq7`0OmJu?e8&5nJkrOsUstMH8*Il)=sCwR6!$cRF3j|^7C7ygy_`^ftkYBndt75 zOQ}>IT@p1tX`5ZrX0()+n!H@9F5PM{_o4cml(5O#K)NmgW=OEPvmKTOOVhn*}7UbBUY1EjP9t1QED|l zzdn3EDx9p1LUEA)B`sU8af$AFmfqoEOMKqyI-^eM7sKaQwUC8>bYpG6C0jMggjbAKv+`S!tx)nW>lYRysTM=Q`cF8;f;!c&K?*y~*R= zf@Z_JRmaWxgw`D-iGzg|3+z@CrfxfLx|L)1r&U}}P&~(1(1zFYA3^usQOg%u24Ce7L((xq#RncJ@NNY?1raI<*#{wF(nvsKu+=Av2&yE=%{I2KTVL z*=uko)qC^!h?b|3F`M~V5A(ZZtXfc?!wk3KPc8ef?xf1 z=HiL6RNOFm4>1?du5=#$x*qPXZDrW=x2iK{O6)3+2NhzJBn1wQ+wfjxNFkz3uY_NC5rN%wSc7+~u4{4_Z20|HkZ%NIniSh zEUdSaFWP4bjrJwG-x=W;-oTtHr|wK#1762?L4g%1n@_!<)Y2p=!`FZ~@2|2#$4Keb z>(}mi8}Ga42-gHxcq^2tB&E~>U{Q;t$4X+{Zu#{c`?pvBRH@_PcZ4CR0dlroL86m& zIzwvxpLyyy5nwxOl$RR>T9yqRIr#TU7*m>aK5UN|v=ctq%sYEp`huZh< z(Yh`K3j$@oh>bhIuf*nVHk!^->8_YYq!OTsswrlyfcS`jNHq(p z^;EL0gpa|Lk3-p}kS@i=-&qEj9aVBk!ur$qW5TPmVu}tLwnq~EEe{`v?!WP2+;ffn zau>hfPe9kT(ln0p)^JTjTuQYeETKTC?E~aIA2tSU$t$P0ZH$w*gWZiCdHJSs{sR$&tQ|qh~XmkCYv|$1a^fbkMx4*6w61 zMP=1|-Y(DG=v}Ww`7NFh_=VIxT5Y|Z^Ao|Rk(G-BU6@*p*8as8+z`zZ;?a9I&;As-#yCv6Sqn9*;*2G7DI!>>Mb zJpAf%tm7qimP@vlu-6zrMG=F!0aC(#scz&&HIe4S%#O zb}yGMB+M|8*cTYyh!rZ#l*aD8qw{aU%5k(I>i(sEy1nt7WCA~dzr2&xNSE4Dr+r?z z=b}?#{FfMa5lUDq6`FshaIv%0^Mok628qFR`U(Ds`G@NoN)= zxj96-^>2(kE*BX-fyU1_}Qd)+DsO5FUhj6K8Pd&5_moCQU6(qBPAnQlE@^H8`84ja{dr>}=u zWF@_!y_15?fo{o;zWC;GPf+Z!4Or8(H9NVis$~LJ7Plb&V3Tf-g+FX|U8s8ZW2dW; zR9;{FyR4zPOg)z=EUHipNmxJ*j;Sg3B|*%{9dyd6P*^= zBLLrzENAWH8lPRGhh#-4-6SbO_sri0jC(hxY*^Q@R@^Uq(!-k#%T<4fov(6xy^+hD z;h|3W;qrd;%&&8Gq!j9Aeeu`i_a#e`wL68*LO5n6v4kDkn@Lv2G+R$G{@YayV~vYE zCw6*vexh+9W=GYPry8CG<`2G~=J#UhPVR7n>po`P@dz~QKvdOSgc6gp4?mo05ud?j z_BJ@It5bkTu^?Q(p#9yt(KFks(gdlF-%`}6X`gfqm8pz^nlbM`{{%lHX3*$!m7&fM zBKa^VAG*rFG!CH+q#}{sqn~5<;joO3vUhLDGbJUL2Bb=_D1O5W{@dTZgtQp$awB%5cS@wcMHK&3R0J8t|TpnOl1)3#V&fo z+)!3zhza!qdEIZ@ifeL@`)5g@MgG=Dm8G|WDkjtT^1ZJ0wDy$v#G`k!dQ7Rqq4$Ox zn4Cq33fj=@%Tf=UW6BS>Rpzg?|2&;h{$}V)y}&_@>eu`s3cz&v*(-BEmY^nea2r7! z07Y_Q(1b0%U=r=yJ4AIMQS;SxA**c4SL;CUrQYA{?QG3gt|zKE6a};Sd0qGDDN+3JTdX{pzQ-F@#bwKh*Odly zFfx55itcUF0EjPI0|2x^lCKU{s|wfa@mx5c(Vm1evuOby>$$7-NVR$T5TI;I25tcN z8`_zudcRfPj6rDkI#fVOx}QBwd~HiT+1+706;D};f+_c?gbPd9m>w$(2Ks{y0HV#L zj#LcIr5vYF@iGUjy4>o}a3J~-z+d;@PF;Pb0Ex^b!gP7DWe^p1b+EI~Mb`tIv|~=q z7+p}hvt}}5l#1m8pSb;|@_FRM+$S05h?rCLcBs5Mx~BqRXZr{MgM^nXPv5GEf_y#uhh1gc|&?cv6rpqg6bC%xvOhj=vy^M-B zjU50(DxXixQ$wHz+#%mGXx&%Z@j{Y|2BDuZSFE5CLb?Yvwc!5)@vt2Fqr_XfJ%Xdn z^_}=w$@$soJ2mREnxuyZg}I?f6n20K5eLsp*~dkhH$-8}j7VQuQ3LWiyy)*+%wiPX zIr~Zk0M6!fsVQvLd7kHhG)QV`CKnQ_^r)WT#?rGjp8Kx}jfcSDAk`+Pup_1@9Du6??hX zJ7l^lUl7LAxUeo}du9?F0ib4+kcpbu69a7A8}D+C6Z?KC>m?A&fxER@#{)ALjlUqU zvSFp*#*Ff4R0mrnTo5=B{gPKNShfGj z|FEl(mQY^EY%U!={>m5LS)m{;w`2R=e`r(W4LbXvRip|__jSE_SJv5F75i~w01Dh{ znUe#god69eMMaoLCk(k=p(5$dJ>MQ4>{BIwpm=|npE`K^hv0sxwJ>1LH_e2clOPVd z@#Vtw>EShS^rfXhO0JN&pY*-0OHikSM!-z&4ffXu@W4<@%|8b)(8UKFFA0`qhp$l!tKu)N)3q$?@t^yZa$@Kb9@CYM!= zZn#JMLIeAjt^RBCli5HAy9`)4hP>JI=$+~(|rHx#GGOc`-Ta3~O!6|lU-tnk_Emn1@d#&CCCX?Odd4Q68g!>d0fOz9=gn6>kfoJ`X2VvHF z>Q;SMP2hd8?hb|aX{mtuEkiweI8^b2*?jsIR}U1v2_A1S{}tH~q!0Z7djE-Y{`Y&N zhP}=JEz`|2HV5%t`MVKmva(O;Fq$zdpo@rR(RJzcp#?nd2!|8f6_HruJY`_a86@#=tWz=9Yz>` z8eln=Es~nxyt?}A(7r|QWU!y^e)}cBz(#s$r?60oV`=7mzIhmR5be}Q8=o&T;dMHe zhTQ!5^9K53U*h_olh~644J7@9U_C7fdUMAa?4{fFGi7tf^bQhMRfRzhZ~!STK-DxU&iaV{Ku{cs)NTy#y-k}NpJmxxQE||GE1nZ z2LBN`1@@b{!*}KQap-Q!-v_7{6#~V7vNdM}$C@hlsqapmn&9w+Ft*tD1-|DWLuKx{ ze|@>)qhUmvbw4p9JMTV*C!yI>UtpBrujY;?)#w=*6TUyR_5*y6N7_(_Tf(L5%_whqV zRZ{sb>-h(q&xNW1S+h2;Qp|bl;;*$8f4l!4b4Tc@?km`vwDlu3T#Nu4{67BJ+3KjR z&{FIa-){b}IS|YNIy;l7W%271NToH64{pXMF{&wnto8Ks%%kig!_IV5j;RcHtGtxk z3Em%=l;@(1vfC(qc(JfL7@8lhq$#nXQL%&%1o8)M4?mZdOX=kwM3kc0gP=^wirdvQ zzU{tBuE9(MElyR2ENB%Q%I`F(o%T(*jB{z{yiZLyi8lJhoE%h8Rl2zsepPxC*NXD+ z(glm*2K1NZMlA|`7iEdbN&~5li&}v+u&#Fk>BXXFX<1n2iRf+@!{sKd!OeoPDSz5z zOX6+f*%FN=Az{QC(Yiu{a0jz{$TeJbzAZT@uFLmf3xDnUmMi<>XeYpP>Y^AN0lZhm z@u_GQ?KvP@AhR8~DQ|>&AUo~vZ5BzS#MVmDZ3@c8M+6C?Y<WJ4=Me05Wu{mV4^@8cHN)|t53WNc5i@XIJ-d{H33RZ1qZcIH0YN*d{* zM%{%<#~NH{Kb0IlnD^#o6$zR~9vsTaPijf^xJC_{x@n#UcnI zW1JJOdeQlA=D?myg^#wziY3o#BHj?9Qpqn}ZQ>&~AuYvJ#ksVQ;Qe{~1euVF#)Zh` zzJHkvNjiH|es4mku@RTBo(AlT) zL&-~}1MSibxtCcCEZ>jmGU?P03*opbi!#Z==G|>nJSuOCx#z@1M`h-T)sJcDO&@h} zCWZhuk%X!6-4e%9^q5h5+iY-ES~7I&>E@^wj1NBJ_5h7Nenn?13y;$O>5G%S5|X1# zcAPWxF-JM&b$P_-g=Q0Sso9P?rF7G}8SLjDsg})O|3)#mhvhQJ^Idc$&l1C|Yp>!v z^KyDrlhd4o>bP5EKY!}~c@(oQpQNL+z?&~*^D)?W$B#4r9*(~v3A0@)t) zl&J)FImE9NHK86Wox%9B^~D*9T79YK&NTvv4ndE=Ct~BCoqc0*t@+ zRCI5M_q~|(?b6*UqpoUFJ|fq?&CrfwWnSdQzRo56u!g$NeEmW)Rj*4f*Ms4w?nBm7 z$&5#8;D9@!v}@P;Z}|k!OvJF=&1=t5hIajV)aRDD!A@a!LXAsGUvvfY8C}n-{Ub*u zgY)mnS$$zJz7suazQundpse0bX9w1CHIoAqjG6n;XN$Q~JpX|*hH|2f&mLdJGAc!A zowwwys_uf*B&1`v&eS!fSQY9UtWf43hn608i#_A)aMsn3$aD+wvUw40VOxZ=Y8d z!_#GD{N98`c(>_3QiN!`x!U`|g9P?qcAxnnrvhssX7sD$Iso@9OdAg@6o&!l1>F|+ z9kzS-mQa!+l6Y9r-qih}B40wNqkZr13HZ zN;BtYao*bm`K0ZzlQ-RT# znifcEsKdv-!mf2_3-Q}|`miu=)mHmp2_Z^q#-6w-)}Db%DIkKECST$9|LZTE+puFY z@Yyo39xT37<>Z{U_Kyb6vUf;(* zt_%qxDv%FXy|D92K`Z^ezX^U8#6&OL3yqr$CL{XUR|6+y{8GAzy ztoGW#HJ{u3s+SRq%Q=C+Q(Nj-qozfw6Jgb+aC}J?I3)&XnfG}nIC9*6r#d06t>(3+ z#bjhiwZ|64i|^$lE-ew+4MeQ;Jud9O2JPBOkSTbzWsgHjS#Ez@l@uJEOT1?o7{EQ1 z3lug$9b{#C0j{lS_<9QWeMPqyCU}Nv z_G<*_?S?`oxS8hp`(0>rts|+TZ-+Mf4++XIeMZxw&!l>z<8ty6>|7%57{`sR>P8NF zs&<*O1vAis`sspMAGvo8o3mcW`0EYs*NRUd_juvw{Ox~aC^p6%bM6TE$&P4ed-W#d zu(uE~yc1~L0b1_LN~4UueBfGsNqI^GJi9j7S^#kMfdZ7T01c4`c7Cr0dUR6rPdReI z3D795mh&c6i#){CNpNYiRX=$ddbBIY30oj5sHsoIB22?c^e-z1=PCe&)~|JPH4k6lZhPT<2Dl^ZNKoP0 z9^hebj>6fdfkH@*k(RpO6%IOnprHQuq@}jZ@KoXD?avt`_ z_X=sfcNT62VGOCpIo9~uLCF{H_DpPC(2Wne+PUt^n1g%71=^aqK)U-g$n5=`Hf6u< zZMR~~kyI=FoU2zM^ya;w_DH0^m+vjxdCreYTgr8rV5QW*fG!)L(Ec?q3+mg~tbU)S zs&X`FDk%y#e9P=+3E<8!by@Pa=0EbwMOFW?O;E$5KbwraYly~CnR*%NI|X__|CfvY zS{t&zV=HqyWSxvD za1ZpBqA@Z(H5Q|iI_)kGoAAk&>!^mZ?Kx?XdJR?+^jsFdh}p5_nJA?b7;foRT>;`j zcqMgqHFNvC(_$h%|0H;*TK(Ew#VDZc$~k3`R0_vbxc8z+JHdg&Zq6`~BE7C7$fNx3 zMYQ|0{M}Wg=tM=ytocjFmce@K7oqBh*tos=2&>5TbnChQz zsgAnq$A5HOfWO9?0>*U`~w|v(|%c5(i^f%@gWB$166Rq=r z<@5&aH=4@VmbJR^)T7(7_?jCtTJrW^au(emL-WHe2FuSu@gR6NcLTpmbYZ?yq zt0~NLkEA-0ep{0N=P^g!nWWpvX(~K9%2V~KRSE%jy>ha11Fnx{{~sA|L6^t1dMv*sqw_$LM=bAS^5(;o?N$d zEwl3|%ZpP~ZF9QuTaY5R`4Ef1*pyFiuHkmE^uRX8?LRN*lbt9B>pw5c3R`A2qgNJH89U{jY`iVtjfDu*<4G6a1P&>G&2K*Yr z8jYK_NvIwoT&@;-zJ>x$a(jF#+p3TfcWDy38l2_iI_0Cke?I^1z!V z68{qt*|K7Ats8rusmtTQ;qwArwR2gkIC$uXuwl+?v4b-r;G`!{H2P0m9QpfCyanCt zVvoX2-?-Iy+7CVx&;>JVz)wx0i18fH!V02|)1(8COV~|;;E*tW9t=XsXhfMEdhnpibP4W%&JNkPy z=jJCXkMYuOyf(TJ(o~3`rcT>`ZFKf1+gZQ5anv{AVe!OOqFhrHP=pBeShYZs7_k2B zS~p$NRC&ibaHs&#`}wR+6jfL|VD}CqJ33#e89&8#L$yt~72Hx#?Gd83=L$o#n{<~n z#^ChaV&Y)KTb9YQfeBg)zno%Oo}CBoafu~X0%`^%%V8hM#u)YZc5A>#GZ_6QJ)fJm z7k)ORQpU)ox%tXg2`(ul1F8}^Ll@ELrk9NzTen?B4{f(&j}(jrAoY&@;)psQzWB$A zmbI?^-yX48eYt@)AR9CToU{Q{E3{SoAJ0&=b}z#O)co`<{f|Y&Jtc<^PSfn@q2oiopM*@8GHxN8Rm{qw7>udubTYsF{j>vk&^Fe)xa%n^ybBRckM?9wZ9G z%2;6~GKc7K)xxvCx7Ru!l=wSCf!=)m@8JLO;s092eV`gh6DXtcaxdoIS*`b|RIU&@ zK?v4%+3U|xlw%j3z3G*+s-AJuPY#A8LUV~LtIo=Si7-DeSizUolb74@s9zg`sy+h2 zmpa|t6O8E)D``A^r6YRp^XzJaGS$&IeD|KAF_2|`jT}K!WyrBgc#RH|<5L9S-iI8! zYSJ5|7-Vk(~jw+|T{!ezhD+#t@! zr2QUOxSigK>K*k|$lp!r^Xxqt05u4=IHrtJveIy%+7g^+Q7sU3i%*u@bMm>dhO%BI z>#X}V&RU)sM-$1$&il%Nc|!b8YB~yhGo+h1LU)1xXaJCV@3Ld$Zd9n^i$m|0{Q}SG zO`o)xSW$Y;@vXm$?@6cKpre|{$*ULGX4ulyR~^(jgIHVIdPUO2?zb!zLQJ!Ylk#_$ zW5)Xg@&5lpFl{p;ZB2g^vQeo*?qb&6Y;ze-Sm6suVY@x;_>|l0he0Vu!f$U zlJUF|P8Xt{eHpE3YglGh=7MNrZT82r;(~q~0Ty&E{MX@}<6m9$^f-TZm*Qw+e9Oo%uC<7n3ZEl%GL&hH<}y7~PB>XAY6 P!7yzN1NFi?kDmP>M0jvy literal 0 HcmV?d00001 diff --git a/assets/20210329103157129.png b/assets/20210329103157129.png new file mode 100644 index 0000000000000000000000000000000000000000..d52001d836f6f040709a4e081a083a009a5fce6e GIT binary patch literal 84027 zcmX_nWmr_*`}F_<(h3SVgramyN(fTIP=kOVEz&h~4k;y)0uDXoFmy>bjI`tcLnGbY z={wKwe_ii~^WmH`XYYOPy=UF~UTd8Q4Ru8_VjwX903ZV?$!h`t1nd9+F2zG!008GP z?U54p29B$yqAZ|nh<*!u^1w<)O$Gp{j3v1>#mAl#IVtJ60s!Qw{|=lU#{zQz;2#1c zFQe^cyxa0NW=H(^-#lHildM^1AM0x$-17EFexRt!CjMNn3}3qyjo-<0`po(hI>|$7 z;F|zdr`H_-|Lssdh3|5AvhPl85s5=PP}@MqPpZ(FvX%b=LLA-Gv&|6SmX0n?_xqv!@^&fFcnWO}VC z68z-2K%D4YzO>GekQTzH&d&(zpmDzLQPnyo`8{Gf(4oK$&%I+6`SGo z%WGc>oM=*&{uCIK#bZuG*M}})f&0Zxv+a0JYnS6Ct6jDi69b#iDC?#XVV1&Q!qiv? zo1^pJ`uR0mj0x!){C0rYPPedRzDpu~3S_-i>X>qRe_JlAN==H{8B-$|GV;Fg^D(T zUn-QTKjvfRL3z1A;ZuJ=b|xJyoQ?VkB-Q=lW8sFArT`F$m&W}wb|Klc{b z(qTVoE!$ngCqUw7uzCDBrnBn-O(nv-VPe@}Gk$D+8h-gjr+>eKn1kb8F;mI-arWg* zepF0fs!(LsguSoru%YWnW?2}^V;wotrOw05_GI%FEgB)ci&HhXMN27>&nvT|=B7!@ z#(M@lMq`gU0=DC)H2<_EgL>QQYeLs~t7k9)#D#Kd5~H&L*L$MZcVHNAk+j;CkJ8)= z*R9PBk@1H7H<9atI*{Ra4!%V;oU~LtM%n@P>(%x!&D`Wq4obtKcISzEQ<`6tKm&JM zFFJ5r<{qo`W?Cg{Y_olgq}tkxOD8pU3{lWJSXH^0zRbJbbG{ zCi0CgxU%F+xtFj1%x=X8^a!2WaUx&g{oXXzRPuJFQPxn+{ow)F(MOx!C)^uq2Q)^A z2zYXw&VHcFd>E~lpEm9~hKSsb9dt^xY)uB~M0!*ub}?{NLBrIP;4yCCXZ4yQETl?z zRofC$(Vb^CEo3|{VKU;kb72sTq1c=d|0jD}qs2aWSHaJ=tmiRsI1F}VZvr*uHR89$7B2PCJKe~&`)UuFL-_}0KnS=)pYI&7U9WpiX+V8fHXK)<91KHL zGw-uUtW*2X6GaG*R5i^%p`1lrn=+|oJwwyt$5_X7cfuoVaxt4-O{3iV2yF^e#So?&EfCV5H!WUpKb?Z1Ha z`S`8LbkA$s?iJ=f!VCaiM&2!w9yo8)BFS*#S+G^bf)S|SdF^bl%0<- zk#^glQy$36_co~#JsU%9HC@h~m`49(%hqSY(3fgY zfBsaMk(pH=tD}l{S6v)pPa%~nUOc*|VnHXnR1#O~mTS%sbxli_k^;e@=aYMWJ#2^e zQ9IJ^%;sY(b&)pjA4hDuA3xt8&RZ;(_HSEe+!)rpK!E;O|AK%uS8L-o1B7=(hSnlU*qjFjE$AXY7C8ZE3)*pvc-(n8G^pTJN!1 zfOC1tw|y;uh>`R2@1#dHs={PX^;I-16OXq3-5(%Hf*jQ=kcVPb<)`yWOBSiAFPNzo zggADI-u#sgdd&o#$@KK8n9CI9FqE-9I2l$*6z($BIQl_vV{RR@6KO6VB^?h@JrJ`~4#={)^L&#lw)jt!U`Ko#JM1 zLzDogb#j&$kW+~C9UUzeH{#w#K;?(}X`8-k`_a9Yiru|g^x2!i|q!ej|co%0DJ?crx z1fLkRB461}73GOBKM}lWZuRs1_#Uz#ACM|Wxa7dYp5lL(e?^u~xSo2nb(atxomyPh z&(Mxd6{1vQ-Iy`MJl*yA;t{Udpt!fApWpe#`DdDBj`zGdkKPDcFg9Bpe_;AkoSlNH ze6CW;*OT$@=pUur8Ic+&qfDMB@~#r<)X^HXH`c)#Kj^Ax%~)9hOaQIU-VpjX0Zx z(`fHD!VmxaHV_0i-YJ58gB{W-^x)15OFBS%9hvdHCm#ZAY#>kPv(pp#mADZ0j0^^ z!ud9JL=$)O7-T@^YFc!4US{N8#E|faBgX+= z{^Ip-g{BEqj6d(Rsp5~{_s!W8FKfI=tlT-))W2`W({;#JX{(!YI?)IPl&Tk$|7O{w zbNp67tcSQfls6|+D-2=da^TQ!RGXBq+ZK3;jxfGYxFfJW;0s!yaJU?~{VeWuCZ;jl7S%;7tfd%`hlEl`{mp_>%T`Jac5{3gMp`My9G<}jUb=strSmPJtqH7{1%Jj>kQ&_)GpFiUm#&c&&GXQci3QvkFF=2MhV%h#OyEEA@9 zFrCaKPYBSj9hm#gso^Y}zmnjNw5>PS)S{UP^}kPOO}M&{e(yhjUUWO^XSXQ)^g+_T z+hrQTTo`eU@9E*Hj(C;6E9B|YhAIsd_^k#Rxsm|wxX3hFnMpXyEFsONs&nHI$eI{f zoPg_u2eg#jFNq{t_w~eppX9H#B9I?E7a>aa{XDMsjgM|)fizTZU&CMtb!Y3Bs(W@3oQ&zZX`LyEOgsHOqfw*-1e zTZK{j7au>Rh_M~3IDK&{_Z|(MLAt59=j&VrO9S>6FOkEQsC=ZRkVddP;*?XB&0BKD zqsFLUPZr-`tbS&zF+^h2rP(fK)u$Pq843Kp_p;`wmPDr4PJjs_DK*OUF}BEvR-*=% z>vS5ol4+T)}met z(h|zzxT#Th@CA;r`N%wl6uNrKvI-Sc$8zm;O>`rdjZNdorR%cs@Cc-5sTn+x<~51v z+FknFqwrUPtk(@>bva3B53SuJ-l(9O4vqMRmCpS)P74a2n9RsV+(E@AvtFG5UVNk& zIw%Y_4UUyku7yJPv~{mtKg`E5tkuson)Mn6@Ydobe&V8Jwx`Z>#{^EiBiK_?ewZ>c z=3tE!kus9J0c5?aU^_ND>n$?lSVWA_YHzuv{xNxLteo|_y6AN^se!@YQ^M`seR^Zh z(K&*5_hf6`-i_aIQv*kcH6u)~-31_mvbd z<>wPGf7v^AQBWawFcg%+iOW5gFS}oNvpqVevX*b~Nwk&j*diaMI9fGGlXU(R57MSl z&&J6rSK4c7CfIx0jhspR^d>Xs9c?E2`+#cYANp&m1f{sKHBvHE-|L_tczS~YQmZmS z7Xt{31~bdp=iR)liyU`Dx;_5rTCaxqdfxa1X*0w1hU3nSa<|aSQ7-zNaU|mPEx&A2 zy*pp(gJ`F=lEh-MQ*=g_@}`u|2jvMy(3nCvr)K5XE?Hp|%pR4mpBh(6aJ^+dbveG^ zUuRwdHL8B^w<8=b;h}3n?7!uathnjAIpO>ZV<^6HsXzrg+JjjY`oplWPd(w1z z9%cD2>(-{2*hJ1QPt>Iv8P&_h;azn?FD5>ot3hju>PWC!a^Rvg)A+V5bCV3+7D{ zOaa{C-HEP4K|2J+;-**>YQQHm-Cv%HTnI(ihdRX?C zcJ?s~nzZ~#+PnI0__g;v1MOS69z3b9#|7p+62v31U%sP^lya9Iy^>~37iLv?r=lVl z^aL2|(=yU>s(AIp^J&x|=g|vJn zZs%=S&)kU~L#UERp=c=Gz2DZ}I_e!{BZy~VNCDnII zNv4xM{i~)DosBp(YBhaNRhLENWfh`sr(M8=`?;{A5d-!E?4SHEh$OZKInuCl zN4f9#R6;6r9(C1BaG4+3{pXXCDvq+HVrT`FMmF;P!1Mm@!fI)nZm)zHFX`h>{W^VG zy!$hRkX+qZ^nB3M?3ocv#gmBbnZ_pT86*IgGnRN=h2ucUXGENuGNh{UX{yuRE`-+gvPA3*{|8}Fp{F}c9u{0-M}L`4q;L#?&B)tPI$rN%J4?U@D{kn z&_QOVuK%Bd6Ozn8!q3W`hpUEG5#xxa^Je}1u0^C$G@ERdlV575Pr+Q@gpFFo>;SaE zTw#T1Uf$aG6C&{bNmCKWQ?jtRZ`@Y;whh;Mz*fT=|eJ)4;temz? zlOy~dU~O)4x3!w|s`bBXIFb+$B}WVI#+AYce5UU_JY_9*y9W<_9m3sY{@T4GD#&iE zYa^#ru5vEnHkN$^asvQpWoh96z-MDaX~~Fz2LON>RTy&Kxn;U_Gg{sQ6ry*M5lgfb z7xrcDqq!;H^S5;>h-c*k85FLduVD_rF2o|e$o+l#Bg;ZnpEk)-8gKH%cy*;VsrlV{ zczPJsN9@YKy*j$jMpm)@Vf)33z}AiK3_DVwZi^*e zVA^3yjOSm_Llo5&W%W2JiMQ<(IJZN`AR^qY4z){E11mPu!py#fJtezY5i6e#cHZ*I z98e2*c3xjZlzPn7IFVC_Yn@jd`g>{x&iH3f#^07GfmXae;pT-3jYY+gC@djq{rz|5 z-K0|zQQJrJEKvc?q`>Sg_k_Xe4b+E8SSk!O@Ca$D+Y@%%YPc>E&ox6_t=>j`hvxfK zqW{g_6!NO{y}!*-9kb}5H29Fus4iNg%*xGNDBZY ze_ub8A3&!byejerCllfW=Dw~UV(0VM3sSI<2>!uV^9Hn|^rBkLDi=H5E}e(+?ND66 zpKttmHR zq5}Nyxs2N_gIev*Nv9k_002!H#)cgPjj7kzL2BpT-+r>PHsSU^BV%8*b@TG;b(=X!yz}Q8fIOzQcU3YS|$RnM!sj~^PBNgiF+Qoau0i|D|j+ zyS;Q9gryplFkiHFHXi$h-NN(N=GUJxZ<9>lOv@L`+`n*OUlTA8E@|;+f&Ze5+;jH) zG}|XdC;$r;bUg1W|FFiq+S`l$wnAj zEhAWcc*nLhfKLEo(mLNeA|Q$5gje>=_n_-l z|81N(D!~;cKr;}&S2e(a!eB60b&LLe@tyxpOzW<~;?m7E)%t!VfA;Vw=6y=HGF*0& zXp>3{ktwI6SO1qUS8ptowPt%0yZ57#|-MB$X6Cay+%z>Ontli z3vKL4M-~1tMe~+QAz#wLyF=gSEDt*n;F7)Lk=`b+b_3yD>O2W&1F{l9!=CY0?>sCu zHD>haDtyyr49B$W3uhwYB~mPGEYKFN`+X1=eOn*0)I!TL(}|BJyV2yS!~D(@T;qOw zQBl#)!{&8)diunsQJNzEO1LvF+b9RowqY4SH%{%t)Kv%UsjSA9rF zD|jbd8PelTfvO*QZSSCjbxSUUpwL!e34+nl2=uo*cG%f z;AZJCHPIJ(#xgN0ES}lvFB>7_h$`bVh$J2`t~WaE*8kDJE~YS_f zKrHaNsG%;4UVU-WVR>I(aZ1N=)+kqB)^PC6e^eOiRNusEbIP=+SH5(=F)aO$Yvr-Y@ZE|hLt6e}N$@I= zd;n+4&Q%c9hPEj>S)#65vLViQx%H7%TaL1+SzjMr zqvwyml0m}oi8yAO@by#3;trll;b{bA)!Mj z6JI}WCt4*An5m2;HOqF1naxj4nuwo?-{S*|1 znc^}yw@CCo??IGC`epb3mE?;f0|Nm3G*wH5-Xr_&w8PzEEf1A@AIq_B?7R7^;BLmE zT(U(=C?Umd{NPR2pWcbC$FNs{LxI+M`jAK5BWnQ4ZG{Je6z#P?!W`f_Dt<&~Ie@ia z65Q4MK=_w^IhFDB@)X)yYhFWqqB+1%6BW`>&8(Zbl!?-H{`OkW@Spq8K_2ouY~ngV zUB*~*=@wl|)Q;??)LP-@h)Fi!#QS$&5dA=9F(BWFoWIm&Qlcz2gNTzY$S6(k2m_n- zU>$^`w3^NXqfLz+XbUgR!jkF-D$4^C($)5kBpa_mQhGerHaqa26QOa#gIQIuo|d83 z50|NFvJSBoI*B#*RW1y*zds}JG;G`p>mHtVZS!-pA;lzvIO;XKteFlOY{5w zRP0&sOyyhIi?L+8>Us4sKIVU)TUrjss?uwzi=yMCf9QSw>^c*grtiLWPFegANQ(tK zA>Qm6yoWb2npZLL)+efneU8FsIwsxy8;`Gs+$jvvR*LypC~?w}r$f)ps0(HW`n^{9 zLfsA3+#R*?blMndo@icQdzqRx&$ase@9p5Bo1ht4yg7@eujjK8lPuB%>D64J8aJ|3 zI-V92l!XOLjMDmk=vXBDMX6_!JWCzW<5|p-8G-CQW}`qX#8<%1hF8%3TBGAj|7&dY z81xt=_S`FRyD$-|9d1SG%|9An|0}=Q=6Y@5f8j%MhxdA3LrSq~sc)e$uLa_{4y6~G z^Ig(|4v(wOwO0Mv|C!bPWcaP{hu5+V^0mq#x~dw@emM9UX5kf#qHcwZ)S;)Mv}wUS zm~J=ImDvxT%=WWq?Ox?A5Ye`W(NdyD){0W7^V-+pLy8EIaf;6EZHQE@$ke)8SC)bD>_^m?KTds6iwO< z^~^$T{7d+LZ)V$xH*O-!$;+$5(_%EH5A(Js#je)vs5*6wG*xdtmDvdS)f+#8J#eT& zCFElg&$}K2a}_(|@Q|uzomCMkj_x^5g@&_p@ZFfTR(#*#;z*~;`~?oiTykHch`3Q zUy-pdcd@iZEm)!=XljGfzV`1mmw7fgo&Fscu>Oq!ep%RtHckTml6E}bV4zUN?#%xj zG12eqj?oftg8o`wRn4ViBr-SFn?Erc-d@))Xv84b*0YXMUFxK@Ud%>znu0iNy!5ZV z)Xb*$VkPC+uj<*e8+0FrrMmk0V)>#gMteT^CR?8Z_~Up{ z=x#FA=2KHq=Ep#}Abv#zp0c1S9u*l`+L=e2v~4r5yAu%}VfIqR_>xVV>y~hIXkK1o zYHTDWyQQi52tQ(#38Zzo6cI)X3^PpZaPSL2li(|h&?PzG1ETQOu|W`IAqAHoWC9ap zj@(>UbVzGXvG_^u?B(OVWV*Sxvce_S^Wzfy9W(JL-%Fe+o_0Y+1Q*cmRlfw{Gi&i{ zZV6~^4QLMUdm4en*-WVQ^?wZEcS&k7mX=;{=hL%bk0!wZvWpz+yT z-&|;`PyhfcpIeYl%a%j?v=U9@q&t5RD%hHwi~+u&?8!`-wDOvR9FY8N-xci3wLU&~ zoK3AF-g`U&;+Njv$}SFF^@tw`cK!B)2$j%0Y*8t}>)s%7!13N>WA(ZDv{Ez40r=LM z1TjjhoX-|=GrzQEQ8R1rS?vH8(@H*=TEFaqbw;i^qxiVSz0|zt4y=2p$}pyXNBA8l z5`8h3Qooy(hRBI;!u8)g*DZ^Zsir9nYk4q~QZCco@T<L?%c(#9*ksa=@0 zff{5gA|r;lyH<7hV6V&TXvvElP`vUD`1opaR^Zgb)i_@9`t0#O>q_7O>ExzxboXZK z_inqWc?|5!N%o}%^{7(IIO`Ydd*|^&3rF=YS+L;R@vu6J{VIto{do`6enw7C60_5pmV97;pie5?ec$;VWi{bosHaAZMGJa{%|>ekJ(=Ot_}HHTA!x~!_sb)i8#ME4QJ zcZNPRfq5A5&L0$SwlcBq+Nqdo z*x0gVBSyy>G@4$*Wc965;lU?IO@OJHP|4XC?L=&MfxZ8ha#CW0WV2%t$muB!c>j0t zHZjE`7TY5LKm&0zhrV?4M)aNabe1iFdr*Y-y$%K`^wkR-bUzCV=mzcxuU)95l(#(mB{3QnbL4Lgk;&s9+vs4-v=P1F+3 zU*ZmUxv6y$tG~yc4W|}fd7AdCHh=c-So2t){fK6TD%a0^(xt#|p%q6K@8A7dOF0=D zQW0eAqCaXaDX7LQymJ2KQRyT0iv=2pdj;$f6OX`^{#!X=o!<-V+2I*kOdaf#4_F$0ttHDi8qP4Knex5b$Xq)V8Al2S*<$>!V zhrF7rVu-LL(}iRMUHC1KiVI>)nxwJrL`9Vn&*ZY8)45@J5A$_hKCIsLGCp1UD3aJ3;s9V)7w!3?kSfvk?>V3`j%b@-WO&4N7!@>#rhK3Y=!sG{bL!z2*z zfC%99iZK8S6Nh=Hnb7aLi&&~g*3HX>&3T|Ey_IK}?(X(FvOBzx9Un`={H6Z8N{$5- zg7i5oy6_yL(8m=E&D=2L;C20C>Eyl?o_MLm!Q9U#e*c#Fzm^^VzzCLNf{O27h!Y&C zWIo7%R$aWsJ{jFUM+Nwt|9|M@<~0L351;pMTA&w!lI={Q;ksLO`enjlm+h~z0D*L$ z!;vfgNIWeszPh2e(@R?`877-qrda0Z(I0GEmc;)9Q-yH0mdZek&GfbG(>1~7^4PYr zjswo|3aF#$H*5epybcO)NIudsz>OEB7Z&DwT!sEP@25HU6@S11WQivK$4fo=UvuBd z!9J9p%Z~9)G({SJlp)+%2(wD5G8zvqY=j@G@BatfK4AA{opb;$0D@(NF1t7cu1jEP zD=wyrFY7*VtXvCbOrNnudStvYc)=^x#9nJaqhwYx=_X}*?7AJ5jWk1V%f40 z3JJ-*^9`)t8@bleLvQmrC;2R9#isB`&Dvx}dCQY-A&Jti8Idw<8KAH10|4}b!r4S= zLziq`1*_BQ$of(-z~3N9RiBJ_sr0gugLn2AAvA!jhyRyi$iekUYzE+R^QsahOFwKU z27D&>I*2eS$f+~jJ~TJU#Cq2}0j^*`V9Hl)I_B5HPDX|(-)yweSj579g_mBbXgGcs zx1kFFQ2%rix*YT$FW5=1zTfKOk4adBkORDYIuDu6e(!Abr147I-0i4HKU5vST!4u; zF?tJ9LTgR=qy~PHJxa2DduP#_mSVnstt#iKe~zxtkB-(`|H*0qFMi-ZFW(Y|yTW2S zG%j}%@ScEG0PQE(B(-jpl{egW%zxCMAx+Ad9+m_N%qsPNvqEd^A_ct9aq4Ay2W{@D z?3H;|AJ-0zV2-|IH&wy|c!}`B=Paa#&JF`zBJ@*Rj{t#$mW>TaEb(?~&~j^pH$BYK z_{^6lK4s;!Ey=;SKwGQVqwRWT5_7mOd4b^?I{7*gotFyn5{H$ZM_D?2vF0Q5>`2NHbtUcD zK&g;j{QT|WN3NzFp2~J765bW|CC0A&mpY5r2{TG1_ML!^)QbY>2Z z1&eVoCboC?B<~g#zudH=!7`3@G)2|i=4k(}Nay3fJ3PHOIXak4Y6}eltr+E`Jp#Uu z76=h;6%#Typc#{_p6hKDY01wc$n~PjUE;OoNc|NF3`v3|0oRr0C!Y^8tqKws$>}bl z;^h%*_svB540j9S6JZVv4ifP)+#T*VKtne>8aI=lhGs&pnO4Tj!qyy|$aN4xqnTHD z#3-CIo7YI&s$@+RF(!m^X>A{8^V~WxDc+M7-lYs0{j?i1zELym^a*znSROs=d_$R; zetej>&_V0^z}1G|B*|`VX=P8+){U#T%_+NbiV=f6xsSp;^5~qI{Ynqp`$|uJHox!j z2xw-$DK8}%fue@lr^zZs%L(jkM}l#iE4C});zoTs=c zs%O9KB~?>Ik4P<49_Y)7cR5*IG7-+#xssbL+2$Shz79uKB~s<6>TT(~ec$KIxgCP( z?f^~1W%KDPhO!_@K^vSrTLJS|E)QyA=riXH@lv#tP3j4x0i~1SE5}ZA_PUX%ABdS_ zTUxkVgH@X0UQGDf4_rw}=cv5#ic1swx@xy8p+g=-=~n&BdHfu!f`OWW4D=Bhh*=uH zH(V2BIB;ECMh4cjOK2@;jNg9$U+ZSsPRt!2PR-{tn3TOWE$l;;{}@eNvJjwm z5L&5?k?-ZHKeEx&sTHA|es9~u&y^=Awe5n|d&)!T_BlTMyx&~{!NM#K%0B81&ErjB z=BfF`A-q9kXIjJTpzJIz!b8zCXj7NB)R&jN*5$F3ct><)B|JeH31ke(4KLST{&R9U|?GPjre`9?j_QFe)D%wPe#5EMb?%=C0ryDl#x|g?IbnD>Jhk>s`-4cbF+< zE!FJIhP}f(v+Eq6m>Ed*S-pnDb=BNu&M!+3rH3}w-p&OhLZgr-5aXEnIks zvf5$DT34g_0i9jrf@)(pEqP5Zb9H&t!<&8e1bVNJl-C0ahV#{_Y5nxu6D|)6v&F0- zwojRi^BBJNuQ){UY^2ULem*NiXwi&ekfd)GE_IXMIBXsQS1EubEXJ`la?zudmGGuLB_e@q6IN4-;9YX$ zzC5{I*$7yLtCBShipsN8yL9U(GPhCO%hqV3Z6#3Wwv@v8my!y?Q#HhQRV~kO2KcE0 zA$NEimNM%nH~jT`xYD{&#%`xp?bMR6}jZS8C=}89e4< zFf;B2$_b&|cTUBs1TFlCUy|o%G%~V5s0BtLW3y$$pIwU!eS8Xf^y(7#Zug+fziAIS zoqNE1t{mt1+@{kc|8imra3;J9+oFPDn?l^>Le6y82{nb0dqf~vR00NXBW0%hfvTqq zVW0x|a5jLK1JFN?(i)s-6HaK%T8z8D{_~&O!jkdu=hY~;Dev1&US^cmk^=qp*T*r_ zHBvv(As5St-LaDzik0|DYuF{m!u&zBd*Wh#)Q$2d-s|%L#fzG%LbA)!yImRZUceD5 z>GpK(pT8&Dy*R&`^RnX(ot@AW7ZmO%rFtn6d*Cs<<{|YO0JK`Fc$|)vX_uU z)?h*{NJ~8aV7jMKowV0{b-Sexc{PuJq0mzcXoqbBuC>;gve)3kA~&&yrtX$q_rQ!t z=$4Op4G%4upM9w4I8aE5)n6ZQaOks?+W*^0!)2*1Ao0yq(6fHT=Xhe`chin zztAO{(vIe*-U?l^Zq{Y7Hdh1WDXL1c zxumvwyjZ`{j!3uB_~;b#w!BeF!J~_hz}e4W`(yEdl9vih_Z#i3M;dh5gi*5wF$yx) z)!a-gY2g*F5^0yCOd~ed!MvO->EJbv=acvOdG z`lz_*Txhnfy`$yHa(DIojx&XKs*o_%fhMTVviw)?VRugm#p_UhKCwTUlB3YCZgvTu zd<>0?*#%6rNJ=p^-nF?f)iq7e!f6k_(`=ZX%VuOfzN(i0&pc@KIKjB=IAuvqwVXvL zoldHNwO!cdi<5_L8Bp9|{Iqq2(~r#2H1U$eYAXIxv#oy7wk+x|K}iirR!L1MYEjAM z=yo#@iLIoHgeBh#66rc`@!iAfL=5*xii1aWUdOi~KKJ5i8>?ww`0Q$yHE>>eO*4>Q z!QUa&8#WUbKKduDctT zyfIB9{Rla6%X0-^S4A2|XtRhxV=1`eQjF7sss{5-(}Hu3X6%dJ_(g;`D5VYa+e5zd zi2e?#z*gJ_IY4XWS%zY{Xq)Y363$>=BlwWW6eYX=yGUy($Qo;uq@?!%sXN9=i;hW( ztK}JbXuV=Sb7degf?sk})2uOfW{PyI&-tcG|IXp&xDK`Lk4osY6nc9D7d;Dt^6&ku zDQt*lktW7iqsT$$8zNvuEKPADbeKDcE4i?1{2cE1w_swkA-uQGE{Ou%N|zuAR@rBk zlc*h*d5)xo51&;q+iZP+do5kTDLFai#(e{X2#XyCOC9$v1!@K0>e`%KOmv=^Dl2|A z>*;o^iDjMDIpUR21)iTSlTL#Ee4@nDbJ%6VYXb@H|HEXE6d$J8O%7fBdbR6wRSmUO>WC6;@R|$ zfSVZY&wgbk>4|^xwWh8*4qnf`)x4WA!9`0ZJI(DGS2Cj-9z4F<`Amf0wfQ z8syJ~Si`_i3FCy}a1K)IIY~#GWzS7@szdr3T5N{S*O7Pr-1_*aS4Vt0!r!5v+p*w_)$6NmM&-B^7&lUV+?A>~R{YKT+6Z%=Sx9 z?O8BEFPFgTwbDrYV1@3SVPXQ3O(4hnYX0m+|J9e-r_SYF>}z7Q{Z;`pmo$(!4qB>` zPbtZwrciQr-I7Mp@@%|@QW-X5iOqQ|T@#^BNBf~-cgAWfH(5%_&DzN4jk=rxZN8_W zoccT3{zQ=kzW2HDj z!_L+ijaJjY=1T(iBm0NNym)Jkq7Of*3J#kV@O%h#IiK-({rd@@Zeh*3uy`NyaCM%k z0ZsW^MzT_bJM(I}n6($b%zbOzs!!nX>aYvRSWGv&E12eDEpxElD>%^grlq;^sh*Wor7o2RZNAtBUw|J zo7XZjC5h1AouI+>{Oqw$fSg_VC zK3!o8NDsnRXv>u?4V@qnRsk;RP&v7NNUTK~Dy)}~69`!xm)EbKKCG5zi8e=tkQ*~M z7_>3z?+YXB7=**^j7iKcKHgcwi?F@fAvK{{PRVzbOU|HhB+JJRd_q%b$o6lC zzZ&HWsi8~#OGNBwDRZ_&!?)MYcH?s2)pD&>Q(YO+@^!ZNgPPZ05NdYLdX$mtxk49b zXWOQv@+Qy96xUAq_?_4Kw;$QZj?i|8i%CsfompcenDf&ZG;CZ_K;ATU(rdmzkD? z!hUDWivUqw@H~c0MEWoWDqA4PY96t_X91b>emNdZgqXymx7qTxRR8oSs77s@m=NTw zeaHDlKoF<*)fVJn@b^-C1GB7rTAtBh=`}`;Sqr=_CimM*e>(s5!+$)}XJ7H5w`9Mc zgThvQ2V2#?KrrxkWWn0LgA}U$^&%qpD;Id&j+%(Ir0JsuP?n|b}Vv)lTR)1hwVhGD}|nO-TE zI@`~^=AnZ-pEi+*&HG>?@81bc9v>%rFRHqQewezO=Z!fEKj)9TC0_v@B-vOb-vvsH z_`4uqqteix%}ip3+tqjK=p1GTXcyi}?rYd;Y;n*IRuzq%yU@t^K?as&<12?8^0|)a z8gB~oxtlbZcyqKB$h*QK^CMS(KITOjTfOFc`q;0K*{!zb&B*1lX8+q7qq0}kEm(3# zXnjRl2yz=zz^wnOnDD0R#}KoFsGQL9{ckku%V91PWpn(Ks;l#q^3!=&EV z#is#H44nTa_0?DWSj?}hcHEN{BqS@Y2BH}png*|`C9$UDS~Hq-e|ZXDns2cUa1#@g zfV-=+MQQ*0vy&ZcQG9=~@x1Z&tmi;TSiYShlqRFk88@dgI)Ew++QpK$QR4jpJA+A&VE$Hz8FBjJU&WZhMt>}h9-7FLp z8L0Vor3Zrn8;!M}?tpx^wZ2 zpmFv6GHH%vx;e=oUK8sJi7X(5AA!H$ovQkpvUHN$WQm936@Pm!x<@Q4s4oy=2__OGh-X{09hH-OQ-6D?ve3f}JU2rw zETD7We%O7&n%@Lw^+#mg5JzPassf+AqrG?5oIG2+r;ks8x!%ShlD>{amHC5`imYew z%gOS?)Q15BDH4ug6ZX-y^*>H1ri~X!euxRN9h^5iYwbD_`{~P<2MbBCe77MjixWzb zrPEXj4(*{vsw+9YYK}P|z-^E?*2d8ITS*dedby zNA9lVGGRIrJgH(gK4S1}EZ&X3v}TrTlV{T^P+j{U3sLy$B%wHi1UI=N#}Cx0Rr@c0 zPQeM;8{CT@d+*(c#A1(T5?E6MMv`m4a*gh&xlMgfQiIYXFdpNyi?3#;j>vL^zDL|8 zr;cfIn+r6iXmyITZbH$274b-bit$LDu`y5aIwVwI`uqork& zMQM}81>uqqq5kmI!*#To7cSsQ1q!`^A&h?3IG$V{E2=-%dwhNm!U4kF`fR-VHYa0; z!9a*m_XeuDxdkn-`Y0~?KULqI*9%-8K_x`oVMF}+zgDs;L5c;nGXH%r4*;;E(ve0k3+ znIFN3fjs%Y=+9^1EDX<9ldXFfMxEa1((;Fe@jPte*)aQSZUFE3T4e^+N` zg_ZGeJSn)yCTI2*hi=5s!1Bk0fb|5N|5}(!$Uk{v=_3#x_ATu;nj-|nr==$4m+akt zOtd8})DkBFW(|0QwP#^9v&ShX;~1?J@wfk-wKw;sBkcmsuqqTFa09t2*}^JH*M|^l z`F+lM!S>i>{d*c{n4-AthL0h6z=Pg#foFA0D=HsT>R8TqJ^z4?;J-$aY1B42<{a~$ zduwj2uVmb1EWZUa8G6EVsJe@#-lk(M+5mtgquRz+*e2RTfb75M01h9Ky25v@K8mpU z|39kUIO~I40?cA#45*MScZOWadSC> zOVev^#c`SUJJX}%X7LE7*?JkeDm{E+lHx?&d<6|d?99r~{B<()V47yJ>`lF8vA)Zi zY0mct78M-(XUgRI0(l@X6rW7a>04`uEZMna!L)&X_pkM{ZXfZ6$;(w9+O%c@>8y`B zj3tn_*5#VRQn9{oj}x#2_Hcp!V)0L&M{ zkaYk`G(&`ETCUS_M_9TkIynw<)lNuv8EHPmb=xBds#21i?5Tb3DyQiYe>la$W}`*8 zyCgvy$8^vQ)2$h!Sdmx8gDwWOp^}ixkJ-B5{M*i4H23VTrM@QhGN-y5uuPcrxXbCK zy3~yU)IfLRAtzwl7Xe%IJAjWzb}8bhR2{;N)J|a@XTv~(tAnIR=P^8me#?MRy9a5V zaOSEtb&Zb$s$oUppWz~)BNevu(I1b}I(HO4^SJkJU9<2PeT<>TIbgve+wFG$!!zz@ zm#W?`-9+ZT^&>OV^gfp7_YROr(pn>eGAV+S^6QzT4ap$kj9~T3kF6ve6zBH4b4+Zm z@>_J2lH>=JTa&r7(|fK1k=i~9%|xzM1_@%vVUBT`FvH?0>%l!8SKvYD;-Rh!MN1-B z&8~5$0e@eV+C$@#>DUC|JOuhN%-qzS-c7uzAgJ~!&YEl&U~aC$#o-&D68VIOsBY~Z z6$Jv}9$g-kAAI&r4TsBLF>L?OdsOJ-+(XCM7GZ%Zg0JdfKi)OMZ8aFQ=wg@_qSyh$ zo7(R2+8VFL{hvK@#Un(BHiL+iKPc-|ykh!df6Zrrow@VAJn{+f!{m<`o#Nm}Q>yGq zug4h*N&?)+++uybKY}94A#7@EfE8wLkuB`}bPvP%Es-GgoB9%Wh+g?8rRB}n-fJH; zlm^UD^j~%^&ik!LuX(q|GS}i<9)INLqaMk*nC5vV6P0{7OYxAB^2fk7xPhni3EHh<`rV{f};OScnYa}uMiOu`))p& z1I49wagbnoS+2o|Na`2uJuE*szlOiB68(~dihF0tLw0)UOUM-Y-1CQPXf)vns_>`Q z+QV<&7RSe}{O^a(Ds>4baYb^&MIXCOCNPaz$^?Xy9NU-lxCw2EQvkg+1Qi?)^7|G& z+ShDKMf8w$ZVoRiIPgZ!h}Wwf8KY!IK)+_8MD0@PtBF3E_Mfi15|fj?E>1^FKUyWz z<|%m~qJRd!C}()`0R;WWeSMvlXJ%ee@(v%Kq~^WspgW;aR$@B!-8lGgR`TT{?5hc? z*Uk2DH~KP;CxCu_EkN@dp7+Rum~K{MpseJilekN^-B~|5dH>fb(eDJdTux+4d)GGY z>2IP(YZ^=JTzqlBL_>+HXQqub2`w0eRTV+SVfB4UZ`u{Z1i|$*cwRK&v-i4lznCW& zi`Nmsq0yGl9as6!qpFS3sE=`?dx}B>55Y7sAsRuPsiu|}HD6q`=ot93Z@ReG`Isk0 z`NRE<0kN&N7rj^&_`q<(p z+IOUV`UcPa;&XfkbT!Y{w8FBgAE7juqd@jotev8#c(GU7DH-%VOkdR)`txQYg8Mn!Omj$a0m0=Gl{Eji+ZIkjLu;u+;= zGmaVkz6+Qzn;0kh)*Ldua)re9IQ3K+coWOmfV3LZ`FAc@J2ant7XA^x1%aLb|Ld;r z|Jz-5{puczgfKTb?7tQ78S$h;SEt16Ps$fcMMa<`G)~upv6*elpY(nSZ=awt3`)a+ zGgCZ?10@3`CBXBW>u!!u=Rcm+(QTkNgQ&YNE*GR2AsVkQuZuZeqxPWwt9KZ_e{96M z9V|Zs#)SGnW*Z(|vW{9e0qS)j-6w#m7L*(flbqPt!P)hO1I@(8uoGkQoBbo}w%ATd z!P+N(yY;&dWA>-^JJG<}DT=>exMpnu^y~l4`a)W)AaDl1C3&HA+5Dj`fQ{F8dRJqU zvc2 zrHcc_zps4?VRZdZw&a*|=iK$$JEcU}&cM(!bXiRJk#(JyHY=guRq2#ov@3!(4XWgK zTk3ggKk*q0nG;p8fMiO|Qw>~eJ*|?hj2TMiG<)4TqWLX>*76FpdQZsLRrXWb6$>^^ z(pyom54-)>T0%K`C9}Ff#dn(EZ;cCQnC@N{_aN0=pjSJMh>XL41_m(@Z05FDGkFSH z-A7FASo>M;?MAwt`@iL|zT^K}U05O*QO$t{_<1SM5*hJJfMkg^A&&g#KmCndk(-`9 zbO_Qa;oavUbFp_17+oH_-cI5t%O8t?_e^jhU>Y|EbGk4P$0gC=xSVviK)CI8_x`TH z$oM%*_O=(F#KX~}ZI}chxJ`||zJ6dZ*k$b~LXvuy!WT8E8JW9A_}IU3UFUv9$-4q} zv+s%+fa$D!jI`+USb1z}LuwkkGoB-xtXfCh)Mitp6yox4rB1@B{UfLbw2SB{gZIUE zcXGx+w3O)6I%&6BC>BSN>oPG*>~9oZ4k#6DsC^gCCnpIZWuL0r; z^q1V3x9t_`KrIvX*d&UsMTf2vrv!z>cff9E$U-(89WO*1s&>FQqD10#!-JMA*(H$+ z6=1DUy0_XPcV9{Bju^LDn}?x92Gquz*pI<~V{>y`-#3znnrPr7@<`-V9>bZ9Z_tH5 zDO)c=TI;_Gfy)rv)@h&rl#GL<7je2W61(CRX)&?FssFafowE)Qxraix;N0jvzwH9H zl@Rb8a`!z#>igtrgK0(#)waYo;F}a=Wg$-oA0yUg;pO%(8w-e_U?+dJGq6%X5VDUXv1a}E_S30ckVhs zyAaL8QrN!I25ZUmIwMpPHzucUc2zVc^%hE3>6QqrUo-F{s@@-R!ri|Xw~Bm=+bx9< z8LBRMKoAbF8#(2CYGAs!l&~$-rI?H@Uf4rY*##oCImjtznbaudE(AD(h+UQ@@2!K8GoiLsIqpsCRxAl=t-}D)f(BTVT6!1ftx| zpvnnnb*xy)+#XovYu~Y(Mefgd2{lVnwq_6S09GdheE5O{gtXpe>j$q{b}-#ru5|2s zghd#bezz0J(tLS*hyBVfiu+~B*N(-UfUC1cF=}4GeeIcm(BG%yp#|XJ&@IpcZqrOU zbS&0v4i42cFc4_O+*O-m0>UtBGmkfNH}CG~%-JzVqy>(g#zgnX?No5GwqMf=@p4VN zaK8++8~9>RHx^}J&TnsaIIfs2q?egqOcp#}T@rkxbXfV(O}8v=N@YCApn__$q&RSO zf7{BQHzuwI1mjurD4UaAk{;0yVTp{s=j9%2j~nN7fL!od!<_iV zc-wZqjdZ{c|Kv>MWZ(tbmnuHcEynk33A+@}u{V1&V<${w5Bn+k!^_YfjCjF#4CTFg zJs4}Dky9^!SSrkV^w3SAaQ>@NLDjL%hR5L!GK{z_h9k+iVO^jbfpsi9YAaaCXPJV0 z%MCPM3KCKqC{r$8^H)Tc}0p4Tj=**EB# zZ1Kfy6M$`mDoduCqp5?;IPt7boQ13prz(N?Ehy#@!KZu?q5@h6Z(BpQCqD{H^P6k9 zw6xI|Y?JehkF#5lZua3^*bQZ6cYrnmiyoaq%=i}UNboFrvh7b$ZG$*1Oje$pmJoz! zi5moo^&sZnt~SntHA{_>TrVs#p_X8(ZC;x?HnR%4g@E6CUfADPb}@>m5>P5pxGGQ| zCv4P)p>U}A>wnL_a5*ZEc6CcoiaOzgv`JW`A+;YJjip*(Za8JGtjvOyN=8Z*>ip7I zw98&L?9O(X%}_oU0ws1KekN_a*;42!dyO10rfVlztv1SlI>D_yMZ?np4rWO|S4^}i zfOeDf?mUzYXb0y>HtpCiW5yOWHKU7bm4_uw1`JQzoHMEqz~l+G;`JO1d3M`ZLNO4C zcQnn2D>tOAnmsD8DmP~!)$iAuS8P>`4&(h{-<&e3vGHKRa_kNT6?OR+nNY?Av3y6B zY8^2!o=!TGz4|XjwWm8S$g9!^#^k-7Go7W@kc1D0W7up>em|&$Hkf!SJCJpPd-iVA z)OHZww6cr-2z9>Z1*NwnN*5x(RmA94jGz&M4=o*3fh6tYkVKin2W zL$U1*Lw~=ik5_eb&Dasdf9?noLUAeAZ3*?I$m~qPWgH)xkf`#8)X43zyi7>kJ<>WP z1e)QWV^{{nI0bg8jTSRtd#X?3MFX)aG0Q*o-JK^@w1kmTB_uCxdmE=FFDCUoAZ{8; zIIqNBlO`05Bs_|p@0{_~yZjz-jR`nEfUPA3`(IvW7Cu11I~(R8WCcKS_BFkqxin!o zvG_;6H(MU#9?yJ!<`J4kMAVc&hciaCUedoj5b57nDtrE@mgmH+i ztv2QxW2@0E4pa{1N)%%mr=)pzO&6@7-wba_xyhO zVQl+qOokOcxtn)liS{(u-gjE|Z8HZ(5I5)N=SOHl=U6jj{sN%Gt7ayy{an#7cHPZk zx_?8jog&j6@&lb?zkyhdtJEK&(iv8h5CyA206_oa>ZHf<=E^-Au(L}Jo#N`7S2(hB z-_d88Gj#ssF$cP#bkF8bC5wrQq)~DnL$XOrHuB)ln`vWZ@5L7Hr)4i9Hfu%el0;Os zL)+;eB_7bq?^5k&0CU8`5R`Mm(O(+`fF#6<(+|GQn>3D{rCT3wo|=q#)sEFWWy+5L zmE$FZd;}t`zS)JBYiB^Mk>T4>8Ws@~=fkmW4#9GV;$k{k!GoOdnXZIJ5^9X6JW`gD zqmgRkb!`Wqe3GKN>K4%^zTSa;5zpqaK*w6j}zR2W5S@%$X&7%I; zTlKjlMbV8H z<^{W<`P&MM7#yZnk)xZv5nf^O*AC-}^f1)ewT4jgir;;p5{iREfkI~tOd;p6AvuptPhN~;I-Mz~01FH8 zU=onbjlG3lq>zH)5vCix25);bFFVPgtQ9r3E^RDd%%&VA?yYq0bq-**5@tIGNGtO$ z;8dE}xe%;eEfwQLH6M@ggOggF!+L-_)~(Q21qxoYsyjQLK>6uCMK5*BVu>{T0Xw@p z*+WPS$ZB+>kBPTUJ%_$Les^U8e8R+6vPXhN9ygmZVEs}VamAdqW!+#{dBD^le{-=P z7kG2F@AG`u!^fqzX&Aaao0~pZV=p{?%2s!QjjWVoSdkEgE1Ic3 z+kMp2iotz9O8U()FEJm0dEMvRw~T1KtdAZ%xWCqc{zwaY*R*xL%E- z`A!q3mgKKSV)+s8uU4u_Mw0O1JGL;KG*P9B?0a+6*3~5{PKZS3#gUy-9cnKYVTu{k z696hW&E92qN`8aL0`hmqg?YT3iTu3H(c0fYVTcS3v$3BHe&o}bmb&!f<7NBlU$q@87f%PLWGx+%MSMyPPNXSJlg^CHzHCqW z0e8Y+sSSq4*1L0Ck^-~M79LvX)pl_a7hZ>QGAK_ni;zE%9}KMmwQZCNJk${$IP}Ly zx;#Kh3vSxPbF&cH|dW?MKDP}9X{CH-1Kj`I!0t(mfg`&)e-~j zZ4x$k5t#ywf~9u~@Yj#jId1kma4a$ods#>OJdKk)N@f0q8KG&@ zC(h2Z$zQ+M4DJx6U}~6?ErnMe4#7^l zIZCeN?oZPdVevlD<9#9U#&8czXbtemRJv_-_Yq%ee8K4+v0k(#VS`=cV{j{+ z(ac4ZqB?R`ob2JW$NowFGP2R|G|hlZ#Pekm)m>egw#a9SayK1sjsNhyiNs#F6<$i_ zG@_{Ox~`4KzM}QPmeqh6_KrE#&r(c1+@S?<gV!}^;QU_zNOh{4XG2GKCFYF zB*SkbgII%KFhrszKZhC|^JFy7>2y(ABssZ@y8c@AY{4ww<*1b*QY%S!=%~>1rvvo+ zIF7w=_p0r8C)T)MA>7=h6rTwXSRi53^ z{CE2KEl9i%6W7#M(|ze1WuqSkNj#!!eQS&G(tfqUv@yxNxP0dB=ykEIby1e51!{rW4}|)EnKGJM4DV#I+4+u(CoC(_HI+0_ZnibYZCbid zW(<&nvQ#`C_0CqTIlQAiH4Q%?*Nv1d+exAN<^T(6{IR{^2ptiNTp_2t$%=vQt^rx;BWsrp$nnt^KaZcH?`%Ub+M)8cs`}HsD+jWf#${ zubk_ft_fGB`r^oCAYy_bHRoa9AJ>TUT9nsy1^b&Xr(g?L=CqxOr3xK6v@8huGjAoB zB^FbuA5UZ5@Q!R7ia9wBhKgp@O@;j;x^NciZEGZhMa;yk{rVxP$?R_(v_##5g~mSD`!mbcI8S@y4E7SIZEOe7@dEi_ki-wS@Yx2mO6mz?`H0x zQaU3m;TeN!a1jB&bLBbvqz@!LOck7WT%Fw|N1cIhZ)x6jt^<)y{<$5fOyW*avES+) z#|OA>Vx*MaZY*r)p%?)?PU+PcIAe_j5>Izb%OzTPYDK#LIr30t3x7!aGG)a3>>lq- z@jA_B3ki@ZvHXj5w=`bq$4sF116uXH2b1LwMpwNHA-2mwBMF0*Au>NYK;BaCfY?}{ zA^}Ua0c8ZAe7JstTpStiqjMHJ8o0SXSk6u$5Xt0~9FZdfFgtru?rNH9&)pQf!z4$H z>s1NZGfmv2gYB*aDB?$BbVvFD%RtQ+L+zcGQ6=MzH{PpX2=h}TW4@-n4BsXr$C2S4qLhn9-_>>$>I`WTVAE;z&6{@=S7{ze z3h?aDU!-PnSWWt!-O&6T3-8*JITF|MArMxUuwark!cZ zX-7qRU>ilG8rP}4QYyirrDq}DQ`c5Uz#cEW1YG;g;0&|+dQ3J!)!)dQbd2>or%XQz zMJSX3AZH$1#IUvAk?TJtUM-|@?P(7zBvn`zgTg?&qx`Sd0t)PexGD9l>%dq|gDeI7nfA3om4TVs=9j96e zyq|Vr9Bnh+Y1c{T$6Uf$!`X90w3tDRrbCTQMBWLY#p7g&87i5chkt6>-yb#SUu$Vdj$pG@-y-sw9e$5+pT-U*oZb`>B72ly9- zlUunX9)V|UHQWb2`;*KRtnVe(V>U?N3g}uQdkhpCR4iz;*F$bb=CqhO;_*0^hhqHq zVCdkEtD#We&zu8#u9@SC5hyAC+EdHLbY(qV`o#~1X`Lp^wr7C17R@60j-{EY^NekJ zZC_V~UIMa`^bx!4CWlWh$cEncH$-<6n>&rkgC7ih-99amW+eNr+G$p|lo-=p;H zieec=2ygV-I7#ov5x6FUBaXsn_}UFe9`M3 zd6h!I{Z&(vha7b}6kgA}n^4jgIf(}*orSIh-=lhn3@go7%ec6&=WN~Fax+^uChk>j4Rs#oSgw%3ZxmH6}ehT zh5C2-nvnT0Iwb_f$XAtVo+8sx<2UW6_4YJzS^54Zs-UimnCB~(_PUl_FRox-w%92S zmh$0fHy`A3IUw)f1=l*}keZH~OsP7JBHtI{ccJ=DW#w6TkED4%XkGWqZ){=UwW82M z9vWBiEJ=H;`4;k44%^8nkKQ5uF_9R?0oA{!NG#!`&Nu^|l>fH#zH67zqxAi3r z$&*JdJS_djRD|`1dy{(lP$*2JbX228o?D4 zr_mR`)zRA2Nk?_Rh-!FG)T=DN*sOcB%Jhe%tJoixCYO_Xb9?(EKxTlCR{K-{>uAq- zjWz0hCl|TvjZC)Evk@FeaaJJ=*R7KI#?OTJQ%z%5_dg*`-Pn^tt>i&uB&Z5 zAs)U=0K;;SHk)zkN7?g|w3<>`W8zJ}>2dHQ_}J=51@Depec- z;3i1!C%+}kZ8ziW)i4A}Z_=duEj0Qkn!;|CldN@-|)}%o-tF7th znRq1eumB1k@AI^Pn8jZsiT&HEt7QeR(wv3;(+%C9;XqfVmWM)`?=)zdb7xbpo=kil zRSpLLC2ekm%kN+?`LqQb`QTyTN#(*epY`hC+LS=tOzB`{N?q1inTv}SHds1KrIhl` zqs;M|vOBgR8cYLIIJ$oor$D#L3OyrDzy%s3?=&hD3Hufx*P^%9zuYz7N1 z9&`;?!{);o{7|#yP|mRwq;_;>Vq(sYHDwS!!@1(f7HrS4(5|}hm49Mq><-J_o`sKb zBO6W{(N7U4`~(H=;|Apx90AS%`?0b7M|^e{3Ppx9Uh^obt$xdx5OOon0xWAn<`K1i zqZLOU&9UXl>m%%^=hwRu&d`KBe&w##;71d1dPUv}cp|RE8I+twNR( z^A9BXhZVE{aNsfTioU~zXQvzShIy6f(I9BBF^K?bYyb=#EamD}T=C4iMlOwA`_5BB z{dcVVW?e4tV6Ks!A@y#2X-I;M3g^-m)!<_2L(R;TBNx<#${_rs`Ix$Q#Yn#JaBig9 zT2}Z=gzAmw+BC)}Pww$54(({5qKa>JO~f>*cOh{aC^>?94QHbH^b=e$43<8}xa>_* zbIiclB*4D*RfUoHxGk+h9WwP#T7NY1CG@%Oh6#IqG7n8iaC%31aaLXkyZP9(y2f1d z=L`*SYC!u2{Rpsws@qzcUd&2xs=L}7I}pGt3^!{K)+T=|YRAE-L#g`gkXwpS>Zd|D zn2Y`TKmbWL4MTZMzO*H*5`9l{LHcyV+DbsRa~5--7~Ptfp#@O5U!oQWP<)0UimWPXzVDVaTO zP;0khG%AOgY=6aa&3u6#s43xa?V`V;ihJ`~w}3csOY)j1l_{z4!A6N9th|`6+u~@D zwSd`wJTH{s%7?(7@=NCrV%M^Kj?%VWBcu^d z5gbHtq#kxXzwkbg&SXQi8mQ|T351myp+>9prQx-dGff=%BBST=_)OOCnp9IPWunEZ z%5vCi+AA}v?yy8vp>?ROcV++vqorpP7y7;2RdF(yiz!T=U73~38OQ8PJxmIfXy+z$ zWyyS+HY0!>aJOGLQlO-c&`%zz{d!F*PwwJF1HF29OJZ;@ca{PeIw*JLhmu|M)F%S= zVUefB_u`NpT6r5A#&VDDJDZSE!{L8Igt6pxP)yidi4E z^3w%?`F>NWTDWjsqLkR9nNzE(FJAt?{m4-H8ZwZyBlL>(oVk#urJAO#e8oO@f%AvS z101M&jnr2lTDw^DT!oFjC$A=Mn@`VoMRexGqO$8lp`*@;GPaeW$prV+j`^(vc_Rfb zLPQWuXtF4?S#1R@@k8g{?YyFI8XDN<#KyqT@dyUbVAO_pL;P=+G3itNuTL{-QaN*P z1~UDxcTdEwSr%oSA@4HFJ<_Hu=O;eHFH+0K^0(2Eqn&a-jz2$Mxm)WzHsbBLv5u!QI zb}J{~O61%*ORV|XXXl2HDwpbMb$a#AhctPKNx&(zQ%PKF44_VqduK zT0tx{Gf{oOxv|Q=^_0#w5t41DX5)jVEzA5B(a~(QY^^kG>tE&}kgo11jWQ;t;j$Xc zlZ$%VzIZ~i2aH;W?|-Euv;V~f&}(tU_#Qi8yg;A%`5EuQawXGeIacKn)N z&q>Va0zGvL6c}6PPH0XCCNj6M;NONgh_44GG#?5R!u9ZmIkzu1qY!WmGR=`}+2Ez+ zkHVQ8#M7*l*yFJE9(y&FAxR}SU8`ky`%Ohk@b9(cfS-#8@ zC3T#DYf&*yZWiU; zJKlf4({X{)e9nk@G+8)`@Hjj7>KPss9T$Fd*4Q*mwM$mKdUJLy|5h82urJ2|<~asi z8qbrj3m(L2ij+`0vP%UF0Q+Hg|3Su*tc8FpwN|g3KX9Qsg|)^(=clTgNbaqYJ9C;@ zPDp^Y07A2RgDYpK)IIjHnf2SboVMsVsQk!AS@`Kc2%b|)9{SKe;GbjCbLoGBxWV~X z_ji{6KziPsp=kQd2JgGa4MDiMqf03r#v(nQ8eS=94kgIG1OC;cIYjMWls({;WIA-4 z@l^VpUFGCgfw&9`zA_@uJXgM&o1>3z>iU)rtv>f?gR^>ehd>E9&>C{Oe~ATd7z?}d zxBTpvUXTveiS5a?*O~IQO@4_-)#6&ZEGAo~V`Reu=QhyxT1QVdv$H3BlJxxkb#jza zd!t`Ue#}un$lb@!bKM47BEj4Lx&D5uA@2Hwf_zmA1)csnZV=<(aVXiVzPIr?XG4G@6IP0hw!L> zDNsXSOV1d#jQXrE0OYzgLCO0{E?(|w^@70S?~xaOF?F8Mb%3=m^6(GmVg?mx=pvA? zkK||WZZwc8v-I(oIu5LSN#gWJyG~xd=cETlCg*)Sm6&M#cwP-CFH!+7oL}17t0|GO z$JLXyyO2GS2wl1F{?ewO_`T}gewq>B?-lg^GpCYumz?=t6qH`&=I96d@SHtg|D14s zs;Tn_6g_Hhi0Q?`j(P@@(CqMjy#TsWr(p_T7=8Eyt*GE0t9VX7PuVpl_xNm*M=>2# zP7vaam*$@CrZTEOSg7QkVn6&c>3&by-gSr)HCi#_nXs;D**+P2KOpACn+(iVe}{>A zq97+zMFMO*Y0!=rpJ9-~PCG}hCcD!o10=BDwD5yRrmJ=tZ%YIppDHFr*rm!OdszR1e5OHZ$H7AF%cmN!`-SiaPt9H zq7Tu=_VT9WxI1r-zds6AcgSZrUr0r?DkUF0R_z8pI=&5$4AMH-}{fn@vIJQ26<0HM1TPvQP}UFiB1hC8!Z;Lt0Bd@*&oY~D~=XlD`5 z2cIdp1p-=#F9D7+kpJU`%)XxGyah30*?dC+j5TgSvxtCLG>PNJPH@idBH*a+78qy5 z$CH79!`2zj2ur#U*Z8s?uYNS07j2$j)=e|<27N^8*47CF>`$1R6Lj&{c>`{+irA}U z|3@CdN3D+u3WlN&5BA}NO>$DlJbHp6IBt?uhVr}Z-|%m7w7n6%Ag;)mUYhmZL6!l= zX9zS&`%wyXjXw9n1bN%9C>bQ+2%J59v_AInAG8!tp8p%-;YI8}JSfbF2xVPmP(Nr| zfuPiTo%?)%m0s{myQG{jTou#J*<8}8#BZ`BoFU}%DWL_zI1HVBY;o} zCJMX54;49+Br%}&B>4b*6|A|%wjULRR5((#D!Em1k4p&CqUSp~YA9Ota{q2t3g47f z6?3gHGYSI=GvL8=?dgk>(?eV0f#F>sk>cWLfqi975=W>6)YKK|qYIlhhF#{e}J$qdWkxImead0)3f;`I&jwRM#;?+R8Os9Ss?achX z86IbZ@>Sc%-_S*-4Eqat0flxeGPPo*xXGvlr9cO~GGpBnS<$8a;Z$=?}D4Bu5 zAH_gJx75xZ+YxoSbRuSkuS(s6;>g)kFU?}25&C1(5qg)@Qo0gT3{Qm$!&AZ56au>G z?W_ViIEOkwT*|S84|!4WKaO63EJDP%HSj!skPa+2j!yL<_tN31cCi$)xj!xjHXc5e zl+Kj)J9_ksbkoTI@=iJ5UP`OV11^83Ra^f6&c~L2y!Xq_^Xnn zKE1Z3ccYdP52p{07rFOvtfNYjM7+3tOXVoPN;e0x@hhmY*Qk;b!s!fR=yEtl6|C%& zenHrZ>Emvyggp0ESB=C-EKi;(>aLt?qL}+8Oh@ireSqlqn7kGpa&=jNW`G#BHW~6a zxx-SSp;ce4-*}x(J;mexxP;vV{-AU}t+R9HSbkXR;;nVz{IHXTrwr-Uy(`O$yPP;1 z{c5Y_8NW$mPOX|JQyMZ>HU>Kdfi6?UFLx>K?$V$6Dv~i8RL{WgGr#9hSYPF&)oUtG zDzNiT^zu}PO0<(@8pxwTdHvl&dK>a(`)o&;16Qn1o;Cg;y4q~sz~H;WmExxTL(1QH=Uvkt zjqxh~INrsKW}Vwi`9tG$Bjz7o7~Z9ly=k%Mcs?_er9qP?w_K$+H-?Dp^eZApZ?~C4YT`p!zCVh`NkJ z@h3WDaC`J!e*jH?T+91Ur?KIP%tqg)JzdkpKC)hl z?F?A2F@%UB>9E(Gz7+@0w7-YQqnJHCArP4wFgHkw3$?zz93GibAFBW4Cd-gKGJ-ZB z3X|HJ&^b%Wvh`YZ(>Y4ZHfQ6b9!1jpj)Lh!*k>2s>mz+bWoX?D_`MN|Gnb2gH~dG8 z9CkeZY92F@iBF5%+E@wWXJ2(D9Vt~(gZgs|uT~;E(YkB!9IukAXM^L95cLNUW_>Qd zbIa@{YI*d|qD)$@csx6%o!WvnOId?vSqEy6VXJ?f-l-xEnwbak2Sz&|Qg^KqKB7$l z4|9#aPm~}H*mqweRtS~zF2JE(n_by8)5y?Du}4&{WB6q_7}}>?9UnEkb-g8z<%bnv z%B6DhD4)r7#9@HtFeupK-RR--qY-DoqXVAKJMcFsklV~4P&Pe+kPt({9X^#>m&10V z)n^bH4E&gLM?+0LOo6qwbc~Bxb5Y5|@Fcl_doY?YfvHnXzMPA+-<-2{s8z(Vo#zsp z4$|0=>-BssO57dPb@b#5iPdo>eWv=&+W{UW`UrmSF7t=Mw&vqbzuy$)i}gihhQv%P zelE4+Nw%W~hVZ_m$A9nA&zEkpsXITh$99;1$5Aom@{4k6Hv-R6vACTFJRK-1^7Npj zr+4b-{8uxzUYTkk7(=2h@x-BHyJ8)C%Kc7{x7B25#~e+FBI;!^N6rCWjlb^C&&*sa zIN7LI?6OGon?+ z)4F?ii7f>zf6dOSP$S40N{}n9pD$XzJ@_RNQEM z*&Tk!pKTT>S<97~I5+bRPCo03MHz{E2oeFid*$|Ho35H-lHf2WXZ2SoMcLkPk8TsY z1M^MC@PXO#M;#$qa`bR($r;763Q~p}HU)Zhx z9`CWJz8UwcaoA)A-9C8%xKMJU#x-iF_0q+tA8=B?r1Pt18H!6B1?z>wCQbSdR_-ji zHE)~bh#fxT@h99KumSA(=#>n5Zgh^ZL2N;eO65idQ{4PExs&zjG^ZHX2cOAX4`d-|T<3*9QG1j#Oz&sn#K?edW^BD#bnahvI3 zElL}JsU8nT{GER^A8wUK<6D9kR{THT8f!4<2YQ8L>>u$beg+ec-lHME9TBZ7C;B1 zb^(NJGoo7qZ7&?xiOxsh+|ts$tW;5OVL1z=TzexA2i?Q|IJwoMox0|l-ObmiO@VS|Vx@ltPGakUU8T|#EE+g~^0cU-i7H60ngq%JZp!Pi>mGU& zozdpVh@n+ZCl%g~e>Q9sbf6rY0vhJz=<9hHh&CH;0As($2x;{TfW`%^_pMO1u^A?w zLH{08a6Whnw1mlMfpNCU)jT1IGJbM-7{FB8m2nNq{#`m~c#NihWF|zBr;M9^pWSX* z4FzxB!20LS??`$~MFMi1rgr`~cFkHP`_k>=v7N?J-0)5LKzhwFD<`%e0Do2&6^u4p zIx5c~+%y+%s{Ahqb&}=Pe(D>o{Zq3s;~!zt82Mk2pz*a3@LHAfb}D86ZLvR=8m4|*Jt)P}EhhsSb3DGx~<%2Wup4*TO7JxPsZI%hqEu15EU6Q3dX&Cc{ z&0x&OFN~YZ44d0&OggLr|64CH3fw>r7%zw6snXKHd;mMf!D{lx+!ym#CNS^(jcH)* zeI?nw-Thct=AAB($ep6(%aMV9ghK#LhY#fLb=igs3OR&*y!U>Xmx)BhDHaq_EAEP#R2f%iEKyh>WOv!i3foa!9ewi+R z+5NZqZJhvy(0}+ktm*%oM~pn*iC*X$w+Pn`z7IRAv=AlWe|_uU4|HSNyxNiN+53rb z@SNTEL~pQ0B~jA-3y{3PSpMlvNq3C5h0UV>F{w-NZR^?Iow;si(wP^2+WJmzTw?H~ zg0sEm@OE!F0z3pedcH}_)*uXgo5^F>JtrTbp@DZhP(BPm#+`ZcrF>I*t&V)Q@rgJ@ zK=tFWoo;u6Z?)}yR=p5#%s1ABzhT60K=kF`BH~O!fh{iw|$b{95v#0>?V7{wEf! zHHjh6Fn>_Zhf~0&~7Q?~d1?RQ_be_93W@KuAI=TE(AZp>U8_{)hkf4)^#drhzB|BL^0 z|F08w{--Mb_l3j~plDq9T6V_-*fXY+*fVD=VGOQy@b5N&)Wvh$uzPLVG#NDQ;eLqY=f2LluGi~%QAyi!-sek018y}Z zg^_pH{?Acu0Tigj|0N8eN^S_2ViB00-BLdEe|g})4Buyoiws=zzF+Vjyzjps?~2RfTS90~25=+^g*vMQ z&0TNubrdAGk-BCCcA4~T>wA3qk|Tn$7$SNh!vPa-VU}s{(~HqNxX?*`|80PZXyYCl z^rsze^7^D5F1Tttpb-nLc=zvf`$8Is@qG)6Rd25|Eg5ZQD8{xM_$}OHrih^24PG_} zt2i9KxATgq6`b^>@b&vnj9I4Q!_s=JB?!7lDv@CHddDClBPKI~dSxmOZZzoAUiXIA zR|7I+*CCIlrT+VZZ_HxhdWN_^H-7MrK2b!*2cyL@3;+Ag<_`4NAv1x1KsV5z_rIO; z$ruoF_3rn4v5;M$%(!qu6({-eh7t0QZ)IHN11C7_`tUh72fSb--2l+5*1Z zUb2~A@8`aZ%)mJeL^3#C=9JTs$4}l-`QIGS=%E2#xvyvT(7kI+D9Dp3 zxGwAxE_J#7CFvot{ND1?D$st?4yPgtRd2{sL{bJ4(_+SUN(`31nGr0)H_JUJ?I(;`uAhw!l8T_c$!77p4KXgeH2V5|k+<>E z@DJO@d)pvDA(oJtrssSz%$GRfOH75bDmzlc0-W^d;PbM@v6kbTll;<8F0Qj9Jtnq$*FKo_&u zj9kMY#Mfr5znsB)-;ZIcV1k0k+R{OWkae?-FK2NQYXmM+G}n7x&D;7i0z^G6{_<;i zRzPx#VOO5p79R3`gVXj7Q{mAM@Q)%F{#3xN+*jBIRg&?e-YO_g?e9w>1Hcmo>=|&u z0kkxG=YKEp%UQ;Y)k;q}PqxacYi5;XQdOg#9*gRqWp| z`$zEIGkliyZhTc7f82dijm+eAL2_Mcu8BWB(m4E2UmcbH* z4gO)ybpd@jW*LvJv}vuj79x8^#9N%=X$CKQerQs=rp|bur}kz=y59>ykfkeC$MF?Y z^u$^+Dw3AlKBQDB$C8`yI{%T~B(s(nfs_%{&}=q*UhA>p&j=jp61 zX*a~e^D9xG7(TrK4Sm{H?G{BuY`>HLTLbwA^s>{&W7SjU*eLJJSUH9 zSt0|(1abv<4cGBCr*nFbgOh|ly8ei7G9X>GbfMey5+VeOdTBoFxR7gi4ATg3Hr#>+SM1{RjVQVu8A3og0Xt9cCGcS47u$VWKSH395;f) zCOF4o{i@4y9f{NE2Y3vOdhu4*P~@;y+`&T7fIxMFNZ`I_^3|~0&bKQXSZK9;48QyS zy(pnb!&|$EZw$)oV$=T^g9?c#@SFP{8wwfXi;^^|aa;5{YInhgAZy?{k{7e4Pe8fH zC#b|NTOX2N?G%TqA$Uhm-2_`wY8u(KNLjHnC!-JBTN1Gsb`ZI_--BC_zq-m`xLQ;ii<5HUyg+Ae`<~3|5cMtS&6DN#Gz9d^wub4x9 z6Wy%p#ffZ>4pJZ8klz;x@X)~HVDqsr&2ZZW^6#k4D0EEA6p_on~ia0 zyqy!VmnGkO3I$Blwq(O0s0V=kT_fM-Pt&xDKupZ@U*y6y`m`$!W#2&yG0_v1kdfq? zedmT=_pr@Zecp}WMaFOt$O0EH?j65WKa=6J5Z$?~m?s2fCv^Woe?iTth%?}}KK@jm zvUh`X#&mY>RgWA!{#_&SSnn_oxv@SQU`8B%H}v3!*OSr(fq^v$168N=V|w*t+k?V7 zN1f$syt8yrbKLieM0dsgxeU&!wQt|o`QLdU{(vpYl{{)_I~j51sE&G!DLd)!0p&N!2UZ>kF}69NrLpVB7dX zuq7YnAyhJBQ8|+fRgvAO?9 zGR5CRjy|}-F6fxYB^KnJjF&OSD(vHV3l-?C>A;V4TJE;TZ^Mf=ZDF5o68luZ!$g$ZkWLD`D3iUWN_|p41UKvn;!Fl6qyixO`7B_M3 zVjVpn&2y_8_X@eb`j)!i-AxLaHV0EQQiWR>C4Q_dpEPbgjBs+=qM>%PCvv_{<@y0& z3s7AJ$#Tzn?7BzLHa`dpEo!FKfKRu!oEDvImB|Bg-D@z0blo9q;j1T)4%~kIk;XZA zbn5;qrZYs=%&+ugiUWAU|DBd+JUt1wEI)D?>y8L0NW0Wu>^@xtT>Vm;A{O;Ld524% zMF-IOox5V@cL~;ghY(+~ImmnM9R`x(Qi!puwxf2YD@iR&s>agm zzcxIZEYN@o*_{Z6vyKWF35;H}Rai1SvrbDLb<97OHi+FQ2r z?c_;~20_6f%#k|(P4;$P32MicJr5@8&mgOIan|`F{&7$4_Syh=0!+WT% ziRjUjQU=P@In|)A)OvwhV=+-d9(~nj#0$ zu|1h6Yqc61Y2SOm8J+>h-1%6xH@_io4`eT<0b+&)sZT;{-u>PoA>$btn3oOYVZhPUMEX=T@#XjAHl zRJ|y34wE_sWlz$^fgI>bMneW$h+gK4dz5RW$RMqZJ$21^=6-aid(<^&1bKb*4vG}7bs*@3zk_nAGkAaQYb(fH>fS)ApV#X<|Qt*7Qb zRE@26mvg_edR*Ah!E~q(*KJ{zoHH%DF?##Z;-x{_lZi$gXl?$m)A3Q8~(X8D` zzd6jzB~J-a3rU%o)eJG!*fv_7AD2FV?uN{F==oCad6R#6DdJ6KVNy=XU9CZQlLNIL zFfADM5zDxW*REyIR=y0P+30suhrSS_P6Yvbqi@+SF{!0_UFNv2W%Fh}h}1V1c`9L* zV<)S*L#qf*hbLEDmxf`aqL-3GGQId6tAnWm%e`s>9*p8j=j6W?WiRyO*izo;Gbf>g z@(+HJU@niuUr%7Y?jH7PU6dUKo7y5RH*393Ahaov+v}~bsL*?#&$2Hs z&VVtl`!CYR5clw$UoKC<$BL~QpN@%?^njn+{b*F;ye4C<>6rWlIrczgbD?z~Eq(<{ z;Xw3Qr9XJ53Qex)?3~!Wdo_oJ`1jY>GX!wNdMI8+U`M?J>0lIJ!Ka=dF@>^c5 z^PPH|O(06w%16?onH1I&{7HJH6WTyrt6i9%Ry2fe|11@j+6|iSG&}uk&FuO~V81!u zdUX28@EQ*Qz43CHhEe3PUyw3MK*QR~tg&(qiU63vNAc9{#Gto1`6@2R_B0+4E~=5@ zrgUmXYhbwY{dEb`Q`7vxWy)Dg28~*d1Q)#xRm6mIattbUAs?0^xR@8J9(Lwsct(jFf8oF&B;_Bh zAX0hoS znn_78A>eD^v`Fr@P2)$GWy_vbBNyLXmNd=kd&jPCnv9LRUjIfujnPJu41#ZK^tMa zX~Yd4At)r@9rN9}iVL@ZLS&?donnqO>*=IFdL`=TELJk4b24W%95(F3kk)qe2}oE< zCBWS%nlIUWHjN5N+(RiMOJGe25r5$)O3wv1_5YDb?l=V>RnDjxupD4$li zmBzw>5Y##PCiT0|FitO_ozMY-5{Sd4v1><^G2P_SCVW25#Qa^O`P5r{Yh3F{IYD_N zD!)SE_Z~_$@paG#CDyed74(IV$7#gQ4Tv90!*+h{fkdv*Vi(RR7-ni^pAW za;g->Vvz|FfB1u#2Q&!armYQ#)sRlfw-}HE19hT1#H=rTx#dqj|E6K8K2SPbQTq+-CHUWB`VurMt{%nvBdV) zYHBpIyNgJ+FoUX-6g<0e&7?y2^fI)k7PMcPtzx%3Qa)=+yFaNiRpm&dx={Pmx%jlT zv~kpf;P7Yc`UUB+qJXKa4gI(ld*^zqh3Nw=r8L^HouNp;BNR80zW~wk#njLkF&cgE z75Za(YTypJ4d`3fR|&Gfoh?pGXXz2EGHW+l(m7AKG$DT?`@;0Z=p7r2Tk6M~6`QK}ApN$Gs6|W8t^ZfZa z>N+r3z4$&A}33=Z#-a)|MXdXfcEuM?3@h-WWjFxw`n zl3}0Ll9TfF=p)K4J8AXYHx6wjuKdp*kTsyFTW37g z9o`o#TrZ|#O{3*b7H*!{+*H_$3pafTy$b7BuE`>HJ*AHeJgeCfyrORI>!3dpfWE=m z5&0+uMx&>)Z&V?0tI^j|))#^@{ZfiwbW@DB#uk z@|){TMq@2e3S?%+5!#}S^~rX_?lZ6A?qkQz zS>R)~$vd`LO3$dSN5loM)qXqTcy(SDak(7% zWgSX@90OyhYD0>z)^1L_daPh;7+~~HC(Rr7h}T|`ald=nL{rw-Fh7)7L0s!F$m>@@ zFm$7FB)R!{-j1m6W@Xq|DJ@g%o+!Bl86XKp>jyUlZN_lwviTmh%$_U;*8yBR3bGpw z%MxM=7bFvEdvT**SZ2D?LV=^#S-;>V$^cVP(K<9T1+T^TPJeYniEcy~o!9{+7bPss zqc$qMw5YOR$#@#x-sNfG(eahy;>z?W&uQSE-%idKm~@BAoU-C1VZ#hJN_ChjxC(Z> z*z7V|cwQKnXMD{6H_FKW%<3Oz>Pc~%X6F3I#M&FV#(rhYe;qBaOvGj~=rVwER3FT6 zc+p20pPM|-5z_o25EfUJK5KHIVpkd4dbeHDZe*~1CFI*93WunNlMGtxRA6WtzEB?F z(l%b9mgEhTw+&uAuZSyY6$fv-`lQeoL~32M!&$ZjiJB|&h6w9Wx@h*&w_$qT&rs!Y zoAZ%iH-a@6Q=04A%E#%NxMWgWkpi`J&SnVb02SHAA)d1<`M(o}YjR$|Z@}pLuHzv8 zkvKGbEVP<{`FWk7sA$(+P)-v&B}U6+cfv;grA@ihyeaAF0NTB3DO|Wo>Pb=;)#>8} zpN&CI#iLJo0~%UMjf0T;JMV7{t0KDLCb!FsvGfDhsK1i{kF;I1cYiBqEDc4$e zYTo!!8a`t>xu)_##MdGupw0m#HMu7m@#HS3wGaZFcan)0uA_f1eDX@Crw5L;Hz~;H z8L!1&M(fuQ-E?-$!52Hi^smM!-B9z2YTiRXs;SUM;Tay_mc9t>uF+t0i=zyod!=*= zn&#_BmsmCr)Xy;__ZOAj_Gva5SO1HJtM@2T>vMlv)G~p9sEh-+IeLy*>pbgUb=MhV z{)>K)n^X1Zxy)Xm9G(hkA}$u}1+Xdy=x)RtPS`TxLVH0KoLz@twH7FLztq9@BNe8O+;$1s~*BSY{qMihn*m)#Th4vMWaVvOT9@zoc?e$gg zA(?o7E^d?`BOKwbSr4$$+Js-_+Hmcr$cRp7G}5X_`5aZwEi~mjzg4V~cHpRM_K?#) zZ+uUdj&#pa&FR0R7LxGlom-hZV)c?vzrJ`slH?WQnWefthB`gN()WPQW}ke?!mD@W z)am8nShHPI>BO`2e+H&Orhojhg(Zi|v-1h2*2_ael9w#q+!4-yC6MDGaUu!_U*Gn( zg5-Nl^~aU?0)b#36036XE4+;@u!5>mS>RDf@~d3lWlv+Yl1W91*GwrxL;fYj&LmqG zoy%PllvU@S#31C)6`nQAcBi=qy}2&Tujje}&!GFRsF0{HZmo;)d6nK3#IU3)yn@qlA6u~Vv zi0;*So)p6m6s6<0yl-TG)vZsNRX!1?$UE)ywD2KtNd+hkM6=9aUL4>jGW~%TUvThais{ME!?-;3ypqzV(T~) z$iCQD7*%0bERyLVPOsjI?S=|G^t2#wjkW5z{e;_auCz}!eRQo8_6jo|t3L=+zMPor z=_hNMbXTmee1G~HMJyRKl+AC+p4NA;_L8Om+Ov0dM%l-unC20omoXEBixc7?F)Fk5 zVotHZZaFmZ%zG#WDMv3W8D$nHsnBU`%lV$bRTw5=IJuXa3@gw*oTliGiT!zf5?~HR z&#iT|yDPR)eFS7`Ld)WgDKo2km6B3x>(VD9z(rj8tH=B}!=q0U0@SD5Xv@sI1X8!t zLgGXJ*`1usUV8*YvuDDnqz&u!Fta^YD0(GKOEhK<$sq7s&IGn zrVq=UP?$;|I4Rgj+j(++N9djhA+#&shAE{AzpKor(@ZUs&gmj!vIZg72QLUVPm&m~ z>&au~pWHa7?h3k({Vq79mZ;7k3@o|Jl#p{9$;`Eup$J=ZG`ZHA1(V)58{#SDc~!G>vcV`rPeI zLsnZXvV=va62ysl#rB`*Hy|)EJ;V8<)eKHOoVNtj&|&29!)Fput%0t#$ZmC`+h1$e z@dvP5<>B3Co{tHkx5`a__~x}ap;ye>Mb}m#DMuCBWt8-Ym)}%gu!_s$LA8#3d?r3~7G9a8dL~?_;SGtx2rsIy;9EC3Q5dJ@o#z|Oh;k!zEBD?>Z`rS$iF}YA2}(X_vHMU6 z#-^2*lVeW?e!}0Le1?@HHU)(?lGDYZofP!=gZ_84!qXo5UJvaULWks2PbRKkpD^eQ z+Tp|A>Tr5`;0xwZ2Ch>9e$@vm_0e*J>sDPsWl5Xi04NJd-Si=evIN479rVKd`>0IFL14C%Aj-+pj@Nr>py7>XULo zN@P?0@dr!b^ebbl;^uTv^WPQmox}B3fNza*yl2(p%~QPx*i(F zn=4ctw}Z;Y!QJu)2~jF7FHm2TgTKdn^J&)bXMI%&FZHf(d80+m&bKbovG1M9B*d*WS1#P>MO4{8Wk<>*qeRn|gC?y9j?o~bj;r;#c`KnUe+ zp(HgMsZ>qk6Kl9O`(%BiCDlUk+)ftrh`JWEaU{B#;H{7tc5tHP@g3P2eC)@KQnYJav%`}VK=XR>d^W*mH&N$lvcqOG} zP?C1!iL2gg0KQcgZZ9w2l;dBfb*bHamf@3|;1ycz?;}G{9AG?4G2b%_T^JLyW_$a> z!sehlm>WE@wvW7$S_Re+fD*0wFh7R1%>J9Yf=>C7;6r6LuV+c#Vw$3*F?x^eW_tI{ zM;eYivF=)wgB?JbZk=t#-R8ES*-4Zye}xM+()x%FNPN4+t~{p|dxp4XBdc4ew-_oSvD|9Vlj@+42O)cyWM-zRTYT_f6P~P)LvH3|2rw49nG*#sVDQ~5@2RyRNwTdL5 zQk_w?XO=F1_n9)@9kz>_(Yn4L-hB48ZLgNNvt8WQIzaGej9lbAM@v8n{`S^m$57r4 zV26Nah>K*bSFZdBBB80{qKSJI0iFszjA*!+wg&*fE(lT3A-A*?`_(IVf44Y3n5Gkl zW|5{Nu|wVPq5ukr^lgo)xd&(2J!oC2gWA@tYA!-Ei2-IybQ7z{8TGrCww$qI8=Rs- z@3s+z%TvjWmUjS)L!qR+xqDsHMAzXwhXqJ~81KyV>|HS|J-+4GbN`;$3k%q2w)8-Q zdhO_OI<^*QbA8zLn80@3{ zg;wTA(m8M1Ym~6Penwntf3XIUJ2>pFm}c;W{`uC(x4}?k75s5$Z3c`L>n<7rD_6t} ztOT_REoB~6RaQWr$CB$|8`<5!Q9CW_(_2yE_IZMOlIW2sIbEa3s7-Yg_hq)0gKl7j zyE+%QBGvWYwT?!spUb9&>&&Rrlf}NM1|FW?%KTIJ>}hH{sloxIIq5ks+6C_O0|W)& zWk9IQBYR|X*C78RgqTQj%ZWG@`G(Zy-h)r9LL?w#vBv%BcJG)$y@$y-oprw~P zP>AQQQ5q`~<`7+aS&}i@(*rAf;ZiS6SLDUNTI-`)2YxZm3HtuQOzB|rb*+!R1ikB_ zU((9dJf_&#TX}q(Qho-m+tVeLMjE4ODB?`)AqYlac`=_W*7=@|A(;eN%cvx4qvE!t zeC#Iu@E|KCHHT=1QN6}au#T+>0~w#Ou5=$oKVjRF`igWn95<$mv}XKLg#LM5 zzI}yR;?wahm1?5ki*xFSfBm(+Xa(q3s{Ioc37$dqifpJO`gCRl{eexfCYN^^_z3#KKDoh8(UBA9r!`@Ny5L}54kNKF&-<=wdNiGkvv2-eg< zWP|vtZY_AHex4rCtu^d^#gle|u59&cNc>M?tbxYDbr}{!l=!80x!!rC+(HRViPWvu zzdALE#nYw~_FHy}{yEt4p}l#&ly-%%+Wm<*nz@KT{^4;rcml|ihho|h+@k&-9L@;) zsU%xLC{LUAv2=T#7#UEs*-w;P8oQ`7V4UHg_zLJM7(|v0tq%W4J93l7p2OQ}d#C;$ zzTE$rs*^$~^NrE{qO&uZ^vziSTUE*_Ig6L2`3QiKqjzV-csyA6^-}8Ov~uV@z~vBY z+?OgD2W!o}&g+rRYD^6I^tIBS>5EtM&Dl5FlJ`O-p=&^joJH_Ej0PSn{3beuq{R@G z%JB^H-5BqN`{>OJ{XIIfoVi*`DR8Z%Pec|ML6V z4j{?lmF~Zzbanzi!1daNU+XLn35zm;*h0i!juQ!=mKB2c+w3Nd$Q`E9py z9Rj0H3%)6c^^(O_9p_DY&WKGSdgJ)rYL6|w)&mk+d4<&CjUOmq6d1B3Nb`PwR>WlR zt-tq$?vP$VaqNKYhAMcsS(B3Ek~9BM68iDtNL9Vf?E$|FZ#7;&xhg#>r>zBI+st?$ z)p2-z08OR7-M4eY{Nn|rCktXJk-7gfnB>6crJfJ8XaF5Z-@fqE@N? zmyUkl*6ysIOvB3SvnZwo3n6!6#aIsGHC!H4^4?5WbA5G2TvxcnW(}D|f0k)iU<4;a z2B+WHNjr{6m#KT2a%Xc8$U9tUZe3bwURn&Gn~o?f{wkZk#vP=-pAnj8>Nv0gHRank z#=8l@TiUV!T!cvLVV>A$S@|CBuawVstB?DQ`;BU8uRoG5#GG?D}pUU^)!m;Xa))4` zC>AkL&}dqoH{Lm%_3m93eo*iUI-VxQtF+4w=Z3OWt$MyeB`eJy0@&Z~2|O&BRK*Cl zxQ-*GH|i#&+!BHo`sJLD?ukAc(4smA)5cHsmTh??33z?=RjGSM@Ksn65S##zthW^P zpx?*16_=ok04$Ikyeh?bfD9XGoQy418sUw3(VTURt+Y#x!3Za`X3KC6_FH(}{6AV? zm3ga=hjs~c1L8L1KU*-%;et)(0%mXb-k7B3Z`M>@Syl8(x-ab-MBo)7PvBeNO{eZp zh(37EkHZBQ)BVXKb4}HPLFA1A4Q^}c=Te4-aYQN402yz13Kdp$r2TD*u-2dp>t^ zUeft@c~Z_PP{uSATsEoXsua`+Xz&`=p!uPN8HYQS8UDEy!8)%Z2Bwk>dBZZc!gf7V z0yE{)-dOlscN$^lepn;JyIc`{!qsDe^!n3!CK3@fAKtor)8n&zL+@z;7)QFz8?B^6 z{Wv-&ZEOa|mreN^8*pySE6fMg_Rg~*drx6zs&?3d`77*k0?Y*!UI_a70V;_*ctaD; z^Uk)buEX#~9!0>|{%`u0Q%A(+pQ^a7Xx zx-}GPCy3ru2ApnUme-Ry#3mCU--!(V>|8yhVO{dezXby5;%n@PX zVwovA?duQyg9bqp4!!#?RmV7@o)LwHhc4L(g(lt;LldMN)hP~JkR6!$g=vUwz26J5 z)Nc9f-S1;HADEVL7ZVp(ESU}_U3SFtLg2^g*+TCkbQlj=ivIQktvC2KQ5BnuS89l2 zxDH`1ohD&!R-Sc?8jFD*rx&9CrzC1VCmZ7hR8Jfu?)P`DN^b@ZFQcWzB`TQmmr^g@ zCkjc`hXN6>>`K#8s|gCByu0%Cl9Ib61VB9E)!D7c#PHE-xPuKjj_R z?J=zo2kZ$m)=N6?UZX9%P}(8+08k>0xt zO1~-6B(XW2yKVNwE5v8zZnls-_v+gy(gQNxa4+Sfwb5d9C!!YpBe`9JLEqJ>TDE9MVMm+t3 zt+Ot+F~5%;{yOdE2|S<<$vkrZ05rrVpRu<6nWN0I{%xIoSzP%B2`+L@f1Y< zR|$U9{M!KyT_gH3ft)Gvb57r(NgoUuvgw}78ul+S^|~A3{zrKZa)UPYg++ffQ3Ubg`}9dj-EO@vj8>BB#kDN$@Bf5-}o2^MbS=U!fm z8WqhQ0g|nW`de5>)Cv#NPCMAqri%osW9iu;mNk z1c`3TYbB5hBM4RJh2lINlCl$XvgRz7UlcaFk+}IQEeOVH+a?0eq_2oxg_XFpHm19jT^6!fEur)akb3$S;%nb`i4Bu1=coFz~I@s-NHP zb23OdtULa-9d`K9A@uRVq)_;}8c$1&jGF7xs*v`Vf4x}r= zt{i~K9io|}NC;LONSpjr(U!M~Kv5bt*&%HqvT%&ml1Rx8s6#g`HO+3hJE6EEBxp=><8 z7@AidP6i`B!u?MPT*Hdb{qK4hvjHWvq5`bGbVW<|QkACPfQwbDBS7(Ge(j@fKWaJV zSLq|inM5e$!`?5NcMRYd{h+6hJ9AY^b*De!!v@ldrHblT5$lcDY1UZ;HL|v!3EzHI z8}T>DxBtN=KdiC9;qP4lt@O9f6CjUTdQ(dY3G%p2ov8I#CZ7r>s>(Sd7!jw~|6`A4 zZn&HAKX63+L^~QC-uS0Y@uAk`#r9wJabylOC-h17G}qImRd#saL@Qh)q>r0}u`0Pn~f%s$GW8UzYhw*e_1oq~wyG;Tg;w z4bv4>uH&V-NwB>o@Lf8fO%2X|S^8OB;wjA{sqnGF-`>~nSp}T^+iaTSe$3`QM)&^m z_McrLcNI8yQyAD{4bvixa9G5}>uhH$EtFQ84nXwcn38_(}JBJyBR3O z_b0ONZl6U&2&jCU`EX;vEv<)Zr?!!@f^|H!e!}75-l_>pjj1-fx_4T-I7KReJD9LO z^VMcJ;?67P@z09yV$m(zYs{l7XJSc6PAJe}9E{zFvD%ZLfc9&{Fl8V_nv;WYW6=}V zui~8rrsYb@B>4h1?#X!BQOg`cQzSYT1iEt=Z{Exk?r(~JPptfaumorKx@5tX?J$O> zB}46$Z9tae{ZeG++@!6i3+78wpi^Gw#E25)hGw?FxyWSYn&2M|&a(G8eGdjX*k$q~ zY6BG#Id5oQIA4gs`w9|;f4P>i^hHx!AG@{v>Vvs!Z&W_?SsA_c z7|=kpGU?OppiPP#PNigHufSVtb`Dw2bx;4hL_Vq6S^TJ$*I5ONS~{GK{60Twzp2fD z<*iO(Q)wG8IC~Tybw5aghSQYqkry?#g;XPH!&CnInGOT8>B^4xs$kvj*lXc#A{WQW5sf#5ie;fKac2DaSFp=Nw)U{Xw zW2T~elo!+)HQ=_*a{Q{b{am& z)YhjPhD1e;g_f2VsScNVi59HBuZj>+TyL1+tJqy;krDc&ZuXrOxcvp1x|v{S#)mug(rT^c+E$vz zw>h|KgJY1>hjAAoBKrn$XB_cC;*(Qcv#A?Z8Pbox#jWDVK;rEZusBj zan$k==ll}ywAx2>-uz_ruK@mI{fK^akdojXISYIKt#2lKicJ!63cGm>mb)W}>F5~8Iv1>>Z$^>D2%v$=pspmByNi{@j zMqcGiMoGkVawWb4Hjw_-qTN~mzgr;|nYE*-a~l<5+LCSH(?$U{-OL_GK0goBdfogW zg&?0x`R%NXx3;s!03(L3IdC_ujXP;E0ATG~dNpJ95%j*R%l~R{nQEa2PUfHSu#-G0 z3ad|HY~=UGj0C^F^f7a7%>Lok9u#q?!wy$Z7PO;x4Vr_jwxk9hjBu5i8O5NzrwdAo z{}5~E-)V(A+`|Yf;)`=3&BS=kB74dp^x#9Uub}ch@IvAV6!vs7RPHgr=?x|41SwOr zX??_WG;97f{z1m3cOT7Lumv1Wf$88$sJ6yz`R*LNTh~aqkmb%c4DBPf{c*7Ci{Sh> zkdes3i@=PD6NLr`=NBulH{`4Rk_ZyHPPu&4eArbwXnBUHt}(fb9p+>89z=!EW;)z7 znvF7y37V?A6d@UOk4T&yTqDd4mqGyv~RTj@UW)4{c3q~fUU?aZ1w&8R z2h{!`smS1HsOZwrXsDqnLTCp0rS(RVVRXh2_s*NXzD_|VtI2IZSPyW3?~=x4LHnu) z(BnoeTRk@IN*1Q#&|KdrJC5)<$k^6g+QvXj3J7Yj2L7Vja3qtB`vtd&u7B0$2OI!y zH0=2T)e7Y>VxG~b5z6ajwZfpX#j4bU+%$`O$URZR520hmU00_*j0aZ5=5OD?B`-@e za)}joi;TWM*)fUoRPS^==x7I1L#Qb9?pRmC$D;O63ewr{^w7-Rt_&Ky&tw+ zo*(B^#F4t%^<(ZO*Lj;bUgPL448gt;Ge^x5^S9CPKy zZTzK`)vJ?tF+pRUBluqQJ2%9L5N2kzNjkHhU>X!mxBwCu{DJg30M=*U#d6m;nux6iOsY1yRol~Ijz&nUi+jDE;s2t zF*CwG_R`*;3TaNt()fnvp`UpHxitp}*!M{&EQPiO>tR}wNC+ZUIvxH2WN)vp|(2iS+HbDp-yu07!XzrtVviXo9dJvH+3J~ zZc$kZXU>b-k;}Z^8Z+K!XRQY?Q`O-cEwy>iWhz<@caQ1>XiWQG!Hz`VSsJVw$FsgJJ4 zVgk@z?K_SQEs2;S41o#+t#%q&Nf(`2JIcw8`!i%h@{r$I^=Ir84su!g-bg;E%r=1V zuog(>Y9Wp$R}vx54cwd+Yv;CtrgFLcdBOao&=rW}i@3&sPh_Q>ZK+wi8jBahzNw=2$d)qQ4*v)e@pEqI+BjqD($&1Eya|y|FQ3*eUh_rHrd+4GppTh9); z=v6m)Zl`R4d93|6a@w%nqKv(GI4h;;TX91=YzEheWCAVz1DT&)oZrcl!FFv)EdDd> z4hxNCtf7hLe-P>F%+!dfmV5Zp=CMdFU&Vb3H%8I>6;IPR5{S2t?43?lV`dnmO6)3B z(0(VLfJNi?M0Q50Jaj5AhV&_0zcclAc%_kAjWMz(x{NXbqCqSCVszvlObGgAucInR zI0AmVfW=ZWVl3^JN4C1WfL5j&i_GW3q?m}E<_4`Kwn01GaU0b1e9Izy5`Now=bO(F zuq*wJX#O8(?;X`t)AfO37ZFfE5EPK!q$nK%Q9$X0j&u;DL!|ejf*3%0FQNBdLod>M z?@dAtJ@fPb{vg6kp~+q#7Xtm0{mn&Aq_7W&f{Y1L%3N@-}v)KS_8UV?NVb3W3FB; z&C>*#@j)kw0HV&F8(2G>FEnHF0a(Tg?8Os&OF1cn!)cqhDrQC-89NfA3YNaK^)UE+ zNHWTU-sW`y@skr5SdnDmz|65^h1d*?DvPeIvrRvCc%1*N1sGp_1c9`fNqIWh^=)BK zImBK>bV#j)AZrretap#`TmDQ-%{G_Q0Id{ccE79$aX4|U=gu`EJuwA9?&D^qSmo4i z05oySJ=a0=u4p8+SIv8e3~X^Z#*1Yv0WMG1lXq_gEenIpo61iN@LMyAD~2CUwG6DY zsP@Qgf5$x`z6FiX06GmX;eU8SxCQuda6Wl60|{%eT0cq*g1Kt@;wVWaPc2+N0@nmSHXf+HJ%caI+bb4uJw=HOJcExAgjx=tVFpf&(T^5l&MhPIE}ME z=PU*_DhOIDqtu6vx=?4mBE1ZsWWDrXRHNj)swpV;iPxKDn=x#q5_5k@cU^vct(XD|L!1LA67Zc(9gc57qd=5zTFry8T_aV5k{W1h`I$CJpOh*TA>84 zJ(k327I8iDax+>tulgG-d}u{m2vodR%$c0LXCv?PPb6L8zAYC0WI<Bx z;2of|6oT+2*QKvhC+kyF!^My@mLJ^`4_92qJ$aNVpV`{#xYg}#)vb{BjGs-OIuq?~ z$=but1DXd6Wj?r6zO485GWRJ{y6XP7aWf$h1!(t{Fx}?v6xT!3k1jtT>N-A@;T?Su zKYxf)uN@}=Xuk4KdoGR@EBUizNv}eXkq6wq_T={m+>Ne!TMpk{`v-$&Lt@;Omfvqa zZKQ8>tL{?X6uOYOOp8sZzR`UY^0mKjwD(T&$~jS~PR!T$W{9VBb;S}*-Hn=}FT}Mu zXL#$DApa6f$F;S3Zs!Q+49`{VAHbayVl1*L=*B-#Iu4&b7>|=b<7HO&|2{eN&)5Cs zi&w;;{Nr6f2NOvP^Yf5hcMD2Hf@q1r{+)2DD>}NsV{`qBPB>LgWjH?IAE=Qw;^Yph);Yyk z^t*x(;qTLwF>B9ZB!k3nZJbZ-nbvyc`$BEA`=)P>IxS~W(tCMMnc0|Mjvw_F$~FP5 zquHbtBeJ7I#CH>O8rWHZv-<4I4l@(&hc^S*$JH0IIQs{TQ5soWq_V}BciNfJ-tq&> zFO8#kK8~%qC8^a&v159=_If|a*u_Jbpq_NoZ~_L@tupqWmKZPBfYMOClYCrVZ{RU*h5;Vbn_a!nC#JMkx7Lv1U!;ROff0d6w zcncJ-m)j9M*GaLa&5iV4JdzQIVhbsBJ4WutSsz#O>aem50vT*pS$8I8-#{y(z27Lr zJz(ix)GEGSc{C5dVf#5t4V(+eW!K9J6@8pTbWpr0nKG`UAn7$2zk?J0CC2c%2r<~L zPUUR&9z*RJ#pPR8XdQz4nu=8N+T%$9#QOQHrBX)YDk&4xw;zG8mC;_kIX-4M_wy9L=F<78iSRTc-BE2~uWP2z(6t#o9l#i3X zv1DZD;0f0Aoo;H|gg~;p?ymla5u5qf0mg91#$iqpljxl_g?yA;eWYNr%sG=kU+))S zVKjv1JSQpZ!zRKgt)t?tI8;WIKor;y>MIxgCUwyDF6&zf;vn5A>VlX(L2?Qkg&)_t zd?Pr^sQxZHym2|*sq*Lsb>-;&{`*R5gLHC$hbOMJ&%6`7VxNVB7gK!qBj&|LQEkL~ z%K0(9?2{f!gI%s9a8^aKh5wXcuVMk&iAM_N+Zut_iHMrvkg$D4s9M(9X)lvUnp zzZdq%@w~N*=lTBYPfT7emP<)ZnHR3n-y#|thhY|x* zlgTWabs{jgCwcuhg5p0f^*vmLWOww*^xnkxCfHPIL`8ZNuqJhs9(C(?Iah~XDqnt@ z@W?xuwEK+*_xqW%wM0&NKop}6^MGUzrL@iJv4{t5gX^M_H9YIVpo*a9p35e`VcQ7r zo{QbEDBqYY^BUd0UhIF6=YBQOB?wahjGJnAEDaz2M}qvitTv#l&+!kg{I8!luc!yO z6J2VLCg|(cenYwczWVc;fHTx3-mR8t4Ja=iTl9yj)hz45#Gn&v>1mSS=_B+BO>zaD z=<({$YYN9mD!z4xa#GtUr4!!a21iMQ{Yoo!DHWgi{$)#pM^#pUb(*J#ChZux<8qz5`X+ovujz2iU zOC`kyS|B-$k;1Nkz!-d%vceDWTt@G%fR(m%Y}ucGKPn$>;#~3uW`f!%553(_IX}ZC zs+0au%D`iQ^8XT)bAXTsS)sKzkdUc;?bO6|ZjS&DHu9+vaU-zR##@VU`cON33w4Z9 zu|XVq*S$RJH>rj^z_KMt#auT5G-Ps`KBYug|&w}abTJ~lB^$<_<4-GzS* zs8aFEXZFGz@60zvD~x>g4_Xvmc(V|{@)UF?-$Etl=6XEeUNvx^maW*FBfh!wG0N{P znjTml^`+7+3T`>JsokFq_T7x{ zCv9)sgBj+(R7|vz(@>k^jdHkpk({EC4=d#7z`O{qUkY2*vY?o zL=3{32a^3PwlaO$siq5UGhFfD%ur}AZ@W@!?u8?UEAvE6>XJS)H)dB%)BKUvrW$<~ zxB{=nbo*%-(rJHWj7{~&a%Do`{CQv*J#f1X-)-&8!FX_fvwX0=FmHv<_>9MCo5e?}@d zjL#xK+wX(N+_h(x0XukiZWX!GwbCS2*vO7L$^(N1UBy*^iSjoVfW5%3MZc}uz}=@5 z>F%ZY9+X5&y>1(YAg0xEC!5iTh0hPnMU{lUgQK@{NxI1Cu^|8VWJ6WV>Sf11X^CER zt`Mt_UKp_^gcMmcs|0LV4k}+~k_nMC={ORRVY(&sI@d%r=a!{txH+rZt@+ME0albM z*04Yw`QhbsfwpQ{#oAm5vkBW_E6d%Z_Wch2ALoi!Bevu3j)jMeW> zFq=GXVE_IHTbdXao4|DnNv}h9)oxfWERD#Pk1fnu)sNtoO_r;Ugp-phb3@AMJrBF# zH=csZD9xvJ2MvjsGU>Awr4}{3{L}+0Q!w|iihgAMr?FX~#-{+l%3WTw;~)!y_nl`x zLQcsSY|-c zn8{?~D1&Mf0Qm<6d{nT}Czgx-l$3C!?AQcm1?k`+c-P-vMqPhGQG$|c&b*7H%w3J> zp=QJ8%=0FM1ca%lKQycvfOcyY_WQZ?M1dFKIWGK<)+3b3*oZ91%(}DR6^-;|^QYa7 zDRfYcS$y({LdMdf&h}J~omvtqI_jMf4vH4NtJ<4wT z_ZDl)HOY4EOU+vPg~PuoUn&#J8|{76{P?RIbs=jCqCTD~?-w&?-zISjp{7WXodP7)kYIW^}7@a3=(+fofmsGu^ zobgjJ(WI@dG$B~;EeuI$qAC-auL-lP_q_hN>x(N2t=Qs;H||9(@j>_ScyqQ=lSSnL zdjeAf$!#p37EvZBn~AkkJM9`Q&LU5ir+qiMo*qZ!o`8#XfROxiZ?^|pUF=}dkPr1CW7 zN56Eu{H-9H4b~t3`h)BC`nkfdLo+TeXMn=yR-Kz(4yYDupQPU=&3$+fgef%5nHG<~ z=BFfdpGR-cm>kqP4mW{$5tVG>@`!SDUfUB^)mj>- zbtyRx(y!Z0Y|O_D-k)+6PG1L(F8>&RKR3Sq0O5p3^w0Aj0KeLUZ;E&MdHtY)L^ZIJOKH1nqmTld~N zu%nn2ghMIQ-)oG!_0>LU9T0(WaAv!sxOsCD0&dkE&(+o^R(o1VH{%QF$GgC7E{C^2 zlrCoyvt_#QMUuqettPz-rB)6<`y5wEAcE)+u#Zrfn>u^u?OsFD!nAOF(TmC;8MUt% z*6zZj0U~SD?yxbKj;0j7l6<}Q7Oi^Go1wMrs6T(|T$h^#ib#8=5m(>GClRM?#TsI) zTz2(2k(PX?=t(V0PMUw7i0aWRZIXO)c_n2t)}~>l7t|eiN8Nj$9BtXhC~`>`#mvd3 zQaN4U3vXxMAqewSbPHGAqN!2~ELJgJgsxUSa8}4|hbhk7Izh-%wTf0UX5O>UmC+i_ zyJSQ3Rz%8@W5GM>9EQvb!z_^Okxt~D1m%hSSM~!ZYI7f zk1MHeF}QHvx_+_6bbjhp+f;$Kpq*eoq8FV#WvnaxQvO&qT%UPeKRxT>e@HRy+{&vL2U+$!q6cyQ|1@d}f*4IbR`@u9u_|g`)*^LFC zjEGqvM$U{2l{vaMM`N)jNcDS?v3Zu(XUeiQU+Ejw2zl=bszgpYj)B-xU1=-I$MW-^ zLUo`HB1PkH`RZqCQ9N~|o2${>xfur29NTerHS`@FOdnR=x|Z_}#$@bx4zhx~7adbw z0@lQP{78o`YJ_E9&@^dzu=%M*UR%WxF8Jp;Wwu;W@DFuDnr&EZQ{@?JMG{fu4FC3Y z<{WD+S&e^d&oH@Q5}UAWIKSbO$h z@IZ>$hOHMo!mz4-7;K!YRWa4a$yhbZEXUT5o>-AyZly5Q3nyHhXckQDT7MIlQR$@3*Y5fuvtwUhf4`?KW^>=ZJ? z7z3D?rdI?93oPE5UUodKU99JQO)wx^7STc}u;>hzCOTuEix3PYSFn-%o_Gs7)JG?a zcpL!YR<&5QOSxvM)6EnZqFj-YjjuNpdYMKQU}j>|{<=;k`Vvg06?iC*HGO&%#c7I^ za^kZy;NUqYwkYX9^HfGcl^$QXjB-f_mfp&25HVGsMMWvK3Gs#Z({AD33C4x&-f
uONBAl$|5VnSy6c5tmEQlEXiNawFCEFm3w|zv{_Y`8f%p{Osv1%-82?*e$jQZQGBDnWg$#iv<}t?J+V1o80|Oy;16ib2B5R?%DzIp-0ozuWcDn ze$f}))zzVq&R>#Dk>*skh0!pR9e(3n3-oZ(oD361d-g+X%X{tPJRc1QBekTXM84d< zIC-usFHR1LO}w?u7YI81W?5O!YuQ92t2P?4yQ1!!aqV8_s-WW#VKwhM4KYaKn6xfh z*a7b8J#hae-pe+tk)Wx2__f@o5e5etRAeiq3=GH@S6Ve+RcWF;h(vTa_=n>gqAKL6 za-Fgo>jzm#*bq`jYaOKZ1-EQRwA5I7#eMlK>m2zCiz_^-QEXY-ZN1`|d|(<5Y@JFK z*4aZ+co|jRNi)y!gO|8nCSgojvKHZ8)U>^*`_EK;D#dH~SfkrvH-rmJUKUcGjEXCk z#f)PL+b7Mf7YA0WaL##j)HQy!xX>rcz1kN3+3q@r=9{bWqYrtjL^SzTPBn_0aHZ{` zu^y@rtpmo9Fd#mO@KgLr^d@5|hG ztXP*hp+Tqqc0vy9?NlpoMF<6Kec|Bfv7s3Wk7WBNCjoxUjayE4*Y0l<_kGHp{a~|m z$?Wv)@+C*fp$$ne-s7viyW6Ay{PjA}Kc`ZED_)=Ml{rtid5z%S1RLy+dyeypZ9O~I z#cerzf3I=rPs4x{X92pMMhy96te2tkT?7m7MKE^OvMQAF&m z1rK;H$p4D>;M|v_`KuY6=vVk4z&u7>_@o6y9Gg$|Z~NGTjn6heL9$m)$-~Cf% z;@3ZYqEg(5K%EKh?(?f!Zy?#NNG<(sww-t(r(q5nc^viS{3yezJ9cPJ3qxJ-Y1l09+{!|10Jo zlEVUFV)w42#02xuI2J9&Z@M&WTvs6aNd!`|y9Z(VZ<{_Msctrv!a6nDI|^zJ-Z~z5 zRIkl*d0vpP;wE(SLm*7}?)gcIA#2MTr$J13BY)8aB#G}`E%4ulaBy0cr2b|<2E|rl z5TZQsuREAiokCsE`>3tS5bAA}BvFscLkwn1^6)n-|3CKu9;(R!k}Tci1Q-$sj?!vF zU4%4_#~a3XKk|O)Gd-6P=G?2F3U<$**EZV9&W11@Zx|)X%V!%ovQI|5iesXO{&^iV zgq0q851b^dE`Ra4#))AJdE!(KJ3>!nrjtXlmF(6=8q&qf04%kcWl3HbRJw8 z0qy6BuG##pE~28HM>67mJqg|J%|3Z?*wld}Go&IC`l0*MsZnUx7OR)V%pURX$71e@|L7QO*)1 z`$$va&phHpD*g{+wYQDdWOe$glp$Vm=HWrI?bY<>wRZ?KR60DWiYpEe1_F1gVKWW9 zRbFoKF3KUI6Vqc3Lh6%tB1F`pSLO>~$*U%B%;Sc=-R1S-kB#vA{tyTI$I3r5xJ{-e1$eX|T!bk%QwHpvLnarM)aj;x!~1*di?WR4ir1>lb6~%dG_IbsgBaS zCj7k~kZhGzaAlnXIR1%;&Y!#YamM!j1OEijak!rPwf$MoIPb1wC)H1ToT{&R8U1AA z&x6er|0~!;Ala}i(fE~tC7tY$-7HB@ePxI%9+Y_FKrI@u8A%ozVhN16c*R+Q2Vn}= zpW_|?b@ssi%nc5Jkk_MK#nkU%gp`mfthc@1W!G-29%v&6hY0V!68!V(cQ-6L+D21r z)tur+Kuo&T5%+8Pk-m@q5;IT49{nwKaOB>Kup=Gnhbdi?*mYI^qH0wDMW{>dA-T+v zV~l#Oe9fH!KpDVWZ;bM&iV3*bdi=6*b?c`d<_~@3#6_&yM^}#e=O9d-`zIu_Bg0TJofu5uOt@=jpAvwLEU%^|-KawmUj>g*`F4@u|B@&65$}?^u#6#(T9-uyZn`~XFLx~@M2>cR zlr#Be%(v3}BKqMl&e44M=@~+|(R!2^MCw^xpA>P_npn&Mo>?UQV->{`^1eXwJTr_O zmiM?{z!YYh8zF2!^dk5Lgs%vry1+pfP}MsgP4T^m4{Z7xm`(&@zq7{t-;Us%rpo-{ zx?N|ygl_q7xOCq=@{>9ir^btL0`?|l!MTV29CH@V-))cy5)04~R0nJ(?nm_5MAZO_ zVpkU_!CNgZfha-3X3T}qgoHUGXfp1ve;OZEBy|5<(YmnwzbG2aY0w`A^O=18KPJl~ zV$eETeq2(9k23fuk1yGURp$4BvYz*5~7zuCIa6UElLao{)A0zGgT2yGUkPPtQC6fw!T9W|8^Aa3c`B8D zD>5sv@)sZdwBBc7AWzI(F@W1WgH0LQ2Q*l5UGX7k`*+^sjTixMoyrDrJv3i_ctS2V}E3Qsc z0vo(B8<$fgv)2EW10~#JtwbQ|rbg${YxEa~hmsMuQ$0TQe~Sg_Ynxw+UjzzLiL->cb%%)#5f?M#Vp*kCx~dBt2-~h7-@TojybDBe#+rB8$;Lx*>PCuPj!x z%q#CQbqftW6w_mq!I`FW-r{_!abM6u&{| zg2EdaC^aH7&e1IwFv)o~5D$ z`}CU74kMOq*)az0Y8p~$RQWG`aBlyaxgbUTzz7~)CE9M>S}%}gS?007M|;HdQh*cN zW>t5Aa(B<;f;r9)h8lpdx#B{Ea1o7YwPFbSGC@M20a5Ul20FGCeIpkB-d!p+*O$xj z!%HG%;v@dra|tV>d1_zLs1lC+a+S}Pgr3v5%ZKa}gX7{{cIl6^*NbMhFRORA_bT2Z z{wTl=Ns-efxI_OQ*zUS>dDZjok)3Hb%)f+c9#9&T|I5JhX-Larf(BP&SJUjy#?6#( z%2&&6k8YUv>PuEy~V)qG!qNb;)M--(ef*T&b+gENbQvZh4HbM&v9Fx0p zYwz${qZBX4yANLPd~G9UE{VpfG>e7J^7CcK;rY@%!~0}K2G<*uq{`T)X6q}^8Q*s7 zKYNriZLS(Ame))D?LBQG?Y1!qUiIoDb=6-i|oH=C>ft)7M~@Fo1QFzAhrUcv9a>$WPZ6 z)1;Y-A+`!g*VfL^-KNlwr3~hWHU6{{7D~k}sEwtx)E0ag6H>fO5T!WyB4}FP(}6Eq zxB0#%lINs4CVnLbod?`%;Jp>`*YIXKq+yg{U#)Ssl2UNDpf-yRuia4h|{YoP56kGp$Ow)569 zOWSv)<=`Dor+TAK-rRbG{%oqr@q3-Y&6L2v1bx@SADo64XKakm&QLy0{;k%?aeR%d zDK8$bofx!pQzV?wa=8N>8875b)jNQRl^s=0`#owG{`x$>X|=h>|q^1J7~u%NHv9xB65TJwtif<)#%inJ-toY9l7q!Vebw}Cf~!E`<|Hh(+jTsZ(akfntD&3 zA)M}TnbIQ+w=NIpKYwlLxTsWV5+yXn%s*&wbj7qU(|EMgqUv09xNt|-an1)<(1U$V zZEni$ccoUp&*?~+Ue>)8m}P4t9~cmMzX{Z+RJ_XYBJpGbZUnQmB@d%3%nHkN<9d&2 zE}YYYnJbt!!#>VEJ0&Uw?R_fs|C~fPG`q%(&>v~Fa%w+DC>&pqVAW_yTC7WeO{FZ6 zG%yL=WN*iUY?~`vCm`e#H}qM`V$6Ki=a!?`M6yAdfHnAMfB>wAgqFi-l)D`zBbDyz zibhxkHhPsh9HCy49JO|59^5u+?QAKkpnPdbLoX6}bVK6zI9FUkMW=hWvAV=f{=gYo zZ9tS+{la7}49!;V|0>s8-c{)4X*+MrG*om^m79`C`1B){VO=w3>EUMbSV-F5NA@|9 zFK|$ZC?_)c+FOO=x?9h8qN6pH072UD&~2S?aH1YY`!nD@L0vqNX|v+5Vg1PXw4%M^ z0cDn<#}wDRJzdO%js0@*o4Q~#7z^-px%X%JmW4d=1G8MyN9<9cXpbkk3@p^`N+@;V zbIpi5M@tZ<{)}ZbU2O_y_xB84{wGItRX}ELtJKGf179>ul$)457~-q!Fl7uk-Hnbf z0$eaWD`uq)NSId1DkaZ6A`9ol2NrGC!8jGgeCMT~OV`$6isu9h?6LJ};bA+>_?|{^ zexGfN%S!bNo4JRb!ub3}(yP)`CI`k+mb*GFCuc~FlEa_R4Y@67MB09wZGO%7RtA!K zFzqd3ew+qc4c3buULFKQt+3ci-gP=yaq0RGXR8>@0lXROUIqnl8}L}T!Evz=onK96 zY?{zfijkj$bTN6%HunBlw}5R-8!K_s zsiy9f7<19Fb#pi8X^z#2Hr*D00Pe& zLa@pWVKdV;(#h@aNG>pGTa&BqDAs7Ra>1$oDN8QO&TA40(upvo=jN>UskR=u`Wb( zX)f*bzp4|mKj`T>RU|#4YrQPretAFA~I!c;VN+Hn5K>18$_S( z%7pQ}1%B@@dzs!z7DSTMwEMAui%Rk5(q;^vesWq_l%QE6&Z2a>0lA2 z``%|ITD>LEG7xxpbII-FjmV?D<7e%I4p6=mA+4cusocx$=hx{%Wb4YRO^>*=7haL= z)UT>cB4!_)$BYfUI8@`cZXd0wt!SjwKa>9Y@~uL04H`d;L)qA`=vMblCd6xi{%ej+ z{DSY{O%fdswo_H1<)NQezs!aCQW4@>8)G=VY2gVII^76aF2w#2WUUb0;JuBswBy7S4$Y*Wg$wouu z&{deMHRsS2lgX15vWc^~{%sQ%!d0HR!vkUO`N*(;+_gT-zDJ(uLQ9jLT*Ex;UGFE* z+(90=?OZ4E4HmwjXP!9oV7rBD82k_SvBCZm|BBP$6ExmnSN-i|^k6iM9(>n%FpJ zQvI;$K0!c^MXxU>*8^-yx$-+J%d@GTjcjtm*rut>a7HmdLJWn!!1%u`jPr6Y418y( z8x-GG4}nh(v1}!aj!cdvk7-*qyYr>1<~D&SPILEw)-*_NKiO`-7_AzMjOUQ#1G z6*FBQB1hZ;AWY>&tO}TS8``db5w5pf2&e~KQ%=~kb z<3c-GLTdQj@Puq9mPTziq-AN$Xo5hs-}Jy!o(m z`iF~k&lzb?qwAevv&TPo>H(mio6~pc)@4h*h=jwoJGpcQY1`5Lnp{ZN6CXhzf&9qdEs!oMKa>-8)n`P_|5hLLvCK^Ri-&rAob%r*IX!n?qP)|e%l~r3N+T`I;j8= z^HALnxZ#O?-sab$22(xcH6N3cC<*)0Q18MM56Smb{YJ?%t)}1nw6US!(Nw=?#zzbG zDmQQva3){3HdEq^`YfpXy1j$vo)$I5+`2|a@=g|R-o_2Zd5lj4N?-)wZiFQcRJz-0 zA3WG-MXev?^*xniuPX)}=O-WD~UiJ(rab~9STt*WL(U%jtMwD7Cy|b3 zj=6*u(4mdO!a6{|GnNqjqmR=G`nFGjg%fX?PW}CaoDbeO9+7A-l~y-Ak5eW)dNxz8 z3LUo3)o)JRx6S1m2v{}`G=?QPa?Ge6yJn7>FdT z2HkPj7%=u;Lh9g5FOp@h*gK9_0oh|T+JyJ*@QyKornLQ|YjqE0#u5}oBM8TUQ}@NL zf_G0{cl_6!TC-C9PPSSuUAhwJE4e>xqtBDu z7r=ycv=b}27u>43M;Qhfk(6GpFQrD)x#7Lzl+_~1_AhlK?g_+PUwiXS_Qr8?4~DjG z`*>%LFrUKn?$vx3*S(#G#MC-Zp^tQHeoiK-YFP}{rDk|fD}3FO-|kcfTsut3qK9@V z&9?2&-$uT?dri!a>qW}lV48^=RemIA6^Vz>hWFMgu_u7DsX)Mup4pdvPQd}(n9f^I z-!zct=S*dSq9v}By-S^166u?InX$*_K4Y`2rOvg<^66M|j>gx6R$Z&US~Bwj)xF2gO_! zjNUi-WJq6Z^q#zYuuEbiov~uzTj8tRsMg~(VN8HqnjtKM@P7lC*TP}svBnSk+>9shyHn-B?)I%pGE0QU-?~z!?6X9+X9%Y znkEOdMPfys2rPD=)vaF?T4(o&_^?=Y#NNZrI=ig1WCM|L43989`IcrXnA_X0AFqf} z*l^leR~I(&U$~x*2OUOEOs7Wg4H9S!WFYe$Y`4H97T;-(>UwNS$6|{@+!JSv@aouw z6ak>FpbV9ex7sE;qJ+MAs|k|nhwh2rhHFKwZ(PXZ^`A{fgh~Q!**iULYV_>!o$sf-y&YuM{bDeE z+avW+JK^=Fh`YwF$=To{%`HQQ=+P&4pt4RkC|w>KCuf>^1bv^K4L-#2VgF1{fy4P3 zD>tPF6R4l6tCMz>0hH>F>7k;S!)44KXI$v?oMH0-R+vIaO9{P!17^{|g!bkLq^*@< zS^eNB|75{2SFyKzRq}$sz790ZC9N}>pa1;s*H)C)hhb^{+?sJ%17KPD^LBZt3&j%{ z8TPF>Lm!R=W}US^@V$rTq1W_vB|Ej8BeiD%_RfcT`*LI09W|tu#u9XMA4hAs56!(J zKzW$L)$uW;cA!IKbn9c$58rTLk?KN4C(wQS)d%>2-U4y`ns{8L>>jWYa}GI>xbj4u zgvc`~!4a6^J^jn{i(w|#Lrh>lLtJ5m3sFy9tIy8pOg1u|%j3X_?VNItED62r_Rjmo z{ibIxz$uGhtZtH`mX>&}I{lHsQA91r58U)Y!Xs7{n53)MqzYY0T)114G=F-h@|bX> z+(j=iZR~2JrGI^qqUZdgh;sxqxhPH{wfEBd^6eX&w^J7~0i~-6i)9CHmPJ@Mzf=Oe zHa!H?2itYeasn|&z1EqK>_%I9WZiqZh&* zk-}E<_azRsw|5*A6Tk=hbE3xnkp{HFFBmiWzsPZf>&F+FLu~6T!MC&O4b}~a7@;NT z=V!t@X*uC$jqKDR`gRy$pWz!xVB-^^W~~Ntk#Dx{Rjv;o2Xcv$q63?D=@L#u0vpG4 z=?J5nA4t}SxzpFd;rsRXlbO19%y$HX2}=Pm`&|!qJNIZYtHDSVa3>9187?MbU^`av z2(-RQ1Y~Y>>?-{_+Yvk=Q|9*m>r?(`mHsPA45?7RhZ=kz4mcMVy*;?48R|+QOj-59 z_osx6cB)jp3iLnPNdi>w2waU1X}{sfsvP!xWzqD8I@o;2_>vp%}b{g#BBQ7JK4RK9_ zpwKGpga4M~h^f+GQL&L#Q|GLYTUBt1{|j{A%BRv}pYCsm{I3VM9rf=K_xnQA$f7?S zDDB|daT;13csZ;hhw0i}#U`l2C1pmnC%j}&>z}{237ah^@jD4hzB=?g3PSNc8~bIU zvIKd@l~OMDXK0y$4PU!_t|HPkT_?j`s#bQL{+L_e8>Eavqwo4FV|VPN0H2~KMC+Uu zDz&HgZUTF@oL4`1zxYPRB`6fHFHRS+l(*vCy4+fUW^r5DiRqDbqg!!u$`)NddY(L) zmSfyLdKEugylyG=q!KU5ikwJ67um)DJ$mauoldcsc5^_iS>9i>dg1#vW9oozlC>eM&j$_hRr3pl#M&>JeB)`4xBV? zS=80fu2^-1;l~ng<0ugFlnEOazGXgRuO2{O=I7LU zG6he1I<0Q4TOHVJFt@JZ+PQ1F^EvIp#h-)VUp_XH)`$esZ0c`tB0YHJsH4`+4V1=$ z23_tE;0Vn04ZlnfzK?@*pRwl}{%qMJkTX~_t%n!8ad^_%>{`|o^b~(>2`fU?1I6G7 zC1cmLX?|yHBI#qfuCx2|YqEgpN37Wnu94;>I5^v3BLLK^(`&5 z$S;DJaIr!CDK=Sm{BFtOpXj3amRh%G)(`G$r*F= zeBmXBk}hJ0_3duVy@)vz3(UloyF&enK-JfDZTnQoIm`FVNBboS`eDPOrn?U+xorkB z8Bv*yGgadu6j<}AEOll3=wxE-B-fvGtv+jm*b1+EpeFMyeDPs8wX|2u3{7UDl_Bi- z)`obFMBO`=FXr6?bvuR!I%h0iFV3_9QcJ1Dx#xY33f&7C0`<0L(MAKz{7sq{y#T=Y z`49E)bI_!7x@N?u2S*(PY|q6o1@pVa!(KNVlw8fBbQ|&&_FU9i)Tp!WP5n*h(WWZ# zev5Ac(6&#fyZS-uH-N=M`?l#1G*+t(D|asMezWZZeLvWGsAzC;p;+HYj8>{wn8V4q z;~a0Z_4dZ8qMV2>BmWY|~7?;KE;aPQ+WbM>qYI}_Audw7@N7}a=ZlefyguFFu zuAY`|!Za;EB{L1f#K5kMA`1kT(;TH6uiv)OE8X%M?%zdMn)rHVSt$Ug<4kt8H<=<& z8ItJ;F*;-}i=|vhIihoYf zkit|4dO>)Jxd%iwo2I^b1)MZ*{4>^2kDx1=PD)*1=r4Fdm?=Ojll=EFWGeL+1~&Q9^pU6iKc zaM`HS{F%AYP)xP5{wTMen18BTE9i+499uYk9%@s6{rd8{|46;qX6H{Clq3A>-Rx-X zJ%jT|%zHXCWUp?!f_pNAX90p#r`z}>vKxtI>wm3GoD%K_>)7L56odiEm(JHqp04*4 zGaC|lu6APMzCpEVA6vOhpQ!M~~Cu@hc9;V<$L| z*mrO1N)t2-#Zmab0ADjO%JIkQm--7qvW|+oPWZCHMZu(-?rB4*d#{llkl=&QxYcBs$qfv zpXlp%JhLd7+`=Tn{i#O7By~-fp^uyeG@=OE==UbT!CT1)$C3{l>Eie0=3y}7<3V?t z)XTHw#l5}1ZNx#c2<|kAk#qgUrVB|_I!JZxoGd~XeQmRfw^F z;oLh%xcnlirqkfC3IMF8*6&6us!wuq_-+45I88LFRa=L$Y6bSAjf3AR%f!#1t7 z(w{7?);6zN_z^H6af4ecYj|>Bf4O6TRyuunyo}J{ZA?I;-}H)yz@%^)r5g?Vv~v=# zS0t-1ZM%5$3~?BGEGg=%A14moOs0sf z{*QEujA2?q&LbqDL%IHML(qXM-aB<&U%3T-p%uv3_kY!*7Aot7+bWGBtn zNutBM(PEi$Y&%i(T-Vd$-XVS!AQlgs!bb9ebXni6@P<^=yJ%Nxm9XpIdP!V ze>UCryz7<5*WulA8_^*>tk6Z^ryr{++`TQx$2Gh#(fOq_uy7axv}?jUQ3;S0Ip#)& ze)^YTY@@+=65o?=uo$Ll7f>wT)_P4$q+HRK`@$KV1V)Qjm35Gsm23QbF?BPd9xmN_ zf|u-)wqQ!E7Vc5Lk>6wav16qy^i=Z80>gJs9k}$<>?vD(x!0SLF9=jtoIP8D@Py?7 zwkH$8lJiK1K7ne6F0qC1r-~)SV48u>)w5Sz=;s6cKlcLDOguVNNCm1Co}8_wZ4xA{O7#DO<16*x185{T}4e!O01!dqT`x zoYLSSCLBvik>|*a&h|GqT1JjJ?+}4fnul;R9g5Et_CDR==8i~`YI@Q%x7W?N<}7=< zw}RgLo@`0edk*ll@4tRHV!0kJLRe|f1<5St)U)x}ens)vo01-3y@l49S-^3jwa|hi z913Q%M=s1vbsB0%v~`2#7W3ZzKV`jjTvOrSKa8Xbf`o)1h@?^?AP5^R4Z{M-k)qNa zBcwzmCXK|95|GY;#31u`0dMWcyS^npaotmf5 zeB)eo-C$~EcL(^ey4t5 z+vGlTPMPPk3(&6_##eIKSp!{f^&HTB!N-=;f?*O~{>psG*=sP2_ek zZL3Ut*l!Eo6noZZm(?1>LN|}q3R-WCh)c^i3g=N0$Qx4bVrq1G@!r5ollg;gqKoTN zXeT3A#2pP#3DAD9fRJ~VPO!k85XzlvI6oUaZdlXP z0D+ULF7-}wOAuxWEu!E_mA(W9h-t>xu>&_yP0*Y6($R)8aU3`Ic(w)zLo}}|zTsZ> z>V=te%FdQgF5T<>8m@`FTM#N#8GK*tsHK(I^;if2+Gvw;q*0diz^zMOk#jHhd__{Edp@rSqf$|uX+ zF!&MJYeuaAboTJD#bodB?2;+$Xz+X8c^DkqSc#l-#WXo*1l+d9r96R(tnCeUOo|Oq zDW}|Ws_kE=a|kNE`UI1QJTqu?{=*FVi5vXfY6cxOMzv!wICQLis_RG@6{gZT&C<@19wmXsH*?Tov*j8h9a~R%wj!Eo8E`_a zXHiP=&g4T&=9>m`Hx^Copd?z(q=N@dWbA5#XD+U2lB3Qx_caNED+!hFF?H{B9-XNUe7;CtkjfqbdR|z zeU8XSyZtfyoN%NJ{~5hpY{lv0+c5hP5i6b4;u)?9ntk+==rILL!0Iokz5rxD>)Tkb zm}9Tvp}K*h>wDsROmI0CYkX#uGvQG0a;%Jn?LedB&uk@CF=KVd=pB|qnjL7BeA`ND zVD#R?R@SQ1lD$gCK7XTqpFb=j73ueced+{CVdA{^B!)ft$%eKCWoIDojH}J}oxuUU zdnl7Et{Yi&Hj%u9UtO6b3XsjO$dd4z1X43io2}po}4dnGF1YT#v zXR)YO43Tbi{2*uyj$Yrg#(8{nt7^3Jn@@V3`){82yl`^&)0KuKTu5jlv@fdB76 zQxr$gd`w9-Mcw+;gm*jB z=#GXT<(0mh2G3p^A4yIi^iEkc$Z8eX|ArmiI(D|;pmB()Tb3gfH+bL6&t08lODfJ{ zN3=$b)@D7=5QiDTgt{s{OmD7OV(J%U?sfKlZIH&O?j;&>K6BLFXgWK*5c}%)AP>l$ z$~_z<_c*@=`R^&PZC3th=@x&>$NhRmza1k?%{LSY=Q{)kZu+zY>B!Bgh22ehyW}?V z;In^r?S`b&>n}dWEN%+7f1-PM@deF?AZ}5Vp2BT$t`T(LYXVaYz7B+1DSGH^M9)OR zJ|4MY9HfB{zmUWnTPfgPr?t+9CecAL6V}5YR0hwY1-4V|9+0lK0hTdZP>37$NqdG`2H?0g!O!_g{-nqJ+m_wMWeZI zrMoJqCRvYypW+{kb{)Ni444n)uJv+FuNQn`AEv-jee0hitUNpVx%g#yo7OAl`6YX; z)O6OObP#UsvEshX@B9BsJdcckza$lLoeAj4!=fH8y45z8zndv6w)=J_yP_CLI_qww z|23p(pg11e-->ZPL5Ju*G(F97GvcT{jvM=C-oO5h$9fTV8 z08>i7RoFrIrM;9Y_gG)~{V?|rh5c@vj~4+yRf7YOXYW_7#w3}7lb>zi-8cg1%xhF? z8JTWBjc!6KDWl+9(5Mly=e{TPRp1Y|tT@Lvas3Xqumtpnw@4GaJWd~c!J)w>Qa_zz zm?9`~Z8!vIfh`@<`_${+&I^R|)uS-8SRM+(+o?BnitWct5|GEy8K`FFaNqBn2Tf3o zwT5$sNejAdFzuPbci3Jci^+8#j6oW8|e#X2VW*#sTpn zW0KO!JN81nA&BoIXX(T1Zq&b~EE#iuYqU^a|DGu@W`~uq)qxFkdhjtmI`aDHQ^lGP zPIpfvYfECJn2Np#-0u2|IJt&Zf=4v{u)+&u9T2xh$r^dncTQ^%$xrZ4Wkl`iECxRb zA>3d>zk=fzoifG!zU)C+gy8C5mso=&H4g2>?>Sv{dzN)y)7M>93{&~G!0YwY@Z9bd z4JN$nz{TF=mzDRU%WNoC=9EVsmDxn85@JbadsD2OQxQUB1|C2?|Ky;17wnXYEcJA% zm2h?)e8Bzu{PXghLC*Za^MxK^P_&eK~52aKYwf5^N`G0>r8OhH52#)b+?dfT!%I>ee z&0h5H>We@VP+Fi1ttUWpB-3x;-!ozPb@b~4xn@z!Ezr(GTbTCVm6ERji(3dWfo)dK zmrA^*6Nx5BaAsrqyWEGkZp2?0MSo%sX|gdK^Y2JJjem=%;2#_aFXZa@cL($#x*U+; ze2L*ikt_^#k^k+KNAWz#Yz9H=s71`Lb`Ipr;kw-oMeVN_PfnZHgLGDkin~ik_q^{r zC3aK%yXgNCTlx{!JO~7@?{rQLjJ>s<7yHjOfDIMB)Vp8fZRMxA*rl!KzVEJ8@|Vcl zw%hBt@E$00ryh1oJ-j0A`toOqv6AX~@*(Ag@=9T*=J|<1>@z<>?%D{GJ|U|5dhnLU z-Q}@-Hvg7#DsLezAsUnUJO7@JWs+&J{QSjCbl(YyfwnY;cgEyhPRHEd6kBOT6@e;+ z25rHOV2oC{&3j(WN-y1{RU6oTPCIV*c=_95rf&$bi?%y1ewht;K0f?9&Xt64J_&+} zTt6C!N4dLd3W^P;d~#Yyrr+7{?F$M zwzHEl@chcRlzov~B*G*ptxKYyu2j$P5DA_n_k2zfPU50qtB_{rAC^V>_w{dYh$;Yi zwWcYpTmzB*+=}$AKLat^^CC`$OmiD(y&b^u92ypZ*uGZidd{x;Q8awBsAzX`=nra~ zwM_bKk?|R@7w@(=3%8S8h>u9VgU!M{;%N%)Qf%)613@Ka4`9A3ceoI7Uf&+2`<=~_ z+ki*H*_tQYeL_t9ERJ(Mm2pq*V1%Qm+i=R8r@|OsfL1(}n??CtChb0SqC@mnnW*t1 z9^q+D6c4TZ8ztE}w;BVxca%=#sG$%;=lMgqF1>;Il!b=3;Fp%pmc+Yy928HA1fyWE zr**|sdLL&jr(PIWdijg5ef4W?V#1nMY=E44P83~;V{@7ukX659yXD809zKF@AU1Dv zD=@Rca2c@-ICim%OE_hZe`2VY=uQ!m8Hwf-BLv&uD65yZTazbn|BF7iBNu zz4SB7Ia4mLy1EjsZSei#>yQE4!K478@ok&ZioG=}0?)dqUSQsf@%Z`~!DhDPm|`nf z*JfKz)UV~a8|}W$OFrGRM}_AqZw!NTnuBeh0V~wAt~s0UFtRY_?MJ3vm|EEubvko0 zy$D{GperPDA9s1TPY1+ijP9bnbAqlBg=Q@mIIWRbDFxXXdF7SJ6226>6E+(7>fvXB z7?Iyv&M{@n7{8l@p|Xmnd!0AfH08iH&G4O)W{Bsotk!vBQ#hb4_KAkO7o8!hN ziY5FCS}JeL_|MOXxfZtoJ@a{976CGZEgOAKJ>-ql)!{Bu)%$ZzvUiz^NTf0{F6KXi@*TG&Ba78TOJ zBz`F$##FuFQ88_yPhNSBH`sCd%$S(kS)hs9@3Yfgr(6|iN#tzn&O&9Nc^k=U!?|d4 zJI?wEpPEO0*o%99Bo+$)jH0h405VnmE*PzOH$avwbx8igupUH40=gnD505_j#xcvu zeCoFmoZKASZ;fs81ecT&V6{SjnI>w0b1_{^lg>Z(YM50I%>1Ediw1g-HZ2ahu0--~ zzsWkp#&g6ol&$3CuiBv#wA{O%dtAz zc)7^Pt&Q9laQ={d%<~Ib_-2u%oUOZrGenEsSs;Fi=GcEK9r|ZXp5kk|^Ubjf@`3I! zVmumdLASrNg$$EH-TC+{LDI0RzF)PQ&cS|z{PpR1^=t&r zw49S>0!Fd&5h}biT-?dtncl=v4D@dj-DqMJCYg1=Xk2F`y>NJfllKupVsEQ*7&dw< z%?VpjLY4wvs5l9g$^`(Lq1xxz*;9WFP+U_{8L}S>7$vFFBi!7_>g_+@Trf45Ybdjdyi^fN!J+TQNJX*F5ie;_iFms znUIXP)lGCb^j_i{_Q{bu1e^-fs>b&O7vI})%tw6KR1QxFB`8*_Sks}MYOA5q(ZFId z!jce7{vj+bQUEs|F8pQ=DHI~{aj@{|p?XNvQM|l1vGM-J58?g`5NX*Z;vnkE!oXACZF{uGJCzgDTP1_vQb(%I~M_%k9YKM_mmNw?s4L2(_59-L(K(qju6$5S^^3u!};piRbb>zWIdgggoa8 zN&l5gKW5uOK+EOB`?vl-TCU80(xz96wvR8asss>c@@{~bcoD5U-_pg^Rd<(`)K|9h z6(wh=<{U@iLN@O%l~LM>Qt*0dG3z~-axb}Q-#v)JzmfR)5t~=6J)XJBULTH)6tf<9 zvAMX>fiZZJ+e@PX`_!z@{lrWoLOlvhyyD}EpfITm&L5@Z!W*u#WGp`=0?5m!foUF| zB-SnMN0JcKO8VvCE33a>2q@kQLS!Qk-KYljo z`@Bk#JuZ6*`2vfSsHdvZi06}APJM=}?5P!ztbDC1@J+iM`kJ8u;XgusKfY6`H&Afs zCsLW_P~C9GaqZ-Tt}?&)OrR`G3WlWG4^cf#c_~3Z@S3>~f16WbX^;dqwOhab^=Xz^ zSRPl5Owgy0x~10vZvuZ@4%CQDTF>N_%BSQIp9Z{H{(O_rGo3NnFmmyie!zC4x|2^E z3C%mXX}xZC-0<`4&=LIne9YBwy?}yH?bWm0)}Fk4W!E>RDyZKJi{8D^C@2{gOeL6} zK&RN*1)^NZq7?@lR(fr?#)o)3oXs4KF$F3sl-;tO%QEhOKp}ks9lEZp$y}Uukz%5$ zkb@A(1D{N>23jfAE_$j=Da&3l>(R>zgkOYIM-?}e7MiSp1Gyifd zfs{^&Tj{UUD9lxN5NufN!F`ArCO8kgu0@KZxgA2D^e)q@$V2tVJT+S_|V zv+A(gheNIs>^}Uq1PL#}?cmp_MZH{@x%J+1l`Y}R=;QAg02*O7^c7^1$s_LxC7kB|&Zyi#iS@#4G6J>5p zXXR(!{yu)e;*nk(w9?Qi!o_WOYZ%JA?ev`VH|L@}$FQW^J__fr;;!)^-Zaj)2Zu~DkVKY(ZPn(!G#64}Y{BQH>zFXZNg=3&y7sn+hvi+`uVk+TJ#&!T5q^eXc8d5l=4#RC`lc+5o&f?;)zt;PGE5=UO7=s`buDKC?sq}euO6}eeR&or{OfDwk>!b>)+d;K z?oBEiJWJQ$jbUW5n(es~GO?FGdI%Zy+}Y3GX%9PeuEx;3CWO%IHUUC!oaF8G3#o)- z(f~)ET8refv9Z3bX1bIe%$HMpw?AoJsnnI+o`)mTjS&=3&EEU?{QVZ(e zB=?}dP(GC7k!GR!3QoL;$}R9uGk(PDcvW3&l4q`3^yD?nTmg=iA*Lvnq4J1#?49{I zVf&#yd(gvf9Xb)?q1e#I4{Y$y8~rI#F=5rBzuztzeB$(!Q|D7PQl<9WUVGD-m z3dX8n_Tnj)FU3t-{#WCnbW!YI5pCmwU3Oi>@IVfBx;qyjJI}v2<|ptc_Rl*K+?Vi$-5C_^6xxA?V&6h2{utg<@Zd+hDA@+GxVRH60Q zUHx+)06*A@!p2DG1u3<}U2K+(5w;$rKd+K$zWXNS=2kY-szt`24)Nv3tnMZ(xw6Ns z@u8OfDxSG;?zjT^1P+iST!1hfe5wS<{N8JJx0&g4z*CQG`?N9YBL%Fd#$NdwI@U@G z&2D0v0c?>40`$9647mP#TeHV{`6~LRXRp}2?r{HNtYA((8<;_jz~i~XW#07S0~!HS zd@Lc#t7YxHPLmbjl7vbP$GA*o?>9c(FYA0!#949oeXPk|M#j$tF$#xm>zW#=x)S;LQ5OsA?gcj>x_SZKKZ8MhJ2$=x{<@J< zY_~`sH}tM`u{G(4G`czVu9-M6oo)IsU!x=}uZj*vI6hNuL0GLU8E zRug^n?(?Rz=kUg%j`Va`GkK#kp(Okx+!4$E3&?iX2ZL0 z4kbZ@Q%zHYb^rEpB7@zte#1#Vuu!?8@8=0A0Ywvt3Ls6oDMewxYDn73<7*3tt-1eK zNQ;GYVG(j}56{AGdg2kRhfp~X^IV0Gf|o3~zyE5M%UKhGEzk}JETh+Fs^^i95mybo zcG-^)v=qt7eq&k>ygnG)u0(R8x0jjy0rtjAz067R#q{A|@hPJytin_JufA8Z&sahA z4@+ww*#8{x+%>@`IVc9)*!>nwp=4#X{4Gem(iEghPS(#oyI0+HiX}nKUwLl@46dOT zx*Tc#_7;QUe}Ip^8ah=;$f9>|F0k#P$gQN)m4tpmC|T1KUx#qUaJ4(SJ+FKHr|4aA z_z=={Sl)s0{Z}4aMr!i3>0B%|8al+ui{g30hv<wJ0U$D89<(o4a@crn-3ye9-g z>*Ha@h{_Es|4m#}u-7OumC!D1xIP%x*zV_>ZZr1x{y$L zMOt9%&zmc#{m#xf9?k5a05-?@#-J4+@g=_?I3eWsilwEz%BxCO9~%(WBV~m*JR$os z_8Yt#8~HG`+ucumACb!2lRlJQH1}edJ=nFgmgqgZY7p^H(s=bIu-Djh9p#OFOMUp_ zl{Cw3r^$TUDGQoHkrL$NkqRuAC!eKl_el=K%RD$lUJ4e;V<8w1PF$Vy7JSx^%I}Gv zxivUkGG434)Q68RjnWKs{4IKshfY&KH#3XNduaJx-&at9_2DYR{51BZtdaG^eIuGO z0lgMs)_twLt@mol!&?6PLflB9LBYnPV+RYIw*@K>JCfCZN=pWtDhU)`JRBeLPDHWH zRR@0GrYea-1m+p-Kh;*QY$5XDr485db`zdqPm6`75Kj@q$K8Jvp(v6#ZuFadmQtIx zh7muDJ%f&Zm6l0f>^owCp*D-SC8If9p>0pQiGcs6K<}~CrmO5K(BAW z6!u)liF{8Af;8oMFb(BlWo9weCbNN(4wr8T?K8dL6Ocr7rZ!I8qmNF0`L%OeHm0Be z%>JLrAlP*oMR3FdzzG=+>3Pqj>#BF(+0NCF$cX%N8c!t-y&EqtdwghB0eaEes}GLn z+nlve-OFumn<-U_XWwi7rI6^vwY}*CN+guU0Oc=5u?kSHTp{6vFuQagRx#$vVIRwd z&L3s0_RH?BKG~q18t(5Bub`WH%z1^R4nicOAt?rOL&#hCQy*D^IhiE0#*G3_zP@Lt3g~M(xu+@fnOna5NBQKa2Bz5+T}B?( zJZUeC$jsyN4F78zdbBO^w?r99C#VM~pnSAs75vPnjfR;Ur=5-^_5Kgb-$zhao?~#& zPX69ILT-Hf;^W6G1OaWW55kVahrCaxK6Q>4GsKJ8+nk(zsoHj@GJ7aQ@*6X-=Dq0C zLI)4L05Q{8`kcjg2VsLU8qITLgyI>){Ch?6m@CqTM|ZW>yDA)i2Dhvp&wZY zAwdk%U8{_$^@SE?#uM|8)&!4X*<5?b1+I_rOPzk3PrQ(Q$j3q3dmVp{`7={SQLpOH zrFcf!!MWna1z|o51|7Yf_KEUO<;aD(&ky_9XCbIXQJRJiwW|(Y?w`7Hdx-BIzv=5n zr5Y)$pyy9|bHbE3p z)Y(*+S%I~Q{MRpcoL{Q!wdCK-Vo^?YzKSk-SkC`5(2n=wLOnwvA#c%PqDrd#zIhBP zwj!Lco?H2vjvW~(e)L*jZJ%XU-WQgAUpyMBMv8PMlM3bam1G0{oN-H!(Re6jX0!-R4U*IOjLz5D9f%c!`!YDn{ ztgc}dZWMt}x3Zs(x#!)>&5-$mS(C!K_*y)uai=9jZJ3k@$VzqR`T3_$D=H1=ERc^_ z68N6WIK6Z?8TJWKd-c@oDk5qE{uDnNl)P7(Z(-<05E{^a6RST3Nfn^*8}df4_Km(J zxS+KKx1>fS%s;I`X|zC6ae*tU&sBvKru}_2_4HS^(mYvHxrRQ%Rw8*4ya`Sg8NEOz z#5*jAmK%|XodSzha;k4Ir&|(8)!L4=wMMGnMt}+Rj@NO$-nxfTP762t3l5`|2Cjx7v@JBG*Ucs=STEhnF|w|#!!hk48Ba+(0S}0xrBR4 z#;_f9JKmb<_+e|D%yTgN?sT};*`aSS4%ctUxfP^?*Cq_znT`+8=GiWNNheM3&m6Lp zcXZuNB$7IMGH9zl7yopkfZ!Ko-P-YGH*W&qURX$q%@n*H7I9E;VkbtId|u!(Q#*Sq?euBw1%CLo{?U5< zv~hPYday*Y#{7O)eobbiX_e3mc#4fUu>Aw>!@~QG)rnW5IOJQ+_reen8Kd@%$HEf!r=lJkqA zeK6IbOP+PLKzgf5gOgM=KwOp{3g2HgCos0hANrWtmoMJFj@zB%_IVtinRp?(8^5A5 zL0Dkej7QlQYVPQP-p%AMw)u9vX_<6ynHPxaFs9!o{3(j=M`#0TVB(3+o3EyQk# zcLS3c=eg(Oj*juRX;6=D`v(7e!_laDxVusj*G}mA!lFY3Q_7ji z-gU31*wv%Y${ZvT+57+)#9!$PJ?%#Hl8!s2x|nbD+2QV|#x@$8yw5p*^LPXKoC%cyoikEUK-hvDe zi@X2Xxbdo~dC7JSlRq)vc>ogP^>w_=cY}C7;c!l(mj2FpN%K$y!j&^ss=&T|PX)Pr zW6f}fOBSdPR&o;HlW))c?IGT1Z;V=XX8f|tEBnO} z;^U_8wcsQtrt9|J@!S)H{y3d(L#Hxi|AnX>*vB!g40D&OTqV413$qT;@Opk2<%$VD zg<1)nw9cN_V}_~>@pi`&ZVO^NH&~mWTxy{!EF#E@Qfjuf>aKbf_NTx1g#Om_r*1!q z!cy?uW>Pp0EI14}s;m!;9LTM0>pY5ZIN-U7R@rLG^Xc!U#*UPgplraQfartTH9B#* z-p-6`CefMI{19A+l89p^=UPXM==}O z`%nxMoyNv?4*peo?PAEq%gMp;0W-7h-?#Xv(p6d>Ywf`kzaxo9IcHYX0xEZk?e2B* zpdBndqhBv^h|2%`j?8Qc7k#bs7R3#Dow)5gCC&X!bqy5uH@YqS{0u!R{T=>bYHw%5vh%KFsfdc*P{3I%Kij*hP9GdB&xCx#649^CUB6?jHR8jrY>2j0tf zi1)P`C^7+cO1Wic^=$+)t)td^c%}R+wtY- zcFtvdmRq;y7qd!K%n`uY*IMxXncW&2cfB!SrF>g5^Ih7J~bAWDMj0au78id=hb|ugrnY^@l@;z|5C)RAXdAAO}x)T9p?v5YFQ8==b$5|4d`Y8v`1(0dTlY&0jMUok(W>Bxpt#hx904|J{x zAx3bdMAB8a)H^tNsh@{KOFB}}56j`}7L{?Q{4cg>t9 zbk`k%*oT3cC1{MuE6t zP!(!;x7r;yp2y&lkVxT5;y{T#?i@d_n+RKS{c#&R0vn~OO73J_oJXkn9FwXLxDiUJc34 z)!J1qsHhb}gyC2=Hm8`k*iNKcM%I!^)4u$O8qNKE$QR;ze)j%c{~DHKxD0{(eu8@k zbzFaJ>QhcJq{j>UBsw!tu9zJpl^rDkLq8$sd6ptuPci8n9!QIHbN1C)V5X%Ehh3i|iuZE|Yg3|4?=IJt(>M z7~C1_ZA@+X@VRclNwP?c_t;tetwJs_DJ&lF?a7yB%1K~?&oet3nu^pvS^pNm{+Av6 z91!(-ul(~nQ}=#@K#AwXj!(52Rmuj$WfsFT0-<{uD&NrFbTO`=uyjdWxn6Iz9M}|e zX(bYfgk{f@@8ryW_3U^IT$|2fZG z!zt})w`k9hMixx+l8cQh?|hH{ZI-apCp%hy4s8iEFFntWo#c+ zL%0zpaVjfmdOd0Jy1Oe4Ku{=H8G^vJptQ)})h%|uTr`9-1y+hPD?gG)>)c)9 zim9FB@F1Xv+!v_tDv`!S=o0V%0k)u)3zn9Z$4X_Ww_`e&fzvRBuP+n98KT4gq~AIr zM{$~%YHw5f`&~yj?*5vz8{BBS^Y%!n`#exinpdLB>`UgTsjCHyh$vL1(h2e!^L^Jq z`=cF8{rcAXp-#pdG<$UPmLxu^EBAkJi=lutOcvQ+iV0KW_a?+B9sy1T``i)u(}rZ; zkKD5+3IjV&8yS8;O=8O*6=#Ww)phH1ZkZLt-QPaUfU=%NnHZI^0oHbSqdNbVrO)MO z*MZiFYOU1HgojH{IezAv7*@>#wj-*?@~mk|^{$H#B?zGWpmMK||8zU*bAj8)={~MYt9C#9IFQQCf=Zz^IP8$xD zv*-$V*W_{+<6+3LnYc_@H>-)pqgmYvq<~-pYtR^qf_?x3O|{Jj6PsOxlnQ?w7&H!* zx_j-iW%`VPb`0eD4qddl67ol#uH|2o#E3jldrzP8TpRgQ71v98lK~8mC6 ze(Tn3Pd<8|saH?Sk97_ezvx%*XAp@RMY~~#x?;VHGLCXRns%b$-zU7TqNBKsLg=(G z!QXpMgpSP=aEU9d01tYa#nN(lMl46&5=}sU&5gf^=vNu7T#-B2R0H8D7T!x!x1RxA z?|je9(6ScV*c9TC>Ik=YGsUJ*8UqmKV`c9JmaeFfO!kW#26#5H75r8R=l9NF-R1Wi zBiWA*T)AVDfJf%DKAlg!%#n#Wi3RU$E6}TSEl8<7oa2kpgdYEl2+7@F{D_~$$%xv9 zH&_083>l&h6CdgS0ha#{JW!X4Tf4F{r&Kf7wy*prlf9U?5n;Nwp7wv@lV>>IhXVlO zd3cjF89@-N;VlyU>S2%GUk#>*al)wTpN@RPiAJ)wt<6%&SJ+7uN#l;B+Ujq*qgWhX zW|^4vV(0#eJZl1IJfd0HG^XNxasZ{eX`f8f@|FHjM#yG43lHSD#BtteMf0$ng$>L9 z(Al4ix$`_=JRq{o{42*3n4N*elYO{C>S@=4LeR{n47J$Oz4y-nr0;aH-p=pN(5tm^ z=Knx_;Wgz7k}k1>(<-z#5lXOckIFcY5(B-3Maq>O>!L-t6ms*DvNpqw+7xRSQjBEw z;-9~z8xPElsP}g>FCmTtAr3MD#%gar96%c~JO6$#FNsLgZRVO3&U9AiJTBQP5~$?r zT~d|Hpl%_=2Wse%b^Y;ckc|96?RS$N7d4rlkFTTOswV*X5vqUcEtnI1gK>=k2ABe| zVu6SrnFTp+lMIW^pfq*cg@(icCSfMO*8$-=E7xz+c3h#yTfIzu4+bxS`^A z^Z0SXo&6Wi#j8FqoPQLx%ZcCM^*Hz$nf1zMX>J_{*dNVQ%CD{6kkbKOJ8`%O$y`n@ zQdq*Rsv}#>^onu_cXcS@?EN75F9OU)bo)7# zP$eakv#koRjzd*lYK&SxcdeZRUc%SH;#`&P_VqTPvoR1XHnur{b#4eG2#gz-5v{Qq1lMdJirHBeeykSwff;nlLMaJFI!~{&Ii6qC?5T_;_S=X>{}n~=#NL2I@)ak zxBf7K8GlPHCqq66-`~8}cXKtXg+M?@_*zcEQRqAdA#ZF@w%N~*E;4`W%NmC7Rhvgi zF5OxQ{SDP2SQ9pl!cNYTRT&$v*v-Mrc{f(lBcc?Z6^wXi{m5$ga;%cIQPI)7?U=;j zoM~qNO|EFF zL%*GggT7N4)^r~$dYqw?KpR#LQppMQcdDf%`pX@j`NOs~vBUG}4iWBcNaz?O&k|?l zR~65x8b-9jzS(-?oR2=~wmmR;p4&EE?4m&UX z%@SOfr*zEnc|e|-kI456JVM79q}Ekg_|eAn3)=jCi!0`@=J9MgU$yy>$cZeFV_qaV zB+qfQ<0D&TG8d?G;g^>cpK%A$c35~z-qfGlO`Sp_j-sk};1#6H2}jT)fVAnxT>rp# zTG##N0G-S6?w}NlO)K0yEWAq{sFr`{xBB2zCx#dy5$HXu=~uXP+>P_-!ds57!Y)c8zqb${sFoI1kEkaU0&eMRlfLH3KO`wVM@ zq3cGBY^XNQe?xZ4D6w_wA3c&bO{6o4`#tVe{x4?!_sA{(noJ}fUfrV0s=Df%BwX3v zJMR(KJsH1|v-vvFOmkHyr!&P`)4T3#x}+;(zY4y;dy>?wPG12Exo(2!G{u!7!9Q!h zMbsy~)TJ^CHfp)=;3WP3o;gXY;>4HE7l>R9+dXLf!ney^e!b|{gY%oW;uuUmmaKm| zzWco4CE|jQBPCw1Oy{L(VYhAA?zCrkwq`h5jrTBzlQ%W3wrA((BpoE#`Fi^N|JRcC z;Z5v9XTts8r$BC9kA_i|f|Su9rLkrrb%R@2a=|U*JoH!u?aNAi2*0z*Gr@B2vyUGS zoBb>*lNuB_aK+!XE`#EPmzf?T+5h`o0jNQ1MU$tr^M2{bHSe$IomcappQ&n?=o-`8 zzPdL@uB-gg&fng|KTmaOO6-pGy;q;~AvqC5G`}&PtHrC)|gD zSO5PLu84@z)_>4tXEr8$os}xf^S18)eN0$ZATB8Uj#xSxvu^$G%ru|ssg@~Qg#16O C3XUBB literal 0 HcmV?d00001 -- Gitee From 30487019fa40d6545803d1a7b63a79e251428998 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 7 Apr 2021 17:20:10 +0800 Subject: [PATCH 117/296] Match-id-91605781ab714e22ea7fa2211411a9becea1147b --- build/build.sh | 2 +- build/scripts/run_main.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 4807e81..77b88bb 100644 --- a/build/build.sh +++ b/build/build.sh @@ -84,7 +84,7 @@ function build_run_package() if [ $FILECNT -ne 6 ]; then exit 1 fi - + /bin/cp -rf ${ROOT}/assets run_pkg /bin/cp -f ${ROOT}/README.md run_pkg /bin/cp -f scripts/run_main.sh run_pkg chmod 550 run_pkg/run_main.sh diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index ec0eb6e..90334aa 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -24,6 +24,7 @@ function install() chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -rf ./assets ${INSTALL_PATH}/assets cp -f ./README.md ${INSTALL_PATH}/README.md mkdir -p ${INSTALL_PATH}/script cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh -- Gitee From 161eafde37b08907ad5ab9e09bce7b4e4d49f63b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Apr 2021 21:22:35 +0800 Subject: [PATCH 118/296] Match-id-765ec7fd5a72548a588e986b794454e804519225 --- build/build.sh | 12 ++++++++++-- cli/src/CMakeLists.txt | 4 ++-- install/deb/src/CMakeLists.txt | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/build.sh b/build/build.sh index 77b88bb..453fce9 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,13 +61,21 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + strip main mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + strip main mv main ascend-docker-runtime } diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 2449567..6834d97 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -10,5 +10,5 @@ include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") aux_source_directory(. SRC) add_subdirectory(HuaweiSecureC) add_executable(ascend-docker-cli ${SRC}) -target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-cli -pie -Wl,-z,now HuaweiSecureC) +target_compile_options(ascend-docker-cli PRIVATE -fstacIk-protector-all -fpie) +target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index 5012826..9b34a9a 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -27,6 +27,6 @@ add_subdirectory(HuaweiSecureC) # 添加链接库 #该命令要在add_executable命令下方,否则报错 target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now cjson) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-z,now HuaweiSecureC) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now cjson) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now HuaweiSecureC) -- Gitee From cd9157ae2e7579d57561e072bc2e4df7ef85589e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Apr 2021 21:27:18 +0800 Subject: [PATCH 119/296] Match-id-3e1a5a9a09f60eb296403bad9193f3c0274a44ec --- cli/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 6834d97..6057e3c 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -10,5 +10,5 @@ include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") aux_source_directory(. SRC) add_subdirectory(HuaweiSecureC) add_executable(ascend-docker-cli ${SRC}) -target_compile_options(ascend-docker-cli PRIVATE -fstacIk-protector-all -fpie) +target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now HuaweiSecureC) -- Gitee From bbfe955b1fe5e9984611d4ae8ce0228a9d905722 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Apr 2021 15:58:18 +0800 Subject: [PATCH 120/296] Match-id-c9e5113fb1b7e35a698967e284a38fd7c8e49063 --- cli/src/u_mount.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index dacf70a..1dc559b 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -118,14 +118,12 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe return -1; } - ret = CreateFile(dst, srcStat.st_mode); - if (ret < 0) { + if (CreateFile(dst, srcStat.st_mode) < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; } - ret = Mount(src, dst); - if (ret < 0) { + if (Mount(src, dst) < 0) { LOG_ERROR("error: failed to mount dev."); return -1; } -- Gitee From 0d50a0334f69370c890fcf4b011c32e4f79cc434 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Apr 2021 17:35:27 +0800 Subject: [PATCH 121/296] Match-id-a4b1a52edde25cc05ed88b141211f8cf184966aa --- build/build.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/build.sh b/build/build.sh index 453fce9..9f19598 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,9 +61,6 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook @@ -71,9 +68,6 @@ function build_bin() echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime -- Gitee From d6f074009ec1f21706bc1a3d214983ad723d45cd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Apr 2021 19:15:47 +0800 Subject: [PATCH 122/296] Match-id-17023ec2b7a97feb5da57e4e77756fab54a1bbaa --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 9f19598..ecdd3cb 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,14 +61,14 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + go build -buildmode=pie -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + go build -buildmode=pie -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From 442392670e2aaf14699deb53d4efc130894af5ea Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 10 Apr 2021 09:42:36 +0800 Subject: [PATCH 123/296] Match-id-aa92d3705f565d2f35e8c0f84119665dd600c6a9 --- build/build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index ecdd3cb..e006115 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,14 +61,20 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - go build -buildmode=pie -trimpath ../${HOOKSRCNAME} + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + go build -buildmode=shared -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - go build -buildmode=pie -trimpath ../${RUNTIMESRCNAME} + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + go build -buildmode=shared -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From f991798b7b37fbe9db6268b334acb353763d4eb8 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 10 Apr 2021 09:49:15 +0800 Subject: [PATCH 124/296] Match-id-543e025679baababf62326e933783799ea6aa959 --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index e006115..4828b8d 100644 --- a/build/build.sh +++ b/build/build.sh @@ -64,7 +64,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=shared -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook @@ -74,7 +74,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=shared -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From 325ad71ea77c8e66fd9821f9c81053f030ef123c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 10 Apr 2021 14:08:43 +0800 Subject: [PATCH 125/296] Match-id-868f757cb014e9abba9c176394e8d5e76c868824 --- build/build.sh | 4 ++-- cli/src/u_mount.c | 9 +++++---- cli/src/utils.c | 2 +- cli/src/utils.h | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/build.sh b/build/build.sh index 4828b8d..453fce9 100644 --- a/build/build.sh +++ b/build/build.sh @@ -64,7 +64,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook @@ -74,7 +74,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 1dc559b..8b42948 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -117,13 +117,14 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe LOG_ERROR("error: failed to check dst %s stat", dst); return -1; } - - if (CreateFile(dst, srcStat.st_mode) < 0) { + ret = IsCreateFileSuccess(dst, srcStat.st_mode); + if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; } - if (Mount(src, dst) < 0) { + ret = Mount(src, dst); + if (ret < 0) { LOG_ERROR("error: failed to mount dev."); return -1; } @@ -170,7 +171,7 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } - ret = CreateFile(dst, srcStat.st_mode); + ret = IsCreateFileSuccess(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; diff --git a/cli/src/utils.c b/cli/src/utils.c index ab504b3..3c15f63 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -91,7 +91,7 @@ int MakeDirWithParent(const char *path, mode_t mode) return 0; } -int CreateFile(const char *path, mode_t mode) +int IsCreateFileSuccess(const char *path, mode_t mode) { /* directory */ char parentDir[BUF_SIZE] = {0}; diff --git a/cli/src/utils.h b/cli/src/utils.h index 29dc8d7..45572ed 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -16,6 +16,6 @@ int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); -int CreateFile(const char *path, mode_t mode); +int IsCreateFileSuccess(const char *path, mode_t mode); #endif \ No newline at end of file -- Gitee From 38373db6a080c29d9a6d724a0cf802ecee342f32 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 10 Apr 2021 15:54:56 +0800 Subject: [PATCH 126/296] Match-id-43ae21fadbca3a839d315a50d05339589ccbd22c --- cli/src/u_mount.c | 4 ++-- cli/src/utils.c | 2 +- cli/src/utils.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 8b42948..8e4b67c 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -117,7 +117,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe LOG_ERROR("error: failed to check dst %s stat", dst); return -1; } - ret = IsCreateFileSuccess(dst, srcStat.st_mode); + ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; @@ -171,7 +171,7 @@ int MountFile(const char *rootfs, const char *filepath) return 0; } - ret = IsCreateFileSuccess(dst, srcStat.st_mode); + ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { LOG_ERROR("error: failed to create mount dst file: %s.", dst); return -1; diff --git a/cli/src/utils.c b/cli/src/utils.c index 3c15f63..5515b38 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -91,7 +91,7 @@ int MakeDirWithParent(const char *path, mode_t mode) return 0; } -int IsCreateFileSuccess(const char *path, mode_t mode) +int MakeMountPoints(const char *path, mode_t mode) { /* directory */ char parentDir[BUF_SIZE] = {0}; diff --git a/cli/src/utils.h b/cli/src/utils.h index 45572ed..b097b29 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -16,6 +16,6 @@ int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); -int IsCreateFileSuccess(const char *path, mode_t mode); +int MakeMountPoints(const char *path, mode_t mode); #endif \ No newline at end of file -- Gitee From e03d5455f6a4c9203c9023a90d85fc38e7fcc807 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 11 Apr 2021 12:31:42 +0800 Subject: [PATCH 127/296] Match-id-33a792e9b450b2be671b023e51b312b86bc73160 --- cli/src/CMakeLists.txt | 2 +- install/deb/src/HuaweiSecureC/CMakeLists.txt | 2 +- install/deb/src/cjson/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 6057e3c..ff6662a 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -10,5 +10,5 @@ include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") aux_source_directory(. SRC) add_subdirectory(HuaweiSecureC) add_executable(ascend-docker-cli ${SRC}) -target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie) +target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/install/deb/src/HuaweiSecureC/CMakeLists.txt b/install/deb/src/HuaweiSecureC/CMakeLists.txt index 4a9d0c5..84fd943 100644 --- a/install/deb/src/HuaweiSecureC/CMakeLists.txt +++ b/install/deb/src/HuaweiSecureC/CMakeLists.txt @@ -4,4 +4,4 @@ aux_source_directory(. LIB_SRC) #生成链接库 add_library(HuaweiSecureC ${LIB_SRC}) -target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie) +target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) diff --git a/install/deb/src/cjson/CMakeLists.txt b/install/deb/src/cjson/CMakeLists.txt index 01a144f..eb2ae25 100644 --- a/install/deb/src/cjson/CMakeLists.txt +++ b/install/deb/src/cjson/CMakeLists.txt @@ -4,5 +4,5 @@ aux_source_directory(. LIB_SRC) #生成链接库 add_library(cjson ${LIB_SRC}) -target_compile_options(cjson PRIVATE -fstack-protector-all -fpie) +target_compile_options(cjson PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) -- Gitee From bcc702181a9fcad7d7ccb109ba34e5757b2d30ac Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Apr 2021 09:00:55 +0800 Subject: [PATCH 128/296] Match-id-682813c829912d99675cce899845ac342681d6f4 --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 453fce9..14b8c5c 100644 --- a/build/build.sh +++ b/build/build.sh @@ -64,7 +64,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + go build -buildmode=c-archive -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook @@ -74,7 +74,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + go build -buildmode=c-archive -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From 7595105d5e33d32df2bbfe9dfaaf8944cbda89cb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Apr 2021 09:29:25 +0800 Subject: [PATCH 129/296] Match-id-c478d135e001a141eb54c7030e6115c7aefeeefa --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 14b8c5c..453fce9 100644 --- a/build/build.sh +++ b/build/build.sh @@ -64,7 +64,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=c-archive -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} strip main mv main ascend-docker-hook @@ -74,7 +74,7 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=c-archive -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From 2316059a9aaf34ff2da79e4cb491cf9c14ad9ffa Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Apr 2021 10:39:07 +0800 Subject: [PATCH 130/296] Match-id-f3ee93cd442a9859c67d92e504eb2d847468d158 --- build/build.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build/build.sh b/build/build.sh index 453fce9..bad19da 100644 --- a/build/build.sh +++ b/build/build.sh @@ -62,19 +62,20 @@ function build_bin() [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${HOOKSRCNAME} - strip main + export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" + export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" + export CGO_LDFLAGS="-Wl,-s,--build-id=none" + go build -buildmode=pie -trimpath -ldflags="-w -s" ../${HOOKSRCNAME} mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - go build -buildmode=pie -ldflags "-buildid=IdNetCheck" -trimpath ../${RUNTIMESRCNAME} + export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" + export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" + export CGO_LDFLAGS="-Wl,-s,--build-id=none" + go build -buildmode=pie -trimpath -ldflags="-w -s" ../${RUNTIMESRCNAME} strip main mv main ascend-docker-runtime } -- Gitee From dc88e5ac6f95345c4b02ad333e8020ab40f31974 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Apr 2021 13:48:24 +0800 Subject: [PATCH 131/296] Match-id-6806e9fd7166a02df6e1e45eccdd3959ec693a5f --- build/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index bad19da..255b0f5 100644 --- a/build/build.sh +++ b/build/build.sh @@ -76,7 +76,6 @@ function build_bin() export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" export CGO_LDFLAGS="-Wl,-s,--build-id=none" go build -buildmode=pie -trimpath -ldflags="-w -s" ../${RUNTIMESRCNAME} - strip main mv main ascend-docker-runtime } -- Gitee From a10eba6e5effcd83e8c3300beca5c84d5ba091de Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Apr 2021 15:45:18 +0800 Subject: [PATCH 132/296] Match-id-e81d98301b7272a7dbafd587cfb13141835f57c7 --- build/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.sh b/build/build.sh index 255b0f5..247c14f 100644 --- a/build/build.sh +++ b/build/build.sh @@ -64,8 +64,8 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_LDFLAGS="-Wl,-s,--build-id=none" - go build -buildmode=pie -trimpath -ldflags="-w -s" ../${HOOKSRCNAME} + export CGO_LDFLAGS="-Wl,-s,--build-id=none -pie" + go build -buildmode=pie -ldflags="-buildid=IdNetCheck -w -s" -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook echo "make runtime" @@ -74,8 +74,8 @@ function build_bin() export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_LDFLAGS="-Wl,-s,--build-id=none" - go build -buildmode=pie -trimpath -ldflags="-w -s" ../${RUNTIMESRCNAME} + export CGO_LDFLAGS="-Wl,-s,--build-id=none -pie" + go build -buildmode=pie -ldflags="-buildid=IdNetCheck -w -s" -trimpath ../${RUNTIMESRCNAME} mv main ascend-docker-runtime } -- Gitee From d9c1edf0e8e7082dae2d3fbcca42ce7a7d74a176 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 19 Apr 2021 11:29:06 +0800 Subject: [PATCH 133/296] Match-id-09901361d9eeae243035e171e4dc73ccbe63ece4 --- build/build.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/build.sh b/build/build.sh index 247c14f..f0f6dc4 100644 --- a/build/build.sh +++ b/build/build.sh @@ -62,20 +62,20 @@ function build_bin() [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_LDFLAGS="-Wl,-s,--build-id=none -pie" - go build -buildmode=pie -ldflags="-buildid=IdNetCheck -w -s" -trimpath ../${HOOKSRCNAME} + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_CPPFLAGS="-fstack-protector-all -ftrapv -D_FORTIFY_SOURCE=2 -O2" - export CGO_LDFLAGS="-Wl,-s,--build-id=none -pie" - go build -buildmode=pie -ldflags="-buildid=IdNetCheck -w -s" -trimpath ../${RUNTIMESRCNAME} + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} mv main ascend-docker-runtime } @@ -113,7 +113,7 @@ function make_unzip() { cd ${OPENSRC} CJSONS=$(find . -name "cJSON.*") - CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson + CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson /bin/cp -f ${CJSONS} ${CJSONSLIB} MAKESELF_DIR=$(find . -name "makeself-release-*") -- Gitee From 34fc1a31636be675d0ff299fbb679379ce5cf23d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 28 Apr 2021 10:49:57 +0800 Subject: [PATCH 134/296] Match-id-56b8bf3f8f798f1b37c419b38166665caef9d603 --- ci/dependency.xml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index c78680d..950da24 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -16,21 +16,4 @@ - - - - BVersion - Generic - - Huawei Secure C - Huawei Secure C V100R001C01SPC009B003 - - - - /* - platform/ - - - - -- Gitee From feca2e0d370c92cdbe0f5db72af017b03fe406ac Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 28 Apr 2021 13:51:33 +0800 Subject: [PATCH 135/296] Match-id-b0401735f9cf5b6f2b6cebc6f88e3ac31f59297d --- build/build.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build/build.sh b/build/build.sh index f0f6dc4..43a49d1 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,20 +61,12 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook echo "make runtime" [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} mv main ascend-docker-runtime } -- Gitee From ac6aada6ab6db0ee3257d9fb48e3e88f59d80da6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 28 Apr 2021 14:21:24 +0800 Subject: [PATCH 136/296] Match-id-d87d238e89a1fd2e2d3e63729ae38aae78a91d57 --- build/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/build.sh b/build/build.sh index 43a49d1..a49db4e 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,6 +61,10 @@ function build_bin() echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook -- Gitee From 903b2439ad2bd71e5b2cb4c92f11b340834fcc8d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 30 Apr 2021 11:17:17 +0800 Subject: [PATCH 137/296] Match-id-da09f484a277affdf62d906ca8cedbeeda62b897 --- ci/dependency.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci/dependency.xml b/ci/dependency.xml index 950da24..ddad9de 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -16,4 +16,21 @@ + + + + BVersion + Generic + + Huawei Secure C + Huawei Secure C V100R001C01SPC011B003 + + + + /* + platform/ + + + + -- Gitee From 31bb4877f2363983b3f975bfba3cec3d532ba0a1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 7 May 2021 10:28:53 +0800 Subject: [PATCH 138/296] Match-id-61f710aee7265b84bb1cf0931e1599608224064a --- build/scripts/run_main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 90334aa..c483e8d 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -158,7 +158,7 @@ if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ fi # 需root用户权限 -if [ "${USER}" != "root" ]; then +if [ "${UID}" != "0" ]; then echo 'please run with root permission' exit 1 fi -- Gitee From eee3a9c5310d40fb2bb05b3190aebeb9d953c22e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 16 Jun 2021 10:04:03 +0800 Subject: [PATCH 139/296] Match-id-12bb7c3ee15d9f04e35204e84d8ef7a005828421 --- ci/dependency.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index ddad9de..9ae6139 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -4,7 +4,7 @@ Component Generic - CANN + MindXToolBox ascend-docker-plugin 20.10.0.B010 -- Gitee From 58595341b81cf4118e2f487137845ebe36e64130 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 16 Jun 2021 10:09:53 +0800 Subject: [PATCH 140/296] Match-id-a4a93a8edc767685ea52159307145658cbeb252c --- ci/dependency.xml | 2 +- cli/src/cgrp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/dependency.xml b/ci/dependency.xml index 9ae6139..7d8e5fb 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -4,7 +4,7 @@ Component Generic - MindXToolBox + MindX ascend-docker-plugin 20.10.0.B010 diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 22f2d9c..feef8ab 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "securec.h" -- Gitee From ab3ba3702955da79e4c71771761f148878768680 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 18 Jun 2021 14:31:59 +0800 Subject: [PATCH 141/296] Match-id-ca494e624f72b13ade0060716a9952e0fe19fafb --- build/scripts/run_main.sh | 1 + build/scripts/uninstall.sh | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index c483e8d..26bf50a 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -34,6 +34,7 @@ function install() rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} fi mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} + chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 57ef761..2cb5b28 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -2,7 +2,9 @@ # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # Description: ascend-docker-runtime 卸载脚本 set -e - +LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} ROOT=$(cd $(dirname $0); pwd)/.. DST='/etc/docker/daemon.json' SRC="${DST}.${PPID}" @@ -14,10 +16,21 @@ fi ${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then - echo 'ERROR: del damon.json failed' + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} exit 1 fi mv ${SRC} ${DST} [ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} +INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) + +if test -d ${INSTALL_ROOT_PATH} +then + rm -rf ${INSTALL_ROOT_PATH} + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" >>${LOG_FILE} +fi +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" >>${LOG_FILE} \ No newline at end of file -- Gitee From 1d10f3f68b49e01652e74dac6c5b30ed4d03767f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 29 Jun 2021 20:19:24 +0800 Subject: [PATCH 142/296] Match-id-a7daddceab745d133a401439354c20bb5724d857 --- build/scripts/run_main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index c483e8d..c1671ad 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -98,7 +98,7 @@ function upgrade() chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper - chmod 550 ${INSTALL_PATH}/script/uninstall.sh + chmod 500 ${INSTALL_PATH}/script/uninstall.sh chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list echo 'upgrade ascend docker runtime success' -- Gitee From 80b4deb584d5e75e7b1047dffe77be45b75ac154 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 30 Jun 2021 10:18:11 +0800 Subject: [PATCH 143/296] Match-id-e86743ebedd7ea6a476b02262bb7017af60bdb26 --- build/scripts/run_main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index c1671ad..2db8163 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -28,7 +28,7 @@ function install() cp -f ./README.md ${INSTALL_PATH}/README.md mkdir -p ${INSTALL_PATH}/script cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh - chmod 550 ${INSTALL_PATH}/script/uninstall.sh + chmod 500 ${INSTALL_PATH}/script/uninstall.sh if [ -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} -- Gitee From d7eb64aa02f36d1223d918c671a213e927a1fe7a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Jul 2021 15:04:31 +0800 Subject: [PATCH 144/296] Match-id-ff14c3cc373447ddd47e99b03a251a5ac693c6e3 --- cli/src/cgrp.c | 37 ++++++++--------- cli/src/logger.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++ cli/src/logger.h | 11 +++++ cli/src/main.c | 65 ++++++++++++++--------------- cli/src/ns.c | 8 ++-- cli/src/u_mount.c | 53 ++++++++++++------------ cli/src/utils.c | 24 +++++++++-- cli/src/utils.h | 1 + 8 files changed, 218 insertions(+), 82 deletions(-) create mode 100644 cli/src/logger.c create mode 100644 cli/src/logger.h diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index feef8ab..a73a0ca 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -18,6 +18,7 @@ #include "utils.h" #include "options.h" +#include "logger.h" bool TakeNthWord(char **pLine, unsigned int n, char **word) { @@ -73,13 +74,13 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - LOG_ERROR("error: cannot canonicalize path %s.", filepath); + Logger(FormatMessage("cannot canonicalize path %s.", filepath), 2); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - LOG_ERROR("cannot open file."); + Logger("cannot open file.", 2); return -1; } @@ -157,20 +158,20 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - LOG_ERROR("error: failed to assemble dev path for %s.", devName); + Logger(FormatMessage("failed to assemble dev path for %s.", devName), 2); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - LOG_ERROR("error: failed to get stat of %s.", devPath); + Logger(FormatMessage("failed to get stat of %s.", devPath), 2); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - LOG_ERROR("error: write devices failed."); + Logger("write devices failed.", 2); return -1; } @@ -183,19 +184,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - LOG_ERROR("error: failed to setup cgroup for %s.", DAVINCI_MANAGER); + Logger(FormatMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER), 2); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - LOG_ERROR("error: failed to setup cgroup for %s.", DEVMM_SVM); + Logger(FormatMessage("failed to setup cgroup for %s.", DEVMM_SVM), 2); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - LOG_ERROR("error: failed to setup cgroup for %s.", HISI_HDC); + Logger(FormatMessage("failed to setup cgroup for %s.", HISI_HDC), 2); return -1; } @@ -210,13 +211,13 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - LOG_ERROR("error: assemble mount info path failed: ppid(%d).", getppid()); + Logger(FormatMessage("assemble mount info path failed: ppid(%d).", getppid()), 2); return -1; } ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - LOG_ERROR("error: cat file content failed."); + Logger("cat file content failed.", 2); return -1; } @@ -224,13 +225,13 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) char cgroupPath[BUF_SIZE] = {0x0}; ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { - LOG_ERROR("error: assemble cgroup path failed: pid(%d).", pid); + Logger(FormatMessage("assemble cgroup path failed: pid(%d).", pid), 2); return -1; } ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - LOG_ERROR("error: cat file content failed."); + Logger("cat file content failed.", 2); return -1; } @@ -239,7 +240,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - LOG_ERROR("error: assemble cgroup device path failed."); + Logger("assemble cgroup device path failed.", 2); return -1; } @@ -254,20 +255,20 @@ int SetupCgroup(const struct ParsedConfig *config) FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - LOG_ERROR("error: cannot canonicalize cgroup path: %s.", config->cgroupPath); + Logger(FormatMessage("cannot canonicalize cgroup path: %s.", config->cgroupPath), 2); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - LOG_ERROR("error: failed to open cgroup file: %s.", resolvedCgroupPath); + Logger(FormatMessage("failed to open cgroup file: %s.", resolvedCgroupPath), 2); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - LOG_ERROR("error: failed to setup driver cgroup."); + Logger("failed to setup driver cgroup.", 2); return -1; } @@ -277,14 +278,14 @@ int SetupCgroup(const struct ParsedConfig *config) config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - LOG_ERROR("error: failed to assemble device path for no.%u.", config->devices[idx]); + Logger(FormatMessage("failed to assemble device path for no.%u.", config->devices[idx]), 2); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - LOG_ERROR("error: failed to setup cgroup for %s.", deviceName); + Logger(FormatMessage("failed to setup cgroup for %s.", deviceName), 2); return -1; } } diff --git a/cli/src/logger.c b/cli/src/logger.c new file mode 100644 index 0000000..377e7f9 --- /dev/null +++ b/cli/src/logger.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli日志模块 +*/ +#include +#include +#include +#include +#include + +#define FILE_MAX_SIZE (1024*1024*10) +#define LOG_PATH_DIR "/var/log/" + +void GetCurrentLocalTime(char* buffer) +{ + time_t rawtime; + struct tm* timeinfo; + time(&rawtime); + timeinfo = localtime(&rawtime); + sprintf(buffer, "[%04d-%02d-%02d %02d:%02d:%02d]", + (timeinfo->tm_year+1900), + (timeinfo->tm_mon+1), + (timeinfo->tm_mday), + (timeinfo->tm_hour), + (timeinfo->tm_min), + (timeinfo->tm_sec)); +} + +long GetLogSize(char* filename) +{ + long length = 0; + FILE *fp = NULL; + fp = fopen(filename, "rb"); + if (fp != NULL) + { + fseek(fp, 0, SEEK_END); + length = ftell(fp); + } + if (fp != NULL) + { + fclose(fp); + fp = NULL; + } + return length; +} + +void LogLoop(char* filename) +{ + char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; + int exist; + exist = access(loopPath, 0); + if (exist == 0) + { + unlink(loopPath); + } + rename(filename, loopPath); +} + +void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSize) +{ + if (filename != NULL && buffer != NULL) + { + long length = GetLogSize(filename); + if (length > maxSize) + { + LogLoop(filename); + } + FILE *fp; + fp = fopen(filename, "a+"); + if (fp != NULL) + { + char now[21]; + memset(now, 0, sizeof(now)); + GetCurrentLocalTime(now); + fwrite(now, strlen(now), 1, fp); + fwrite(buffer, bufferSize, 1, fp); + fclose(fp); + fp = NULL; + } + } +} + +void Logger(const char *msg, int level) { + enum LEVEL { Info=0, Warn, Error, Debug}; + enum LEVEL _level; + char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; + _level = level; + char buffer[strlen(msg)+20]; + memset(buffer, 0, sizeof(buffer)); + switch (_level) + { + case Debug:sprintf(buffer, "[Debug]%s\n", msg); + break; + case Error:sprintf(buffer, "[Error]%s\n", msg); + break; + case Warn:sprintf(buffer, "[Warn]%s\n", msg); + break; + default:sprintf(buffer, "[Info]%s\n", msg); + } + WriteLogFile(logPath, FILE_MAX_SIZE, buffer, strlen(buffer)); +} diff --git a/cli/src/logger.h b/cli/src/logger.h new file mode 100644 index 0000000..02636f1 --- /dev/null +++ b/cli/src/logger.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend-docker-cli工具容器logger日志模块头文件 +*/ + +#ifndef _LOGGER_H +#define _LOGGER_H + +void Logger(const char *msg, int level); + +#endif diff --git a/cli/src/main.c b/cli/src/main.c index 662d578..931ffbe 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -19,6 +19,8 @@ #include "u_mount.h" #include "cgrp.h" #include "options.h" +#include "utils.h" +#include "logger.h" #define DECIMAL 10 @@ -47,7 +49,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { - LOG_ERROR("error: failed to get devices from cmd args."); + Logger("failed to get devices from cmd args.", 2); return false; } @@ -59,12 +61,12 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { - LOG_ERROR("error: failed to convert pid string from cmd args, pid string: %s.", arg); + Logger(FormatMessage("failed to convert pid string from cmd args, pid string: %s.", arg), 2); return false; } if (args->pid <= 0) { - LOG_ERROR("error: invalid pid %d.", args->pid); + Logger(FormatMessage("invalid pid %d.", args->pid), 2); return false; } @@ -75,7 +77,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { - LOG_ERROR("error: failed to get rootfs path from cmd args"); + Logger("failed to get rootfs path from cmd args", 2); return false; } @@ -86,7 +88,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { - LOG_ERROR("error: failed to get options string from cmd args"); + Logger("failed to get options string from cmd args", 2); return false; } @@ -96,14 +98,14 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->files.count == MAX_MOUNT_NR) { - LOG_ERROR("error: too many files to mount, max number is %u", MAX_MOUNT_NR); + Logger(FormatMessage("too many files to mount, max number is %u", MAX_MOUNT_NR), 2); return -1; } char *dst = &args->files.list[args->files.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - LOG_ERROR("error: failed to copy mount file path: %s", arg); + Logger(FormatMessage("failed to copy mount file path: %s", arg), 2); return false; } @@ -113,14 +115,14 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->dirs.count == MAX_MOUNT_NR) { - LOG_ERROR("error: too many directories to mount, max number is %u", MAX_MOUNT_NR); + Logger(FormatMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR), 2); return -1; } char *dst = &args->dirs.list[args->dirs.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - LOG_ERROR("error: failed to copy mount directory path: %s", arg); + Logger(FormatMessage("error: failed to copy mount directory path: %s", arg), 2); return false; } @@ -151,16 +153,14 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu } if (i == NUM_OF_CMD_ARGS) { - LOG_ERROR("error: unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); + Logger(FormatMessage("unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value), 2); return -1; } - bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { - LOG_ERROR("error: failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); + Logger(FormatMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value), 2); return -1; } - return 0; } @@ -179,14 +179,14 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device token = strtok_s(devices, sep, &context); while (token != NULL) { if (idx >= *idListSize) { - LOG_ERROR("error: too many devices(%u), support %u devices maximally", idx, *idListSize); + Logger(FormatMessage("too many devices(%u), support %u devices maximally", idx, *idListSize), 2); return -1; } errno = 0; idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { - LOG_ERROR("error: failed to convert device id (%s) from cmd args", token); + Logger(FormatMessage("failed to convert device id (%s) from cmd args", token), 2); return -1; } @@ -205,38 +205,38 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { - LOG_ERROR("error: failed to copy rootfs path to parsed config."); + Logger("failed to copy rootfs path to parsed config.", 2); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { - LOG_ERROR("error: failed to parse device ids from cmdline argument"); + Logger("failed to parse device ids from cmdline argument", 2); return -1; } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - LOG_ERROR("error: failed to get container mnt ns path: pid(%d).", args->pid); + Logger(FormatMessage("failed to get container mnt ns path: pid(%d).", args->pid), 2); return -1; } ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { - LOG_ERROR("error: failed to get cgroup path."); + Logger("failed to get cgroup path.", 2); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - LOG_ERROR("error: failed to get self ns path."); + Logger("failed to get self ns path.", 2); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - LOG_ERROR("error: failed to get self ns fd: %s.", originNsPath); + Logger(FormatMessage("failed to get self ns fd: %s.", originNsPath), 2); return -1; } @@ -255,28 +255,28 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - LOG_ERROR("error: failed to prepare nesessary config."); + Logger("failed to prepare nesessary config.", 2); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - LOG_ERROR("error: failed to set to container ns: %s.", config.containerNsPath); + Logger(FormatMessage("failed to set to container ns: %s.", config.containerNsPath), 2); close(config.originNsFd); return -1; } ret = DoMounting(&config); if (ret < 0) { - LOG_ERROR("error: failed to do mounting."); + Logger("failed to do mounting.", 2); close(config.originNsFd); return -1; } ret = SetupCgroup(&config); if (ret < 0) { - LOG_ERROR("error: failed to set up cgroup."); + Logger("failed to set up cgroup.", 2); close(config.originNsFd); return -1; } @@ -284,7 +284,7 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - LOG_ERROR("error: failed to set ns back."); + Logger("failed to set ns back.", 2); close(config.originNsFd); return -1; } @@ -300,27 +300,28 @@ int Process(int argc, char **argv) int optionIndex; struct CmdArgs args = {0}; + Logger("runc start prestart-hook ...", 0); while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { - LOG_ERROR("error: failed to parse cmd args."); + Logger("failed to parse cmd args.", 2); return -1; } } - + Logger("verify parameters valid and parse runtime options", 0); if (!IsCmdArgsValid(&args)) { - LOG_ERROR("error: information not completed or valid."); + Logger("information not completed or valid.", 2); return -1; } ParseRuntimeOptions(args.options); - + Logger("setup container config", 0); ret = SetupContainer(&args); if (ret < 0) { - LOG_ERROR("error: failed to setup container."); + Logger("failed to setup container.", 2); return ret; } - + Logger("prestart-hook setup container successful.", 0); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 57ec208..6d837bd 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -10,6 +10,8 @@ #include #include "basic.h" #include "securec.h" +#include "utils.h" +#include "logger.h" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) { @@ -27,7 +29,7 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - LOG_ERROR("error: failed to set ns: fd(%d).", fd); + Logger(FormatMessage("failed to set ns: fd(%d).", fd), 2); return -1; } @@ -41,13 +43,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - LOG_ERROR("error: failed to open ns path: %s.", path); + Logger(FormatMessage("failed to open ns path: %s.", path), 2); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - LOG_ERROR("error: failed to set ns: %s.", path); + Logger(FormatMessage("failed to set ns: %s.", path), 2); close(fd); return -1; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 8e4b67c..7251394 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -14,6 +14,7 @@ #include "basic.h" #include "utils.h" #include "options.h" +#include "logger.h" int Mount(const char *src, const char *dst) { @@ -23,13 +24,13 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - LOG_ERROR("error: failed to mount."); + Logger("failed to mount.", 2); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - LOG_ERROR("error: failed to re-mount."); + Logger("failed to re-mount.", 2); return -1; } @@ -65,7 +66,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - LOG_ERROR("error: cannot canonicalize device dst: %s.", dst); + Logger(FormatMessage("cannot canonicalize device dst: %s.", dst), 2); return -1; } @@ -77,7 +78,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - LOG_ERROR("error: failed to copy resolved device mnt path to dst: %s.", resolvedDst); + Logger(FormatMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst), 2); return -1; } } @@ -94,14 +95,14 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - LOG_ERROR("error: failed to get device mount src and(or) dst path, device name: %s.", srcDeviceName); + Logger(FormatMessage("failed to get device mount src and(or) dst path, device name: %s.", srcDeviceName), 2); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - LOG_ERROR("error: failed to stat src: %s.", src); + Logger(FormatMessage("failed to stat src: %s.", src), 2); return -1; } @@ -111,21 +112,21 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - LOG_ERROR("error: %s already exists but not a char device as expected.", dst); + Logger(FormatMessage("%s already exists but not a char device as expected.", dst), 2); return -1; } else if (ret < 0 && errno != ENOENT) { - LOG_ERROR("error: failed to check dst %s stat", dst); + Logger(FormatMessage("failed to check dst %s stat", dst), 2); return -1; } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - LOG_ERROR("error: failed to create mount dst file: %s.", dst); + Logger(FormatMessage("failed to create mount dst file: %s.", dst), 2); return -1; } ret = Mount(src, dst); if (ret < 0) { - LOG_ERROR("error: failed to mount dev."); + Logger("failed to mount dev.", 2); return -1; } @@ -141,12 +142,12 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int srcRet = sprintf_s(srcDeviceName, BUF_SIZE, "%s%u", device_name, ids[idx]); int dstRet = sprintf_s(dstDeviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (srcRet < 0 || dstRet < 0) { - LOG_ERROR("error: assemble device name failed, id: %u.", ids[idx]); + Logger(FormatMessage("assemble device name failed, id: %u.", ids[idx]), 2); return -1; } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - LOG_ERROR("error: failed to mount device %s.", srcDeviceName); + Logger(FormatMessage("failed to mount device %s.", srcDeviceName), 2); return -1; } } @@ -161,7 +162,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - LOG_ERROR("error: failed to assemble file mounting path, file: %s.", filepath); + Logger(FormatMessage("failed to assemble file mounting path, file: %s.", filepath), 2); return -1; } @@ -173,13 +174,13 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - LOG_ERROR("error: failed to create mount dst file: %s.", dst); + Logger(FormatMessage("failed to create mount dst file: %s.", dst), 2); return -1; } ret = Mount(filepath, dst); if (ret < 0) { - LOG_ERROR("error: failed to mount dev."); + Logger("failed to mount dev.", 2); return -1; } @@ -204,13 +205,13 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - LOG_ERROR("error: failed to make dir: %s.", dst); + Logger(FormatMessage("failed to make dir: %s.", dst), 2); return -1; } ret = Mount(src, dst); if (ret < 0) { - LOG_ERROR("error: failed to mount dir: %s to %s.", src, dst); + Logger(FormatMessage("error: failed to mount dir: %s to %s.", src, dst), 2); return -1; } @@ -222,19 +223,19 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { - LOG_ERROR("error: failed to mount device %s.", DAVINCI_MANAGER); + Logger(FormatMessage("failed to mount device %s.", DAVINCI_MANAGER), 2); return -1; } ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { - LOG_ERROR("error: failed to mount device %s.", DEVMM_SVM); + Logger(FormatMessage("failed to mount device %s.", DEVMM_SVM), 2); return -1; } ret = MountDevice(rootfs, HISI_HDC, NULL); if (ret < 0) { - LOG_ERROR("error: failed to mount device %s.", HISI_HDC); + Logger(FormatMessage("failed to mount device %s.", HISI_HDC), 2); return -1; } @@ -248,7 +249,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do directory mounting for %s.", (const char *)&list->list[i][0]); + Logger(FormatMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]), 2); return -1; } } @@ -263,7 +264,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - LOG_ERROR("error: failed to do file mounting for %s.", (const char *)&list->list[i][0]); + Logger(FormatMessage("failed to do file mounting for %s.", (const char *)&list->list[i][0]), 2); return -1; } } @@ -278,13 +279,13 @@ int DoMounting(const struct ParsedConfig *config) (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), config->devices, config->devicesNr); if (ret < 0) { - LOG_ERROR("error: failed to mount devices."); + Logger("failed to mount devices.", 2); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - LOG_ERROR("error: failed to mount ctrl devices."); + Logger("failed to mount ctrl devices.", 2); return -1; } @@ -294,13 +295,13 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { - LOG_ERROR("error: failed to mount files."); + Logger("failed to mount files.", 2); return -1; } ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { - LOG_ERROR("error: failed to do mount directories."); + Logger("failed to do mount directories.", 2); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index 5515b38..e905efc 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -13,6 +13,24 @@ #include #include #include "securec.h" +#include "logger.h" +char *FormatMessage(char *format, ...){ + va_list list; + // 获取格式化后字符串的长度 + va_start(list, format); + int size = vsnprintf(NULL, 0, format, list); + va_end(list); + if(size <= 0){ + return NULL; + } + size++; + // 复位va_list, 将格式化字符串写入到buf + va_start(list, format); + char *buf = (char *)malloc(size); + vsnprintf(buf, size, format, list); + va_end(list); + return buf; +} int IsStrEqual(const char *s1, const char *s2) { @@ -99,19 +117,19 @@ int MakeMountPoints(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { - LOG_ERROR("error: failed to make parent dir for file: %s", path); + Logger(FormatMessage("failed to make parent dir for file: %s", path), 2); return -1; } char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - LOG_ERROR("error: failed to resolve path %s.", path); + Logger(FormatMessage("failed to resolve path %s.", path), 2); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - LOG_ERROR("error: cannot create file: %s.", resolvedPath); + Logger(FormatMessage("cannot create file: %s.", resolvedPath), 2); return -1; } close(fd); diff --git a/cli/src/utils.h b/cli/src/utils.h index b097b29..a399c50 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -9,6 +9,7 @@ #include #include "basic.h" +char *FormatMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); int MkDir(const char *dir, int mode); -- Gitee From 2a8df8f50e3863499e474d4935a200a30ffca71a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 6 Jul 2021 21:16:21 +0800 Subject: [PATCH 145/296] Match-id-737d601f866e7f67e6759de16b6f5541d2d1ded4 --- cli/src/basic.h | 6 +++ cli/src/cgrp.c | 80 +++++++++++++++++++++++-------- cli/src/logger.c | 25 ++++------ cli/src/logger.h | 2 +- cli/src/main.c | 119 ++++++++++++++++++++++++++++++++++------------ cli/src/ns.c | 15 ++++-- cli/src/u_mount.c | 114 ++++++++++++++++++++++++++++++++++---------- cli/src/utils.c | 24 +++++++--- cli/src/utils.h | 2 +- 9 files changed, 285 insertions(+), 102 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index ab5d288..65e4181 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -19,6 +19,12 @@ #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 +#define LEVEL_INFO 0 +#define LEVEL_WARN 1 +#define LEVEL_ERROR 2 +#define LEVEL_DEBUG 3 + + #define LOG_ERROR(fmt, ...) \ do { \ char _content[BUF_SIZE] = {0}; \ diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index a73a0ca..4c6c430 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -3,7 +3,7 @@ * Description: ascend-docker-cli工具容器CGroup配置模块 */ #include "cgrp.h" - +#include "basic.h" #include #include #include @@ -74,13 +74,17 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - Logger(FormatMessage("cannot canonicalize path %s.", filepath), 2); + int iLength = 0; + char* str = FormatLogMessage("cannot canonicalize path %s.", &iLength, filepath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - Logger("cannot open file.", 2); + char msg[] = "cannot open file."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -158,20 +162,27 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - Logger(FormatMessage("failed to assemble dev path for %s.", devName), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to assemble dev path for %s.", &iLength, devName); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - Logger(FormatMessage("failed to get stat of %s.", devPath), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to get stat of %s.", &iLength, devPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - Logger("write devices failed.", 2); + char msg[] = "write devices failed."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -184,19 +195,28 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - Logger(FormatMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, DAVINCI_MANAGER); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - Logger(FormatMessage("failed to setup cgroup for %s.", DEVMM_SVM), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, DEVMM_SVM); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - Logger(FormatMessage("failed to setup cgroup for %s.", HISI_HDC), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, HISI_HDC); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -211,13 +231,17 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - Logger(FormatMessage("assemble mount info path failed: ppid(%d).", getppid()), 2); + int iLength = 0; + char* str = FormatLogMessage("assemble mount info path failed: ppid(%d).", &iLength, getppid()); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - Logger("cat file content failed.", 2); + char msg[] = "cat file content failed."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -225,13 +249,17 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) char cgroupPath[BUF_SIZE] = {0x0}; ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { - Logger(FormatMessage("assemble cgroup path failed: pid(%d).", pid), 2); + int iLength = 0; + char* str = FormatLogMessage("assemble cgroup path failed: pid(%d).", &iLength, pid); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - Logger("cat file content failed.", 2); + char msg[] = "cat file content failed."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -240,7 +268,8 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - Logger("assemble cgroup device path failed.", 2); + char msg[] = "assemble cgroup device path failed."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -255,20 +284,27 @@ int SetupCgroup(const struct ParsedConfig *config) FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - Logger(FormatMessage("cannot canonicalize cgroup path: %s.", config->cgroupPath), 2); + int iLength = 0; + char* str = FormatLogMessage("cannot canonicalize cgroup path: %s.", &iLength, config->cgroupPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - Logger(FormatMessage("failed to open cgroup file: %s.", resolvedCgroupPath), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to open cgroup file: %s.", &iLength, resolvedCgroupPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - Logger("failed to setup driver cgroup.", 2); + char msg[] = "failed to setup driver cgroup."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -278,14 +314,20 @@ int SetupCgroup(const struct ParsedConfig *config) config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - Logger(FormatMessage("failed to assemble device path for no.%u.", config->devices[idx]), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to assemble device path for no.%u.", &iLength, config->devices[idx]); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - Logger(FormatMessage("failed to setup cgroup for %s.", deviceName), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, deviceName); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } } diff --git a/cli/src/logger.c b/cli/src/logger.c index 377e7f9..b39876b 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -10,20 +10,16 @@ #define FILE_MAX_SIZE (1024*1024*10) #define LOG_PATH_DIR "/var/log/" +#define TEMP_BUFFER 30 -void GetCurrentLocalTime(char* buffer) +void GetCurrentLocalTime(char* buffer, int length) { time_t rawtime; - struct tm* timeinfo; + struct tm* timeinfo = NULL; time(&rawtime); timeinfo = localtime(&rawtime); - sprintf(buffer, "[%04d-%02d-%02d %02d:%02d:%02d]", - (timeinfo->tm_year+1900), - (timeinfo->tm_mon+1), - (timeinfo->tm_mday), - (timeinfo->tm_hour), - (timeinfo->tm_min), - (timeinfo->tm_sec)); + sprintf_s(buffer, TEMP_BUFFER, "[%04d-%02d-%02d %02d:%02d:%02d]", (timeinfo->tm_year+1900), (timeinfo->tm_mon+1), + (timeinfo->tm_mday), (timeinfo->tm_hour), (timeinfo->tm_min), (timeinfo->tm_sec)); } long GetLogSize(char* filename) @@ -69,9 +65,8 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz fp = fopen(filename, "a+"); if (fp != NULL) { - char now[21]; - memset(now, 0, sizeof(now)); - GetCurrentLocalTime(now); + char now[TEMP_BUFFER] = {0}; + GetCurrentLocalTime(now, sizeof(now)/sizeof(now[0])); fwrite(now, strlen(now), 1, fp); fwrite(buffer, bufferSize, 1, fp); fclose(fp); @@ -80,13 +75,12 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz } } -void Logger(const char *msg, int level) { +void Logger(const char *msg, int level, int length) { enum LEVEL { Info=0, Warn, Error, Debug}; enum LEVEL _level; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; _level = level; - char buffer[strlen(msg)+20]; - memset(buffer, 0, sizeof(buffer)); + char* buffer = malloc(length+20); switch (_level) { case Debug:sprintf(buffer, "[Debug]%s\n", msg); @@ -98,4 +92,5 @@ void Logger(const char *msg, int level) { default:sprintf(buffer, "[Info]%s\n", msg); } WriteLogFile(logPath, FILE_MAX_SIZE, buffer, strlen(buffer)); + free(buffer); } diff --git a/cli/src/logger.h b/cli/src/logger.h index 02636f1..efad6b0 100644 --- a/cli/src/logger.h +++ b/cli/src/logger.h @@ -6,6 +6,6 @@ #ifndef _LOGGER_H #define _LOGGER_H -void Logger(const char *msg, int level); +void Logger(const char *msg, int level, int length); #endif diff --git a/cli/src/main.c b/cli/src/main.c index 931ffbe..bc9bf21 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -49,7 +49,8 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get devices from cmd args.", 2); + char msg[] = "failed to get devices from cmd args."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return false; } @@ -61,12 +62,18 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { - Logger(FormatMessage("failed to convert pid string from cmd args, pid string: %s.", arg), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to convert pid string from cmd args, pid string: %s.", &iLength, arg); + Logger(str, LEVEL_ERROR, iLength); + free(str); return false; } if (args->pid <= 0) { - Logger(FormatMessage("invalid pid %d.", args->pid), 2); + int iLength = 0; + char* str = FormatLogMessage("invalid pid %d.", &iLength, args->pid); + Logger(str, LEVEL_ERROR, iLength); + free(str); return false; } @@ -77,7 +84,8 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get rootfs path from cmd args", 2); + char msg[] = "failed to get rootfs path from cmd args"; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return false; } @@ -88,7 +96,8 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get options string from cmd args", 2); + char msg[] = "failed to get options string from cmd args"; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return false; } @@ -98,14 +107,20 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->files.count == MAX_MOUNT_NR) { - Logger(FormatMessage("too many files to mount, max number is %u", MAX_MOUNT_NR), 2); + int iLength = 0; + char* str = FormatLogMessage("too many files to mount, max number is %u", &iLength, MAX_MOUNT_NR); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } char *dst = &args->files.list[args->files.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - Logger(FormatMessage("failed to copy mount file path: %s", arg), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to copy mount file path: %s", &iLength, arg); + Logger(str, LEVEL_ERROR, iLength); + free(str); return false; } @@ -115,14 +130,20 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->dirs.count == MAX_MOUNT_NR) { - Logger(FormatMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR), 2); + int iLength = 0; + char* str = FormatLogMessage("too many directories to mount, max number is %u", &iLength, MAX_MOUNT_NR); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } char *dst = &args->dirs.list[args->dirs.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - Logger(FormatMessage("error: failed to copy mount directory path: %s", arg), 2); + int iLength = 0; + char* str = FormatLogMessage("error: failed to copy mount directory path: %s", &iLength, arg); + Logger(str, LEVEL_ERROR, iLength); + free(str); return false; } @@ -153,12 +174,18 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu } if (i == NUM_OF_CMD_ARGS) { - Logger(FormatMessage("unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value), 2); + int iLength = 0; + char* str = FormatLogMessage("unrecognized cmd arg: indicate char: %c, value: %s.", &iLength, indicator, value); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { - Logger(FormatMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value), 2); + int iLength = 0; + char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", &iLength, indicator, value); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } return 0; @@ -179,14 +206,20 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device token = strtok_s(devices, sep, &context); while (token != NULL) { if (idx >= *idListSize) { - Logger(FormatMessage("too many devices(%u), support %u devices maximally", idx, *idListSize), 2); + int iLength = 0; + char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", &iLength, idx, *idListSize); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } errno = 0; idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { - Logger(FormatMessage("failed to convert device id (%s) from cmd args", token), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to convert device id (%s) from cmd args", &iLength, token); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -205,38 +238,48 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { - Logger("failed to copy rootfs path to parsed config.", 2); + char msg[] = "failed to copy rootfs path to parsed config."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { - Logger("failed to parse device ids from cmdline argument", 2); + char msg[] = "failed to parse device ids from cmdline argument"; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - Logger(FormatMessage("failed to get container mnt ns path: pid(%d).", args->pid), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to get container mnt ns path: pid(%d).", &iLength, args->pid); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { - Logger("failed to get cgroup path.", 2); + char msg[] = "failed to get cgroup path."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - Logger("failed to get self ns path.", 2); + char msg[] = "failed to get self ns path."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - Logger(FormatMessage("failed to get self ns fd: %s.", originNsPath), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to get self ns fd: %s.", &iLength, originNsPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -255,28 +298,34 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { - Logger("failed to prepare nesessary config.", 2); + char msg[] = "failed to prepare nesessary config."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } // enter container's mount namespace ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - Logger(FormatMessage("failed to set to container ns: %s.", config.containerNsPath), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to set to container ns: %s.", &iLength, config.containerNsPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); close(config.originNsFd); return -1; } ret = DoMounting(&config); if (ret < 0) { - Logger("failed to do mounting.", 2); + char msg[] = "failed to do mounting."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); close(config.originNsFd); return -1; } ret = SetupCgroup(&config); if (ret < 0) { - Logger("failed to set up cgroup.", 2); + char msg[] = "failed to set up cgroup."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); close(config.originNsFd); return -1; } @@ -284,7 +333,8 @@ int SetupContainer(struct CmdArgs *args) // back to original namespace ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - Logger("failed to set ns back.", 2); + char msg[] = "failed to set ns back."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); close(config.originNsFd); return -1; } @@ -300,28 +350,35 @@ int Process(int argc, char **argv) int optionIndex; struct CmdArgs args = {0}; - Logger("runc start prestart-hook ...", 0); + char startMsg[] = "runc start prestart-hook ..."; + Logger(startMsg, LEVEL_INFO, sizeof(startMsg)/sizeof(char)); while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { - Logger("failed to parse cmd args.", 2); + char msg[] = "failed to parse cmd args."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } } - Logger("verify parameters valid and parse runtime options", 0); + char parametersMsg[] = "verify parameters valid and parse runtime options"; + Logger(parametersMsg, LEVEL_INFO, sizeof(parametersMsg)/sizeof(char)); if (!IsCmdArgsValid(&args)) { - Logger("information not completed or valid.", 2); + char msg[] = "information not completed or valid."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ParseRuntimeOptions(args.options); - Logger("setup container config", 0); + char containerMsg[] = "setup container config"; + Logger(containerMsg, LEVEL_INFO, sizeof(containerMsg)/sizeof(char)); ret = SetupContainer(&args); if (ret < 0) { - Logger("failed to setup container.", 2); + char msg[] = "failed to setup container."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return ret; } - Logger("prestart-hook setup container successful.", 0); + char successMsg[] = "prestart-hook setup container successful."; + Logger(successMsg, LEVEL_INFO, sizeof(successMsg)/sizeof(char)); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 6d837bd..a7e7d11 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -29,7 +29,10 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - Logger(FormatMessage("failed to set ns: fd(%d).", fd), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to set ns: fd(%d).", &iLength, fd); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -43,13 +46,19 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - Logger(FormatMessage("failed to open ns path: %s.", path), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to open ns path: %s.", &iLength, path); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - Logger(FormatMessage("failed to set ns: %s.", path), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to set ns: %s.", &iLength, path); + Logger(str, LEVEL_ERROR, iLength); + free(str); close(fd); return -1; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 7251394..8fe92ae 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -24,13 +24,15 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - Logger("failed to mount.", 2); + char msg[] = "failed to mount."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - Logger("failed to re-mount.", 2); + char msg[] = "failed to re-mount."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -66,7 +68,10 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - Logger(FormatMessage("cannot canonicalize device dst: %s.", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("cannot canonicalize device dst: %s.", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -78,7 +83,10 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - Logger(FormatMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", &iLength, resolvedDst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } } @@ -95,14 +103,20 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - Logger(FormatMessage("failed to get device mount src and(or) dst path, device name: %s.", srcDeviceName), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to get device mount src and(or) dst path, device name: %s.", &iLength, srcDeviceName); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - Logger(FormatMessage("failed to stat src: %s.", src), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to stat src: %s.", &iLength, src); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -112,21 +126,31 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - Logger(FormatMessage("%s already exists but not a char device as expected.", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("%s already exists but not a char device as expected.", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } else if (ret < 0 && errno != ENOENT) { - Logger(FormatMessage("failed to check dst %s stat", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to check dst %s stat", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - Logger(FormatMessage("failed to create mount dst file: %s.", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = Mount(src, dst); if (ret < 0) { - Logger("failed to mount dev.", 2); + char msg[] = "failed to mount dev."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -142,12 +166,18 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int srcRet = sprintf_s(srcDeviceName, BUF_SIZE, "%s%u", device_name, ids[idx]); int dstRet = sprintf_s(dstDeviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (srcRet < 0 || dstRet < 0) { - Logger(FormatMessage("assemble device name failed, id: %u.", ids[idx]), 2); + int iLength = 0; + char* str = FormatLogMessage("assemble device name failed, id: %u.", &iLength, ids[idx]); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - Logger(FormatMessage("failed to mount device %s.", srcDeviceName), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to mount device %s.", &iLength, srcDeviceName); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } } @@ -162,7 +192,10 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - Logger(FormatMessage("failed to assemble file mounting path, file: %s.", filepath), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", &iLength, filepath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -174,13 +207,17 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - Logger(FormatMessage("failed to create mount dst file: %s.", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = Mount(filepath, dst); if (ret < 0) { - Logger("failed to mount dev.", 2); + char msg[] = "failed to mount dev."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -205,13 +242,19 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - Logger(FormatMessage("failed to make dir: %s.", dst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to make dir: %s.", &iLength, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = Mount(src, dst); if (ret < 0) { - Logger(FormatMessage("error: failed to mount dir: %s to %s.", src, dst), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to mount dir: %s to %s.", &iLength, src, dst); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -223,19 +266,28 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { - Logger(FormatMessage("failed to mount device %s.", DAVINCI_MANAGER), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to mount device %s.", &iLength, DAVINCI_MANAGER); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { - Logger(FormatMessage("failed to mount device %s.", DEVMM_SVM), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to mount device %s.", &iLength, DEVMM_SVM); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } ret = MountDevice(rootfs, HISI_HDC, NULL); if (ret < 0) { - Logger(FormatMessage("failed to mount device %s.", HISI_HDC), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to mount device %s.", &iLength, HISI_HDC); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } @@ -249,7 +301,10 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - Logger(FormatMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to do directory mounting for %s.", &iLength, (const char *)&list->list[i][0]); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } } @@ -264,7 +319,10 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - Logger(FormatMessage("failed to do file mounting for %s.", (const char *)&list->list[i][0]), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to do file mounting for %s.", &iLength, (const char *)&list->list[i][0]); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } } @@ -279,13 +337,15 @@ int DoMounting(const struct ParsedConfig *config) (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), config->devices, config->devicesNr); if (ret < 0) { - Logger("failed to mount devices.", 2); + char msg[] = "failed to mount devices."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - Logger("failed to mount ctrl devices.", 2); + char msg[] = "failed to mount ctrl devices."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } @@ -295,13 +355,15 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { - Logger("failed to mount files.", 2); + char msg[] = "failed to mount files."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { - Logger("failed to do mount directories.", 2); + char msg[] = "failed to do mount directories."; + Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index e905efc..f80d525 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -14,11 +14,13 @@ #include #include "securec.h" #include "logger.h" -char *FormatMessage(char *format, ...){ + +char *FormatLogMessage(char *format, int* iLength, ...){ va_list list; // 获取格式化后字符串的长度 va_start(list, format); - int size = vsnprintf(NULL, 0, format, list); + char buff[1024] = {0}; + int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff), format, list); va_end(list); if(size <= 0){ return NULL; @@ -27,7 +29,8 @@ char *FormatMessage(char *format, ...){ // 复位va_list, 将格式化字符串写入到buf va_start(list, format); char *buf = (char *)malloc(size); - vsnprintf(buf, size, format, list); + *iLength = size; + vsnprintf_s(buf, size, size, format, list); va_end(list); return buf; } @@ -117,19 +120,28 @@ int MakeMountPoints(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { - Logger(FormatMessage("failed to make parent dir for file: %s", path), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to make parent dir for file: %s", &iLength, path); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - Logger(FormatMessage("failed to resolve path %s.", path), 2); + int iLength = 0; + char* str = FormatLogMessage("failed to resolve path %s.", &iLength, path); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - Logger(FormatMessage("cannot create file: %s.", resolvedPath), 2); + int iLength = 0; + char* str = FormatLogMessage("cannot create file: %s.", &iLength, resolvedPath); + Logger(str, LEVEL_ERROR, iLength); + free(str); return -1; } close(fd); diff --git a/cli/src/utils.h b/cli/src/utils.h index a399c50..9350b44 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -9,7 +9,7 @@ #include #include "basic.h" -char *FormatMessage(char *format, ...); +char *FormatLogMessage(char *format, int* iLength, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); int MkDir(const char *dir, int mode); -- Gitee From 3ddbe2299d836919c3f9e225f36b4257aa0b9b21 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 7 Jul 2021 15:13:37 +0800 Subject: [PATCH 146/296] Match-id-df4725b6c80f635a41309e55ed1b71e075c67f50 --- cli/src/cgrp.c | 34 +++++++---------- cli/src/logger.c | 94 ++++++++++++++++++++++++++++++++--------------- cli/src/main.c | 42 +++++++++++---------- cli/src/u_mount.c | 50 ++++++++++--------------- cli/src/utils.c | 14 ++++--- 5 files changed, 128 insertions(+), 106 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 4c6c430..0a520cc 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -3,7 +3,6 @@ * Description: ascend-docker-cli工具容器CGroup配置模块 */ #include "cgrp.h" -#include "basic.h" #include #include #include @@ -84,7 +83,7 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const fp = fopen(resolvedPath, "r"); if (fp == NULL) { char msg[] = "cannot open file."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -182,7 +181,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { char msg[] = "write devices failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -241,7 +240,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { char msg[] = "cat file content failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -259,7 +258,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { char msg[] = "cat file content failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -269,7 +268,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { char msg[] = "assemble cgroup device path failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -279,24 +278,22 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { int ret; + int iLength = 0; + char *str = NULL; char deviceName[BUF_SIZE] = {0}; char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - int iLength = 0; - char* str = FormatLogMessage("cannot canonicalize cgroup path: %s.", &iLength, config->cgroupPath); + str = FormatLogMessage("cannot canonicalize cgroup path: %s.", &iLength, config->cgroupPath); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - int iLength = 0; - char* str = FormatLogMessage("failed to open cgroup file: %s.", &iLength, resolvedCgroupPath); + str = FormatLogMessage("failed to open cgroup file: %s.", &iLength, resolvedCgroupPath); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } @@ -304,7 +301,7 @@ int SetupCgroup(const struct ParsedConfig *config) if (ret < 0) { fclose(cgroupAllow); char msg[] = "failed to setup driver cgroup."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -314,24 +311,19 @@ int SetupCgroup(const struct ParsedConfig *config) config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - int iLength = 0; - char* str = FormatLogMessage("failed to assemble device path for no.%u.", &iLength, config->devices[idx]); + str = FormatLogMessage("failed to assemble device path for no.%u.", &iLength, config->devices[idx]); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - int iLength = 0; - char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, deviceName); + str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, deviceName); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } } - + free(str); fclose(cgroupAllow); return 0; } \ No newline at end of file diff --git a/cli/src/logger.c b/cli/src/logger.c index b39876b..78516c4 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -7,19 +7,30 @@ #include #include #include +#include "basic.h" -#define FILE_MAX_SIZE (1024*1024*10) +#define FILE_MAX_SIZE (1024 * 1024 * 10) #define LOG_PATH_DIR "/var/log/" #define TEMP_BUFFER 30 +#define YEAR_OFFSET 1900 +#define MONTH_OFFSET 1 +#define LEVEL_LENGTH 20 -void GetCurrentLocalTime(char* buffer, int length) +int GetCurrentLocalTime(const char* buffer, int length) { time_t rawtime; struct tm* timeinfo = NULL; time(&rawtime); timeinfo = localtime(&rawtime); - sprintf_s(buffer, TEMP_BUFFER, "[%04d-%02d-%02d %02d:%02d:%02d]", (timeinfo->tm_year+1900), (timeinfo->tm_mon+1), - (timeinfo->tm_mday), (timeinfo->tm_hour), (timeinfo->tm_min), (timeinfo->tm_sec)); + return sprintf_s(buffer, + TEMP_BUFFER, + "[%04d-%02d-%02d %02d:%02d:%02d]", + (timeinfo->tm_year + YEAR_OFFSET), + (timeinfo->tm_mon + MONTH_OFFSET), + (timeinfo->tm_mday), + (timeinfo->tm_hour), + (timeinfo->tm_min), + (timeinfo->tm_sec)); } long GetLogSize(char* filename) @@ -27,13 +38,11 @@ long GetLogSize(char* filename) long length = 0; FILE *fp = NULL; fp = fopen(filename, "rb"); - if (fp != NULL) - { + if (fp != NULL) { fseek(fp, 0, SEEK_END); length = ftell(fp); } - if (fp != NULL) - { + if (fp != NULL) { fclose(fp); fp = NULL; } @@ -45,28 +54,29 @@ void LogLoop(char* filename) char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; int exist; exist = access(loopPath, 0); - if (exist == 0) - { + if (exist == 0) { unlink(loopPath); } rename(filename, loopPath); -} +} void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSize) { - if (filename != NULL && buffer != NULL) - { + if (filename != NULL && buffer != NULL) { long length = GetLogSize(filename); - if (length > maxSize) - { - LogLoop(filename); + if (length > maxSize) { + LogLoop(filename); } FILE *fp; fp = fopen(filename, "a+"); - if (fp != NULL) - { + if (fp != NULL) { + int ret; char now[TEMP_BUFFER] = {0}; - GetCurrentLocalTime(now, sizeof(now)/sizeof(now[0])); + ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); + if (ret < 0) { + fclose(fp); + return; + } fwrite(now, strlen(now), 1, fp); fwrite(buffer, bufferSize, 1, fp); fclose(fp); @@ -75,21 +85,45 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz } } -void Logger(const char *msg, int level, int length) { - enum LEVEL { Info=0, Warn, Error, Debug}; - enum LEVEL _level; +void Logger(const char *msg, int level, int length) +{ + if (msg == NULL) { + return; + } + int iret; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; - _level = level; - char* buffer = malloc(length+20); - switch (_level) - { - case Debug:sprintf(buffer, "[Debug]%s\n", msg); + int destMax = length + LEVEL_LENGTH; + if (destMax <= 0) { + return; + } + char* buffer = malloc(destMax); + if (buffer == NULL) { + return; + } + switch (level) { + case LEVEL_DEBUG: + iret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); + if (iret < 0) { + return; + } break; - case Error:sprintf(buffer, "[Error]%s\n", msg); + case LEVEL_ERROR: + iret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); + if (iret < 0) { + return; + } break; - case Warn:sprintf(buffer, "[Warn]%s\n", msg); + case LEVEL_WARN: + iret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); + if (iret < 0) { + return; + } break; - default:sprintf(buffer, "[Info]%s\n", msg); + default: + iret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); + if (iret < 0) { + return; + } } WriteLogFile(logPath, FILE_MAX_SIZE, buffer, strlen(buffer)); free(buffer); diff --git a/cli/src/main.c b/cli/src/main.c index bc9bf21..b86add5 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -50,7 +50,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { char msg[] = "failed to get devices from cmd args."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return false; } @@ -85,7 +85,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { char msg[] = "failed to get rootfs path from cmd args"; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return false; } @@ -97,7 +97,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { char msg[] = "failed to get options string from cmd args"; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return false; } @@ -183,7 +183,8 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { int iLength = 0; - char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", &iLength, indicator, value); + char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", + &iLength, indicator, value); Logger(str, LEVEL_ERROR, iLength); free(str); return -1; @@ -207,7 +208,8 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device while (token != NULL) { if (idx >= *idListSize) { int iLength = 0; - char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", &iLength, idx, *idListSize); + char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", + &iLength, idx, *idListSize); Logger(str, LEVEL_ERROR, iLength); free(str); return -1; @@ -239,14 +241,14 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { char msg[] = "failed to copy rootfs path to parsed config."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { char msg[] = "failed to parse device ids from cmdline argument"; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -262,7 +264,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { char msg[] = "failed to get cgroup path."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -270,7 +272,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { char msg[] = "failed to get self ns path."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -299,7 +301,7 @@ int SetupContainer(struct CmdArgs *args) ret = DoPrepare(args, &config); if (ret < 0) { char msg[] = "failed to prepare nesessary config."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -317,7 +319,7 @@ int SetupContainer(struct CmdArgs *args) ret = DoMounting(&config); if (ret < 0) { char msg[] = "failed to do mounting."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); close(config.originNsFd); return -1; } @@ -325,7 +327,7 @@ int SetupContainer(struct CmdArgs *args) ret = SetupCgroup(&config); if (ret < 0) { char msg[] = "failed to set up cgroup."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); close(config.originNsFd); return -1; } @@ -334,7 +336,7 @@ int SetupContainer(struct CmdArgs *args) ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { char msg[] = "failed to set ns back."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); close(config.originNsFd); return -1; } @@ -351,34 +353,34 @@ int Process(int argc, char **argv) struct CmdArgs args = {0}; char startMsg[] = "runc start prestart-hook ..."; - Logger(startMsg, LEVEL_INFO, sizeof(startMsg)/sizeof(char)); + Logger(startMsg, LEVEL_INFO, sizeof(startMsg) / sizeof(char)); while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { char msg[] = "failed to parse cmd args."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } } char parametersMsg[] = "verify parameters valid and parse runtime options"; - Logger(parametersMsg, LEVEL_INFO, sizeof(parametersMsg)/sizeof(char)); + Logger(parametersMsg, LEVEL_INFO, sizeof(parametersMsg) / sizeof(char)); if (!IsCmdArgsValid(&args)) { char msg[] = "information not completed or valid."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } ParseRuntimeOptions(args.options); char containerMsg[] = "setup container config"; - Logger(containerMsg, LEVEL_INFO, sizeof(containerMsg)/sizeof(char)); + Logger(containerMsg, LEVEL_INFO, sizeof(containerMsg) / sizeof(char)); ret = SetupContainer(&args); if (ret < 0) { char msg[] = "failed to setup container."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return ret; } char successMsg[] = "prestart-hook setup container successful."; - Logger(successMsg, LEVEL_INFO, sizeof(successMsg)/sizeof(char)); + Logger(successMsg, LEVEL_INFO, sizeof(successMsg) / sizeof(char)); return 0; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 8fe92ae..d632832 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -25,14 +25,14 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { char msg[] = "failed to mount."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { char msg[] = "failed to re-mount."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -97,63 +97,51 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { int ret; + int iLength = 0; + char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to get device mount src and(or) dst path, device name: %s.", &iLength, srcDeviceName); + str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", &iLength, srcDeviceName); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } - struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to stat src: %s.", &iLength, src); + str = FormatLogMessage("failed to stat src: %s.", &iLength, src); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } - errno = 0; struct stat dstStat; ret = stat((const char *)dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - int iLength = 0; - char* str = FormatLogMessage("%s already exists but not a char device as expected.", &iLength, dst); + str = FormatLogMessage("%s already exists but not a char device as expected.", &iLength, dst); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } else if (ret < 0 && errno != ENOENT) { - int iLength = 0; - char* str = FormatLogMessage("failed to check dst %s stat", &iLength, dst); + str = FormatLogMessage("failed to check dst %s stat", &iLength, dst); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); + str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); Logger(str, LEVEL_ERROR, iLength); - free(str); return -1; } - ret = Mount(src, dst); if (ret < 0) { char msg[] = "failed to mount dev."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } - + free(str); return 0; } @@ -217,7 +205,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = Mount(filepath, dst); if (ret < 0) { char msg[] = "failed to mount dev."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -302,7 +290,8 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { int iLength = 0; - char* str = FormatLogMessage("failed to do directory mounting for %s.", &iLength, (const char *)&list->list[i][0]); + char* str = FormatLogMessage("failed to do directory mounting for %s.", &iLength, + (const char *)&list->list[i][0]); Logger(str, LEVEL_ERROR, iLength); free(str); return -1; @@ -320,7 +309,8 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { int iLength = 0; - char* str = FormatLogMessage("failed to do file mounting for %s.", &iLength, (const char *)&list->list[i][0]); + char* str = FormatLogMessage("failed to do file mounting for %s.", &iLength, + (const char *)&list->list[i][0]); Logger(str, LEVEL_ERROR, iLength); free(str); return -1; @@ -338,14 +328,14 @@ int DoMounting(const struct ParsedConfig *config) config->devices, config->devicesNr); if (ret < 0) { char msg[] = "failed to mount devices."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { char msg[] = "failed to mount ctrl devices."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } @@ -356,14 +346,14 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { char msg[] = "failed to mount files."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { char msg[] = "failed to do mount directories."; - Logger(msg, LEVEL_ERROR, sizeof(msg)/sizeof(char)); + Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index f80d525..3c3dd0f 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -15,23 +15,27 @@ #include "securec.h" #include "logger.h" -char *FormatLogMessage(char *format, int* iLength, ...){ +char *FormatLogMessage(char *format, int* iLength, ...) +{ va_list list; // 获取格式化后字符串的长度 - va_start(list, format); + va_start(list, iLength); char buff[1024] = {0}; int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff), format, list); va_end(list); - if(size <= 0){ + if (size <= 0) { return NULL; } size++; // 复位va_list, 将格式化字符串写入到buf - va_start(list, format); + va_start(list, iLength); char *buf = (char *)malloc(size); *iLength = size; - vsnprintf_s(buf, size, size, format, list); + int ret = vsnprintf_s(buf, size, size, format, list); va_end(list); + if (ret <= 0) { + return NULL; + } return buf; } -- Gitee From eec42515d85ee14696e0c85c7671b6bfcfe5b82c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 7 Jul 2021 15:40:59 +0800 Subject: [PATCH 147/296] Match-id-5128b44decd630bd285612cfb1aba44e8e75ed36 --- cli/src/logger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 78516c4..c83c433 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -7,6 +7,7 @@ #include #include #include +#include "securec.h" #include "basic.h" #define FILE_MAX_SIZE (1024 * 1024 * 10) @@ -16,7 +17,7 @@ #define MONTH_OFFSET 1 #define LEVEL_LENGTH 20 -int GetCurrentLocalTime(const char* buffer, int length) +int GetCurrentLocalTime(char* buffer, int length) { time_t rawtime; struct tm* timeinfo = NULL; -- Gitee From 1ff5a5f6f4fa46c6b878c4c37ae127ceb6bd91e9 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Jul 2021 11:33:14 +0800 Subject: [PATCH 148/296] Match-id-3fc3884a61d46bf22bd7083038de1f333f68d7d8 --- cli/src/cgrp.c | 75 +++++++++++---------------- cli/src/logger.c | 6 +-- cli/src/logger.h | 2 +- cli/src/main.c | 128 ++++++++++++++++++---------------------------- cli/src/ns.c | 15 +++--- cli/src/u_mount.c | 112 ++++++++++++++++------------------------ cli/src/utils.c | 22 ++++---- cli/src/utils.h | 2 +- 8 files changed, 143 insertions(+), 219 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 0a520cc..68d1cce 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -73,17 +73,15 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - int iLength = 0; - char* str = FormatLogMessage("cannot canonicalize path %s.", &iLength, filepath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("cannot canonicalize path %s.", filepath); + Logger(str, LEVEL_ERROR); free(str); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - char msg[] = "cannot open file."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("cannot open file.", LEVEL_ERROR); return -1; } @@ -161,18 +159,16 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to assemble dev path for %s.", &iLength, devName); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to assemble dev path for %s.", devName); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = stat((const char *)devPath, &devStat); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to get stat of %s.", &iLength, devPath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to get stat of %s.", devPath); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -180,8 +176,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - char msg[] = "write devices failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("write devices failed.", LEVEL_ERROR); return -1; } @@ -194,27 +189,24 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, DAVINCI_MANAGER); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, DEVMM_SVM); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to setup cgroup for %s.", DEVMM_SVM); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, HISI_HDC); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to setup cgroup for %s.", HISI_HDC); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -230,17 +222,15 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("assemble mount info path failed: ppid(%d).", &iLength, getppid()); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("assemble mount info path failed: ppid(%d).", getppid()); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - char msg[] = "cat file content failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("cat file content failed.", LEVEL_ERROR); return -1; } @@ -248,17 +238,15 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) char cgroupPath[BUF_SIZE] = {0x0}; ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("assemble cgroup path failed: pid(%d).", &iLength, pid); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("assemble cgroup path failed: pid(%d).", pid); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - char msg[] = "cat file content failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("cat file content failed.", LEVEL_ERROR); return -1; } @@ -267,8 +255,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - char msg[] = "assemble cgroup device path failed."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("assemble cgroup device path failed.", LEVEL_ERROR); return -1; } @@ -278,30 +265,28 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { int ret; - int iLength = 0; char *str = NULL; char deviceName[BUF_SIZE] = {0}; char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - str = FormatLogMessage("cannot canonicalize cgroup path: %s.", &iLength, config->cgroupPath); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("cannot canonicalize cgroup path: %s.", config->cgroupPath); + Logger(str, LEVEL_ERROR); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - str = FormatLogMessage("failed to open cgroup file: %s.", &iLength, resolvedCgroupPath); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to open cgroup file: %s.", resolvedCgroupPath); + Logger(str, LEVEL_ERROR); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - char msg[] = "failed to setup driver cgroup."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to setup driver cgroup.", LEVEL_ERROR); return -1; } @@ -311,15 +296,15 @@ int SetupCgroup(const struct ParsedConfig *config) config->devices[idx]); if (ret < 0) { fclose(cgroupAllow); - str = FormatLogMessage("failed to assemble device path for no.%u.", &iLength, config->devices[idx]); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to assemble device path for no.%u.", config->devices[idx]); + Logger(str, LEVEL_ERROR); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - str = FormatLogMessage("failed to setup cgroup for %s.", &iLength, deviceName); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to setup cgroup for %s.", deviceName); + Logger(str, LEVEL_ERROR); return -1; } } diff --git a/cli/src/logger.c b/cli/src/logger.c index c83c433..dd71373 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -15,7 +15,7 @@ #define TEMP_BUFFER 30 #define YEAR_OFFSET 1900 #define MONTH_OFFSET 1 -#define LEVEL_LENGTH 20 +#define LOG_LENGTH 1024 int GetCurrentLocalTime(char* buffer, int length) { @@ -86,14 +86,14 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz } } -void Logger(const char *msg, int level, int length) +void Logger(const char *msg, int level) { if (msg == NULL) { return; } int iret; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; - int destMax = length + LEVEL_LENGTH; + int destMax = LOG_LENGTH; if (destMax <= 0) { return; } diff --git a/cli/src/logger.h b/cli/src/logger.h index efad6b0..02636f1 100644 --- a/cli/src/logger.h +++ b/cli/src/logger.h @@ -6,6 +6,6 @@ #ifndef _LOGGER_H #define _LOGGER_H -void Logger(const char *msg, int level, int length); +void Logger(const char *msg, int level); #endif diff --git a/cli/src/main.c b/cli/src/main.c index b86add5..18c569a 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -49,8 +49,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { - char msg[] = "failed to get devices from cmd args."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to get devices from cmd args.", LEVEL_ERROR); return false; } @@ -62,17 +61,15 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to convert pid string from cmd args, pid string: %s.", &iLength, arg); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to convert pid string from cmd args, pid string: %s.", arg); + Logger(str, LEVEL_ERROR); free(str); return false; } if (args->pid <= 0) { - int iLength = 0; - char* str = FormatLogMessage("invalid pid %d.", &iLength, args->pid); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("invalid pid %d.", args->pid); + Logger(str, LEVEL_ERROR); free(str); return false; } @@ -84,8 +81,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { - char msg[] = "failed to get rootfs path from cmd args"; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to get rootfs path from cmd args", LEVEL_ERROR); return false; } @@ -96,8 +92,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { - char msg[] = "failed to get options string from cmd args"; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to get options string from cmd args", LEVEL_ERROR); return false; } @@ -107,9 +102,8 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->files.count == MAX_MOUNT_NR) { - int iLength = 0; - char* str = FormatLogMessage("too many files to mount, max number is %u", &iLength, MAX_MOUNT_NR); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -117,9 +111,8 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) char *dst = &args->files.list[args->files.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - int iLength = 0; - char* str = FormatLogMessage("failed to copy mount file path: %s", &iLength, arg); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to copy mount file path: %s", arg); + Logger(str, LEVEL_ERROR); free(str); return false; } @@ -130,9 +123,8 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->dirs.count == MAX_MOUNT_NR) { - int iLength = 0; - char* str = FormatLogMessage("too many directories to mount, max number is %u", &iLength, MAX_MOUNT_NR); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -140,9 +132,8 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) char *dst = &args->dirs.list[args->dirs.count++][0]; errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { - int iLength = 0; - char* str = FormatLogMessage("error: failed to copy mount directory path: %s", &iLength, arg); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("error: failed to copy mount directory path: %s", arg); + Logger(str, LEVEL_ERROR); free(str); return false; } @@ -174,18 +165,15 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu } if (i == NUM_OF_CMD_ARGS) { - int iLength = 0; - char* str = FormatLogMessage("unrecognized cmd arg: indicate char: %c, value: %s.", &iLength, indicator, value); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); + Logger(str, LEVEL_ERROR); free(str); return -1; } bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { - int iLength = 0; - char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", - &iLength, indicator, value); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -207,10 +195,8 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device token = strtok_s(devices, sep, &context); while (token != NULL) { if (idx >= *idListSize) { - int iLength = 0; - char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", - &iLength, idx, *idListSize); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", idx, *idListSize); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -218,9 +204,8 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device errno = 0; idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to convert device id (%s) from cmd args", &iLength, token); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to convert device id (%s) from cmd args", token); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -240,47 +225,41 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { - char msg[] = "failed to copy rootfs path to parsed config."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to copy rootfs path to parsed config.", LEVEL_ERROR); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { - char msg[] = "failed to parse device ids from cmdline argument"; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to parse device ids from cmdline argument", LEVEL_ERROR); return -1; } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to get container mnt ns path: pid(%d).", &iLength, args->pid); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to get container mnt ns path: pid(%d).", args->pid); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { - char msg[] = "failed to get cgroup path."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to get cgroup path.", LEVEL_ERROR); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - char msg[] = "failed to get self ns path."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to get self ns path.", LEVEL_ERROR); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to get self ns fd: %s.", &iLength, originNsPath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -298,45 +277,43 @@ int SetupContainer(struct CmdArgs *args) InitParsedConfig(&config); + Logger("prepare necessary config", LEVEL_INFO); ret = DoPrepare(args, &config); if (ret < 0) { - char msg[] = "failed to prepare nesessary config."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to prepare nesessary config.", LEVEL_ERROR); return -1; } // enter container's mount namespace + Logger("enter container's mount namespace", LEVEL_INFO); ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to set to container ns: %s.", &iLength, config.containerNsPath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to set to container ns: %s.", config.containerNsPath); + Logger(str, LEVEL_ERROR); free(str); close(config.originNsFd); return -1; } - + Logger("do mounting", LEVEL_INFO); ret = DoMounting(&config); if (ret < 0) { - char msg[] = "failed to do mounting."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to do mounting.", LEVEL_ERROR); close(config.originNsFd); return -1; } - + Logger("setup up cgroup", LEVEL_INFO); ret = SetupCgroup(&config); if (ret < 0) { - char msg[] = "failed to set up cgroup."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to set up cgroup.", LEVEL_ERROR); close(config.originNsFd); return -1; } // back to original namespace + Logger("back to original namespace", LEVEL_INFO); ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - char msg[] = "failed to set ns back."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to set ns back.", LEVEL_ERROR); close(config.originNsFd); return -1; } @@ -352,35 +329,28 @@ int Process(int argc, char **argv) int optionIndex; struct CmdArgs args = {0}; - char startMsg[] = "runc start prestart-hook ..."; - Logger(startMsg, LEVEL_INFO, sizeof(startMsg) / sizeof(char)); + Logger("runc start prestart-hook ...", LEVEL_INFO); while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { - char msg[] = "failed to parse cmd args."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to parse cmd args.", LEVEL_ERROR); return -1; } } - char parametersMsg[] = "verify parameters valid and parse runtime options"; - Logger(parametersMsg, LEVEL_INFO, sizeof(parametersMsg) / sizeof(char)); + Logger("verify parameters valid and parse runtime options", LEVEL_INFO); if (!IsCmdArgsValid(&args)) { - char msg[] = "information not completed or valid."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("information not completed or valid.", LEVEL_ERROR); return -1; } ParseRuntimeOptions(args.options); - char containerMsg[] = "setup container config"; - Logger(containerMsg, LEVEL_INFO, sizeof(containerMsg) / sizeof(char)); + Logger("setup container config ...", LEVEL_INFO); ret = SetupContainer(&args); if (ret < 0) { - char msg[] = "failed to setup container."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to setup container.", LEVEL_ERROR); return ret; } - char successMsg[] = "prestart-hook setup container successful."; - Logger(successMsg, LEVEL_INFO, sizeof(successMsg) / sizeof(char)); + Logger("prestart-hook setup container successful.", LEVEL_INFO); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index a7e7d11..aba7d8e 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -29,9 +29,8 @@ int EnterNsByFd(int fd, int nsType) { int ret = setns(fd, nsType); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to set ns: fd(%d).", &iLength, fd); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to set ns: fd(%d).", fd); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -46,18 +45,16 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to open ns path: %s.", &iLength, path); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to open ns path: %s.", path); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to set ns: %s.", &iLength, path); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to set ns: %s.", path); + Logger(str, LEVEL_ERROR); free(str); close(fd); return -1; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index d632832..a793625 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -24,15 +24,13 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - char msg[] = "failed to mount."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount.", LEVEL_ERROR); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - char msg[] = "failed to re-mount."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to re-mount.", LEVEL_ERROR); return -1; } @@ -68,9 +66,8 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - int iLength = 0; - char* str = FormatLogMessage("cannot canonicalize device dst: %s.", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("cannot canonicalize device dst: %s.", dst); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -83,9 +80,8 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - int iLength = 0; - char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", &iLength, resolvedDst); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -97,22 +93,21 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { int ret; - int iLength = 0; char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", &iLength, srcDeviceName); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); + Logger(str, LEVEL_ERROR); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - str = FormatLogMessage("failed to stat src: %s.", &iLength, src); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to stat src: %s.", src); + Logger(str, LEVEL_ERROR); return -1; } errno = 0; @@ -121,24 +116,23 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - str = FormatLogMessage("%s already exists but not a char device as expected.", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("%s already exists but not a char device as expected.", dst); + Logger(str, LEVEL_ERROR); return -1; } else if (ret < 0 && errno != ENOENT) { - str = FormatLogMessage("failed to check dst %s stat", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to check dst %s stat", dst); + Logger(str, LEVEL_ERROR); return -1; } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + str = FormatLogMessage("failed to create mount dst file: %s.", dst); + Logger(str, LEVEL_ERROR); return -1; } ret = Mount(src, dst); if (ret < 0) { - char msg[] = "failed to mount dev."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount dev.", LEVEL_ERROR); return -1; } free(str); @@ -154,17 +148,15 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int srcRet = sprintf_s(srcDeviceName, BUF_SIZE, "%s%u", device_name, ids[idx]); int dstRet = sprintf_s(dstDeviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (srcRet < 0 || dstRet < 0) { - int iLength = 0; - char* str = FormatLogMessage("assemble device name failed, id: %u.", &iLength, ids[idx]); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("assemble device name failed, id: %u.", ids[idx]); + Logger(str, LEVEL_ERROR); free(str); return -1; } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to mount device %s.", &iLength, srcDeviceName); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to mount device %s.", srcDeviceName); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -180,9 +172,8 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", &iLength, filepath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", filepath); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -195,17 +186,15 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to create mount dst file: %s.", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to create mount dst file: %s.", dst); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = Mount(filepath, dst); if (ret < 0) { - char msg[] = "failed to mount dev."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount dev.", LEVEL_ERROR); return -1; } @@ -230,18 +219,16 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to make dir: %s.", &iLength, dst); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to make dir: %s.", dst); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = Mount(src, dst); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to mount dir: %s to %s.", &iLength, src, dst); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to mount dir: %s to %s.", src, dst); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -254,27 +241,24 @@ int DoCtrlDeviceMounting(const char *rootfs) /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to mount device %s.", &iLength, DAVINCI_MANAGER); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to mount device %s.", &iLength, DEVMM_SVM); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to mount device %s.", DEVMM_SVM); + Logger(str, LEVEL_ERROR); free(str); return -1; } ret = MountDevice(rootfs, HISI_HDC, NULL); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to mount device %s.", &iLength, HISI_HDC); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to mount device %s.", HISI_HDC); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -289,10 +273,8 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to do directory mounting for %s.", &iLength, - (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -308,10 +290,8 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to do file mounting for %s.", &iLength, - (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to do file mounting for %s.", (const char *)&list->list[i][0]); + Logger(str, LEVEL_ERROR); free(str); return -1; } @@ -327,15 +307,13 @@ int DoMounting(const struct ParsedConfig *config) (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), config->devices, config->devicesNr); if (ret < 0) { - char msg[] = "failed to mount devices."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount devices.", LEVEL_ERROR); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - char msg[] = "failed to mount ctrl devices."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount ctrl devices.", LEVEL_ERROR); return -1; } @@ -345,15 +323,13 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { - char msg[] = "failed to mount files."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to mount files.", LEVEL_ERROR); return -1; } ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { - char msg[] = "failed to do mount directories."; - Logger(msg, LEVEL_ERROR, sizeof(msg) / sizeof(char)); + Logger("failed to do mount directories.", LEVEL_ERROR); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index 3c3dd0f..dee4d01 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -15,11 +15,11 @@ #include "securec.h" #include "logger.h" -char *FormatLogMessage(char *format, int* iLength, ...) +char *FormatLogMessage(char *format, ...) { va_list list; // 获取格式化后字符串的长度 - va_start(list, iLength); + va_start(list, format); char buff[1024] = {0}; int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff), format, list); va_end(list); @@ -28,9 +28,8 @@ char *FormatLogMessage(char *format, int* iLength, ...) } size++; // 复位va_list, 将格式化字符串写入到buf - va_start(list, iLength); + va_start(list, format); char *buf = (char *)malloc(size); - *iLength = size; int ret = vsnprintf_s(buf, size, size, format, list); va_end(list); if (ret <= 0) { @@ -124,27 +123,24 @@ int MakeMountPoints(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { - int iLength = 0; - char* str = FormatLogMessage("failed to make parent dir for file: %s", &iLength, path); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to make parent dir for file: %s", path); + Logger(str, LEVEL_ERROR); free(str); return -1; } char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - int iLength = 0; - char* str = FormatLogMessage("failed to resolve path %s.", &iLength, path); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("failed to resolve path %s.", path); + Logger(str, LEVEL_ERROR); free(str); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - int iLength = 0; - char* str = FormatLogMessage("cannot create file: %s.", &iLength, resolvedPath); - Logger(str, LEVEL_ERROR, iLength); + char* str = FormatLogMessage("cannot create file: %s.", resolvedPath); + Logger(str, LEVEL_ERROR); free(str); return -1; } diff --git a/cli/src/utils.h b/cli/src/utils.h index 9350b44..e6f9412 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -9,7 +9,7 @@ #include #include "basic.h" -char *FormatLogMessage(char *format, int* iLength, ...); +char *FormatLogMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); int MkDir(const char *dir, int mode); -- Gitee From 98aa21fef965075f887c6adecbb4dbe8ebe1d22c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Jul 2021 11:41:07 +0800 Subject: [PATCH 149/296] Match-id-bf669790dbad3a219dfd4c4011ba8916f2ba81b9 --- cli/src/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index dd71373..b5a647f 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -17,7 +17,7 @@ #define MONTH_OFFSET 1 #define LOG_LENGTH 1024 -int GetCurrentLocalTime(char* buffer, int length) +int GetCurrentLocalTime(char* buffer) { time_t rawtime; struct tm* timeinfo = NULL; @@ -73,7 +73,7 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz if (fp != NULL) { int ret; char now[TEMP_BUFFER] = {0}; - ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); + ret = GetCurrentLocalTime(now); if (ret < 0) { fclose(fp); return; -- Gitee From 6d0972b476114dd085f78fd8013f6723b3de85f0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Jul 2021 11:44:57 +0800 Subject: [PATCH 150/296] Match-id-78cca812284e61b9913a7f49325ee5b6cbe3b4fa --- cli/src/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index b5a647f..dd71373 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -17,7 +17,7 @@ #define MONTH_OFFSET 1 #define LOG_LENGTH 1024 -int GetCurrentLocalTime(char* buffer) +int GetCurrentLocalTime(char* buffer, int length) { time_t rawtime; struct tm* timeinfo = NULL; @@ -73,7 +73,7 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz if (fp != NULL) { int ret; char now[TEMP_BUFFER] = {0}; - ret = GetCurrentLocalTime(now); + ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); if (ret < 0) { fclose(fp); return; -- Gitee From 4e2e860ec76bcca3dfdf1a0360021659c1f70884 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 8 Jul 2021 18:37:25 +0800 Subject: [PATCH 151/296] Match-id-75d1e12608a43e6344c55ea37665b9f5ed6efbc0 --- cli/src/logger.c | 16 ++++------------ cli/src/u_mount.c | 8 ++++++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index dd71373..a7eb235 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -104,27 +104,19 @@ void Logger(const char *msg, int level) switch (level) { case LEVEL_DEBUG: iret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); - if (iret < 0) { - return; - } break; case LEVEL_ERROR: iret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); - if (iret < 0) { - return; - } break; case LEVEL_WARN: iret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); - if (iret < 0) { - return; - } break; default: iret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); - if (iret < 0) { - return; - } + } + if (iret < 0) { + free(buffer); + return; } WriteLogFile(logPath, FILE_MAX_SIZE, buffer, strlen(buffer)); free(buffer); diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index a793625..528ce4e 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -24,13 +24,17 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - Logger("failed to mount.", LEVEL_ERROR); + char* str = FormatLogMessage("failed to mount src:%s.", src); + Logger(str, LEVEL_ERROR); + free(str); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - Logger("failed to re-mount.", LEVEL_ERROR); + char* str = FormatLogMessage("failed to re-mount. dst:%s.", dst); + Logger(str, LEVEL_ERROR); + free(str); return -1; } -- Gitee From 9f929cd3ebae614b5012872e550ca95ea25e6cc0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Jul 2021 08:51:22 +0800 Subject: [PATCH 152/296] Match-id-920f39d8c82c33133c30a658abf4b339fe6da086 --- cli/src/basic.h | 4 ++-- cli/src/logger.c | 2 +- cli/src/logger.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 65e4181..9573d36 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -21,8 +21,8 @@ #define LEVEL_INFO 0 #define LEVEL_WARN 1 -#define LEVEL_ERROR 2 -#define LEVEL_DEBUG 3 +#define LEVEL_ERROR 2 +#define LEVEL_DEBUG 3 #define LOG_ERROR(fmt, ...) \ diff --git a/cli/src/logger.c b/cli/src/logger.c index a7eb235..4ba4cd6 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -1,5 +1,5 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. * Description: ascend-docker-cli日志模块 */ #include diff --git a/cli/src/logger.h b/cli/src/logger.h index 02636f1..e1dcadd 100644 --- a/cli/src/logger.h +++ b/cli/src/logger.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. * Description: ascend-docker-cli工具容器logger日志模块头文件 */ -- Gitee From ed39ae1bc8808f6b0529f6457afa17223b4305d2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Jul 2021 11:19:18 +0800 Subject: [PATCH 153/296] Match-id-05d88e422f8f8e5479ea7964189f46075062ce1e --- cli/src/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 4ba4cd6..32b0388 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -36,14 +36,14 @@ int GetCurrentLocalTime(char* buffer, int length) long GetLogSize(char* filename) { - long length = 0; FILE *fp = NULL; fp = fopen(filename, "rb"); + long length = 0; if (fp != NULL) { fseek(fp, 0, SEEK_END); length = ftell(fp); } - if (fp != NULL) { + if (NULL != fp) { fclose(fp); fp = NULL; } -- Gitee From bc45b644691eb4c60369357fea9493da5c6d30fe Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 10:40:41 +0800 Subject: [PATCH 154/296] Match-id-96556915147637860db042d07e874ab9d2ea0b4f --- cli/src/basic.h | 4 ++- cli/src/cgrp.c | 40 ++++++++++++++------------ cli/src/logger.c | 68 ++++++++++++++++++++++++++++++++++++++------ cli/src/logger.h | 2 +- cli/src/main.c | 72 +++++++++++++++++++++++------------------------ cli/src/ns.c | 6 ++-- cli/src/u_mount.c | 57 +++++++++++++++++++------------------ cli/src/utils.c | 10 +++++-- 8 files changed, 161 insertions(+), 98 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 9573d36..1511955 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -15,6 +15,7 @@ #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" #define DEFAULT_DIR_MODE 0755 +#define DEFAULT_LOG_MODE 0666 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 @@ -23,7 +24,8 @@ #define LEVEL_WARN 1 #define LEVEL_ERROR 2 #define LEVEL_DEBUG 3 - +#define SCREEN_NO 0 +#define SCREEN_YES 1 #define LOG_ERROR(fmt, ...) \ do { \ diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 68d1cce..9aaef40 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -74,14 +74,14 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { char* str = FormatLogMessage("cannot canonicalize path %s.", filepath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { - Logger("cannot open file.", LEVEL_ERROR); + Logger("cannot open file.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -160,7 +160,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = sprintf_s(devPath, BUF_SIZE, "/dev/%s", devName); if (ret < 0) { char* str = FormatLogMessage("failed to assemble dev path for %s.", devName); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -168,7 +168,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = stat((const char *)devPath, &devStat); if (ret < 0) { char* str = FormatLogMessage("failed to get stat of %s.", devPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -176,7 +176,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) bool isFailed = fprintf(cgroupAllow, "c %u:%u rw", major(devStat.st_rdev), minor(devStat.st_rdev)) < 0 || fflush(cgroupAllow) == EOF || ferror(cgroupAllow) < 0; if (isFailed) { - Logger("write devices failed.", LEVEL_ERROR); + Logger("write devices failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -190,7 +190,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { char* str = FormatLogMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -198,7 +198,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { char* str = FormatLogMessage("failed to setup cgroup for %s.", DEVMM_SVM); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -206,7 +206,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) ret = SetupDeviceCgroup(cgroupAllow, HISI_HDC); if (ret < 0) { char* str = FormatLogMessage("failed to setup cgroup for %s.", HISI_HDC); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -223,14 +223,14 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(mountPath, BUF_SIZE, "/proc/%d/mountinfo", (int)getppid()); if (ret < 0) { char* str = FormatLogMessage("assemble mount info path failed: ppid(%d).", getppid()); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } ret = ParseFileByLine(mount, BUF_SIZE, GetCgroupMount, mountPath); if (ret < 0) { - Logger("cat file content failed.", LEVEL_ERROR); + Logger("cat file content failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -239,14 +239,14 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(cgroupPath, BUF_SIZE, "/proc/%d/cgroup", pid); if (ret < 0) { char* str = FormatLogMessage("assemble cgroup path failed: pid(%d).", pid); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } ret = ParseFileByLine(cgroup, BUF_SIZE, GetCgroupRoot, cgroupPath); if (ret < 0) { - Logger("cat file content failed.", LEVEL_ERROR); + Logger("cat file content failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -255,7 +255,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) ret = sprintf_s(effPath, maxSize, "%s%s%s", mount, cgroup, ALLOW_PATH); if (ret < 0) { - Logger("assemble cgroup device path failed.", LEVEL_ERROR); + Logger("assemble cgroup device path failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -272,21 +272,23 @@ int SetupCgroup(const struct ParsedConfig *config) if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { str = FormatLogMessage("cannot canonicalize cgroup path: %s.", config->cgroupPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { str = FormatLogMessage("failed to open cgroup file: %s.", resolvedCgroupPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } ret = SetupDriverCgroup(cgroupAllow); if (ret < 0) { fclose(cgroupAllow); - Logger("failed to setup driver cgroup.", LEVEL_ERROR); + Logger("failed to setup driver cgroup.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -297,14 +299,16 @@ int SetupCgroup(const struct ParsedConfig *config) if (ret < 0) { fclose(cgroupAllow); str = FormatLogMessage("failed to assemble device path for no.%u.", config->devices[idx]); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); str = FormatLogMessage("failed to setup cgroup for %s.", deviceName); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } } diff --git a/cli/src/logger.c b/cli/src/logger.c index 32b0388..a7950a8 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -5,24 +5,31 @@ #include #include #include +#include #include #include #include "securec.h" #include "basic.h" +#include "utils.h" #define FILE_MAX_SIZE (1024 * 1024 * 10) -#define LOG_PATH_DIR "/var/log/" +#define LOG_PATH_DIR "/var/log/ascend-docker-runtime/" #define TEMP_BUFFER 30 #define YEAR_OFFSET 1900 #define MONTH_OFFSET 1 #define LOG_LENGTH 1024 + + int GetCurrentLocalTime(char* buffer, int length) { time_t rawtime; struct tm* timeinfo = NULL; time(&rawtime); timeinfo = localtime(&rawtime); + if (timeinfo == NULL) { + return -1; + } return sprintf_s(buffer, TEMP_BUFFER, "[%04d-%02d-%02d %02d:%02d:%02d]", @@ -34,10 +41,29 @@ int GetCurrentLocalTime(char* buffer, int length) (timeinfo->tm_sec)); } -long GetLogSize(char* filename) +int CreateLog(const char* filename) { + int exist; + exist = access(filename, 0); + if (exist != 0) { + return creat(filename, DEFAULT_LOG_MODE); + } + return 0; +} + +long GetLogSize(const char* filename) +{ + int iret; + iret = CreateLog(filename); + if (iret < 0) { + return -1; + } FILE *fp = NULL; - fp = fopen(filename, "rb"); + char path[PATH_MAX + 1] = {0x00}; + if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { + return -1; + } + fp = fopen(path, "rb"); long length = 0; if (fp != NULL) { fseek(fp, 0, SEEK_END); @@ -50,8 +76,10 @@ long GetLogSize(char* filename) return length; } -void LogLoop(char* filename) + +int LogLoop(const char* filename) { + int iret; char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; int exist; exist = access(loopPath, 0); @@ -59,17 +87,33 @@ void LogLoop(char* filename) unlink(loopPath); } rename(filename, loopPath); + iret = CreateLog(filename); + if (iret < 0) { + return -1; + } + return iret; } -void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSize) +void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned bufferSize) { if (filename != NULL && buffer != NULL) { + char path[PATH_MAX + 1] = {0x00}; + FILE *fp; + int iret; long length = GetLogSize(filename); + if (length < 0) { + return; + } if (length > maxSize) { - LogLoop(filename); + iret = LogLoop(filename); + if (iret < 0) { + return; + } } - FILE *fp; - fp = fopen(filename, "a+"); + if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { + return; + } + fp = fopen(path, "a+"); if (fp != NULL) { int ret; char now[TEMP_BUFFER] = {0}; @@ -86,13 +130,19 @@ void WriteLogFile(char* filename, long maxSize, char* buffer, unsigned bufferSiz } } -void Logger(const char *msg, int level) +void Logger(const char *msg, int level, int screen) { if (msg == NULL) { return; } + if (screen == SCREEN_YES) { + LOG_ERROR(msg); + } int iret; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; + if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_DIR_MODE) < 0) { + return; + } int destMax = LOG_LENGTH; if (destMax <= 0) { return; diff --git a/cli/src/logger.h b/cli/src/logger.h index e1dcadd..5f94eef 100644 --- a/cli/src/logger.h +++ b/cli/src/logger.h @@ -6,6 +6,6 @@ #ifndef _LOGGER_H #define _LOGGER_H -void Logger(const char *msg, int level); +void Logger(const char *msg, int level, int screen); #endif diff --git a/cli/src/main.c b/cli/src/main.c index 18c569a..ac7c06d 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -49,7 +49,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get devices from cmd args.", LEVEL_ERROR); + Logger("failed to get devices from cmd args.", LEVEL_ERROR, SCREEN_YES); return false; } @@ -62,14 +62,14 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { char* str = FormatLogMessage("failed to convert pid string from cmd args, pid string: %s.", arg); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return false; } if (args->pid <= 0) { char* str = FormatLogMessage("invalid pid %d.", args->pid); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return false; } @@ -81,7 +81,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get rootfs path from cmd args", LEVEL_ERROR); + Logger("failed to get rootfs path from cmd args", LEVEL_ERROR, SCREEN_YES); return false; } @@ -92,7 +92,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { - Logger("failed to get options string from cmd args", LEVEL_ERROR); + Logger("failed to get options string from cmd args", LEVEL_ERROR, SCREEN_YES); return false; } @@ -103,7 +103,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->files.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -112,7 +112,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { char* str = FormatLogMessage("failed to copy mount file path: %s", arg); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return false; } @@ -124,7 +124,7 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args->dirs.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -133,7 +133,7 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) errno_t err = strcpy_s(dst, PATH_MAX, arg); if (err != EOK) { char* str = FormatLogMessage("error: failed to copy mount directory path: %s", arg); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return false; } @@ -166,14 +166,14 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu if (i == NUM_OF_CMD_ARGS) { char* str = FormatLogMessage("unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -196,7 +196,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device while (token != NULL) { if (idx >= *idListSize) { char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", idx, *idListSize); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -205,7 +205,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device idList[idx] = strtoul((const char *)token, NULL, DECIMAL); if (errno != 0) { char* str = FormatLogMessage("failed to convert device id (%s) from cmd args", token); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -225,41 +225,41 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) err = strcpy_s(config->rootfs, BUF_SIZE, args->rootfs); if (err != EOK) { - Logger("failed to copy rootfs path to parsed config.", LEVEL_ERROR); + Logger("failed to copy rootfs path to parsed config.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = ParseDeviceIDs(config->devices, &config->devicesNr, (char *)args->devices); if (ret < 0) { - Logger("failed to parse device ids from cmdline argument", LEVEL_ERROR); + Logger("failed to parse device ids from cmdline argument", LEVEL_ERROR, SCREEN_YES); return -1; } ret = GetNsPath(args->pid, "mnt", config->containerNsPath, BUF_SIZE); if (ret < 0) { char* str = FormatLogMessage("failed to get container mnt ns path: pid(%d).", args->pid); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { - Logger("failed to get cgroup path.", LEVEL_ERROR); + Logger("failed to get cgroup path.", LEVEL_ERROR, SCREEN_YES); return -1; } char originNsPath[BUF_SIZE] = {0}; ret = GetSelfNsPath("mnt", originNsPath, BUF_SIZE); if (ret < 0) { - Logger("failed to get self ns path.", LEVEL_ERROR); + Logger("failed to get self ns path.", LEVEL_ERROR, SCREEN_YES); return -1; } config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -277,43 +277,43 @@ int SetupContainer(struct CmdArgs *args) InitParsedConfig(&config); - Logger("prepare necessary config", LEVEL_INFO); + Logger("prepare necessary config", LEVEL_INFO, SCREEN_YES); ret = DoPrepare(args, &config); if (ret < 0) { - Logger("failed to prepare nesessary config.", LEVEL_ERROR); + Logger("failed to prepare nesessary config.", LEVEL_ERROR, SCREEN_YES); return -1; } // enter container's mount namespace - Logger("enter container's mount namespace", LEVEL_INFO); + Logger("enter container's mount namespace", LEVEL_INFO, SCREEN_YES); ret = EnterNsByPath((const char *)config.containerNsPath, CLONE_NEWNS); if (ret < 0) { char* str = FormatLogMessage("failed to set to container ns: %s.", config.containerNsPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); close(config.originNsFd); return -1; } - Logger("do mounting", LEVEL_INFO); + Logger("do mounting", LEVEL_INFO, SCREEN_YES); ret = DoMounting(&config); if (ret < 0) { - Logger("failed to do mounting.", LEVEL_ERROR); + Logger("failed to do mounting.", LEVEL_ERROR, SCREEN_YES); close(config.originNsFd); return -1; } - Logger("setup up cgroup", LEVEL_INFO); + Logger("setup up cgroup", LEVEL_INFO, SCREEN_YES); ret = SetupCgroup(&config); if (ret < 0) { - Logger("failed to set up cgroup.", LEVEL_ERROR); + Logger("failed to set up cgroup.", LEVEL_ERROR, SCREEN_YES); close(config.originNsFd); return -1; } // back to original namespace - Logger("back to original namespace", LEVEL_INFO); + Logger("back to original namespace", LEVEL_INFO, SCREEN_YES); ret = EnterNsByFd(config.originNsFd, CLONE_NEWNS); if (ret < 0) { - Logger("failed to set ns back.", LEVEL_ERROR); + Logger("failed to set ns back.", LEVEL_ERROR, SCREEN_YES); close(config.originNsFd); return -1; } @@ -329,28 +329,28 @@ int Process(int argc, char **argv) int optionIndex; struct CmdArgs args = {0}; - Logger("runc start prestart-hook ...", LEVEL_INFO); + Logger("runc start prestart-hook ...", LEVEL_INFO, SCREEN_YES); while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { - Logger("failed to parse cmd args.", LEVEL_ERROR); + Logger("failed to parse cmd args.", LEVEL_ERROR, SCREEN_YES); return -1; } } - Logger("verify parameters valid and parse runtime options", LEVEL_INFO); + Logger("verify parameters valid and parse runtime options", LEVEL_INFO, SCREEN_YES); if (!IsCmdArgsValid(&args)) { - Logger("information not completed or valid.", LEVEL_ERROR); + Logger("information not completed or valid.", LEVEL_ERROR, SCREEN_YES); return -1; } ParseRuntimeOptions(args.options); - Logger("setup container config ...", LEVEL_INFO); + Logger("setup container config ...", LEVEL_INFO, SCREEN_YES); ret = SetupContainer(&args); if (ret < 0) { - Logger("failed to setup container.", LEVEL_ERROR); + Logger("failed to setup container.", LEVEL_ERROR, SCREEN_YES); return ret; } - Logger("prestart-hook setup container successful.", LEVEL_INFO); + Logger("prestart-hook setup container successful.", LEVEL_INFO, SCREEN_YES); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index aba7d8e..11d92c4 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -30,7 +30,7 @@ int EnterNsByFd(int fd, int nsType) int ret = setns(fd, nsType); if (ret < 0) { char* str = FormatLogMessage("failed to set ns: fd(%d).", fd); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -46,7 +46,7 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { char* str = FormatLogMessage("failed to open ns path: %s.", path); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -54,7 +54,7 @@ int EnterNsByPath(const char *path, int nsType) ret = EnterNsByFd(fd, nsType); if (ret < 0) { char* str = FormatLogMessage("failed to set ns: %s.", path); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); close(fd); return -1; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 528ce4e..a54f08f 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -25,7 +25,7 @@ int Mount(const char *src, const char *dst) ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount src:%s.", src); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -33,7 +33,7 @@ int Mount(const char *src, const char *dst) ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to re-mount. dst:%s.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -71,7 +71,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { char* str = FormatLogMessage("cannot canonicalize device dst: %s.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -85,7 +85,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -104,14 +104,16 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { str = FormatLogMessage("failed to stat src: %s.", src); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } errno = 0; @@ -121,22 +123,23 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { str = FormatLogMessage("%s already exists but not a char device as expected.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } else if (ret < 0 && errno != ENOENT) { - str = FormatLogMessage("failed to check dst %s stat", dst); - Logger(str, LEVEL_ERROR); + Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); return -1; } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); return -1; } ret = Mount(src, dst); if (ret < 0) { - Logger("failed to mount dev.", LEVEL_ERROR); + Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } free(str); @@ -153,14 +156,14 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int dstRet = sprintf_s(dstDeviceName, BUF_SIZE, "%s%u", DEVICE_NAME, ids[idx]); if (srcRet < 0 || dstRet < 0) { char* str = FormatLogMessage("assemble device name failed, id: %u.", ids[idx]); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", srcDeviceName); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -177,7 +180,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", filepath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -191,14 +194,14 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { char* str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } ret = Mount(filepath, dst); if (ret < 0) { - Logger("failed to mount dev.", LEVEL_ERROR); + Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -224,7 +227,7 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { char* str = FormatLogMessage("failed to make dir: %s.", dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -232,7 +235,7 @@ int MountDir(const char *rootfs, const char *src) ret = Mount(src, dst); if (ret < 0) { char* str = FormatLogMessage("failed to mount dir: %s to %s.", src, dst); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -246,7 +249,7 @@ int DoCtrlDeviceMounting(const char *rootfs) int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -254,7 +257,7 @@ int DoCtrlDeviceMounting(const char *rootfs) ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", DEVMM_SVM); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -262,7 +265,7 @@ int DoCtrlDeviceMounting(const char *rootfs) ret = MountDevice(rootfs, HISI_HDC, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", HISI_HDC); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -278,7 +281,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { char* str = FormatLogMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -295,7 +298,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { char* str = FormatLogMessage("failed to do file mounting for %s.", (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -311,13 +314,13 @@ int DoMounting(const struct ParsedConfig *config) (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), config->devices, config->devicesNr); if (ret < 0) { - Logger("failed to mount devices.", LEVEL_ERROR); + Logger("failed to mount devices.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = DoCtrlDeviceMounting(config->rootfs); if (ret < 0) { - Logger("failed to mount ctrl devices.", LEVEL_ERROR); + Logger("failed to mount ctrl devices.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -327,13 +330,13 @@ int DoMounting(const struct ParsedConfig *config) ret = DoFileMounting(config->rootfs, config->files); if (ret < 0) { - Logger("failed to mount files.", LEVEL_ERROR); + Logger("failed to mount files.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = DoDirectoryMounting(config->rootfs, config->dirs); if (ret < 0) { - Logger("failed to do mount directories.", LEVEL_ERROR); + Logger("failed to do mount directories.", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index dee4d01..7e64eff 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -30,9 +30,13 @@ char *FormatLogMessage(char *format, ...) // 复位va_list, 将格式化字符串写入到buf va_start(list, format); char *buf = (char *)malloc(size); + if (buf == NULL) { + return NULL; + } int ret = vsnprintf_s(buf, size, size, format, list); va_end(list); if (ret <= 0) { + free(buf); return NULL; } return buf; @@ -124,7 +128,7 @@ int MakeMountPoints(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { char* str = FormatLogMessage("failed to make parent dir for file: %s", path); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -132,7 +136,7 @@ int MakeMountPoints(const char *path, mode_t mode) char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { char* str = FormatLogMessage("failed to resolve path %s.", path); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -140,7 +144,7 @@ int MakeMountPoints(const char *path, mode_t mode) int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { char* str = FormatLogMessage("cannot create file: %s.", resolvedPath); - Logger(str, LEVEL_ERROR); + Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } -- Gitee From d085c316c67eabbfa3203930ee994049a2914fcb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 11:23:07 +0800 Subject: [PATCH 155/296] Match-id-bb9db4b9b0054bac3a7e154a26897378d47a7cfb --- cli/src/logger.c | 4 +--- cli/src/utils.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index a7950a8..3c44fc9 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -19,8 +19,6 @@ #define MONTH_OFFSET 1 #define LOG_LENGTH 1024 - - int GetCurrentLocalTime(char* buffer, int length) { time_t rawtime; @@ -98,7 +96,7 @@ void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned buf { if (filename != NULL && buffer != NULL) { char path[PATH_MAX + 1] = {0x00}; - FILE *fp; + FILE *fp = NULL; int iret; long length = GetLogSize(filename); if (length < 0) { diff --git a/cli/src/utils.c b/cli/src/utils.c index 7e64eff..529c7be 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -21,7 +21,7 @@ char *FormatLogMessage(char *format, ...) // 获取格式化后字符串的长度 va_start(list, format); char buff[1024] = {0}; - int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff), format, list); + int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff) - 1, format, list); va_end(list); if (size <= 0) { return NULL; @@ -33,7 +33,7 @@ char *FormatLogMessage(char *format, ...) if (buf == NULL) { return NULL; } - int ret = vsnprintf_s(buf, size, size, format, list); + int ret = vsnprintf_s(buf, size, size - 1, format, list); va_end(list); if (ret <= 0) { free(buf); -- Gitee From b4ad57b92d0dd6f9dd641f857d2d17cc1f9a7819 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 15:55:33 +0800 Subject: [PATCH 156/296] Match-id-025ba4dbad0235c9a9b23a17c3360db257ed5780 --- cli/src/basic.h | 3 ++- cli/src/logger.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 1511955..0721c2f 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -15,7 +15,8 @@ #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" #define DEFAULT_DIR_MODE 0755 -#define DEFAULT_LOG_MODE 0666 +#define DEFAULT_LOG_MODE 0640 +#define DEFAULT_LOGDIR_MODE 0750 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 diff --git a/cli/src/logger.c b/cli/src/logger.c index 3c44fc9..8e57d30 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -138,7 +138,7 @@ void Logger(const char *msg, int level, int screen) } int iret; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; - if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_DIR_MODE) < 0) { + if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_LOGDIR_MODE) < 0) { return; } int destMax = LOG_LENGTH; -- Gitee From f540349978b3fd8ffab4940c26bfa7adbd2d9cdd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 16:31:56 +0800 Subject: [PATCH 157/296] Match-id-c24337903796e249c5347895091c6ee05fceafd4 --- cli/src/logger.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 8e57d30..3f50782 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -51,9 +51,9 @@ int CreateLog(const char* filename) long GetLogSize(const char* filename) { - int iret; - iret = CreateLog(filename); - if (iret < 0) { + int ret; + ret = CreateLog(filename); + if (ret < 0) { return -1; } FILE *fp = NULL; @@ -77,7 +77,7 @@ long GetLogSize(const char* filename) int LogLoop(const char* filename) { - int iret; + int ret; char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; int exist; exist = access(loopPath, 0); @@ -85,11 +85,11 @@ int LogLoop(const char* filename) unlink(loopPath); } rename(filename, loopPath); - iret = CreateLog(filename); - if (iret < 0) { + ret = CreateLog(filename); + if (ret < 0) { return -1; } - return iret; + return ret; } void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned bufferSize) @@ -97,14 +97,14 @@ void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned buf if (filename != NULL && buffer != NULL) { char path[PATH_MAX + 1] = {0x00}; FILE *fp = NULL; - int iret; + int ret; long length = GetLogSize(filename); if (length < 0) { return; } if (length > maxSize) { - iret = LogLoop(filename); - if (iret < 0) { + ret = LogLoop(filename); + if (ret < 0) { return; } } @@ -113,7 +113,6 @@ void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned buf } fp = fopen(path, "a+"); if (fp != NULL) { - int ret; char now[TEMP_BUFFER] = {0}; ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); if (ret < 0) { @@ -136,7 +135,7 @@ void Logger(const char *msg, int level, int screen) if (screen == SCREEN_YES) { LOG_ERROR(msg); } - int iret; + int ret; char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_LOGDIR_MODE) < 0) { return; @@ -151,18 +150,18 @@ void Logger(const char *msg, int level, int screen) } switch (level) { case LEVEL_DEBUG: - iret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); break; case LEVEL_ERROR: - iret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); break; case LEVEL_WARN: - iret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); break; default: - iret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); } - if (iret < 0) { + if (ret < 0) { free(buffer); return; } -- Gitee From 0e29976c6b8ae221270bd19643b950435134dc5e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 18:49:30 +0800 Subject: [PATCH 158/296] Match-id-6a9a6103f062803c3a47d990fea8062c9ed91241 --- cli/src/logger.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 3f50782..909bf8f 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -43,8 +43,13 @@ int CreateLog(const char* filename) { int exist; exist = access(filename, 0); + int fd; if (exist != 0) { - return creat(filename, DEFAULT_LOG_MODE); + fd = creat(filename, DEFAULT_LOG_MODE); + if (fd < 0) { + return -1; + } + close(fd); } return 0; } @@ -92,7 +97,7 @@ int LogLoop(const char* filename) return ret; } -void WriteLogFile(char* filename, long maxSize, const char* buffer, unsigned bufferSize) +void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) { if (filename != NULL && buffer != NULL) { char path[PATH_MAX + 1] = {0x00}; -- Gitee From 5bf5b67f7d6b53411478c3147154993155ad6661 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Jul 2021 19:00:58 +0800 Subject: [PATCH 159/296] Match-id-4e44d987b8a0d713e79a96789544d2dcc3dfb736 --- cli/src/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 909bf8f..524ab7b 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -43,7 +43,7 @@ int CreateLog(const char* filename) { int exist; exist = access(filename, 0); - int fd; + int fd = 0; if (exist != 0) { fd = creat(filename, DEFAULT_LOG_MODE); if (fd < 0) { -- Gitee From 29376bdeb6e4072be8f495e7ac9aea62afbb60f6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Sep 2021 17:05:17 +0800 Subject: [PATCH 160/296] Match-id-b7bb048ac60844abb222c75bf2545604d9cd4353 --- hook/main_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hook/main_test.go b/hook/main_test.go index 6cd40e1..7a26252 100644 --- a/hook/main_test.go +++ b/hook/main_test.go @@ -96,9 +96,9 @@ func TestDoPrestartHookCase5(t *testing.T) { func TestGetValueByKeyCase1(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} - kWord := "ASCEND_VISIBLE_DEVICES" + word := "ASCEND_VISIBLE_DEVICES" expectVal := "0-3,5,7" - actualVal := getValueByKey(data, kWord) + actualVal := getValueByKey(data, word) if actualVal != expectVal { t.Fail() } @@ -106,14 +106,14 @@ func TestGetValueByKeyCase1(t *testing.T) { func TestGetValueByKeyCase2(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES"} - kWord := "ASCEND_VISIBLE_DEVICES" + word := "ASCEND_VISIBLE_DEVICES" expectVal := "" defer func() { if err := recover(); err != nil { t.Log("exception occur") } }() - actualVal := getValueByKey(data, kWord) + actualVal := getValueByKey(data, word) if actualVal != expectVal { t.Fail() } @@ -121,9 +121,9 @@ func TestGetValueByKeyCase2(t *testing.T) { func TestGetValueByKeyCase3(t *testing.T) { data := []string{"ASCEND_VISIBLE_DEVICES=0-3,5,7"} - kWord := "ASCEND_VISIBLE_DEVICE" + word := "ASCEND_VISIBLE_DEVICE" expectVal := "" - actualVal := getValueByKey(data, kWord) + actualVal := getValueByKey(data, word) if actualVal != expectVal { t.Fail() } -- Gitee From f05abca8a4cb65b28ae0a975481b5eea237098d6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Sep 2021 15:30:44 +0800 Subject: [PATCH 161/296] Match-id-b41545d32eead089c026321fc41ab95f4dcde85c --- cli/src/basic.h | 1 + cli/src/logger.c | 4 ++++ cli/src/main.c | 11 +++++++---- cli/src/ns.c | 13 ++++++++----- cli/test/dt/testcase/gtest_mytest.cpp | 4 ++-- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 0721c2f..0dbc67b 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -16,6 +16,7 @@ #define HISI_HDC "hisi_hdc" #define DEFAULT_DIR_MODE 0755 #define DEFAULT_LOG_MODE 0640 +#define DUMP_LOG_MODE 0440 #define DEFAULT_LOGDIR_MODE 0750 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 diff --git a/cli/src/logger.c b/cli/src/logger.c index 524ab7b..67d329d 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,9 @@ int LogLoop(const char* filename) unlink(loopPath); } rename(filename, loopPath); + if (chmod(loopPath, DUMP_LOG_MODE) != 0) { + return -1; + } ret = CreateLog(filename); if (ret < 0) { return -1; diff --git a/cli/src/main.c b/cli/src/main.c index ac7c06d..1fe995b 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -255,10 +255,13 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) Logger("failed to get self ns path.", LEVEL_ERROR, SCREEN_YES); return -1; } - - config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 + char realPath[PATH_MAX] = {0}; + if (realpath(originNsPath, realPath) == NULL) { + Logger("failed to check reaplath GetSelfNsPath", LEVEL_ERROR, SCREEN_YES); + } + config->originNsFd = open((const char *)realPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); + char* str = FormatLogMessage("failed to get self ns fd: %s.", realPath); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; @@ -350,7 +353,7 @@ int Process(int argc, char **argv) Logger("failed to setup container.", LEVEL_ERROR, SCREEN_YES); return ret; } - Logger("prestart-hook setup container successful.", LEVEL_INFO, SCREEN_YES); + Logger("prestart-hook setup container successful1.", LEVEL_INFO, SCREEN_YES); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 11d92c4..f1d45bd 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -40,12 +40,15 @@ int EnterNsByFd(int fd, int nsType) int EnterNsByPath(const char *path, int nsType) { - int fd; + int fd = 0; int ret; - - fd = open(path, O_RDONLY); // proc文件接口,非外部输入 + char realPath[PATH_MAX] = {0}; + if (realpath(path, realPath) == NULL) { + Logger("failed to check reaplath: EnterNsByPath", LEVEL_ERROR, SCREEN_YES); + } + fd = open(realPath, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - char* str = FormatLogMessage("failed to open ns path: %s.", path); + char* str = FormatLogMessage("failed to open ns path: %s.", realPath); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; @@ -53,7 +56,7 @@ int EnterNsByPath(const char *path, int nsType) ret = EnterNsByFd(fd, nsType); if (ret < 0) { - char* str = FormatLogMessage("failed to set ns: %s.", path); + char* str = FormatLogMessage("failed to set ns: %s.", realPath); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); close(fd); diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 3f24791..bfd9153 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -1006,7 +1006,7 @@ TEST(DoPrepare, StatusOne) config.devicesNr = 1024; int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); - EXPECT_EQ(0, ret); + EXPECT_EQ(-1, ret); } TEST(DoPrepare, StatusTwo) @@ -1021,7 +1021,7 @@ TEST(DoPrepare, StatusTwo) config.devicesNr = 1024; int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); - EXPECT_EQ(0, ret); + EXPECT_EQ(-1, ret); } TEST(DoPrepare, StatusThree) -- Gitee From 1a03a40b9c375f644ba90fedba3e4771cf6430f2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Sep 2021 15:46:28 +0800 Subject: [PATCH 162/296] Match-id-c9d7000f054be02574918e9ef7eaec52e763fd8e --- cli/src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 1fe995b..bd54967 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -259,9 +259,15 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) if (realpath(originNsPath, realPath) == NULL) { Logger("failed to check reaplath GetSelfNsPath", LEVEL_ERROR, SCREEN_YES); } - config->originNsFd = open((const char *)realPath, O_RDONLY); // proc接口,非外部输入 + char* str1 = FormatLogMessage("::::realPath %s.", realPath); + Logger(str1, LEVEL_ERROR, SCREEN_YES); + free(str1); + char* str2 = FormatLogMessage("::::originNsPath %s.", originNsPath); + Logger(str2, LEVEL_ERROR, SCREEN_YES); + free(str2); + config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { - char* str = FormatLogMessage("failed to get self ns fd: %s.", realPath); + char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; -- Gitee From a4e6e79777771af5e6562f43f9b5a47ed238d864 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Sep 2021 15:53:46 +0800 Subject: [PATCH 163/296] Match-id-7a6dd7fca944ac97b1e0e43a55c7bd0be98da9ac --- cli/src/main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index bd54967..73c3e34 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -218,6 +218,15 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device return 0; } +void testpath(char *originNsPath,char *realPath) +{ + char* str2 = FormatLogMessage("::::originNsPath %s.", originNsPath); + Logger(str2, LEVEL_ERROR, SCREEN_YES); + free(str2); + char* str1 = FormatLogMessage("::::realPath %s.", realPath); + Logger(str1, LEVEL_ERROR, SCREEN_YES); + free(str1); +} int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; @@ -259,12 +268,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) if (realpath(originNsPath, realPath) == NULL) { Logger("failed to check reaplath GetSelfNsPath", LEVEL_ERROR, SCREEN_YES); } - char* str1 = FormatLogMessage("::::realPath %s.", realPath); - Logger(str1, LEVEL_ERROR, SCREEN_YES); - free(str1); - char* str2 = FormatLogMessage("::::originNsPath %s.", originNsPath); - Logger(str2, LEVEL_ERROR, SCREEN_YES); - free(str2); + testpath(originNsPath, realPath); config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); -- Gitee From c2a3e61a111e2a4cd34dc06f4cd1a14b83ca8ab9 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Sep 2021 16:29:40 +0800 Subject: [PATCH 164/296] Match-id-69084a5a48ab0ae87a774967e967a11c9aa8ef0f --- cli/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/main.c b/cli/src/main.c index 73c3e34..85b1c66 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -218,7 +218,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device return 0; } -void testpath(char *originNsPath,char *realPath) +void testpath(char *originNsPath,char *realPath) { char* str2 = FormatLogMessage("::::originNsPath %s.", originNsPath); Logger(str2, LEVEL_ERROR, SCREEN_YES); @@ -227,6 +227,7 @@ void testpath(char *originNsPath,char *realPath) Logger(str1, LEVEL_ERROR, SCREEN_YES); free(str1); } + int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; -- Gitee From 57115e524ef93060d9265e791c107e9ec6438f7c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Sep 2021 17:31:34 +0800 Subject: [PATCH 165/296] Match-id-b32e2e2e2b69e5b40c6e2124013224705b2882ae --- cli/src/main.c | 18 ++---------------- cli/src/ns.c | 13 +++++-------- cli/test/dt/testcase/gtest_mytest.cpp | 4 ++-- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 85b1c66..ac7c06d 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -218,16 +218,6 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device return 0; } -void testpath(char *originNsPath,char *realPath) -{ - char* str2 = FormatLogMessage("::::originNsPath %s.", originNsPath); - Logger(str2, LEVEL_ERROR, SCREEN_YES); - free(str2); - char* str1 = FormatLogMessage("::::realPath %s.", realPath); - Logger(str1, LEVEL_ERROR, SCREEN_YES); - free(str1); -} - int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { int ret; @@ -265,11 +255,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) Logger("failed to get self ns path.", LEVEL_ERROR, SCREEN_YES); return -1; } - char realPath[PATH_MAX] = {0}; - if (realpath(originNsPath, realPath) == NULL) { - Logger("failed to check reaplath GetSelfNsPath", LEVEL_ERROR, SCREEN_YES); - } - testpath(originNsPath, realPath); + config->originNsFd = open((const char *)originNsPath, O_RDONLY); // proc接口,非外部输入 if (config->originNsFd < 0) { char* str = FormatLogMessage("failed to get self ns fd: %s.", originNsPath); @@ -364,7 +350,7 @@ int Process(int argc, char **argv) Logger("failed to setup container.", LEVEL_ERROR, SCREEN_YES); return ret; } - Logger("prestart-hook setup container successful1.", LEVEL_INFO, SCREEN_YES); + Logger("prestart-hook setup container successful.", LEVEL_INFO, SCREEN_YES); return 0; } diff --git a/cli/src/ns.c b/cli/src/ns.c index f1d45bd..11d92c4 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -40,15 +40,12 @@ int EnterNsByFd(int fd, int nsType) int EnterNsByPath(const char *path, int nsType) { - int fd = 0; + int fd; int ret; - char realPath[PATH_MAX] = {0}; - if (realpath(path, realPath) == NULL) { - Logger("failed to check reaplath: EnterNsByPath", LEVEL_ERROR, SCREEN_YES); - } - fd = open(realPath, O_RDONLY); // proc文件接口,非外部输入 + + fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - char* str = FormatLogMessage("failed to open ns path: %s.", realPath); + char* str = FormatLogMessage("failed to open ns path: %s.", path); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; @@ -56,7 +53,7 @@ int EnterNsByPath(const char *path, int nsType) ret = EnterNsByFd(fd, nsType); if (ret < 0) { - char* str = FormatLogMessage("failed to set ns: %s.", realPath); + char* str = FormatLogMessage("failed to set ns: %s.", path); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); close(fd); diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index bfd9153..3f24791 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -1006,7 +1006,7 @@ TEST(DoPrepare, StatusOne) config.devicesNr = 1024; int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } TEST(DoPrepare, StatusTwo) @@ -1021,7 +1021,7 @@ TEST(DoPrepare, StatusTwo) config.devicesNr = 1024; int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } TEST(DoPrepare, StatusThree) -- Gitee From 41b04932b204151eb6c07cfc9a4afc6db05d2248 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 10 Nov 2021 14:52:36 +0800 Subject: [PATCH 166/296] Match-id-4f7e68229316276c0206bf127624ff7629ea6e8c --- ci/dependency.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/dependency.xml b/ci/dependency.xml index 7d8e5fb..00e256f 100644 --- a/ci/dependency.xml +++ b/ci/dependency.xml @@ -7,6 +7,7 @@ MindX ascend-docker-plugin 20.10.0.B010 + N -- Gitee From 8826ea9b59c037c68d7db01eb1d8fb84080d3e1f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 10 Nov 2021 15:15:13 +0800 Subject: [PATCH 167/296] Match-id-c99089176ed8e0df6f1d831b779ee7056bbdbfe4 --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index a49db4e..0d97914 100644 --- a/build/build.sh +++ b/build/build.sh @@ -32,7 +32,7 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}") RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} -VERSION=$(cat $TOP_DIR/CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2) +VERSION=$(cat $TOP_DIR/Toolbox_CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2) PACKAGENAME="Ascend-docker-runtime" CPUARCH=$(uname -m) -- Gitee From 8bdd50b81c4a31fd4966e2f93fd78145d8f3961e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Dec 2021 15:42:33 +0800 Subject: [PATCH 168/296] Match-id-ed988be91f540c6f1f7db0f17f1967d38b283e11 --- cli/src/logger.c | 7 +++---- cli/src/ns.c | 1 - cli/test/dt/testcase/gtest_mytest.cpp | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 67d329d..1a0be42 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -22,10 +22,9 @@ int GetCurrentLocalTime(char* buffer, int length) { - time_t rawtime; - struct tm* timeinfo = NULL; - time(&rawtime); - timeinfo = localtime(&rawtime); + time_t timep = time(NULL); + struct tm result = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + struct tm *timeinfo = localtime_r(&timep, &result); if (timeinfo == NULL) { return -1; } diff --git a/cli/src/ns.c b/cli/src/ns.c index 11d92c4..13a3a55 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -34,7 +34,6 @@ int EnterNsByFd(int fd, int nsType) free(str); return -1; } - return 0; } diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 3f24791..8e9378a 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "securec.h" #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" -- Gitee From ccaebf8b7a73876207784e3cc409da042c66d8dd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 29 Dec 2021 19:34:42 +0800 Subject: [PATCH 169/296] Match-id-85e351b59a45944eae0285b9faaba2520cde027c --- build/build.sh | 29 ++------------------ cli/src/CMakeLists.txt | 2 +- cli/src/HuaweiSecureC/CMakeLists.txt | 2 +- install/deb/src/CMakeLists.txt | 4 +-- install/deb/src/HuaweiSecureC/CMakeLists.txt | 2 +- install/deb/src/cjson/CMakeLists.txt | 2 +- 6 files changed, 9 insertions(+), 32 deletions(-) diff --git a/build/build.sh b/build/build.sh index 0d97914..b855814 100644 --- a/build/build.sh +++ b/build/build.sh @@ -95,39 +95,16 @@ function build_run_package() RUN_PKG_NAME="${PACKAGENAME}-${VERSION}-${CPUARCH}.run" DATE=$(date -u "+%Y-%m-%d") - bash ${OPENSRC}/${MAKESELF_DIR}/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ + bash ${OPENSRC}/makeself-release-2.4.2/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh mv ${RUN_PKG_NAME} ${OUTPUT} } -function make_clean() +function clean() { [ -d "${OUTPUT}" ] && cd ${OUTPUT}&&rm -rf * } -function make_unzip() -{ - cd ${OPENSRC} - CJSONS=$(find . -name "cJSON.*") - CJSONSLIB=${INSTALLHELPERDIR}/deb/src/cjson - /bin/cp -f ${CJSONS} ${CJSONSLIB} - - MAKESELF_DIR=$(find . -name "makeself-release-*") - - cd ${PLATFORM}/HuaweiSecureC - SECURECSRC=$(find . -name "src") - SECURECINC=$(find . -name "include") - - SECURECLIB=${INSTALLHELPERDIR}/deb/src/HuaweiSecureC - /bin/cp -f ${SECURECSRC}/* ${SECURECLIB} - /bin/cp -f ${SECURECINC}/* ${SECURECLIB} - - SECURECLIB=${CLIDIR}/src/HuaweiSecureC - /bin/cp -f ${SECURECSRC}/* ${SECURECLIB} - /bin/cp -f ${SECURECINC}/* ${SECURECLIB} -} - -make_clean -make_unzip +clean build_bin build_run_package diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index ff6662a..0e1129c 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_C_STANDARD 11) message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") +include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") aux_source_directory(. SRC) add_subdirectory(HuaweiSecureC) add_executable(ascend-docker-cli ${SRC}) diff --git a/cli/src/HuaweiSecureC/CMakeLists.txt b/cli/src/HuaweiSecureC/CMakeLists.txt index 4a9d0c5..d206248 100644 --- a/cli/src/HuaweiSecureC/CMakeLists.txt +++ b/cli/src/HuaweiSecureC/CMakeLists.txt @@ -1,6 +1,6 @@ # 查找当前目录下的所有源文件 # 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../../platform/HuaweiSecureC/src LIB_SRC) #生成链接库 add_library(HuaweiSecureC ${LIB_SRC}) diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index 9b34a9a..1ed66b2 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -10,8 +10,8 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") #导入头文件所在路径 #PROJECT_SOURCE_DIR为cmake宏 -include_directories("${PROJECT_SOURCE_DIR}/cjson") -include_directories("${PROJECT_SOURCE_DIR}/HuaweiSecureC") +include_directories("../../../opensource/cJSON-1.7.14") +include_directories("../../../platform/HuaweiSecureC/include") # 查找当前目录下的所有源文件 # 并将名称保存到 SRC 变量 diff --git a/install/deb/src/HuaweiSecureC/CMakeLists.txt b/install/deb/src/HuaweiSecureC/CMakeLists.txt index 84fd943..006ff57 100644 --- a/install/deb/src/HuaweiSecureC/CMakeLists.txt +++ b/install/deb/src/HuaweiSecureC/CMakeLists.txt @@ -1,6 +1,6 @@ # 查找当前目录下的所有源文件 # 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) +aux_source_directory(../../../../platform/HuaweiSecureC/src LIB_SRC) #生成链接库 add_library(HuaweiSecureC ${LIB_SRC}) diff --git a/install/deb/src/cjson/CMakeLists.txt b/install/deb/src/cjson/CMakeLists.txt index eb2ae25..b0a143f 100644 --- a/install/deb/src/cjson/CMakeLists.txt +++ b/install/deb/src/cjson/CMakeLists.txt @@ -1,6 +1,6 @@ # 查找当前目录下的所有源文件 # 并将名称保存到 LIB_SRC 变量 -aux_source_directory(. LIB_SRC) +aux_source_directory(../../../../opensource/cJSON-1.7.14/ LIB_SRC) #生成链接库 add_library(cjson ${LIB_SRC}) -- Gitee From ba5043bdc58179072eac86c562ea1b27ec795b27 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 29 Dec 2021 21:07:27 +0800 Subject: [PATCH 170/296] Match-id-3c2ece00808e4ccf37e9c1b2b7283f975bc50591 --- {cli/src => build}/HuaweiSecureC/CMakeLists.txt | 2 +- build/build.sh | 15 ++++++++------- {install/deb/src => build}/cjson/CMakeLists.txt | 2 +- cli/src/CMakeLists.txt | 2 +- cli/test/dt/srclib/CMakeLists.txt | 2 +- install/deb/src/CMakeLists.txt | 4 ++-- install/deb/src/HuaweiSecureC/CMakeLists.txt | 7 ------- 7 files changed, 14 insertions(+), 20 deletions(-) rename {cli/src => build}/HuaweiSecureC/CMakeLists.txt (69%) rename {install/deb/src => build}/cjson/CMakeLists.txt (71%) delete mode 100644 install/deb/src/HuaweiSecureC/CMakeLists.txt diff --git a/cli/src/HuaweiSecureC/CMakeLists.txt b/build/HuaweiSecureC/CMakeLists.txt similarity index 69% rename from cli/src/HuaweiSecureC/CMakeLists.txt rename to build/HuaweiSecureC/CMakeLists.txt index d206248..d36a0f0 100644 --- a/cli/src/HuaweiSecureC/CMakeLists.txt +++ b/build/HuaweiSecureC/CMakeLists.txt @@ -1,6 +1,6 @@ # 查找当前目录下的所有源文件 # 并将名称保存到 LIB_SRC 变量 -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../../platform/HuaweiSecureC/src LIB_SRC) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../platform/HuaweiSecureC/src LIB_SRC) #生成链接库 add_library(HuaweiSecureC ${LIB_SRC}) diff --git a/build/build.sh b/build/build.sh index b855814..c360943 100644 --- a/build/build.sh +++ b/build/build.sh @@ -39,16 +39,17 @@ CPUARCH=$(uname -m) function build_bin() { echo "make cli" - [ -d "${CLISRCDIR}/build" ] && rm -rf ${CLISRCDIR}/build - mkdir ${CLISRCDIR}/build && cd ${CLISRCDIR}/build - cmake ../ + [ -d "${BUILD}/build/cli/build" ] && rm -rf ${BUILD}/build/cli/build + mkdir -p ${BUILD}/build/cli/build && cd ${BUILD}/build/cli/build + + cmake ${CLISRCDIR} make clean make echo "make installhelper" - [ -d "${INSTALLHELPERSRCDIR}/build" ] && rm -rf ${INSTALLHELPERSRCDIR}/build - mkdir ${INSTALLHELPERSRCDIR}/build && cd ${INSTALLHELPERSRCDIR}/build - cmake ../ + [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build + mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build + cmake ${INSTALLHELPERSRCDIR} make clean make @@ -80,7 +81,7 @@ function build_run_package() cd ${BUILD} mkdir run_pkg - /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) diff --git a/install/deb/src/cjson/CMakeLists.txt b/build/cjson/CMakeLists.txt similarity index 71% rename from install/deb/src/cjson/CMakeLists.txt rename to build/cjson/CMakeLists.txt index b0a143f..5f16c79 100644 --- a/install/deb/src/cjson/CMakeLists.txt +++ b/build/cjson/CMakeLists.txt @@ -1,6 +1,6 @@ # 查找当前目录下的所有源文件 # 并将名称保存到 LIB_SRC 变量 -aux_source_directory(../../../../opensource/cJSON-1.7.14/ LIB_SRC) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../opensource/cJSON-1.7.14/ LIB_SRC) #生成链接库 add_library(cjson ${LIB_SRC}) diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 0e1129c..e8c0fe4 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") aux_source_directory(. SRC) -add_subdirectory(HuaweiSecureC) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC) add_executable(ascend-docker-cli ${SRC}) target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/cli/test/dt/srclib/CMakeLists.txt b/cli/test/dt/srclib/CMakeLists.txt index 3607f62..a9ea319 100644 --- a/cli/test/dt/srclib/CMakeLists.txt +++ b/cli/test/dt/srclib/CMakeLists.txt @@ -15,7 +15,7 @@ ENDIF() add_definitions(-Dgtest) #set(UT_DEMO_SRCS ../../../src/main.c) aux_source_directory(../../../src UT_DEMO_SRCS) -include_directories("../../../src/HuaweiSecureC/include") +include_directories("../Depend/HuaweiSecureC/include") add_library(${PROJECT_NAME} ${UT_DEMO_SRCS}) target_link_libraries(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/libHuaweiSecureC.a) diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index 1ed66b2..e0db884 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -21,8 +21,8 @@ aux_source_directory(. SRC) add_executable(ascend-docker-plugin-install-helper ${SRC}) # 添加子目录 -add_subdirectory(cjson) -add_subdirectory(HuaweiSecureC) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC) # 添加链接库 #该命令要在add_executable命令下方,否则报错 diff --git a/install/deb/src/HuaweiSecureC/CMakeLists.txt b/install/deb/src/HuaweiSecureC/CMakeLists.txt deleted file mode 100644 index 006ff57..0000000 --- a/install/deb/src/HuaweiSecureC/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(../../../../platform/HuaweiSecureC/src LIB_SRC) - -#生成链接库 -add_library(HuaweiSecureC ${LIB_SRC}) -target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) -- Gitee From 2f6e074af25c88cc4a177fd6b741c45283566fb6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 13 Jan 2022 15:54:19 +0800 Subject: [PATCH 171/296] Match-id-9e3931d5da40148c707e740e24347513f76099d3 --- build/build.sh | 11 +- hook/go.mod | 8 + hook/go.sum | 15 + .../runtime-spec/.gitattributes | 2 - .../opencontainers/runtime-spec/.gitignore | 3 - .../opencontainers/runtime-spec/.mailmap | 21 - .../runtime-spec/.pullapprove.yml | 27 - .../runtime-spec/.tool/version-doc.go | 25 - .../opencontainers/runtime-spec/.travis.yml | 26 - .../opencontainers/runtime-spec/ChangeLog | 748 -------------- .../opencontainers/runtime-spec/GOVERNANCE.md | 70 -- .../opencontainers/runtime-spec/LICENSE | 191 ---- .../opencontainers/runtime-spec/MAINTAINERS | 6 - .../opencontainers/runtime-spec/Makefile | 95 -- .../opencontainers/runtime-spec/README.md | 150 --- .../opencontainers/runtime-spec/RELEASES.md | 96 -- .../opencontainers/runtime-spec/bundle.md | 22 - .../runtime-spec/config-linux.md | 766 -------------- .../runtime-spec/config-solaris.md | 120 --- .../opencontainers/runtime-spec/config-vm.md | 68 -- .../runtime-spec/config-windows.md | 207 ---- .../opencontainers/runtime-spec/config.md | 975 ------------------ .../opencontainers/runtime-spec/glossary.md | 38 - .../runtime-spec/implementations.md | 37 - .../opencontainers/runtime-spec/meeting.ics | 41 - .../opencontainers/runtime-spec/principles.md | 46 - .../runtime-spec/runtime-linux.md | 21 - .../opencontainers/runtime-spec/runtime.md | 146 --- .../runtime-spec/schema/Makefile | 50 - .../runtime-spec/schema/README.md | 48 - .../runtime-spec/schema/config-linux.json | 259 ----- .../runtime-spec/schema/config-schema.json | 188 ---- .../runtime-spec/schema/config-solaris.json | 65 -- .../runtime-spec/schema/config-vm.json | 60 -- .../runtime-spec/schema/config-windows.json | 102 -- .../runtime-spec/schema/defs-linux.json | 308 ------ .../runtime-spec/schema/defs-vm.json | 14 - .../runtime-spec/schema/defs-windows.json | 22 - .../runtime-spec/schema/defs.json | 158 --- .../runtime-spec/schema/state-schema.json | 39 - .../schema/test/config/bad/invalid-json.json | 1 - .../test/config/bad/linux-hugepage.json | 16 - .../schema/test/config/bad/linux-rdma.json | 15 - .../schema/test/config/good/linux-rdma.json | 22 - .../test/config/good/minimal-for-start.json | 16 - .../schema/test/config/good/minimal.json | 6 - .../schema/test/config/good/spec-example.json | 395 ------- .../schema/test/state/bad/invalid-json.json | 1 - .../schema/test/state/good/spec-example.json | 10 - .../runtime-spec/schema/validate.go | 100 -- .../opencontainers/runtime-spec/spec.md | 48 - .../runtime-spec/specs-go/config.go | 689 ------------- .../runtime-spec/specs-go/state.go | 17 - .../runtime-spec/specs-go/version.go | 18 - .../opencontainers/runtime-spec/style.md | 131 --- runtime/go.mod | 8 + runtime/go.sum | 15 + .../runtime-spec/.gitattributes | 2 - .../opencontainers/runtime-spec/.gitignore | 3 - .../opencontainers/runtime-spec/.mailmap | 21 - .../runtime-spec/.pullapprove.yml | 27 - .../runtime-spec/.tool/version-doc.go | 25 - .../opencontainers/runtime-spec/.travis.yml | 26 - .../opencontainers/runtime-spec/ChangeLog | 748 -------------- .../opencontainers/runtime-spec/GOVERNANCE.md | 70 -- .../opencontainers/runtime-spec/LICENSE | 191 ---- .../opencontainers/runtime-spec/MAINTAINERS | 6 - .../opencontainers/runtime-spec/Makefile | 95 -- .../opencontainers/runtime-spec/README.md | 150 --- .../opencontainers/runtime-spec/RELEASES.md | 96 -- .../opencontainers/runtime-spec/bundle.md | 22 - .../runtime-spec/config-linux.md | 766 -------------- .../runtime-spec/config-solaris.md | 120 --- .../opencontainers/runtime-spec/config-vm.md | 68 -- .../runtime-spec/config-windows.md | 207 ---- .../opencontainers/runtime-spec/config.md | 975 ------------------ .../opencontainers/runtime-spec/glossary.md | 38 - .../runtime-spec/implementations.md | 37 - .../opencontainers/runtime-spec/meeting.ics | 41 - .../opencontainers/runtime-spec/principles.md | 46 - .../runtime-spec/runtime-linux.md | 21 - .../opencontainers/runtime-spec/runtime.md | 146 --- .../runtime-spec/schema/Makefile | 50 - .../runtime-spec/schema/README.md | 48 - .../runtime-spec/schema/config-linux.json | 259 ----- .../runtime-spec/schema/config-schema.json | 188 ---- .../runtime-spec/schema/config-solaris.json | 65 -- .../runtime-spec/schema/config-vm.json | 60 -- .../runtime-spec/schema/config-windows.json | 102 -- .../runtime-spec/schema/defs-linux.json | 308 ------ .../runtime-spec/schema/defs-vm.json | 14 - .../runtime-spec/schema/defs-windows.json | 22 - .../runtime-spec/schema/defs.json | 158 --- .../runtime-spec/schema/state-schema.json | 39 - .../schema/test/config/bad/invalid-json.json | 1 - .../test/config/bad/linux-hugepage.json | 16 - .../schema/test/config/bad/linux-rdma.json | 15 - .../schema/test/config/good/linux-rdma.json | 22 - .../test/config/good/minimal-for-start.json | 16 - .../schema/test/config/good/minimal.json | 6 - .../schema/test/config/good/spec-example.json | 395 ------- .../schema/test/state/bad/invalid-json.json | 1 - .../schema/test/state/good/spec-example.json | 10 - .../runtime-spec/schema/validate.go | 100 -- .../opencontainers/runtime-spec/spec.md | 48 - .../runtime-spec/specs-go/config.go | 689 ------------- .../runtime-spec/specs-go/state.go | 17 - .../runtime-spec/specs-go/version.go | 18 - .../opencontainers/runtime-spec/style.md | 131 --- .../github.com/prashantv/gostub/.gitignore | 24 - .../github.com/prashantv/gostub/.travis.yml | 15 - .../github.com/prashantv/gostub/CHANGELOG.md | 10 - .../github.com/prashantv/gostub/LICENSE.md | 21 - .../github.com/prashantv/gostub/README.md | 114 -- .../prashantv/gostub/README.md.tmpl | 18 - .../prashantv/gostub/assignable_test.go | 34 - .../vendor/github.com/prashantv/gostub/doc.go | 78 -- .../vendor/github.com/prashantv/gostub/env.go | 36 - .../github.com/prashantv/gostub/env_test.go | 34 - .../prashantv/gostub/examples_test.go | 28 - .../gostub/examples_time_const_test.go | 1 - .../gostub/examples_time_func_test.go | 43 - .../github.com/prashantv/gostub/func_test.go | 118 --- .../github.com/prashantv/gostub/gostub.go | 126 --- .../prashantv/gostub/gostub_test.go | 109 -- .../prashantv/gostub/utils_for_test.go | 26 - .../github.com/prashantv/gostub/version.go | 4 - 127 files changed, 55 insertions(+), 14331 deletions(-) create mode 100644 hook/go.mod create mode 100644 hook/go.sum delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.gitignore delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.mailmap delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/LICENSE delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/Makefile delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/README.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/bundle.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/config.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/glossary.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/implementations.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/principles.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/runtime.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/spec.md delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go delete mode 100644 hook/vendor/github.com/opencontainers/runtime-spec/style.md create mode 100644 runtime/go.mod create mode 100644 runtime/go.sum delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/Makefile delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/README.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/config.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/principles.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/spec.md delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go delete mode 100644 runtime/vendor/github.com/opencontainers/runtime-spec/style.md delete mode 100644 runtime/vendor/github.com/prashantv/gostub/.gitignore delete mode 100644 runtime/vendor/github.com/prashantv/gostub/.travis.yml delete mode 100644 runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md delete mode 100644 runtime/vendor/github.com/prashantv/gostub/LICENSE.md delete mode 100644 runtime/vendor/github.com/prashantv/gostub/README.md delete mode 100644 runtime/vendor/github.com/prashantv/gostub/README.md.tmpl delete mode 100644 runtime/vendor/github.com/prashantv/gostub/assignable_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/doc.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/env.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/env_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/func_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/gostub.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/gostub_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/utils_for_test.go delete mode 100644 runtime/vendor/github.com/prashantv/gostub/version.go diff --git a/build/build.sh b/build/build.sh index c360943..8b1917a 100644 --- a/build/build.sh +++ b/build/build.sh @@ -55,11 +55,14 @@ function build_bin() [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src mkdir ${ROOT}/opensource/src - /bin/cp -rf ${HOOKSRCDIR}/vendor/* ${ROOT}/opensource/src + cd ${HOOKDIR} export GOPATH="${GOPATH}:${ROOT}/opensource" - export GO111MODULE=off + export GO111MODULE=on + export GOPROXY="http://mirrors.tools.huawei.com/goproxy/" + export GONOSUMDB="*" echo "make hook" + go mod tidy [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build export CGO_ENABLED=1 @@ -68,8 +71,12 @@ function build_bin() export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook + echo `pwd` + ls echo "make runtime" + go mod tidy + cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} diff --git a/hook/go.mod b/hook/go.mod new file mode 100644 index 0000000..b2bb8e2 --- /dev/null +++ b/hook/go.mod @@ -0,0 +1,8 @@ +module main + +go 1.16 + +require ( + github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/prashantv/gostub v1.1.0 +) diff --git a/hook/go.sum b/hook/go.sum new file mode 100644 index 0000000..f87c1c7 --- /dev/null +++ b/hook/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 h1:9mv9SC7GWmRWE0J/+oD8w3GsN2KYGKtg6uwLN7hfP5E= +github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes b/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes deleted file mode 100644 index 558b67f..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# https://tools.ietf.org/html/rfc5545#section-3.1 -*.ics text eol=crlf diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore b/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore deleted file mode 100644 index f9663c9..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -output -schema/validate -version.md diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap b/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap deleted file mode 100644 index 346194c..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.mailmap +++ /dev/null @@ -1,21 +0,0 @@ -Aleksa Sarai -Alexander Morozov -Amit Saha -Antonio Murdaca -Brandon Philips -Brandon Philips -ChengTiesheng -Daniel, Dao Quang Minh -Doug Davis -James O. D. Hunt -John Howard -LinZhinan(Zen Lin) -Mrunal Patel -Mrunal Patel -Mrunal Patel -Vincent Batts -Vincent Batts -Vishnu Kannan -Vishnu Kannan -Zefan Li -梁辰晔 (Liang Chenye) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml b/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml deleted file mode 100644 index ce688e2..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 - -requirements: - signed_off_by: - required: false - -group_defaults: - required: 2 - approve_by_comment: - enabled: true - approve_regex: ^LGTM - reject_regex: ^Rejected - reset_on_push: - enabled: true - author_approval: - ignored: true - always_pending: - title_regex: ^WIP - explanation: 'Work in progress...' - conditions: - branches: - - master - -groups: - runtime-spec: - teams: - - runtime-spec-maintainers diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go b/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go deleted file mode 100644 index f36bfe4..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build ignore - -package main - -import ( - "fmt" - "html/template" - "os" - - "github.com/opencontainers/runtime-spec/specs-go" -) - -var markdownTemplateString = ` - -**Specification Version:** *{{.}}* - -` - -var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString)) - -func main() { - if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil { - fmt.Fprintln(os.Stderr, err) - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml b/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml deleted file mode 100644 index 82e03a2..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go -go: - - "1.11.x" - - "1.10.x" - - "1.9.x" - -sudo: required - -services: - - docker - -before_install: - - make install.tools - - docker pull vbatts/pandoc - - go get -d ./schema/... - -install: true - -script: - - env | grep TRAVIS_ - - make .govet - - make .golint - - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" - - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation - - make docs - - make -C schema test diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog b/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog deleted file mode 100644 index e257f80..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/ChangeLog +++ /dev/null @@ -1,748 +0,0 @@ -OpenContainers Specifications - -Changes with v1.0.2: - - Additions: - - * Add create-container, create-runtime and start-container hooks (#1008) - * config-linux: add Intel RDT CLOS name sharing support (#988) - * config-linux: Add Intel RDT/MBA Linux support (#932) - * config-linux: Add Memory cgroup's use_hierarchy (#985) - * Add Linux personality support (#1012) - * config: Add Windows Devices to Schema (#976) - * Add support for SCMP_ACT_LOG (#1019) - * config-linux: support seccomp flags (#1018) - - Minor fixes and documentation: - - * Makefile: avoid SELinux for making docs - * Clarify case with pre-configured Intel RDT closID (#1034) - * config-linux: describe more about rootfs mount propagation (#1035) - * config-linux: add SHOULD to linux.namespaces.type (#1025) - * Reduce DCO checks per PR from 3 to 1 (#1029) - * Fix typo in RELEASES.md (#1033) - * Remove some unneeded indent (#1031) - * Add documentation how to do releases (#1027) - * Removed Vishnu Kannan & Brandon Philips from maintainers (#1030 & #1028) - * schema: drop id from umask (#1024) - * implementations.md: fix repository for crun (#1017) - * Update meeting info section to point to "org" repo (#1016) - * Fix markdown escape in config-linux (#1013) - * config-linux: add more info about hugetlb page size (#1011) - * Fix ociVersion of Configuration Schema Example to support ambient capability (#1009) - * Fix Namespaces to use LinuxNamespaceType (#1007) - * change new pid namespace description (#1006) - * updating link to code of conduct in org repository (#1001) - * Update Windows LayerFolder docs (#999) - * Windows:Have native CommandLine in Process (#998) - * vm: fix parameters field (#994) - * config-linux: documentation change for Intel RDT/MBA Software Controller support (#992) - * Bump Go versions (#993) - * Support for network namespace in windows (#989) - * config: clarify source mount (#981) - * Fix camelCasing on idType to align with other Windows spec conventions (#976) - * meeting: Bump July meeting from the 4th to the 11th (#977) - * docs: Added kata-runtime to implementations (#969) - * Add gVisor to the implementations list (#970) - * .travis.yml: Get schema dependencies in before_install (#968) - * config: Clarify execution environment for hooks (#953) - * config-linux: Drop console(4) reference (#965) - * Linux devices: uid/gid relative to container (#959) - * config: Add VM-based container configuration section (#949) - * uidMappings: change order of fields for clarity (#956) - * specs-go/config: Define RDMA cgroup (#942) - * schema/Makefile: fix test (#947) - * config: Fix Linux mount options links (#952) - * glossary: Bump JSON spec to RFC 8259 (#951) - * schema: Completely drop our JSON Schema 'id' properties (#945) - * meeting: Bump January meeting from the 3rd to the 10th (#943) - * config: add "umask" field to POSIX "user" section (#941) - * schema: add allowed values for defaultAction (#940) - * config: Dedent root paragraphs, since they aren't a list entry (#936) - * fix the link to hook (#933) - * config: Collapse extensibility to a single MUST (#916) - * schema/defs-linux: change weight type to uint16 (#898) - * runtime: Clarify ociVersion as based on the state schema (#903) - -Changes with v1.0.1: - - Minor fixes and documentation: - - * spec: Expand "OCI" in spec-title reference and add "Initiative" - (#900) - * config: Simplify title to "Configuration" (#901) - * config: Fix "procfs_2" -> "proc_2" link label (#906) - * config: Fix IEEE Std 1003.1-2008 exec link markup (#913) - * config: Add a trailing period to the "cannot be mapped" rlimits - line (#915) - * config-linux: RFC 2119 MUST for absolute linux.namespaces[].path - (#925). This is technically a breaking change, because a config - with a relative namespace path would have been compliant before, - but will be non compliant with this change. However, the previous - "an absolute path to namespace file" wording was clear enough that - config authors are unlikely to be relying on relative namespace - paths in configs. - * config-linux: More specific documentation for weightDevice and - throttle* (#825) - * config-linux: Modify procfs to proc (#905) - * config-linux: Fix "psuedo" -> "pseudo" typo (#921) - * config-windows: Make maximum a uint16 (was a uint) (#891) - * runtime: Change "process in the container" -> "container - process" (#907) - * schema/config-schema: Use ArrayOfStrings in capabilities - properties. (#886) - * schema/config-linux: - s/throttleWriteIopsDevice/throttleWriteIOPSDevice/ (#899) - * schema/config-linux: add intelRdt field (#889) - * schema/config-solaris: Replaced refs with some fields - (cappedCPU.ncpus, etc.) (#892) - -Changes with v1.0.0: - - Breaking changes: - - * config: Shift disableOOMKiller from linux.resources to - linux.resources.memory (#896) - - Decreased restrictions: - - * runtime: Make the state JSON's pid optional on non-Linux platforms - (#897) - - Minor fixes and documentation: - - * schema/defs-linux: Require Syscall.action (#885) - * specs-go/config: Fix 'omiempty' -> 'omitempty' typo for - LinuxSeccompArg.ValueTwo (#884) - * ROAMAP: remove the pre-v1.0.0 roadmap (#890) - -Changes with v1.0.0-rc6: - - Breaking changes: - - * config: Shift oomScoreAdj to process and add RFC 2119 requirements - for the runtime (#781, #789, #836) - * config: Forbid 'root' on Hyper-V (#820, #838). - * config: process.capabilities and process.noNewPrivileges are - Linux-only again (#880). This partially reverses #673, which had - landed in v1.0.0-rc5. - * config: Remove process.rlimits from Windows (#880). It is now - POSIX-only, while in v1.0.0-rc5 it was cross-platform (because of - #673). Before #673 (in v1.0.0-rc4 and earlier), it was - Linux-only. - * config-linux: Drop redundant 'blkio' prefix from blockIO - properties (#860) - * config-linux: Make memory limits int64 instead of uint64 (#876). - This partially reverses #704, which had landed in v1.0.0-rc5. - * config-windows: Change CPU 'percent' to 'maximum' (#777) - * config-windows: Remove memory 'reservation' (#788) - * config-windows: Remove 'resources.network' and add 'network' (#801) - - Additions: - - * config: Windows runtimes MUST support the 'ro' mount option (#868) - * config-linux: Add Intel RDT/CAT Linux support (#630, #787) - * config-linux: Add Markdown specification for syscalls (#706) - * config-linux: Add 'unbindable' rootfsPropagation value (#770, #775) - * config-windows: Add 'credentialSpec' (#814, #859) - * config-windows: Add 'servicing' (#815) - * config-windows: Add 'ignoreFlushesDuringBoot' (#816, #859) - * config-windows: Add 'hyperv' (#818, #849, #859) - * config-windows: Add 'layerFolders' (#828) - - Removals and increased restrictions: - - * config: Remove 'platform' (#850) - * config: Require strictly-postitive 'timeout' values (#764) - * config: Strengthen punt to kernel for valid capabilities strings - (#766, #790) - * config: Require volume GUID paths for root.path (#849) - * config: Forbid setting 'readonly' true on Windows (#819) - * config: Forbid setting mount 'type' entirely on Windows and forbid - UNC paths and mapped drives in 'source' on Windows (#821) - * config: Remove 'hooks' from Windows spec (#855, #869, #870) - * config-linux: Clearly require absolute path for namespace (#720) - * config-linux: RFC 2119 tightening for namespaces (#767) - * config-linux: Require at least one entry in - linux.seccomp.syscalls[].names (#769) - * config-linux: Remove syscall.comment (#714) - * config-linux: Use MUST and MAY for weight and leafWeight (#751) - * config-linux: Remove explicit 'null' from device cgroup values - (#804) - * runtime: Remove "features the runtime chooses to support" (#732) - * runtime: Drop "not supported by the base OS" loophole (#733) - * runtime-linux: Condition /proc/self/fd symlinks on source - existence (#736) - - Decreased restrictions: - - * config: Make 'process' optional (#701, #805) - * config-linux: Make linux.seccomp.syscalls optional (#768) - * config-linux: valueTwo is now optional in - `linux.seccomp.syscalls[].args` entries (#877) - * config-linux: Remove local range restrictions for blkioWeight, - blkioLeafWeight, weight, leafWeight, and shares (#780) - * config-linux: Explicitly allow symlinks for providing devices (#873) - - Minor fixes and documentation: - - * config: Remove "MAY support any valid values" sentence (#851) - * config: Remove the previously-forbidden mounts[].type from the - Windows spec (#854) - * config: Clarify mounts[].source relative path anchor (#735) - * config: Explicitly make consoleSize ignored if terminal is false or - unset (#863) - * config: Specify height/width units (characters) for consoleSize (#761) - * config: Use "POSIX platforms" instead of "Linux and Solaris" (#838) - * config-linux: Explicit namespace for interface names (#713) - * config-linux: Explicitly list cgroupsPath as optional (#823) - * runtime: Clarify valid container states for 'start', 'kill', and - 'delete' (#875) - * runtime: Explicitly make process.* timing implementation-defined (#700) - * specs-go/config: Remove range restrictions from Windows comments (#783) - * specs-go/config: Add omitempty to LinuxSyscall.Args (#763) - * specs-go/config: Use a pointer for Process.ConsoleSize (#792) - * schema/README: Use v1.0.0 URL in examples to prepare for the 1.0.0 - release (#881) - * schema/Makefile: Make 'validate' the default target (#750) - * schema/Makefile: Add 'clean' target (#774) - * schema: Add 'test' target to the Makefile (#785) - * *: Remove unnecessary .PHONY entries (#750, #778, #802) - * *: Typo fixes and polishing (#681, #708, #702, #703, #709, #711, - #712, #721, #722, #723, #724, #730, #737, #738, #741, #744, #749, - #753, #756, #765, #773, #776, #784, #786, #793, #794, #796, #798, - #799, #800, #803, #807, #809, #811, #812, #822, #824, #826, #827, - #832, #839, #840, #846, #847, #848, #852, #856, #858, #862, #865, - #871, #874) - -Changes with v1.0.0-rc5: - - Breaking changes: - - * config: Explicitly require `platform` (#695). - * config: The platform-specific sections (`linux`, `solaris`, and - `windows`) MUST NOT be set unless they match `platform.os` (#673). - * config: `process.capabilities` is now an object instead of an - array of strings (#675). - * config-linux: No longer allow negative values for some resources, - partially reversing #648 from v1.0.0-rc4 (#704). - * config-linux: `linux.seccomp.syscalls` entries have `names` - instead of `name` (#657). - * runtime: Rename the state `bundlePath` property to `bundle` - (#674). - - Additions: - - * config: `process.capabilities` is no longer Linux-only (#673). - * config-linux: `linux.seccomp.syscalls` entries have a new - `comment` property (#657). - * config-linux: Add new architectures from libseccomp 2.3.2 (#705) - * runtime: Add a `creating` state `status` (#507, #694). - - Removals and increased restrictions: - - * runtime: Document hook timing and exit code handling (#532). - * schema/config-linux: Explicit `null` values are no longer - compliant (#662). - - Decreased restrictions: - - * config: `type` and `source` properties are now optional for - `mounts` entries (#699). - * config: `args` property is now optional for hooks (#685). - * config-linux: Runtimes no longer need to provide `/proc` and - other filesystems unless they are explicitly requested in the - configuration JSON (#666). - - Minor fixes and documentation: - - * spec: Add OCI Runtime Abstract (#691). - * config: Document the Go `platform` tag (#570). - * config-linux: Remove local uid/gid mapping limit and punt to the - kernel (#693). - * schema: Fix broken `string` and similar `$ref`s (#684). - * schema: Remove `mounts` from required properties (#696). - * schema: Remove `major` and `minor` from `linux.devices` entries - (#688). - * schema: Check for the required `type`, `hard`, and `soft` in - `process.rlimits` entries (#696). - * schema/validate: Gained usage documentation and fixed - `schemaPath` logic when the argument did not contain `://` (#552). - * *: Add anchor tags to a number of spec locations (#707). - * *: Consistent link syntax (#687). - * *: Minor cleanup and rewording (#697). - -Changes with v1.0.0-rc4: - Additions: - - * config-linux: Allow negative values for some resources (#648) - * config-linux: Lift no-tweaking namespace restriction (#649) - - Removals and increased restrictions: - - * config: Rlimit types must be unique (#607) - * config: Forbid empty-string keys in 'annotations' (#645, #654) - * config-linux: Require runtime errors for pre-existing devices - (#647) - * runtime: Only require 'pid' in the state for created/running - statuses (#664) - * schema: Add 'consoleSize' and update requirements (#646) - * schema: Remove string pointers (#656) - * schema/config-linux: Remove blockIODeviceThrottle and other - pointers (#545) - - Breaking Go changes: - - * specs-go/config: Remove string pointers (#653) - * specs-go/config: Make Spec.Hooks a pointer (#427) - * specs-go/config: Convert some resources from unsigned integers - to signed integers (#648) - - Minor fixes and documentation: - - * config: Explicitly list 'hooks' as optional and cite POSIX for - 'env' and 'args' (#427) - * runtime: Replace "process is stopped" with "process exits" - (#465) - * schema/config-linux: Add missing kernelTCP (#655) - * schema/validate: Allow schema identifiers to contain a URL - scheme (#490) - * .travis: Fix git-validation commit ranges (#216) - * *: Add anchor tags to a number of spec locations (#612, #636, - #637, #638, #639, #640) - * *: Typo fixes and polishing (#643, #650, #652, #656, #660, #665) - -Changes with v1.0.0-rc3: - Additions: - - * config: Add support for Windows-based containers (#565, #573) - * config: Add process.consoleSize (#563) - * config: Explicitly allow unknown extensions and document - annotations key conventions (#510) - * config: Define mounts entries for Solaris (#588) - - Removals and increased restrictions: - - * config: Require absolute paths for mount destinations (#609) - * config-linux: Require absolute path for maskedPaths and - readonlyPaths (#587) - * config-linux: Only require /dev/console when process.terminal is - true. Also require /dev/console to be provided by a bind mount - (#518) - * runtime: Require runtimes to generate errors when the container - specified in config.json cannot be created (#559) - - Breaking Go changes: - - * specs-go/config: Aggressive namespacing (#567) - * specs-go/config: Remove pointers from LinuxHugepageLimit, - LinuxInterfacePriority, and LinuxPids properties (#586) - * specs-go/state: Rename version to ociVersion (#633) - LinuxInterfacePriority, and LinuxPids properties (#586) - - Minor fixes and documentation: - - * spec: Separate the spec from project scaffolding (#626) - * README: Define "unspecified", "undefined", and - "implementation-defined" (#575) - * config: Clarify absolue and relative values for root.path (#558) - * config: Clarify ociVersion covering the configuration <-> - runtime API (#523) - * config-linux: Forbid duplicated namespaces with same `type` - (#597) - * glossary: Make objects explicitly unordered and forbid duplicate - names (#584) - * specs-go/config: Add platform tags to Rlimits and - NoNewPRivileges (#564) - * schema/defs-linux: Use int64 for major/minor types (#610) - * Makefile: Add support for Go 1.7 (#547) - * Makefile: Require Go >= 1.6 for golint (#589) - * Makefile: Use a POSIX-compatible test ('==' -> '=') (#542) - * implementations: Rename ocitools -> runtime-tools (#585) - * *: Typo fixes and polishing (#556, #566, #568, #569, #571, #572, - #574, #595, #596, #599, #600, #601, #603, #605, #608, #613, #617, - #619, #621, #622, #623, #624, #625, #627, #629) - -Changes with v1.0.0-rc2: - Additions: - - * config-linux: Add new architectures from libseccomp 2.3.0 (#505) - * schema: Add JSON Schema for state JSON and move schema.json to - config-schema.json and similar (#481, #498, #519) - - Minor fixes and documentation: - - * Add compliance language for platforms and architectures (#527) - * Remove "unconditionally compliant" language (#553) - * bundle: Remove distribution references (#487) - * runtime: Fix sub-bullet indentation (#495) - * config: Replace Arch fstab reference with mount(8) (#443) - * config: Synchronize comments between Markdown and Go (#525) - * config: Drop v0.x compatibility statement (#488) - * config-linux: RFC 2119 wording for cgroupsPath (#493) - * config-linux: Make linux.devices and linux.resources.devices - optional (#526) - * config-linux: Extend no-tweak requirement to runtime namespaces (#538) - * schema: Add hook.timeout (#544) - * schema: Add missing '"type": "object"' (#528) - * schema: Run 'make fmt' and remove duplicates (#546, #551) - * schema/config: Make 'hostname' optional (#491) - * schema/config-linux: Add linux.resources.devices (#550) - * specs-go/config: Add Solaris tags to User properties (#496) - * specs-go/config: Make Linux and Solaris omitempty again (#502) - * specs-go/config: Make KernelTCP and ClassID omitempty (#531) - * specs-go/config: Fix "specified" typo for ApparmorProfile (#503) - * Makefile: Remove code-of-conduct.md and version.md when clean (#541) - * implementations: Mention cc-oci-runtime (#539) - * Use filesystem instead of file system (#529) - * .pullapprove: Add DCO check via PullApprove - * GOVERNANCE: Add governance and release process docs (#521) - * README: Change meeting time from 10am to 2pm Pacific (#524) - * README: Update conference-call phone number (#512, #515) - -Changes with v1.0.0-rc1: - Breaking changes: - - * runtime: Split create and start, #384, #450, #463, #464, #467, - #468 - * runtime: Remove exec, #388 - * runtime: Enviroment MUST match the configuration, #397 - * config: Runtime MUST generate errors for unsupported platforms, - #441 - * config: Windows mount destinations MUST NOT be nested, #437 - - Additions: - - * solaris: Added platform-specific configuration, #411, #424, #431, - #436 - * runtime: Add 'annotations' and 'status' to the state structure, - #462, #484, #485 - * runtime: State no longer needs to be serialized as JSON, #446 - * runtime-linux: Add /dev symbolic links, #449 - * config: Allow absolute paths for root.path (which previously - required relative paths), #394 - * config-linux: Add linux.mountLabel, #393 - * config-linux: Add suport for cgroup namespace, #397 - * config-linux: Runtime SHOULD NOT modify ownership of any - referenced filesystem (previously the restriction only applied to - the root filesystem), #452 - * specs-go/seccomp: Add ppc and s390x to specs-go/config.go, #475 - - Minor fixes and documentation: - - * README: Add project.md to the Table of Contents, #376 - * README: Consistenly indent the Table of Contents, #400 - * README: Link to LICENSE, #442 - * README: Weekly call is OCI-wide, #378 - * config: Explicit runtime namespace for hooks, #415 - * config: Explicit container namespace for uid, gid, and - additionalGids, #412 - * config: Fix 'string' -> 'array of strings' typo for process.args, - #416 - * runtime: The runtime MAY validate config.json, #418 - * runtime: Move errors section out of operations, #445 - * runtime: MAY -> SHOULD for post-stop error logging, #410 - * schema/README: Document JSON Schema usage, #360, #385 - * schema: Minor description updates, #456, #461 - * schema/validate: Support reading documents via stdin, #482 - * .pullapprove: Automate review approval, #458, #474 - * .gitignore: Hide more auto-generated files, #386, #392 - * .travis: git-validation detects Travis now, #366 - * .travis: Regress on failure to produce docs, #479 - * Makefile: Filename docs.* -> oci-runtime-spec.*, #478 - * Makefile: Add install.tools target, #349 - * Makefile: Allow native pandoc implementations, #428, #448 - * Makefile: Prefer Bash, #455 - * Makefile: Travis support for .gitvalidation, #422 - * specs-go/config: Add missing omitempties for Process.Terminal, - Root.Readonly, Spec.Linux, and Spec.Mounts, #408, #429, #430, #431 - * specs-go/config: Remove incorrect omitempties for User.UID and - User.GID, #425 - * specs-go/config: Drop platform-independent comment, #451 - * version: Include version in generated documentation, #406 - * *: Anchor examples, #348 - * *: Fix remnants from SelinuxProcessLabel to SelinuxLabel rename, - #396 - * *: Outsource code-of-conduct to TOB repository, #375, #413 - * *: RFC 2119 consistency, #407, #409, #438, #444, #449 - * *: Typo fixes, #390, #401 - * *: Whitespace fixes and validation, #380, #381, #426 - * ROADMAP: Remove stale targets, #435 - -Changes with v0.5.0: - Breaking changes: - - * specs-go: Renamed the repository from opencontainers/specs to - opencontainers/runtime-spec, #365 - - Additions: - - * config: Add 'timeout' for hooks, #346 - * config-linux: Add 'maskedPaths' and 'readonlyPaths', #364 - - Minor fixes and documentation: - - * JSON Schema bug-fixes and improved examples, #370 - * README: Define "unconditionally compliant", #374 - * config: Make Markdown canonical, #342 - * config: Explicitly list mapping from symbolic names to UID/GIDs as - out-of-scope, #347 - * config-linux: Require the runtime mount namespace for namespace - 'path' values, #275 - * config-linux: Reword kernelTCP docs, #377 - * specs-go: Add omitempty to 'Device' and 'Namespace', #340 - * .travis.yml: Use built-in 'go vet' and current 'go lint', dropping - Go < 1.5, #372, #352 - * implementations: Expand ocitools scope to include testing, #328 - * style: Move one-sentence-per-line rule from the README, #369 - * style: Remove dangling parenthesis, #359 - * README: Add a link to the IRC logs, #358 - * Fix "manadate", "exmaple", "paramters", and "preferrably" typos, - #353, #354 - -Changes with v0.4.0: - Breaking changes: - - * config: Move capabilities, selinuxProcessLabel, apparmorProfile, - and noNewPrivileges from the linux setting to the process setting - and make them optional, renaming selinuxProcessLabel to - selinuxLabel, #329, #330, #339 - * runtime: Rename version to ociVerison in the state JSON, #225 - * runtime: Remove the directory requirement for storing state, now - that there is a 'state' operation, #225, #334 - * go: Shift *.go to specs-go/*.go, #276 - * config: Move rlimits to process, #341 - * go: Move config_linux.go content into config.go, removing - LinuxSpec, #310 - - Additions: - - * schema: Add JSON Schema (and validator) for `config.json`, #313 - * config: Add annotations for opaque-to-the-runtime data, #331 - * config-linux: Make seccomp optional, #333 - * runtime: Added additional operations: state, stop, and exec. - #225 - - Minor fixes and documentation: - - * config-linux: Change mount type from *rune to *string and fix - octal fileMode examples, #323 - * runtime: RFC 2119 phrasing for the lifecycle, #225 - * README: Add a full example of config.json, #276 - * README: Replace BlueJeans with UberConference, #326, #338 - * style: Document Go-pointer exceptions, #317 - -Changes with v0.3.0: - Breaking changes: - - * config: Single, unified config file, #284 - * config: cwd is a required default, and must be absolute, #286, - #307, #308, #312 - * config: qualify the name of the version field, #309 - * config-linux: Convert classID from hex to uint32, #296 - * config-linux: Separate mknod from cgroups, #298 - - Additions: - - * config-linux: Add NoNewPrivileges setting for linux, #290 - - Minor fixes and documentation: - - * config-linux: clarify oom_score_adj, #236, #292 - * config-linux: Update links to cgroups documentation, #318 - * config-linux: Remove pointers for slices preferring omitempty - tag instead, #316 - * README: add runtime, bundle, and hook author user, #280 - * ROADMAP: reshuffled and split into GitHub issues, #300, #301, - #304, #306 - * style: Collect established styles in a discoverable location, #287, #311 - -Changes with v0.2.0: - * Add Apparmor, Selinux and Seccomp - * Add Apparmor, Selinux and Seccomp sections - * Add bind mount example - * Add fd section for linux container process - * Add Go types for specification - * *: adding a code of conduct - * Adding cgroups path to the Spec. - * .: Adding listing of implementations - * .: adding travis file for future CI - * Add license and DCO information for contributions - * Add linux spec description - * Add MAINTAINERS file - * Add memory swappiness to linux spec - * Add runtime state configuration and structs - * Adds a section for user namespace mappings - * Adds link to kernel cgroups documentation - * Adds section for Linux Rlimits - * Adds section for Linux Sysctl. - * Adds user namespace to the list of namespaces - * bundle: add initial run use case - * bundle: Fix 'and any number of and other related' typo - * bundle.md: clarify arbitrary/conventional dirnames - * bundle.md: fix link formatting - * bundle.md: fix off-by-one error - * bundle.md: various updates to latest spec - * bundle: Move 'Linux sysctl' header to its own line - * Change commiter to committer - * Change Device field order in spec_linux.go, 'Path' should be top of the 'Type' field, according to the different of the config-linux.md, 'Path' field is the unique key. - * Change layout of mountpoints and mounts - * Change the rlimit type to string instead of int - * Clarify behavior around namespaces paths. - * config: Add example additionalGids - * config: Add example cwd - * config: cleanup language on readonly parameter - * config: fix links to go files - * config-linux: specify the default devices/filesystems available - * config.md: clarify destination for mounts - * config.md: make the version a semver - * config.md: make the version field example a semver - * config.md: minor clean up of process specification - * config.md: reformat into a standard style - * config.md: update links to spec schema code - * config.md: various cleanup/consistency fixes - * config: minor cleanup - * Deduplicate the field of RootfsPropagation - * Define constants for Linux Namespace names - * Fix LinuxRuntime field - * Fix root object keys - * Fix typos in config.md - * Fix typos in the "Namespace types" section - * Fix typos in the rlimits section - * Fix Windows path escaping in example mount JSON - * JSON objects are easier to parse/manipulate - * made repo public. Added warning in README - * Make namespaces match runc - * make rootfs mount propagation mode settable - * Makes namespaces description linux specific - * *.md: markdown formatting - * Modify the capabilities constants to match header files like other constants - * Move linux specific options to linux spec - * README: add a rule for paragraph formatting in markdown - * README: Document BlueJeans and wiki archive for meetings - * README: Document pre-meeting agenda alteration - * README: Document YouTube and IRC backchannel for meetings - * README: Focus on local runtime (create/start/stop) - * README.md: Add a git commit style guide - * README.md: contribution about discussion - * README: releases section - * README: Remove blank line from infrastructure-agnostic paragraph - * removed boilerplate file - * *: remove superfluous comma in code-of-conduct - * Remove trailing whitespace - * Rename SystemProperties to Sysctl - * Rename the header "Access to devices" to "Devices" to fit with the config - * *: re-org the spec - * Replace Linux.Device with more specific config - * restore formatting - * Return golang compliant names for UID and GID in User - * Return golint-compliant naming for mappings - * runtime: Add prestart/poststop hooks - * runtime_config: comments for golint - * runtime-config-linux: Drop 'Linux' from headers - * runtime_config_linux: Fix 'LinuxSpec' -> 'LinuxRuntimeSpec' in comment - * runtime-config-linux: One sentence per line for opening two paragraphs - * runtime-config: Remove blank lines from the end of files - * runtime-config: Remove 'destination' docs from mounts - * runtime.md: convert oc to runc - * runtime: use opencontainer vs oci - * *: small spelling fixes - * Specific platform specific user struct for spec - * spec: linux: add support for the PIDs cgroup - * spec_linux: conform to `golint` - * spec_linux.go: Rename IDMapping fields to follow syscall.SysProcIDMap - * spec_linux: remove ending periods on one-line comments - * spec: rename ocp to oci and add a link - * specs: add json notation - * specs: align the ascii graph - * specs: fix the description for the [ug]idMappings - * specs: introduce the concept of a runtime.json - * .tools: cleanup the commit entry - * .tools: repo validation tool - * travis: fix DCO validation for merges - * typo: containers -> container's - * typo: the -> for - * Update config-linux for better formatting on values - * Update README.md - * Update readme with weekly call and mailing list - * Update runtime.md - * Update runtime.md - * Update runtime.md - * version: more explicit version for comparison - -Changes with v0.1.0: - * Add Architecture field to Seccomp configuration in Linux runtime - * Add @hqhq as maintainer - * Add hyphen for host specific - * Adding Vishnu Kannan as a Maintainer. - * Add initial roadmap - * Add lifecycle for containers - * Add oom_score_adj to the runtime Spec. - * Add post-start hooks - * Add Seccomp constants to description of Linux runtime spec - * Add Seccomp constants to Linux runtime config - * Add some clarity around the state.json file - * adds text describing the upper-case keywords used in the spec - * add testing framework to ROADMAP - * Appropriately mark optional fields as omitempty - * cgroup: Add support for memory.kmem.tcp.limit_in_bytes - * Change HugepageLimit.Limit type to uint64 - * Change the behavior when cgroupsPath is absent - * Change version from 0.1.0 to 0.2.0 - * Clarify the semantics of hook elements - * Cleanup bundle.md - * Cleanup principles - * config: linux: update description of PidsLimit - * config: Require a new UTS namespace for config.json's hostname - * config: Require the runtime to mount Spec.Mounts in order - * convert **name** to **`name`** - * Example lists "root' but text mentions "bundlePath" - * Fix an extra space in VersionMinor - * Fix golint warnings - * Fix typo in BlockIO struct comment - * Fix typo in Filesystem Bundle - * Fix value of swappiness - * glossary: Provide a quick overview of important terms - * glossary: Specify UTF-8 for all our JSON - * hooks: deduplicate the hooks docs - * implementations: Link to kunalkushwaha/octool - * implementations: Link to mrunalp/ocitools - * lifecycle: Don't require /run/opencontainer//containers - * lifecycle: Mention runtime.json - * lifecycle: no hypens - * MAINTAINERS: add tianon per the charter - * MAINTAINERS: correct Vish's github account - * Makefile: Add glossary to DOC_FILES - * Make optional Cgroup related config params pointers along with `omitempty` json tag. - * Mark RootfsPropagation as omitempty - * *.md: update TOC and links - * move the description of Rlimits before example - * move the description of user ns mapping to proper file - * principles: Give principles their own home - * *: printable documents - * Project: document release process - * README: Fix some headers - * README: make header more concise - * remove blank char from blank line - * Remove the unneeded build tag from the config_linux.go - * Remove trailing comma in hooks json example - * Rename State's Root to Bundle - * ROADMAP.md: remove the tail spaces - * roadmap: update links and add wiki reference - * runtime: Add 'version' to the state.json example - * runtime-config: add example label before json example - * runtime-config: add section about Hooks - * runtime: config: linux: add cgroups information - * runtime: config: linux: Edit BlockIO struct - * runtime: config: linux: Fix typo and trailing commas in json example - * runtime_config_linux.go: add missing pointer - * runtime-config-linux.md: fix the type of cpus and mems - * runtime.md: fix spacing - * Talk about host specific/independent instead of mutability - * .tools: commit validator is a separate project - * .tools: make GetFetchHeadCommit do what it says - * .travis.yml: add go 1.5.1, update from 1.4.2 to 1.4.3 - * Update readme with wiki link to minutes - * Update Typo in ROADMAP.md - * Use unsigned for IDs - * version: introduce a string for dev indication diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md b/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md deleted file mode 100644 index 92c8609..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md +++ /dev/null @@ -1,70 +0,0 @@ -# Project governance - -The [OCI charter][charter] §5.b.viii tasks an OCI Project's maintainers (listed in the repository's MAINTAINERS file and sometimes referred to as "the TDC", [§5.e][charter]) with: - -> Creating, maintaining and enforcing governance guidelines for the TDC, approved by the maintainers, and which shall be posted visibly for the TDC. - -This section describes generic rules and procedures for fulfilling that mandate. - -## Proposing a motion - -A maintainer SHOULD propose a motion on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with another maintainer as a co-sponsor. - -## Voting - -Voting on a proposed motion SHOULD happen on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with maintainers posting LGTM or REJECT. -Maintainers MAY also explicitly not vote by posting ABSTAIN (which is useful to revert a previous vote). -Maintainers MAY post multiple times (e.g. as they revise their position based on feedback), but only their final post counts in the tally. -A proposed motion is adopted if two-thirds of votes cast, a quorum having voted, are in favor of the release. - -Voting SHOULD remain open for a week to collect feedback from the wider community and allow the maintainers to digest the proposed motion. -Under exceptional conditions (e.g. non-major security fix releases) proposals which reach quorum with unanimous support MAY be adopted earlier. - -A maintainer MAY choose to reply with REJECT. -A maintainer posting a REJECT MUST include a list of concerns or links to written documentation for those concerns (e.g. GitHub issues or mailing-list threads). -The maintainers SHOULD try to resolve the concerns and wait for the rejecting maintainer to change their opinion to LGTM. -However, a motion MAY be adopted with REJECTs, as outlined in the previous paragraphs. - -## Quorum - -A quorum is established when at least two-thirds of maintainers have voted. - -For projects that are not specifications, a [motion to release](#release-approval) MAY be adopted if the tally is at least three LGTMs and no REJECTs, even if three votes does not meet the usual two-thirds quorum. - -## Security issues - -Motions with sensitive security implications MUST be proposed on the security@opencontainers.org mailing list instead of dev@opencontainers.org, but should otherwise follow the standard [proposal](#proposing-a-motion) process. -The security@opencontainers.org mailing list includes all members of the TOB. -The TOB will contact the project maintainers and provide a channel for discussing and voting on the motion, but voting will otherwise follow the standard [voting](#voting) and [quorum](#quorum) rules. -The TOB and project maintainers will work together to notify affected parties before making an adopted motion public. - -## Amendments - -The [project governance](#project-governance) rules and procedures MAY be amended or replaced using the procedures themselves. -The MAINTAINERS of this project governance document is the total set of MAINTAINERS from all Open Containers projects (runC, runtime-spec, and image-spec). - -## Subject templates - -Maintainers are busy and get lots of email. -To make project proposals recognizable, proposed motions SHOULD use the following subject templates. - -### Proposing a motion - -> [{project} VOTE]: {motion description} (closes {end of voting window}) - -For example: - -> [runtime-spec VOTE]: Tag 0647920 as 1.0.0-rc (closes 2016-06-03 20:00 UTC) - -### Tallying results - -After voting closes, a maintainer SHOULD post a tally to the motion thread with a subject template like: - -> [{project} {status}]: {motion description} (+{LGTMs} -{REJECTs} #{ABSTAINs}) - -Where `{status}` is either `adopted` or `rejected`. -For example: - -> [runtime-spec adopted]: Tag 0647920 as 1.0.0-rc (+6 -0 #3) - -[charter]: https://www.opencontainers.org/about/governance diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE b/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE deleted file mode 100644 index bdc4036..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 The Linux Foundation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS b/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS deleted file mode 100644 index f559c5b..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -Michael Crosby (@crosbymichael) -Mrunal Patel (@mrunalp) -Vincent Batts (@vbatts) -Daniel, Dao Quang Minh (@dqminh) -Tianon Gravi (@tianon) -Qiang Huang (@hqhq) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/Makefile b/hook/vendor/github.com/opencontainers/runtime-spec/Makefile deleted file mode 100644 index 16051b3..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/Makefile +++ /dev/null @@ -1,95 +0,0 @@ - -EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667 -OUTPUT_DIRNAME ?= output -DOC_FILENAME ?= oci-runtime-spec -DOCKER ?= $(shell command -v docker 2>/dev/null) -PANDOC ?= $(shell command -v pandoc 2>/dev/null) -ifeq "$(strip $(PANDOC))" '' - ifneq "$(strip $(DOCKER))" '' - PANDOC = $(DOCKER) run \ - --security-opt label=disable \ - -it \ - --rm \ - -v $(shell pwd)/:/input/:ro \ - -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \ - -u $(shell id -u) \ - vbatts/pandoc - PANDOC_SRC := /input/ - PANDOC_DST := / - endif -endif - -# These docs are in an order that determines how they show up in the PDF/HTML docs. -DOC_FILES := \ - version.md \ - spec.md \ - principles.md \ - bundle.md \ - runtime.md \ - runtime-linux.md \ - config.md \ - config-linux.md \ - config-solaris.md \ - glossary.md - -default: docs - -docs: $(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html - -ifeq "$(strip $(PANDOC))" '' -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: - $(error cannot build $@ without either pandoc or docker) -else -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) - mkdir -p $(OUTPUT_DIRNAME)/ && \ - $(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) - -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) - mkdir -p $(OUTPUT_DIRNAME)/ && \ - $(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) -endif - -version.md: ./specs-go/version.go - go run ./.tool/version-doc.go > $@ - -HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-) -# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked. -ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true') - -test: .govet .golint .gitvalidation - -.govet: - go vet -x ./... - -# `go get github.com/golang/lint/golint` -.golint: -ifeq ($(call ALLOWED_GO_VERSION,1.7,$(HOST_GOLANG_VERSION)),true) - @which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false) - golint ./... -endif - - -# When this is running in travis, it will only check the travis commit range -.gitvalidation: - @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) -ifdef TRAVIS_COMMIT_RANGE - git-validation -q -run short-subject,dangling-whitespace -else - git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD -endif - -install.tools: .install.golint .install.gitvalidation - -# golint does not even build for - -using your real name (sorry, no pseudonyms or anonymous contributions.) - -You can add the sign off when creating the git commit via `git commit -s`. - -#### Commit Style - -Simple house-keeping for clean git history. -Read more on [How to Write a Git Commit Message][how-to-git-commit] or the Discussion section of [git-commit(1)][git-commit.1]. - -1. Separate the subject from body with a blank line -2. Limit the subject line to 50 characters -3. Capitalize the subject line -4. Do not end the subject line with a period -5. Use the imperative mood in the subject line -6. Wrap the body at 72 characters -7. Use the body to explain what and why vs. how - * If there was important/useful/essential conversation or information, copy or include a reference -8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") - - -[charter]: https://www.opencontainers.org/about/governance -[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md -[dev-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev -[how-to-git-commit]: http://chris.beams.io/posts/git-commit -[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ -[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date -[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ -[oci]: https://www.opencontainers.org -[rfc5545]: https://tools.ietf.org/html/rfc5545 -[runtime-wiki]: https://github.com/opencontainers/runtime-spec/wiki -[uberconference]: https://www.uberconference.com/opencontainers - -[git-commit.1]: http://git-scm.com/docs/git-commit diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md b/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md deleted file mode 100644 index cd48def..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/RELEASES.md +++ /dev/null @@ -1,96 +0,0 @@ -# Releases - -The release process hopes to encourage early, consistent consensus-building during project development. -The mechanisms used are regular community communication on the mailing list about progress, scheduled meetings for issue resolution and release triage, and regularly paced and communicated releases. -Releases are proposed and adopted or rejected using the usual [project governance](GOVERNANCE.md) rules and procedures. - -An anti-pattern that we want to avoid is heavy development or discussions "late cycle" around major releases. -We want to build a community that is involved and communicates consistently through all releases instead of relying on "silent periods" as a judge of stability. - -## Parallel releases - -A single project MAY consider several motions to release in parallel. -However each motion to release after the initial 0.1.0 MUST be based on a previous release that has already landed. - -For example, runtime-spec maintainers may propose a v1.0.0-rc2 on the 1st of the month and a v0.9.1 bugfix on the 2nd of the month. -They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th if the vote initiated on the 1st passes). - -## Specifications - -The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools. -However, specification releases have special restrictions in the [OCI charter][charter]: - -* They are the target of backwards compatibility (§7.g), and -* They are subject to the OFWa patent grant (§8.d and e). - -To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases: - -### Planning a release - -Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases. -This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC. -Maintainers MUST send updates to the dev@opencontainers.org with results of these meetings. - -Before the specification reaches v1.0.0, the meetings SHOULD be weekly. -Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting. - -The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones). -GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures. - -### Timelines - -Specifications have a variety of different timelines in their lifecycle. - -* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback. -* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart. - This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself. - Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced. - For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0. -* Minor and patch releases SHOULD be made on an as-needed basis. - -[charter]: https://www.opencontainers.org/about/governance - -## Checklist - -Releases usually follow a few steps: - -* [ ] prepare a pull-request for the release - * [ ] a commit updating `./ChangeLog` - * [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -` - * [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting - * [ ] review `(^M|^A|^D)` for impact of the commit - * [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:` - * [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'` - * [ ] merge multi-commit PRs (so each line has a `(#num)` suffix) - * [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /` - * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable - * [ ] a commit adding back the "-dev" to `VersionDev` -* [ ] send email to dev@opencontainers.org - * [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev") - * [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l` - * [ ] get the date for a week from now, like `TZ=UTC date --date='next week'` - * [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description - * [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)` - * [ ] email body like -``` -Hey everyone, - -There have been $numPRs PRs merged since $priorTag release (https://github.com/opencontainers/runtime-spec/compare/$priorTag...$versionBumpCommit). - -$linkToPullRequest - -Please respond LGTM or REJECT (with reasoning). - -$sig -``` -* [ ] edit/update the pull-request to link to the VOTE thread, from https://groups.google.com/a/opencontainers.org/forum/#!forum/dev -* [ ] a week later, if the vote passes, merge the PR - * [ ] `git tag -s $version $versionBumpCommit` - * [ ] `git push --tags` -* [ ] produce release documents - * [ ] git checkout the release tag, like `git checkout $version` - * [ ] `make docs` - * [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf`` - * [ ] attach these docs to the release on https://github.com/opencontainers/runtime-spec/releases - * [ ] link to the the VOTE thread and include the passing vote count - * [ ] link to the pull request that merged the release diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md b/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md deleted file mode 100644 index 0924ad9..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/bundle.md +++ /dev/null @@ -1,22 +0,0 @@ -# Filesystem Bundle - -## Container Format - -This section defines a format for encoding a container as a *filesystem bundle* - a set of files organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it. -See also [MacOS application bundles][macos_bundle] for a similar use of the term *bundle*. - -The definition of a bundle is only concerned with how a container, and its configuration data, are stored on a local filesystem so that it can be consumed by a compliant runtime. - -A Standard Container bundle contains all the information needed to load and run a container. -This includes the following artifacts: - -1. `config.json`: contains configuration data. - This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`. - See [`config.json`](config.md) for more details. - -2. container's root filesystem: the directory referenced by [`root.path`](config.md#root), if that property is set in `config.json`. - -When supplied, while these artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle. -In other words, a tar archive of a *bundle* will have these artifacts at the root of the archive, not nested within a top-level directory. - -[macos_bundle]: https://en.wikipedia.org/wiki/Bundle_%28macOS%29 diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md deleted file mode 100644 index 368bf28..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/config-linux.md +++ /dev/null @@ -1,766 +0,0 @@ -# Linux Container Configuration - -This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. - -## Default Filesystems - -The Linux ABI includes both syscalls and several special file paths. -Applications expecting a Linux environment will very likely expect these file paths to be set up correctly. - -The following filesystems SHOULD be made available in each container's filesystem: - -| Path | Type | -| -------- | ------ | -| /proc | [proc][] | -| /sys | [sysfs][] | -| /dev/pts | [devpts][] | -| /dev/shm | [tmpfs][] | - -## Namespaces - -A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. -Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. -For more information, see the [namespaces(7)][namespaces.7_2] man page. - -Namespaces are specified as an array of entries inside the `namespaces` root field. -The following parameters can be specified to set up namespaces: - -* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types SHOULD be supported: - * **`pid`** processes inside the container will only be able to see other processes inside the same container or inside the same pid namespace. - * **`network`** the container will have its own network stack. - * **`mount`** the container will have an isolated mount table. - * **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC. - * **`uts`** the container will be able to have its own hostname and domain name. - * **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container. - * **`cgroup`** the container will have an isolated view of the cgroup hierarchy. -* **`path`** *(string, OPTIONAL)* - namespace file. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). - The runtime MUST place the container process in the namespace associated with that `path`. - The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`. - - If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`. - -If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type. -If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors). - -### Example - -```json -"namespaces": [ - { - "type": "pid", - "path": "/proc/1234/ns/pid" - }, - { - "type": "network", - "path": "/var/run/netns/neta" - }, - { - "type": "mount" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } -] -``` - -## User namespace mappings - -**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container. -**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container. - -Each entry has the following structure: - -* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container. -* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*. -* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped. - -The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping. -Note that the number of mapping entries MAY be limited by the [kernel][user-namespaces]. - -### Example - -```json -"uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } -], -"gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } -] -``` - -## Devices - -**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. -The runtime MAY supply them however it likes (with [`mknod`][mknod.2], by bind mounting from the runtime mount namespace, using symlinks, etc.). - -Each entry has the following structure: - -* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`. - More info in [mknod(1)][mknod.1]. -* **`path`** *(string, REQUIRED)* - full path to device inside container. - If a [file][] already exists at `path` that does not match the requested device, the runtime MUST generate an error. -* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device. -* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. - You can also control access to devices [with cgroups](#device-whitelist). -* **`uid`** *(uint32, OPTIONAL)* - id of device owner in the [container namespace](glossary.md#container-namespace). -* **`gid`** *(uint32, OPTIONAL)* - id of device group in the [container namespace](glossary.md#container-namespace). - -The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices. - -### Example - -```json -"devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } -] -``` - -### Default Devices - -In addition to any devices configured with this setting, the runtime MUST also supply: - -* [`/dev/null`][null.4] -* [`/dev/zero`][zero.4] -* [`/dev/full`][full.4] -* [`/dev/random`][random.4] -* [`/dev/urandom`][random.4] -* [`/dev/tty`][tty.4] -* `/dev/console` is set up if [`terminal`](config.md#process) is enabled in the config by bind mounting the pseudoterminal slave to `/dev/console`. -* [`/dev/ptmx`][pts.4]. - A [bind-mount or symlink of the container's `/dev/pts/ptmx`][devpts]. - -## Control groups - -Also known as cgroups, they are used to restrict resource usage for a container and handle device access. -cgroups provide controls (through controllers) to restrict cpu, memory, IO, pids, network and RDMA resources for the container. -For more information, see the [kernel cgroups documentation][cgroup-v1]. - -### Cgroups Path - -**`cgroupsPath`** (string, OPTIONAL) path to the cgroups. -It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container. - -The value of `cgroupsPath` MUST be either an absolute path or a relative path. - -* In the case of an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point. -* In the case of a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy. - -If the value is specified, the runtime MUST consistently attach to the same place in the cgroups hierarchy given the same value of `cgroupsPath`. -If the value is not specified, the runtime MAY define the default cgroups path. -Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case. - -Implementations of the Spec can choose to name cgroups in any manner. -The Spec does not include naming schema for cgroups. -The Spec does not support per-controller paths for the reasons discussed in the [cgroupv2 documentation][cgroup-v2]. -The cgroups will be created if they don't exist. - -You can configure a container's cgroups via the `resources` field of the Linux configuration. -Do not specify `resources` unless limits have to be updated. -For example, to run a new process in an existing container without updating limits, `resources` need not be specified. - -Runtimes MAY attach the container process to additional cgroup controllers beyond those necessary to fulfill the `resources` settings. - -### Example - -```json -"cgroupsPath": "/myRuntime/myContainer", -"resources": { - "memory": { - "limit": 100000, - "reservation": 200000 - }, - "devices": [ - { - "allow": false, - "access": "rwm" - } - ] -} -``` - -### Device whitelist - -**`devices`** (array of objects, OPTIONAL) configures the [device whitelist][cgroup-v1-devices]. -The runtime MUST apply entries in the listed order. - -Each entry has the following structure: - -* **`allow`** *(boolean, REQUIRED)* - whether the entry is allowed or denied. -* **`type`** *(string, OPTIONAL)* - type of device: `a` (all), `c` (char), or `b` (block). - Unset values mean "all", mapping to `a`. -* **`major, minor`** *(int64, OPTIONAL)* - [major, minor numbers][devices] for the device. - Unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices]. -* **`access`** *(string, OPTIONAL)* - cgroup permissions for device. - A composition of `r` (read), `w` (write), and `m` (mknod). - -#### Example - -```json -"devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } -] -``` - -### Memory - -**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage. -For more information, see the kernel cgroups documentation about [memory][cgroup-v1-memory]. - -Values for memory specify the limit in bytes, or `-1` for unlimited memory. - -* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage -* **`reservation`** *(int64, OPTIONAL)* - sets soft limit of memory usage -* **`swap`** *(int64, OPTIONAL)* - sets limit of memory+Swap usage -* **`kernel`** *(int64, OPTIONAL)* - sets hard limit for kernel memory -* **`kernelTCP`** *(int64, OPTIONAL)* - sets hard limit for kernel TCP buffer memory - -The following properties do not specify memory limits, but are covered by the `memory` controller: - -* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness) - The values are from 0 to 100. Higher means more swappy. -* **`disableOOMKiller`** *(bool, OPTIONAL)* - enables or disables the OOM killer. - If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. - The OOM killer is enabled by default in every cgroup using the `memory` subsystem. - To disable it, specify a value of `true`. -* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting. - If enabled (`true`), child cgroups will share the memory limits of this cgroup. - -#### Example - -```json -"memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false -} -``` - -### CPU - -**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets`. -For more information, see the kernel cgroups documentation about [cpusets][cgroup-v1-cpusets]. - -The following parameters can be specified to set up the controller: - -* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup -* **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by **`period`** below) -* **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only) -* **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources -* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only -* **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in -* **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in - -#### Example - -```json -"cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" -} -``` - -### Block IO - -**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller. -For more information, see the kernel cgroups documentation about [blkio][cgroup-v1-blkio]. - -The following parameters can be specified to set up the controller: - -* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. -* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. -* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`weight`** *(uint16, OPTIONAL)* - bandwidth weight for the device. - * **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth weight for the device while competing with the cgroup's child cgroups, CFQ scheduler only - - You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. - -* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth rate limits. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device - -* **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - an array of per-device IO rate limits. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device - -#### Example - -```json -"blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] -} -``` - -### Huge page limits - -**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the -HugeTLB usage per control group and enforces the controller limit during page fault. -For more information, see the kernel cgroups documentation about [HugeTLB][cgroup-v1-hugetlb]. - -Each entry has the following structure: - -* **`pageSize`** *(string, REQUIRED)* - hugepage size - The value has the format `B` (64KB, 2MB, 1GB), and must match the `` of the - corresponding control file found in `/sys/fs/cgroup/hugetlb/hugetlb..limit_in_bytes`. - Values of `` are intended to be parsed using base 1024 ("1KB" = 1024, "1MB" = 1048576, etc). -* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage - -#### Example - -```json -"hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 209715200 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } -] -``` - -### Network - -**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio`. -For more information, see the kernel cgroups documentations about [net\_cls cgroup][cgroup-v1-net-cls] and [net\_prio cgroup][cgroup-v1-net-prio]. - -The following parameters can be specified to set up the controller: - -* **`classID`** *(uint32, OPTIONAL)* - is the network class identifier the cgroup's network packets will be tagged with -* **`priorities`** *(array of objects, OPTIONAL)* - specifies a list of objects of the priorities assigned to traffic originating from processes in the group and egressing the system on various interfaces. - The following parameters can be specified per-priority: - * **`name`** *(string, REQUIRED)* - interface name in [runtime network namespace](glossary.md#runtime-namespace) - * **`priority`** *(uint32, REQUIRED)* - priority applied to the interface - -#### Example - -```json -"network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] -} -``` - -### PIDs - -**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids`. -For more information, see the kernel cgroups documentation about [pids][cgroup-v1-pids]. - -The following parameters can be specified to set up the controller: - -* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup - -#### Example - -```json -"pids": { - "limit": 32771 -} -``` - -### RDMA - -**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`. -For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma]. - -The name of the device to limit is the entry key. -Entry values are objects with the following properties: - -* **`hcaHandles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup -* **`hcaObjects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup - -You MUST specify at least one of the `hcaHandles` or `hcaObjects` in a given entry, and MAY specify both. - -#### Example - -```json -"rdma": { - "mlx5_1": { - "hcaHandles": 3, - "hcaObjects": 10000 - }, - "mlx4_0": { - "hcaObjects": 1000 - }, - "rxe3": { - "hcaObjects": 10000 - } -} -``` - -## IntelRdt - -**`intelRdt`** (object, OPTIONAL) represents the [Intel Resource Director Technology][intel-rdt-cat-kernel-interface]. -If `intelRdt` is set, the runtime MUST write the container process ID to the `tasks` file in a proper sub-directory in a mounted `resctrl` pseudo-filesystem. That sub-directory name is specified by `closID` parameter. -If no mounted `resctrl` pseudo-filesystem is available in the [runtime mount namespace](glossary.md#runtime-namespace), the runtime MUST [generate an error](runtime.md#errors). - -If `intelRdt` is not set, the runtime MUST NOT manipulate any `resctrl` pseudo-filesystems. - -The following parameters can be specified for the container: - -* **`closID`** *(string, OPTIONAL)* - specifies the identity for RDT Class of Service (CLOS). - If `closID` is set, runtimes MUST create `closID` directory in a mounted `resctrl` pseudo-filesystem if it doesn't exist. If not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `` directory. - -* **`l3CacheSchema`** *(string, OPTIONAL)* - specifies the schema for L3 cache id and capacity bitmask (CBM). - The value SHOULD start with `L3:` and SHOULD NOT contain newlines. -* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id. - * The value MUST start with `MB:` and MUST NOT contain newlines. - - * If both `l3CacheSchema` and `memBwSchema` are set, runtimes MUST write the combined value to the `schemata` file in that sub-directory discussed in `closID`. - - * If `l3CacheSchema` contains a line beginning with `MB:`, the value written to `schemata` file MUST be the non-`MB:` line(s) from `l3CacheSchema` and the line from `memBWSchema`. - - * If either `l3CacheSchema` or `memBwSchema` is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`. - - * If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. - - * If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match. - - * If `closID` is set, and neither of `l3CacheSchema` and `memBwSchema` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist. - - -### Example - -Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits, -and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%. - -Tasks inside the container only have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1, -and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1. - -```json -"linux": { - "intelRdt": { - "closID": "guaranteed_group", - "l3CacheSchema": "L3:0=7f0;1=1f", - "memBwSchema": "MB:0=20;1=70" - } -} -``` - -## Sysctl - -**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container. -For more information, see the [sysctl(8)][sysctl.8] man page. - -### Example - -```json -"sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" -} -``` - -## Seccomp - -Seccomp provides application sandboxing mechanism in the Linux kernel. -Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls. -For more information about Seccomp, see [Seccomp][seccomp] kernel documentation. -The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp][] and are translated to corresponding values. - -**`seccomp`** (object, OPTIONAL) - -The following parameters can be specified to set up seccomp: - -* **`defaultAction`** *(string, REQUIRED)* - the default action for seccomp. Allowed values are the same as `syscalls[].action`. -* **`architectures`** *(array of strings, OPTIONAL)* - the architecture used for system calls. - A valid list of constants as of libseccomp v2.3.2 is shown below. - - * `SCMP_ARCH_X86` - * `SCMP_ARCH_X86_64` - * `SCMP_ARCH_X32` - * `SCMP_ARCH_ARM` - * `SCMP_ARCH_AARCH64` - * `SCMP_ARCH_MIPS` - * `SCMP_ARCH_MIPS64` - * `SCMP_ARCH_MIPS64N32` - * `SCMP_ARCH_MIPSEL` - * `SCMP_ARCH_MIPSEL64` - * `SCMP_ARCH_MIPSEL64N32` - * `SCMP_ARCH_PPC` - * `SCMP_ARCH_PPC64` - * `SCMP_ARCH_PPC64LE` - * `SCMP_ARCH_S390` - * `SCMP_ARCH_S390X` - * `SCMP_ARCH_PARISC` - * `SCMP_ARCH_PARISC64` - -* **`flags`** *(array of strings, OPTIONAL)* - list of flags to use with seccomp(2). - - A valid list of constants is shown below. - - * `SECCOMP_FILTER_FLAG_TSYNC` - * `SECCOMP_FILTER_FLAG_LOG` - * `SECCOMP_FILTER_FLAG_SPEC_ALLOW` - -* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp. - While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries. - For example, if `defaultAction` is `SCMP_ACT_KILL` and `syscalls` is empty or unset, the kernel will kill the container process on its first syscall. - Each entry has the following structure: - - * **`names`** *(array of strings, REQUIRED)* - the names of the syscalls. - `names` MUST contain at least one entry. - * **`action`** *(string, REQUIRED)* - the action for seccomp rules. - A valid list of constants as of libseccomp v2.4.0 is shown below. - - * `SCMP_ACT_KILL` - * `SCMP_ACT_TRAP` - * `SCMP_ACT_ERRNO` - * `SCMP_ACT_TRACE` - * `SCMP_ACT_ALLOW` - * `SCMP_ACT_LOG` - - * **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp. - Each entry has the following structure: - - * **`index`** *(uint, REQUIRED)* - the index for syscall arguments in seccomp. - * **`value`** *(uint64, REQUIRED)* - the value for syscall arguments in seccomp. - * **`valueTwo`** *(uint64, OPTIONAL)* - the value for syscall arguments in seccomp. - * **`op`** *(string, REQUIRED)* - the operator for syscall arguments in seccomp. - A valid list of constants as of libseccomp v2.3.2 is shown below. - - * `SCMP_CMP_NE` - * `SCMP_CMP_LT` - * `SCMP_CMP_LE` - * `SCMP_CMP_EQ` - * `SCMP_CMP_GE` - * `SCMP_CMP_GT` - * `SCMP_CMP_MASKED_EQ` - -### Example - -```json -"seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] -} -``` - -## Rootfs Mount Propagation - -**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation. -Its value is either `shared`, `slave`, `private` or `unbindable`. -It's worth noting that a peer group is defined as a group of VFS mounts that propagate events to each other. -A nested container is defined as a container launched inside an existing container. - -* **`shared`**: the rootfs mount belongs to a new peer group. - This means that further mounts (e.g. nested containers) will also belong to that peer group and will propagate events to the rootfs. - Note this does not mean that it's shared with the host. -* **`slave`**: the rootfs mount receives propagation events from the host (e.g. if something is mounted on the host it will also appear in the container) but not the other way around. -* **`private`**: the rootfs mount doesn't receive mount propagation events from the host and further mounts in nested containers will be isolated from the host and from the rootfs (even if the nested container `rootfsPropagation` option is shared). -* **`unbindable`**: the rootfs mount is a private mount that cannot be bind-mounted. - -The [Shared Subtrees][sharedsubtree] article in the kernel documentation has more information about mount propagation. - -### Example - -```json -"rootfsPropagation": "slave", -``` - -## Masked Paths - -**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read. -The values MUST be absolute paths in the [container namespace](glossary.md#container_namespace). - -### Example - -```json -"maskedPaths": [ - "/proc/kcore" -] -``` - -## Readonly Paths - -**`readonlyPaths`** (array of strings, OPTIONAL) will set the provided paths as readonly inside the container. -The values MUST be absolute paths in the [container namespace](glossary.md#container-namespace). - -### Example - -```json -"readonlyPaths": [ - "/proc/sys" -] -``` - -## Mount Label - -**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container. - -### Example - -```json -"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" -``` - -## Personality - -**`personality`** (object, OPTIONAL) sets the Linux execution personality. For more information -see the [personality](personality.2) syscall documentation. As most of the options are -obsolete and rarely used, and some reduce security, the currently supported set is a small -subset of the available options. - -* **`domain`** *(string, REQUIRED)* - the execution domain. - The valid list of constants is shown below. `LINUX32` will set the `uname` system call to show - a 32 bit CPU type, such as `i686`. - - * `LINUX` - * `LINUX32` - -* **`flags`** *(array of strings, OPTIONAL)* - the additional flags to apply. - Currently no flag values are supported. - - -[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt -[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt -[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt -[cgroup-v1-devices]: https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt -[cgroup-v1-hugetlb]: https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt -[cgroup-v1-memory]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt -[cgroup-v1-net-cls]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_cls.txt -[cgroup-v1-net-prio]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_prio.txt -[cgroup-v1-pids]: https://www.kernel.org/doc/Documentation/cgroup-v1/pids.txt -[cgroup-v1-rdma]: https://www.kernel.org/doc/Documentation/cgroup-v1/rdma.txt -[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt -[devices]: https://www.kernel.org/doc/Documentation/admin-guide/devices.txt -[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt -[file]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164 -[libseccomp]: https://github.com/seccomp/libseccomp -[proc]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt -[seccomp]: https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt -[sharedsubtree]: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt -[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt -[tmpfs]: https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt - -[full.4]: http://man7.org/linux/man-pages/man4/full.4.html -[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html -[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html -[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html -[null.4]: http://man7.org/linux/man-pages/man4/null.4.html -[personality.2]: http://man7.org/linux/man-pages/man2/personality.2.html -[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html -[random.4]: http://man7.org/linux/man-pages/man4/random.4.html -[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html -[tty.4]: http://man7.org/linux/man-pages/man4/tty.4.html -[zero.4]: http://man7.org/linux/man-pages/man4/zero.4.html -[user-namespaces]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html -[intel-rdt-cat-kernel-interface]: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md deleted file mode 100644 index ee375d6..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/config-solaris.md +++ /dev/null @@ -1,120 +0,0 @@ -# Solaris Application Container Configuration - -Solaris application containers can be configured using the following properties, all of the below properties have mappings to properties specified under [zonecfg(1M)][zonecfg.1m_2] man page, except milestone. - -## milestone -The SMF(Service Management Facility) FMRI which should go to "online" state before we start the desired process within the container. - -**`milestone`** *(string, OPTIONAL)* - -### Example -```json -"milestone": "svc:/milestone/container:default" -``` - -## limitpriv -The maximum set of privileges any process in this container can obtain. -The property should consist of a comma-separated privilege set specification as described in [priv_str_to_set(3C)][priv-str-to-set.3c] man page for the respective release of Solaris. - -**`limitpriv`** *(string, OPTIONAL)* - -### Example -```json -"limitpriv": "default" -``` - -## maxShmMemory -The maximum amount of shared memory allowed for this application container. -A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). -Mapped to `max-shm-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. - -**`maxShmMemory`** *(string, OPTIONAL)* - -### Example -```json -"maxShmMemory": "512m" -``` - -## cappedCPU -Sets a limit on the amount of CPU time that can be used by a container. -The unit used translates to the percentage of a single CPU that can be used by all user threads in a container, expressed as a fraction (for example, .75) or a mixed number (whole number and fraction, for example, 1.25). -An ncpu value of 1 means 100% of a CPU, a value of 1.25 means 125%, .75 mean 75%, and so forth. -When projects within a capped container have their own caps, the minimum value takes precedence. -cappedCPU is mapped to `capped-cpu` in [zonecfg(1M)][zonecfg.1m_2] man page. - -* **`ncpus`** *(string, OPTIONAL)* - -### Example -```json -"cappedCPU": { - "ncpus": "8" -} -``` - -## cappedMemory -The physical and swap caps on the memory that can be used by this application container. -A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). -cappedMemory is mapped to `capped-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. - -* **`physical`** *(string, OPTIONAL)* -* **`swap`** *(string, OPTIONAL)* - -### Example -```json -"cappedMemory": { - "physical": "512m", - "swap": "512m" -} -``` - -## Network - -### Automatic Network (anet) -anet is specified as an array that is used to set up networking for Solaris application containers. -The anet resource represents the automatic creation of a network resource for an application container. -The zones administration daemon, zoneadmd, is the primary process for managing the container's virtual platform. -One of the daemon's responsibilities is creation and teardown of the networks for the container. -For more information on the daemon see the [zoneadmd(1M)][zoneadmd.1m] man page. -When such a container is started, a temporary VNIC(Virtual NIC) is automatically created for the container. -The VNIC is deleted when the container is torn down. -The following properties can be used to set up automatic networks. -For additional information on properties, check the [zonecfg(1M)][zonecfg.1m_2] man page for the respective release of Solaris. - -* **`linkname`** *(string, OPTIONAL)* Specify a name for the automatically created VNIC datalink. -* **`lowerLink`** *(string, OPTIONAL)* Specify the link over which the VNIC will be created. -Mapped to `lower-link` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`allowedAddress`** *(string, OPTIONAL)* The set of IP addresses that the container can use might be constrained by specifying the `allowedAddress` property. - If `allowedAddress` has not been specified, then they can use any IP address on the associated physical interface for the network resource. - Otherwise, when `allowedAddress` is specified, the container cannot use IP addresses that are not in the `allowedAddress` list for the physical address. - Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`configureAllowedAddress`** *(string, OPTIONAL)* If `configureAllowedAddress` is set to true, the addresses specified by `allowedAddress` are automatically configured on the interface each time the container starts. - When it is set to false, the `allowedAddress` will not be configured on container start. - Mapped to `configure-allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`defrouter`** *(string, OPTIONAL)* The value for the OPTIONAL default router. -* **`macAddress`** *(string, OPTIONAL)* Set the VNIC's MAC addresses based on the specified value or keyword. - If not a keyword, it is interpreted as a unicast MAC address. - For a list of the supported keywords please refer to the [zonecfg(1M)][zonecfg.1m_2] man page of the respective Solaris release. - Mapped to `mac-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`linkProtection`** *(string, OPTIONAL)* Enables one or more types of link protection using comma-separated values. - See the protection property in dladm(8) for supported values in respective release of Solaris. - Mapped to `link-protection` in the [zonecfg(1M)][zonecfg.1m_2] man page. - -#### Example -```json -"anet": [ - { - "allowedAddress": "172.17.0.2/16", - "configureAllowedAddress": "true", - "defrouter": "172.17.0.1/16", - "linkProtection": "mac-nospoof, ip-nospoof", - "linkname": "net0", - "lowerLink": "net2", - "macAddress": "02:42:f8:52:c7:16" - } -] -``` - - -[priv-str-to-set.3c]: http://docs.oracle.com/cd/E86824_01/html/E54766/priv-str-to-set-3c.html -[zoneadmd.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zoneadmd-1m.html -[zonecfg.1m_2]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md deleted file mode 100644 index ff551d3..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/config-vm.md +++ /dev/null @@ -1,68 +0,0 @@ -# Virtual-machine-specific Container Configuration - -This section describes the schema for the [virtual-machine-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The virtual-machine container specification provides additional configuration for the hypervisor, kernel, and image. - -## Hypervisor Object - -**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine. -* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor. - -### Example - -```json - "hypervisor": { - "path": "/path/to/vmm", - "parameters": ["opts1=foo", "opts2=bar"] - } -``` - -## Kernel Object - -**`kernel`** (object, REQUIRED) specifies details of the kernel to boot the container virtual machine with. -* **`path`** (string, REQUIRED) path to the kernel used to boot the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the kernel. -* **`initrd`** (string, OPTIONAL) path to an initial ramdisk to be used by the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). - -### Example - -```json - "kernel": { - "path": "/path/to/vmlinuz", - "parameters": ["foo=bar", "hello world"], - "initrd": "/path/to/initrd.img" - } -``` - -## Image Object - -**`image`** (object, OPTIONAL) specifies details of the image that contains the root filesystem for the container virtual machine. -* **`path`** (string, REQUIRED) path to the container virtual machine root image. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`format`** (string, REQUIRED) format of the container virtual machine root image. Commonly supported formats are: - * **`raw`** [raw disk image format][raw-image-format]. Unset values for `format` will default to that format. - * **`qcow2`** [QEMU image format][qcow2-image-format]. - * **`vdi`** [VirtualBox 1.1 compatible image format][vdi-image-format]. - * **`vmdk`** [VMware compatible image format][vmdk-image-format]. - * **`vhd`** [Virtual Hard Disk image format][vhd-image-format]. - -This image contains the root filesystem that the virtual machine **`kernel`** will boot into, not to be confused with the container root filesystem itself. The latter, as specified by **`path`** from the [Root Configuration](config.md#Root-Configuration) section, will be mounted inside the virtual machine at a location chosen by the virtual-machine-based runtime. - -### Example - -```json - "image": { - "path": "/path/to/vm/rootfs.img", - "format": "raw" - } -``` - -[raw-image-format]: https://en.wikipedia.org/wiki/IMG_(file_format) -[qcow2-image-format]: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qcow2.txt;hb=HEAD -[vdi-image-format]: https://forensicswiki.org/wiki/Virtual_Disk_Image_(VDI) -[vmdk-image-format]: http://www.vmware.com/app/vmdk/?src=vmdk -[vhd-image-format]: https://github.com/libyal/libvhdi/blob/master/documentation/Virtual%20Hard%20Disk%20(VHD)%20image%20format.asciidoc diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md b/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md deleted file mode 100644 index 5a95782..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/config-windows.md +++ /dev/null @@ -1,207 +0,0 @@ -# Windows-specific Container Configuration - -This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. - -## LayerFolders - -**`layerFolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer with the last entry being the scratch. -`layerFolders` MUST contain at least one entry. - -### Example - -```json -"windows": { - "layerFolders": [ - "C:\\Layers\\layer2", - "C:\\Layers\\layer1", - "C:\\Layers\\layer-base", - "C:\\scratch", - ] -} -``` - -## Devices - -**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. - -Each entry has the following structure: - -* **`id`** *(string, REQUIRED)* - specifies the device which the runtime MUST make available in the container. -* **`idType`** *(string, REQUIRED)* - tells the runtime how to interpret `id`. Today, Windows only supports a value of `class`, which identifies `id` as a [device interface class GUID][interfaceGUID]. - -[interfaceGUID]: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/overview-of-device-interface-classes - -### Example - -```json -"windows": { - "devices": [ - { - "id": "24E552D7-6523-47F7-A647-D3465BF1F5CA", - "idType": "class" - }, - { - "id": "5175d334-c371-4806-b3ba-71fd53c9258d", - "idType": "class" - } - ] -} -``` - -## Resources - -You can configure a container's resource limits via the OPTIONAL `resources` field of the Windows configuration. - -### Memory - -`memory` is an OPTIONAL configuration for the container's memory usage. - -The following parameters can be specified: - -* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes. - -#### Example - -```json -"windows": { - "resources": { - "memory": { - "limit": 2097152 - } - } -} -``` - -### CPU - -`cpu` is an OPTIONAL configuration for the container's CPU usage. - -The following parameters can be specified: - -* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. -* **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. -* **`maximum`** *(uint16, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. - -#### Example - -```json -"windows": { - "resources": { - "cpu": { - "maximum": 5000 - } - } -} -``` - -### Storage - -`storage` is an OPTIONAL configuration for the container's storage usage. - -The following parameters can be specified: - -* **`iops`** *(uint64, OPTIONAL)* - specifies the maximum IO operations per second for the system drive of the container. -* **`bps`** *(uint64, OPTIONAL)* - specifies the maximum bytes per second for the system drive of the container. -* **`sandboxSize`** *(uint64, OPTIONAL)* - specifies the minimum size of the system drive in bytes. - -#### Example - -```json -"windows": { - "resources": { - "storage": { - "iops": 50 - } - } -} -``` - -## Network - -You can configure a container's networking options via the OPTIONAL `network` field of the Windows configuration. - -The following parameters can be specified: - -* **`endpointList`** *(array of strings, OPTIONAL)* - list of HNS (Host Network Service) endpoints that the container should connect to. -* **`allowUnqualifiedDNSQuery`** *(bool, OPTIONAL)* - specifies if unqualified DNS name resolution is allowed. -* **`DNSSearchList`** *(array of strings, OPTIONAL)* - comma separated list of DNS suffixes to use for name resolution. -* **`networkSharedContainerName`** *(string, OPTIONAL)* - name (ID) of the container that we will share with the network stack. -* **`networkNamespace`** *(string, OPTIONAL)* - name (ID) of the network namespace that will be used for the container. If a network namespace is specified no other parameter must be specified. - -### Example - -```json -"windows": { - "network": { - "endpointList": [ - "7a010682-17e0-4455-a838-02e5d9655fe6" - ], - "allowUnqualifiedDNSQuery": true, - "DNSSearchList": [ - "a.com", - "b.com" - ], - "networkSharedContainerName": "containerName", - "networkNamespace": "168f3daf-efc6-4377-b20a-2c86764ba892" - } -} -``` - -## Credential Spec - -You can configure a container's group Managed Service Account (gMSA) via the OPTIONAL `credentialSpec` field of the Windows configuration. -The `credentialSpec` is a JSON object whose properties are implementation-defined. -For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. -For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling]. - - -[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts -[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools - -## Servicing - -When a container terminates, the Host Compute Service indicates if a Windows update servicing operation is pending. -You can indicate that a container should be started in a mode to apply pending servicing operations via the OPTIONAL `servicing` field of the Windows configuration. - -### Example - -```json -"windows": { - "servicing": true -} -``` - -## IgnoreFlushesDuringBoot - -You can indicate that a container should be started in an a mode where disk flushes are not performed during container boot via the OPTIONAL `ignoreFlushesDuringBoot` field of the Windows configuration. - -### Example - -```json -"windows": { - "ignoreFlushesDuringBoot": true -} -``` - -## HyperV - -`hyperv` is an OPTIONAL field of the Windows configuration. -If present, the container MUST be run with Hyper-V isolation. -If omitted, the container MUST be run as a Windows Server container. - -The following parameters can be specified: - -* **`utilityVMPath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. - This would be specified if using a base image which does not contain a utility VM image. - If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path. - -### Example - -```json -"windows": { - "hyperv": { - "utilityVMPath": "C:\\path\\to\\utilityvm" - } -} -``` diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/config.md b/hook/vendor/github.com/opencontainers/runtime-spec/config.md deleted file mode 100644 index 667bbba..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/config.md +++ /dev/null @@ -1,975 +0,0 @@ -# Configuration - -This configuration file contains metadata necessary to implement [standard operations](runtime.md#operations) against the container. -This includes the process to run, environment variables to inject, sandboxing features to use, etc. - -The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go). -[Platform](spec.md#platforms)-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below. -For properties that are only defined for some [platforms](spec.md#platforms), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`). - -Below is a detailed description of each field defined in the configuration format and valid values are specified. -Platform-specific fields are identified as such. -For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies. - - -## Specification version - -* **`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0][semver-v2.0.0] format and specifies the version of the Open Container Initiative Runtime Specification with which the bundle complies. - The Open Container Initiative Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions. - For example, if a configuration is compliant with version 1.1 of this specification, it is compatible with all runtimes that support any 1.1 or later release of this specification, but is not compatible with a runtime that supports 1.0 and not 1.1. - -### Example - -```json -"ociVersion": "0.1.0" -``` - -## Root - -**`root`** (object, OPTIONAL) specifies the container's root filesystem. -On Windows, for Windows Server Containers, this field is REQUIRED. -For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set. - -On all other platforms, this field is REQUIRED. - -* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container. - * On Windows, `path` MUST be a [volume GUID path][naming-a-volume]. - * On POSIX platforms, `path` is either an absolute path or a relative path to the bundle. - For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`. - The value SHOULD be the conventional `rootfs`. - - A directory MUST exist at the path declared by the field. - -* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false. - * On Windows, this field MUST be omitted or false. - -### Example (POSIX platforms) - -```json -"root": { - "path": "rootfs", - "readonly": true -} -``` - -### Example (Windows) - -```json -"root": { - "path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\" -} -``` - -## Mounts - -**`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root). -The runtime MUST mount entries in the listed order. -For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page. -For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page. - -* **`destination`** (string, REQUIRED) Destination of mount point: path inside container. - This value MUST be an absolute path. - * Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar). - * Solaris: corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m]. -* **`source`** (string, OPTIONAL) A device name, but can also be a file or directory name for bind mounts or a dummy. - Path values for bind mounts are either absolute or relative to the bundle. - A mount is a bind mount if it has either `bind` or `rbind` in the options. - * Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported. - * Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m]. -* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used. - * Linux: supported options are listed in the [mount(8)][mount.8] man page. - Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed. - * Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m]. - * Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given. - -### Example (Windows) - -```json -"mounts": [ - { - "destination": "C:\\folder-inside-container", - "source": "C:\\folder-on-host", - "options": ["ro"] - } -] -``` - -### POSIX-platform Mounts - -For POSIX platforms the `mounts` structure has the following fields: - -* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted. - * Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*). - * Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m]. - -### Example (Linux) - -```json -"mounts": [ - { - "destination": "/tmp", - "type": "tmpfs", - "source": "tmpfs", - "options": ["nosuid","strictatime","mode=755","size=65536k"] - }, - { - "destination": "/data", - "type": "none", - "source": "/volumes/testing", - "options": ["rbind","rw"] - } -] -``` - -### Example (Solaris) - -```json -"mounts": [ - { - "destination": "/opt/local", - "type": "lofs", - "source": "/usr/local", - "options": ["ro","nodevices"] - }, - { - "destination": "/opt/sfw", - "type": "lofs", - "source": "/opt/sfw" - } -] -``` - -## Process - -**`process`** (object, OPTIONAL) specifies the container process. -This property is REQUIRED when [`start`](runtime.md#start) is called. - -* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false. - As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal slave is duplicated on the process's [standard streams][stdin.3]. -* **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal. - Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset. - * **`height`** (uint, REQUIRED) - * **`width`** (uint, REQUIRED) -* **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable. - This value MUST be an absolute path. -* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. -* **`args`** (array of strings, OPTIONAL) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that at least one entry is REQUIRED (non-Windows), and that entry is used with the same semantics as `execvp`'s *file*. This field is OPTIONAL on Windows, and `commandLine` is REQUIRED if this field is omitted. -* **`commandLine`** (string, OPTIONAL) specifies the full command line to be executed on Windows. - This is the preferred means of supplying the command line on Windows. If omitted, the runtime will fall back to escaping and concatenating fields from `args` before making the system call into Windows. - - -### POSIX process - -For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties: - -* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process. - Each entry has the following structure: - - * **`type`** (string, REQUIRED) the platform resource being limited. - * Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`. - * Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`. - - The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface. - For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed. - For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call. - - * **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource. - `rlim.rlim_cur` MUST match the configured value. - * **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process. - `rlim.rlim_max` MUST match the configured value. - Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit. - - If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors). - -### Linux Process - -For Linux-based systems, the `process` object supports the following process-specific properties. - -* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process. - For more information about AppArmor, see [AppArmor documentation][apparmor]. -* **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process. - Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`. - Any value which cannot be mapped to a relevant kernel interface MUST cause an error. - `capabilities` contains the following properties: - - * **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process. - * **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process. - * **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process. - * **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process. - * **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process. -* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges. - As an example, the [`no_new_privs`][no-new-privs] article in the kernel documentation has information on how this is achieved using a `prctl` system call on Linux. -* **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][proc_2]. - If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value. - If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`. - - This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#memory) is scoped for a memory cgroup. - For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2]. -* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process. - For more information about SELinux, see [SELinux documentation][selinux]. - -### User - -The user for the process is a platform-specific structure that allows specific control over which user the process runs as. - -#### POSIX-platform User - -For POSIX platforms the `user` structure has the following fields: - -* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace). -* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace). -* **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask. -* **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process. - -_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_ - -### Example (Linux) - -```json -"process": { - "terminal": true, - "consoleSize": { - "height": 25, - "width": 80 - }, - "user": { - "uid": 1, - "gid": 1, - "umask": 63, - "additionalGids": [5, 6] - }, - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/root", - "args": [ - "sh" - ], - "apparmorProfile": "acme_secure_profile", - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true, - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ] -} -``` -### Example (Solaris) - -```json -"process": { - "terminal": true, - "consoleSize": { - "height": 25, - "width": 80 - }, - "user": { - "uid": 1, - "gid": 1, - "umask": 7, - "additionalGids": [2, 8] - }, - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/root", - "args": [ - "/usr/bin/bash" - ] -} -``` - -#### Windows User - -For Windows based systems the user structure has the following fields: - -* **`username`** (string, OPTIONAL) specifies the user name for the process. - -### Example (Windows) - -```json -"process": { - "terminal": true, - "user": { - "username": "containeradministrator" - }, - "env": [ - "VARIABLE=1" - ], - "cwd": "c:\\foo", - "args": [ - "someapp.exe", - ] -} -``` - - -## Hostname - -* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container. - On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7]. - Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7]. - -### Example - -```json -"hostname": "mrsdalloway" -``` - -## Platform-specific configuration - -* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md). - This MAY be set if the target platform of this spec is `linux`. -* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md). - This MUST be set if the target platform of this spec is `windows`. -* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md). - This MAY be set if the target platform of this spec is `solaris`. -* **`vm`** (object, OPTIONAL) [Virtual-machine-specific configuration](config-vm.md). - This MAY be set if the target platform and architecture of this spec support hardware virtualization. - -### Example (Linux) - -```json -{ - "linux": { - "namespaces": [ - { - "type": "pid" - } - ] - } -} -``` - -## POSIX-platform Hooks - -For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container. - -* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties: - * **`prestart`** (array of objects, OPTIONAL, **DEPRECATED**) is an array of [`prestart` hooks](#prestart). - * Entries in the array contain the following properties: - * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that **`path`** MUST be absolute. - * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. - * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. - * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. - If set, `timeout` MUST be greater than zero. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`createRuntime`** (array of objects, OPTIONAL) is an array of [`createRuntime` hooks](#createRuntime-hooks). - * Entries in the array contain the following properties (the entries are identical to the entries in the deprecated `prestart` hooks): - * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that **`path`** MUST be absolute. - * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. - * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. - * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. - If set, `timeout` MUST be greater than zero. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`createContainer`** (array of objects, OPTIONAL) is an array of [`createContainer` hooks](#createContainer-hooks). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - * **`startContainer`** (array of objects, OPTIONAL) is an array of [`startContainer` hooks](#startContainer-hooks). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [container namespace](glossary.md#container-namespace). - * The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - * **`poststart`** (array of objects, OPTIONAL) is an array of [`poststart` hooks](#poststart). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`poststop`** (array of objects, OPTIONAL) is an array of [`poststop` hooks](#poststop). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -Hooks allow users to specify programs to run before or after various lifecycle events. -Hooks MUST be called in the listed order. -The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container. - -### Prestart - -The `prestart` hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle). -On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). - -Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase. - -The `prestart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### CreateRuntime Hooks - -The `createRuntime` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. - -The `createRuntime` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). - -The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. - -Note: `runc` originally implemented `prestart` hooks contrary to the spec, namely as part of the `create` operation (instead of during the `start` operation). This incorrect implementation actually corresponds to `createRuntime` hooks. For runtimes that implement the deprecated `prestart` hooks as `createRuntime` hooks, `createRuntime` hooks MUST be called after the `prestart` hooks. - -### CreateContainer Hooks - -The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. -The `createContainer` hooks MUST be called after the `createRuntime` hooks. - -The `createContainer` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - -For example, on Linux this would happen before the `pivot_root` operation is executed but after the mount namespace was created and setup. - -The definition of `createContainer` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace and different mounts will be setup. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. - -### StartContainer Hooks - -The `startContainer` hooks MUST be called [before the user-specified process is executed](runtime.md#lifecycle) as part of the [`start`](runtime.md#start) operation. -This hook can be used to execute some operations in the container, for example running the `ldconfig` binary on linux before the container process is spawned. - -The `startContainer` hooks' path MUST resolve in the [container namespace](glossary.md#container-namespace). -The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - -### Poststart - -The `poststart` hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns. -For example, this hook can notify the user that the container process is spawned. - -The `poststart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### Poststop - -The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns. -Cleanup or debugging functions are examples of such a hook. - -The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### Summary - -See the below table for a summary of hooks and when they are called: - -| Name | Namespace | When | -| ----------------------- | --------- | -----------------------------------------------------------------------------------------------------------------------------------| -| `prestart` (Deprecated) | runtime | After the start operation is called but before the user-specified program command is executed. | -| `createRuntime` | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | -| `createContainer` | container | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | -| `startContainer` | container | After the start operation is called but before the user-specified program command is executed. | -| `poststart` | runtime | After the user-specified process is executed but before the start operation returns. | -| `poststop` | runtime | After the container is deleted but before the delete operation returns. | - -### Example - -```json -"hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createRuntime": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createContainer": [ - { - "path": "/usr/bin/mount-hook", - "args": ["-mount", "arg1", "arg2"], - "env": [ "key1=value1"] - } - ], - "startContainer": [ - { - "path": "/usr/bin/refresh-ldcache" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": ["cleanup.sh", "-f"] - } - ] -} -``` - -## Annotations - -**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container. -This information MAY be structured or unstructured. -Annotations MUST be a key-value map. -If there are no annotations then this property MAY either be absent or an empty map. - -Keys MUST be strings. -Keys MUST NOT be an empty string. -Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`. -Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications. -Runtimes MUST handle unknown annotation keys like any other [unknown property](#extensibility). - -Values MUST be strings. -Values MAY be an empty string. - -```json -"annotations": { - "com.example.gpu-cores": "2" -} -``` - -## Extensibility - -Runtimes MAY [log](runtime.md#warnings) unknown properties but MUST otherwise ignore them. -That includes not [generating errors](runtime.md#errors) if they encounter an unknown property. - -## Valid values - -Runtimes MUST generate an error when invalid or unsupported values are encountered. -Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support. - -## Configuration Schema Example - -Here is a full example `config.json` for reference. - -```json -{ - "ociVersion": "1.0.1", - "process": { - "terminal": true, - "user": { - "uid": 1, - "gid": 1, - "additionalGids": [ - 5, - 6 - ] - }, - "args": [ - "sh" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_CORE", - "hard": 1024, - "soft": 1024 - }, - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "apparmorProfile": "acme_secure_profile", - "oomScoreAdj": 100, - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "slartibartfast", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": [ - "fix-mounts", - "arg1", - "arg2" - ], - "env": [ - "key1=value1" - ] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": [ - "cleanup.sh", - "-f" - ] - } - ] - }, - "linux": { - "devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } - ], - "uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" - }, - "cgroupsPath": "/myRuntime/myContainer", - "resources": { - "network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] - }, - "pids": { - "limit": 32771 - }, - "hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 9223372036854772000 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } - ], - "memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false - }, - "cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" - }, - "devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } - ], - "blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] - } - }, - "rootfsPropagation": "slave", - "seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "network" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } - ], - "maskedPaths": [ - "/proc/kcore", - "/proc/latency_stats", - "/proc/timer_stats", - "/proc/sched_debug" - ], - "readonlyPaths": [ - "/proc/asound", - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger" - ], - "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" - }, - "annotations": { - "com.example.key1": "value1", - "com.example.key2": "value2" - } -} -``` - - -[apparmor]: https://wiki.ubuntu.com/AppArmor -[cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt -[selinux]:http://selinuxproject.org/page/Main_Page -[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt -[proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt -[umask.2]: http://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html -[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html -[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01 -[ieee-1003.1-2008-functions-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html -[naming-a-volume]: https://aka.ms/nb3hqb - -[capabilities.7]: http://man7.org/linux/man-pages/man7/capabilities.7.html -[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html -[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html -[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS -[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS -[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html -[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html -[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html -[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html -[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md b/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md deleted file mode 100644 index 0c81fad..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/glossary.md +++ /dev/null @@ -1,38 +0,0 @@ -# Glossary - -## Bundle - -A [directory structure](bundle.md) that is written ahead of time, distributed, and used to seed the runtime for creating a [container](#container) and launching a process within it. - -## Configuration - -The [`config.json`](config.md) file in a [bundle](#bundle) which defines the intended [container](#container) and container process. - -## Container - -An environment for executing processes with configurable isolation and resource limitations. -For example, namespaces, resource limits, and mounts are all part of the container environment. - -## Container namespace - -On Linux,the [namespaces][namespaces.7] in which the [configured process](config.md#process) executes. - -## JSON - -All configuration [JSON][] MUST be encoded in [UTF-8][]. -JSON objects MUST NOT include duplicate names. -The order of entries in JSON objects is not significant. - -## Runtime - -An implementation of this specification. -It reads the [configuration files](#configuration) from a [bundle](#bundle), uses that information to create a [container](#container), launches a process inside the container, and performs other [lifecycle actions](runtime.md). - -## Runtime namespace - -On Linux, the namespaces from which new [container namespaces](#container-namespace) are [created](config-linux.md#namespaces) and from which some configured resources are accessed. - -[JSON]: https://tools.ietf.org/html/rfc8259 -[UTF-8]: http://www.unicode.org/versions/Unicode8.0.0/ch03.pdf - -[namespaces.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md b/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md deleted file mode 100644 index 921383a..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/implementations.md +++ /dev/null @@ -1,37 +0,0 @@ -# Implementations - -The following sections link to associated projects, some of which are maintained by the OCI and some of which are maintained by external organizations. -If you know of any associated projects that are not listed here, please file a pull request adding a link to that project. - -## Runtime (Container) - -* [opencontainers/runc][runc] - Reference implementation of OCI runtime -* [projectatomic/bwrap-oci][bwrap-oci] - Convert the OCI spec file to a command line for [bubblewrap][bubblewrap] -* [containers/crun][crun] - Runtime implementation in C - -## Runtime (Virtual Machine) - -* [hyperhq/runv][runv] - Hypervisor-based runtime for OCI -* [clearcontainers/runtime][cc-runtime] - Hypervisor-based OCI runtime utilising [virtcontainers][virtcontainers] by Intel®. -* [google/gvisor][gvisor] - gVisor is a user-space kernel, contains runsc to run sandboxed containers. -* [kata-containers/runtime][kata-runtime] - Hypervisor-based OCI runtime combining technology from [clearcontainers/runtime][cc-runtime] and [hyperhq/runv][runv]. - -## Testing & Tools - -* [kunalkushwaha/octool][octool] - A config linter and validator. -* [huawei-openlab/oct][oct] - Open Container Testing framework for OCI configuration and runtime -* [opencontainers/runtime-tools][runtime-tools] - A config generator and runtime/bundle testing framework. - - -[runc]: https://github.com/opencontainers/runc -[runv]: https://github.com/hyperhq/runv -[cc-runtime]: https://github.com/clearcontainers/runtime -[kata-runtime]: https://github.com/kata-containers/runtime -[virtcontainers]: https://github.com/containers/virtcontainers -[octool]: https://github.com/kunalkushwaha/octool -[oct]: https://github.com/huawei-openlab/oct -[runtime-tools]: https://github.com/opencontainers/runtime-tools -[bwrap-oci]: https://github.com/projectatomic/bwrap-oci -[bubblewrap]: https://github.com/projectatomic/bubblewrap -[crun]: https://github.com/containers/crun -[gvisor]: https://github.com/google/gvisor diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics b/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics deleted file mode 100644 index e8c4bc7..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/meeting.ics +++ /dev/null @@ -1,41 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Open Containers Initiative//Developer Meeting//EN -BEGIN:VTIMEZONE -TZID:America/Los_Angeles -LAST-MODIFIED:20050809T050000Z -BEGIN:STANDARD -DTSTART:20071104T020000 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -TZOFFSETFROM:-0700 -TZOFFSETTO:-0800 -TZNAME:PST -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20070311T020000 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -TZOFFSETFROM:-0800 -TZOFFSETTO:-0700 -TZNAME:PDT -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:tdc-meeting@opencontainers.org -DTSTAMP:20180628T170000Z -DTSTART;TZID=America/Los_Angeles:20170906T140000 -RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE -RDATE;TZID=America/Los_Angeles:20180110T140000 -EXDATE;TZIP=America/Los_Angeles:20180103T140000 -RDATE;TZID=America/Los_Angeles:20180711T140000 -EXDATE;TZIP=America/Los_Angeles:20180704T140000 -DURATION:PT1H -SUMMARY:OCI TDC Meeting -DESCRIPTION;ALTREP="https://github.com/opencontainers/runtime-spec# - meetings":Open Containers Initiative Developer Meeting\n - https://github.com/opencontainers/runtime-spec#meetings\n - Web: https://www.uberconference.com/opencontainers\n - Audio-only: +1 415 968 0849 (no PIN needed) -LOCATION:https://www.uberconference.com/opencontainers -URL:https://github.com/opencontainers/runtime-spec/blob/master/meeting.ics -END:VEVENT -END:VCALENDAR diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/principles.md b/hook/vendor/github.com/opencontainers/runtime-spec/principles.md deleted file mode 100644 index 6c76963..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/principles.md +++ /dev/null @@ -1,46 +0,0 @@ -# The 5 principles of Standard Containers - -Define a unit of software delivery called a Standard Container. -The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container. - -The specification for Standard Containers defines: - -1. configuration file formats -2. a set of standard operations -3. an execution environment. - -A great analogy for this is the physical shipping container used by the transportation industry. -Shipping containers are a fundamental unit of delivery, they can be lifted, stacked, locked, loaded, unloaded and labelled. -Irrespective of their contents, by standardizing the container itself it allowed for a consistent, more streamlined and efficient set of processes to be defined. -For software Standard Containers offer similar functionality by being the fundamental, standardized, unit of delivery for a software package. - -## 1. Standard operations - -Standard Containers define a set of STANDARD OPERATIONS. -They can be created, started, and stopped using standard container tools; copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools. - -## 2. Content-agnostic - -Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. -They are started in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts. - -## 3. Infrastructure-agnostic - -Standard Containers are INFRASTRUCTURE-AGNOSTIC: they can be run in any OCI supported infrastructure. -For example, a standard container can be bundled on a laptop, uploaded to cloud storage, downloaded, run and snapshotted by a build server at a fiber hotel in Virginia, uploaded to 10 staging servers in a home-made private cloud cluster, then sent to 30 production instances across 3 public cloud regions. - -## 4. Designed for automation - -Standard Containers are DESIGNED FOR AUTOMATION: because they offer the same standard operations regardless of content and infrastructure, Standard Containers, are extremely well-suited for automation. -In fact, you could say automation is their secret weapon. - -Many things that once required time-consuming and error-prone human effort can now be programmed. -Before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. -Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. -The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider. - -## 5. Industrial-grade delivery - -Standard Containers make INDUSTRIAL-GRADE DELIVERY of software a reality. -Leveraging all of the properties listed above, Standard Containers are enabling large and small enterprises to streamline and automate their software delivery pipelines. -Whether it is in-house devOps flows, or external customer-based software delivery mechanisms, Standard Containers are changing the way the community thinks about software packaging and delivery. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md b/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md deleted file mode 100644 index 16c6dbe..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md +++ /dev/null @@ -1,21 +0,0 @@ -# Linux Runtime - -## File descriptors - -By default, only the `stdin`, `stdout` and `stderr` file descriptors are kept open for the application by the runtime. -The runtime MAY pass additional file descriptors to the application to support features such as [socket activation][socket-activated-containers]. -Some of the file descriptors MAY be redirected to `/dev/null` even though they are open. - -## Dev symbolic links - -While creating the container (step 2 in the [lifecycle](runtime.md#lifecycle)), runtimes MUST create the following symlinks if the source file exists after processing [`mounts`](config.md#mounts): - -| Source | Destination | -| --------------- | ----------- | -| /proc/self/fd | /dev/fd | -| /proc/self/fd/0 | /dev/stdin | -| /proc/self/fd/1 | /dev/stdout | -| /proc/self/fd/2 | /dev/stderr | - - -[socket-activated-containers]: http://0pointer.de/blog/projects/socket-activated-containers.html diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md b/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md deleted file mode 100644 index c45046b..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/runtime.md +++ /dev/null @@ -1,146 +0,0 @@ -# Runtime and Lifecycle - -## Scope of a Container - -The entity using a runtime to create a container MUST be able to use the operations defined in this specification against that same container. -Whether other entities using the same, or other, instance of the runtime can see that container is out of scope of this specification. - -## State - -The state of a container includes the following properties: - -* **`ociVersion`** (string, REQUIRED) is version of the Open Container Initiative Runtime Specification with which the state complies. -* **`id`** (string, REQUIRED) is the container's ID. - This MUST be unique across all containers on this host. - There is no requirement that it be unique across hosts. -* **`status`** (string, REQUIRED) is the runtime state of the container. - The value MAY be one of: - - * `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle)) - * `created`: the runtime has finished the [create operation](#create) (after step 2 in the [lifecycle](#lifecycle)), and the container process has neither exited nor executed the user-specified program - * `running`: the container process has executed the user-specified program but has not exited (after step 5 in the [lifecycle](#lifecycle)) - * `stopped`: the container process has exited (step 7 in the [lifecycle](#lifecycle)) - - Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. -* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host. -* **`bundle`** (string, REQUIRED) is the absolute path to the container's bundle directory. - This is provided so that consumers can find the container's configuration and root filesystem on the host. -* **`annotations`** (map, OPTIONAL) contains the list of annotations associated with the container. - If no annotations were provided then this property MAY either be absent or an empty map. - -The state MAY include additional properties. - -When serialized in JSON, the format MUST adhere to the following pattern: - -```json -{ - "ociVersion": "0.2.0", - "id": "oci-container1", - "status": "running", - "pid": 4422, - "bundle": "/containers/redis", - "annotations": { - "myKey": "myValue" - } -} -``` - -See [Query State](#query-state) for information on retrieving the state of a container. - -## Lifecycle -The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist. - -1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. -2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). - If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST [generate an error](#errors). - While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified program (from [`process`](config.md#process)) MUST NOT be run at this time. - Any updates to [`config.json`](config.md) after this step MUST NOT affect the container. -3. The [`prestart` hooks](config.md#prestart) MUST be invoked by the runtime. - If any `prestart` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -4. The [`createRuntime` hooks](config.md#createRuntime-hooks) MUST be invoked by the runtime. - If any `createRuntime` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -5. The [`createContainer` hooks](config.md#createContainer-hooks) MUST be invoked by the runtime. - If any `createContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -6. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. -7. The [`startContainer` hooks](config.md#startContainer-hooks) MUST be invoked by the runtime. - If any `startContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -8. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process). -9. The [`poststart` hooks](config.md#poststart) MUST be invoked by the runtime. - If any `poststart` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. -10. The container process exits. - This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked. -11. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. -12. The container MUST be destroyed by undoing the steps performed during create phase (step 2). -13. The [`poststop` hooks](config.md#poststop) MUST be invoked by the runtime. - If any `poststop` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. - -## Errors - -In cases where the specified operation generates an error, this specification does not mandate how, or even if, that error is returned or exposed to the user of an implementation. -Unless otherwise stated, generating an error MUST leave the state of the environment as if the operation were never attempted - modulo any possible trivial ancillary changes such as logging. - -## Warnings - -In cases where the specified operation logs a warning, this specification does not mandate how, or even if, that warning is returned or exposed to the user of an implementation. -Unless otherwise stated, logging a warning does not change the flow of the operation; it MUST continue as if the warning had not been logged. - -## Operations - -Unless otherwise stated, runtimes MUST support the following operations. - -Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations. - -### Query State - -`state ` - -This operation MUST [generate an error](#errors) if it is not provided the ID of a container. -Attempting to query a container that does not exist MUST [generate an error](#errors). -This operation MUST return the state of a container as specified in the [State](#state) section. - -### Create - -`create ` - -This operation MUST [generate an error](#errors) if it is not provided a path to the bundle and the container ID to associate with the container. -If the ID provided is not unique across all containers within the scope of the runtime, or is not valid in any other way, the implementation MUST [generate an error](#errors) and a new container MUST NOT be created. -This operation MUST create a new container. - -All of the properties configured in [`config.json`](config.md) except for [`process`](config.md#process) MUST be applied. -[`process.args`](config.md#process) MUST NOT be applied until triggered by the [`start`](#start) operation. -The remaining `process` properties MAY be applied by this operation. -If the runtime cannot apply a property as specified in the [configuration](config.md), it MUST [generate an error](#errors) and a new container MUST NOT be created. - -The runtime MAY validate `config.json` against this spec, either generically or with respect to the local system capabilities, before creating the container ([step 2](#lifecycle)). -Runtime callers who are interested in pre-create validation can run [bundle-validation tools](implementations.md#testing--tools) before invoking the create operation. - -Any changes made to the [`config.json`](config.md) file after this operation will not have an effect on the container. - -### Start -`start ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `start` a container that is not [`created`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -This operation MUST run the user-specified program as specified by [`process`](config.md#process). -This operation MUST generate an error if `process` was not set. - -### Kill -`kill ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -This operation MUST send the specified signal to the container process. - -### Delete -`delete ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -Deleting a container MUST delete the resources that were created during the `create` step. -Note that resources associated with the container, but not created by this container, MUST NOT be deleted. -Once a container is deleted its ID MAY be used by a subsequent container. - - -## Hooks -Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation. -See [runtime configuration for hooks](./config.md#posix-platform-hooks) for more information. diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile b/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile deleted file mode 100644 index ac8c8d2..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -GOOD_TESTS = $(wildcard test/good/*.json) -BAD_TESTS = $(wildcard test/bad/*.json) - -default: validate - -help: - @echo "Usage: make [target]" - @echo - @echo " * 'fmt' - format the json with indentation" - @echo " * 'help' - show this help information" - @echo " * 'validate' - build the validation tool" - -fmt: - find . -name '*.json' -exec bash -c 'jq --indent 4 -M . {} > xx && mv xx {} || echo "skipping invalid {}"' \; - -.PHONY: validate -validate: validate.go - go get -d ./... - go build ./validate.go - -test: validate $(TESTS) - for TYPE in $$(ls test); \ - do \ - echo "testing $${TYPE}"; \ - for FILE in $$(ls "test/$${TYPE}/good"); \ - do \ - echo " testing test/$${TYPE}/good/$${FILE}"; \ - if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/good/$${FILE}" ; \ - then \ - echo " received expected validation success" ; \ - else \ - echo " received unexpected validation failure" ; \ - exit 1; \ - fi \ - done; \ - for FILE in $$(ls "test/$${TYPE}/bad"); \ - do \ - echo " testing test/$${TYPE}/bad/$${FILE}"; \ - if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/bad/$${FILE}" ; \ - then \ - echo " received unexpected validation success" ; \ - exit 1; \ - else \ - echo " received expected validation failure" ; \ - fi \ - done; \ - done - -clean: - rm -f validate diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md b/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md deleted file mode 100644 index fecc467..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# JSON schema - -## Overview - -This directory contains the [JSON Schema](http://json-schema.org/) for validating JSON covered by this specification. - -The layout of the files is as follows: - -* [config-schema.json](config-schema.json) - the primary entrypoint for the [configuration](../config.md) schema -* [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md) -* [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md) -* [config-windows.json](config-windows.json) - the [Windows-specific configuration sub-structure](../config-windows.md) -* [state-schema.json](state-schema.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema -* [defs.json](defs.json) - definitions for general types -* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types -* [defs-windows.json](defs-windows.json) - definitions for Windows-specific types -* [validate.go](validate.go) - validation utility source code - - -## Utility - -There is also included a simple utility for facilitating validation. -To build it: - -```bash -export GOPATH=`mktemp -d` -go get -d ./... -go build ./validate.go -rm -rf $GOPATH -``` - -Or you can just use make command to create the utility: - -```bash -make validate -``` - -Then use it like: - -```bash -./validate config-schema.json /config.json -``` - -Or like: - -```bash -./validate https://raw.githubusercontent.com/opencontainers/runtime-spec/v1.0.0/schema/schema.json /config.json -``` diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json deleted file mode 100644 index 98295c4..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "linux": { - "description": "Linux platform-specific configurations", - "type": "object", - "properties": { - "devices": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/Device" - } - }, - "uidMappings": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/IDMapping" - } - }, - "gidMappings": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/IDMapping" - } - }, - "namespaces": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "defs-linux.json#/definitions/NamespaceReference" - } - ] - } - }, - "resources": { - "type": "object", - "properties": { - "devices": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/DeviceCgroup" - } - }, - "pids": { - "type": "object", - "properties": { - "limit": { - "$ref": "defs.json#/definitions/int64" - } - }, - "required": [ - "limit" - ] - }, - "blockIO": { - "type": "object", - "properties": { - "weight": { - "$ref": "defs-linux.json#/definitions/weight" - }, - "leafWeight": { - "$ref": "defs-linux.json#/definitions/weight" - }, - "throttleReadBpsDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleWriteBpsDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleReadIOPSDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleWriteIOPSDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "weightDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceWeight" - } - } - } - }, - "cpu": { - "type": "object", - "properties": { - "cpus": { - "type": "string" - }, - "mems": { - "type": "string" - }, - "period": { - "$ref": "defs.json#/definitions/uint64" - }, - "quota": { - "$ref": "defs.json#/definitions/int64" - }, - "realtimePeriod": { - "$ref": "defs.json#/definitions/uint64" - }, - "realtimeRuntime": { - "$ref": "defs.json#/definitions/int64" - }, - "shares": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "hugepageLimits": { - "type": "array", - "items": { - "type": "object", - "properties": { - "pageSize": { - "type": "string", - "pattern": "^[1-9][0-9]*[KMG]B$" - }, - "limit": { - "$ref": "defs.json#/definitions/uint64" - } - }, - "required": [ - "pageSize", - "limit" - ] - } - }, - "memory": { - "type": "object", - "properties": { - "kernel": { - "$ref": "defs.json#/definitions/int64" - }, - "kernelTCP": { - "$ref": "defs.json#/definitions/int64" - }, - "limit": { - "$ref": "defs.json#/definitions/int64" - }, - "reservation": { - "$ref": "defs.json#/definitions/int64" - }, - "swap": { - "$ref": "defs.json#/definitions/int64" - }, - "swappiness": { - "$ref": "defs.json#/definitions/uint64" - }, - "disableOOMKiller": { - "type": "boolean" - }, - "useHierarchy": { - "type": "boolean" - } - } - }, - "network": { - "type": "object", - "properties": { - "classID": { - "$ref": "defs.json#/definitions/uint32" - }, - "priorities": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/NetworkInterfacePriority" - } - } - } - }, - "rdma": { - "type": "object", - "additionalProperties": { - "$ref": "defs-linux.json#/definitions/Rdma" - } - } - } - }, - "cgroupsPath": { - "type": "string" - }, - "rootfsPropagation": { - "$ref": "defs-linux.json#/definitions/RootfsPropagation" - }, - "seccomp": { - "type": "object", - "properties": { - "defaultAction": { - "$ref": "defs-linux.json#/definitions/SeccompAction" - }, - "flags": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/SeccompFlag" - } - }, - "architectures": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/SeccompArch" - } - }, - "syscalls": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/Syscall" - } - } - }, - "required": [ - "defaultAction" - ] - }, - "sysctl": { - "$ref": "defs.json#/definitions/mapStringString" - }, - "maskedPaths": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "readonlyPaths": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "mountLabel": { - "type": "string" - }, - "intelRdt": { - "type": "object", - "properties": { - "closID": { - "type": "string" - }, - "l3CacheSchema": { - "type": "string" - }, - "memBwSchema": { - "type": "string", - "pattern": "^MB:[^\\n]*$" - } - } - }, - "personality": { - "type": "object", - "$ref": "defs-linux.json#/definitions/Personality" - } - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json deleted file mode 100644 index 94923b3..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "description": "Open Container Initiative Runtime Specification Container Configuration Schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "ociVersion": { - "$ref": "defs.json#/definitions/ociVersion" - }, - "hooks": { - "type": "object", - "properties": { - "prestart": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "createRuntime": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "createContainer": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "startContainer": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "poststart": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "poststop": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - } - } - }, - "annotations": { - "$ref": "defs.json#/definitions/annotations" - }, - "hostname": { - "type": "string" - }, - "mounts": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/Mount" - } - }, - "root": { - "description": "Configures the container's root filesystem.", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "readonly": { - "type": "boolean" - } - } - }, - "process": { - "type": "object", - "required": [ - "cwd" - ], - "properties": { - "args": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "commandLine": { - "type": "string" - }, - "consoleSize": { - "type": "object", - "required": [ - "height", - "width" - ], - "properties": { - "height": { - "$ref": "defs.json#/definitions/uint64" - }, - "width": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "cwd": { - "type": "string" - }, - "env": { - "$ref": "defs.json#/definitions/Env" - }, - "terminal": { - "type": "boolean" - }, - "user": { - "type": "object", - "properties": { - "uid": { - "$ref": "defs.json#/definitions/UID" - }, - "gid": { - "$ref": "defs.json#/definitions/GID" - }, - "umask": { - "$ref": "defs.json#/definitions/Umask" - }, - "additionalGids": { - "$ref": "defs.json#/definitions/ArrayOfGIDs" - }, - "username": { - "type": "string" - } - } - }, - "capabilities": { - "type": "object", - "properties": { - "bounding": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "permitted": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "effective": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "inheritable": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "ambient": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "apparmorProfile": { - "type": "string" - }, - "oomScoreAdj": { - "type": "integer" - }, - "selinuxLabel": { - "type": "string" - }, - "noNewPrivileges": { - "type": "boolean" - }, - "rlimits": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "soft", - "hard" - ], - "properties": { - "hard": { - "$ref": "defs.json#/definitions/uint64" - }, - "soft": { - "$ref": "defs.json#/definitions/uint64" - }, - "type": { - "type": "string", - "pattern": "^RLIMIT_[A-Z]+$" - } - } - } - } - } - }, - "linux": { - "$ref": "config-linux.json#/linux" - }, - "solaris": { - "$ref": "config-solaris.json#/solaris" - }, - "windows": { - "$ref": "config-windows.json#/windows" - }, - "vm": { - "$ref": "config-vm.json#/vm" - } - }, - "required": [ - "ociVersion" - ] -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json deleted file mode 100644 index be9f4d2..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "solaris": { - "description": "Solaris platform-specific configurations", - "type": "object", - "properties": { - "milestone": { - "type": "string" - }, - "limitpriv": { - "type": "string" - }, - "maxShmMemory": { - "type": "string" - }, - "cappedCPU": { - "type": "object", - "properties": { - "ncpus": { - "type": "string" - } - } - }, - "cappedMemory": { - "type": "object", - "properties": { - "physical": { - "type": "string" - }, - "swap": { - "type": "string" - } - } - }, - "anet": { - "type": "array", - "items": { - "type": "object", - "properties": { - "linkname": { - "type": "string" - }, - "lowerLink": { - "type": "string" - }, - "allowedAddress": { - "type": "string" - }, - "configureAllowedAddress": { - "type": "string" - }, - "defrouter": { - "type": "string" - }, - "macAddress": { - "type": "string" - }, - "linkProtection": { - "type": "string" - } - } - } - } - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json deleted file mode 100644 index 6b1fb4b..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "vm": { - "description": "configuration for virtual-machine-based containers", - "type": "object", - "required": [ - "kernel" - ], - "properties": { - "hypervisor": { - "description": "hypervisor config used by VM-based containers", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "parameters": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "kernel": { - "description": "kernel config used by VM-based containers", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "parameters": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "initrd": { - "$ref": "defs.json#/definitions/FilePath" - } - } - }, - "image": { - "description": "root image config used by VM-based containers", - "type": "object", - "required": [ - "path", - "format" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "format": { - "$ref": "defs-vm.json#/definitions/RootImageFormat" - } - } - } - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json deleted file mode 100644 index 68b51e9..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "windows": { - "description": "Windows platform-specific configurations", - "type": "object", - "properties": { - "layerFolders": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/FilePath" - }, - "minItems": 1 - }, - "devices": { - "type": "array", - "items": { - "$ref": "defs-windows.json#/definitions/Device" - } - }, - "resources": { - "type": "object", - "properties": { - "memory": { - "type": "object", - "properties": { - "limit": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "cpu": { - "type": "object", - "properties": { - "count": { - "$ref": "defs.json#/definitions/uint64" - }, - "shares": { - "$ref": "defs.json#/definitions/uint16" - }, - "maximum": { - "$ref": "defs.json#/definitions/uint16" - } - } - }, - "storage": { - "type": "object", - "properties": { - "iops": { - "$ref": "defs.json#/definitions/uint64" - }, - "bps": { - "$ref": "defs.json#/definitions/uint64" - }, - "sandboxSize": { - "$ref": "defs.json#/definitions/uint64" - } - } - } - } - }, - "network": { - "type": "object", - "properties": { - "endpointList": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "allowUnqualifiedDNSQuery": { - "type": "boolean" - }, - "DNSSearchList": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "networkSharedContainerName": { - "type": "string" - }, - "networkNamespace": { - "type": "string" - } - } - }, - "credentialSpec": { - "type": "object" - }, - "servicing": { - "type": "boolean" - }, - "ignoreFlushesDuringBoot": { - "type": "boolean" - }, - "hyperv": { - "type": "object", - "properties": { - "utilityVMPath": { - "type": "string" - } - } - } - }, - "required": [ - "layerFolders" - ] - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json deleted file mode 100644 index f011b72..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json +++ /dev/null @@ -1,308 +0,0 @@ -{ - "definitions": { - "PersonalityDomain": { - "type": "string", - "enum": [ - "LINUX", - "LINUX32" - ] - }, - "Personality": { - "type": "object", - "properties": { - "domain": { - "$ref": "#/definitions/PersonalityDomain" - }, - "flags": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "RootfsPropagation": { - "type": "string", - "enum": [ - "private", - "shared", - "slave", - "unbindable" - ] - }, - "SeccompArch": { - "type": "string", - "enum": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X86_64", - "SCMP_ARCH_X32", - "SCMP_ARCH_ARM", - "SCMP_ARCH_AARCH64", - "SCMP_ARCH_MIPS", - "SCMP_ARCH_MIPS64", - "SCMP_ARCH_MIPS64N32", - "SCMP_ARCH_MIPSEL", - "SCMP_ARCH_MIPSEL64", - "SCMP_ARCH_MIPSEL64N32", - "SCMP_ARCH_PPC", - "SCMP_ARCH_PPC64", - "SCMP_ARCH_PPC64LE", - "SCMP_ARCH_S390", - "SCMP_ARCH_S390X", - "SCMP_ARCH_PARISC", - "SCMP_ARCH_PARISC64" - ] - }, - "SeccompAction": { - "type": "string", - "enum": [ - "SCMP_ACT_KILL", - "SCMP_ACT_TRAP", - "SCMP_ACT_ERRNO", - "SCMP_ACT_TRACE", - "SCMP_ACT_ALLOW", - "SCMP_ACT_LOG" - ] - }, - "SeccompFlag": { - "type": "string", - "enum": [ - "SECCOMP_FILTER_FLAG_TSYNC", - "SECCOMP_FILTER_FLAG_LOG", - "SECCOMP_FILTER_FLAG_SPEC_ALLOW" - ] - }, - "SeccompOperators": { - "type": "string", - "enum": [ - "SCMP_CMP_NE", - "SCMP_CMP_LT", - "SCMP_CMP_LE", - "SCMP_CMP_EQ", - "SCMP_CMP_GE", - "SCMP_CMP_GT", - "SCMP_CMP_MASKED_EQ" - ] - }, - "SyscallArg": { - "type": "object", - "properties": { - "index": { - "$ref": "defs.json#/definitions/uint32" - }, - "value": { - "$ref": "defs.json#/definitions/uint64" - }, - "valueTwo": { - "$ref": "defs.json#/definitions/uint64" - }, - "op": { - "$ref": "#/definitions/SeccompOperators" - } - }, - "required": [ - "index", - "value", - "op" - ] - }, - "Syscall": { - "type": "object", - "properties": { - "names": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "action": { - "$ref": "#/definitions/SeccompAction" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/definitions/SyscallArg" - } - } - }, - "required": [ - "names", - "action" - ] - }, - "Major": { - "description": "major device number", - "$ref": "defs.json#/definitions/int64" - }, - "Minor": { - "description": "minor device number", - "$ref": "defs.json#/definitions/int64" - }, - "FileMode": { - "description": "File permissions mode (typically an octal value)", - "type": "integer", - "minimum": 0, - "maximum": 512 - }, - "FileType": { - "description": "Type of a block or special character device", - "type": "string", - "pattern": "^[cbup]$" - }, - "Device": { - "type": "object", - "required": [ - "type", - "path" - ], - "properties": { - "type": { - "$ref": "#/definitions/FileType" - }, - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "fileMode": { - "$ref": "#/definitions/FileMode" - }, - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - }, - "uid": { - "$ref": "defs.json#/definitions/UID" - }, - "gid": { - "$ref": "defs.json#/definitions/GID" - } - } - }, - "weight": { - "$ref": "defs.json#/definitions/uint16" - }, - "blockIODevice": { - "type": "object", - "properties": { - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - } - }, - "required": [ - "major", - "minor" - ] - }, - "blockIODeviceWeight": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/blockIODevice" - }, - { - "type": "object", - "properties": { - "weight": { - "$ref": "#/definitions/weight" - }, - "leafWeight": { - "$ref": "#/definitions/weight" - } - } - } - ] - }, - "blockIODeviceThrottle": { - "allOf": [ - { - "$ref": "#/definitions/blockIODevice" - }, - { - "type": "object", - "properties": { - "rate": { - "$ref": "defs.json#/definitions/uint64" - } - } - } - ] - }, - "DeviceCgroup": { - "type": "object", - "properties": { - "allow": { - "type": "boolean" - }, - "type": { - "type": "string" - }, - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - }, - "access": { - "type": "string" - } - }, - "required": [ - "allow" - ] - }, - "NetworkInterfacePriority": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "priority": { - "$ref": "defs.json#/definitions/uint32" - } - }, - "required": [ - "name", - "priority" - ] - }, - "Rdma": { - "type": "object", - "properties": { - "hcaHandles": { - "$ref": "defs.json#/definitions/uint32" - }, - "hcaObjects": { - "$ref": "defs.json#/definitions/uint32" - } - } - }, - "NamespaceType": { - "type": "string", - "enum": [ - "mount", - "pid", - "network", - "uts", - "ipc", - "user", - "cgroup" - ] - }, - "NamespaceReference": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/NamespaceType" - }, - "path": { - "$ref": "defs.json#/definitions/FilePath" - } - }, - "required": [ - "type" - ] - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json deleted file mode 100644 index 4dae915..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "definitions": { - "RootImageFormat": { - "type": "string", - "enum": [ - "raw", - "qcow2", - "vdi", - "vmdk", - "vhd" - ] - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json deleted file mode 100644 index 63e0ac3..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "definitions": { - "Device": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "idType": { - "type": "string", - "enum": [ - "class" - ] - } - }, - "required": [ - "id", - "idType" - ] - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json deleted file mode 100644 index 58b07e6..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/defs.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "description": "Definitions used throughout the Open Container Initiative Runtime Specification", - "definitions": { - "int8": { - "type": "integer", - "minimum": -128, - "maximum": 127 - }, - "int16": { - "type": "integer", - "minimum": -32768, - "maximum": 32767 - }, - "int32": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "int64": { - "type": "integer", - "minimum": -9223372036854776000, - "maximum": 9223372036854776000 - }, - "uint8": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "uint16": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "uint32": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "uint64": { - "type": "integer", - "minimum": 0, - "maximum": 18446744073709552000 - }, - "percent": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "mapStringString": { - "type": "object", - "patternProperties": { - ".{1,}": { - "type": "string" - } - } - }, - "UID": { - "$ref": "#/definitions/uint32" - }, - "GID": { - "$ref": "#/definitions/uint32" - }, - "Umask": { - "$ref": "#/definitions/uint32" - }, - "ArrayOfGIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/GID" - } - }, - "ArrayOfStrings": { - "type": "array", - "items": { - "type": "string" - } - }, - "FilePath": { - "type": "string" - }, - "Env": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "Hook": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/FilePath" - }, - "args": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "env": { - "$ref": "#/definitions/Env" - }, - "timeout": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "path" - ] - }, - "ArrayOfHooks": { - "type": "array", - "items": { - "$ref": "#/definitions/Hook" - } - }, - "IDMapping": { - "type": "object", - "properties": { - "containerID": { - "$ref": "#/definitions/uint32" - }, - "hostID": { - "$ref": "#/definitions/uint32" - }, - "size": { - "$ref": "#/definitions/uint32" - } - }, - "required": [ - "containerID", - "hostID", - "size" - ] - }, - "Mount": { - "type": "object", - "properties": { - "source": { - "$ref": "#/definitions/FilePath" - }, - "destination": { - "$ref": "#/definitions/FilePath" - }, - "options": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "type": { - "type": "string" - } - }, - "required": [ - "destination" - ] - }, - "ociVersion": { - "description": "The version of Open Container Initiative Runtime Specification that the document complies with", - "type": "string" - }, - "annotations": { - "$ref": "#/definitions/mapStringString" - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json deleted file mode 100644 index 8f82429..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "Open Container Runtime State Schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "ociVersion": { - "$ref": "defs.json#/definitions/ociVersion" - }, - "id": { - "description": "the container's ID", - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "creating", - "created", - "running", - "stopped" - ] - }, - "pid": { - "type": "integer", - "minimum": 0 - }, - "bundle": { - "type": "string" - }, - "annotations": { - "$ref": "defs.json#/definitions/annotations" - } - }, - "required": [ - "ociVersion", - "id", - "status", - "bundle" - ] -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json deleted file mode 100644 index 8e93528..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json +++ /dev/null @@ -1 +0,0 @@ -{] diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json deleted file mode 100644 index aea35eb..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "hugepageLimits": [ - { - "limit": 1234123, - "pageSize": "64kB" - } - ] - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json deleted file mode 100644 index 5a7ac69..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "rdma": { - "mlx5_1": { - "hcaHandles": "not a uint32" - } - } - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json deleted file mode 100644 index e70ed53..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "rdma": { - "mlx5_1": { - "hcaHandles": 3, - "hcaObjects": 10000 - }, - "mlx4_0": { - "hcaObjects": 1000 - }, - "rxe3": { - "hcaObjects": 10000 - } - } - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json deleted file mode 100644 index 766d2d3..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "process": { - "cwd": "/", - "args": [ - "sh" - ], - "user": { - "uid": 0, - "gid": 0 - } - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json deleted file mode 100644 index e26e9d7..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json deleted file mode 100644 index a784d1d..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json +++ /dev/null @@ -1,395 +0,0 @@ -{ - "ociVersion": "0.5.0-dev", - "process": { - "terminal": true, - "user": { - "uid": 1, - "gid": 1, - "additionalGids": [ - 5, - 6 - ] - }, - "args": [ - "sh" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_CORE", - "hard": 1024, - "soft": 1024 - }, - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "apparmorProfile": "acme_secure_profile", - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "slartibartfast", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": [ - "fix-mounts", - "arg1", - "arg2" - ], - "env": [ - "key1=value1" - ] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createRuntime": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createContainer": [ - { - "path": "/usr/bin/mount-hook", - "args": ["-mount", "arg1", "arg2"], - "env": [ "key1=value1"] - } - ], - "startContainer": [ - { - "path": "/usr/bin/refresh-ldcache" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": [ - "cleanup.sh", - "-f" - ] - } - ] - }, - "linux": { - "devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } - ], - "uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" - }, - "cgroupsPath": "/myRuntime/myContainer", - "resources": { - "network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] - }, - "pids": { - "limit": 32771 - }, - "hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 9223372036854772000 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } - ], - "oomScoreAdj": 100, - "memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false, - "useHierarchy": false - }, - "cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" - }, - "devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } - ], - "blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] - } - }, - "rootfsPropagation": "slave", - "seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "network" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } - ], - "maskedPaths": [ - "/proc/kcore", - "/proc/latency_stats", - "/proc/timer_stats", - "/proc/sched_debug" - ], - "readonlyPaths": [ - "/proc/asound", - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger" - ], - "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" - }, - "annotations": { - "com.example.key1": "value1", - "com.example.key2": "value2" - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json deleted file mode 100644 index 8e93528..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json +++ /dev/null @@ -1 +0,0 @@ -{] diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json b/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json deleted file mode 100644 index a49faee..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ociVersion": "0.2.0", - "id": "oci-container1", - "status": "running", - "pid": 4422, - "bundle": "/containers/redis", - "annotations": { - "myKey": "myValue" - } -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go b/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go deleted file mode 100644 index 847d205..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/schema/validate.go +++ /dev/null @@ -1,100 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/xeipuuv/gojsonschema" -) - -const usage = `Validate is used to check document with specified schema. -You can use validate in following ways: - - 1.specify document file as an argument - validate - - 2.pass document content through a pipe - cat | validate - - 3.input document content manually, ended with ctrl+d(or your self-defined EOF keys) - validate - [INPUT DOCUMENT CONTENT HERE] -` - -func main() { - nargs := len(os.Args[1:]) - if nargs == 0 || nargs > 2 { - fmt.Printf("ERROR: invalid arguments number\n\n%s\n", usage) - os.Exit(1) - } - - if os.Args[1] == "help" || - os.Args[1] == "--help" || - os.Args[1] == "-h" { - fmt.Printf("%s\n", usage) - os.Exit(1) - } - - schemaPath := os.Args[1] - if !strings.Contains(schemaPath, "://") { - var err error - schemaPath, err = formatFilePath(schemaPath) - if err != nil { - fmt.Printf("ERROR: invalid schema-file path: %s\n", err) - os.Exit(1) - } - schemaPath = "file://" + schemaPath - } - - schemaLoader := gojsonschema.NewReferenceLoader(schemaPath) - - var documentLoader gojsonschema.JSONLoader - - if nargs > 1 { - documentPath, err := formatFilePath(os.Args[2]) - if err != nil { - fmt.Printf("ERROR: invalid document-file path: %s\n", err) - os.Exit(1) - } - documentLoader = gojsonschema.NewReferenceLoader("file://" + documentPath) - } else { - documentBytes, err := ioutil.ReadAll(os.Stdin) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - documentString := string(documentBytes) - documentLoader = gojsonschema.NewStringLoader(documentString) - } - - result, err := gojsonschema.Validate(schemaLoader, documentLoader) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - if result.Valid() { - fmt.Printf("The document is valid\n") - } else { - fmt.Printf("The document is not valid. see errors :\n") - for _, desc := range result.Errors() { - fmt.Printf("- %s\n", desc) - } - os.Exit(1) - } -} - -func formatFilePath(path string) (string, error) { - if _, err := os.Stat(path); err != nil { - return "", err - } - - absPath, err := filepath.Abs(path) - if err != nil { - return "", err - } - return absPath, nil -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/spec.md b/hook/vendor/github.com/opencontainers/runtime-spec/spec.md deleted file mode 100644 index 684713a..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/spec.md +++ /dev/null @@ -1,48 +0,0 @@ -# Open Container Initiative Runtime Specification - -The [Open Container Initiative][oci] develops specifications for standards on Operating System process and application containers. - -# Abstract - -The Open Container Initiative Runtime Specification aims to specify the configuration, execution environment, and lifecycle of a container. - -A container's configuration is specified as the `config.json` for the supported platforms and details the fields that enable the creation of a container. -The execution environment is specified to ensure that applications running inside a container have a consistent environment between runtimes along with common actions defined for the container's lifecycle. - -# Platforms - -Platforms defined by this specification are: - -* `linux`: [runtime.md](runtime.md), [config.md](config.md), [config-linux.md](config-linux.md), and [runtime-linux.md](runtime-linux.md). -* `solaris`: [runtime.md](runtime.md), [config.md](config.md), and [config-solaris.md](config-solaris.md). -* `windows`: [runtime.md](runtime.md), [config.md](config.md), and [config-windows.md](config-windows.md). -* `vm`: [runtime.md](runtime.md), [config.md](config.md), and [config-vm.md](config-vm.md). - -# Table of Contents - -- [Introduction](spec.md) - - [Notational Conventions](#notational-conventions) - - [Container Principles](principles.md) -- [Filesystem Bundle](bundle.md) -- [Runtime and Lifecycle](runtime.md) - - [Linux-specific Runtime and Lifecycle](runtime-linux.md) -- [Configuration](config.md) - - [Linux-specific Configuration](config-linux.md) - - [Solaris-specific Configuration](config-solaris.md) - - [Windows-specific Configuration](config-windows.md) - - [Virtual-Machine-specific Configuration](config-vm.md) -- [Glossary](glossary.md) - -# Notational Conventions - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC 2119][rfc2119]. - -The key words "unspecified", "undefined", and "implementation-defined" are to be interpreted as described in the [rationale for the C99 standard][c99-unspecified]. - -An implementation is not compliant for a given CPU architecture if it fails to satisfy one or more of the MUST, REQUIRED, or SHALL requirements for the [platforms](#platforms) it implements. -An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the [platforms](#platforms) it implements. - - -[c99-unspecified]: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf#page=18 -[oci]: http://www.opencontainers.org -[rfc2119]: http://tools.ietf.org/html/rfc2119 diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go deleted file mode 100644 index c7c7c3d..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ /dev/null @@ -1,689 +0,0 @@ -package specs - -import "os" - -// Spec is the base configuration for the container. -type Spec struct { - // Version of the Open Container Initiative Runtime Specification with which the bundle complies. - Version string `json:"ociVersion"` - // Process configures the container process. - Process *Process `json:"process,omitempty"` - // Root configures the container's root filesystem. - Root *Root `json:"root,omitempty"` - // Hostname configures the container's hostname. - Hostname string `json:"hostname,omitempty"` - // Mounts configures additional mounts (on top of Root). - Mounts []Mount `json:"mounts,omitempty"` - // Hooks configures callbacks for container lifecycle events. - Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"` - // Annotations contains arbitrary metadata for the container. - Annotations map[string]string `json:"annotations,omitempty"` - - // Linux is platform-specific configuration for Linux based containers. - Linux *Linux `json:"linux,omitempty" platform:"linux"` - // Solaris is platform-specific configuration for Solaris based containers. - Solaris *Solaris `json:"solaris,omitempty" platform:"solaris"` - // Windows is platform-specific configuration for Windows based containers. - Windows *Windows `json:"windows,omitempty" platform:"windows"` - // VM specifies configuration for virtual-machine-based containers. - VM *VM `json:"vm,omitempty" platform:"vm"` -} - -// Process contains information to start a specific application inside the container. -type Process struct { - // Terminal creates an interactive terminal for the container. - Terminal bool `json:"terminal,omitempty"` - // ConsoleSize specifies the size of the console. - ConsoleSize *Box `json:"consoleSize,omitempty"` - // User specifies user information for the process. - User User `json:"user"` - // Args specifies the binary and arguments for the application to execute. - Args []string `json:"args,omitempty"` - // CommandLine specifies the full command line for the application to execute on Windows. - CommandLine string `json:"commandLine,omitempty" platform:"windows"` - // Env populates the process environment for the process. - Env []string `json:"env,omitempty"` - // Cwd is the current working directory for the process and must be - // relative to the container's root. - Cwd string `json:"cwd"` - // Capabilities are Linux capabilities that are kept for the process. - Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"` - // Rlimits specifies rlimit options to apply to the process. - Rlimits []POSIXRlimit `json:"rlimits,omitempty" platform:"linux,solaris"` - // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. - NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"` - // ApparmorProfile specifies the apparmor profile for the container. - ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` - // Specify an oom_score_adj for the container. - OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"` - // SelinuxLabel specifies the selinux context that the container process is run as. - SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` -} - -// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. -// http://man7.org/linux/man-pages/man7/capabilities.7.html -type LinuxCapabilities struct { - // Bounding is the set of capabilities checked by the kernel. - Bounding []string `json:"bounding,omitempty" platform:"linux"` - // Effective is the set of capabilities checked by the kernel. - Effective []string `json:"effective,omitempty" platform:"linux"` - // Inheritable is the capabilities preserved across execve. - Inheritable []string `json:"inheritable,omitempty" platform:"linux"` - // Permitted is the limiting superset for effective capabilities. - Permitted []string `json:"permitted,omitempty" platform:"linux"` - // Ambient is the ambient set of capabilities that are kept. - Ambient []string `json:"ambient,omitempty" platform:"linux"` -} - -// Box specifies dimensions of a rectangle. Used for specifying the size of a console. -type Box struct { - // Height is the vertical dimension of a box. - Height uint `json:"height"` - // Width is the horizontal dimension of a box. - Width uint `json:"width"` -} - -// User specifies specific user (and group) information for the container process. -type User struct { - // UID is the user id. - UID uint32 `json:"uid" platform:"linux,solaris"` - // GID is the group id. - GID uint32 `json:"gid" platform:"linux,solaris"` - // Umask is the umask for the init process. - Umask uint32 `json:"umask,omitempty" platform:"linux,solaris"` - // AdditionalGids are additional group ids set for the container's process. - AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` - // Username is the user name. - Username string `json:"username,omitempty" platform:"windows"` -} - -// Root contains information about the container's root filesystem on the host. -type Root struct { - // Path is the absolute path to the container's root filesystem. - Path string `json:"path"` - // Readonly makes the root filesystem for the container readonly before the process is executed. - Readonly bool `json:"readonly,omitempty"` -} - -// Mount specifies a mount for a container. -type Mount struct { - // Destination is the absolute path where the mount will be placed in the container. - Destination string `json:"destination"` - // Type specifies the mount kind. - Type string `json:"type,omitempty" platform:"linux,solaris"` - // Source specifies the source path of the mount. - Source string `json:"source,omitempty"` - // Options are fstab style mount options. - Options []string `json:"options,omitempty"` -} - -// Hook specifies a command that is run at a particular event in the lifecycle of a container -type Hook struct { - Path string `json:"path"` - Args []string `json:"args,omitempty"` - Env []string `json:"env,omitempty"` - Timeout *int `json:"timeout,omitempty"` -} - -// Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container -// Hooks for container setup and teardown -type Hooks struct { - // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed. - // It is called in the Runtime Namespace - Prestart []Hook `json:"prestart,omitempty"` - // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called - // It is called in the Runtime Namespace - CreateRuntime []Hook `json:"createRuntime,omitempty"` - // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called - // It is called in the Container Namespace - CreateContainer []Hook `json:"createContainer,omitempty"` - // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started - // It is called in the Container Namespace - StartContainer []Hook `json:"startContainer,omitempty"` - // Poststart is a list of hooks to be run after the container process is started. - // It is called in the Runtime Namespace - Poststart []Hook `json:"poststart,omitempty"` - // Poststop is a list of hooks to be run after the container process exits. - // It is called in the Runtime Namespace - Poststop []Hook `json:"poststop,omitempty"` -} - -// Linux contains platform-specific configuration for Linux based containers. -type Linux struct { - // UIDMapping specifies user mappings for supporting user namespaces. - UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"` - // GIDMapping specifies group mappings for supporting user namespaces. - GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"` - // Sysctl are a set of key value pairs that are set for the container on start - Sysctl map[string]string `json:"sysctl,omitempty"` - // Resources contain cgroup information for handling resource constraints - // for the container - Resources *LinuxResources `json:"resources,omitempty"` - // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. - // The path is expected to be relative to the cgroups mountpoint. - // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. - CgroupsPath string `json:"cgroupsPath,omitempty"` - // Namespaces contains the namespaces that are created and/or joined by the container - Namespaces []LinuxNamespace `json:"namespaces,omitempty"` - // Devices are a list of device nodes that are created for the container - Devices []LinuxDevice `json:"devices,omitempty"` - // Seccomp specifies the seccomp security settings for the container. - Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` - // RootfsPropagation is the rootfs mount propagation mode for the container. - RootfsPropagation string `json:"rootfsPropagation,omitempty"` - // MaskedPaths masks over the provided paths inside the container. - MaskedPaths []string `json:"maskedPaths,omitempty"` - // ReadonlyPaths sets the provided paths as RO inside the container. - ReadonlyPaths []string `json:"readonlyPaths,omitempty"` - // MountLabel specifies the selinux context for the mounts in the container. - MountLabel string `json:"mountLabel,omitempty"` - // IntelRdt contains Intel Resource Director Technology (RDT) information for - // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container - IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` - // Personality contains configuration for the Linux personality syscall - Personality *LinuxPersonality `json:"personality,omitempty"` -} - -// LinuxNamespace is the configuration for a Linux namespace -type LinuxNamespace struct { - // Type is the type of namespace - Type LinuxNamespaceType `json:"type"` - // Path is a path to an existing namespace persisted on disk that can be joined - // and is of the same type - Path string `json:"path,omitempty"` -} - -// LinuxNamespaceType is one of the Linux namespaces -type LinuxNamespaceType string - -const ( - // PIDNamespace for isolating process IDs - PIDNamespace LinuxNamespaceType = "pid" - // NetworkNamespace for isolating network devices, stacks, ports, etc - NetworkNamespace LinuxNamespaceType = "network" - // MountNamespace for isolating mount points - MountNamespace LinuxNamespaceType = "mount" - // IPCNamespace for isolating System V IPC, POSIX message queues - IPCNamespace LinuxNamespaceType = "ipc" - // UTSNamespace for isolating hostname and NIS domain name - UTSNamespace LinuxNamespaceType = "uts" - // UserNamespace for isolating user and group IDs - UserNamespace LinuxNamespaceType = "user" - // CgroupNamespace for isolating cgroup hierarchies - CgroupNamespace LinuxNamespaceType = "cgroup" -) - -// LinuxIDMapping specifies UID/GID mappings -type LinuxIDMapping struct { - // ContainerID is the starting UID/GID in the container - ContainerID uint32 `json:"containerID"` - // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' - HostID uint32 `json:"hostID"` - // Size is the number of IDs to be mapped - Size uint32 `json:"size"` -} - -// POSIXRlimit type and restrictions -type POSIXRlimit struct { - // Type of the rlimit to set - Type string `json:"type"` - // Hard is the hard limit for the specified type - Hard uint64 `json:"hard"` - // Soft is the soft limit for the specified type - Soft uint64 `json:"soft"` -} - -// LinuxHugepageLimit structure corresponds to limiting kernel hugepages -type LinuxHugepageLimit struct { - // Pagesize is the hugepage size - // Format: "B' (e.g. 64KB, 2MB, 1GB, etc.) - Pagesize string `json:"pageSize"` - // Limit is the limit of "hugepagesize" hugetlb usage - Limit uint64 `json:"limit"` -} - -// LinuxInterfacePriority for network interfaces -type LinuxInterfacePriority struct { - // Name is the name of the network interface - Name string `json:"name"` - // Priority for the interface - Priority uint32 `json:"priority"` -} - -// linuxBlockIODevice holds major:minor format supported in blkio cgroup -type linuxBlockIODevice struct { - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` -} - -// LinuxWeightDevice struct holds a `major:minor weight` pair for weightDevice -type LinuxWeightDevice struct { - linuxBlockIODevice - // Weight is the bandwidth rate for the device. - Weight *uint16 `json:"weight,omitempty"` - // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` -} - -// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair -type LinuxThrottleDevice struct { - linuxBlockIODevice - // Rate is the IO rate limit per cgroup per device - Rate uint64 `json:"rate"` -} - -// LinuxBlockIO for Linux cgroup 'blkio' resource management -type LinuxBlockIO struct { - // Specifies per cgroup weight - Weight *uint16 `json:"weight,omitempty"` - // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` - // Weight per cgroup per device, can override BlkioWeight - WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` - // IO read rate limit per cgroup per device, bytes per second - ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` - // IO write rate limit per cgroup per device, bytes per second - ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` - // IO read rate limit per cgroup per device, IO per second - ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` - // IO write rate limit per cgroup per device, IO per second - ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` -} - -// LinuxMemory for Linux cgroup 'memory' resource management -type LinuxMemory struct { - // Memory limit (in bytes). - Limit *int64 `json:"limit,omitempty"` - // Memory reservation or soft_limit (in bytes). - Reservation *int64 `json:"reservation,omitempty"` - // Total memory limit (memory + swap). - Swap *int64 `json:"swap,omitempty"` - // Kernel memory limit (in bytes). - Kernel *int64 `json:"kernel,omitempty"` - // Kernel memory limit for tcp (in bytes) - KernelTCP *int64 `json:"kernelTCP,omitempty"` - // How aggressive the kernel will swap memory pages. - Swappiness *uint64 `json:"swappiness,omitempty"` - // DisableOOMKiller disables the OOM killer for out of memory conditions - DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` - // Enables hierarchical memory accounting - UseHierarchy *bool `json:"useHierarchy,omitempty"` -} - -// LinuxCPU for Linux cgroup 'cpu' resource management -type LinuxCPU struct { - // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). - Shares *uint64 `json:"shares,omitempty"` - // CPU hardcap limit (in usecs). Allowed cpu time in a given period. - Quota *int64 `json:"quota,omitempty"` - // CPU period to be used for hardcapping (in usecs). - Period *uint64 `json:"period,omitempty"` - // How much time realtime scheduling may use (in usecs). - RealtimeRuntime *int64 `json:"realtimeRuntime,omitempty"` - // CPU period to be used for realtime scheduling (in usecs). - RealtimePeriod *uint64 `json:"realtimePeriod,omitempty"` - // CPUs to use within the cpuset. Default is to use any CPU available. - Cpus string `json:"cpus,omitempty"` - // List of memory nodes in the cpuset. Default is to use any available memory node. - Mems string `json:"mems,omitempty"` -} - -// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) -type LinuxPids struct { - // Maximum number of PIDs. Default is "no limit". - Limit int64 `json:"limit"` -} - -// LinuxNetwork identification and priority configuration -type LinuxNetwork struct { - // Set class identifier for container's network packets - ClassID *uint32 `json:"classID,omitempty"` - // Set priority of network traffic for container - Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` -} - -// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) -type LinuxRdma struct { - // Maximum number of HCA handles that can be opened. Default is "no limit". - HcaHandles *uint32 `json:"hcaHandles,omitempty"` - // Maximum number of HCA objects that can be created. Default is "no limit". - HcaObjects *uint32 `json:"hcaObjects,omitempty"` -} - -// LinuxResources has container runtime resource constraints -type LinuxResources struct { - // Devices configures the device whitelist. - Devices []LinuxDeviceCgroup `json:"devices,omitempty"` - // Memory restriction configuration - Memory *LinuxMemory `json:"memory,omitempty"` - // CPU resource restriction configuration - CPU *LinuxCPU `json:"cpu,omitempty"` - // Task resource restriction configuration. - Pids *LinuxPids `json:"pids,omitempty"` - // BlockIO restriction configuration - BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` - // Hugetlb limit (in bytes) - HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` - // Network restriction configuration - Network *LinuxNetwork `json:"network,omitempty"` - // Rdma resource restriction configuration. - // Limits are a set of key value pairs that define RDMA resource limits, - // where the key is device name and value is resource limits. - Rdma map[string]LinuxRdma `json:"rdma,omitempty"` -} - -// LinuxDevice represents the mknod information for a Linux special device file -type LinuxDevice struct { - // Path to the device. - Path string `json:"path"` - // Device type, block, char, etc. - Type string `json:"type"` - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` - // FileMode permission bits for the device. - FileMode *os.FileMode `json:"fileMode,omitempty"` - // UID of the device. - UID *uint32 `json:"uid,omitempty"` - // Gid of the device. - GID *uint32 `json:"gid,omitempty"` -} - -// LinuxDeviceCgroup represents a device rule for the whitelist controller -type LinuxDeviceCgroup struct { - // Allow or deny - Allow bool `json:"allow"` - // Device type, block, char, etc. - Type string `json:"type,omitempty"` - // Major is the device's major number. - Major *int64 `json:"major,omitempty"` - // Minor is the device's minor number. - Minor *int64 `json:"minor,omitempty"` - // Cgroup access permissions format, rwm. - Access string `json:"access,omitempty"` -} - -// LinuxPersonalityDomain refers to a personality domain. -type LinuxPersonalityDomain string - -// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined. -type LinuxPersonalityFlag string - -// Define domain and flags for Personality -const ( - // PerLinux is the standard Linux personality - PerLinux LinuxPersonalityDomain = "LINUX" - // PerLinux32 sets personality to 32 bit - PerLinux32 LinuxPersonalityDomain = "LINUX32" -) - -// LinuxPersonality represents the Linux personality syscall input -type LinuxPersonality struct { - // Domain for the personality - Domain LinuxPersonalityDomain `json:"domain"` - // Additional flags - Flags []LinuxPersonalityFlag `json:"flags,omitempty"` -} - -// Solaris contains platform-specific configuration for Solaris application containers. -type Solaris struct { - // SMF FMRI which should go "online" before we start the container process. - Milestone string `json:"milestone,omitempty"` - // Maximum set of privileges any process in this container can obtain. - LimitPriv string `json:"limitpriv,omitempty"` - // The maximum amount of shared memory allowed for this container. - MaxShmMemory string `json:"maxShmMemory,omitempty"` - // Specification for automatic creation of network resources for this container. - Anet []SolarisAnet `json:"anet,omitempty"` - // Set limit on the amount of CPU time that can be used by container. - CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"` - // The physical and swap caps on the memory that can be used by this container. - CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"` -} - -// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container. -type SolarisCappedCPU struct { - Ncpus string `json:"ncpus,omitempty"` -} - -// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container. -type SolarisCappedMemory struct { - Physical string `json:"physical,omitempty"` - Swap string `json:"swap,omitempty"` -} - -// SolarisAnet provides the specification for automatic creation of network resources for this container. -type SolarisAnet struct { - // Specify a name for the automatically created VNIC datalink. - Linkname string `json:"linkname,omitempty"` - // Specify the link over which the VNIC will be created. - Lowerlink string `json:"lowerLink,omitempty"` - // The set of IP addresses that the container can use. - Allowedaddr string `json:"allowedAddress,omitempty"` - // Specifies whether allowedAddress limitation is to be applied to the VNIC. - Configallowedaddr string `json:"configureAllowedAddress,omitempty"` - // The value of the optional default router. - Defrouter string `json:"defrouter,omitempty"` - // Enable one or more types of link protection. - Linkprotection string `json:"linkProtection,omitempty"` - // Set the VNIC's macAddress - Macaddress string `json:"macAddress,omitempty"` -} - -// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. -type Windows struct { - // LayerFolders contains a list of absolute paths to directories containing image layers. - LayerFolders []string `json:"layerFolders"` - // Devices are the list of devices to be mapped into the container. - Devices []WindowsDevice `json:"devices,omitempty"` - // Resources contains information for handling resource constraints for the container. - Resources *WindowsResources `json:"resources,omitempty"` - // CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification. - CredentialSpec interface{} `json:"credentialSpec,omitempty"` - // Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation. - Servicing bool `json:"servicing,omitempty"` - // IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process. - IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` - // HyperV contains information for running a container with Hyper-V isolation. - HyperV *WindowsHyperV `json:"hyperv,omitempty"` - // Network restriction configuration. - Network *WindowsNetwork `json:"network,omitempty"` -} - -// WindowsDevice represents information about a host device to be mapped into the container. -type WindowsDevice struct { - // Device identifier: interface class GUID, etc. - ID string `json:"id"` - // Device identifier type: "class", etc. - IDType string `json:"idType"` -} - -// WindowsResources has container runtime resource constraints for containers running on Windows. -type WindowsResources struct { - // Memory restriction configuration. - Memory *WindowsMemoryResources `json:"memory,omitempty"` - // CPU resource restriction configuration. - CPU *WindowsCPUResources `json:"cpu,omitempty"` - // Storage restriction configuration. - Storage *WindowsStorageResources `json:"storage,omitempty"` -} - -// WindowsMemoryResources contains memory resource management settings. -type WindowsMemoryResources struct { - // Memory limit in bytes. - Limit *uint64 `json:"limit,omitempty"` -} - -// WindowsCPUResources contains CPU resource management settings. -type WindowsCPUResources struct { - // Number of CPUs available to the container. - Count *uint64 `json:"count,omitempty"` - // CPU shares (relative weight to other containers with cpu shares). - Shares *uint16 `json:"shares,omitempty"` - // Specifies the portion of processor cycles that this container can use as a percentage times 100. - Maximum *uint16 `json:"maximum,omitempty"` -} - -// WindowsStorageResources contains storage resource management settings. -type WindowsStorageResources struct { - // Specifies maximum Iops for the system drive. - Iops *uint64 `json:"iops,omitempty"` - // Specifies maximum bytes per second for the system drive. - Bps *uint64 `json:"bps,omitempty"` - // Sandbox size specifies the minimum size of the system drive in bytes. - SandboxSize *uint64 `json:"sandboxSize,omitempty"` -} - -// WindowsNetwork contains network settings for Windows containers. -type WindowsNetwork struct { - // List of HNS endpoints that the container should connect to. - EndpointList []string `json:"endpointList,omitempty"` - // Specifies if unqualified DNS name resolution is allowed. - AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` - // Comma separated list of DNS suffixes to use for name resolution. - DNSSearchList []string `json:"DNSSearchList,omitempty"` - // Name (ID) of the container that we will share with the network stack. - NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` - // name (ID) of the network namespace that will be used for the container. - NetworkNamespace string `json:"networkNamespace,omitempty"` -} - -// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. -type WindowsHyperV struct { - // UtilityVMPath is an optional path to the image used for the Utility VM. - UtilityVMPath string `json:"utilityVMPath,omitempty"` -} - -// VM contains information for virtual-machine-based containers. -type VM struct { - // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers. - Hypervisor VMHypervisor `json:"hypervisor,omitempty"` - // Kernel specifies kernel-related configuration for virtual-machine-based containers. - Kernel VMKernel `json:"kernel"` - // Image specifies guest image related configuration for virtual-machine-based containers. - Image VMImage `json:"image,omitempty"` -} - -// VMHypervisor contains information about the hypervisor to use for a virtual machine. -type VMHypervisor struct { - // Path is the host path to the hypervisor used to manage the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the hypervisor. - Parameters []string `json:"parameters,omitempty"` -} - -// VMKernel contains information about the kernel to use for a virtual machine. -type VMKernel struct { - // Path is the host path to the kernel used to boot the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the kernel. - Parameters []string `json:"parameters,omitempty"` - // InitRD is the host path to an initial ramdisk to be used by the kernel. - InitRD string `json:"initrd,omitempty"` -} - -// VMImage contains information about the virtual machine root image. -type VMImage struct { - // Path is the host path to the root image that the VM kernel would boot into. - Path string `json:"path"` - // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc). - Format string `json:"format"` -} - -// LinuxSeccomp represents syscall restrictions -type LinuxSeccomp struct { - DefaultAction LinuxSeccompAction `json:"defaultAction"` - Architectures []Arch `json:"architectures,omitempty"` - Flags []LinuxSeccompFlag `json:"flags,omitempty"` - Syscalls []LinuxSyscall `json:"syscalls,omitempty"` -} - -// Arch used for additional architectures -type Arch string - -// LinuxSeccompFlag is a flag to pass to seccomp(2). -type LinuxSeccompFlag string - -// Additional architectures permitted to be used for system calls -// By default only the native architecture of the kernel is permitted -const ( - ArchX86 Arch = "SCMP_ARCH_X86" - ArchX86_64 Arch = "SCMP_ARCH_X86_64" - ArchX32 Arch = "SCMP_ARCH_X32" - ArchARM Arch = "SCMP_ARCH_ARM" - ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" - ArchMIPS Arch = "SCMP_ARCH_MIPS" - ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" - ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" - ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" - ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" - ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" - ArchPPC Arch = "SCMP_ARCH_PPC" - ArchPPC64 Arch = "SCMP_ARCH_PPC64" - ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" - ArchS390 Arch = "SCMP_ARCH_S390" - ArchS390X Arch = "SCMP_ARCH_S390X" - ArchPARISC Arch = "SCMP_ARCH_PARISC" - ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" -) - -// LinuxSeccompAction taken upon Seccomp rule match -type LinuxSeccompAction string - -// Define actions for Seccomp rules -const ( - ActKill LinuxSeccompAction = "SCMP_ACT_KILL" - ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" - ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" - ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" - ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" - ActLog LinuxSeccompAction = "SCMP_ACT_LOG" -) - -// LinuxSeccompOperator used to match syscall arguments in Seccomp -type LinuxSeccompOperator string - -// Define operators for syscall arguments in Seccomp -const ( - OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE" - OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT" - OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE" - OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ" - OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE" - OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT" - OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ" -) - -// LinuxSeccompArg used for matching specific syscall arguments in Seccomp -type LinuxSeccompArg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"valueTwo,omitempty"` - Op LinuxSeccompOperator `json:"op"` -} - -// LinuxSyscall is used to match a syscall in Seccomp -type LinuxSyscall struct { - Names []string `json:"names"` - Action LinuxSeccompAction `json:"action"` - Args []LinuxSeccompArg `json:"args,omitempty"` -} - -// LinuxIntelRdt has container runtime resource constraints for Intel RDT -// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel -type LinuxIntelRdt struct { - // The identity for RDT Class of Service - ClosID string `json:"closID,omitempty"` - // The schema for L3 cache id and capacity bitmask (CBM) - // Format: "L3:=;=;..." - L3CacheSchema string `json:"l3CacheSchema,omitempty"` - - // The schema of memory bandwidth per L3 cache id - // Format: "MB:=bandwidth0;=bandwidth1;..." - // The unit of memory bandwidth is specified in "percentages" by - // default, and in "MBps" if MBA Software Controller is enabled. - MemBwSchema string `json:"memBwSchema,omitempty"` -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go deleted file mode 100644 index 89dce34..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go +++ /dev/null @@ -1,17 +0,0 @@ -package specs - -// State holds information about the runtime state of the container. -type State struct { - // Version is the version of the specification that is supported. - Version string `json:"ociVersion"` - // ID is the container ID - ID string `json:"id"` - // Status is the runtime status of the container. - Status string `json:"status"` - // Pid is the process ID for the container process. - Pid int `json:"pid,omitempty"` - // Bundle is the path to the container's bundle directory. - Bundle string `json:"bundle"` - // Annotations are key values associated with the container. - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go b/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go deleted file mode 100644 index bda7e1c..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go +++ /dev/null @@ -1,18 +0,0 @@ -package specs - -import "fmt" - -const ( - // VersionMajor is for an API incompatible changes - VersionMajor = 1 - // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 0 - // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 2 - - // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "" -) - -// Version is the specification version that the package types support. -var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/hook/vendor/github.com/opencontainers/runtime-spec/style.md b/hook/vendor/github.com/opencontainers/runtime-spec/style.md deleted file mode 100644 index 1d42043..0000000 --- a/hook/vendor/github.com/opencontainers/runtime-spec/style.md +++ /dev/null @@ -1,131 +0,0 @@ -# Style and conventions - -## One sentence per line - -To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line. -This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length. -For example, this paragraph will span three lines in the Markdown source. - -## Traditionally hex settings should use JSON integers, not JSON strings - -For example, [`"classID": 1048577`](config-linux.md#network) instead of `"classID": "0x100001"`. -The config JSON isn't enough of a UI to be worth jumping through string <-> integer hoops to support an 0x… form ([source][integer-over-hex]). - -## Constant names should keep redundant prefixes - -For example, `CAP_KILL` instead of `KILL` in [**`process.capabilities`**](config.md#process). -The redundancy reduction from removing the namespacing prefix is not useful enough to be worth trimming the upstream identifier ([source][keep-prefix]). - -## Optional settings should not have pointer Go types - -Because in many cases the Go default for the type is a no-op in the spec (sources [here][no-pointer-for-strings], [here][no-pointer-for-slices], and [here][no-pointer-for-boolean]). -The exceptions are entries where we need to distinguish between “not set” and “set to the Go default for that type” ([source][pointer-when-updates-require-changes]), and this decision should be made on a per-setting case. - -## Links - -Internal links should be [relative links][markdown-relative-links] when linking to content within the repository. -Internal links should be used inline. - -External links should be collected at the bottom of a markdown file and used as referenced links. -See 'Referenced Links' in this [markdown quick reference][markdown-quick-reference]. -The use of referenced links in the markdown body helps to keep files clean and organized. -This also facilitates updates of external link targets on a per-file basis. - -Referenced links should be kept in two alphabetically sorted sets, a general reference section followed by a man page section. -To keep Pandoc happy, duplicate naming of links within pages listed in the Makefile's `DOC_FILES` variable should be avoided by appending an `_N` to the link tagname, where `N` is some number not currently in use. -The organization and style of an existing reference section should be maintained unless it violates these style guidelines. - -An exception to these rules is when a URL is needed contextually, for example when showing an explicit link to the reader. - -## Examples - -### Anchoring - -For any given section that provides a notable example, it is ideal to have it denoted with [markdown headers][markdown-headers]. -The level of header should be such that it is a subheader of the header it is an example of. - -#### Example - -```markdown -## Some Topic - -### Some Subheader - -#### Further Subheader - -##### Example - -To use Further Subheader, ... - -### Example - -To use Some Topic, ... - -``` - -### Content - -Where necessary, the values in the example can be empty or unset, but accommodate with comments regarding this intention. - -Where feasible, the content and values used in an example should convey the fullest use of the data structures concerned. -Most commonly onlookers will intend to copy-and-paste a "working example". -If the intention of the example is to be a fully utilized example, rather than a copy-and-paste example, perhaps add a comment as such. - -```markdown -### Example -``` -```json -{ - "foo": null, - "bar": "" -} -``` - -**vs.** - -```markdown -### Example - -Following is a fully populated example (not necessarily for copy/paste use) -``` -```json -{ - "foo": [ - 1, - 2, - 3 - ], - "bar": "waffles", - "bif": { - "baz": "potatoes" - } -} -``` - -### Links - -The following is an example of different types of links. -This is shown as a complete markdown file, where the referenced links are at the bottom. - -```markdown -The specification repository's [glossary](glossary.md) is where readers can find definitions of commonly used terms. - -Readers may click through to the [Open Containers namespace][open-containers] on [GitHub][github]. - -The URL for the Open Containers link above is: https://github.com/opencontainers - - -[github]: https://github.com -[open-containers]: https://github.com/opencontainers -``` - - -[integer-over-hex]: https://github.com/opencontainers/runtime-spec/pull/267#r48360013 -[keep-prefix]: https://github.com/opencontainers/runtime-spec/pull/159#issuecomment-138728337 -[no-pointer-for-boolean]: https://github.com/opencontainers/runtime-spec/pull/290#r50296396 -[no-pointer-for-slices]: https://github.com/opencontainers/runtime-spec/pull/316#r50782982 -[no-pointer-for-strings]: https://github.com/opencontainers/runtime-spec/pull/653#issue-200439192 -[pointer-when-updates-require-changes]: https://github.com/opencontainers/runtime-spec/pull/317#r50932706 -[markdown-headers]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#headings -[markdown-quick-reference]: https://en.support.wordpress.com/markdown-quick-reference -[markdown-relative-links]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#relative-links diff --git a/runtime/go.mod b/runtime/go.mod new file mode 100644 index 0000000..b2bb8e2 --- /dev/null +++ b/runtime/go.mod @@ -0,0 +1,8 @@ +module main + +go 1.16 + +require ( + github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/prashantv/gostub v1.1.0 +) diff --git a/runtime/go.sum b/runtime/go.sum new file mode 100644 index 0000000..f87c1c7 --- /dev/null +++ b/runtime/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 h1:9mv9SC7GWmRWE0J/+oD8w3GsN2KYGKtg6uwLN7hfP5E= +github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes deleted file mode 100644 index 558b67f..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# https://tools.ietf.org/html/rfc5545#section-3.1 -*.ics text eol=crlf diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore b/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore deleted file mode 100644 index f9663c9..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -output -schema/validate -version.md diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap b/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap deleted file mode 100644 index 346194c..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.mailmap +++ /dev/null @@ -1,21 +0,0 @@ -Aleksa Sarai -Alexander Morozov -Amit Saha -Antonio Murdaca -Brandon Philips -Brandon Philips -ChengTiesheng -Daniel, Dao Quang Minh -Doug Davis -James O. D. Hunt -John Howard -LinZhinan(Zen Lin) -Mrunal Patel -Mrunal Patel -Mrunal Patel -Vincent Batts -Vincent Batts -Vishnu Kannan -Vishnu Kannan -Zefan Li -梁辰晔 (Liang Chenye) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml b/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml deleted file mode 100644 index ce688e2..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.pullapprove.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 - -requirements: - signed_off_by: - required: false - -group_defaults: - required: 2 - approve_by_comment: - enabled: true - approve_regex: ^LGTM - reject_regex: ^Rejected - reset_on_push: - enabled: true - author_approval: - ignored: true - always_pending: - title_regex: ^WIP - explanation: 'Work in progress...' - conditions: - branches: - - master - -groups: - runtime-spec: - teams: - - runtime-spec-maintainers diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go b/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go deleted file mode 100644 index f36bfe4..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.tool/version-doc.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build ignore - -package main - -import ( - "fmt" - "html/template" - "os" - - "github.com/opencontainers/runtime-spec/specs-go" -) - -var markdownTemplateString = ` - -**Specification Version:** *{{.}}* - -` - -var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString)) - -func main() { - if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil { - fmt.Fprintln(os.Stderr, err) - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml b/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml deleted file mode 100644 index 82e03a2..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go -go: - - "1.11.x" - - "1.10.x" - - "1.9.x" - -sudo: required - -services: - - docker - -before_install: - - make install.tools - - docker pull vbatts/pandoc - - go get -d ./schema/... - -install: true - -script: - - env | grep TRAVIS_ - - make .govet - - make .golint - - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" - - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation - - make docs - - make -C schema test diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog b/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog deleted file mode 100644 index e257f80..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/ChangeLog +++ /dev/null @@ -1,748 +0,0 @@ -OpenContainers Specifications - -Changes with v1.0.2: - - Additions: - - * Add create-container, create-runtime and start-container hooks (#1008) - * config-linux: add Intel RDT CLOS name sharing support (#988) - * config-linux: Add Intel RDT/MBA Linux support (#932) - * config-linux: Add Memory cgroup's use_hierarchy (#985) - * Add Linux personality support (#1012) - * config: Add Windows Devices to Schema (#976) - * Add support for SCMP_ACT_LOG (#1019) - * config-linux: support seccomp flags (#1018) - - Minor fixes and documentation: - - * Makefile: avoid SELinux for making docs - * Clarify case with pre-configured Intel RDT closID (#1034) - * config-linux: describe more about rootfs mount propagation (#1035) - * config-linux: add SHOULD to linux.namespaces.type (#1025) - * Reduce DCO checks per PR from 3 to 1 (#1029) - * Fix typo in RELEASES.md (#1033) - * Remove some unneeded indent (#1031) - * Add documentation how to do releases (#1027) - * Removed Vishnu Kannan & Brandon Philips from maintainers (#1030 & #1028) - * schema: drop id from umask (#1024) - * implementations.md: fix repository for crun (#1017) - * Update meeting info section to point to "org" repo (#1016) - * Fix markdown escape in config-linux (#1013) - * config-linux: add more info about hugetlb page size (#1011) - * Fix ociVersion of Configuration Schema Example to support ambient capability (#1009) - * Fix Namespaces to use LinuxNamespaceType (#1007) - * change new pid namespace description (#1006) - * updating link to code of conduct in org repository (#1001) - * Update Windows LayerFolder docs (#999) - * Windows:Have native CommandLine in Process (#998) - * vm: fix parameters field (#994) - * config-linux: documentation change for Intel RDT/MBA Software Controller support (#992) - * Bump Go versions (#993) - * Support for network namespace in windows (#989) - * config: clarify source mount (#981) - * Fix camelCasing on idType to align with other Windows spec conventions (#976) - * meeting: Bump July meeting from the 4th to the 11th (#977) - * docs: Added kata-runtime to implementations (#969) - * Add gVisor to the implementations list (#970) - * .travis.yml: Get schema dependencies in before_install (#968) - * config: Clarify execution environment for hooks (#953) - * config-linux: Drop console(4) reference (#965) - * Linux devices: uid/gid relative to container (#959) - * config: Add VM-based container configuration section (#949) - * uidMappings: change order of fields for clarity (#956) - * specs-go/config: Define RDMA cgroup (#942) - * schema/Makefile: fix test (#947) - * config: Fix Linux mount options links (#952) - * glossary: Bump JSON spec to RFC 8259 (#951) - * schema: Completely drop our JSON Schema 'id' properties (#945) - * meeting: Bump January meeting from the 3rd to the 10th (#943) - * config: add "umask" field to POSIX "user" section (#941) - * schema: add allowed values for defaultAction (#940) - * config: Dedent root paragraphs, since they aren't a list entry (#936) - * fix the link to hook (#933) - * config: Collapse extensibility to a single MUST (#916) - * schema/defs-linux: change weight type to uint16 (#898) - * runtime: Clarify ociVersion as based on the state schema (#903) - -Changes with v1.0.1: - - Minor fixes and documentation: - - * spec: Expand "OCI" in spec-title reference and add "Initiative" - (#900) - * config: Simplify title to "Configuration" (#901) - * config: Fix "procfs_2" -> "proc_2" link label (#906) - * config: Fix IEEE Std 1003.1-2008 exec link markup (#913) - * config: Add a trailing period to the "cannot be mapped" rlimits - line (#915) - * config-linux: RFC 2119 MUST for absolute linux.namespaces[].path - (#925). This is technically a breaking change, because a config - with a relative namespace path would have been compliant before, - but will be non compliant with this change. However, the previous - "an absolute path to namespace file" wording was clear enough that - config authors are unlikely to be relying on relative namespace - paths in configs. - * config-linux: More specific documentation for weightDevice and - throttle* (#825) - * config-linux: Modify procfs to proc (#905) - * config-linux: Fix "psuedo" -> "pseudo" typo (#921) - * config-windows: Make maximum a uint16 (was a uint) (#891) - * runtime: Change "process in the container" -> "container - process" (#907) - * schema/config-schema: Use ArrayOfStrings in capabilities - properties. (#886) - * schema/config-linux: - s/throttleWriteIopsDevice/throttleWriteIOPSDevice/ (#899) - * schema/config-linux: add intelRdt field (#889) - * schema/config-solaris: Replaced refs with some fields - (cappedCPU.ncpus, etc.) (#892) - -Changes with v1.0.0: - - Breaking changes: - - * config: Shift disableOOMKiller from linux.resources to - linux.resources.memory (#896) - - Decreased restrictions: - - * runtime: Make the state JSON's pid optional on non-Linux platforms - (#897) - - Minor fixes and documentation: - - * schema/defs-linux: Require Syscall.action (#885) - * specs-go/config: Fix 'omiempty' -> 'omitempty' typo for - LinuxSeccompArg.ValueTwo (#884) - * ROAMAP: remove the pre-v1.0.0 roadmap (#890) - -Changes with v1.0.0-rc6: - - Breaking changes: - - * config: Shift oomScoreAdj to process and add RFC 2119 requirements - for the runtime (#781, #789, #836) - * config: Forbid 'root' on Hyper-V (#820, #838). - * config: process.capabilities and process.noNewPrivileges are - Linux-only again (#880). This partially reverses #673, which had - landed in v1.0.0-rc5. - * config: Remove process.rlimits from Windows (#880). It is now - POSIX-only, while in v1.0.0-rc5 it was cross-platform (because of - #673). Before #673 (in v1.0.0-rc4 and earlier), it was - Linux-only. - * config-linux: Drop redundant 'blkio' prefix from blockIO - properties (#860) - * config-linux: Make memory limits int64 instead of uint64 (#876). - This partially reverses #704, which had landed in v1.0.0-rc5. - * config-windows: Change CPU 'percent' to 'maximum' (#777) - * config-windows: Remove memory 'reservation' (#788) - * config-windows: Remove 'resources.network' and add 'network' (#801) - - Additions: - - * config: Windows runtimes MUST support the 'ro' mount option (#868) - * config-linux: Add Intel RDT/CAT Linux support (#630, #787) - * config-linux: Add Markdown specification for syscalls (#706) - * config-linux: Add 'unbindable' rootfsPropagation value (#770, #775) - * config-windows: Add 'credentialSpec' (#814, #859) - * config-windows: Add 'servicing' (#815) - * config-windows: Add 'ignoreFlushesDuringBoot' (#816, #859) - * config-windows: Add 'hyperv' (#818, #849, #859) - * config-windows: Add 'layerFolders' (#828) - - Removals and increased restrictions: - - * config: Remove 'platform' (#850) - * config: Require strictly-postitive 'timeout' values (#764) - * config: Strengthen punt to kernel for valid capabilities strings - (#766, #790) - * config: Require volume GUID paths for root.path (#849) - * config: Forbid setting 'readonly' true on Windows (#819) - * config: Forbid setting mount 'type' entirely on Windows and forbid - UNC paths and mapped drives in 'source' on Windows (#821) - * config: Remove 'hooks' from Windows spec (#855, #869, #870) - * config-linux: Clearly require absolute path for namespace (#720) - * config-linux: RFC 2119 tightening for namespaces (#767) - * config-linux: Require at least one entry in - linux.seccomp.syscalls[].names (#769) - * config-linux: Remove syscall.comment (#714) - * config-linux: Use MUST and MAY for weight and leafWeight (#751) - * config-linux: Remove explicit 'null' from device cgroup values - (#804) - * runtime: Remove "features the runtime chooses to support" (#732) - * runtime: Drop "not supported by the base OS" loophole (#733) - * runtime-linux: Condition /proc/self/fd symlinks on source - existence (#736) - - Decreased restrictions: - - * config: Make 'process' optional (#701, #805) - * config-linux: Make linux.seccomp.syscalls optional (#768) - * config-linux: valueTwo is now optional in - `linux.seccomp.syscalls[].args` entries (#877) - * config-linux: Remove local range restrictions for blkioWeight, - blkioLeafWeight, weight, leafWeight, and shares (#780) - * config-linux: Explicitly allow symlinks for providing devices (#873) - - Minor fixes and documentation: - - * config: Remove "MAY support any valid values" sentence (#851) - * config: Remove the previously-forbidden mounts[].type from the - Windows spec (#854) - * config: Clarify mounts[].source relative path anchor (#735) - * config: Explicitly make consoleSize ignored if terminal is false or - unset (#863) - * config: Specify height/width units (characters) for consoleSize (#761) - * config: Use "POSIX platforms" instead of "Linux and Solaris" (#838) - * config-linux: Explicit namespace for interface names (#713) - * config-linux: Explicitly list cgroupsPath as optional (#823) - * runtime: Clarify valid container states for 'start', 'kill', and - 'delete' (#875) - * runtime: Explicitly make process.* timing implementation-defined (#700) - * specs-go/config: Remove range restrictions from Windows comments (#783) - * specs-go/config: Add omitempty to LinuxSyscall.Args (#763) - * specs-go/config: Use a pointer for Process.ConsoleSize (#792) - * schema/README: Use v1.0.0 URL in examples to prepare for the 1.0.0 - release (#881) - * schema/Makefile: Make 'validate' the default target (#750) - * schema/Makefile: Add 'clean' target (#774) - * schema: Add 'test' target to the Makefile (#785) - * *: Remove unnecessary .PHONY entries (#750, #778, #802) - * *: Typo fixes and polishing (#681, #708, #702, #703, #709, #711, - #712, #721, #722, #723, #724, #730, #737, #738, #741, #744, #749, - #753, #756, #765, #773, #776, #784, #786, #793, #794, #796, #798, - #799, #800, #803, #807, #809, #811, #812, #822, #824, #826, #827, - #832, #839, #840, #846, #847, #848, #852, #856, #858, #862, #865, - #871, #874) - -Changes with v1.0.0-rc5: - - Breaking changes: - - * config: Explicitly require `platform` (#695). - * config: The platform-specific sections (`linux`, `solaris`, and - `windows`) MUST NOT be set unless they match `platform.os` (#673). - * config: `process.capabilities` is now an object instead of an - array of strings (#675). - * config-linux: No longer allow negative values for some resources, - partially reversing #648 from v1.0.0-rc4 (#704). - * config-linux: `linux.seccomp.syscalls` entries have `names` - instead of `name` (#657). - * runtime: Rename the state `bundlePath` property to `bundle` - (#674). - - Additions: - - * config: `process.capabilities` is no longer Linux-only (#673). - * config-linux: `linux.seccomp.syscalls` entries have a new - `comment` property (#657). - * config-linux: Add new architectures from libseccomp 2.3.2 (#705) - * runtime: Add a `creating` state `status` (#507, #694). - - Removals and increased restrictions: - - * runtime: Document hook timing and exit code handling (#532). - * schema/config-linux: Explicit `null` values are no longer - compliant (#662). - - Decreased restrictions: - - * config: `type` and `source` properties are now optional for - `mounts` entries (#699). - * config: `args` property is now optional for hooks (#685). - * config-linux: Runtimes no longer need to provide `/proc` and - other filesystems unless they are explicitly requested in the - configuration JSON (#666). - - Minor fixes and documentation: - - * spec: Add OCI Runtime Abstract (#691). - * config: Document the Go `platform` tag (#570). - * config-linux: Remove local uid/gid mapping limit and punt to the - kernel (#693). - * schema: Fix broken `string` and similar `$ref`s (#684). - * schema: Remove `mounts` from required properties (#696). - * schema: Remove `major` and `minor` from `linux.devices` entries - (#688). - * schema: Check for the required `type`, `hard`, and `soft` in - `process.rlimits` entries (#696). - * schema/validate: Gained usage documentation and fixed - `schemaPath` logic when the argument did not contain `://` (#552). - * *: Add anchor tags to a number of spec locations (#707). - * *: Consistent link syntax (#687). - * *: Minor cleanup and rewording (#697). - -Changes with v1.0.0-rc4: - Additions: - - * config-linux: Allow negative values for some resources (#648) - * config-linux: Lift no-tweaking namespace restriction (#649) - - Removals and increased restrictions: - - * config: Rlimit types must be unique (#607) - * config: Forbid empty-string keys in 'annotations' (#645, #654) - * config-linux: Require runtime errors for pre-existing devices - (#647) - * runtime: Only require 'pid' in the state for created/running - statuses (#664) - * schema: Add 'consoleSize' and update requirements (#646) - * schema: Remove string pointers (#656) - * schema/config-linux: Remove blockIODeviceThrottle and other - pointers (#545) - - Breaking Go changes: - - * specs-go/config: Remove string pointers (#653) - * specs-go/config: Make Spec.Hooks a pointer (#427) - * specs-go/config: Convert some resources from unsigned integers - to signed integers (#648) - - Minor fixes and documentation: - - * config: Explicitly list 'hooks' as optional and cite POSIX for - 'env' and 'args' (#427) - * runtime: Replace "process is stopped" with "process exits" - (#465) - * schema/config-linux: Add missing kernelTCP (#655) - * schema/validate: Allow schema identifiers to contain a URL - scheme (#490) - * .travis: Fix git-validation commit ranges (#216) - * *: Add anchor tags to a number of spec locations (#612, #636, - #637, #638, #639, #640) - * *: Typo fixes and polishing (#643, #650, #652, #656, #660, #665) - -Changes with v1.0.0-rc3: - Additions: - - * config: Add support for Windows-based containers (#565, #573) - * config: Add process.consoleSize (#563) - * config: Explicitly allow unknown extensions and document - annotations key conventions (#510) - * config: Define mounts entries for Solaris (#588) - - Removals and increased restrictions: - - * config: Require absolute paths for mount destinations (#609) - * config-linux: Require absolute path for maskedPaths and - readonlyPaths (#587) - * config-linux: Only require /dev/console when process.terminal is - true. Also require /dev/console to be provided by a bind mount - (#518) - * runtime: Require runtimes to generate errors when the container - specified in config.json cannot be created (#559) - - Breaking Go changes: - - * specs-go/config: Aggressive namespacing (#567) - * specs-go/config: Remove pointers from LinuxHugepageLimit, - LinuxInterfacePriority, and LinuxPids properties (#586) - * specs-go/state: Rename version to ociVersion (#633) - LinuxInterfacePriority, and LinuxPids properties (#586) - - Minor fixes and documentation: - - * spec: Separate the spec from project scaffolding (#626) - * README: Define "unspecified", "undefined", and - "implementation-defined" (#575) - * config: Clarify absolue and relative values for root.path (#558) - * config: Clarify ociVersion covering the configuration <-> - runtime API (#523) - * config-linux: Forbid duplicated namespaces with same `type` - (#597) - * glossary: Make objects explicitly unordered and forbid duplicate - names (#584) - * specs-go/config: Add platform tags to Rlimits and - NoNewPRivileges (#564) - * schema/defs-linux: Use int64 for major/minor types (#610) - * Makefile: Add support for Go 1.7 (#547) - * Makefile: Require Go >= 1.6 for golint (#589) - * Makefile: Use a POSIX-compatible test ('==' -> '=') (#542) - * implementations: Rename ocitools -> runtime-tools (#585) - * *: Typo fixes and polishing (#556, #566, #568, #569, #571, #572, - #574, #595, #596, #599, #600, #601, #603, #605, #608, #613, #617, - #619, #621, #622, #623, #624, #625, #627, #629) - -Changes with v1.0.0-rc2: - Additions: - - * config-linux: Add new architectures from libseccomp 2.3.0 (#505) - * schema: Add JSON Schema for state JSON and move schema.json to - config-schema.json and similar (#481, #498, #519) - - Minor fixes and documentation: - - * Add compliance language for platforms and architectures (#527) - * Remove "unconditionally compliant" language (#553) - * bundle: Remove distribution references (#487) - * runtime: Fix sub-bullet indentation (#495) - * config: Replace Arch fstab reference with mount(8) (#443) - * config: Synchronize comments between Markdown and Go (#525) - * config: Drop v0.x compatibility statement (#488) - * config-linux: RFC 2119 wording for cgroupsPath (#493) - * config-linux: Make linux.devices and linux.resources.devices - optional (#526) - * config-linux: Extend no-tweak requirement to runtime namespaces (#538) - * schema: Add hook.timeout (#544) - * schema: Add missing '"type": "object"' (#528) - * schema: Run 'make fmt' and remove duplicates (#546, #551) - * schema/config: Make 'hostname' optional (#491) - * schema/config-linux: Add linux.resources.devices (#550) - * specs-go/config: Add Solaris tags to User properties (#496) - * specs-go/config: Make Linux and Solaris omitempty again (#502) - * specs-go/config: Make KernelTCP and ClassID omitempty (#531) - * specs-go/config: Fix "specified" typo for ApparmorProfile (#503) - * Makefile: Remove code-of-conduct.md and version.md when clean (#541) - * implementations: Mention cc-oci-runtime (#539) - * Use filesystem instead of file system (#529) - * .pullapprove: Add DCO check via PullApprove - * GOVERNANCE: Add governance and release process docs (#521) - * README: Change meeting time from 10am to 2pm Pacific (#524) - * README: Update conference-call phone number (#512, #515) - -Changes with v1.0.0-rc1: - Breaking changes: - - * runtime: Split create and start, #384, #450, #463, #464, #467, - #468 - * runtime: Remove exec, #388 - * runtime: Enviroment MUST match the configuration, #397 - * config: Runtime MUST generate errors for unsupported platforms, - #441 - * config: Windows mount destinations MUST NOT be nested, #437 - - Additions: - - * solaris: Added platform-specific configuration, #411, #424, #431, - #436 - * runtime: Add 'annotations' and 'status' to the state structure, - #462, #484, #485 - * runtime: State no longer needs to be serialized as JSON, #446 - * runtime-linux: Add /dev symbolic links, #449 - * config: Allow absolute paths for root.path (which previously - required relative paths), #394 - * config-linux: Add linux.mountLabel, #393 - * config-linux: Add suport for cgroup namespace, #397 - * config-linux: Runtime SHOULD NOT modify ownership of any - referenced filesystem (previously the restriction only applied to - the root filesystem), #452 - * specs-go/seccomp: Add ppc and s390x to specs-go/config.go, #475 - - Minor fixes and documentation: - - * README: Add project.md to the Table of Contents, #376 - * README: Consistenly indent the Table of Contents, #400 - * README: Link to LICENSE, #442 - * README: Weekly call is OCI-wide, #378 - * config: Explicit runtime namespace for hooks, #415 - * config: Explicit container namespace for uid, gid, and - additionalGids, #412 - * config: Fix 'string' -> 'array of strings' typo for process.args, - #416 - * runtime: The runtime MAY validate config.json, #418 - * runtime: Move errors section out of operations, #445 - * runtime: MAY -> SHOULD for post-stop error logging, #410 - * schema/README: Document JSON Schema usage, #360, #385 - * schema: Minor description updates, #456, #461 - * schema/validate: Support reading documents via stdin, #482 - * .pullapprove: Automate review approval, #458, #474 - * .gitignore: Hide more auto-generated files, #386, #392 - * .travis: git-validation detects Travis now, #366 - * .travis: Regress on failure to produce docs, #479 - * Makefile: Filename docs.* -> oci-runtime-spec.*, #478 - * Makefile: Add install.tools target, #349 - * Makefile: Allow native pandoc implementations, #428, #448 - * Makefile: Prefer Bash, #455 - * Makefile: Travis support for .gitvalidation, #422 - * specs-go/config: Add missing omitempties for Process.Terminal, - Root.Readonly, Spec.Linux, and Spec.Mounts, #408, #429, #430, #431 - * specs-go/config: Remove incorrect omitempties for User.UID and - User.GID, #425 - * specs-go/config: Drop platform-independent comment, #451 - * version: Include version in generated documentation, #406 - * *: Anchor examples, #348 - * *: Fix remnants from SelinuxProcessLabel to SelinuxLabel rename, - #396 - * *: Outsource code-of-conduct to TOB repository, #375, #413 - * *: RFC 2119 consistency, #407, #409, #438, #444, #449 - * *: Typo fixes, #390, #401 - * *: Whitespace fixes and validation, #380, #381, #426 - * ROADMAP: Remove stale targets, #435 - -Changes with v0.5.0: - Breaking changes: - - * specs-go: Renamed the repository from opencontainers/specs to - opencontainers/runtime-spec, #365 - - Additions: - - * config: Add 'timeout' for hooks, #346 - * config-linux: Add 'maskedPaths' and 'readonlyPaths', #364 - - Minor fixes and documentation: - - * JSON Schema bug-fixes and improved examples, #370 - * README: Define "unconditionally compliant", #374 - * config: Make Markdown canonical, #342 - * config: Explicitly list mapping from symbolic names to UID/GIDs as - out-of-scope, #347 - * config-linux: Require the runtime mount namespace for namespace - 'path' values, #275 - * config-linux: Reword kernelTCP docs, #377 - * specs-go: Add omitempty to 'Device' and 'Namespace', #340 - * .travis.yml: Use built-in 'go vet' and current 'go lint', dropping - Go < 1.5, #372, #352 - * implementations: Expand ocitools scope to include testing, #328 - * style: Move one-sentence-per-line rule from the README, #369 - * style: Remove dangling parenthesis, #359 - * README: Add a link to the IRC logs, #358 - * Fix "manadate", "exmaple", "paramters", and "preferrably" typos, - #353, #354 - -Changes with v0.4.0: - Breaking changes: - - * config: Move capabilities, selinuxProcessLabel, apparmorProfile, - and noNewPrivileges from the linux setting to the process setting - and make them optional, renaming selinuxProcessLabel to - selinuxLabel, #329, #330, #339 - * runtime: Rename version to ociVerison in the state JSON, #225 - * runtime: Remove the directory requirement for storing state, now - that there is a 'state' operation, #225, #334 - * go: Shift *.go to specs-go/*.go, #276 - * config: Move rlimits to process, #341 - * go: Move config_linux.go content into config.go, removing - LinuxSpec, #310 - - Additions: - - * schema: Add JSON Schema (and validator) for `config.json`, #313 - * config: Add annotations for opaque-to-the-runtime data, #331 - * config-linux: Make seccomp optional, #333 - * runtime: Added additional operations: state, stop, and exec. - #225 - - Minor fixes and documentation: - - * config-linux: Change mount type from *rune to *string and fix - octal fileMode examples, #323 - * runtime: RFC 2119 phrasing for the lifecycle, #225 - * README: Add a full example of config.json, #276 - * README: Replace BlueJeans with UberConference, #326, #338 - * style: Document Go-pointer exceptions, #317 - -Changes with v0.3.0: - Breaking changes: - - * config: Single, unified config file, #284 - * config: cwd is a required default, and must be absolute, #286, - #307, #308, #312 - * config: qualify the name of the version field, #309 - * config-linux: Convert classID from hex to uint32, #296 - * config-linux: Separate mknod from cgroups, #298 - - Additions: - - * config-linux: Add NoNewPrivileges setting for linux, #290 - - Minor fixes and documentation: - - * config-linux: clarify oom_score_adj, #236, #292 - * config-linux: Update links to cgroups documentation, #318 - * config-linux: Remove pointers for slices preferring omitempty - tag instead, #316 - * README: add runtime, bundle, and hook author user, #280 - * ROADMAP: reshuffled and split into GitHub issues, #300, #301, - #304, #306 - * style: Collect established styles in a discoverable location, #287, #311 - -Changes with v0.2.0: - * Add Apparmor, Selinux and Seccomp - * Add Apparmor, Selinux and Seccomp sections - * Add bind mount example - * Add fd section for linux container process - * Add Go types for specification - * *: adding a code of conduct - * Adding cgroups path to the Spec. - * .: Adding listing of implementations - * .: adding travis file for future CI - * Add license and DCO information for contributions - * Add linux spec description - * Add MAINTAINERS file - * Add memory swappiness to linux spec - * Add runtime state configuration and structs - * Adds a section for user namespace mappings - * Adds link to kernel cgroups documentation - * Adds section for Linux Rlimits - * Adds section for Linux Sysctl. - * Adds user namespace to the list of namespaces - * bundle: add initial run use case - * bundle: Fix 'and any number of and other related' typo - * bundle.md: clarify arbitrary/conventional dirnames - * bundle.md: fix link formatting - * bundle.md: fix off-by-one error - * bundle.md: various updates to latest spec - * bundle: Move 'Linux sysctl' header to its own line - * Change commiter to committer - * Change Device field order in spec_linux.go, 'Path' should be top of the 'Type' field, according to the different of the config-linux.md, 'Path' field is the unique key. - * Change layout of mountpoints and mounts - * Change the rlimit type to string instead of int - * Clarify behavior around namespaces paths. - * config: Add example additionalGids - * config: Add example cwd - * config: cleanup language on readonly parameter - * config: fix links to go files - * config-linux: specify the default devices/filesystems available - * config.md: clarify destination for mounts - * config.md: make the version a semver - * config.md: make the version field example a semver - * config.md: minor clean up of process specification - * config.md: reformat into a standard style - * config.md: update links to spec schema code - * config.md: various cleanup/consistency fixes - * config: minor cleanup - * Deduplicate the field of RootfsPropagation - * Define constants for Linux Namespace names - * Fix LinuxRuntime field - * Fix root object keys - * Fix typos in config.md - * Fix typos in the "Namespace types" section - * Fix typos in the rlimits section - * Fix Windows path escaping in example mount JSON - * JSON objects are easier to parse/manipulate - * made repo public. Added warning in README - * Make namespaces match runc - * make rootfs mount propagation mode settable - * Makes namespaces description linux specific - * *.md: markdown formatting - * Modify the capabilities constants to match header files like other constants - * Move linux specific options to linux spec - * README: add a rule for paragraph formatting in markdown - * README: Document BlueJeans and wiki archive for meetings - * README: Document pre-meeting agenda alteration - * README: Document YouTube and IRC backchannel for meetings - * README: Focus on local runtime (create/start/stop) - * README.md: Add a git commit style guide - * README.md: contribution about discussion - * README: releases section - * README: Remove blank line from infrastructure-agnostic paragraph - * removed boilerplate file - * *: remove superfluous comma in code-of-conduct - * Remove trailing whitespace - * Rename SystemProperties to Sysctl - * Rename the header "Access to devices" to "Devices" to fit with the config - * *: re-org the spec - * Replace Linux.Device with more specific config - * restore formatting - * Return golang compliant names for UID and GID in User - * Return golint-compliant naming for mappings - * runtime: Add prestart/poststop hooks - * runtime_config: comments for golint - * runtime-config-linux: Drop 'Linux' from headers - * runtime_config_linux: Fix 'LinuxSpec' -> 'LinuxRuntimeSpec' in comment - * runtime-config-linux: One sentence per line for opening two paragraphs - * runtime-config: Remove blank lines from the end of files - * runtime-config: Remove 'destination' docs from mounts - * runtime.md: convert oc to runc - * runtime: use opencontainer vs oci - * *: small spelling fixes - * Specific platform specific user struct for spec - * spec: linux: add support for the PIDs cgroup - * spec_linux: conform to `golint` - * spec_linux.go: Rename IDMapping fields to follow syscall.SysProcIDMap - * spec_linux: remove ending periods on one-line comments - * spec: rename ocp to oci and add a link - * specs: add json notation - * specs: align the ascii graph - * specs: fix the description for the [ug]idMappings - * specs: introduce the concept of a runtime.json - * .tools: cleanup the commit entry - * .tools: repo validation tool - * travis: fix DCO validation for merges - * typo: containers -> container's - * typo: the -> for - * Update config-linux for better formatting on values - * Update README.md - * Update readme with weekly call and mailing list - * Update runtime.md - * Update runtime.md - * Update runtime.md - * version: more explicit version for comparison - -Changes with v0.1.0: - * Add Architecture field to Seccomp configuration in Linux runtime - * Add @hqhq as maintainer - * Add hyphen for host specific - * Adding Vishnu Kannan as a Maintainer. - * Add initial roadmap - * Add lifecycle for containers - * Add oom_score_adj to the runtime Spec. - * Add post-start hooks - * Add Seccomp constants to description of Linux runtime spec - * Add Seccomp constants to Linux runtime config - * Add some clarity around the state.json file - * adds text describing the upper-case keywords used in the spec - * add testing framework to ROADMAP - * Appropriately mark optional fields as omitempty - * cgroup: Add support for memory.kmem.tcp.limit_in_bytes - * Change HugepageLimit.Limit type to uint64 - * Change the behavior when cgroupsPath is absent - * Change version from 0.1.0 to 0.2.0 - * Clarify the semantics of hook elements - * Cleanup bundle.md - * Cleanup principles - * config: linux: update description of PidsLimit - * config: Require a new UTS namespace for config.json's hostname - * config: Require the runtime to mount Spec.Mounts in order - * convert **name** to **`name`** - * Example lists "root' but text mentions "bundlePath" - * Fix an extra space in VersionMinor - * Fix golint warnings - * Fix typo in BlockIO struct comment - * Fix typo in Filesystem Bundle - * Fix value of swappiness - * glossary: Provide a quick overview of important terms - * glossary: Specify UTF-8 for all our JSON - * hooks: deduplicate the hooks docs - * implementations: Link to kunalkushwaha/octool - * implementations: Link to mrunalp/ocitools - * lifecycle: Don't require /run/opencontainer//containers - * lifecycle: Mention runtime.json - * lifecycle: no hypens - * MAINTAINERS: add tianon per the charter - * MAINTAINERS: correct Vish's github account - * Makefile: Add glossary to DOC_FILES - * Make optional Cgroup related config params pointers along with `omitempty` json tag. - * Mark RootfsPropagation as omitempty - * *.md: update TOC and links - * move the description of Rlimits before example - * move the description of user ns mapping to proper file - * principles: Give principles their own home - * *: printable documents - * Project: document release process - * README: Fix some headers - * README: make header more concise - * remove blank char from blank line - * Remove the unneeded build tag from the config_linux.go - * Remove trailing comma in hooks json example - * Rename State's Root to Bundle - * ROADMAP.md: remove the tail spaces - * roadmap: update links and add wiki reference - * runtime: Add 'version' to the state.json example - * runtime-config: add example label before json example - * runtime-config: add section about Hooks - * runtime: config: linux: add cgroups information - * runtime: config: linux: Edit BlockIO struct - * runtime: config: linux: Fix typo and trailing commas in json example - * runtime_config_linux.go: add missing pointer - * runtime-config-linux.md: fix the type of cpus and mems - * runtime.md: fix spacing - * Talk about host specific/independent instead of mutability - * .tools: commit validator is a separate project - * .tools: make GetFetchHeadCommit do what it says - * .travis.yml: add go 1.5.1, update from 1.4.2 to 1.4.3 - * Update readme with wiki link to minutes - * Update Typo in ROADMAP.md - * Use unsigned for IDs - * version: introduce a string for dev indication diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md b/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md deleted file mode 100644 index 92c8609..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/GOVERNANCE.md +++ /dev/null @@ -1,70 +0,0 @@ -# Project governance - -The [OCI charter][charter] §5.b.viii tasks an OCI Project's maintainers (listed in the repository's MAINTAINERS file and sometimes referred to as "the TDC", [§5.e][charter]) with: - -> Creating, maintaining and enforcing governance guidelines for the TDC, approved by the maintainers, and which shall be posted visibly for the TDC. - -This section describes generic rules and procedures for fulfilling that mandate. - -## Proposing a motion - -A maintainer SHOULD propose a motion on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with another maintainer as a co-sponsor. - -## Voting - -Voting on a proposed motion SHOULD happen on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with maintainers posting LGTM or REJECT. -Maintainers MAY also explicitly not vote by posting ABSTAIN (which is useful to revert a previous vote). -Maintainers MAY post multiple times (e.g. as they revise their position based on feedback), but only their final post counts in the tally. -A proposed motion is adopted if two-thirds of votes cast, a quorum having voted, are in favor of the release. - -Voting SHOULD remain open for a week to collect feedback from the wider community and allow the maintainers to digest the proposed motion. -Under exceptional conditions (e.g. non-major security fix releases) proposals which reach quorum with unanimous support MAY be adopted earlier. - -A maintainer MAY choose to reply with REJECT. -A maintainer posting a REJECT MUST include a list of concerns or links to written documentation for those concerns (e.g. GitHub issues or mailing-list threads). -The maintainers SHOULD try to resolve the concerns and wait for the rejecting maintainer to change their opinion to LGTM. -However, a motion MAY be adopted with REJECTs, as outlined in the previous paragraphs. - -## Quorum - -A quorum is established when at least two-thirds of maintainers have voted. - -For projects that are not specifications, a [motion to release](#release-approval) MAY be adopted if the tally is at least three LGTMs and no REJECTs, even if three votes does not meet the usual two-thirds quorum. - -## Security issues - -Motions with sensitive security implications MUST be proposed on the security@opencontainers.org mailing list instead of dev@opencontainers.org, but should otherwise follow the standard [proposal](#proposing-a-motion) process. -The security@opencontainers.org mailing list includes all members of the TOB. -The TOB will contact the project maintainers and provide a channel for discussing and voting on the motion, but voting will otherwise follow the standard [voting](#voting) and [quorum](#quorum) rules. -The TOB and project maintainers will work together to notify affected parties before making an adopted motion public. - -## Amendments - -The [project governance](#project-governance) rules and procedures MAY be amended or replaced using the procedures themselves. -The MAINTAINERS of this project governance document is the total set of MAINTAINERS from all Open Containers projects (runC, runtime-spec, and image-spec). - -## Subject templates - -Maintainers are busy and get lots of email. -To make project proposals recognizable, proposed motions SHOULD use the following subject templates. - -### Proposing a motion - -> [{project} VOTE]: {motion description} (closes {end of voting window}) - -For example: - -> [runtime-spec VOTE]: Tag 0647920 as 1.0.0-rc (closes 2016-06-03 20:00 UTC) - -### Tallying results - -After voting closes, a maintainer SHOULD post a tally to the motion thread with a subject template like: - -> [{project} {status}]: {motion description} (+{LGTMs} -{REJECTs} #{ABSTAINs}) - -Where `{status}` is either `adopted` or `rejected`. -For example: - -> [runtime-spec adopted]: Tag 0647920 as 1.0.0-rc (+6 -0 #3) - -[charter]: https://www.opencontainers.org/about/governance diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE b/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE deleted file mode 100644 index bdc4036..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 The Linux Foundation. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS b/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS deleted file mode 100644 index f559c5b..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/MAINTAINERS +++ /dev/null @@ -1,6 +0,0 @@ -Michael Crosby (@crosbymichael) -Mrunal Patel (@mrunalp) -Vincent Batts (@vbatts) -Daniel, Dao Quang Minh (@dqminh) -Tianon Gravi (@tianon) -Qiang Huang (@hqhq) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile b/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile deleted file mode 100644 index 16051b3..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/Makefile +++ /dev/null @@ -1,95 +0,0 @@ - -EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667 -OUTPUT_DIRNAME ?= output -DOC_FILENAME ?= oci-runtime-spec -DOCKER ?= $(shell command -v docker 2>/dev/null) -PANDOC ?= $(shell command -v pandoc 2>/dev/null) -ifeq "$(strip $(PANDOC))" '' - ifneq "$(strip $(DOCKER))" '' - PANDOC = $(DOCKER) run \ - --security-opt label=disable \ - -it \ - --rm \ - -v $(shell pwd)/:/input/:ro \ - -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \ - -u $(shell id -u) \ - vbatts/pandoc - PANDOC_SRC := /input/ - PANDOC_DST := / - endif -endif - -# These docs are in an order that determines how they show up in the PDF/HTML docs. -DOC_FILES := \ - version.md \ - spec.md \ - principles.md \ - bundle.md \ - runtime.md \ - runtime-linux.md \ - config.md \ - config-linux.md \ - config-solaris.md \ - glossary.md - -default: docs - -docs: $(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html - -ifeq "$(strip $(PANDOC))" '' -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: - $(error cannot build $@ without either pandoc or docker) -else -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).pdf: $(DOC_FILES) - mkdir -p $(OUTPUT_DIRNAME)/ && \ - $(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) - -$(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) - mkdir -p $(OUTPUT_DIRNAME)/ && \ - $(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES)) -endif - -version.md: ./specs-go/version.go - go run ./.tool/version-doc.go > $@ - -HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-) -# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked. -ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true') - -test: .govet .golint .gitvalidation - -.govet: - go vet -x ./... - -# `go get github.com/golang/lint/golint` -.golint: -ifeq ($(call ALLOWED_GO_VERSION,1.7,$(HOST_GOLANG_VERSION)),true) - @which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false) - golint ./... -endif - - -# When this is running in travis, it will only check the travis commit range -.gitvalidation: - @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) -ifdef TRAVIS_COMMIT_RANGE - git-validation -q -run short-subject,dangling-whitespace -else - git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD -endif - -install.tools: .install.golint .install.gitvalidation - -# golint does not even build for - -using your real name (sorry, no pseudonyms or anonymous contributions.) - -You can add the sign off when creating the git commit via `git commit -s`. - -#### Commit Style - -Simple house-keeping for clean git history. -Read more on [How to Write a Git Commit Message][how-to-git-commit] or the Discussion section of [git-commit(1)][git-commit.1]. - -1. Separate the subject from body with a blank line -2. Limit the subject line to 50 characters -3. Capitalize the subject line -4. Do not end the subject line with a period -5. Use the imperative mood in the subject line -6. Wrap the body at 72 characters -7. Use the body to explain what and why vs. how - * If there was important/useful/essential conversation or information, copy or include a reference -8. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...") - - -[charter]: https://www.opencontainers.org/about/governance -[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md -[dev-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev -[how-to-git-commit]: http://chris.beams.io/posts/git-commit -[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ -[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date#Calculating_the_week_number_of_a_given_date -[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ -[oci]: https://www.opencontainers.org -[rfc5545]: https://tools.ietf.org/html/rfc5545 -[runtime-wiki]: https://github.com/opencontainers/runtime-spec/wiki -[uberconference]: https://www.uberconference.com/opencontainers - -[git-commit.1]: http://git-scm.com/docs/git-commit diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md b/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md deleted file mode 100644 index cd48def..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/RELEASES.md +++ /dev/null @@ -1,96 +0,0 @@ -# Releases - -The release process hopes to encourage early, consistent consensus-building during project development. -The mechanisms used are regular community communication on the mailing list about progress, scheduled meetings for issue resolution and release triage, and regularly paced and communicated releases. -Releases are proposed and adopted or rejected using the usual [project governance](GOVERNANCE.md) rules and procedures. - -An anti-pattern that we want to avoid is heavy development or discussions "late cycle" around major releases. -We want to build a community that is involved and communicates consistently through all releases instead of relying on "silent periods" as a judge of stability. - -## Parallel releases - -A single project MAY consider several motions to release in parallel. -However each motion to release after the initial 0.1.0 MUST be based on a previous release that has already landed. - -For example, runtime-spec maintainers may propose a v1.0.0-rc2 on the 1st of the month and a v0.9.1 bugfix on the 2nd of the month. -They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th if the vote initiated on the 1st passes). - -## Specifications - -The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools. -However, specification releases have special restrictions in the [OCI charter][charter]: - -* They are the target of backwards compatibility (§7.g), and -* They are subject to the OFWa patent grant (§8.d and e). - -To avoid unfortunate side effects (onerous backwards compatibility requirements or Member resignations), the following additional procedures apply to specification releases: - -### Planning a release - -Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases. -This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC. -Maintainers MUST send updates to the dev@opencontainers.org with results of these meetings. - -Before the specification reaches v1.0.0, the meetings SHOULD be weekly. -Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting. - -The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones). -GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures. - -### Timelines - -Specifications have a variety of different timelines in their lifecycle. - -* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback. -* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart. - This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself. - Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced. - For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0. -* Minor and patch releases SHOULD be made on an as-needed basis. - -[charter]: https://www.opencontainers.org/about/governance - -## Checklist - -Releases usually follow a few steps: - -* [ ] prepare a pull-request for the release - * [ ] a commit updating `./ChangeLog` - * [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -` - * [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting - * [ ] review `(^M|^A|^D)` for impact of the commit - * [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:` - * [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'` - * [ ] merge multi-commit PRs (so each line has a `(#num)` suffix) - * [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /` - * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable - * [ ] a commit adding back the "-dev" to `VersionDev` -* [ ] send email to dev@opencontainers.org - * [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev") - * [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l` - * [ ] get the date for a week from now, like `TZ=UTC date --date='next week'` - * [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description - * [ ] subject line like `[runtime-spec VOTE] tag $versionBumpCommit as $version (closes $dateWeekFromNowUTC)` - * [ ] email body like -``` -Hey everyone, - -There have been $numPRs PRs merged since $priorTag release (https://github.com/opencontainers/runtime-spec/compare/$priorTag...$versionBumpCommit). - -$linkToPullRequest - -Please respond LGTM or REJECT (with reasoning). - -$sig -``` -* [ ] edit/update the pull-request to link to the VOTE thread, from https://groups.google.com/a/opencontainers.org/forum/#!forum/dev -* [ ] a week later, if the vote passes, merge the PR - * [ ] `git tag -s $version $versionBumpCommit` - * [ ] `git push --tags` -* [ ] produce release documents - * [ ] git checkout the release tag, like `git checkout $version` - * [ ] `make docs` - * [ ] rename the output PDF and HTML file to include version, like `mv output/oci-runtime-spec.pdf output/oci-runtime-spec-$version.pdf`` - * [ ] attach these docs to the release on https://github.com/opencontainers/runtime-spec/releases - * [ ] link to the the VOTE thread and include the passing vote count - * [ ] link to the pull request that merged the release diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md b/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md deleted file mode 100644 index 0924ad9..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/bundle.md +++ /dev/null @@ -1,22 +0,0 @@ -# Filesystem Bundle - -## Container Format - -This section defines a format for encoding a container as a *filesystem bundle* - a set of files organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it. -See also [MacOS application bundles][macos_bundle] for a similar use of the term *bundle*. - -The definition of a bundle is only concerned with how a container, and its configuration data, are stored on a local filesystem so that it can be consumed by a compliant runtime. - -A Standard Container bundle contains all the information needed to load and run a container. -This includes the following artifacts: - -1. `config.json`: contains configuration data. - This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`. - See [`config.json`](config.md) for more details. - -2. container's root filesystem: the directory referenced by [`root.path`](config.md#root), if that property is set in `config.json`. - -When supplied, while these artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle. -In other words, a tar archive of a *bundle* will have these artifacts at the root of the archive, not nested within a top-level directory. - -[macos_bundle]: https://en.wikipedia.org/wiki/Bundle_%28macOS%29 diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md deleted file mode 100644 index 368bf28..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/config-linux.md +++ /dev/null @@ -1,766 +0,0 @@ -# Linux Container Configuration - -This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. - -## Default Filesystems - -The Linux ABI includes both syscalls and several special file paths. -Applications expecting a Linux environment will very likely expect these file paths to be set up correctly. - -The following filesystems SHOULD be made available in each container's filesystem: - -| Path | Type | -| -------- | ------ | -| /proc | [proc][] | -| /sys | [sysfs][] | -| /dev/pts | [devpts][] | -| /dev/shm | [tmpfs][] | - -## Namespaces - -A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. -Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. -For more information, see the [namespaces(7)][namespaces.7_2] man page. - -Namespaces are specified as an array of entries inside the `namespaces` root field. -The following parameters can be specified to set up namespaces: - -* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types SHOULD be supported: - * **`pid`** processes inside the container will only be able to see other processes inside the same container or inside the same pid namespace. - * **`network`** the container will have its own network stack. - * **`mount`** the container will have an isolated mount table. - * **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC. - * **`uts`** the container will be able to have its own hostname and domain name. - * **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container. - * **`cgroup`** the container will have an isolated view of the cgroup hierarchy. -* **`path`** *(string, OPTIONAL)* - namespace file. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). - The runtime MUST place the container process in the namespace associated with that `path`. - The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`. - - If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`. - -If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type. -If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors). - -### Example - -```json -"namespaces": [ - { - "type": "pid", - "path": "/proc/1234/ns/pid" - }, - { - "type": "network", - "path": "/var/run/netns/neta" - }, - { - "type": "mount" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } -] -``` - -## User namespace mappings - -**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container. -**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container. - -Each entry has the following structure: - -* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container. -* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID*. -* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped. - -The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping. -Note that the number of mapping entries MAY be limited by the [kernel][user-namespaces]. - -### Example - -```json -"uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } -], -"gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } -] -``` - -## Devices - -**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. -The runtime MAY supply them however it likes (with [`mknod`][mknod.2], by bind mounting from the runtime mount namespace, using symlinks, etc.). - -Each entry has the following structure: - -* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`. - More info in [mknod(1)][mknod.1]. -* **`path`** *(string, REQUIRED)* - full path to device inside container. - If a [file][] already exists at `path` that does not match the requested device, the runtime MUST generate an error. -* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device. -* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. - You can also control access to devices [with cgroups](#device-whitelist). -* **`uid`** *(uint32, OPTIONAL)* - id of device owner in the [container namespace](glossary.md#container-namespace). -* **`gid`** *(uint32, OPTIONAL)* - id of device group in the [container namespace](glossary.md#container-namespace). - -The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices. - -### Example - -```json -"devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } -] -``` - -### Default Devices - -In addition to any devices configured with this setting, the runtime MUST also supply: - -* [`/dev/null`][null.4] -* [`/dev/zero`][zero.4] -* [`/dev/full`][full.4] -* [`/dev/random`][random.4] -* [`/dev/urandom`][random.4] -* [`/dev/tty`][tty.4] -* `/dev/console` is set up if [`terminal`](config.md#process) is enabled in the config by bind mounting the pseudoterminal slave to `/dev/console`. -* [`/dev/ptmx`][pts.4]. - A [bind-mount or symlink of the container's `/dev/pts/ptmx`][devpts]. - -## Control groups - -Also known as cgroups, they are used to restrict resource usage for a container and handle device access. -cgroups provide controls (through controllers) to restrict cpu, memory, IO, pids, network and RDMA resources for the container. -For more information, see the [kernel cgroups documentation][cgroup-v1]. - -### Cgroups Path - -**`cgroupsPath`** (string, OPTIONAL) path to the cgroups. -It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container. - -The value of `cgroupsPath` MUST be either an absolute path or a relative path. - -* In the case of an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point. -* In the case of a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy. - -If the value is specified, the runtime MUST consistently attach to the same place in the cgroups hierarchy given the same value of `cgroupsPath`. -If the value is not specified, the runtime MAY define the default cgroups path. -Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case. - -Implementations of the Spec can choose to name cgroups in any manner. -The Spec does not include naming schema for cgroups. -The Spec does not support per-controller paths for the reasons discussed in the [cgroupv2 documentation][cgroup-v2]. -The cgroups will be created if they don't exist. - -You can configure a container's cgroups via the `resources` field of the Linux configuration. -Do not specify `resources` unless limits have to be updated. -For example, to run a new process in an existing container without updating limits, `resources` need not be specified. - -Runtimes MAY attach the container process to additional cgroup controllers beyond those necessary to fulfill the `resources` settings. - -### Example - -```json -"cgroupsPath": "/myRuntime/myContainer", -"resources": { - "memory": { - "limit": 100000, - "reservation": 200000 - }, - "devices": [ - { - "allow": false, - "access": "rwm" - } - ] -} -``` - -### Device whitelist - -**`devices`** (array of objects, OPTIONAL) configures the [device whitelist][cgroup-v1-devices]. -The runtime MUST apply entries in the listed order. - -Each entry has the following structure: - -* **`allow`** *(boolean, REQUIRED)* - whether the entry is allowed or denied. -* **`type`** *(string, OPTIONAL)* - type of device: `a` (all), `c` (char), or `b` (block). - Unset values mean "all", mapping to `a`. -* **`major, minor`** *(int64, OPTIONAL)* - [major, minor numbers][devices] for the device. - Unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices]. -* **`access`** *(string, OPTIONAL)* - cgroup permissions for device. - A composition of `r` (read), `w` (write), and `m` (mknod). - -#### Example - -```json -"devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } -] -``` - -### Memory - -**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage. -For more information, see the kernel cgroups documentation about [memory][cgroup-v1-memory]. - -Values for memory specify the limit in bytes, or `-1` for unlimited memory. - -* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage -* **`reservation`** *(int64, OPTIONAL)* - sets soft limit of memory usage -* **`swap`** *(int64, OPTIONAL)* - sets limit of memory+Swap usage -* **`kernel`** *(int64, OPTIONAL)* - sets hard limit for kernel memory -* **`kernelTCP`** *(int64, OPTIONAL)* - sets hard limit for kernel TCP buffer memory - -The following properties do not specify memory limits, but are covered by the `memory` controller: - -* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness) - The values are from 0 to 100. Higher means more swappy. -* **`disableOOMKiller`** *(bool, OPTIONAL)* - enables or disables the OOM killer. - If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. - The OOM killer is enabled by default in every cgroup using the `memory` subsystem. - To disable it, specify a value of `true`. -* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting. - If enabled (`true`), child cgroups will share the memory limits of this cgroup. - -#### Example - -```json -"memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false -} -``` - -### CPU - -**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets`. -For more information, see the kernel cgroups documentation about [cpusets][cgroup-v1-cpusets]. - -The following parameters can be specified to set up the controller: - -* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup -* **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by **`period`** below) -* **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only) -* **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources -* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only -* **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in -* **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in - -#### Example - -```json -"cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" -} -``` - -### Block IO - -**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller. -For more information, see the kernel cgroups documentation about [blkio][cgroup-v1-blkio]. - -The following parameters can be specified to set up the controller: - -* **`weight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. -* **`leafWeight`** *(uint16, OPTIONAL)* - equivalents of `weight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. -* **`weightDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth weights. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`weight`** *(uint16, OPTIONAL)* - bandwidth weight for the device. - * **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth weight for the device while competing with the cgroup's child cgroups, CFQ scheduler only - - You MUST specify at least one of `weight` or `leafWeight` in a given entry, and MAY specify both. - -* **`throttleReadBpsDevice`**, **`throttleWriteBpsDevice`** *(array of objects, OPTIONAL)* - an array of per-device bandwidth rate limits. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`rate`** *(uint64, REQUIRED)* - bandwidth rate limit in bytes per second for the device - -* **`throttleReadIOPSDevice`**, **`throttleWriteIOPSDevice`** *(array of objects, OPTIONAL)* - an array of per-device IO rate limits. - Each entry has the following structure: - * **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. - For more information, see the [mknod(1)][mknod.1] man page. - * **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device - -#### Example - -```json -"blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] -} -``` - -### Huge page limits - -**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the -HugeTLB usage per control group and enforces the controller limit during page fault. -For more information, see the kernel cgroups documentation about [HugeTLB][cgroup-v1-hugetlb]. - -Each entry has the following structure: - -* **`pageSize`** *(string, REQUIRED)* - hugepage size - The value has the format `B` (64KB, 2MB, 1GB), and must match the `` of the - corresponding control file found in `/sys/fs/cgroup/hugetlb/hugetlb..limit_in_bytes`. - Values of `` are intended to be parsed using base 1024 ("1KB" = 1024, "1MB" = 1048576, etc). -* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage - -#### Example - -```json -"hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 209715200 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } -] -``` - -### Network - -**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio`. -For more information, see the kernel cgroups documentations about [net\_cls cgroup][cgroup-v1-net-cls] and [net\_prio cgroup][cgroup-v1-net-prio]. - -The following parameters can be specified to set up the controller: - -* **`classID`** *(uint32, OPTIONAL)* - is the network class identifier the cgroup's network packets will be tagged with -* **`priorities`** *(array of objects, OPTIONAL)* - specifies a list of objects of the priorities assigned to traffic originating from processes in the group and egressing the system on various interfaces. - The following parameters can be specified per-priority: - * **`name`** *(string, REQUIRED)* - interface name in [runtime network namespace](glossary.md#runtime-namespace) - * **`priority`** *(uint32, REQUIRED)* - priority applied to the interface - -#### Example - -```json -"network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] -} -``` - -### PIDs - -**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids`. -For more information, see the kernel cgroups documentation about [pids][cgroup-v1-pids]. - -The following parameters can be specified to set up the controller: - -* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup - -#### Example - -```json -"pids": { - "limit": 32771 -} -``` - -### RDMA - -**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`. -For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma]. - -The name of the device to limit is the entry key. -Entry values are objects with the following properties: - -* **`hcaHandles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup -* **`hcaObjects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup - -You MUST specify at least one of the `hcaHandles` or `hcaObjects` in a given entry, and MAY specify both. - -#### Example - -```json -"rdma": { - "mlx5_1": { - "hcaHandles": 3, - "hcaObjects": 10000 - }, - "mlx4_0": { - "hcaObjects": 1000 - }, - "rxe3": { - "hcaObjects": 10000 - } -} -``` - -## IntelRdt - -**`intelRdt`** (object, OPTIONAL) represents the [Intel Resource Director Technology][intel-rdt-cat-kernel-interface]. -If `intelRdt` is set, the runtime MUST write the container process ID to the `tasks` file in a proper sub-directory in a mounted `resctrl` pseudo-filesystem. That sub-directory name is specified by `closID` parameter. -If no mounted `resctrl` pseudo-filesystem is available in the [runtime mount namespace](glossary.md#runtime-namespace), the runtime MUST [generate an error](runtime.md#errors). - -If `intelRdt` is not set, the runtime MUST NOT manipulate any `resctrl` pseudo-filesystems. - -The following parameters can be specified for the container: - -* **`closID`** *(string, OPTIONAL)* - specifies the identity for RDT Class of Service (CLOS). - If `closID` is set, runtimes MUST create `closID` directory in a mounted `resctrl` pseudo-filesystem if it doesn't exist. If not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `` directory. - -* **`l3CacheSchema`** *(string, OPTIONAL)* - specifies the schema for L3 cache id and capacity bitmask (CBM). - The value SHOULD start with `L3:` and SHOULD NOT contain newlines. -* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id. - * The value MUST start with `MB:` and MUST NOT contain newlines. - - * If both `l3CacheSchema` and `memBwSchema` are set, runtimes MUST write the combined value to the `schemata` file in that sub-directory discussed in `closID`. - - * If `l3CacheSchema` contains a line beginning with `MB:`, the value written to `schemata` file MUST be the non-`MB:` line(s) from `l3CacheSchema` and the line from `memBWSchema`. - - * If either `l3CacheSchema` or `memBwSchema` is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`. - - * If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. - - * If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match. - - * If `closID` is set, and neither of `l3CacheSchema` and `memBwSchema` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist. - - -### Example - -Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits, -and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%. - -Tasks inside the container only have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1, -and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1. - -```json -"linux": { - "intelRdt": { - "closID": "guaranteed_group", - "l3CacheSchema": "L3:0=7f0;1=1f", - "memBwSchema": "MB:0=20;1=70" - } -} -``` - -## Sysctl - -**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container. -For more information, see the [sysctl(8)][sysctl.8] man page. - -### Example - -```json -"sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" -} -``` - -## Seccomp - -Seccomp provides application sandboxing mechanism in the Linux kernel. -Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls. -For more information about Seccomp, see [Seccomp][seccomp] kernel documentation. -The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp][] and are translated to corresponding values. - -**`seccomp`** (object, OPTIONAL) - -The following parameters can be specified to set up seccomp: - -* **`defaultAction`** *(string, REQUIRED)* - the default action for seccomp. Allowed values are the same as `syscalls[].action`. -* **`architectures`** *(array of strings, OPTIONAL)* - the architecture used for system calls. - A valid list of constants as of libseccomp v2.3.2 is shown below. - - * `SCMP_ARCH_X86` - * `SCMP_ARCH_X86_64` - * `SCMP_ARCH_X32` - * `SCMP_ARCH_ARM` - * `SCMP_ARCH_AARCH64` - * `SCMP_ARCH_MIPS` - * `SCMP_ARCH_MIPS64` - * `SCMP_ARCH_MIPS64N32` - * `SCMP_ARCH_MIPSEL` - * `SCMP_ARCH_MIPSEL64` - * `SCMP_ARCH_MIPSEL64N32` - * `SCMP_ARCH_PPC` - * `SCMP_ARCH_PPC64` - * `SCMP_ARCH_PPC64LE` - * `SCMP_ARCH_S390` - * `SCMP_ARCH_S390X` - * `SCMP_ARCH_PARISC` - * `SCMP_ARCH_PARISC64` - -* **`flags`** *(array of strings, OPTIONAL)* - list of flags to use with seccomp(2). - - A valid list of constants is shown below. - - * `SECCOMP_FILTER_FLAG_TSYNC` - * `SECCOMP_FILTER_FLAG_LOG` - * `SECCOMP_FILTER_FLAG_SPEC_ALLOW` - -* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp. - While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries. - For example, if `defaultAction` is `SCMP_ACT_KILL` and `syscalls` is empty or unset, the kernel will kill the container process on its first syscall. - Each entry has the following structure: - - * **`names`** *(array of strings, REQUIRED)* - the names of the syscalls. - `names` MUST contain at least one entry. - * **`action`** *(string, REQUIRED)* - the action for seccomp rules. - A valid list of constants as of libseccomp v2.4.0 is shown below. - - * `SCMP_ACT_KILL` - * `SCMP_ACT_TRAP` - * `SCMP_ACT_ERRNO` - * `SCMP_ACT_TRACE` - * `SCMP_ACT_ALLOW` - * `SCMP_ACT_LOG` - - * **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp. - Each entry has the following structure: - - * **`index`** *(uint, REQUIRED)* - the index for syscall arguments in seccomp. - * **`value`** *(uint64, REQUIRED)* - the value for syscall arguments in seccomp. - * **`valueTwo`** *(uint64, OPTIONAL)* - the value for syscall arguments in seccomp. - * **`op`** *(string, REQUIRED)* - the operator for syscall arguments in seccomp. - A valid list of constants as of libseccomp v2.3.2 is shown below. - - * `SCMP_CMP_NE` - * `SCMP_CMP_LT` - * `SCMP_CMP_LE` - * `SCMP_CMP_EQ` - * `SCMP_CMP_GE` - * `SCMP_CMP_GT` - * `SCMP_CMP_MASKED_EQ` - -### Example - -```json -"seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] -} -``` - -## Rootfs Mount Propagation - -**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation. -Its value is either `shared`, `slave`, `private` or `unbindable`. -It's worth noting that a peer group is defined as a group of VFS mounts that propagate events to each other. -A nested container is defined as a container launched inside an existing container. - -* **`shared`**: the rootfs mount belongs to a new peer group. - This means that further mounts (e.g. nested containers) will also belong to that peer group and will propagate events to the rootfs. - Note this does not mean that it's shared with the host. -* **`slave`**: the rootfs mount receives propagation events from the host (e.g. if something is mounted on the host it will also appear in the container) but not the other way around. -* **`private`**: the rootfs mount doesn't receive mount propagation events from the host and further mounts in nested containers will be isolated from the host and from the rootfs (even if the nested container `rootfsPropagation` option is shared). -* **`unbindable`**: the rootfs mount is a private mount that cannot be bind-mounted. - -The [Shared Subtrees][sharedsubtree] article in the kernel documentation has more information about mount propagation. - -### Example - -```json -"rootfsPropagation": "slave", -``` - -## Masked Paths - -**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read. -The values MUST be absolute paths in the [container namespace](glossary.md#container_namespace). - -### Example - -```json -"maskedPaths": [ - "/proc/kcore" -] -``` - -## Readonly Paths - -**`readonlyPaths`** (array of strings, OPTIONAL) will set the provided paths as readonly inside the container. -The values MUST be absolute paths in the [container namespace](glossary.md#container-namespace). - -### Example - -```json -"readonlyPaths": [ - "/proc/sys" -] -``` - -## Mount Label - -**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container. - -### Example - -```json -"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" -``` - -## Personality - -**`personality`** (object, OPTIONAL) sets the Linux execution personality. For more information -see the [personality](personality.2) syscall documentation. As most of the options are -obsolete and rarely used, and some reduce security, the currently supported set is a small -subset of the available options. - -* **`domain`** *(string, REQUIRED)* - the execution domain. - The valid list of constants is shown below. `LINUX32` will set the `uname` system call to show - a 32 bit CPU type, such as `i686`. - - * `LINUX` - * `LINUX32` - -* **`flags`** *(array of strings, OPTIONAL)* - the additional flags to apply. - Currently no flag values are supported. - - -[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt -[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt -[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt -[cgroup-v1-devices]: https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt -[cgroup-v1-hugetlb]: https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt -[cgroup-v1-memory]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt -[cgroup-v1-net-cls]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_cls.txt -[cgroup-v1-net-prio]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_prio.txt -[cgroup-v1-pids]: https://www.kernel.org/doc/Documentation/cgroup-v1/pids.txt -[cgroup-v1-rdma]: https://www.kernel.org/doc/Documentation/cgroup-v1/rdma.txt -[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt -[devices]: https://www.kernel.org/doc/Documentation/admin-guide/devices.txt -[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt -[file]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164 -[libseccomp]: https://github.com/seccomp/libseccomp -[proc]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt -[seccomp]: https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt -[sharedsubtree]: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt -[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt -[tmpfs]: https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt - -[full.4]: http://man7.org/linux/man-pages/man4/full.4.html -[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html -[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html -[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html -[null.4]: http://man7.org/linux/man-pages/man4/null.4.html -[personality.2]: http://man7.org/linux/man-pages/man2/personality.2.html -[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html -[random.4]: http://man7.org/linux/man-pages/man4/random.4.html -[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html -[tty.4]: http://man7.org/linux/man-pages/man4/tty.4.html -[zero.4]: http://man7.org/linux/man-pages/man4/zero.4.html -[user-namespaces]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html -[intel-rdt-cat-kernel-interface]: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md deleted file mode 100644 index ee375d6..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/config-solaris.md +++ /dev/null @@ -1,120 +0,0 @@ -# Solaris Application Container Configuration - -Solaris application containers can be configured using the following properties, all of the below properties have mappings to properties specified under [zonecfg(1M)][zonecfg.1m_2] man page, except milestone. - -## milestone -The SMF(Service Management Facility) FMRI which should go to "online" state before we start the desired process within the container. - -**`milestone`** *(string, OPTIONAL)* - -### Example -```json -"milestone": "svc:/milestone/container:default" -``` - -## limitpriv -The maximum set of privileges any process in this container can obtain. -The property should consist of a comma-separated privilege set specification as described in [priv_str_to_set(3C)][priv-str-to-set.3c] man page for the respective release of Solaris. - -**`limitpriv`** *(string, OPTIONAL)* - -### Example -```json -"limitpriv": "default" -``` - -## maxShmMemory -The maximum amount of shared memory allowed for this application container. -A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). -Mapped to `max-shm-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. - -**`maxShmMemory`** *(string, OPTIONAL)* - -### Example -```json -"maxShmMemory": "512m" -``` - -## cappedCPU -Sets a limit on the amount of CPU time that can be used by a container. -The unit used translates to the percentage of a single CPU that can be used by all user threads in a container, expressed as a fraction (for example, .75) or a mixed number (whole number and fraction, for example, 1.25). -An ncpu value of 1 means 100% of a CPU, a value of 1.25 means 125%, .75 mean 75%, and so forth. -When projects within a capped container have their own caps, the minimum value takes precedence. -cappedCPU is mapped to `capped-cpu` in [zonecfg(1M)][zonecfg.1m_2] man page. - -* **`ncpus`** *(string, OPTIONAL)* - -### Example -```json -"cappedCPU": { - "ncpus": "8" -} -``` - -## cappedMemory -The physical and swap caps on the memory that can be used by this application container. -A scale (K, M, G, T) can be applied to the value for each of these numbers (for example, 1M is one megabyte). -cappedMemory is mapped to `capped-memory` in [zonecfg(1M)][zonecfg.1m_2] man page. - -* **`physical`** *(string, OPTIONAL)* -* **`swap`** *(string, OPTIONAL)* - -### Example -```json -"cappedMemory": { - "physical": "512m", - "swap": "512m" -} -``` - -## Network - -### Automatic Network (anet) -anet is specified as an array that is used to set up networking for Solaris application containers. -The anet resource represents the automatic creation of a network resource for an application container. -The zones administration daemon, zoneadmd, is the primary process for managing the container's virtual platform. -One of the daemon's responsibilities is creation and teardown of the networks for the container. -For more information on the daemon see the [zoneadmd(1M)][zoneadmd.1m] man page. -When such a container is started, a temporary VNIC(Virtual NIC) is automatically created for the container. -The VNIC is deleted when the container is torn down. -The following properties can be used to set up automatic networks. -For additional information on properties, check the [zonecfg(1M)][zonecfg.1m_2] man page for the respective release of Solaris. - -* **`linkname`** *(string, OPTIONAL)* Specify a name for the automatically created VNIC datalink. -* **`lowerLink`** *(string, OPTIONAL)* Specify the link over which the VNIC will be created. -Mapped to `lower-link` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`allowedAddress`** *(string, OPTIONAL)* The set of IP addresses that the container can use might be constrained by specifying the `allowedAddress` property. - If `allowedAddress` has not been specified, then they can use any IP address on the associated physical interface for the network resource. - Otherwise, when `allowedAddress` is specified, the container cannot use IP addresses that are not in the `allowedAddress` list for the physical address. - Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`configureAllowedAddress`** *(string, OPTIONAL)* If `configureAllowedAddress` is set to true, the addresses specified by `allowedAddress` are automatically configured on the interface each time the container starts. - When it is set to false, the `allowedAddress` will not be configured on container start. - Mapped to `configure-allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`defrouter`** *(string, OPTIONAL)* The value for the OPTIONAL default router. -* **`macAddress`** *(string, OPTIONAL)* Set the VNIC's MAC addresses based on the specified value or keyword. - If not a keyword, it is interpreted as a unicast MAC address. - For a list of the supported keywords please refer to the [zonecfg(1M)][zonecfg.1m_2] man page of the respective Solaris release. - Mapped to `mac-address` in the [zonecfg(1M)][zonecfg.1m_2] man page. -* **`linkProtection`** *(string, OPTIONAL)* Enables one or more types of link protection using comma-separated values. - See the protection property in dladm(8) for supported values in respective release of Solaris. - Mapped to `link-protection` in the [zonecfg(1M)][zonecfg.1m_2] man page. - -#### Example -```json -"anet": [ - { - "allowedAddress": "172.17.0.2/16", - "configureAllowedAddress": "true", - "defrouter": "172.17.0.1/16", - "linkProtection": "mac-nospoof, ip-nospoof", - "linkname": "net0", - "lowerLink": "net2", - "macAddress": "02:42:f8:52:c7:16" - } -] -``` - - -[priv-str-to-set.3c]: http://docs.oracle.com/cd/E86824_01/html/E54766/priv-str-to-set-3c.html -[zoneadmd.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zoneadmd-1m.html -[zonecfg.1m_2]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md deleted file mode 100644 index ff551d3..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/config-vm.md +++ /dev/null @@ -1,68 +0,0 @@ -# Virtual-machine-specific Container Configuration - -This section describes the schema for the [virtual-machine-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The virtual-machine container specification provides additional configuration for the hypervisor, kernel, and image. - -## Hypervisor Object - -**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine. -* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor. - -### Example - -```json - "hypervisor": { - "path": "/path/to/vmm", - "parameters": ["opts1=foo", "opts2=bar"] - } -``` - -## Kernel Object - -**`kernel`** (object, REQUIRED) specifies details of the kernel to boot the container virtual machine with. -* **`path`** (string, REQUIRED) path to the kernel used to boot the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the kernel. -* **`initrd`** (string, OPTIONAL) path to an initial ramdisk to be used by the container virtual machine. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). - -### Example - -```json - "kernel": { - "path": "/path/to/vmlinuz", - "parameters": ["foo=bar", "hello world"], - "initrd": "/path/to/initrd.img" - } -``` - -## Image Object - -**`image`** (object, OPTIONAL) specifies details of the image that contains the root filesystem for the container virtual machine. -* **`path`** (string, REQUIRED) path to the container virtual machine root image. - This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). -* **`format`** (string, REQUIRED) format of the container virtual machine root image. Commonly supported formats are: - * **`raw`** [raw disk image format][raw-image-format]. Unset values for `format` will default to that format. - * **`qcow2`** [QEMU image format][qcow2-image-format]. - * **`vdi`** [VirtualBox 1.1 compatible image format][vdi-image-format]. - * **`vmdk`** [VMware compatible image format][vmdk-image-format]. - * **`vhd`** [Virtual Hard Disk image format][vhd-image-format]. - -This image contains the root filesystem that the virtual machine **`kernel`** will boot into, not to be confused with the container root filesystem itself. The latter, as specified by **`path`** from the [Root Configuration](config.md#Root-Configuration) section, will be mounted inside the virtual machine at a location chosen by the virtual-machine-based runtime. - -### Example - -```json - "image": { - "path": "/path/to/vm/rootfs.img", - "format": "raw" - } -``` - -[raw-image-format]: https://en.wikipedia.org/wiki/IMG_(file_format) -[qcow2-image-format]: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qcow2.txt;hb=HEAD -[vdi-image-format]: https://forensicswiki.org/wiki/Virtual_Disk_Image_(VDI) -[vmdk-image-format]: http://www.vmware.com/app/vmdk/?src=vmdk -[vhd-image-format]: https://github.com/libyal/libvhdi/blob/master/documentation/Virtual%20Hard%20Disk%20(VHD)%20image%20format.asciidoc diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md deleted file mode 100644 index 5a95782..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/config-windows.md +++ /dev/null @@ -1,207 +0,0 @@ -# Windows-specific Container Configuration - -This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). -The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. - -## LayerFolders - -**`layerFolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer with the last entry being the scratch. -`layerFolders` MUST contain at least one entry. - -### Example - -```json -"windows": { - "layerFolders": [ - "C:\\Layers\\layer2", - "C:\\Layers\\layer1", - "C:\\Layers\\layer-base", - "C:\\scratch", - ] -} -``` - -## Devices - -**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. - -Each entry has the following structure: - -* **`id`** *(string, REQUIRED)* - specifies the device which the runtime MUST make available in the container. -* **`idType`** *(string, REQUIRED)* - tells the runtime how to interpret `id`. Today, Windows only supports a value of `class`, which identifies `id` as a [device interface class GUID][interfaceGUID]. - -[interfaceGUID]: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/overview-of-device-interface-classes - -### Example - -```json -"windows": { - "devices": [ - { - "id": "24E552D7-6523-47F7-A647-D3465BF1F5CA", - "idType": "class" - }, - { - "id": "5175d334-c371-4806-b3ba-71fd53c9258d", - "idType": "class" - } - ] -} -``` - -## Resources - -You can configure a container's resource limits via the OPTIONAL `resources` field of the Windows configuration. - -### Memory - -`memory` is an OPTIONAL configuration for the container's memory usage. - -The following parameters can be specified: - -* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes. - -#### Example - -```json -"windows": { - "resources": { - "memory": { - "limit": 2097152 - } - } -} -``` - -### CPU - -`cpu` is an OPTIONAL configuration for the container's CPU usage. - -The following parameters can be specified: - -* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. -* **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. -* **`maximum`** *(uint16, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. - -#### Example - -```json -"windows": { - "resources": { - "cpu": { - "maximum": 5000 - } - } -} -``` - -### Storage - -`storage` is an OPTIONAL configuration for the container's storage usage. - -The following parameters can be specified: - -* **`iops`** *(uint64, OPTIONAL)* - specifies the maximum IO operations per second for the system drive of the container. -* **`bps`** *(uint64, OPTIONAL)* - specifies the maximum bytes per second for the system drive of the container. -* **`sandboxSize`** *(uint64, OPTIONAL)* - specifies the minimum size of the system drive in bytes. - -#### Example - -```json -"windows": { - "resources": { - "storage": { - "iops": 50 - } - } -} -``` - -## Network - -You can configure a container's networking options via the OPTIONAL `network` field of the Windows configuration. - -The following parameters can be specified: - -* **`endpointList`** *(array of strings, OPTIONAL)* - list of HNS (Host Network Service) endpoints that the container should connect to. -* **`allowUnqualifiedDNSQuery`** *(bool, OPTIONAL)* - specifies if unqualified DNS name resolution is allowed. -* **`DNSSearchList`** *(array of strings, OPTIONAL)* - comma separated list of DNS suffixes to use for name resolution. -* **`networkSharedContainerName`** *(string, OPTIONAL)* - name (ID) of the container that we will share with the network stack. -* **`networkNamespace`** *(string, OPTIONAL)* - name (ID) of the network namespace that will be used for the container. If a network namespace is specified no other parameter must be specified. - -### Example - -```json -"windows": { - "network": { - "endpointList": [ - "7a010682-17e0-4455-a838-02e5d9655fe6" - ], - "allowUnqualifiedDNSQuery": true, - "DNSSearchList": [ - "a.com", - "b.com" - ], - "networkSharedContainerName": "containerName", - "networkNamespace": "168f3daf-efc6-4377-b20a-2c86764ba892" - } -} -``` - -## Credential Spec - -You can configure a container's group Managed Service Account (gMSA) via the OPTIONAL `credentialSpec` field of the Windows configuration. -The `credentialSpec` is a JSON object whose properties are implementation-defined. -For more information about gMSAs, see [Active Directory Service Accounts for Windows Containers][gMSAOverview]. -For more information about tooling to generate a gMSA, see [Deployment Overview][gMSATooling]. - - -[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts -[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools - -## Servicing - -When a container terminates, the Host Compute Service indicates if a Windows update servicing operation is pending. -You can indicate that a container should be started in a mode to apply pending servicing operations via the OPTIONAL `servicing` field of the Windows configuration. - -### Example - -```json -"windows": { - "servicing": true -} -``` - -## IgnoreFlushesDuringBoot - -You can indicate that a container should be started in an a mode where disk flushes are not performed during container boot via the OPTIONAL `ignoreFlushesDuringBoot` field of the Windows configuration. - -### Example - -```json -"windows": { - "ignoreFlushesDuringBoot": true -} -``` - -## HyperV - -`hyperv` is an OPTIONAL field of the Windows configuration. -If present, the container MUST be run with Hyper-V isolation. -If omitted, the container MUST be run as a Windows Server container. - -The following parameters can be specified: - -* **`utilityVMPath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. - This would be specified if using a base image which does not contain a utility VM image. - If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path. - -### Example - -```json -"windows": { - "hyperv": { - "utilityVMPath": "C:\\path\\to\\utilityvm" - } -} -``` diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/config.md b/runtime/vendor/github.com/opencontainers/runtime-spec/config.md deleted file mode 100644 index 667bbba..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/config.md +++ /dev/null @@ -1,975 +0,0 @@ -# Configuration - -This configuration file contains metadata necessary to implement [standard operations](runtime.md#operations) against the container. -This includes the process to run, environment variables to inject, sandboxing features to use, etc. - -The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go). -[Platform](spec.md#platforms)-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below. -For properties that are only defined for some [platforms](spec.md#platforms), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`). - -Below is a detailed description of each field defined in the configuration format and valid values are specified. -Platform-specific fields are identified as such. -For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies. - - -## Specification version - -* **`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0][semver-v2.0.0] format and specifies the version of the Open Container Initiative Runtime Specification with which the bundle complies. - The Open Container Initiative Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions. - For example, if a configuration is compliant with version 1.1 of this specification, it is compatible with all runtimes that support any 1.1 or later release of this specification, but is not compatible with a runtime that supports 1.0 and not 1.1. - -### Example - -```json -"ociVersion": "0.1.0" -``` - -## Root - -**`root`** (object, OPTIONAL) specifies the container's root filesystem. -On Windows, for Windows Server Containers, this field is REQUIRED. -For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set. - -On all other platforms, this field is REQUIRED. - -* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container. - * On Windows, `path` MUST be a [volume GUID path][naming-a-volume]. - * On POSIX platforms, `path` is either an absolute path or a relative path to the bundle. - For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`. - The value SHOULD be the conventional `rootfs`. - - A directory MUST exist at the path declared by the field. - -* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false. - * On Windows, this field MUST be omitted or false. - -### Example (POSIX platforms) - -```json -"root": { - "path": "rootfs", - "readonly": true -} -``` - -### Example (Windows) - -```json -"root": { - "path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\" -} -``` - -## Mounts - -**`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root). -The runtime MUST mount entries in the listed order. -For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page. -For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page. - -* **`destination`** (string, REQUIRED) Destination of mount point: path inside container. - This value MUST be an absolute path. - * Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar). - * Solaris: corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m]. -* **`source`** (string, OPTIONAL) A device name, but can also be a file or directory name for bind mounts or a dummy. - Path values for bind mounts are either absolute or relative to the bundle. - A mount is a bind mount if it has either `bind` or `rbind` in the options. - * Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported. - * Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m]. -* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used. - * Linux: supported options are listed in the [mount(8)][mount.8] man page. - Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed. - * Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m]. - * Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given. - -### Example (Windows) - -```json -"mounts": [ - { - "destination": "C:\\folder-inside-container", - "source": "C:\\folder-on-host", - "options": ["ro"] - } -] -``` - -### POSIX-platform Mounts - -For POSIX platforms the `mounts` structure has the following fields: - -* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted. - * Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*). - * Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m]. - -### Example (Linux) - -```json -"mounts": [ - { - "destination": "/tmp", - "type": "tmpfs", - "source": "tmpfs", - "options": ["nosuid","strictatime","mode=755","size=65536k"] - }, - { - "destination": "/data", - "type": "none", - "source": "/volumes/testing", - "options": ["rbind","rw"] - } -] -``` - -### Example (Solaris) - -```json -"mounts": [ - { - "destination": "/opt/local", - "type": "lofs", - "source": "/usr/local", - "options": ["ro","nodevices"] - }, - { - "destination": "/opt/sfw", - "type": "lofs", - "source": "/opt/sfw" - } -] -``` - -## Process - -**`process`** (object, OPTIONAL) specifies the container process. -This property is REQUIRED when [`start`](runtime.md#start) is called. - -* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false. - As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal slave is duplicated on the process's [standard streams][stdin.3]. -* **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal. - Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset. - * **`height`** (uint, REQUIRED) - * **`width`** (uint, REQUIRED) -* **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable. - This value MUST be an absolute path. -* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. -* **`args`** (array of strings, OPTIONAL) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that at least one entry is REQUIRED (non-Windows), and that entry is used with the same semantics as `execvp`'s *file*. This field is OPTIONAL on Windows, and `commandLine` is REQUIRED if this field is omitted. -* **`commandLine`** (string, OPTIONAL) specifies the full command line to be executed on Windows. - This is the preferred means of supplying the command line on Windows. If omitted, the runtime will fall back to escaping and concatenating fields from `args` before making the system call into Windows. - - -### POSIX process - -For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties: - -* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process. - Each entry has the following structure: - - * **`type`** (string, REQUIRED) the platform resource being limited. - * Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`. - * Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`. - - The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface. - For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed. - For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call. - - * **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource. - `rlim.rlim_cur` MUST match the configured value. - * **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process. - `rlim.rlim_max` MUST match the configured value. - Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit. - - If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors). - -### Linux Process - -For Linux-based systems, the `process` object supports the following process-specific properties. - -* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process. - For more information about AppArmor, see [AppArmor documentation][apparmor]. -* **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process. - Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`. - Any value which cannot be mapped to a relevant kernel interface MUST cause an error. - `capabilities` contains the following properties: - - * **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process. - * **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process. - * **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process. - * **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process. - * **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process. -* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges. - As an example, the [`no_new_privs`][no-new-privs] article in the kernel documentation has information on how this is achieved using a `prctl` system call on Linux. -* **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][proc_2]. - If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value. - If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`. - - This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#memory) is scoped for a memory cgroup. - For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2]. -* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process. - For more information about SELinux, see [SELinux documentation][selinux]. - -### User - -The user for the process is a platform-specific structure that allows specific control over which user the process runs as. - -#### POSIX-platform User - -For POSIX platforms the `user` structure has the following fields: - -* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace). -* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace). -* **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask. -* **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process. - -_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_ - -### Example (Linux) - -```json -"process": { - "terminal": true, - "consoleSize": { - "height": 25, - "width": 80 - }, - "user": { - "uid": 1, - "gid": 1, - "umask": 63, - "additionalGids": [5, 6] - }, - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/root", - "args": [ - "sh" - ], - "apparmorProfile": "acme_secure_profile", - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true, - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ] -} -``` -### Example (Solaris) - -```json -"process": { - "terminal": true, - "consoleSize": { - "height": 25, - "width": 80 - }, - "user": { - "uid": 1, - "gid": 1, - "umask": 7, - "additionalGids": [2, 8] - }, - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/root", - "args": [ - "/usr/bin/bash" - ] -} -``` - -#### Windows User - -For Windows based systems the user structure has the following fields: - -* **`username`** (string, OPTIONAL) specifies the user name for the process. - -### Example (Windows) - -```json -"process": { - "terminal": true, - "user": { - "username": "containeradministrator" - }, - "env": [ - "VARIABLE=1" - ], - "cwd": "c:\\foo", - "args": [ - "someapp.exe", - ] -} -``` - - -## Hostname - -* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container. - On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7]. - Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7]. - -### Example - -```json -"hostname": "mrsdalloway" -``` - -## Platform-specific configuration - -* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md). - This MAY be set if the target platform of this spec is `linux`. -* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md). - This MUST be set if the target platform of this spec is `windows`. -* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md). - This MAY be set if the target platform of this spec is `solaris`. -* **`vm`** (object, OPTIONAL) [Virtual-machine-specific configuration](config-vm.md). - This MAY be set if the target platform and architecture of this spec support hardware virtualization. - -### Example (Linux) - -```json -{ - "linux": { - "namespaces": [ - { - "type": "pid" - } - ] - } -} -``` - -## POSIX-platform Hooks - -For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container. - -* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties: - * **`prestart`** (array of objects, OPTIONAL, **DEPRECATED**) is an array of [`prestart` hooks](#prestart). - * Entries in the array contain the following properties: - * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that **`path`** MUST be absolute. - * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. - * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. - * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. - If set, `timeout` MUST be greater than zero. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`createRuntime`** (array of objects, OPTIONAL) is an array of [`createRuntime` hooks](#createRuntime-hooks). - * Entries in the array contain the following properties (the entries are identical to the entries in the deprecated `prestart` hooks): - * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec]. - This specification extends the IEEE standard in that **`path`** MUST be absolute. - * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec]. - * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1]. - * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook. - If set, `timeout` MUST be greater than zero. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`createContainer`** (array of objects, OPTIONAL) is an array of [`createContainer` hooks](#createContainer-hooks). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - * **`startContainer`** (array of objects, OPTIONAL) is an array of [`startContainer` hooks](#startContainer-hooks). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [container namespace](glossary.md#container-namespace). - * The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - * **`poststart`** (array of objects, OPTIONAL) is an array of [`poststart` hooks](#poststart). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - * **`poststop`** (array of objects, OPTIONAL) is an array of [`poststop` hooks](#poststop). - * Entries in the array have the same schema as `createRuntime` entries. - * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). - * The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -Hooks allow users to specify programs to run before or after various lifecycle events. -Hooks MUST be called in the listed order. -The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container. - -### Prestart - -The `prestart` hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle). -On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). - -Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase. - -The `prestart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### CreateRuntime Hooks - -The `createRuntime` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. - -The `createRuntime` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook). - -The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. - -Note: `runc` originally implemented `prestart` hooks contrary to the spec, namely as part of the `create` operation (instead of during the `start` operation). This incorrect implementation actually corresponds to `createRuntime` hooks. For runtimes that implement the deprecated `prestart` hooks as `createRuntime` hooks, `createRuntime` hooks MUST be called after the `prestart` hooks. - -### CreateContainer Hooks - -The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed. -The `createContainer` hooks MUST be called after the `createRuntime` hooks. - -The `createContainer` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - -For example, on Linux this would happen before the `pivot_root` operation is executed but after the mount namespace was created and setup. - -The definition of `createContainer` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace and different mounts will be setup. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime. - -### StartContainer Hooks - -The `startContainer` hooks MUST be called [before the user-specified process is executed](runtime.md#lifecycle) as part of the [`start`](runtime.md#start) operation. -This hook can be used to execute some operations in the container, for example running the `ldconfig` binary on linux before the container process is spawned. - -The `startContainer` hooks' path MUST resolve in the [container namespace](glossary.md#container-namespace). -The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace). - -### Poststart - -The `poststart` hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns. -For example, this hook can notify the user that the container process is spawned. - -The `poststart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### Poststop - -The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns. -Cleanup or debugging functions are examples of such a hook. - -The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace). -The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace). - -### Summary - -See the below table for a summary of hooks and when they are called: - -| Name | Namespace | When | -| ----------------------- | --------- | -----------------------------------------------------------------------------------------------------------------------------------| -| `prestart` (Deprecated) | runtime | After the start operation is called but before the user-specified program command is executed. | -| `createRuntime` | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | -| `createContainer` | container | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. | -| `startContainer` | container | After the start operation is called but before the user-specified program command is executed. | -| `poststart` | runtime | After the user-specified process is executed but before the start operation returns. | -| `poststop` | runtime | After the container is deleted but before the delete operation returns. | - -### Example - -```json -"hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createRuntime": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createContainer": [ - { - "path": "/usr/bin/mount-hook", - "args": ["-mount", "arg1", "arg2"], - "env": [ "key1=value1"] - } - ], - "startContainer": [ - { - "path": "/usr/bin/refresh-ldcache" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": ["cleanup.sh", "-f"] - } - ] -} -``` - -## Annotations - -**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container. -This information MAY be structured or unstructured. -Annotations MUST be a key-value map. -If there are no annotations then this property MAY either be absent or an empty map. - -Keys MUST be strings. -Keys MUST NOT be an empty string. -Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`. -Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications. -Runtimes MUST handle unknown annotation keys like any other [unknown property](#extensibility). - -Values MUST be strings. -Values MAY be an empty string. - -```json -"annotations": { - "com.example.gpu-cores": "2" -} -``` - -## Extensibility - -Runtimes MAY [log](runtime.md#warnings) unknown properties but MUST otherwise ignore them. -That includes not [generating errors](runtime.md#errors) if they encounter an unknown property. - -## Valid values - -Runtimes MUST generate an error when invalid or unsupported values are encountered. -Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support. - -## Configuration Schema Example - -Here is a full example `config.json` for reference. - -```json -{ - "ociVersion": "1.0.1", - "process": { - "terminal": true, - "user": { - "uid": 1, - "gid": 1, - "additionalGids": [ - 5, - 6 - ] - }, - "args": [ - "sh" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_CORE", - "hard": 1024, - "soft": 1024 - }, - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "apparmorProfile": "acme_secure_profile", - "oomScoreAdj": 100, - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "slartibartfast", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": [ - "fix-mounts", - "arg1", - "arg2" - ], - "env": [ - "key1=value1" - ] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": [ - "cleanup.sh", - "-f" - ] - } - ] - }, - "linux": { - "devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } - ], - "uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" - }, - "cgroupsPath": "/myRuntime/myContainer", - "resources": { - "network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] - }, - "pids": { - "limit": 32771 - }, - "hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 9223372036854772000 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } - ], - "memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false - }, - "cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" - }, - "devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } - ], - "blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] - } - }, - "rootfsPropagation": "slave", - "seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "network" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } - ], - "maskedPaths": [ - "/proc/kcore", - "/proc/latency_stats", - "/proc/timer_stats", - "/proc/sched_debug" - ], - "readonlyPaths": [ - "/proc/asound", - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger" - ], - "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" - }, - "annotations": { - "com.example.key1": "value1", - "com.example.key2": "value2" - } -} -``` - - -[apparmor]: https://wiki.ubuntu.com/AppArmor -[cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt -[selinux]:http://selinuxproject.org/page/Main_Page -[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt -[proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt -[umask.2]: http://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html -[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html -[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01 -[ieee-1003.1-2008-functions-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html -[naming-a-volume]: https://aka.ms/nb3hqb - -[capabilities.7]: http://man7.org/linux/man-pages/man7/capabilities.7.html -[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html -[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html -[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS -[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS -[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html -[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html -[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html -[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html -[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md b/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md deleted file mode 100644 index 0c81fad..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/glossary.md +++ /dev/null @@ -1,38 +0,0 @@ -# Glossary - -## Bundle - -A [directory structure](bundle.md) that is written ahead of time, distributed, and used to seed the runtime for creating a [container](#container) and launching a process within it. - -## Configuration - -The [`config.json`](config.md) file in a [bundle](#bundle) which defines the intended [container](#container) and container process. - -## Container - -An environment for executing processes with configurable isolation and resource limitations. -For example, namespaces, resource limits, and mounts are all part of the container environment. - -## Container namespace - -On Linux,the [namespaces][namespaces.7] in which the [configured process](config.md#process) executes. - -## JSON - -All configuration [JSON][] MUST be encoded in [UTF-8][]. -JSON objects MUST NOT include duplicate names. -The order of entries in JSON objects is not significant. - -## Runtime - -An implementation of this specification. -It reads the [configuration files](#configuration) from a [bundle](#bundle), uses that information to create a [container](#container), launches a process inside the container, and performs other [lifecycle actions](runtime.md). - -## Runtime namespace - -On Linux, the namespaces from which new [container namespaces](#container-namespace) are [created](config-linux.md#namespaces) and from which some configured resources are accessed. - -[JSON]: https://tools.ietf.org/html/rfc8259 -[UTF-8]: http://www.unicode.org/versions/Unicode8.0.0/ch03.pdf - -[namespaces.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md b/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md deleted file mode 100644 index 921383a..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/implementations.md +++ /dev/null @@ -1,37 +0,0 @@ -# Implementations - -The following sections link to associated projects, some of which are maintained by the OCI and some of which are maintained by external organizations. -If you know of any associated projects that are not listed here, please file a pull request adding a link to that project. - -## Runtime (Container) - -* [opencontainers/runc][runc] - Reference implementation of OCI runtime -* [projectatomic/bwrap-oci][bwrap-oci] - Convert the OCI spec file to a command line for [bubblewrap][bubblewrap] -* [containers/crun][crun] - Runtime implementation in C - -## Runtime (Virtual Machine) - -* [hyperhq/runv][runv] - Hypervisor-based runtime for OCI -* [clearcontainers/runtime][cc-runtime] - Hypervisor-based OCI runtime utilising [virtcontainers][virtcontainers] by Intel®. -* [google/gvisor][gvisor] - gVisor is a user-space kernel, contains runsc to run sandboxed containers. -* [kata-containers/runtime][kata-runtime] - Hypervisor-based OCI runtime combining technology from [clearcontainers/runtime][cc-runtime] and [hyperhq/runv][runv]. - -## Testing & Tools - -* [kunalkushwaha/octool][octool] - A config linter and validator. -* [huawei-openlab/oct][oct] - Open Container Testing framework for OCI configuration and runtime -* [opencontainers/runtime-tools][runtime-tools] - A config generator and runtime/bundle testing framework. - - -[runc]: https://github.com/opencontainers/runc -[runv]: https://github.com/hyperhq/runv -[cc-runtime]: https://github.com/clearcontainers/runtime -[kata-runtime]: https://github.com/kata-containers/runtime -[virtcontainers]: https://github.com/containers/virtcontainers -[octool]: https://github.com/kunalkushwaha/octool -[oct]: https://github.com/huawei-openlab/oct -[runtime-tools]: https://github.com/opencontainers/runtime-tools -[bwrap-oci]: https://github.com/projectatomic/bwrap-oci -[bubblewrap]: https://github.com/projectatomic/bubblewrap -[crun]: https://github.com/containers/crun -[gvisor]: https://github.com/google/gvisor diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics b/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics deleted file mode 100644 index e8c4bc7..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/meeting.ics +++ /dev/null @@ -1,41 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Open Containers Initiative//Developer Meeting//EN -BEGIN:VTIMEZONE -TZID:America/Los_Angeles -LAST-MODIFIED:20050809T050000Z -BEGIN:STANDARD -DTSTART:20071104T020000 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -TZOFFSETFROM:-0700 -TZOFFSETTO:-0800 -TZNAME:PST -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20070311T020000 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -TZOFFSETFROM:-0800 -TZOFFSETTO:-0700 -TZNAME:PDT -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:tdc-meeting@opencontainers.org -DTSTAMP:20180628T170000Z -DTSTART;TZID=America/Los_Angeles:20170906T140000 -RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1WE -RDATE;TZID=America/Los_Angeles:20180110T140000 -EXDATE;TZIP=America/Los_Angeles:20180103T140000 -RDATE;TZID=America/Los_Angeles:20180711T140000 -EXDATE;TZIP=America/Los_Angeles:20180704T140000 -DURATION:PT1H -SUMMARY:OCI TDC Meeting -DESCRIPTION;ALTREP="https://github.com/opencontainers/runtime-spec# - meetings":Open Containers Initiative Developer Meeting\n - https://github.com/opencontainers/runtime-spec#meetings\n - Web: https://www.uberconference.com/opencontainers\n - Audio-only: +1 415 968 0849 (no PIN needed) -LOCATION:https://www.uberconference.com/opencontainers -URL:https://github.com/opencontainers/runtime-spec/blob/master/meeting.ics -END:VEVENT -END:VCALENDAR diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md b/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md deleted file mode 100644 index 6c76963..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/principles.md +++ /dev/null @@ -1,46 +0,0 @@ -# The 5 principles of Standard Containers - -Define a unit of software delivery called a Standard Container. -The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container. - -The specification for Standard Containers defines: - -1. configuration file formats -2. a set of standard operations -3. an execution environment. - -A great analogy for this is the physical shipping container used by the transportation industry. -Shipping containers are a fundamental unit of delivery, they can be lifted, stacked, locked, loaded, unloaded and labelled. -Irrespective of their contents, by standardizing the container itself it allowed for a consistent, more streamlined and efficient set of processes to be defined. -For software Standard Containers offer similar functionality by being the fundamental, standardized, unit of delivery for a software package. - -## 1. Standard operations - -Standard Containers define a set of STANDARD OPERATIONS. -They can be created, started, and stopped using standard container tools; copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools. - -## 2. Content-agnostic - -Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. -They are started in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts. - -## 3. Infrastructure-agnostic - -Standard Containers are INFRASTRUCTURE-AGNOSTIC: they can be run in any OCI supported infrastructure. -For example, a standard container can be bundled on a laptop, uploaded to cloud storage, downloaded, run and snapshotted by a build server at a fiber hotel in Virginia, uploaded to 10 staging servers in a home-made private cloud cluster, then sent to 30 production instances across 3 public cloud regions. - -## 4. Designed for automation - -Standard Containers are DESIGNED FOR AUTOMATION: because they offer the same standard operations regardless of content and infrastructure, Standard Containers, are extremely well-suited for automation. -In fact, you could say automation is their secret weapon. - -Many things that once required time-consuming and error-prone human effort can now be programmed. -Before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. -Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. -The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider. - -## 5. Industrial-grade delivery - -Standard Containers make INDUSTRIAL-GRADE DELIVERY of software a reality. -Leveraging all of the properties listed above, Standard Containers are enabling large and small enterprises to streamline and automate their software delivery pipelines. -Whether it is in-house devOps flows, or external customer-based software delivery mechanisms, Standard Containers are changing the way the community thinks about software packaging and delivery. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md deleted file mode 100644 index 16c6dbe..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime-linux.md +++ /dev/null @@ -1,21 +0,0 @@ -# Linux Runtime - -## File descriptors - -By default, only the `stdin`, `stdout` and `stderr` file descriptors are kept open for the application by the runtime. -The runtime MAY pass additional file descriptors to the application to support features such as [socket activation][socket-activated-containers]. -Some of the file descriptors MAY be redirected to `/dev/null` even though they are open. - -## Dev symbolic links - -While creating the container (step 2 in the [lifecycle](runtime.md#lifecycle)), runtimes MUST create the following symlinks if the source file exists after processing [`mounts`](config.md#mounts): - -| Source | Destination | -| --------------- | ----------- | -| /proc/self/fd | /dev/fd | -| /proc/self/fd/0 | /dev/stdin | -| /proc/self/fd/1 | /dev/stdout | -| /proc/self/fd/2 | /dev/stderr | - - -[socket-activated-containers]: http://0pointer.de/blog/projects/socket-activated-containers.html diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md b/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md deleted file mode 100644 index c45046b..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/runtime.md +++ /dev/null @@ -1,146 +0,0 @@ -# Runtime and Lifecycle - -## Scope of a Container - -The entity using a runtime to create a container MUST be able to use the operations defined in this specification against that same container. -Whether other entities using the same, or other, instance of the runtime can see that container is out of scope of this specification. - -## State - -The state of a container includes the following properties: - -* **`ociVersion`** (string, REQUIRED) is version of the Open Container Initiative Runtime Specification with which the state complies. -* **`id`** (string, REQUIRED) is the container's ID. - This MUST be unique across all containers on this host. - There is no requirement that it be unique across hosts. -* **`status`** (string, REQUIRED) is the runtime state of the container. - The value MAY be one of: - - * `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle)) - * `created`: the runtime has finished the [create operation](#create) (after step 2 in the [lifecycle](#lifecycle)), and the container process has neither exited nor executed the user-specified program - * `running`: the container process has executed the user-specified program but has not exited (after step 5 in the [lifecycle](#lifecycle)) - * `stopped`: the container process has exited (step 7 in the [lifecycle](#lifecycle)) - - Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. -* **`pid`** (int, REQUIRED when `status` is `created` or `running` on Linux, OPTIONAL on other platforms) is the ID of the container process, as seen by the host. -* **`bundle`** (string, REQUIRED) is the absolute path to the container's bundle directory. - This is provided so that consumers can find the container's configuration and root filesystem on the host. -* **`annotations`** (map, OPTIONAL) contains the list of annotations associated with the container. - If no annotations were provided then this property MAY either be absent or an empty map. - -The state MAY include additional properties. - -When serialized in JSON, the format MUST adhere to the following pattern: - -```json -{ - "ociVersion": "0.2.0", - "id": "oci-container1", - "status": "running", - "pid": 4422, - "bundle": "/containers/redis", - "annotations": { - "myKey": "myValue" - } -} -``` - -See [Query State](#query-state) for information on retrieving the state of a container. - -## Lifecycle -The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist. - -1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. -2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). - If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST [generate an error](#errors). - While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified program (from [`process`](config.md#process)) MUST NOT be run at this time. - Any updates to [`config.json`](config.md) after this step MUST NOT affect the container. -3. The [`prestart` hooks](config.md#prestart) MUST be invoked by the runtime. - If any `prestart` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -4. The [`createRuntime` hooks](config.md#createRuntime-hooks) MUST be invoked by the runtime. - If any `createRuntime` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -5. The [`createContainer` hooks](config.md#createContainer-hooks) MUST be invoked by the runtime. - If any `createContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -6. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. -7. The [`startContainer` hooks](config.md#startContainer-hooks) MUST be invoked by the runtime. - If any `startContainer` hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 12. -8. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process). -9. The [`poststart` hooks](config.md#poststart) MUST be invoked by the runtime. - If any `poststart` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. -10. The container process exits. - This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked. -11. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. -12. The container MUST be destroyed by undoing the steps performed during create phase (step 2). -13. The [`poststop` hooks](config.md#poststop) MUST be invoked by the runtime. - If any `poststop` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded. - -## Errors - -In cases where the specified operation generates an error, this specification does not mandate how, or even if, that error is returned or exposed to the user of an implementation. -Unless otherwise stated, generating an error MUST leave the state of the environment as if the operation were never attempted - modulo any possible trivial ancillary changes such as logging. - -## Warnings - -In cases where the specified operation logs a warning, this specification does not mandate how, or even if, that warning is returned or exposed to the user of an implementation. -Unless otherwise stated, logging a warning does not change the flow of the operation; it MUST continue as if the warning had not been logged. - -## Operations - -Unless otherwise stated, runtimes MUST support the following operations. - -Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations. - -### Query State - -`state ` - -This operation MUST [generate an error](#errors) if it is not provided the ID of a container. -Attempting to query a container that does not exist MUST [generate an error](#errors). -This operation MUST return the state of a container as specified in the [State](#state) section. - -### Create - -`create ` - -This operation MUST [generate an error](#errors) if it is not provided a path to the bundle and the container ID to associate with the container. -If the ID provided is not unique across all containers within the scope of the runtime, or is not valid in any other way, the implementation MUST [generate an error](#errors) and a new container MUST NOT be created. -This operation MUST create a new container. - -All of the properties configured in [`config.json`](config.md) except for [`process`](config.md#process) MUST be applied. -[`process.args`](config.md#process) MUST NOT be applied until triggered by the [`start`](#start) operation. -The remaining `process` properties MAY be applied by this operation. -If the runtime cannot apply a property as specified in the [configuration](config.md), it MUST [generate an error](#errors) and a new container MUST NOT be created. - -The runtime MAY validate `config.json` against this spec, either generically or with respect to the local system capabilities, before creating the container ([step 2](#lifecycle)). -Runtime callers who are interested in pre-create validation can run [bundle-validation tools](implementations.md#testing--tools) before invoking the create operation. - -Any changes made to the [`config.json`](config.md) file after this operation will not have an effect on the container. - -### Start -`start ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `start` a container that is not [`created`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -This operation MUST run the user-specified program as specified by [`process`](config.md#process). -This operation MUST generate an error if `process` was not set. - -### Kill -`kill ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to send a signal to a container that is neither [`created` nor `running`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -This operation MUST send the specified signal to the container process. - -### Delete -`delete ` - -This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). -Deleting a container MUST delete the resources that were created during the `create` step. -Note that resources associated with the container, but not created by this container, MUST NOT be deleted. -Once a container is deleted its ID MAY be used by a subsequent container. - - -## Hooks -Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation. -See [runtime configuration for hooks](./config.md#posix-platform-hooks) for more information. diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile deleted file mode 100644 index ac8c8d2..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -GOOD_TESTS = $(wildcard test/good/*.json) -BAD_TESTS = $(wildcard test/bad/*.json) - -default: validate - -help: - @echo "Usage: make [target]" - @echo - @echo " * 'fmt' - format the json with indentation" - @echo " * 'help' - show this help information" - @echo " * 'validate' - build the validation tool" - -fmt: - find . -name '*.json' -exec bash -c 'jq --indent 4 -M . {} > xx && mv xx {} || echo "skipping invalid {}"' \; - -.PHONY: validate -validate: validate.go - go get -d ./... - go build ./validate.go - -test: validate $(TESTS) - for TYPE in $$(ls test); \ - do \ - echo "testing $${TYPE}"; \ - for FILE in $$(ls "test/$${TYPE}/good"); \ - do \ - echo " testing test/$${TYPE}/good/$${FILE}"; \ - if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/good/$${FILE}" ; \ - then \ - echo " received expected validation success" ; \ - else \ - echo " received unexpected validation failure" ; \ - exit 1; \ - fi \ - done; \ - for FILE in $$(ls "test/$${TYPE}/bad"); \ - do \ - echo " testing test/$${TYPE}/bad/$${FILE}"; \ - if ./validate "$${TYPE}-schema.json" "test/$${TYPE}/bad/$${FILE}" ; \ - then \ - echo " received unexpected validation success" ; \ - exit 1; \ - else \ - echo " received expected validation failure" ; \ - fi \ - done; \ - done - -clean: - rm -f validate diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md deleted file mode 100644 index fecc467..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# JSON schema - -## Overview - -This directory contains the [JSON Schema](http://json-schema.org/) for validating JSON covered by this specification. - -The layout of the files is as follows: - -* [config-schema.json](config-schema.json) - the primary entrypoint for the [configuration](../config.md) schema -* [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md) -* [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md) -* [config-windows.json](config-windows.json) - the [Windows-specific configuration sub-structure](../config-windows.md) -* [state-schema.json](state-schema.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema -* [defs.json](defs.json) - definitions for general types -* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types -* [defs-windows.json](defs-windows.json) - definitions for Windows-specific types -* [validate.go](validate.go) - validation utility source code - - -## Utility - -There is also included a simple utility for facilitating validation. -To build it: - -```bash -export GOPATH=`mktemp -d` -go get -d ./... -go build ./validate.go -rm -rf $GOPATH -``` - -Or you can just use make command to create the utility: - -```bash -make validate -``` - -Then use it like: - -```bash -./validate config-schema.json /config.json -``` - -Or like: - -```bash -./validate https://raw.githubusercontent.com/opencontainers/runtime-spec/v1.0.0/schema/schema.json /config.json -``` diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json deleted file mode 100644 index 98295c4..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-linux.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "linux": { - "description": "Linux platform-specific configurations", - "type": "object", - "properties": { - "devices": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/Device" - } - }, - "uidMappings": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/IDMapping" - } - }, - "gidMappings": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/IDMapping" - } - }, - "namespaces": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "defs-linux.json#/definitions/NamespaceReference" - } - ] - } - }, - "resources": { - "type": "object", - "properties": { - "devices": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/DeviceCgroup" - } - }, - "pids": { - "type": "object", - "properties": { - "limit": { - "$ref": "defs.json#/definitions/int64" - } - }, - "required": [ - "limit" - ] - }, - "blockIO": { - "type": "object", - "properties": { - "weight": { - "$ref": "defs-linux.json#/definitions/weight" - }, - "leafWeight": { - "$ref": "defs-linux.json#/definitions/weight" - }, - "throttleReadBpsDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleWriteBpsDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleReadIOPSDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "throttleWriteIOPSDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceThrottle" - } - }, - "weightDevice": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/blockIODeviceWeight" - } - } - } - }, - "cpu": { - "type": "object", - "properties": { - "cpus": { - "type": "string" - }, - "mems": { - "type": "string" - }, - "period": { - "$ref": "defs.json#/definitions/uint64" - }, - "quota": { - "$ref": "defs.json#/definitions/int64" - }, - "realtimePeriod": { - "$ref": "defs.json#/definitions/uint64" - }, - "realtimeRuntime": { - "$ref": "defs.json#/definitions/int64" - }, - "shares": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "hugepageLimits": { - "type": "array", - "items": { - "type": "object", - "properties": { - "pageSize": { - "type": "string", - "pattern": "^[1-9][0-9]*[KMG]B$" - }, - "limit": { - "$ref": "defs.json#/definitions/uint64" - } - }, - "required": [ - "pageSize", - "limit" - ] - } - }, - "memory": { - "type": "object", - "properties": { - "kernel": { - "$ref": "defs.json#/definitions/int64" - }, - "kernelTCP": { - "$ref": "defs.json#/definitions/int64" - }, - "limit": { - "$ref": "defs.json#/definitions/int64" - }, - "reservation": { - "$ref": "defs.json#/definitions/int64" - }, - "swap": { - "$ref": "defs.json#/definitions/int64" - }, - "swappiness": { - "$ref": "defs.json#/definitions/uint64" - }, - "disableOOMKiller": { - "type": "boolean" - }, - "useHierarchy": { - "type": "boolean" - } - } - }, - "network": { - "type": "object", - "properties": { - "classID": { - "$ref": "defs.json#/definitions/uint32" - }, - "priorities": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/NetworkInterfacePriority" - } - } - } - }, - "rdma": { - "type": "object", - "additionalProperties": { - "$ref": "defs-linux.json#/definitions/Rdma" - } - } - } - }, - "cgroupsPath": { - "type": "string" - }, - "rootfsPropagation": { - "$ref": "defs-linux.json#/definitions/RootfsPropagation" - }, - "seccomp": { - "type": "object", - "properties": { - "defaultAction": { - "$ref": "defs-linux.json#/definitions/SeccompAction" - }, - "flags": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/SeccompFlag" - } - }, - "architectures": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/SeccompArch" - } - }, - "syscalls": { - "type": "array", - "items": { - "$ref": "defs-linux.json#/definitions/Syscall" - } - } - }, - "required": [ - "defaultAction" - ] - }, - "sysctl": { - "$ref": "defs.json#/definitions/mapStringString" - }, - "maskedPaths": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "readonlyPaths": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "mountLabel": { - "type": "string" - }, - "intelRdt": { - "type": "object", - "properties": { - "closID": { - "type": "string" - }, - "l3CacheSchema": { - "type": "string" - }, - "memBwSchema": { - "type": "string", - "pattern": "^MB:[^\\n]*$" - } - } - }, - "personality": { - "type": "object", - "$ref": "defs-linux.json#/definitions/Personality" - } - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json deleted file mode 100644 index 94923b3..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-schema.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "description": "Open Container Initiative Runtime Specification Container Configuration Schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "ociVersion": { - "$ref": "defs.json#/definitions/ociVersion" - }, - "hooks": { - "type": "object", - "properties": { - "prestart": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "createRuntime": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "createContainer": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "startContainer": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "poststart": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - }, - "poststop": { - "$ref": "defs.json#/definitions/ArrayOfHooks" - } - } - }, - "annotations": { - "$ref": "defs.json#/definitions/annotations" - }, - "hostname": { - "type": "string" - }, - "mounts": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/Mount" - } - }, - "root": { - "description": "Configures the container's root filesystem.", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "readonly": { - "type": "boolean" - } - } - }, - "process": { - "type": "object", - "required": [ - "cwd" - ], - "properties": { - "args": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "commandLine": { - "type": "string" - }, - "consoleSize": { - "type": "object", - "required": [ - "height", - "width" - ], - "properties": { - "height": { - "$ref": "defs.json#/definitions/uint64" - }, - "width": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "cwd": { - "type": "string" - }, - "env": { - "$ref": "defs.json#/definitions/Env" - }, - "terminal": { - "type": "boolean" - }, - "user": { - "type": "object", - "properties": { - "uid": { - "$ref": "defs.json#/definitions/UID" - }, - "gid": { - "$ref": "defs.json#/definitions/GID" - }, - "umask": { - "$ref": "defs.json#/definitions/Umask" - }, - "additionalGids": { - "$ref": "defs.json#/definitions/ArrayOfGIDs" - }, - "username": { - "type": "string" - } - } - }, - "capabilities": { - "type": "object", - "properties": { - "bounding": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "permitted": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "effective": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "inheritable": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "ambient": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "apparmorProfile": { - "type": "string" - }, - "oomScoreAdj": { - "type": "integer" - }, - "selinuxLabel": { - "type": "string" - }, - "noNewPrivileges": { - "type": "boolean" - }, - "rlimits": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "soft", - "hard" - ], - "properties": { - "hard": { - "$ref": "defs.json#/definitions/uint64" - }, - "soft": { - "$ref": "defs.json#/definitions/uint64" - }, - "type": { - "type": "string", - "pattern": "^RLIMIT_[A-Z]+$" - } - } - } - } - } - }, - "linux": { - "$ref": "config-linux.json#/linux" - }, - "solaris": { - "$ref": "config-solaris.json#/solaris" - }, - "windows": { - "$ref": "config-windows.json#/windows" - }, - "vm": { - "$ref": "config-vm.json#/vm" - } - }, - "required": [ - "ociVersion" - ] -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json deleted file mode 100644 index be9f4d2..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-solaris.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "solaris": { - "description": "Solaris platform-specific configurations", - "type": "object", - "properties": { - "milestone": { - "type": "string" - }, - "limitpriv": { - "type": "string" - }, - "maxShmMemory": { - "type": "string" - }, - "cappedCPU": { - "type": "object", - "properties": { - "ncpus": { - "type": "string" - } - } - }, - "cappedMemory": { - "type": "object", - "properties": { - "physical": { - "type": "string" - }, - "swap": { - "type": "string" - } - } - }, - "anet": { - "type": "array", - "items": { - "type": "object", - "properties": { - "linkname": { - "type": "string" - }, - "lowerLink": { - "type": "string" - }, - "allowedAddress": { - "type": "string" - }, - "configureAllowedAddress": { - "type": "string" - }, - "defrouter": { - "type": "string" - }, - "macAddress": { - "type": "string" - }, - "linkProtection": { - "type": "string" - } - } - } - } - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json deleted file mode 100644 index 6b1fb4b..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-vm.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "vm": { - "description": "configuration for virtual-machine-based containers", - "type": "object", - "required": [ - "kernel" - ], - "properties": { - "hypervisor": { - "description": "hypervisor config used by VM-based containers", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "parameters": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "kernel": { - "description": "kernel config used by VM-based containers", - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "parameters": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "initrd": { - "$ref": "defs.json#/definitions/FilePath" - } - } - }, - "image": { - "description": "root image config used by VM-based containers", - "type": "object", - "required": [ - "path", - "format" - ], - "properties": { - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "format": { - "$ref": "defs-vm.json#/definitions/RootImageFormat" - } - } - } - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json deleted file mode 100644 index 68b51e9..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/config-windows.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "windows": { - "description": "Windows platform-specific configurations", - "type": "object", - "properties": { - "layerFolders": { - "type": "array", - "items": { - "$ref": "defs.json#/definitions/FilePath" - }, - "minItems": 1 - }, - "devices": { - "type": "array", - "items": { - "$ref": "defs-windows.json#/definitions/Device" - } - }, - "resources": { - "type": "object", - "properties": { - "memory": { - "type": "object", - "properties": { - "limit": { - "$ref": "defs.json#/definitions/uint64" - } - } - }, - "cpu": { - "type": "object", - "properties": { - "count": { - "$ref": "defs.json#/definitions/uint64" - }, - "shares": { - "$ref": "defs.json#/definitions/uint16" - }, - "maximum": { - "$ref": "defs.json#/definitions/uint16" - } - } - }, - "storage": { - "type": "object", - "properties": { - "iops": { - "$ref": "defs.json#/definitions/uint64" - }, - "bps": { - "$ref": "defs.json#/definitions/uint64" - }, - "sandboxSize": { - "$ref": "defs.json#/definitions/uint64" - } - } - } - } - }, - "network": { - "type": "object", - "properties": { - "endpointList": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "allowUnqualifiedDNSQuery": { - "type": "boolean" - }, - "DNSSearchList": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - }, - "networkSharedContainerName": { - "type": "string" - }, - "networkNamespace": { - "type": "string" - } - } - }, - "credentialSpec": { - "type": "object" - }, - "servicing": { - "type": "boolean" - }, - "ignoreFlushesDuringBoot": { - "type": "boolean" - }, - "hyperv": { - "type": "object", - "properties": { - "utilityVMPath": { - "type": "string" - } - } - } - }, - "required": [ - "layerFolders" - ] - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json deleted file mode 100644 index f011b72..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-linux.json +++ /dev/null @@ -1,308 +0,0 @@ -{ - "definitions": { - "PersonalityDomain": { - "type": "string", - "enum": [ - "LINUX", - "LINUX32" - ] - }, - "Personality": { - "type": "object", - "properties": { - "domain": { - "$ref": "#/definitions/PersonalityDomain" - }, - "flags": { - "$ref": "defs.json#/definitions/ArrayOfStrings" - } - } - }, - "RootfsPropagation": { - "type": "string", - "enum": [ - "private", - "shared", - "slave", - "unbindable" - ] - }, - "SeccompArch": { - "type": "string", - "enum": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X86_64", - "SCMP_ARCH_X32", - "SCMP_ARCH_ARM", - "SCMP_ARCH_AARCH64", - "SCMP_ARCH_MIPS", - "SCMP_ARCH_MIPS64", - "SCMP_ARCH_MIPS64N32", - "SCMP_ARCH_MIPSEL", - "SCMP_ARCH_MIPSEL64", - "SCMP_ARCH_MIPSEL64N32", - "SCMP_ARCH_PPC", - "SCMP_ARCH_PPC64", - "SCMP_ARCH_PPC64LE", - "SCMP_ARCH_S390", - "SCMP_ARCH_S390X", - "SCMP_ARCH_PARISC", - "SCMP_ARCH_PARISC64" - ] - }, - "SeccompAction": { - "type": "string", - "enum": [ - "SCMP_ACT_KILL", - "SCMP_ACT_TRAP", - "SCMP_ACT_ERRNO", - "SCMP_ACT_TRACE", - "SCMP_ACT_ALLOW", - "SCMP_ACT_LOG" - ] - }, - "SeccompFlag": { - "type": "string", - "enum": [ - "SECCOMP_FILTER_FLAG_TSYNC", - "SECCOMP_FILTER_FLAG_LOG", - "SECCOMP_FILTER_FLAG_SPEC_ALLOW" - ] - }, - "SeccompOperators": { - "type": "string", - "enum": [ - "SCMP_CMP_NE", - "SCMP_CMP_LT", - "SCMP_CMP_LE", - "SCMP_CMP_EQ", - "SCMP_CMP_GE", - "SCMP_CMP_GT", - "SCMP_CMP_MASKED_EQ" - ] - }, - "SyscallArg": { - "type": "object", - "properties": { - "index": { - "$ref": "defs.json#/definitions/uint32" - }, - "value": { - "$ref": "defs.json#/definitions/uint64" - }, - "valueTwo": { - "$ref": "defs.json#/definitions/uint64" - }, - "op": { - "$ref": "#/definitions/SeccompOperators" - } - }, - "required": [ - "index", - "value", - "op" - ] - }, - "Syscall": { - "type": "object", - "properties": { - "names": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "action": { - "$ref": "#/definitions/SeccompAction" - }, - "args": { - "type": "array", - "items": { - "$ref": "#/definitions/SyscallArg" - } - } - }, - "required": [ - "names", - "action" - ] - }, - "Major": { - "description": "major device number", - "$ref": "defs.json#/definitions/int64" - }, - "Minor": { - "description": "minor device number", - "$ref": "defs.json#/definitions/int64" - }, - "FileMode": { - "description": "File permissions mode (typically an octal value)", - "type": "integer", - "minimum": 0, - "maximum": 512 - }, - "FileType": { - "description": "Type of a block or special character device", - "type": "string", - "pattern": "^[cbup]$" - }, - "Device": { - "type": "object", - "required": [ - "type", - "path" - ], - "properties": { - "type": { - "$ref": "#/definitions/FileType" - }, - "path": { - "$ref": "defs.json#/definitions/FilePath" - }, - "fileMode": { - "$ref": "#/definitions/FileMode" - }, - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - }, - "uid": { - "$ref": "defs.json#/definitions/UID" - }, - "gid": { - "$ref": "defs.json#/definitions/GID" - } - } - }, - "weight": { - "$ref": "defs.json#/definitions/uint16" - }, - "blockIODevice": { - "type": "object", - "properties": { - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - } - }, - "required": [ - "major", - "minor" - ] - }, - "blockIODeviceWeight": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/blockIODevice" - }, - { - "type": "object", - "properties": { - "weight": { - "$ref": "#/definitions/weight" - }, - "leafWeight": { - "$ref": "#/definitions/weight" - } - } - } - ] - }, - "blockIODeviceThrottle": { - "allOf": [ - { - "$ref": "#/definitions/blockIODevice" - }, - { - "type": "object", - "properties": { - "rate": { - "$ref": "defs.json#/definitions/uint64" - } - } - } - ] - }, - "DeviceCgroup": { - "type": "object", - "properties": { - "allow": { - "type": "boolean" - }, - "type": { - "type": "string" - }, - "major": { - "$ref": "#/definitions/Major" - }, - "minor": { - "$ref": "#/definitions/Minor" - }, - "access": { - "type": "string" - } - }, - "required": [ - "allow" - ] - }, - "NetworkInterfacePriority": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "priority": { - "$ref": "defs.json#/definitions/uint32" - } - }, - "required": [ - "name", - "priority" - ] - }, - "Rdma": { - "type": "object", - "properties": { - "hcaHandles": { - "$ref": "defs.json#/definitions/uint32" - }, - "hcaObjects": { - "$ref": "defs.json#/definitions/uint32" - } - } - }, - "NamespaceType": { - "type": "string", - "enum": [ - "mount", - "pid", - "network", - "uts", - "ipc", - "user", - "cgroup" - ] - }, - "NamespaceReference": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/NamespaceType" - }, - "path": { - "$ref": "defs.json#/definitions/FilePath" - } - }, - "required": [ - "type" - ] - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json deleted file mode 100644 index 4dae915..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-vm.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "definitions": { - "RootImageFormat": { - "type": "string", - "enum": [ - "raw", - "qcow2", - "vdi", - "vmdk", - "vhd" - ] - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json deleted file mode 100644 index 63e0ac3..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs-windows.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "definitions": { - "Device": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "idType": { - "type": "string", - "enum": [ - "class" - ] - } - }, - "required": [ - "id", - "idType" - ] - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json deleted file mode 100644 index 58b07e6..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/defs.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "description": "Definitions used throughout the Open Container Initiative Runtime Specification", - "definitions": { - "int8": { - "type": "integer", - "minimum": -128, - "maximum": 127 - }, - "int16": { - "type": "integer", - "minimum": -32768, - "maximum": 32767 - }, - "int32": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - }, - "int64": { - "type": "integer", - "minimum": -9223372036854776000, - "maximum": 9223372036854776000 - }, - "uint8": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "uint16": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "uint32": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "uint64": { - "type": "integer", - "minimum": 0, - "maximum": 18446744073709552000 - }, - "percent": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "mapStringString": { - "type": "object", - "patternProperties": { - ".{1,}": { - "type": "string" - } - } - }, - "UID": { - "$ref": "#/definitions/uint32" - }, - "GID": { - "$ref": "#/definitions/uint32" - }, - "Umask": { - "$ref": "#/definitions/uint32" - }, - "ArrayOfGIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/GID" - } - }, - "ArrayOfStrings": { - "type": "array", - "items": { - "type": "string" - } - }, - "FilePath": { - "type": "string" - }, - "Env": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "Hook": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/FilePath" - }, - "args": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "env": { - "$ref": "#/definitions/Env" - }, - "timeout": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "path" - ] - }, - "ArrayOfHooks": { - "type": "array", - "items": { - "$ref": "#/definitions/Hook" - } - }, - "IDMapping": { - "type": "object", - "properties": { - "containerID": { - "$ref": "#/definitions/uint32" - }, - "hostID": { - "$ref": "#/definitions/uint32" - }, - "size": { - "$ref": "#/definitions/uint32" - } - }, - "required": [ - "containerID", - "hostID", - "size" - ] - }, - "Mount": { - "type": "object", - "properties": { - "source": { - "$ref": "#/definitions/FilePath" - }, - "destination": { - "$ref": "#/definitions/FilePath" - }, - "options": { - "$ref": "#/definitions/ArrayOfStrings" - }, - "type": { - "type": "string" - } - }, - "required": [ - "destination" - ] - }, - "ociVersion": { - "description": "The version of Open Container Initiative Runtime Specification that the document complies with", - "type": "string" - }, - "annotations": { - "$ref": "#/definitions/mapStringString" - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json deleted file mode 100644 index 8f82429..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/state-schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "Open Container Runtime State Schema", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "properties": { - "ociVersion": { - "$ref": "defs.json#/definitions/ociVersion" - }, - "id": { - "description": "the container's ID", - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "creating", - "created", - "running", - "stopped" - ] - }, - "pid": { - "type": "integer", - "minimum": 0 - }, - "bundle": { - "type": "string" - }, - "annotations": { - "$ref": "defs.json#/definitions/annotations" - } - }, - "required": [ - "ociVersion", - "id", - "status", - "bundle" - ] -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json deleted file mode 100644 index 8e93528..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/invalid-json.json +++ /dev/null @@ -1 +0,0 @@ -{] diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json deleted file mode 100644 index aea35eb..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-hugepage.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "hugepageLimits": [ - { - "limit": 1234123, - "pageSize": "64kB" - } - ] - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json deleted file mode 100644 index 5a7ac69..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/bad/linux-rdma.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "rdma": { - "mlx5_1": { - "hcaHandles": "not a uint32" - } - } - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json deleted file mode 100644 index e70ed53..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/linux-rdma.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "linux": { - "resources": { - "rdma": { - "mlx5_1": { - "hcaHandles": 3, - "hcaObjects": 10000 - }, - "mlx4_0": { - "hcaObjects": 1000 - }, - "rxe3": { - "hcaObjects": 10000 - } - } - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json deleted file mode 100644 index 766d2d3..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal-for-start.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - }, - "process": { - "cwd": "/", - "args": [ - "sh" - ], - "user": { - "uid": 0, - "gid": 0 - } - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json deleted file mode 100644 index e26e9d7..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/minimal.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ociVersion": "1.0.0", - "root": { - "path": "rootfs" - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json deleted file mode 100644 index a784d1d..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/config/good/spec-example.json +++ /dev/null @@ -1,395 +0,0 @@ -{ - "ociVersion": "0.5.0-dev", - "process": { - "terminal": true, - "user": { - "uid": 1, - "gid": 1, - "additionalGids": [ - 5, - 6 - ] - }, - "args": [ - "sh" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL" - ], - "ambient": [ - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_CORE", - "hard": 1024, - "soft": 1024 - }, - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "apparmorProfile": "acme_secure_profile", - "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675", - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "slartibartfast", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "hooks": { - "prestart": [ - { - "path": "/usr/bin/fix-mounts", - "args": [ - "fix-mounts", - "arg1", - "arg2" - ], - "env": [ - "key1=value1" - ] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createRuntime": [ - { - "path": "/usr/bin/fix-mounts", - "args": ["fix-mounts", "arg1", "arg2"], - "env": [ "key1=value1"] - }, - { - "path": "/usr/bin/setup-network" - } - ], - "createContainer": [ - { - "path": "/usr/bin/mount-hook", - "args": ["-mount", "arg1", "arg2"], - "env": [ "key1=value1"] - } - ], - "startContainer": [ - { - "path": "/usr/bin/refresh-ldcache" - } - ], - "poststart": [ - { - "path": "/usr/bin/notify-start", - "timeout": 5 - } - ], - "poststop": [ - { - "path": "/usr/sbin/cleanup.sh", - "args": [ - "cleanup.sh", - "-f" - ] - } - ] - }, - "linux": { - "devices": [ - { - "path": "/dev/fuse", - "type": "c", - "major": 10, - "minor": 229, - "fileMode": 438, - "uid": 0, - "gid": 0 - }, - { - "path": "/dev/sda", - "type": "b", - "major": 8, - "minor": 0, - "fileMode": 432, - "uid": 0, - "gid": 0 - } - ], - "uidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "gidMappings": [ - { - "containerID": 0, - "hostID": 1000, - "size": 32000 - } - ], - "sysctl": { - "net.ipv4.ip_forward": "1", - "net.core.somaxconn": "256" - }, - "cgroupsPath": "/myRuntime/myContainer", - "resources": { - "network": { - "classID": 1048577, - "priorities": [ - { - "name": "eth0", - "priority": 500 - }, - { - "name": "eth1", - "priority": 1000 - } - ] - }, - "pids": { - "limit": 32771 - }, - "hugepageLimits": [ - { - "pageSize": "2MB", - "limit": 9223372036854772000 - }, - { - "pageSize": "64KB", - "limit": 1000000 - } - ], - "oomScoreAdj": 100, - "memory": { - "limit": 536870912, - "reservation": 536870912, - "swap": 536870912, - "kernel": -1, - "kernelTCP": -1, - "swappiness": 0, - "disableOOMKiller": false, - "useHierarchy": false - }, - "cpu": { - "shares": 1024, - "quota": 1000000, - "period": 500000, - "realtimeRuntime": 950000, - "realtimePeriod": 1000000, - "cpus": "2-3", - "mems": "0-7" - }, - "devices": [ - { - "allow": false, - "access": "rwm" - }, - { - "allow": true, - "type": "c", - "major": 10, - "minor": 229, - "access": "rw" - }, - { - "allow": true, - "type": "b", - "major": 8, - "minor": 0, - "access": "r" - } - ], - "blockIO": { - "weight": 10, - "leafWeight": 10, - "weightDevice": [ - { - "major": 8, - "minor": 0, - "weight": 500, - "leafWeight": 300 - }, - { - "major": 8, - "minor": 16, - "weight": 500 - } - ], - "throttleReadBpsDevice": [ - { - "major": 8, - "minor": 0, - "rate": 600 - } - ], - "throttleWriteIOPSDevice": [ - { - "major": 8, - "minor": 16, - "rate": 300 - } - ] - } - }, - "rootfsPropagation": "slave", - "seccomp": { - "defaultAction": "SCMP_ACT_ALLOW", - "architectures": [ - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" - ], - "syscalls": [ - { - "names": [ - "getcwd", - "chmod" - ], - "action": "SCMP_ACT_ERRNO" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "network" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - }, - { - "type": "user" - }, - { - "type": "cgroup" - } - ], - "maskedPaths": [ - "/proc/kcore", - "/proc/latency_stats", - "/proc/timer_stats", - "/proc/sched_debug" - ], - "readonlyPaths": [ - "/proc/asound", - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger" - ], - "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811" - }, - "annotations": { - "com.example.key1": "value1", - "com.example.key2": "value2" - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json deleted file mode 100644 index 8e93528..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/bad/invalid-json.json +++ /dev/null @@ -1 +0,0 @@ -{] diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json deleted file mode 100644 index a49faee..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/test/state/good/spec-example.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ociVersion": "0.2.0", - "id": "oci-container1", - "status": "running", - "pid": 4422, - "bundle": "/containers/redis", - "annotations": { - "myKey": "myValue" - } -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go b/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go deleted file mode 100644 index 847d205..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/schema/validate.go +++ /dev/null @@ -1,100 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/xeipuuv/gojsonschema" -) - -const usage = `Validate is used to check document with specified schema. -You can use validate in following ways: - - 1.specify document file as an argument - validate - - 2.pass document content through a pipe - cat | validate - - 3.input document content manually, ended with ctrl+d(or your self-defined EOF keys) - validate - [INPUT DOCUMENT CONTENT HERE] -` - -func main() { - nargs := len(os.Args[1:]) - if nargs == 0 || nargs > 2 { - fmt.Printf("ERROR: invalid arguments number\n\n%s\n", usage) - os.Exit(1) - } - - if os.Args[1] == "help" || - os.Args[1] == "--help" || - os.Args[1] == "-h" { - fmt.Printf("%s\n", usage) - os.Exit(1) - } - - schemaPath := os.Args[1] - if !strings.Contains(schemaPath, "://") { - var err error - schemaPath, err = formatFilePath(schemaPath) - if err != nil { - fmt.Printf("ERROR: invalid schema-file path: %s\n", err) - os.Exit(1) - } - schemaPath = "file://" + schemaPath - } - - schemaLoader := gojsonschema.NewReferenceLoader(schemaPath) - - var documentLoader gojsonschema.JSONLoader - - if nargs > 1 { - documentPath, err := formatFilePath(os.Args[2]) - if err != nil { - fmt.Printf("ERROR: invalid document-file path: %s\n", err) - os.Exit(1) - } - documentLoader = gojsonschema.NewReferenceLoader("file://" + documentPath) - } else { - documentBytes, err := ioutil.ReadAll(os.Stdin) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - documentString := string(documentBytes) - documentLoader = gojsonschema.NewStringLoader(documentString) - } - - result, err := gojsonschema.Validate(schemaLoader, documentLoader) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - if result.Valid() { - fmt.Printf("The document is valid\n") - } else { - fmt.Printf("The document is not valid. see errors :\n") - for _, desc := range result.Errors() { - fmt.Printf("- %s\n", desc) - } - os.Exit(1) - } -} - -func formatFilePath(path string) (string, error) { - if _, err := os.Stat(path); err != nil { - return "", err - } - - absPath, err := filepath.Abs(path) - if err != nil { - return "", err - } - return absPath, nil -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md b/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md deleted file mode 100644 index 684713a..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/spec.md +++ /dev/null @@ -1,48 +0,0 @@ -# Open Container Initiative Runtime Specification - -The [Open Container Initiative][oci] develops specifications for standards on Operating System process and application containers. - -# Abstract - -The Open Container Initiative Runtime Specification aims to specify the configuration, execution environment, and lifecycle of a container. - -A container's configuration is specified as the `config.json` for the supported platforms and details the fields that enable the creation of a container. -The execution environment is specified to ensure that applications running inside a container have a consistent environment between runtimes along with common actions defined for the container's lifecycle. - -# Platforms - -Platforms defined by this specification are: - -* `linux`: [runtime.md](runtime.md), [config.md](config.md), [config-linux.md](config-linux.md), and [runtime-linux.md](runtime-linux.md). -* `solaris`: [runtime.md](runtime.md), [config.md](config.md), and [config-solaris.md](config-solaris.md). -* `windows`: [runtime.md](runtime.md), [config.md](config.md), and [config-windows.md](config-windows.md). -* `vm`: [runtime.md](runtime.md), [config.md](config.md), and [config-vm.md](config-vm.md). - -# Table of Contents - -- [Introduction](spec.md) - - [Notational Conventions](#notational-conventions) - - [Container Principles](principles.md) -- [Filesystem Bundle](bundle.md) -- [Runtime and Lifecycle](runtime.md) - - [Linux-specific Runtime and Lifecycle](runtime-linux.md) -- [Configuration](config.md) - - [Linux-specific Configuration](config-linux.md) - - [Solaris-specific Configuration](config-solaris.md) - - [Windows-specific Configuration](config-windows.md) - - [Virtual-Machine-specific Configuration](config-vm.md) -- [Glossary](glossary.md) - -# Notational Conventions - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC 2119][rfc2119]. - -The key words "unspecified", "undefined", and "implementation-defined" are to be interpreted as described in the [rationale for the C99 standard][c99-unspecified]. - -An implementation is not compliant for a given CPU architecture if it fails to satisfy one or more of the MUST, REQUIRED, or SHALL requirements for the [platforms](#platforms) it implements. -An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the [platforms](#platforms) it implements. - - -[c99-unspecified]: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf#page=18 -[oci]: http://www.opencontainers.org -[rfc2119]: http://tools.ietf.org/html/rfc2119 diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go deleted file mode 100644 index c7c7c3d..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go +++ /dev/null @@ -1,689 +0,0 @@ -package specs - -import "os" - -// Spec is the base configuration for the container. -type Spec struct { - // Version of the Open Container Initiative Runtime Specification with which the bundle complies. - Version string `json:"ociVersion"` - // Process configures the container process. - Process *Process `json:"process,omitempty"` - // Root configures the container's root filesystem. - Root *Root `json:"root,omitempty"` - // Hostname configures the container's hostname. - Hostname string `json:"hostname,omitempty"` - // Mounts configures additional mounts (on top of Root). - Mounts []Mount `json:"mounts,omitempty"` - // Hooks configures callbacks for container lifecycle events. - Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"` - // Annotations contains arbitrary metadata for the container. - Annotations map[string]string `json:"annotations,omitempty"` - - // Linux is platform-specific configuration for Linux based containers. - Linux *Linux `json:"linux,omitempty" platform:"linux"` - // Solaris is platform-specific configuration for Solaris based containers. - Solaris *Solaris `json:"solaris,omitempty" platform:"solaris"` - // Windows is platform-specific configuration for Windows based containers. - Windows *Windows `json:"windows,omitempty" platform:"windows"` - // VM specifies configuration for virtual-machine-based containers. - VM *VM `json:"vm,omitempty" platform:"vm"` -} - -// Process contains information to start a specific application inside the container. -type Process struct { - // Terminal creates an interactive terminal for the container. - Terminal bool `json:"terminal,omitempty"` - // ConsoleSize specifies the size of the console. - ConsoleSize *Box `json:"consoleSize,omitempty"` - // User specifies user information for the process. - User User `json:"user"` - // Args specifies the binary and arguments for the application to execute. - Args []string `json:"args,omitempty"` - // CommandLine specifies the full command line for the application to execute on Windows. - CommandLine string `json:"commandLine,omitempty" platform:"windows"` - // Env populates the process environment for the process. - Env []string `json:"env,omitempty"` - // Cwd is the current working directory for the process and must be - // relative to the container's root. - Cwd string `json:"cwd"` - // Capabilities are Linux capabilities that are kept for the process. - Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"` - // Rlimits specifies rlimit options to apply to the process. - Rlimits []POSIXRlimit `json:"rlimits,omitempty" platform:"linux,solaris"` - // NoNewPrivileges controls whether additional privileges could be gained by processes in the container. - NoNewPrivileges bool `json:"noNewPrivileges,omitempty" platform:"linux"` - // ApparmorProfile specifies the apparmor profile for the container. - ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` - // Specify an oom_score_adj for the container. - OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"` - // SelinuxLabel specifies the selinux context that the container process is run as. - SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` -} - -// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. -// http://man7.org/linux/man-pages/man7/capabilities.7.html -type LinuxCapabilities struct { - // Bounding is the set of capabilities checked by the kernel. - Bounding []string `json:"bounding,omitempty" platform:"linux"` - // Effective is the set of capabilities checked by the kernel. - Effective []string `json:"effective,omitempty" platform:"linux"` - // Inheritable is the capabilities preserved across execve. - Inheritable []string `json:"inheritable,omitempty" platform:"linux"` - // Permitted is the limiting superset for effective capabilities. - Permitted []string `json:"permitted,omitempty" platform:"linux"` - // Ambient is the ambient set of capabilities that are kept. - Ambient []string `json:"ambient,omitempty" platform:"linux"` -} - -// Box specifies dimensions of a rectangle. Used for specifying the size of a console. -type Box struct { - // Height is the vertical dimension of a box. - Height uint `json:"height"` - // Width is the horizontal dimension of a box. - Width uint `json:"width"` -} - -// User specifies specific user (and group) information for the container process. -type User struct { - // UID is the user id. - UID uint32 `json:"uid" platform:"linux,solaris"` - // GID is the group id. - GID uint32 `json:"gid" platform:"linux,solaris"` - // Umask is the umask for the init process. - Umask uint32 `json:"umask,omitempty" platform:"linux,solaris"` - // AdditionalGids are additional group ids set for the container's process. - AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` - // Username is the user name. - Username string `json:"username,omitempty" platform:"windows"` -} - -// Root contains information about the container's root filesystem on the host. -type Root struct { - // Path is the absolute path to the container's root filesystem. - Path string `json:"path"` - // Readonly makes the root filesystem for the container readonly before the process is executed. - Readonly bool `json:"readonly,omitempty"` -} - -// Mount specifies a mount for a container. -type Mount struct { - // Destination is the absolute path where the mount will be placed in the container. - Destination string `json:"destination"` - // Type specifies the mount kind. - Type string `json:"type,omitempty" platform:"linux,solaris"` - // Source specifies the source path of the mount. - Source string `json:"source,omitempty"` - // Options are fstab style mount options. - Options []string `json:"options,omitempty"` -} - -// Hook specifies a command that is run at a particular event in the lifecycle of a container -type Hook struct { - Path string `json:"path"` - Args []string `json:"args,omitempty"` - Env []string `json:"env,omitempty"` - Timeout *int `json:"timeout,omitempty"` -} - -// Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container -// Hooks for container setup and teardown -type Hooks struct { - // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed. - // It is called in the Runtime Namespace - Prestart []Hook `json:"prestart,omitempty"` - // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called - // It is called in the Runtime Namespace - CreateRuntime []Hook `json:"createRuntime,omitempty"` - // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called - // It is called in the Container Namespace - CreateContainer []Hook `json:"createContainer,omitempty"` - // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started - // It is called in the Container Namespace - StartContainer []Hook `json:"startContainer,omitempty"` - // Poststart is a list of hooks to be run after the container process is started. - // It is called in the Runtime Namespace - Poststart []Hook `json:"poststart,omitempty"` - // Poststop is a list of hooks to be run after the container process exits. - // It is called in the Runtime Namespace - Poststop []Hook `json:"poststop,omitempty"` -} - -// Linux contains platform-specific configuration for Linux based containers. -type Linux struct { - // UIDMapping specifies user mappings for supporting user namespaces. - UIDMappings []LinuxIDMapping `json:"uidMappings,omitempty"` - // GIDMapping specifies group mappings for supporting user namespaces. - GIDMappings []LinuxIDMapping `json:"gidMappings,omitempty"` - // Sysctl are a set of key value pairs that are set for the container on start - Sysctl map[string]string `json:"sysctl,omitempty"` - // Resources contain cgroup information for handling resource constraints - // for the container - Resources *LinuxResources `json:"resources,omitempty"` - // CgroupsPath specifies the path to cgroups that are created and/or joined by the container. - // The path is expected to be relative to the cgroups mountpoint. - // If resources are specified, the cgroups at CgroupsPath will be updated based on resources. - CgroupsPath string `json:"cgroupsPath,omitempty"` - // Namespaces contains the namespaces that are created and/or joined by the container - Namespaces []LinuxNamespace `json:"namespaces,omitempty"` - // Devices are a list of device nodes that are created for the container - Devices []LinuxDevice `json:"devices,omitempty"` - // Seccomp specifies the seccomp security settings for the container. - Seccomp *LinuxSeccomp `json:"seccomp,omitempty"` - // RootfsPropagation is the rootfs mount propagation mode for the container. - RootfsPropagation string `json:"rootfsPropagation,omitempty"` - // MaskedPaths masks over the provided paths inside the container. - MaskedPaths []string `json:"maskedPaths,omitempty"` - // ReadonlyPaths sets the provided paths as RO inside the container. - ReadonlyPaths []string `json:"readonlyPaths,omitempty"` - // MountLabel specifies the selinux context for the mounts in the container. - MountLabel string `json:"mountLabel,omitempty"` - // IntelRdt contains Intel Resource Director Technology (RDT) information for - // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container - IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` - // Personality contains configuration for the Linux personality syscall - Personality *LinuxPersonality `json:"personality,omitempty"` -} - -// LinuxNamespace is the configuration for a Linux namespace -type LinuxNamespace struct { - // Type is the type of namespace - Type LinuxNamespaceType `json:"type"` - // Path is a path to an existing namespace persisted on disk that can be joined - // and is of the same type - Path string `json:"path,omitempty"` -} - -// LinuxNamespaceType is one of the Linux namespaces -type LinuxNamespaceType string - -const ( - // PIDNamespace for isolating process IDs - PIDNamespace LinuxNamespaceType = "pid" - // NetworkNamespace for isolating network devices, stacks, ports, etc - NetworkNamespace LinuxNamespaceType = "network" - // MountNamespace for isolating mount points - MountNamespace LinuxNamespaceType = "mount" - // IPCNamespace for isolating System V IPC, POSIX message queues - IPCNamespace LinuxNamespaceType = "ipc" - // UTSNamespace for isolating hostname and NIS domain name - UTSNamespace LinuxNamespaceType = "uts" - // UserNamespace for isolating user and group IDs - UserNamespace LinuxNamespaceType = "user" - // CgroupNamespace for isolating cgroup hierarchies - CgroupNamespace LinuxNamespaceType = "cgroup" -) - -// LinuxIDMapping specifies UID/GID mappings -type LinuxIDMapping struct { - // ContainerID is the starting UID/GID in the container - ContainerID uint32 `json:"containerID"` - // HostID is the starting UID/GID on the host to be mapped to 'ContainerID' - HostID uint32 `json:"hostID"` - // Size is the number of IDs to be mapped - Size uint32 `json:"size"` -} - -// POSIXRlimit type and restrictions -type POSIXRlimit struct { - // Type of the rlimit to set - Type string `json:"type"` - // Hard is the hard limit for the specified type - Hard uint64 `json:"hard"` - // Soft is the soft limit for the specified type - Soft uint64 `json:"soft"` -} - -// LinuxHugepageLimit structure corresponds to limiting kernel hugepages -type LinuxHugepageLimit struct { - // Pagesize is the hugepage size - // Format: "B' (e.g. 64KB, 2MB, 1GB, etc.) - Pagesize string `json:"pageSize"` - // Limit is the limit of "hugepagesize" hugetlb usage - Limit uint64 `json:"limit"` -} - -// LinuxInterfacePriority for network interfaces -type LinuxInterfacePriority struct { - // Name is the name of the network interface - Name string `json:"name"` - // Priority for the interface - Priority uint32 `json:"priority"` -} - -// linuxBlockIODevice holds major:minor format supported in blkio cgroup -type linuxBlockIODevice struct { - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` -} - -// LinuxWeightDevice struct holds a `major:minor weight` pair for weightDevice -type LinuxWeightDevice struct { - linuxBlockIODevice - // Weight is the bandwidth rate for the device. - Weight *uint16 `json:"weight,omitempty"` - // LeafWeight is the bandwidth rate for the device while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` -} - -// LinuxThrottleDevice struct holds a `major:minor rate_per_second` pair -type LinuxThrottleDevice struct { - linuxBlockIODevice - // Rate is the IO rate limit per cgroup per device - Rate uint64 `json:"rate"` -} - -// LinuxBlockIO for Linux cgroup 'blkio' resource management -type LinuxBlockIO struct { - // Specifies per cgroup weight - Weight *uint16 `json:"weight,omitempty"` - // Specifies tasks' weight in the given cgroup while competing with the cgroup's child cgroups, CFQ scheduler only - LeafWeight *uint16 `json:"leafWeight,omitempty"` - // Weight per cgroup per device, can override BlkioWeight - WeightDevice []LinuxWeightDevice `json:"weightDevice,omitempty"` - // IO read rate limit per cgroup per device, bytes per second - ThrottleReadBpsDevice []LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"` - // IO write rate limit per cgroup per device, bytes per second - ThrottleWriteBpsDevice []LinuxThrottleDevice `json:"throttleWriteBpsDevice,omitempty"` - // IO read rate limit per cgroup per device, IO per second - ThrottleReadIOPSDevice []LinuxThrottleDevice `json:"throttleReadIOPSDevice,omitempty"` - // IO write rate limit per cgroup per device, IO per second - ThrottleWriteIOPSDevice []LinuxThrottleDevice `json:"throttleWriteIOPSDevice,omitempty"` -} - -// LinuxMemory for Linux cgroup 'memory' resource management -type LinuxMemory struct { - // Memory limit (in bytes). - Limit *int64 `json:"limit,omitempty"` - // Memory reservation or soft_limit (in bytes). - Reservation *int64 `json:"reservation,omitempty"` - // Total memory limit (memory + swap). - Swap *int64 `json:"swap,omitempty"` - // Kernel memory limit (in bytes). - Kernel *int64 `json:"kernel,omitempty"` - // Kernel memory limit for tcp (in bytes) - KernelTCP *int64 `json:"kernelTCP,omitempty"` - // How aggressive the kernel will swap memory pages. - Swappiness *uint64 `json:"swappiness,omitempty"` - // DisableOOMKiller disables the OOM killer for out of memory conditions - DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` - // Enables hierarchical memory accounting - UseHierarchy *bool `json:"useHierarchy,omitempty"` -} - -// LinuxCPU for Linux cgroup 'cpu' resource management -type LinuxCPU struct { - // CPU shares (relative weight (ratio) vs. other cgroups with cpu shares). - Shares *uint64 `json:"shares,omitempty"` - // CPU hardcap limit (in usecs). Allowed cpu time in a given period. - Quota *int64 `json:"quota,omitempty"` - // CPU period to be used for hardcapping (in usecs). - Period *uint64 `json:"period,omitempty"` - // How much time realtime scheduling may use (in usecs). - RealtimeRuntime *int64 `json:"realtimeRuntime,omitempty"` - // CPU period to be used for realtime scheduling (in usecs). - RealtimePeriod *uint64 `json:"realtimePeriod,omitempty"` - // CPUs to use within the cpuset. Default is to use any CPU available. - Cpus string `json:"cpus,omitempty"` - // List of memory nodes in the cpuset. Default is to use any available memory node. - Mems string `json:"mems,omitempty"` -} - -// LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) -type LinuxPids struct { - // Maximum number of PIDs. Default is "no limit". - Limit int64 `json:"limit"` -} - -// LinuxNetwork identification and priority configuration -type LinuxNetwork struct { - // Set class identifier for container's network packets - ClassID *uint32 `json:"classID,omitempty"` - // Set priority of network traffic for container - Priorities []LinuxInterfacePriority `json:"priorities,omitempty"` -} - -// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) -type LinuxRdma struct { - // Maximum number of HCA handles that can be opened. Default is "no limit". - HcaHandles *uint32 `json:"hcaHandles,omitempty"` - // Maximum number of HCA objects that can be created. Default is "no limit". - HcaObjects *uint32 `json:"hcaObjects,omitempty"` -} - -// LinuxResources has container runtime resource constraints -type LinuxResources struct { - // Devices configures the device whitelist. - Devices []LinuxDeviceCgroup `json:"devices,omitempty"` - // Memory restriction configuration - Memory *LinuxMemory `json:"memory,omitempty"` - // CPU resource restriction configuration - CPU *LinuxCPU `json:"cpu,omitempty"` - // Task resource restriction configuration. - Pids *LinuxPids `json:"pids,omitempty"` - // BlockIO restriction configuration - BlockIO *LinuxBlockIO `json:"blockIO,omitempty"` - // Hugetlb limit (in bytes) - HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"` - // Network restriction configuration - Network *LinuxNetwork `json:"network,omitempty"` - // Rdma resource restriction configuration. - // Limits are a set of key value pairs that define RDMA resource limits, - // where the key is device name and value is resource limits. - Rdma map[string]LinuxRdma `json:"rdma,omitempty"` -} - -// LinuxDevice represents the mknod information for a Linux special device file -type LinuxDevice struct { - // Path to the device. - Path string `json:"path"` - // Device type, block, char, etc. - Type string `json:"type"` - // Major is the device's major number. - Major int64 `json:"major"` - // Minor is the device's minor number. - Minor int64 `json:"minor"` - // FileMode permission bits for the device. - FileMode *os.FileMode `json:"fileMode,omitempty"` - // UID of the device. - UID *uint32 `json:"uid,omitempty"` - // Gid of the device. - GID *uint32 `json:"gid,omitempty"` -} - -// LinuxDeviceCgroup represents a device rule for the whitelist controller -type LinuxDeviceCgroup struct { - // Allow or deny - Allow bool `json:"allow"` - // Device type, block, char, etc. - Type string `json:"type,omitempty"` - // Major is the device's major number. - Major *int64 `json:"major,omitempty"` - // Minor is the device's minor number. - Minor *int64 `json:"minor,omitempty"` - // Cgroup access permissions format, rwm. - Access string `json:"access,omitempty"` -} - -// LinuxPersonalityDomain refers to a personality domain. -type LinuxPersonalityDomain string - -// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined. -type LinuxPersonalityFlag string - -// Define domain and flags for Personality -const ( - // PerLinux is the standard Linux personality - PerLinux LinuxPersonalityDomain = "LINUX" - // PerLinux32 sets personality to 32 bit - PerLinux32 LinuxPersonalityDomain = "LINUX32" -) - -// LinuxPersonality represents the Linux personality syscall input -type LinuxPersonality struct { - // Domain for the personality - Domain LinuxPersonalityDomain `json:"domain"` - // Additional flags - Flags []LinuxPersonalityFlag `json:"flags,omitempty"` -} - -// Solaris contains platform-specific configuration for Solaris application containers. -type Solaris struct { - // SMF FMRI which should go "online" before we start the container process. - Milestone string `json:"milestone,omitempty"` - // Maximum set of privileges any process in this container can obtain. - LimitPriv string `json:"limitpriv,omitempty"` - // The maximum amount of shared memory allowed for this container. - MaxShmMemory string `json:"maxShmMemory,omitempty"` - // Specification for automatic creation of network resources for this container. - Anet []SolarisAnet `json:"anet,omitempty"` - // Set limit on the amount of CPU time that can be used by container. - CappedCPU *SolarisCappedCPU `json:"cappedCPU,omitempty"` - // The physical and swap caps on the memory that can be used by this container. - CappedMemory *SolarisCappedMemory `json:"cappedMemory,omitempty"` -} - -// SolarisCappedCPU allows users to set limit on the amount of CPU time that can be used by container. -type SolarisCappedCPU struct { - Ncpus string `json:"ncpus,omitempty"` -} - -// SolarisCappedMemory allows users to set the physical and swap caps on the memory that can be used by this container. -type SolarisCappedMemory struct { - Physical string `json:"physical,omitempty"` - Swap string `json:"swap,omitempty"` -} - -// SolarisAnet provides the specification for automatic creation of network resources for this container. -type SolarisAnet struct { - // Specify a name for the automatically created VNIC datalink. - Linkname string `json:"linkname,omitempty"` - // Specify the link over which the VNIC will be created. - Lowerlink string `json:"lowerLink,omitempty"` - // The set of IP addresses that the container can use. - Allowedaddr string `json:"allowedAddress,omitempty"` - // Specifies whether allowedAddress limitation is to be applied to the VNIC. - Configallowedaddr string `json:"configureAllowedAddress,omitempty"` - // The value of the optional default router. - Defrouter string `json:"defrouter,omitempty"` - // Enable one or more types of link protection. - Linkprotection string `json:"linkProtection,omitempty"` - // Set the VNIC's macAddress - Macaddress string `json:"macAddress,omitempty"` -} - -// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. -type Windows struct { - // LayerFolders contains a list of absolute paths to directories containing image layers. - LayerFolders []string `json:"layerFolders"` - // Devices are the list of devices to be mapped into the container. - Devices []WindowsDevice `json:"devices,omitempty"` - // Resources contains information for handling resource constraints for the container. - Resources *WindowsResources `json:"resources,omitempty"` - // CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification. - CredentialSpec interface{} `json:"credentialSpec,omitempty"` - // Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation. - Servicing bool `json:"servicing,omitempty"` - // IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process. - IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` - // HyperV contains information for running a container with Hyper-V isolation. - HyperV *WindowsHyperV `json:"hyperv,omitempty"` - // Network restriction configuration. - Network *WindowsNetwork `json:"network,omitempty"` -} - -// WindowsDevice represents information about a host device to be mapped into the container. -type WindowsDevice struct { - // Device identifier: interface class GUID, etc. - ID string `json:"id"` - // Device identifier type: "class", etc. - IDType string `json:"idType"` -} - -// WindowsResources has container runtime resource constraints for containers running on Windows. -type WindowsResources struct { - // Memory restriction configuration. - Memory *WindowsMemoryResources `json:"memory,omitempty"` - // CPU resource restriction configuration. - CPU *WindowsCPUResources `json:"cpu,omitempty"` - // Storage restriction configuration. - Storage *WindowsStorageResources `json:"storage,omitempty"` -} - -// WindowsMemoryResources contains memory resource management settings. -type WindowsMemoryResources struct { - // Memory limit in bytes. - Limit *uint64 `json:"limit,omitempty"` -} - -// WindowsCPUResources contains CPU resource management settings. -type WindowsCPUResources struct { - // Number of CPUs available to the container. - Count *uint64 `json:"count,omitempty"` - // CPU shares (relative weight to other containers with cpu shares). - Shares *uint16 `json:"shares,omitempty"` - // Specifies the portion of processor cycles that this container can use as a percentage times 100. - Maximum *uint16 `json:"maximum,omitempty"` -} - -// WindowsStorageResources contains storage resource management settings. -type WindowsStorageResources struct { - // Specifies maximum Iops for the system drive. - Iops *uint64 `json:"iops,omitempty"` - // Specifies maximum bytes per second for the system drive. - Bps *uint64 `json:"bps,omitempty"` - // Sandbox size specifies the minimum size of the system drive in bytes. - SandboxSize *uint64 `json:"sandboxSize,omitempty"` -} - -// WindowsNetwork contains network settings for Windows containers. -type WindowsNetwork struct { - // List of HNS endpoints that the container should connect to. - EndpointList []string `json:"endpointList,omitempty"` - // Specifies if unqualified DNS name resolution is allowed. - AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` - // Comma separated list of DNS suffixes to use for name resolution. - DNSSearchList []string `json:"DNSSearchList,omitempty"` - // Name (ID) of the container that we will share with the network stack. - NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"` - // name (ID) of the network namespace that will be used for the container. - NetworkNamespace string `json:"networkNamespace,omitempty"` -} - -// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation. -type WindowsHyperV struct { - // UtilityVMPath is an optional path to the image used for the Utility VM. - UtilityVMPath string `json:"utilityVMPath,omitempty"` -} - -// VM contains information for virtual-machine-based containers. -type VM struct { - // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers. - Hypervisor VMHypervisor `json:"hypervisor,omitempty"` - // Kernel specifies kernel-related configuration for virtual-machine-based containers. - Kernel VMKernel `json:"kernel"` - // Image specifies guest image related configuration for virtual-machine-based containers. - Image VMImage `json:"image,omitempty"` -} - -// VMHypervisor contains information about the hypervisor to use for a virtual machine. -type VMHypervisor struct { - // Path is the host path to the hypervisor used to manage the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the hypervisor. - Parameters []string `json:"parameters,omitempty"` -} - -// VMKernel contains information about the kernel to use for a virtual machine. -type VMKernel struct { - // Path is the host path to the kernel used to boot the virtual machine. - Path string `json:"path"` - // Parameters specifies parameters to pass to the kernel. - Parameters []string `json:"parameters,omitempty"` - // InitRD is the host path to an initial ramdisk to be used by the kernel. - InitRD string `json:"initrd,omitempty"` -} - -// VMImage contains information about the virtual machine root image. -type VMImage struct { - // Path is the host path to the root image that the VM kernel would boot into. - Path string `json:"path"` - // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc). - Format string `json:"format"` -} - -// LinuxSeccomp represents syscall restrictions -type LinuxSeccomp struct { - DefaultAction LinuxSeccompAction `json:"defaultAction"` - Architectures []Arch `json:"architectures,omitempty"` - Flags []LinuxSeccompFlag `json:"flags,omitempty"` - Syscalls []LinuxSyscall `json:"syscalls,omitempty"` -} - -// Arch used for additional architectures -type Arch string - -// LinuxSeccompFlag is a flag to pass to seccomp(2). -type LinuxSeccompFlag string - -// Additional architectures permitted to be used for system calls -// By default only the native architecture of the kernel is permitted -const ( - ArchX86 Arch = "SCMP_ARCH_X86" - ArchX86_64 Arch = "SCMP_ARCH_X86_64" - ArchX32 Arch = "SCMP_ARCH_X32" - ArchARM Arch = "SCMP_ARCH_ARM" - ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" - ArchMIPS Arch = "SCMP_ARCH_MIPS" - ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" - ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" - ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" - ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" - ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" - ArchPPC Arch = "SCMP_ARCH_PPC" - ArchPPC64 Arch = "SCMP_ARCH_PPC64" - ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" - ArchS390 Arch = "SCMP_ARCH_S390" - ArchS390X Arch = "SCMP_ARCH_S390X" - ArchPARISC Arch = "SCMP_ARCH_PARISC" - ArchPARISC64 Arch = "SCMP_ARCH_PARISC64" -) - -// LinuxSeccompAction taken upon Seccomp rule match -type LinuxSeccompAction string - -// Define actions for Seccomp rules -const ( - ActKill LinuxSeccompAction = "SCMP_ACT_KILL" - ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP" - ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO" - ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE" - ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW" - ActLog LinuxSeccompAction = "SCMP_ACT_LOG" -) - -// LinuxSeccompOperator used to match syscall arguments in Seccomp -type LinuxSeccompOperator string - -// Define operators for syscall arguments in Seccomp -const ( - OpNotEqual LinuxSeccompOperator = "SCMP_CMP_NE" - OpLessThan LinuxSeccompOperator = "SCMP_CMP_LT" - OpLessEqual LinuxSeccompOperator = "SCMP_CMP_LE" - OpEqualTo LinuxSeccompOperator = "SCMP_CMP_EQ" - OpGreaterEqual LinuxSeccompOperator = "SCMP_CMP_GE" - OpGreaterThan LinuxSeccompOperator = "SCMP_CMP_GT" - OpMaskedEqual LinuxSeccompOperator = "SCMP_CMP_MASKED_EQ" -) - -// LinuxSeccompArg used for matching specific syscall arguments in Seccomp -type LinuxSeccompArg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"valueTwo,omitempty"` - Op LinuxSeccompOperator `json:"op"` -} - -// LinuxSyscall is used to match a syscall in Seccomp -type LinuxSyscall struct { - Names []string `json:"names"` - Action LinuxSeccompAction `json:"action"` - Args []LinuxSeccompArg `json:"args,omitempty"` -} - -// LinuxIntelRdt has container runtime resource constraints for Intel RDT -// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel -type LinuxIntelRdt struct { - // The identity for RDT Class of Service - ClosID string `json:"closID,omitempty"` - // The schema for L3 cache id and capacity bitmask (CBM) - // Format: "L3:=;=;..." - L3CacheSchema string `json:"l3CacheSchema,omitempty"` - - // The schema of memory bandwidth per L3 cache id - // Format: "MB:=bandwidth0;=bandwidth1;..." - // The unit of memory bandwidth is specified in "percentages" by - // default, and in "MBps" if MBA Software Controller is enabled. - MemBwSchema string `json:"memBwSchema,omitempty"` -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go deleted file mode 100644 index 89dce34..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/state.go +++ /dev/null @@ -1,17 +0,0 @@ -package specs - -// State holds information about the runtime state of the container. -type State struct { - // Version is the version of the specification that is supported. - Version string `json:"ociVersion"` - // ID is the container ID - ID string `json:"id"` - // Status is the runtime status of the container. - Status string `json:"status"` - // Pid is the process ID for the container process. - Pid int `json:"pid,omitempty"` - // Bundle is the path to the container's bundle directory. - Bundle string `json:"bundle"` - // Annotations are key values associated with the container. - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go b/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go deleted file mode 100644 index bda7e1c..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/specs-go/version.go +++ /dev/null @@ -1,18 +0,0 @@ -package specs - -import "fmt" - -const ( - // VersionMajor is for an API incompatible changes - VersionMajor = 1 - // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 0 - // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 2 - - // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "" -) - -// Version is the specification version that the package types support. -var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/runtime/vendor/github.com/opencontainers/runtime-spec/style.md b/runtime/vendor/github.com/opencontainers/runtime-spec/style.md deleted file mode 100644 index 1d42043..0000000 --- a/runtime/vendor/github.com/opencontainers/runtime-spec/style.md +++ /dev/null @@ -1,131 +0,0 @@ -# Style and conventions - -## One sentence per line - -To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line. -This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length. -For example, this paragraph will span three lines in the Markdown source. - -## Traditionally hex settings should use JSON integers, not JSON strings - -For example, [`"classID": 1048577`](config-linux.md#network) instead of `"classID": "0x100001"`. -The config JSON isn't enough of a UI to be worth jumping through string <-> integer hoops to support an 0x… form ([source][integer-over-hex]). - -## Constant names should keep redundant prefixes - -For example, `CAP_KILL` instead of `KILL` in [**`process.capabilities`**](config.md#process). -The redundancy reduction from removing the namespacing prefix is not useful enough to be worth trimming the upstream identifier ([source][keep-prefix]). - -## Optional settings should not have pointer Go types - -Because in many cases the Go default for the type is a no-op in the spec (sources [here][no-pointer-for-strings], [here][no-pointer-for-slices], and [here][no-pointer-for-boolean]). -The exceptions are entries where we need to distinguish between “not set” and “set to the Go default for that type” ([source][pointer-when-updates-require-changes]), and this decision should be made on a per-setting case. - -## Links - -Internal links should be [relative links][markdown-relative-links] when linking to content within the repository. -Internal links should be used inline. - -External links should be collected at the bottom of a markdown file and used as referenced links. -See 'Referenced Links' in this [markdown quick reference][markdown-quick-reference]. -The use of referenced links in the markdown body helps to keep files clean and organized. -This also facilitates updates of external link targets on a per-file basis. - -Referenced links should be kept in two alphabetically sorted sets, a general reference section followed by a man page section. -To keep Pandoc happy, duplicate naming of links within pages listed in the Makefile's `DOC_FILES` variable should be avoided by appending an `_N` to the link tagname, where `N` is some number not currently in use. -The organization and style of an existing reference section should be maintained unless it violates these style guidelines. - -An exception to these rules is when a URL is needed contextually, for example when showing an explicit link to the reader. - -## Examples - -### Anchoring - -For any given section that provides a notable example, it is ideal to have it denoted with [markdown headers][markdown-headers]. -The level of header should be such that it is a subheader of the header it is an example of. - -#### Example - -```markdown -## Some Topic - -### Some Subheader - -#### Further Subheader - -##### Example - -To use Further Subheader, ... - -### Example - -To use Some Topic, ... - -``` - -### Content - -Where necessary, the values in the example can be empty or unset, but accommodate with comments regarding this intention. - -Where feasible, the content and values used in an example should convey the fullest use of the data structures concerned. -Most commonly onlookers will intend to copy-and-paste a "working example". -If the intention of the example is to be a fully utilized example, rather than a copy-and-paste example, perhaps add a comment as such. - -```markdown -### Example -``` -```json -{ - "foo": null, - "bar": "" -} -``` - -**vs.** - -```markdown -### Example - -Following is a fully populated example (not necessarily for copy/paste use) -``` -```json -{ - "foo": [ - 1, - 2, - 3 - ], - "bar": "waffles", - "bif": { - "baz": "potatoes" - } -} -``` - -### Links - -The following is an example of different types of links. -This is shown as a complete markdown file, where the referenced links are at the bottom. - -```markdown -The specification repository's [glossary](glossary.md) is where readers can find definitions of commonly used terms. - -Readers may click through to the [Open Containers namespace][open-containers] on [GitHub][github]. - -The URL for the Open Containers link above is: https://github.com/opencontainers - - -[github]: https://github.com -[open-containers]: https://github.com/opencontainers -``` - - -[integer-over-hex]: https://github.com/opencontainers/runtime-spec/pull/267#r48360013 -[keep-prefix]: https://github.com/opencontainers/runtime-spec/pull/159#issuecomment-138728337 -[no-pointer-for-boolean]: https://github.com/opencontainers/runtime-spec/pull/290#r50296396 -[no-pointer-for-slices]: https://github.com/opencontainers/runtime-spec/pull/316#r50782982 -[no-pointer-for-strings]: https://github.com/opencontainers/runtime-spec/pull/653#issue-200439192 -[pointer-when-updates-require-changes]: https://github.com/opencontainers/runtime-spec/pull/317#r50932706 -[markdown-headers]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#headings -[markdown-quick-reference]: https://en.support.wordpress.com/markdown-quick-reference -[markdown-relative-links]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#relative-links diff --git a/runtime/vendor/github.com/prashantv/gostub/.gitignore b/runtime/vendor/github.com/prashantv/gostub/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/runtime/vendor/github.com/prashantv/gostub/.travis.yml b/runtime/vendor/github.com/prashantv/gostub/.travis.yml deleted file mode 100644 index 6b212a1..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -sudo: false - -go: - - 1.9.x - - 1.10.x - - 1.11.x - -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: - - $HOME/gopath/bin/goveralls -service=travis-ci - diff --git a/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md b/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md deleted file mode 100644 index 4ff448b..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## 1.0.0 - 2018-11-09 -### Added -- Initial release with APIs to stub and reset values for testing. -- Supports stubbing Go variables, and environment variables. diff --git a/runtime/vendor/github.com/prashantv/gostub/LICENSE.md b/runtime/vendor/github.com/prashantv/gostub/LICENSE.md deleted file mode 100644 index 528318b..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Prashant Varanasi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/runtime/vendor/github.com/prashantv/gostub/README.md b/runtime/vendor/github.com/prashantv/gostub/README.md deleted file mode 100644 index b4ae77f..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# gostub - -[![Build Status](https://travis-ci.org/prashantv/gostub.svg?branch=master)](https://travis-ci.org/prashantv/gostub) -[![GoDoc](https://godoc.org/github.com/prashantv/gostub?status.svg)](https://godoc.org/github.com/prashantv/gostub) -[![Coverage Status](https://coveralls.io/repos/github/prashantv/gostub/badge.svg?branch=master)](https://coveralls.io/github/prashantv/gostub?branch=master) - -gostub is a library to make stubbing in unit tests easy. - -## Getting started - -Import the following package: -`github.com/prashantv/gostub` - -Click [here](https://godoc.org/github.com/prashantv/gostub) to read the [API documentation](https://godoc.org/github.com/prashantv/gostub). - -## Package overview - -Package gostub is used for stubbing variables in tests, and resetting the -original value once the test has been run. - -This can be used to stub static variables as well as static functions. To stub a -static variable, use the Stub function: - -```go -var configFile = "config.json" - -func GetConfig() ([]byte, error) { - return ioutil.ReadFile(configFile) -} - -// Test code -stubs := gostub.Stub(&configFile, "/tmp/test.config") - -data, err := GetConfig() -// data will now return contents of the /tmp/test.config file -``` - -gostub can also stub static functions in a test by using a variable to reference -the static function, and using that local variable to call the static function: - -```go -var timeNow = time.Now - -func GetDate() int { - return timeNow().Day() -} -``` - -You can test this by using gostub to stub the timeNow variable: - -```go -stubs := gostub.Stub(&timeNow, func() time.Time { - return time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC) -}) -defer stubs.Reset() - -// Test can check that GetDate returns 6 -``` - -If you are stubbing a function to return a constant value like in the above -test, you can use StubFunc instead: - -```go -stubs := gostub.StubFunc(&timeNow, time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC)) -defer stubs.Reset() -``` - -StubFunc can also be used to stub functions that return multiple values: - -```go -var osHostname = osHostname -// [...] production code using osHostname to call it. - -// Test code: -stubs := gostub.StubFunc(&osHostname, "fakehost", nil) -defer stubs.Reset() -``` - -The Reset method should be deferred to run at the end of the test to reset all -stubbed variables back to their original values. - -You can set up multiple stubs by calling Stub again: - -```go -stubs := gostub.Stub(&v1, 1) -stubs.Stub(&v2, 2) -defer stubs.Reset() -``` - -For simple cases where you are only setting up simple stubs, you can condense -the setup and cleanup into a single line: - -```go -defer gostub.Stub(&v1, 1).Stub(&v2, 2).Reset() -``` - -This sets up the stubs and then defers the Reset call. - -You should keep the return argument from the Stub call if you need to change -stubs or add more stubs during test execution: - -```go -stubs := gostub.Stub(&v1, 1) -defer stubs.Reset() - -// Do some testing -stubs.Stub(&v1, 5) - -// More testing -stubs.Stub(&b2, 6) -``` - -The Stub call must be passed a pointer to the variable that should be stubbed, -and a value which can be assigned to the variable. diff --git a/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl b/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl deleted file mode 100644 index 39f1c15..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/README.md.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -# gostub - -[![Build Status](https://travis-ci.org/prashantv/gostub.svg?branch=master)](https://travis-ci.org/prashantv/gostub) -[![GoDoc](https://godoc.org/github.com/prashantv/gostub?status.svg)](https://godoc.org/github.com/prashantv/gostub) -[![Coverage Status](https://coveralls.io/repos/github/prashantv/gostub/badge.svg?branch=master)](https://coveralls.io/github/prashantv/gostub?branch=master) - -gostub is a library to make stubbing in unit tests easy. - -## Getting started - -Import the following package: -`{{ .ImportPath }}` - -Click [here](https://godoc.org/github.com/prashantv/gostub) to read the [API documentation](https://godoc.org/github.com/prashantv/gostub). - -## Package overview - -{{ .EmitSynopsis }} diff --git a/runtime/vendor/github.com/prashantv/gostub/assignable_test.go b/runtime/vendor/github.com/prashantv/gostub/assignable_test.go deleted file mode 100644 index 936e2de..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/assignable_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package gostub - -import ( - "bytes" - "io" - "io/ioutil" - "strings" - "testing" -) - -const productionData = "production data" - -var dataReader io.Reader = bytes.NewReader([]byte(productionData)) - -func TestAssignableStub(t *testing.T) { - const testData = "test data" - stubs := Stub(&dataReader, strings.NewReader(testData)) - defer stubs.Reset() - - got, err := ioutil.ReadAll(dataReader) - if err != nil { - t.Fatalf("ReadAll failed: %v", err) - } - - if !bytes.Equal(got, []byte(testData)) { - t.Errorf("Got unexpected data:\n got %v\n want %v", string(got), string(testData)) - } -} - -func TestUnassignableStub(t *testing.T) { - defer expectPanic(t, "Stub wrong type", "not assignable") - var noInterface interface{} = "test" - Stub(&dataReader, noInterface) -} diff --git a/runtime/vendor/github.com/prashantv/gostub/doc.go b/runtime/vendor/github.com/prashantv/gostub/doc.go deleted file mode 100644 index ee8dd61..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/doc.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Package gostub is used for stubbing variables in tests, and resetting the -original value once the test has been run. - -This can be used to stub static variables as well as static functions. To -stub a static variable, use the Stub function: - var configFile = "config.json" - - func GetConfig() ([]byte, error) { - return ioutil.ReadFile(configFile) - } - - // Test code - stubs := gostub.Stub(&configFile, "/tmp/test.config") - - data, err := GetConfig() - // data will now return contents of the /tmp/test.config file - -gostub can also stub static functions in a test by using a variable -to reference the static function, and using that local variable to call -the static function: - var timeNow = time.Now - - func GetDate() int { - return timeNow().Day() - } - -You can test this by using gostub to stub the timeNow variable: - stubs := gostub.Stub(&timeNow, func() time.Time { - return time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC) - }) - defer stubs.Reset() - - // Test can check that GetDate returns 6 - -If you are stubbing a function to return a constant value like in -the above test, you can use StubFunc instead: - stubs := gostub.StubFunc(&timeNow, time.Date(2015, 6, 1, 0, 0, 0, 0, time.UTC)) - defer stubs.Reset() - -StubFunc can also be used to stub functions that return multiple values: - var osHostname = osHostname - // [...] production code using osHostname to call it. - - // Test code: - stubs := gostub.StubFunc(&osHostname, "fakehost", nil) - defer stubs.Reset() - -The Reset method should be deferred to run at the end of the test to reset -all stubbed variables back to their original values. - -You can set up multiple stubs by calling Stub again: - stubs := gostub.Stub(&v1, 1) - stubs.Stub(&v2, 2) - defer stubs.Reset() - -For simple cases where you are only setting up simple stubs, you can condense -the setup and cleanup into a single line: - defer gostub.Stub(&v1, 1).Stub(&v2, 2).Reset() -This sets up the stubs and then defers the Reset call. - -You should keep the return argument from the Stub call if you need to change -stubs or add more stubs during test execution: - stubs := gostub.Stub(&v1, 1) - defer stubs.Reset() - - // Do some testing - stubs.Stub(&v1, 5) - - // More testing - stubs.Stub(&b2, 6) - -The Stub call must be passed a pointer to the variable that should be stubbed, -and a value which can be assigned to the variable. -*/ -package gostub - -//go:generate godocdown -template README.md.tmpl --output=README.md diff --git a/runtime/vendor/github.com/prashantv/gostub/env.go b/runtime/vendor/github.com/prashantv/gostub/env.go deleted file mode 100644 index 9315e05..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/env.go +++ /dev/null @@ -1,36 +0,0 @@ -package gostub - -import "os" - -func (s *Stubs) checkEnvKey(k string) { - if _, ok := s.origEnv[k]; !ok { - v, ok := os.LookupEnv(k) - s.origEnv[k] = envVal{v, ok} - } -} - -// SetEnv the specified environent variable to the specified value. -func (s *Stubs) SetEnv(k, v string) *Stubs { - s.checkEnvKey(k) - - os.Setenv(k, v) - return s -} - -// UnsetEnv unsets the specified environent variable. -func (s *Stubs) UnsetEnv(k string) *Stubs { - s.checkEnvKey(k) - - os.Unsetenv(k) - return s -} - -func (s *Stubs) resetEnv() { - for k, v := range s.origEnv { - if v.ok { - os.Setenv(k, v.val) - } else { - os.Unsetenv(k) - } - } -} diff --git a/runtime/vendor/github.com/prashantv/gostub/env_test.go b/runtime/vendor/github.com/prashantv/gostub/env_test.go deleted file mode 100644 index 7fa2f4b..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/env_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package gostub - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestStubEnv(t *testing.T) { - os.Setenv("GOSTUB_T1", "V1") - os.Setenv("GOSTUB_T2", "V2") - os.Unsetenv("GOSTUB_NONE") - - stubs := New() - - stubs.SetEnv("GOSTUB_NONE", "a") - stubs.SetEnv("GOSTUB_T1", "1") - stubs.SetEnv("GOSTUB_T1", "2") - stubs.SetEnv("GOSTUB_T1", "3") - stubs.SetEnv("GOSTUB_T2", "4") - stubs.UnsetEnv("GOSTUB_T2") - - assert.Equal(t, "3", os.Getenv("GOSTUB_T1"), "Wrong value for T1") - assert.Equal(t, "", os.Getenv("GOSTUB_T2"), "Wrong value for T2") - assert.Equal(t, "a", os.Getenv("GOSTUB_NONE"), "Wrong value for NONE") - stubs.Reset() - - _, ok := os.LookupEnv("GOSTUB_NONE") - assert.False(t, ok, "NONE should be unset") - - assert.Equal(t, "V1", os.Getenv("GOSTUB_T1"), "Wrong reset value for T1") - assert.Equal(t, "V2", os.Getenv("GOSTUB_T2"), "Wrong reset value for T2") -} diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_test.go deleted file mode 100644 index ebcd429..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/examples_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package gostub_test - -import ( - "fmt" - "os" - - "github.com/prashantv/gostub" -) - -func ExampleStubFunc() { - var osHostname = os.Hostname - - defer gostub.StubFunc(&osHostname, "fakehost", nil).Reset() - host, err := osHostname() - - fmt.Println("Host:", host, "err:", err) - // Output: - // Host: fakehost err: -} - -func ExampleStub() { - var counter = 100 - - defer gostub.Stub(&counter, 200).Reset() - fmt.Println("Counter:", counter) - // Output: - // Counter: 200 -} diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go deleted file mode 100644 index 602dcdb..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/examples_time_const_test.go +++ /dev/null @@ -1 +0,0 @@ -package gostub_test diff --git a/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go b/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go deleted file mode 100644 index 3f655e1..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/examples_time_func_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package gostub_test - -import ( - "fmt" - "time" - - "github.com/prashantv/gostub" -) - -// Production code -var timeNow = time.Now - -func GetDay() int { - return timeNow().Day() -} - -// Test code -func Example_stubTimeWithFunction() { - var day = 2 - stubs := gostub.Stub(&timeNow, func() time.Time { - return time.Date(2015, 07, day, 0, 0, 0, 0, time.UTC) - }) - defer stubs.Reset() - - firstDay := GetDay() - - day = 3 - secondDay := GetDay() - - fmt.Printf("First day: %v, second day: %v\n", firstDay, secondDay) - // Output: - // First day: 2, second day: 3 -} - -// Test code -func Example_stubTimeWithConstant() { - stubs := gostub.StubFunc(&timeNow, time.Date(2015, 07, 2, 0, 0, 0, 0, time.UTC)) - defer stubs.Reset() - - fmt.Println("Day:", GetDay()) - // Output: - // Day: 2 -} diff --git a/runtime/vendor/github.com/prashantv/gostub/func_test.go b/runtime/vendor/github.com/prashantv/gostub/func_test.go deleted file mode 100644 index 1e03963..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/func_test.go +++ /dev/null @@ -1,118 +0,0 @@ -package gostub - -import ( - "errors" - "os" - "testing" - "time" -) - -func TestStubTime(t *testing.T) { - var timeNow = time.Now - - var fakeTime = time.Date(2015, 7, 1, 0, 0, 0, 0, time.UTC) - StubFunc(&timeNow, fakeTime) - expectVal(t, fakeTime, timeNow()) -} - -func TestReturnErr(t *testing.T) { - var osRemove = os.Remove - - StubFunc(&osRemove, nil) - expectVal(t, nil, osRemove("test")) - - e := errors.New("err") - StubFunc(&osRemove, e) - expectVal(t, e, osRemove("test")) -} - -func TestStubHostname(t *testing.T) { - var osHostname = os.Hostname - - StubFunc(&osHostname, "fakehost", nil) - hostname, err := osHostname() - expectVal(t, "fakehost", hostname) - expectVal(t, nil, err) - - var errNoHost = errors.New("no hostname") - StubFunc(&osHostname, "", errNoHost) - hostname, err = osHostname() - expectVal(t, "", hostname) - expectVal(t, errNoHost, err) -} - -func TestStubReturnFunc(t *testing.T) { - var retFunc = func() func() error { - return func() error { - return errors.New("err") - } - } - - var errInception = errors.New("in limbo") - StubFunc(&retFunc, func() error { - return errInception - }) - expectVal(t, errInception, retFunc()()) -} - -func TestStubFuncFail(t *testing.T) { - var osHostname = os.Hostname - var s string - - tests := []struct { - desc string - toStub interface{} - stubVals []interface{} - wantErr string - }{ - { - desc: "toStub is not a function", - toStub: &s, - stubVals: []interface{}{"fakehost", nil}, - wantErr: "to stub must be a pointer to a function", - }, - { - desc: "toStub is not a pointer", - toStub: osHostname, - stubVals: []interface{}{"fakehost", nil}, - wantErr: "to stub must be a pointer to a function", - }, - { - desc: "wrong number of stubVals", - toStub: &osHostname, - stubVals: []interface{}{"fakehost"}, - wantErr: "func type has 2 return values, but only 1 stub values provided", - }, - } - - for _, tt := range tests { - func() { - defer expectPanic(t, tt.desc, tt.wantErr) - StubFunc(tt.toStub, tt.stubVals...) - }() - } -} - -func TestMultipleStubFuncs(t *testing.T) { - var f1 = func() int { - return 100 - } - var f2 = func() int { - return 200 - } - var f3 = func() int { - return 300 - } - - stubs := StubFunc(&f1, 1).StubFunc(&f2, 2) - expectVal(t, f1(), 1) - expectVal(t, f2(), 2) - - stubs.StubFunc(&f3, 3) - expectVal(t, f3(), 3) - - stubs.Reset() - expectVal(t, f1(), 100) - expectVal(t, f2(), 200) - expectVal(t, f3(), 300) -} diff --git a/runtime/vendor/github.com/prashantv/gostub/gostub.go b/runtime/vendor/github.com/prashantv/gostub/gostub.go deleted file mode 100644 index ce9fd84..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/gostub.go +++ /dev/null @@ -1,126 +0,0 @@ -package gostub - -import ( - "fmt" - "reflect" -) - -// Stub replaces the value stored at varToStub with stubVal. -// varToStub must be a pointer to the variable. stubVal should have a type -// that is assignable to the variable. -func Stub(varToStub interface{}, stubVal interface{}) *Stubs { - return New().Stub(varToStub, stubVal) -} - -// StubFunc replaces a function variable with a function that returns stubVal. -// funcVarToStub must be a pointer to a function variable. If the function -// returns multiple values, then multiple values should be passed to stubFunc. -// The values must match be assignable to the return values' types. -func StubFunc(funcVarToStub interface{}, stubVal ...interface{}) *Stubs { - return New().StubFunc(funcVarToStub, stubVal...) -} - -type envVal struct { - val string - ok bool -} - -// Stubs represents a set of stubbed variables that can be reset. -type Stubs struct { - // stubs is a map from the variable pointer (being stubbed) to the original value. - stubs map[reflect.Value]reflect.Value - origEnv map[string]envVal -} - -// New returns Stubs that can be used to stub out variables. -func New() *Stubs { - return &Stubs{ - stubs: make(map[reflect.Value]reflect.Value), - origEnv: make(map[string]envVal), - } -} - -// Stub replaces the value stored at varToStub with stubVal. -// varToStub must be a pointer to the variable. stubVal should have a type -// that is assignable to the variable. -func (s *Stubs) Stub(varToStub interface{}, stubVal interface{}) *Stubs { - v := reflect.ValueOf(varToStub) - stub := reflect.ValueOf(stubVal) - - // Ensure varToStub is a pointer to the variable. - if v.Type().Kind() != reflect.Ptr { - panic("variable to stub is expected to be a pointer") - } - - if _, ok := s.stubs[v]; !ok { - // Store the original value if this is the first time varPtr is being stubbed. - s.stubs[v] = reflect.ValueOf(v.Elem().Interface()) - } - - // *varToStub = stubVal - v.Elem().Set(stub) - return s -} - -// StubFunc replaces a function variable with a function that returns stubVal. -// funcVarToStub must be a pointer to a function variable. If the function -// returns multiple values, then multiple values should be passed to stubFunc. -// The values must match be assignable to the return values' types. -func (s *Stubs) StubFunc(funcVarToStub interface{}, stubVal ...interface{}) *Stubs { - funcPtrType := reflect.TypeOf(funcVarToStub) - if funcPtrType.Kind() != reflect.Ptr || - funcPtrType.Elem().Kind() != reflect.Func { - panic("func variable to stub must be a pointer to a function") - } - funcType := funcPtrType.Elem() - if funcType.NumOut() != len(stubVal) { - panic(fmt.Sprintf("func type has %v return values, but only %v stub values provided", - funcType.NumOut(), len(stubVal))) - } - - return s.Stub(funcVarToStub, FuncReturning(funcPtrType.Elem(), stubVal...).Interface()) -} - -// FuncReturning creates a new function with type funcType that returns results. -func FuncReturning(funcType reflect.Type, results ...interface{}) reflect.Value { - var resultValues []reflect.Value - for i, r := range results { - var retValue reflect.Value - if r == nil { - // We can't use reflect.ValueOf(nil), so we need to create the zero value. - retValue = reflect.Zero(funcType.Out(i)) - } else { - // We cannot simply use reflect.ValueOf(r) as that does not work for - // interface types, as reflect.ValueOf receives the dynamic type, which - // is the underlying type. e.g. for an error, it may *errors.errorString. - // Instead, we make the return type's expected interface value using - // reflect.New, and set the data to the passed in value. - tempV := reflect.New(funcType.Out(i)) - tempV.Elem().Set(reflect.ValueOf(r)) - retValue = tempV.Elem() - } - resultValues = append(resultValues, retValue) - } - return reflect.MakeFunc(funcType, func(_ []reflect.Value) []reflect.Value { - return resultValues - }) -} - -// Reset resets all stubbed variables back to their original values. -func (s *Stubs) Reset() { - for v, originalVal := range s.stubs { - v.Elem().Set(originalVal) - } - s.resetEnv() -} - -// ResetSingle resets a single stubbed variable back to its original value. -func (s *Stubs) ResetSingle(varToStub interface{}) { - v := reflect.ValueOf(varToStub) - originalVal, ok := s.stubs[v] - if !ok { - panic("cannot reset variable as it has not been stubbed yet") - } - - v.Elem().Set(originalVal) -} diff --git a/runtime/vendor/github.com/prashantv/gostub/gostub_test.go b/runtime/vendor/github.com/prashantv/gostub/gostub_test.go deleted file mode 100644 index 35d1476..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/gostub_test.go +++ /dev/null @@ -1,109 +0,0 @@ -package gostub - -import "testing" - -// Variables used in stubbing. -var v1, v2, v3, v4 int - -// resetVars is used to reset the variables used in stubbing tests to their default values. -func resetVars() { - v1 = 100 - v2 = 200 - v3 = 300 - v4 = 400 -} - -func TestStub(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1) - - if v1 != 1 { - t.Errorf("expected") - } - expectVal(t, v1, 1) - stubs.Reset() - expectVal(t, v1, 100) -} - -func TestRestub(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1) - expectVal(t, v1, 1) - stubs.Stub(&v1, 2) - expectVal(t, v1, 2) - stubs.Reset() - expectVal(t, v1, 100) -} - -func TestResetSingle(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1).Stub(&v2, 2) - expectVal(t, v1, 1) - expectVal(t, v2, 2) - - stubs.ResetSingle(&v1) - expectVal(t, v1, 100) - expectVal(t, v2, 2) - - stubs.Reset() - expectVal(t, v1, 100) - expectVal(t, v2, 200) -} - -func TestResetSingleNotStubbed(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1) - expectVal(t, v1, 1) - - defer expectPanic(t, "ResetSingle unstubbed variable", "not been stubbed") - stubs.ResetSingle(&v2) -} - -func TestResetTwice(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1) - expectVal(t, v1, 1) - - stubs.Reset() - expectVal(t, v1, 100) - - stubs.Stub(&v1, 2) - expectVal(t, v1, 2) - - stubs.Reset() - expectVal(t, v1, 100) -} - -func TestMultipleStubs(t *testing.T) { - resetVars() - - stubs := Stub(&v1, 1).Stub(&v2, 2).Stub(&v3, 3) - expectVal(t, v1, 1) - expectVal(t, v2, 2) - expectVal(t, v3, 3) - expectVal(t, v4, 400) - - stubs.Stub(&v4, 4) - expectVal(t, v4, 4) - - stubs.Reset() - expectVal(t, v1, 100) - expectVal(t, v2, 200) - expectVal(t, v3, 300) - expectVal(t, v4, 400) -} - -func TestVarNotPtr(t *testing.T) { - defer expectPanic(t, "Stub non-pointer", "expected to be a pointer") - Stub(v1, 1) -} - -func TestTypeMismatch(t *testing.T) { - defer expectPanic(t, "Stub wrong type", "not assignable") - Stub(&v1, "test") -} diff --git a/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go b/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go deleted file mode 100644 index 557fbfb..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/utils_for_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package gostub - -import ( - "fmt" - "reflect" - "strings" - "testing" -) - -func expectVal(t *testing.T, expected interface{}, got interface{}) { - if !reflect.DeepEqual(expected, got) { - t.Errorf("expected %v but got %v", expected, got) - } -} - -func expectPanic(t *testing.T, msg string, expectedPanic string) { - if r := recover(); r != nil { - got := fmt.Sprint(r) - if !strings.Contains(got, expectedPanic) { - t.Errorf("panic message expected to contain %q, got %v", expectedPanic, got) - } - return - } - - t.Errorf("%v expected to panic", msg) -} diff --git a/runtime/vendor/github.com/prashantv/gostub/version.go b/runtime/vendor/github.com/prashantv/gostub/version.go deleted file mode 100644 index 7160e9c..0000000 --- a/runtime/vendor/github.com/prashantv/gostub/version.go +++ /dev/null @@ -1,4 +0,0 @@ -package gostub - -// Version contains the package version. -const Version = "1.0.0" -- Gitee From 3bd9f5ddc67bbd9e4d81846b502be9938c52e85f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 17 Jan 2022 09:09:40 +0800 Subject: [PATCH 172/296] Match-id-99bdf0633668b79631f4b231e6e697099dd53835 --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 8b1917a..15ab2b7 100644 --- a/build/build.sh +++ b/build/build.sh @@ -56,7 +56,7 @@ function build_bin() [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src mkdir ${ROOT}/opensource/src cd ${HOOKDIR} - export GOPATH="${GOPATH}:${ROOT}/opensource" + export GOPATH="${ROOT}/opensource" export GO111MODULE=on export GOPROXY="http://mirrors.tools.huawei.com/goproxy/" export GONOSUMDB="*" -- Gitee From 1bd5583bcf985c08a06e662ea5f016f9a449108e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 18 Jan 2022 11:06:09 +0800 Subject: [PATCH 173/296] Match-id-7dc301885ac9a9fb16dc795a30a038fe0842197f --- build/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 15ab2b7..fe9acea 100644 --- a/build/build.sh +++ b/build/build.sh @@ -58,7 +58,6 @@ function build_bin() cd ${HOOKDIR} export GOPATH="${ROOT}/opensource" export GO111MODULE=on - export GOPROXY="http://mirrors.tools.huawei.com/goproxy/" export GONOSUMDB="*" echo "make hook" -- Gitee From a1f661358459f68eb54089541390c9052216dcd5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 19 Jan 2022 11:12:46 +0800 Subject: [PATCH 174/296] Match-id-cd39ed830f78ed33f1c036cde662457c1dd8870b --- build/build.sh | 16 +- build/scripts/run_main.sh | 5 - build/scripts/uninstall.sh | 1 - install/deb/scripts/control | 3 - install/deb/scripts/postinst | 15 -- install/deb/scripts/prerm | 15 -- install/deb/src/CMakeLists.txt | 32 --- install/deb/src/install | 10 - install/deb/src/main.c | 323 ------------------------- install/rpm/ascend-docker-plgugin.spec | 62 ----- 10 files changed, 3 insertions(+), 479 deletions(-) delete mode 100644 install/deb/scripts/control delete mode 100644 install/deb/scripts/postinst delete mode 100644 install/deb/scripts/prerm delete mode 100644 install/deb/src/CMakeLists.txt delete mode 100644 install/deb/src/install delete mode 100644 install/deb/src/main.c delete mode 100644 install/rpm/ascend-docker-plgugin.spec diff --git a/build/build.sh b/build/build.sh index fe9acea..3a06279 100644 --- a/build/build.sh +++ b/build/build.sh @@ -14,8 +14,6 @@ BUILD=${ROOT}/build CLIDIR=${ROOT}/cli CLISRCNAME="main.c" -INSTALLHELPERDIR=${ROOT}/install -INSTALLHELPERSRCNAME="main.c" HOOKDIR=${ROOT}/hook HOOKSRCNAME="main.go" @@ -25,8 +23,7 @@ RUNTIMESRCNAME="main.go" CLISRCPATH=$(find ${CLIDIR} -name "${CLISRCNAME}") CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} -INSTALLHELPERSRCPATH=$(find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}") -INSTALLHELPERSRCDIR=${INSTALLHELPERSRCPATH%/${INSTALLHELPERSRCNAME}} + HOOKSRCPATH=$(find ${HOOKDIR} -name "${HOOKSRCNAME}") HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}") @@ -46,13 +43,6 @@ function build_bin() make clean make - echo "make installhelper" - [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build - mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build - cmake ${INSTALLHELPERSRCDIR} - make clean - make - [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src mkdir ${ROOT}/opensource/src cd ${HOOKDIR} @@ -87,12 +77,12 @@ function build_run_package() cd ${BUILD} mkdir run_pkg - /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli}/build/ascend-docker* run_pkg + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/cli}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 6 ]; then + if [ $FILECNT -ne 5 ]; then exit 1 fi /bin/cp -rf ${ROOT}/assets run_pkg diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 9c4cf90..36ed6f2 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -18,11 +18,9 @@ function install() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli - cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli - chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -rf ./assets ${INSTALL_PATH}/assets cp -f ./README.md ${INSTALL_PATH}/README.md @@ -46,7 +44,6 @@ function install() SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" DST="${DOCKER_CONFIG_DIR}/daemon.json" - ./ascend-docker-plugin-install-helper add ${DST} ${SRC} ${INSTALL_PATH}/ascend-docker-runtime if [ "$?" != "0" ]; then echo 'create damon.json failed' exit 1 @@ -92,13 +89,11 @@ function upgrade() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli - cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli - chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 500 ${INSTALL_PATH}/script/uninstall.sh chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 2cb5b28..1faa629 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -14,7 +14,6 @@ if [ ! -f "${DST}" ]; then exit 0 fi -${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} diff --git a/install/deb/scripts/control b/install/deb/scripts/control deleted file mode 100644 index 65fdc00..0000000 --- a/install/deb/scripts/control +++ /dev/null @@ -1,3 +0,0 @@ -Maintainer: huawei -Description: asenddockertool. - The asend docker tool help usr to modify a customed deamon.json. diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst deleted file mode 100644 index 29dc923..0000000 --- a/install/deb/scripts/postinst +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -DIR=/etc/docker -if [ ! -d "${DIR}" ]; then -mkdir ${DIR} -fi -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -BINDIR=/usr/bin -${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "create damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "create damom.json success\n" diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm deleted file mode 100644 index ebfb388..0000000 --- a/install/deb/scripts/prerm +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -DIR=/etc/docker -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -if [ ! -f "${DST}" ]; then -exit 0 -fi -BINDIR=/usr/bin -${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "del damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "del damom.json success\n" diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt deleted file mode 100644 index e0db884..0000000 --- a/install/deb/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# CMake 最低版本号要求 -cmake_minimum_required (VERSION 2.8) - -# 项目信息 -project (ascend-docker-plugin-install-helper) - -message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") - - -#导入头文件所在路径 -#PROJECT_SOURCE_DIR为cmake宏 -include_directories("../../../opensource/cJSON-1.7.14") -include_directories("../../../platform/HuaweiSecureC/include") - -# 查找当前目录下的所有源文件 -# 并将名称保存到 SRC 变量 -aux_source_directory(. SRC) - -# 指定生成目标 -add_executable(ascend-docker-plugin-install-helper ${SRC}) - -# 添加子目录 -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC) - -# 添加链接库 -#该命令要在add_executable命令下方,否则报错 -target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now cjson) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now HuaweiSecureC) - diff --git a/install/deb/src/install b/install/deb/src/install deleted file mode 100644 index 10c46f6..0000000 --- a/install/deb/src/install +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash -echo "extract files\n" -if [ ! -d "../cjson" ];then - mkdir ../src -else - rm -rf ../src -fi -/bin/cp -rf ${files} ../cjson -tar -zxvf ../*.tar.gz -files=`find ../ -name "cJSON.*"` diff --git a/install/deb/src/main.c b/install/deb/src/main.c deleted file mode 100644 index 4ee0919..0000000 --- a/install/deb/src/main.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker -*/ -#include -#include -#include -#include -#include "cJSON.h" - -#define MAX_JSON_FILE_SIZE 65535 -#define MIN_ARGS_NUM 4 -#define ADD_CMD_ARGS_NUM 5 -#define ADD_CMD "add" -#define RM_CMD "rm" -#define CMD_INDEX 1 -#define FINAL_FILE_INDEX 2 -#define TEMP_FILE_INDEX 3 -#define RUNTIME_PATH_INDEX 4 -#define ASCEND_RUNTIME_PATH_KEY "path" -#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" -#define RUNTIME_KEY "runtimes" -#define ASCEND_RUNTIME_NAME "ascend" -#define DEFALUT_KEY "default-runtime" -#define DEFAULT_VALUE "ascend" - -void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) -{ - fseek(pf, 0, SEEK_END); - - int size = (int)ftell(pf); - if (size >= maxBufferSize) { - fprintf(stderr, "file size too large\n"); - return; - } - - fseek(pf, 0, SEEK_SET); - fread(text, sizeof(char), size, pf); - text[size] = '\0'; -} - -cJSON *CreateAscendRuntimeInfo(const char *runtimePath) -{ - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - fprintf(stderr, "create ascend runtime info root err\n"); - return NULL; - } - - cJSON *newString = NULL; - newString = cJSON_CreateString(runtimePath); - if (newString == NULL) { - fprintf(stderr, "create ascend runtime info path value err\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON *paraArray = NULL; - paraArray = cJSON_CreateArray(); - if (paraArray == NULL) { - fprintf(stderr, "create ascend runtime info args err\n"); - cJSON_Delete(root); - cJSON_Delete(newString); - return NULL; - } - - cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); - cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); - - return root; -} - -cJSON *CreateRuntimes(const char *runtimePath) -{ - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(runtimePath); - if (ascendRuntime == NULL) { - fprintf(stderr, "create ascendruntime err\n"); - return NULL; - } - - cJSON *runtimes = NULL; - runtimes = cJSON_CreateObject(); - if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); - cJSON_Delete(ascendRuntime); - return NULL; - } - - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - - return runtimes; -} - -int DelJsonContent(cJSON *root, const char *key) -{ - cJSON *existItem = NULL; - existItem = cJSON_GetObjectItem(root, key); - if (existItem == NULL) { - return 0; - } - - cJSON *removedItem = NULL; - removedItem = cJSON_DetachItemViaPointer(root, existItem); - if (removedItem == NULL) { - fprintf(stderr, "remove %s failed\n", key); - return -1; - } - - cJSON_Delete(removedItem); - return 0; -} - -cJSON *CreateContent(const char *runtimePath) -{ - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = CreateRuntimes(runtimePath); - if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); - return NULL; - } - - cJSON *defaultRuntime = NULL; - defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(runtimes); - return NULL; - } - - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ - fprintf(stderr, "create root err\n"); - cJSON_Delete(runtimes); - cJSON_Delete(defaultRuntime); - return NULL; - } - - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -cJSON *ModifyContent(FILE *pf, const char *runtimePath) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - if (runtimes == NULL) { - runtimes = CreateRuntimes(runtimePath); - if (runtimes == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - } else { - int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(runtimePath); - if (ascendRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - } - - /* 插入defaul runtime */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -cJSON *RemoveContent(FILE *pf) -{ - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 去除default runtimes */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - /* 去除runtimes */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); - if (runtimes == NULL) { - fprintf(stderr, "no runtime key found\n"); - cJSON_Delete(root); - return NULL; - } - - ret = DelJsonContent(runtimes, DEFAULT_VALUE); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - return root; -} - - -int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) -{ - cJSON *root = NULL; - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - root = CreateContent(runtimePath); - } else { - root = ModifyContent(pf, runtimePath); - fclose(pf); - } - - if (root == NULL) { - fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); - return -1; - } - - fprintf(pf, "%s", cJSON_Print(root)); - fclose(pf); - - cJSON_Delete(root); - - return 0; -} - -int CreateRevisedJsonFile(const char *filePath, const char *tempPath) -{ - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - fprintf(stderr, "error: no json files found\n"); - return -1; - } - cJSON *newContent = NULL; - newContent = RemoveContent(pf); - fclose(pf); - - if (newContent == NULL) { - fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - return -1; - } - - fprintf(pf, "%s", cJSON_Print(newContent)); - fclose(pf); - - cJSON_Delete(newContent); - - return 0; -} - -/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ -int main(int argc, char *argv[]) -{ - if (argc < MIN_ARGS_NUM) { - return -1; - } - - printf("%s\n", argv[FINAL_FILE_INDEX]); - printf("%s\n", argv[TEMP_FILE_INDEX]); - printf("%s\n", argv[CMD_INDEX]); - - if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { - if (argc != ADD_CMD_ARGS_NUM) { - return -1; - } - - return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); - } - - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); -} diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec deleted file mode 100644 index f6f27aa..0000000 --- a/install/rpm/ascend-docker-plgugin.spec +++ /dev/null @@ -1,62 +0,0 @@ -Name: ascend-docker-runtime -Version: 20.10.0.B020 -Release: 1 -Summary: simple RPM package -License: FIXME - -%define _binaries_in_noarch_packages_terminate_build 0 - -%description -ascend-docker-plugin helps usrs to use NPU in docker - -%prep - -%build - -%install -mkdir -p %{buildroot}/usr/bin/ -cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/bin/ - -%pre - -%post -#!/bin/bash -DIR=/etc/docker -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -BINDIR=/usr/bin -if [ ! -d "${DIR}" ]; then -mkdir ${DIR} -fi -${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "create damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "create damom.json success\n" - -%preun -#!/bin/bash -DIR=/etc/docker -BINDIR=/usr/bin -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -if [ ! -f "${DST}" ]; then -exit 0 -fi -${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "del damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "del damom.json success\n" - -%postun - -%clean - -%files -%defattr(0755,root,root,0755) -/usr/bin/* -- Gitee From eeab1f98c4297ccc81e6525b42173ecb2be25966 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 19 Jan 2022 16:28:49 +0800 Subject: [PATCH 175/296] Match-id-1d8ac9a4d57edb43ef631405cdea90eae87f6c8c --- build/scripts/run_main.sh | 14 -------------- hook/main.go | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 36ed6f2..0559bf8 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -37,20 +37,6 @@ function install() chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list echo 'install executable files success' - - if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then - mkdir -p ${DOCKER_CONFIG_DIR} - fi - - SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" - DST="${DOCKER_CONFIG_DIR}/daemon.json" - if [ "$?" != "0" ]; then - echo 'create damon.json failed' - exit 1 - fi - - mv ${SRC} ${DST} - echo 'create damom.json success' echo 'please reboot docker daemon to take effect' } diff --git a/hook/main.go b/hook/main.go index 8a55787..1e66730 100644 --- a/hook/main.go +++ b/hook/main.go @@ -197,7 +197,7 @@ var getContainerConfig = func() (*containerConfig, error) { } // when use ctr->containerd. the rootfs in config.json is a relative path rfs := ociSpec.Root.Path - if (!filepath.IsAbs(rfs)) { + if !filepath.IsAbs(rfs) { rfs = path.Join(state.Bundle, ociSpec.Root.Path) } @@ -340,15 +340,11 @@ func doPrestartHook() error { args := append([]string{cliPath}, "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), - "--pid", fmt.Sprintf("%d", containerConfig.Pid), - "--rootfs", containerConfig.Rootfs) + "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) - for _, filePath := range fileMountList { - args = append(args, "--mount-file", filePath) - } - - for _, dirPath := range dirMountList { - args = append(args, "--mount-dir", dirPath) + args, mountError := addMounts(fileMountList, args, dirMountList) + if mountError != nil { + return mountError } if len(parsedOptions) > 0 { @@ -362,6 +358,31 @@ func doPrestartHook() error { return nil } +func addMounts(fileMountList []string, args []string, dirMountList []string) ([]string, error) { + for _, filePath := range fileMountList { + fileInfo, err := os.Lstat(filePath) + if err != nil { + return nil, fmt.Errorf("cannot get the path for mounting") + } + if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + return nil, fmt.Errorf("try to mount symlink") + } + args = append(args, "--mount-file", filePath) + } + + for _, dirPath := range dirMountList { + fileInfo, err := os.Lstat(dirPath) + if err != nil { + return nil, fmt.Errorf("cannot get the path for mounting") + } + if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + return nil, fmt.Errorf("try to mount symlink") + } + args = append(args, "--mount-dir", dirPath) + } + return args, nil +} + func main() { log.SetPrefix(loggingPrefix) flag.Parse() -- Gitee From 7d20803730d04fa2f8c7c3b636242a91193c11a5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 19 Jan 2022 21:32:42 +0800 Subject: [PATCH 176/296] Match-id-7dc14342229757308f9f769f9338f83e90093888 --- cli/src/cgrp.c | 18 ++++++++++-------- cli/src/logger.c | 6 ++++++ cli/src/utils.c | 17 +++++++++++++++++ cli/src/utils.h | 4 ++++ 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 9aaef40..90f4b18 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -78,7 +78,9 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const free(str); return -1; } - + if (CheckLegality(resolvedPath) != 0) { + Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); + } fp = fopen(resolvedPath, "r"); if (fp == NULL) { Logger("cannot open file.", LEVEL_ERROR, SCREEN_YES); @@ -271,16 +273,17 @@ int SetupCgroup(const struct ParsedConfig *config) FILE *cgroupAllow = NULL; if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - str = FormatLogMessage("cannot canonicalize cgroup path: %s.", config->cgroupPath); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - + if (CheckLegality(resolvedCgroupPath) != 0) { + Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); + return -1; + } cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { - str = FormatLogMessage("failed to open cgroup file: %s.", resolvedCgroupPath); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("failed to open cgroup file.", LEVEL_ERROR, SCREEN_YES); free(str); return -1; } @@ -306,8 +309,7 @@ int SetupCgroup(const struct ParsedConfig *config) ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); if (ret < 0) { fclose(cgroupAllow); - str = FormatLogMessage("failed to setup cgroup for %s.", deviceName); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("failed to setup cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); return -1; } diff --git a/cli/src/logger.c b/cli/src/logger.c index 1a0be42..6745515 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -66,6 +66,9 @@ long GetLogSize(const char* filename) if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { return -1; } + if (CheckLegality(path) != 0) { + return -1; + } fp = fopen(path, "rb"); long length = 0; if (fp != NULL) { @@ -119,6 +122,9 @@ void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsign if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { return; } + if (CheckLegality(path) != 0) { + return; + } fp = fopen(path, "a+"); if (fp != NULL) { char now[TEMP_BUFFER] = {0}; diff --git a/cli/src/utils.c b/cli/src/utils.c index 529c7be..15413dc 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -150,4 +150,21 @@ int MakeMountPoints(const char *path, mode_t mode) } close(fd); return 0; +} + +int CheckLegality(const char* filename) +{ + struct stat fileStat; + if (stat(filename, &fileStat) != 0) { + return -1; + } + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + fprintf(stderr, "Please check the folder owner!\n"); + return -1; + } + if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 + fprintf(stderr, "Please check the write permission!\n"); + return -1; + } + return 0; } \ No newline at end of file diff --git a/cli/src/utils.h b/cli/src/utils.h index e6f9412..ab83b5f 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -7,8 +7,11 @@ #include #include +#include #include "basic.h" +#define ROOT_UID 0 + char *FormatLogMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); @@ -18,5 +21,6 @@ int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); int MakeMountPoints(const char *path, mode_t mode); +int CheckLegality(const char* filename); #endif \ No newline at end of file -- Gitee From f11626c4739abf5eedaacb3b2a4a1059e0463da0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 20 Jan 2022 15:35:51 +0800 Subject: [PATCH 177/296] Match-id-9ad133bb4bc31d759f9fe686306c81e2007dcd2c --- cli/src/cgrp.c | 1 + cli/src/utils.c | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 90f4b18..29534bc 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -80,6 +80,7 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const } if (CheckLegality(resolvedPath) != 0) { Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); + return -1; } fp = fopen(resolvedPath, "r"); if (fp == NULL) { diff --git a/cli/src/utils.c b/cli/src/utils.c index 15413dc..56d05e8 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "securec.h" #include "logger.h" @@ -154,17 +155,25 @@ int MakeMountPoints(const char *path, mode_t mode) int CheckLegality(const char* filename) { - struct stat fileStat; - if (stat(filename, &fileStat) != 0) { - return -1; - } - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - fprintf(stderr, "Please check the folder owner!\n"); - return -1; - } - if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 - fprintf(stderr, "Please check the write permission!\n"); + char buf[PATH_MAX + 1] = {0x00}; + errno_t ret = strncpy_s(buf, PATH_MAX + 1, filename, strlen(filename)); + if (ret != EOK) { return -1; } + do { + struct stat fileStat; + if (stat(buf, &fileStat) != 0) { + return -1; + } + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + fprintf(stderr, "Please check the folder owner!\n"); + return -1; + } + if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 + fprintf(stderr, "Please check the write permission!\n"); + return -1; + } + } while(strcmp(dirname(buf), "/")); + return 0; } \ No newline at end of file -- Gitee From 83fa6102311ce30962ac0d8235e6efc1b2d985e1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 25 Jan 2022 20:05:24 +0800 Subject: [PATCH 178/296] Match-id-db6162815a2e2a0e6c5b6445422d421f7fea53ca --- cli/src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/utils.c b/cli/src/utils.c index 56d05e8..db7b6e4 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -173,7 +173,7 @@ int CheckLegality(const char* filename) fprintf(stderr, "Please check the write permission!\n"); return -1; } - } while(strcmp(dirname(buf), "/")); + } while (strcmp(dirname(buf), "/")); return 0; } \ No newline at end of file -- Gitee From b229cd2b54e40fac7b36fda9041249464baba5ca Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 26 Jan 2022 11:13:52 +0800 Subject: [PATCH 179/296] Match-id-65bd172869942939198fd228050c6643a24ebb09 --- README.md | 2 +- build/scripts/run_main.sh | 1 - build/scripts/uninstall.sh | 11 +---------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9d46a11..2d13a1f 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ chmod +x Ascend-cann-toolbox*.run systemctl daemon-reload systemctl restart docker ``` -安装docker-runtime后会修改配置文件/etc/docker/daemon.json +安装docker-runtime后会需要修改配置文件/etc/docker/daemon.json ![image](assets/20210329103157123.png) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 0559bf8..964c74a 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -50,7 +50,6 @@ function uninstall() fi ${INSTALL_PATH}/script/uninstall.sh - echo 'remove daemon.json setting success' [ -n "${INSTALL_PATH}" ] && rm -rf ${INSTALL_PATH} echo 'remove executable files success' diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 1faa629..869bb15 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -6,22 +6,13 @@ LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} ROOT=$(cd $(dirname $0); pwd)/.. -DST='/etc/docker/daemon.json' -SRC="${DST}.${PPID}" -ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d -if [ ! -f "${DST}" ]; then - exit 0 -fi +ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d if [ "$?" != "0" ]; then - echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" - echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} exit 1 fi -mv ${SRC} ${DST} - [ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) -- Gitee From 83ddbc6f5079e717073ded9e42b186eb5ed80705 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 26 Jan 2022 15:20:10 +0800 Subject: [PATCH 180/296] Match-id-8addf02fa9f508fcb75a643537457f7d1e5d121e --- README.md | 2 +- build/build.sh | 16 +- build/scripts/run_main.sh | 20 ++ build/scripts/uninstall.sh | 12 +- hook/main.go | 37 +-- install/deb/scripts/control | 3 + install/deb/scripts/postinst | 15 ++ install/deb/scripts/prerm | 15 ++ install/deb/src/CMakeLists.txt | 32 +++ install/deb/src/install | 10 + install/deb/src/main.c | 334 +++++++++++++++++++++++++ install/rpm/ascend-docker-plgugin.spec | 62 +++++ 12 files changed, 524 insertions(+), 34 deletions(-) create mode 100644 install/deb/scripts/control create mode 100644 install/deb/scripts/postinst create mode 100644 install/deb/scripts/prerm create mode 100644 install/deb/src/CMakeLists.txt create mode 100644 install/deb/src/install create mode 100644 install/deb/src/main.c create mode 100644 install/rpm/ascend-docker-plgugin.spec diff --git a/README.md b/README.md index 2d13a1f..9d46a11 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ chmod +x Ascend-cann-toolbox*.run systemctl daemon-reload systemctl restart docker ``` -安装docker-runtime后会需要修改配置文件/etc/docker/daemon.json +安装docker-runtime后会修改配置文件/etc/docker/daemon.json ![image](assets/20210329103157123.png) diff --git a/build/build.sh b/build/build.sh index 3a06279..fe9acea 100644 --- a/build/build.sh +++ b/build/build.sh @@ -14,6 +14,8 @@ BUILD=${ROOT}/build CLIDIR=${ROOT}/cli CLISRCNAME="main.c" +INSTALLHELPERDIR=${ROOT}/install +INSTALLHELPERSRCNAME="main.c" HOOKDIR=${ROOT}/hook HOOKSRCNAME="main.go" @@ -23,7 +25,8 @@ RUNTIMESRCNAME="main.go" CLISRCPATH=$(find ${CLIDIR} -name "${CLISRCNAME}") CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} - +INSTALLHELPERSRCPATH=$(find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}") +INSTALLHELPERSRCDIR=${INSTALLHELPERSRCPATH%/${INSTALLHELPERSRCNAME}} HOOKSRCPATH=$(find ${HOOKDIR} -name "${HOOKSRCNAME}") HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}} RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}") @@ -43,6 +46,13 @@ function build_bin() make clean make + echo "make installhelper" + [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build + mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build + cmake ${INSTALLHELPERSRCDIR} + make clean + make + [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src mkdir ${ROOT}/opensource/src cd ${HOOKDIR} @@ -77,12 +87,12 @@ function build_run_package() cd ${BUILD} mkdir run_pkg - /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/cli}/build/ascend-docker* run_pkg + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 5 ]; then + if [ $FILECNT -ne 6 ]; then exit 1 fi /bin/cp -rf ${ROOT}/assets run_pkg diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 964c74a..9c4cf90 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -18,9 +18,11 @@ function install() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -rf ./assets ${INSTALL_PATH}/assets cp -f ./README.md ${INSTALL_PATH}/README.md @@ -37,6 +39,21 @@ function install() chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list echo 'install executable files success' + + if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then + mkdir -p ${DOCKER_CONFIG_DIR} + fi + + SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" + DST="${DOCKER_CONFIG_DIR}/daemon.json" + ./ascend-docker-plugin-install-helper add ${DST} ${SRC} ${INSTALL_PATH}/ascend-docker-runtime + if [ "$?" != "0" ]; then + echo 'create damon.json failed' + exit 1 + fi + + mv ${SRC} ${DST} + echo 'create damom.json success' echo 'please reboot docker daemon to take effect' } @@ -50,6 +67,7 @@ function uninstall() fi ${INSTALL_PATH}/script/uninstall.sh + echo 'remove daemon.json setting success' [ -n "${INSTALL_PATH}" ] && rm -rf ${INSTALL_PATH} echo 'remove executable files success' @@ -74,11 +92,13 @@ function upgrade() cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 500 ${INSTALL_PATH}/script/uninstall.sh chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index 869bb15..2cb5b28 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -6,13 +6,23 @@ LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} ROOT=$(cd $(dirname $0); pwd)/.. - +DST='/etc/docker/daemon.json' +SRC="${DST}.${PPID}" ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d +if [ ! -f "${DST}" ]; then + exit 0 +fi + +${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} if [ "$?" != "0" ]; then + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} exit 1 fi +mv ${SRC} ${DST} + [ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) diff --git a/hook/main.go b/hook/main.go index 1e66730..c909114 100644 --- a/hook/main.go +++ b/hook/main.go @@ -340,11 +340,15 @@ func doPrestartHook() error { args := append([]string{cliPath}, "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), - "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) + "--pid", fmt.Sprintf("%d", containerConfig.Pid), + "--rootfs", containerConfig.Rootfs) - args, mountError := addMounts(fileMountList, args, dirMountList) - if mountError != nil { - return mountError + for _, filePath := range fileMountList { + args = append(args, "--mount-file", filePath) + } + + for _, dirPath := range dirMountList { + args = append(args, "--mount-dir", dirPath) } if len(parsedOptions) > 0 { @@ -358,31 +362,6 @@ func doPrestartHook() error { return nil } -func addMounts(fileMountList []string, args []string, dirMountList []string) ([]string, error) { - for _, filePath := range fileMountList { - fileInfo, err := os.Lstat(filePath) - if err != nil { - return nil, fmt.Errorf("cannot get the path for mounting") - } - if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { - return nil, fmt.Errorf("try to mount symlink") - } - args = append(args, "--mount-file", filePath) - } - - for _, dirPath := range dirMountList { - fileInfo, err := os.Lstat(dirPath) - if err != nil { - return nil, fmt.Errorf("cannot get the path for mounting") - } - if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { - return nil, fmt.Errorf("try to mount symlink") - } - args = append(args, "--mount-dir", dirPath) - } - return args, nil -} - func main() { log.SetPrefix(loggingPrefix) flag.Parse() diff --git a/install/deb/scripts/control b/install/deb/scripts/control new file mode 100644 index 0000000..65fdc00 --- /dev/null +++ b/install/deb/scripts/control @@ -0,0 +1,3 @@ +Maintainer: huawei +Description: asenddockertool. + The asend docker tool help usr to modify a customed deamon.json. diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst new file mode 100644 index 0000000..29dc923 --- /dev/null +++ b/install/deb/scripts/postinst @@ -0,0 +1,15 @@ +#!/bin/bash +DIR=/etc/docker +if [ ! -d "${DIR}" ]; then +mkdir ${DIR} +fi +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +BINDIR=/usr/bin +${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "create damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "create damom.json success\n" diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm new file mode 100644 index 0000000..ebfb388 --- /dev/null +++ b/install/deb/scripts/prerm @@ -0,0 +1,15 @@ +#!/bin/bash +DIR=/etc/docker +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +if [ ! -f "${DST}" ]; then +exit 0 +fi +BINDIR=/usr/bin +${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "del damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "del damom.json success\n" diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt new file mode 100644 index 0000000..e0db884 --- /dev/null +++ b/install/deb/src/CMakeLists.txt @@ -0,0 +1,32 @@ +# CMake 最低版本号要求 +cmake_minimum_required (VERSION 2.8) + +# 项目信息 +project (ascend-docker-plugin-install-helper) + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + + +#导入头文件所在路径 +#PROJECT_SOURCE_DIR为cmake宏 +include_directories("../../../opensource/cJSON-1.7.14") +include_directories("../../../platform/HuaweiSecureC/include") + +# 查找当前目录下的所有源文件 +# 并将名称保存到 SRC 变量 +aux_source_directory(. SRC) + +# 指定生成目标 +add_executable(ascend-docker-plugin-install-helper ${SRC}) + +# 添加子目录 +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC) + +# 添加链接库 +#该命令要在add_executable命令下方,否则报错 +target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now cjson) +target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now HuaweiSecureC) + diff --git a/install/deb/src/install b/install/deb/src/install new file mode 100644 index 0000000..10c46f6 --- /dev/null +++ b/install/deb/src/install @@ -0,0 +1,10 @@ +#! /bin/bash +echo "extract files\n" +if [ ! -d "../cjson" ];then + mkdir ../src +else + rm -rf ../src +fi +/bin/cp -rf ${files} ../cjson +tar -zxvf ../*.tar.gz +files=`find ../ -name "cJSON.*"` diff --git a/install/deb/src/main.c b/install/deb/src/main.c new file mode 100644 index 0000000..2dd7a79 --- /dev/null +++ b/install/deb/src/main.c @@ -0,0 +1,334 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker +*/ +#include +#include +#include +#include +#include "cJSON.h" + +#define MAX_JSON_FILE_SIZE 65535 +#define MIN_ARGS_NUM 4 +#define ADD_CMD_ARGS_NUM 5 +#define ADD_CMD "add" +#define RM_CMD "rm" +#define CMD_INDEX 1 +#define FINAL_FILE_INDEX 2 +#define TEMP_FILE_INDEX 3 +#define RUNTIME_PATH_INDEX 4 +#define ASCEND_RUNTIME_PATH_KEY "path" +#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" +#define RUNTIME_KEY "runtimes" +#define ASCEND_RUNTIME_NAME "ascend" +#define DEFALUT_KEY "default-runtime" +#define DEFAULT_VALUE "ascend" + +static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) +{ + (void)fseek(pf, 0, SEEK_END); + + int size = (int)ftell(pf); + if (size >= maxBufferSize) { + fprintf(stderr, "file size too large\n"); + return; + } + + (void)fseek(pf, 0, SEEK_SET); + if (fread(text, sizeof(char), size, pf) != 0) { + return; + } + text[size] = '\0'; +} + +static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) +{ + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + fprintf(stderr, "create ascend runtime info root err\n"); + return NULL; + } + + cJSON *newString = NULL; + newString = cJSON_CreateString(runtimePath); + if (newString == NULL) { + fprintf(stderr, "create ascend runtime info path value err\n"); + cJSON_Delete(root); + return NULL; + } + + cJSON *paraArray = NULL; + paraArray = cJSON_CreateArray(); + if (paraArray == NULL) { + fprintf(stderr, "create ascend runtime info args err\n"); + cJSON_Delete(root); + cJSON_Delete(newString); + return NULL; + } + + cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); + cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); + + return root; +} + +static cJSON *CreateRuntimes(const char *runtimePath) +{ + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(runtimePath); + if (ascendRuntime == NULL) { + fprintf(stderr, "create ascendruntime err\n"); + return NULL; + } + + cJSON *runtimes = NULL; + runtimes = cJSON_CreateObject(); + if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + cJSON_Delete(ascendRuntime); + return NULL; + } + + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + + return runtimes; +} + +static int DelJsonContent(cJSON *root, const char *key) +{ + cJSON *existItem = NULL; + existItem = cJSON_GetObjectItem(root, key); + if (existItem == NULL) { + return 0; + } + + cJSON *removedItem = NULL; + removedItem = cJSON_DetachItemViaPointer(root, existItem); + if (removedItem == NULL) { + fprintf(stderr, "remove %s failed\n", key); + return -1; + } + + cJSON_Delete(removedItem); + return 0; +} + +static cJSON *CreateContent(const char *runtimePath) +{ + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = CreateRuntimes(runtimePath); + if (runtimes == NULL) { + fprintf(stderr, "create runtimes err\n"); + return NULL; + } + + cJSON *defaultRuntime = NULL; + defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(runtimes); + return NULL; + } + + cJSON *root = NULL; + root = cJSON_CreateObject(); + if (root == NULL) { + /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ + fprintf(stderr, "create root err\n"); + cJSON_Delete(runtimes); + cJSON_Delete(defaultRuntime); + return NULL; + } + + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); + + return root; +} + +static cJSON *ModifyContent(FILE *pf, const char *runtimePath) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 插入ascend runtime */ + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, "runtimes"); + if (runtimes == NULL) { + runtimes = CreateRuntimes(runtimePath); + if (runtimes == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + } else { + int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *ascendRuntime = NULL; + ascendRuntime = CreateAscendRuntimeInfo(runtimePath); + if (ascendRuntime == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); + } + + /* 插入defaul runtime */ + int ret = DelJsonContent(root, DEFALUT_KEY); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); + if (defaultRuntime == NULL) { + cJSON_Delete(root); + return NULL; + } + cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); + + return root; +} + +static cJSON *RemoveContent(FILE *pf) +{ + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 去除default runtimes */ + int ret = DelJsonContent(root, DEFALUT_KEY); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + + /* 去除runtimes */ + cJSON *runtimes = NULL; + runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); + if (runtimes == NULL) { + fprintf(stderr, "no runtime key found\n"); + cJSON_Delete(root); + return NULL; + } + + ret = DelJsonContent(runtimes, DEFAULT_VALUE); + if (ret != 0) { + cJSON_Delete(root); + return NULL; + } + + return root; +} + + +static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) +{ + cJSON *root = NULL; + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + root = CreateContent(runtimePath); + } else { + root = ModifyContent(pf, runtimePath); + fclose(pf); + } + + if (root == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + return -1; + } + + if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { + fprintf(stderr, "error: failed to create file\n"); + (void)fclose(pf); + cJSON_Delete(root); + return -1; + } + (void)fclose(pf); + + cJSON_Delete(root); + + return 0; +} + +static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) +{ + FILE *pf = NULL; + pf = fopen(filePath, "r+"); + if (pf == NULL) { + fprintf(stderr, "error: no json files found\n"); + return -1; + } + cJSON *newContent = NULL; + newContent = RemoveContent(pf); + (void)fclose(pf); + + if (newContent == NULL) { + fprintf(stderr, "error: failed to create json\n"); + return -1; + } + + pf = fopen(tempPath, "w"); + if (pf == NULL) { + fprintf(stderr, "error: failed to create file\n"); + cJSON_Delete(newContent); + return -1; + } + + if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { + fprintf(stderr, "error: failed to create file\n"); + cJSON_Delete(newContent); + return -1; + } + (void)fclose(pf); + + cJSON_Delete(newContent); + + return 0; +} + +/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ +int main(int argc, char *argv[]) +{ + if (argc < MIN_ARGS_NUM) { + return -1; + } + + printf("%s\n", argv[FINAL_FILE_INDEX]); + printf("%s\n", argv[TEMP_FILE_INDEX]); + printf("%s\n", argv[CMD_INDEX]); + + if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { + if (argc != ADD_CMD_ARGS_NUM) { + return -1; + } + + return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); + } + + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); +} diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec new file mode 100644 index 0000000..f6f27aa --- /dev/null +++ b/install/rpm/ascend-docker-plgugin.spec @@ -0,0 +1,62 @@ +Name: ascend-docker-runtime +Version: 20.10.0.B020 +Release: 1 +Summary: simple RPM package +License: FIXME + +%define _binaries_in_noarch_packages_terminate_build 0 + +%description +ascend-docker-plugin helps usrs to use NPU in docker + +%prep + +%build + +%install +mkdir -p %{buildroot}/usr/bin/ +cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/bin/ + +%pre + +%post +#!/bin/bash +DIR=/etc/docker +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +BINDIR=/usr/bin +if [ ! -d "${DIR}" ]; then +mkdir ${DIR} +fi +${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "create damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "create damom.json success\n" + +%preun +#!/bin/bash +DIR=/etc/docker +BINDIR=/usr/bin +SRC="${DIR}/daemon.json.${PPID}" +DST="${DIR}/daemon.json" +if [ ! -f "${DST}" ]; then +exit 0 +fi +${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then +echo "del damon.json failed\n" +exit 1 +fi +\mv ${SRC} ${DST} +echo "del damom.json success\n" + +%postun + +%clean + +%files +%defattr(0755,root,root,0755) +/usr/bin/* -- Gitee From 319abb14eb69b2c8e549e83d15c0b6b5086ec96d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 21 Feb 2022 17:17:58 +0800 Subject: [PATCH 181/296] Match-id-fd706c08945c4519bcefe0d295d55c42c7ad1711 --- cli/src/basic.c | 5 +++++ install/deb/src/main.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/cli/src/basic.c b/cli/src/basic.c index 643cc9f..3af9c37 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -6,5 +6,10 @@ void InitParsedConfig(struct ParsedConfig *parsedConfig) { + if (parsedConfig != NULL) + { + Logger("parsedConfig Pointer is null!."); + return; + } parsedConfig->devicesNr = MAX_DEVICE_NR; } \ No newline at end of file diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 2dd7a79..d3c8ee6 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -26,6 +26,10 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { + if (pf == NULL || text == NULL) { + fprintf(stderr, "file pointer or text pointer are null!\n"); + return NULL; + } (void)fseek(pf, 0, SEEK_END); int size = (int)ftell(pf); @@ -43,6 +47,10 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { + if (runtimePath = NULL) { + fprintf(stderr, "runtimePath pointer are null!\n"); + return NULL; + } cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { @@ -75,6 +83,10 @@ static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) static cJSON *CreateRuntimes(const char *runtimePath) { + if (runtimePath == NULL) { + fprintf(stderr, "runtimePath pointer is null!\n"); + return NULL; + } cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { @@ -97,6 +109,10 @@ static cJSON *CreateRuntimes(const char *runtimePath) static int DelJsonContent(cJSON *root, const char *key) { + if (root == NULL || key == NULL) { + fprintf(stderr, "userInfo pointer is null!\n"); + return NULL; + } cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); if (existItem == NULL) { @@ -116,6 +132,10 @@ static int DelJsonContent(cJSON *root, const char *key) static cJSON *CreateContent(const char *runtimePath) { + if (runtimePath == NULL) { + fprintf(stderr, "runtimePath pointer is null!\n"); + return NULL; + } /* 插入ascend runtime */ cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); @@ -150,6 +170,10 @@ static cJSON *CreateContent(const char *runtimePath) static cJSON *ModifyContent(FILE *pf, const char *runtimePath) { + if (pf == NULL || runtimePath == NULL) { + fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); + return NULL; + } char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -203,6 +227,10 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) static cJSON *RemoveContent(FILE *pf) { + if (pf == NULL) { + fprintf(stderr, "file pointer is null!\n"); + return NULL; + } char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -241,6 +269,10 @@ static cJSON *RemoveContent(FILE *pf) static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { + if (filePath = NULL || tempPath = NULL || runtimePath = NULL) { + fprintf(stderr, "filePath Pointer or tempPath or runtimePath are null!\n"); + return -1; + } cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); @@ -277,6 +309,10 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { + if (filePath == NULL || tempPath == NULL) { + fprintf(stderr, "filePath Pointer or tempPath are null!\n"); + return -1; + } FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { -- Gitee From 259e4f135b33e7ce84e46822ce089fbb1614251a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 21 Feb 2022 17:17:58 +0800 Subject: [PATCH 182/296] Match-id-6adfe6f25f003b5b11546ef37c098ea7e05ae7a7 --- cli/src/basic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/basic.c b/cli/src/basic.c index 3af9c37..37ca120 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -3,11 +3,17 @@ * Description: ascend-docker-cli工具公共宏和结构体定义 */ #include "basic.h" +#include +#include "logger.h" void InitParsedConfig(struct ParsedConfig *parsedConfig) { +<<<<<<< HEAD + if (parsedConfig != NULL) { +======= if (parsedConfig != NULL) { +>>>>>>> fd706c08945c4519bcefe0d295d55c42c7ad1711 Logger("parsedConfig Pointer is null!."); return; } -- Gitee From 970a4033d2202f1b8739f89e365ecab3090aed7a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 21 Feb 2022 17:17:58 +0800 Subject: [PATCH 183/296] Match-id-c25fd09e916068308714c720e95c14dc885d8b41 --- cli/src/basic.c | 12 +++---- cli/src/cgrp.c | 71 +++++++++++++++++++++++++++++++++++------- cli/src/logger.c | 20 ++++++++++++ cli/src/main.c | 58 ++++++++++++++++++++++++++++++++++ cli/src/options.c | 5 +++ cli/src/u_mount.c | 68 +++++++++++++++++++++++++++++++++------- cli/src/utils.c | 35 +++++++++++++++++++++ install/deb/src/main.c | 21 +++++++++---- 8 files changed, 254 insertions(+), 36 deletions(-) diff --git a/cli/src/basic.c b/cli/src/basic.c index 37ca120..d4de536 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -4,18 +4,14 @@ */ #include "basic.h" #include -#include "logger.h" +#include void InitParsedConfig(struct ParsedConfig *parsedConfig) { -<<<<<<< HEAD - if (parsedConfig != NULL) { -======= - if (parsedConfig != NULL) - { ->>>>>>> fd706c08945c4519bcefe0d295d55c42c7ad1711 - Logger("parsedConfig Pointer is null!."); + if (parsedConfig == NULL) { + fprintf(stderr, "parsedConfig pointer is null!\n"); return; } + parsedConfig->devicesNr = MAX_DEVICE_NR; } \ No newline at end of file diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 29534bc..83b5864 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -21,6 +21,11 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) { + if (pLine == NULL || word == NULL) { + fprintf(stderr, "pLine, word pointer is null!\n"); + return false; + } + char *w = NULL; for (unsigned int i = 0; i < n; i++) { w = strsep(pLine, " "); @@ -35,6 +40,11 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) bool CheckRootDir(char **pLine) { + if (pLine == NULL) { + fprintf(stderr, "pLine pointer is null!\n"); + return false; + } + char *rootDir = NULL; if (!TakeNthWord(pLine, ROOT_GAP, &rootDir)) { return false; @@ -45,6 +55,11 @@ bool CheckRootDir(char **pLine) bool CheckFsType(char **pLine) { + if (pLine == NULL) { + fprintf(stderr, "pLine pointer is null!\n"); + return false; + } + char* fsType = NULL; if (!TakeNthWord(pLine, FSTYPE_GAP, &fsType)) { return false; @@ -55,6 +70,11 @@ bool CheckFsType(char **pLine) bool CheckSubStr(char **pLine, const char *subsys) { + if (pLine == NULL || subsys == NULL) { + fprintf(stderr, "pLine, subsys pointer is null!\n"); + return false; + } + char* substr = NULL; if (!TakeNthWord(pLine, MOUNT_SUBSTR_GAP, &substr)) { return false; @@ -66,6 +86,11 @@ bool CheckSubStr(char **pLine, const char *subsys) typedef char *(*ParseFileLine)(char *, const char *); int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) { + if (buffer == NULL || filepath == NULL) { + fprintf(stderr, "buffer, filepath pointer is null!\n"); + return -1; + } + FILE *fp = NULL; char *result = NULL; char *line = NULL; @@ -107,6 +132,11 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char *GetCgroupMount(char *line, const char *subsys) { + if (line == NULL || subsys == NULL) { + fprintf(stderr, "line, subsys pointer is null!\n"); + return NULL; + } + if (!CheckRootDir(&line)) { return NULL; } @@ -131,6 +161,11 @@ char *GetCgroupMount(char *line, const char *subsys) char *GetCgroupRoot(char *line, const char *subSystem) { + if (line == NULL || subSystem == NULL) { + fprintf(stderr, "line, subSystem pointer is null!\n"); + return NULL; + } + char *token = NULL; int i; for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { @@ -156,6 +191,11 @@ char *GetCgroupRoot(char *line, const char *subSystem) int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) { + if (cgroupAllow == NULL || devName == NULL) { + fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); + return -1; + } + int ret; struct stat devStat; char devPath[BUF_SIZE]; @@ -188,8 +228,12 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) int SetupDriverCgroup(FILE *cgroupAllow) { - int ret; + if (cgroupAllow == NULL) { + fprintf(stderr, "cgroupAllow pointer is null!\n"); + return -1; + } + int ret; ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { char* str = FormatLogMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER); @@ -219,6 +263,11 @@ int SetupDriverCgroup(FILE *cgroupAllow) int GetCgroupPath(int pid, char *effPath, size_t maxSize) { + if (effPath == NULL) { + fprintf(stderr, "effPath pointer is null!\n"); + return -1; + } + int ret; char mountPath[BUF_SIZE] = {0x0}; char mount[BUF_SIZE] = {0x0}; @@ -267,12 +316,15 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { - int ret; + if (config == NULL) { + fprintf(stderr, "config pointer is null!\n"); + return -1; + } + char *str = NULL; char deviceName[BUF_SIZE] = {0}; char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; - if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); @@ -289,26 +341,23 @@ int SetupCgroup(const struct ParsedConfig *config) return -1; } - ret = SetupDriverCgroup(cgroupAllow); - if (ret < 0) { + if (SetupDriverCgroup(cgroupAllow) < 0) { fclose(cgroupAllow); Logger("failed to setup driver cgroup.", LEVEL_ERROR, SCREEN_YES); return -1; } - for (size_t idx = 0; idx < config->devicesNr; idx++) { - int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", + if (sprintf_s(deviceName, BUF_SIZE, "%s%u", (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), - config->devices[idx]); - if (ret < 0) { + config->devices[idx]) < 0) { fclose(cgroupAllow); str = FormatLogMessage("failed to assemble device path for no.%u.", config->devices[idx]); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); - if (ret < 0) { + + if (SetupDeviceCgroup(cgroupAllow, (const char *)deviceName) < 0) { fclose(cgroupAllow); Logger("failed to setup cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); diff --git a/cli/src/logger.c b/cli/src/logger.c index 6745515..4445c78 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -22,6 +22,11 @@ int GetCurrentLocalTime(char* buffer, int length) { + if (buffer == NULL) { + fprintf(stderr, "buffer pointer is null!\n"); + return -1; + } + time_t timep = time(NULL); struct tm result = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct tm *timeinfo = localtime_r(&timep, &result); @@ -56,6 +61,11 @@ int CreateLog(const char* filename) long GetLogSize(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + int ret; ret = CreateLog(filename); if (ret < 0) { @@ -85,6 +95,11 @@ long GetLogSize(const char* filename) int LogLoop(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + int ret; char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; int exist; @@ -105,6 +120,11 @@ int LogLoop(const char* filename) void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) { + if (filename == NULL || buffer == NULL) { + fprintf(stderr, "filename, buffer pointer is null!\n"); + return; + } + if (filename != NULL && buffer != NULL) { char path[PATH_MAX + 1] = {0x00}; FILE *fp = NULL; diff --git a/cli/src/main.c b/cli/src/main.c index ac7c06d..5319d83 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -47,6 +47,11 @@ typedef bool (*CmdArgParser)(struct CmdArgs *args, const char *arg); static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get devices from cmd args.", LEVEL_ERROR, SCREEN_YES); @@ -58,6 +63,11 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { @@ -79,6 +89,11 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get rootfs path from cmd args", LEVEL_ERROR, SCREEN_YES); @@ -90,6 +105,11 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get options string from cmd args", LEVEL_ERROR, SCREEN_YES); @@ -101,6 +121,11 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + if (args->files.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); @@ -122,6 +147,11 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + if (args->dirs.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); @@ -157,6 +187,11 @@ static struct { static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) { + if (args == NULL || value == NULL) { + fprintf(stderr, "args, value pointer is null!\n"); + return -1; + } + int i; for (i = 0; i < NUM_OF_CMD_ARGS; i++) { if (g_cmdArgParsers[i].c == indicator) { @@ -182,11 +217,20 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu static inline bool IsCmdArgsValid(const struct CmdArgs *args) { + if (args == NULL) { + fprintf(stderr, "args pointer is null!\n"); + return false; + } return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) { + if (idList == NULL || idListSize == NULL || devices == NULL) { + fprintf(stderr, "idList, idListSize, devices pointer is null!\n"); + return -1; + } + static const char *sep = ","; char *token = NULL; char *context = NULL; @@ -220,6 +264,11 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { + if (args == NULL || config == NULL) { + fprintf(stderr, "args, config pointer is null!\n"); + return -1; + } + int ret; errno_t err; @@ -272,6 +321,11 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) int SetupContainer(struct CmdArgs *args) { + if (args == NULL) { + fprintf(stderr, "args pointer is null!\n"); + return -1; + } + int ret; struct ParsedConfig config; @@ -324,6 +378,10 @@ int SetupContainer(struct CmdArgs *args) int Process(int argc, char **argv) { + if (argv == NULL) { + fprintf(stderr, "argv pointer is null!\n"); + return -1; + } int c; int ret; int optionIndex; diff --git a/cli/src/options.c b/cli/src/options.c index 144e3d3..2300016 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -24,6 +24,11 @@ static struct { void ParseRuntimeOptions(const char *options) { + if (options == NULL) { + fprintf(stderr, "options pointer is null!\n"); + return; + } + // set defaults value g_runtimeOptions.noDrv = false; g_runtimeOptions.isVirtual = false; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index a54f08f..129f540 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -18,6 +18,11 @@ int Mount(const char *src, const char *dst) { + if (src == NULL || dst == NULL) { + fprintf(stderr, "src pointer or dst pointer is null!\n"); + return -1; + } + static const unsigned long mountFlags = MS_BIND; static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; int ret; @@ -44,6 +49,11 @@ int Mount(const char *src, const char *dst) static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName, struct PathInfo* pathInfo) { + if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL || pathInfo == NULL) { + fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName, pathInfo pointer are null!\n"); + return -1; + } + int ret; errno_t err; char unresolvedDst[BUF_SIZE] = {0}; @@ -96,21 +106,23 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { - int ret; + if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL) { + fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName pointer is null!\n"); + return -1; + } + char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); - if (ret < 0) { + if (GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo) < 0) { str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } struct stat srcStat; - ret = stat((const char *)src, &srcStat); - if (ret < 0) { + if (stat((const char *)src, &srcStat) < 0) { str = FormatLogMessage("failed to stat src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -118,6 +130,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } errno = 0; struct stat dstStat; + int ret; ret = stat((const char *)dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 @@ -130,15 +143,15 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); return -1; } - ret = MakeMountPoints(dst, srcStat.st_mode); - if (ret < 0) { + + if (MakeMountPoints(dst, srcStat.st_mode) < 0) { str = FormatLogMessage("failed to create mount dst file: %s.", dst); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - ret = Mount(src, dst); - if (ret < 0) { + + if (Mount(src, dst) < 0) { Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -148,6 +161,11 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { + if (rootfs == NULL || device_name == NULL) { + fprintf(stderr, "rootfs, device_name pointer is null!\n"); + return -1; + } + char srcDeviceName[BUF_SIZE] = {0}; char dstDeviceName[BUF_SIZE] = {0}; @@ -174,6 +192,11 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int MountFile(const char *rootfs, const char *filepath) { + if (rootfs == NULL || filepath == NULL) { + fprintf(stderr, "rootfs, filepath pointer is null!\n"); + return -1; + } + int ret; char dst[BUF_SIZE] = {0}; @@ -210,6 +233,11 @@ int MountFile(const char *rootfs, const char *filepath) int MountDir(const char *rootfs, const char *src) { + if (rootfs == NULL || src == NULL) { + fprintf(stderr, "rootfs, src pointer is null!\n"); + return -1; + } + int ret; char dst[BUF_SIZE] = {0}; @@ -245,6 +273,11 @@ int MountDir(const char *rootfs, const char *src) int DoCtrlDeviceMounting(const char *rootfs) { + if (rootfs == NULL) { + fprintf(stderr, "rootfs pointer is null!\n"); + return -1; + } + /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { @@ -275,8 +308,12 @@ int DoCtrlDeviceMounting(const char *rootfs) int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { - int ret; + if (rootfs == NULL || list == NULL) { + fprintf(stderr, "rootfs, list pointer is null!\n"); + return -1; + } + int ret; for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { @@ -292,8 +329,12 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) int DoFileMounting(const char *rootfs, const struct MountList *list) { - int ret; + if (rootfs == NULL || list == NULL) { + fprintf(stderr, "rootfs, list pointer is null!\n"); + return -1; + } + int ret; for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { @@ -309,6 +350,11 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) int DoMounting(const struct ParsedConfig *config) { + if (config == NULL) { + fprintf(stderr, "config pointer is null!\n"); + return -1; + } + int ret; ret = DoDeviceMounting(config->rootfs, (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), diff --git a/cli/src/utils.c b/cli/src/utils.c index db7b6e4..b35cb23 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -18,6 +18,11 @@ char *FormatLogMessage(char *format, ...) { + if (format == NULL) { + fprintf(stderr, "format pointer is null!\n"); + return NULL; + } + va_list list; // 获取格式化后字符串的长度 va_start(list, format); @@ -55,6 +60,11 @@ int StrHasPrefix(const char *str, const char *prefix) int MkDir(const char *dir, int mode) { + if (dir == NULL) { + fprintf(stderr, "dir pointer is null!\n"); + return -1; + } + return mkdir(dir, mode); } @@ -68,6 +78,11 @@ int VerifyPathInfo(const struct PathInfo* pathInfo) int CheckDirExists(const char *dir) { + if (dir == NULL) { + fprintf(stderr, "dir pointer is null!\n"); + return -1; + } + DIR *ptr = opendir(dir); if (NULL == ptr) { return -1; @@ -79,6 +94,11 @@ int CheckDirExists(const char *dir) int GetParentPathStr(const char *path, char *parent, size_t bufSize) { + if (path == NULL || parent == NULL) { + fprintf(stderr, "path pointer or parentPath is null!\n"); + return -1; + } + char *ptr = strrchr(path, '/'); if (ptr == NULL) { return 0; @@ -99,6 +119,11 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) int MakeDirWithParent(const char *path, mode_t mode) { + if (path == NULL) { + fprintf(stderr, "path pointer is null!\n"); + return -1; + } + if (*path == '\0' || *path == '.') { return 0; } @@ -122,6 +147,11 @@ int MakeDirWithParent(const char *path, mode_t mode) int MakeMountPoints(const char *path, mode_t mode) { + if (path == NULL) { + fprintf(stderr, "path pointer is null!\n"); + return -1; + } + /* directory */ char parentDir[BUF_SIZE] = {0}; GetParentPathStr(path, parentDir, BUF_SIZE); @@ -155,6 +185,11 @@ int MakeMountPoints(const char *path, mode_t mode) int CheckLegality(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + char buf[PATH_MAX + 1] = {0x00}; errno_t ret = strncpy_s(buf, PATH_MAX + 1, filename, strlen(filename)); if (ret != EOK) { diff --git a/install/deb/src/main.c b/install/deb/src/main.c index d3c8ee6..0210e91 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -28,8 +28,9 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { if (pf == NULL || text == NULL) { fprintf(stderr, "file pointer or text pointer are null!\n"); - return NULL; + return; } + (void)fseek(pf, 0, SEEK_END); int size = (int)ftell(pf); @@ -47,10 +48,11 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { - if (runtimePath = NULL) { + if (runtimePath == NULL) { fprintf(stderr, "runtimePath pointer are null!\n"); return NULL; } + cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { @@ -87,6 +89,7 @@ static cJSON *CreateRuntimes(const char *runtimePath) fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } + cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { @@ -111,8 +114,9 @@ static int DelJsonContent(cJSON *root, const char *key) { if (root == NULL || key == NULL) { fprintf(stderr, "userInfo pointer is null!\n"); - return NULL; + return -1; } + cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); if (existItem == NULL) { @@ -136,6 +140,7 @@ static cJSON *CreateContent(const char *runtimePath) fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } + /* 插入ascend runtime */ cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); @@ -174,6 +179,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); return NULL; } + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -231,6 +237,7 @@ static cJSON *RemoveContent(FILE *pf) fprintf(stderr, "file pointer is null!\n"); return NULL; } + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -269,10 +276,11 @@ static cJSON *RemoveContent(FILE *pf) static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { - if (filePath = NULL || tempPath = NULL || runtimePath = NULL) { - fprintf(stderr, "filePath Pointer or tempPath or runtimePath are null!\n"); + if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { + fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); return -1; } + cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); @@ -310,9 +318,10 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { if (filePath == NULL || tempPath == NULL) { - fprintf(stderr, "filePath Pointer or tempPath are null!\n"); + fprintf(stderr, "filePath or tempPath are null!\n"); return -1; } + FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { -- Gitee From 697af523ee3707f332f8909180d4a82e093f6faf Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 22 Feb 2022 15:54:08 +0800 Subject: [PATCH 184/296] Match-id-c6cbeee5e47608c24c4301878b5f1acceddee981 --- cli/src/cgrp.c | 11 ++--------- cli/src/ns.c | 8 ++------ cli/src/utils.c | 14 ++++---------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 29534bc..fbb059a 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -73,9 +73,7 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char resolvedPath[PATH_MAX] = {0x0}; if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - char* str = FormatLogMessage("cannot canonicalize path %s.", filepath); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("Cannot canonicalize path.", LEVEL_ERROR, SCREEN_YES); return -1; } if (CheckLegality(resolvedPath) != 0) { @@ -170,9 +168,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) ret = stat((const char *)devPath, &devStat); if (ret < 0) { - char* str = FormatLogMessage("failed to get stat of %s.", devPath); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("Failed to get stat of devpath.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -275,7 +271,6 @@ int SetupCgroup(const struct ParsedConfig *config) if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); - free(str); return -1; } if (CheckLegality(resolvedCgroupPath) != 0) { @@ -285,7 +280,6 @@ int SetupCgroup(const struct ParsedConfig *config) cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { Logger("failed to open cgroup file.", LEVEL_ERROR, SCREEN_YES); - free(str); return -1; } @@ -311,7 +305,6 @@ int SetupCgroup(const struct ParsedConfig *config) if (ret < 0) { fclose(cgroupAllow); Logger("failed to setup cgroup.", LEVEL_ERROR, SCREEN_YES); - free(str); return -1; } } diff --git a/cli/src/ns.c b/cli/src/ns.c index 13a3a55..df62101 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -44,17 +44,13 @@ int EnterNsByPath(const char *path, int nsType) fd = open(path, O_RDONLY); // proc文件接口,非外部输入 if (fd < 0) { - char* str = FormatLogMessage("failed to open ns path: %s.", path); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("Failed to open ns path.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = EnterNsByFd(fd, nsType); if (ret < 0) { - char* str = FormatLogMessage("failed to set ns: %s.", path); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to set ns.", LEVEL_ERROR, SCREEN_YES); close(fd); return -1; } diff --git a/cli/src/utils.c b/cli/src/utils.c index db7b6e4..7b625e3 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -128,25 +128,19 @@ int MakeMountPoints(const char *path, mode_t mode) int ret = MakeDirWithParent(parentDir, DEFAULT_DIR_MODE); if (ret < 0) { - char* str = FormatLogMessage("failed to make parent dir for file: %s", path); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("Failed to make parent dir for file.", LEVEL_ERROR, SCREEN_YES); return -1; } char resolvedPath[PATH_MAX] = {0}; if (realpath(path, resolvedPath) == NULL && errno != ENOENT) { - char* str = FormatLogMessage("failed to resolve path %s.", path); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to resolve path.", LEVEL_ERROR, SCREEN_YES); return -1; } int fd = open(resolvedPath, O_NOFOLLOW | O_CREAT, mode); if (fd < 0) { - char* str = FormatLogMessage("cannot create file: %s.", resolvedPath); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("cannot create file.", LEVEL_ERROR, SCREEN_YES); return -1; } close(fd); @@ -174,6 +168,6 @@ int CheckLegality(const char* filename) return -1; } } while (strcmp(dirname(buf), "/")); - + return 0; } \ No newline at end of file -- Gitee From adf41250525c26e8c418ec7f9d15a5386cefe2d8 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 22 Feb 2022 15:19:47 +0800 Subject: [PATCH 185/296] Match-id-9d947dc342461a1ca00896ebd09f45f13d4b8824 --- install/deb/src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 0210e91..2be6344 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -127,6 +127,8 @@ static int DelJsonContent(cJSON *root, const char *key) removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { fprintf(stderr, "remove %s failed\n", key); + free(existItem); + existItem = NULL; return -1; } @@ -334,6 +336,10 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (newContent == NULL) { fprintf(stderr, "error: failed to create json\n"); + if (pf != NULL) { + (void)fclose(pf); + pf = NULL; + } return -1; } @@ -347,10 +353,14 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); + if (pf != NULL) { + (void)fclose(pf); + pf = NULL; + } return -1; } (void)fclose(pf); - + pf = NULL; cJSON_Delete(newContent); return 0; -- Gitee From fa0ba3ce48c8568c0b10b6e86b0dd8c10f6e7fe5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 23 Feb 2022 14:35:23 +0800 Subject: [PATCH 186/296] Match-id-4c4524bb66153ee31ed8f70463aef0d37d866787 --- build/scripts/run_main.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 9c4cf90..a9ae06e 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -55,6 +55,9 @@ function install() mv ${SRC} ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' + if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then + chmod 600 "/var/log/ascend_seclog/ascend_toolbox_install.log" + fi } function uninstall() -- Gitee From a6f58e1997090f2602846c77da27e5b27ace7cf6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 23 Feb 2022 14:42:25 +0800 Subject: [PATCH 187/296] Match-id-73d00fabe63c8cde006a1ef0694d24c2c2563b79 --- build/scripts/run_main.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 9c4cf90..173bc27 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -55,6 +55,9 @@ function install() mv ${SRC} ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' + if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then + chmod 600 "/var/log/ascend_seclog/ascend_toolbox_install.log" + fi } function uninstall() -- Gitee From 9c591083186f7ac30a5e1273c7060350e18213bf Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 21 Feb 2022 17:17:58 +0800 Subject: [PATCH 188/296] Match-id-4a76a68fb38076c03d0d08514c57d2b2ef1c45ee --- cli/src/basic.c | 12 +++---- cli/src/cgrp.c | 71 +++++++++++++++++++++++++++++++++++------- cli/src/logger.c | 20 ++++++++++++ cli/src/main.c | 59 +++++++++++++++++++++++++++++++++++ cli/src/options.c | 5 +++ cli/src/u_mount.c | 68 +++++++++++++++++++++++++++++++++------- cli/src/utils.c | 37 +++++++++++++++++++++- install/deb/src/main.c | 21 +++++++++---- 8 files changed, 256 insertions(+), 37 deletions(-) diff --git a/cli/src/basic.c b/cli/src/basic.c index 37ca120..d4de536 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -4,18 +4,14 @@ */ #include "basic.h" #include -#include "logger.h" +#include void InitParsedConfig(struct ParsedConfig *parsedConfig) { -<<<<<<< HEAD - if (parsedConfig != NULL) { -======= - if (parsedConfig != NULL) - { ->>>>>>> fd706c08945c4519bcefe0d295d55c42c7ad1711 - Logger("parsedConfig Pointer is null!."); + if (parsedConfig == NULL) { + fprintf(stderr, "parsedConfig pointer is null!\n"); return; } + parsedConfig->devicesNr = MAX_DEVICE_NR; } \ No newline at end of file diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 29534bc..83b5864 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -21,6 +21,11 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) { + if (pLine == NULL || word == NULL) { + fprintf(stderr, "pLine, word pointer is null!\n"); + return false; + } + char *w = NULL; for (unsigned int i = 0; i < n; i++) { w = strsep(pLine, " "); @@ -35,6 +40,11 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) bool CheckRootDir(char **pLine) { + if (pLine == NULL) { + fprintf(stderr, "pLine pointer is null!\n"); + return false; + } + char *rootDir = NULL; if (!TakeNthWord(pLine, ROOT_GAP, &rootDir)) { return false; @@ -45,6 +55,11 @@ bool CheckRootDir(char **pLine) bool CheckFsType(char **pLine) { + if (pLine == NULL) { + fprintf(stderr, "pLine pointer is null!\n"); + return false; + } + char* fsType = NULL; if (!TakeNthWord(pLine, FSTYPE_GAP, &fsType)) { return false; @@ -55,6 +70,11 @@ bool CheckFsType(char **pLine) bool CheckSubStr(char **pLine, const char *subsys) { + if (pLine == NULL || subsys == NULL) { + fprintf(stderr, "pLine, subsys pointer is null!\n"); + return false; + } + char* substr = NULL; if (!TakeNthWord(pLine, MOUNT_SUBSTR_GAP, &substr)) { return false; @@ -66,6 +86,11 @@ bool CheckSubStr(char **pLine, const char *subsys) typedef char *(*ParseFileLine)(char *, const char *); int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) { + if (buffer == NULL || filepath == NULL) { + fprintf(stderr, "buffer, filepath pointer is null!\n"); + return -1; + } + FILE *fp = NULL; char *result = NULL; char *line = NULL; @@ -107,6 +132,11 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char *GetCgroupMount(char *line, const char *subsys) { + if (line == NULL || subsys == NULL) { + fprintf(stderr, "line, subsys pointer is null!\n"); + return NULL; + } + if (!CheckRootDir(&line)) { return NULL; } @@ -131,6 +161,11 @@ char *GetCgroupMount(char *line, const char *subsys) char *GetCgroupRoot(char *line, const char *subSystem) { + if (line == NULL || subSystem == NULL) { + fprintf(stderr, "line, subSystem pointer is null!\n"); + return NULL; + } + char *token = NULL; int i; for (i = 0; i < ROOT_SUBSTR_GAP; ++i) { @@ -156,6 +191,11 @@ char *GetCgroupRoot(char *line, const char *subSystem) int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) { + if (cgroupAllow == NULL || devName == NULL) { + fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); + return -1; + } + int ret; struct stat devStat; char devPath[BUF_SIZE]; @@ -188,8 +228,12 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) int SetupDriverCgroup(FILE *cgroupAllow) { - int ret; + if (cgroupAllow == NULL) { + fprintf(stderr, "cgroupAllow pointer is null!\n"); + return -1; + } + int ret; ret = SetupDeviceCgroup(cgroupAllow, DAVINCI_MANAGER); if (ret < 0) { char* str = FormatLogMessage("failed to setup cgroup for %s.", DAVINCI_MANAGER); @@ -219,6 +263,11 @@ int SetupDriverCgroup(FILE *cgroupAllow) int GetCgroupPath(int pid, char *effPath, size_t maxSize) { + if (effPath == NULL) { + fprintf(stderr, "effPath pointer is null!\n"); + return -1; + } + int ret; char mountPath[BUF_SIZE] = {0x0}; char mount[BUF_SIZE] = {0x0}; @@ -267,12 +316,15 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { - int ret; + if (config == NULL) { + fprintf(stderr, "config pointer is null!\n"); + return -1; + } + char *str = NULL; char deviceName[BUF_SIZE] = {0}; char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; - if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); @@ -289,26 +341,23 @@ int SetupCgroup(const struct ParsedConfig *config) return -1; } - ret = SetupDriverCgroup(cgroupAllow); - if (ret < 0) { + if (SetupDriverCgroup(cgroupAllow) < 0) { fclose(cgroupAllow); Logger("failed to setup driver cgroup.", LEVEL_ERROR, SCREEN_YES); return -1; } - for (size_t idx = 0; idx < config->devicesNr; idx++) { - int ret = sprintf_s(deviceName, BUF_SIZE, "%s%u", + if (sprintf_s(deviceName, BUF_SIZE, "%s%u", (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), - config->devices[idx]); - if (ret < 0) { + config->devices[idx]) < 0) { fclose(cgroupAllow); str = FormatLogMessage("failed to assemble device path for no.%u.", config->devices[idx]); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - ret = SetupDeviceCgroup(cgroupAllow, (const char *)deviceName); - if (ret < 0) { + + if (SetupDeviceCgroup(cgroupAllow, (const char *)deviceName) < 0) { fclose(cgroupAllow); Logger("failed to setup cgroup.", LEVEL_ERROR, SCREEN_YES); free(str); diff --git a/cli/src/logger.c b/cli/src/logger.c index 6745515..4445c78 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -22,6 +22,11 @@ int GetCurrentLocalTime(char* buffer, int length) { + if (buffer == NULL) { + fprintf(stderr, "buffer pointer is null!\n"); + return -1; + } + time_t timep = time(NULL); struct tm result = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct tm *timeinfo = localtime_r(&timep, &result); @@ -56,6 +61,11 @@ int CreateLog(const char* filename) long GetLogSize(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + int ret; ret = CreateLog(filename); if (ret < 0) { @@ -85,6 +95,11 @@ long GetLogSize(const char* filename) int LogLoop(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + int ret; char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; int exist; @@ -105,6 +120,11 @@ int LogLoop(const char* filename) void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) { + if (filename == NULL || buffer == NULL) { + fprintf(stderr, "filename, buffer pointer is null!\n"); + return; + } + if (filename != NULL && buffer != NULL) { char path[PATH_MAX + 1] = {0x00}; FILE *fp = NULL; diff --git a/cli/src/main.c b/cli/src/main.c index ac7c06d..c5a14ca 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -47,6 +47,11 @@ typedef bool (*CmdArgParser)(struct CmdArgs *args, const char *arg); static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get devices from cmd args.", LEVEL_ERROR, SCREEN_YES); @@ -58,6 +63,11 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); if (errno != 0) { @@ -79,6 +89,11 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->rootfs, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get rootfs path from cmd args", LEVEL_ERROR, SCREEN_YES); @@ -90,6 +105,11 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + errno_t err = strcpy_s(args->options, BUF_SIZE, arg); if (err != EOK) { Logger("failed to get options string from cmd args", LEVEL_ERROR, SCREEN_YES); @@ -101,6 +121,11 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + if (args->files.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); @@ -122,6 +147,11 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { + if (args == NULL || arg == NULL) { + fprintf(stderr, "args, arg pointer is null!\n"); + return false; + } + if (args->dirs.count == MAX_MOUNT_NR) { char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); @@ -157,6 +187,11 @@ static struct { static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) { + if (args == NULL || value == NULL) { + fprintf(stderr, "args, value pointer is null!\n"); + return -1; + } + int i; for (i = 0; i < NUM_OF_CMD_ARGS; i++) { if (g_cmdArgParsers[i].c == indicator) { @@ -182,11 +217,20 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu static inline bool IsCmdArgsValid(const struct CmdArgs *args) { + if (args == NULL) { + fprintf(stderr, "args pointer is null!\n"); + return false; + } return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) { + if (idList == NULL || idListSize == NULL || devices == NULL) { + fprintf(stderr, "idList, idListSize, devices pointer is null!\n"); + return -1; + } + static const char *sep = ","; char *token = NULL; char *context = NULL; @@ -220,6 +264,11 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { + if (args == NULL || config == NULL) { + fprintf(stderr, "args, config pointer is null!\n"); + return -1; + } + int ret; errno_t err; @@ -272,6 +321,11 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) int SetupContainer(struct CmdArgs *args) { + if (args == NULL) { + fprintf(stderr, "args pointer is null!\n"); + return -1; + } + int ret; struct ParsedConfig config; @@ -324,6 +378,11 @@ int SetupContainer(struct CmdArgs *args) int Process(int argc, char **argv) { + if (argv == NULL) { + fprintf(stderr, "argv pointer is null!\n"); + return -1; + } + int c; int ret; int optionIndex; diff --git a/cli/src/options.c b/cli/src/options.c index 144e3d3..2300016 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -24,6 +24,11 @@ static struct { void ParseRuntimeOptions(const char *options) { + if (options == NULL) { + fprintf(stderr, "options pointer is null!\n"); + return; + } + // set defaults value g_runtimeOptions.noDrv = false; g_runtimeOptions.isVirtual = false; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index a54f08f..129f540 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -18,6 +18,11 @@ int Mount(const char *src, const char *dst) { + if (src == NULL || dst == NULL) { + fprintf(stderr, "src pointer or dst pointer is null!\n"); + return -1; + } + static const unsigned long mountFlags = MS_BIND; static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; int ret; @@ -44,6 +49,11 @@ int Mount(const char *src, const char *dst) static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName, struct PathInfo* pathInfo) { + if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL || pathInfo == NULL) { + fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName, pathInfo pointer are null!\n"); + return -1; + } + int ret; errno_t err; char unresolvedDst[BUF_SIZE] = {0}; @@ -96,21 +106,23 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { - int ret; + if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL) { + fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName pointer is null!\n"); + return -1; + } + char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); - if (ret < 0) { + if (GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo) < 0) { str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } struct stat srcStat; - ret = stat((const char *)src, &srcStat); - if (ret < 0) { + if (stat((const char *)src, &srcStat) < 0) { str = FormatLogMessage("failed to stat src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -118,6 +130,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } errno = 0; struct stat dstStat; + int ret; ret = stat((const char *)dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 @@ -130,15 +143,15 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); return -1; } - ret = MakeMountPoints(dst, srcStat.st_mode); - if (ret < 0) { + + if (MakeMountPoints(dst, srcStat.st_mode) < 0) { str = FormatLogMessage("failed to create mount dst file: %s.", dst); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - ret = Mount(src, dst); - if (ret < 0) { + + if (Mount(src, dst) < 0) { Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -148,6 +161,11 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { + if (rootfs == NULL || device_name == NULL) { + fprintf(stderr, "rootfs, device_name pointer is null!\n"); + return -1; + } + char srcDeviceName[BUF_SIZE] = {0}; char dstDeviceName[BUF_SIZE] = {0}; @@ -174,6 +192,11 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int MountFile(const char *rootfs, const char *filepath) { + if (rootfs == NULL || filepath == NULL) { + fprintf(stderr, "rootfs, filepath pointer is null!\n"); + return -1; + } + int ret; char dst[BUF_SIZE] = {0}; @@ -210,6 +233,11 @@ int MountFile(const char *rootfs, const char *filepath) int MountDir(const char *rootfs, const char *src) { + if (rootfs == NULL || src == NULL) { + fprintf(stderr, "rootfs, src pointer is null!\n"); + return -1; + } + int ret; char dst[BUF_SIZE] = {0}; @@ -245,6 +273,11 @@ int MountDir(const char *rootfs, const char *src) int DoCtrlDeviceMounting(const char *rootfs) { + if (rootfs == NULL) { + fprintf(stderr, "rootfs pointer is null!\n"); + return -1; + } + /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { @@ -275,8 +308,12 @@ int DoCtrlDeviceMounting(const char *rootfs) int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { - int ret; + if (rootfs == NULL || list == NULL) { + fprintf(stderr, "rootfs, list pointer is null!\n"); + return -1; + } + int ret; for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { @@ -292,8 +329,12 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) int DoFileMounting(const char *rootfs, const struct MountList *list) { - int ret; + if (rootfs == NULL || list == NULL) { + fprintf(stderr, "rootfs, list pointer is null!\n"); + return -1; + } + int ret; for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { @@ -309,6 +350,11 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) int DoMounting(const struct ParsedConfig *config) { + if (config == NULL) { + fprintf(stderr, "config pointer is null!\n"); + return -1; + } + int ret; ret = DoDeviceMounting(config->rootfs, (IsVirtual() ? VDEVICE_NAME : DEVICE_NAME), diff --git a/cli/src/utils.c b/cli/src/utils.c index db7b6e4..f342643 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -18,6 +18,11 @@ char *FormatLogMessage(char *format, ...) { + if (format == NULL) { + fprintf(stderr, "format pointer is null!\n"); + return NULL; + } + va_list list; // 获取格式化后字符串的长度 va_start(list, format); @@ -55,6 +60,11 @@ int StrHasPrefix(const char *str, const char *prefix) int MkDir(const char *dir, int mode) { + if (dir == NULL) { + fprintf(stderr, "dir pointer is null!\n"); + return -1; + } + return mkdir(dir, mode); } @@ -68,6 +78,11 @@ int VerifyPathInfo(const struct PathInfo* pathInfo) int CheckDirExists(const char *dir) { + if (dir == NULL) { + fprintf(stderr, "dir pointer is null!\n"); + return -1; + } + DIR *ptr = opendir(dir); if (NULL == ptr) { return -1; @@ -79,6 +94,11 @@ int CheckDirExists(const char *dir) int GetParentPathStr(const char *path, char *parent, size_t bufSize) { + if (path == NULL || parent == NULL) { + fprintf(stderr, "path pointer or parentPath is null!\n"); + return -1; + } + char *ptr = strrchr(path, '/'); if (ptr == NULL) { return 0; @@ -99,6 +119,11 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) int MakeDirWithParent(const char *path, mode_t mode) { + if (path == NULL) { + fprintf(stderr, "path pointer is null!\n"); + return -1; + } + if (*path == '\0' || *path == '.') { return 0; } @@ -122,6 +147,11 @@ int MakeDirWithParent(const char *path, mode_t mode) int MakeMountPoints(const char *path, mode_t mode) { + if (path == NULL) { + fprintf(stderr, "path pointer is null!\n"); + return -1; + } + /* directory */ char parentDir[BUF_SIZE] = {0}; GetParentPathStr(path, parentDir, BUF_SIZE); @@ -155,6 +185,11 @@ int MakeMountPoints(const char *path, mode_t mode) int CheckLegality(const char* filename) { + if (filename == NULL) { + fprintf(stderr, "filename pointer is null!\n"); + return -1; + } + char buf[PATH_MAX + 1] = {0x00}; errno_t ret = strncpy_s(buf, PATH_MAX + 1, filename, strlen(filename)); if (ret != EOK) { @@ -173,7 +208,7 @@ int CheckLegality(const char* filename) fprintf(stderr, "Please check the write permission!\n"); return -1; } - } while (strcmp(dirname(buf), "/")); + } while (strncmp(dirname(buf), "/", strlen(dirname(buf)))); return 0; } \ No newline at end of file diff --git a/install/deb/src/main.c b/install/deb/src/main.c index d3c8ee6..0210e91 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -28,8 +28,9 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { if (pf == NULL || text == NULL) { fprintf(stderr, "file pointer or text pointer are null!\n"); - return NULL; + return; } + (void)fseek(pf, 0, SEEK_END); int size = (int)ftell(pf); @@ -47,10 +48,11 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { - if (runtimePath = NULL) { + if (runtimePath == NULL) { fprintf(stderr, "runtimePath pointer are null!\n"); return NULL; } + cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { @@ -87,6 +89,7 @@ static cJSON *CreateRuntimes(const char *runtimePath) fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } + cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { @@ -111,8 +114,9 @@ static int DelJsonContent(cJSON *root, const char *key) { if (root == NULL || key == NULL) { fprintf(stderr, "userInfo pointer is null!\n"); - return NULL; + return -1; } + cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); if (existItem == NULL) { @@ -136,6 +140,7 @@ static cJSON *CreateContent(const char *runtimePath) fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } + /* 插入ascend runtime */ cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); @@ -174,6 +179,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); return NULL; } + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -231,6 +237,7 @@ static cJSON *RemoveContent(FILE *pf) fprintf(stderr, "file pointer is null!\n"); return NULL; } + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); @@ -269,10 +276,11 @@ static cJSON *RemoveContent(FILE *pf) static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { - if (filePath = NULL || tempPath = NULL || runtimePath = NULL) { - fprintf(stderr, "filePath Pointer or tempPath or runtimePath are null!\n"); + if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { + fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); return -1; } + cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); @@ -310,9 +318,10 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { if (filePath == NULL || tempPath == NULL) { - fprintf(stderr, "filePath Pointer or tempPath are null!\n"); + fprintf(stderr, "filePath or tempPath are null!\n"); return -1; } + FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { -- Gitee From 5321be72fe941ece0fae45c7291bb7da138d9e54 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 23 Feb 2022 17:37:35 +0800 Subject: [PATCH 189/296] Match-id-23c615b2ff72fcf9b96018128133053d467871c5 --- install/deb/src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 0210e91..2be6344 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -127,6 +127,8 @@ static int DelJsonContent(cJSON *root, const char *key) removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { fprintf(stderr, "remove %s failed\n", key); + free(existItem); + existItem = NULL; return -1; } @@ -334,6 +336,10 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (newContent == NULL) { fprintf(stderr, "error: failed to create json\n"); + if (pf != NULL) { + (void)fclose(pf); + pf = NULL; + } return -1; } @@ -347,10 +353,14 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); + if (pf != NULL) { + (void)fclose(pf); + pf = NULL; + } return -1; } (void)fclose(pf); - + pf = NULL; cJSON_Delete(newContent); return 0; -- Gitee From f8c29983836049da86f6b1866824f8bec3da9785 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 24 Feb 2022 16:36:25 +0800 Subject: [PATCH 190/296] Match-id-3d198a912a7252bd3100cb33c987e81a89762036 --- cli/test/dt/testcase/gtest_mytest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 8e9378a..453e6c1 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -49,7 +49,8 @@ extern "C" char *GetCgroupRoot(char *line, const char *subSystem); extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); -extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); +//extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); +extern "C" int GetCgroupPath(int pid, char *effPath, size_t maxSize); extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); @@ -796,7 +797,7 @@ TEST(GetCgroupPath, StatusOne) MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; - int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); + int ret = GetCgroupPath(args.pid, cgroupPath, BUF_SIZE); EXPECT_EQ(0, ret); } -- Gitee From f68fa3bf9977b89899948166464a9da21e6a5163 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 24 Feb 2022 20:33:04 +0800 Subject: [PATCH 191/296] Match-id-03c6b5a4046afc799a0d6bf35a11291200e65832 --- cli/src/main.c | 24 +++++++-------- cli/src/u_mount.c | 43 +++++++++++++-------------- cli/test/dt/testcase/gtest_mytest.cpp | 5 ++-- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index c5a14ca..0cba8bd 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -48,7 +48,7 @@ typedef bool (*CmdArgParser)(struct CmdArgs *args, const char *arg); static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -64,7 +64,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -90,7 +90,7 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -106,7 +106,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -122,7 +122,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -148,7 +148,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -188,7 +188,7 @@ static struct { static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) { if (args == NULL || value == NULL) { - fprintf(stderr, "args, value pointer is null!\n"); + Logger("args, value pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -218,7 +218,7 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu static inline bool IsCmdArgsValid(const struct CmdArgs *args) { if (args == NULL) { - fprintf(stderr, "args pointer is null!\n"); + Logger("args pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); @@ -227,7 +227,7 @@ static inline bool IsCmdArgsValid(const struct CmdArgs *args) static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) { if (idList == NULL || idListSize == NULL || devices == NULL) { - fprintf(stderr, "idList, idListSize, devices pointer is null!\n"); + Logger("idList, idListSize, devices pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -265,7 +265,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { if (args == NULL || config == NULL) { - fprintf(stderr, "args, config pointer is null!\n"); + Logger("args, config pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -322,7 +322,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) int SetupContainer(struct CmdArgs *args) { if (args == NULL) { - fprintf(stderr, "args pointer is null!\n"); + Logger("args pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -379,7 +379,7 @@ int SetupContainer(struct CmdArgs *args) int Process(int argc, char **argv) { if (argv == NULL) { - fprintf(stderr, "argv pointer is null!\n"); + Logger("argv pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 129f540..76b9e67 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -19,7 +19,7 @@ int Mount(const char *src, const char *dst) { if (src == NULL || dst == NULL) { - fprintf(stderr, "src pointer or dst pointer is null!\n"); + Logger("src pointer or dst pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -49,8 +49,8 @@ int Mount(const char *src, const char *dst) static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName, struct PathInfo* pathInfo) { - if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL || pathInfo == NULL) { - fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName, pathInfo pointer are null!\n"); + if (rootfs == NULL || srcDeviceName == NULL || pathInfo == NULL) { + Logger("rootfs, srcDeviceName, pathInfo pointer are null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -106,23 +106,22 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { - if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL) { - fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName pointer is null!\n"); - return -1; - } - + int ret; char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - if (GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo) < 0) { + ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); + if (ret < 0) { str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } + struct stat srcStat; - if (stat((const char *)src, &srcStat) < 0) { + ret = stat((const char *)src, &srcStat); + if (ret < 0) { str = FormatLogMessage("failed to stat src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -130,7 +129,6 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } errno = 0; struct stat dstStat; - int ret; ret = stat((const char *)dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 @@ -143,15 +141,16 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); return -1; } - - if (MakeMountPoints(dst, srcStat.st_mode) < 0) { + ret = MakeMountPoints(dst, srcStat.st_mode); + if (ret < 0) { str = FormatLogMessage("failed to create mount dst file: %s.", dst); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - if (Mount(src, dst) < 0) { + ret = Mount(src, dst); + if (ret < 0) { Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -162,7 +161,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { if (rootfs == NULL || device_name == NULL) { - fprintf(stderr, "rootfs, device_name pointer is null!\n"); + Logger("rootfs, device_name pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -193,7 +192,7 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int MountFile(const char *rootfs, const char *filepath) { if (rootfs == NULL || filepath == NULL) { - fprintf(stderr, "rootfs, filepath pointer is null!\n"); + Logger("rootfs, filepath pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -234,7 +233,7 @@ int MountFile(const char *rootfs, const char *filepath) int MountDir(const char *rootfs, const char *src) { if (rootfs == NULL || src == NULL) { - fprintf(stderr, "rootfs, src pointer is null!\n"); + Logger("rootfs, src pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -274,14 +273,14 @@ int MountDir(const char *rootfs, const char *src) int DoCtrlDeviceMounting(const char *rootfs) { if (rootfs == NULL) { - fprintf(stderr, "rootfs pointer is null!\n"); + Logger("rootfs pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } /* device */ int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); if (ret < 0) { - char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); + char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); // error1 Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; @@ -309,7 +308,7 @@ int DoCtrlDeviceMounting(const char *rootfs) int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { if (rootfs == NULL || list == NULL) { - fprintf(stderr, "rootfs, list pointer is null!\n"); + Logger("rootfs, list pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -330,7 +329,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) int DoFileMounting(const char *rootfs, const struct MountList *list) { if (rootfs == NULL || list == NULL) { - fprintf(stderr, "rootfs, list pointer is null!\n"); + Logger("rootfs, list pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -351,7 +350,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) int DoMounting(const struct ParsedConfig *config) { if (config == NULL) { - fprintf(stderr, "config pointer is null!\n"); + Logger("config pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 453e6c1..8e9378a 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -49,8 +49,7 @@ extern "C" char *GetCgroupRoot(char *line, const char *subSystem); extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); -//extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); -extern "C" int GetCgroupPath(int pid, char *effPath, size_t maxSize); +extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); @@ -797,7 +796,7 @@ TEST(GetCgroupPath, StatusOne) MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; - int ret = GetCgroupPath(args.pid, cgroupPath, BUF_SIZE); + int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); EXPECT_EQ(0, ret); } -- Gitee From 35273f6b785a8922d4aae4d9902de8b621a2bb9d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 25 Feb 2022 19:12:46 +0800 Subject: [PATCH 192/296] Match-id-9fd6554d839fc28733ea9818d1617c673f70a24e --- cli/src/main.c | 24 ++++++++++++------------ cli/src/u_mount.c | 39 +++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 5319d83..5b1b953 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -48,7 +48,7 @@ typedef bool (*CmdArgParser)(struct CmdArgs *args, const char *arg); static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -64,7 +64,7 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -90,7 +90,7 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -106,7 +106,7 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -122,7 +122,7 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -148,7 +148,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) { if (args == NULL || arg == NULL) { - fprintf(stderr, "args, arg pointer is null!\n"); + Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } @@ -188,7 +188,7 @@ static struct { static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *value) { if (args == NULL || value == NULL) { - fprintf(stderr, "args, value pointer is null!\n"); + Logger("args, value pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -218,7 +218,7 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu static inline bool IsCmdArgsValid(const struct CmdArgs *args) { if (args == NULL) { - fprintf(stderr, "args pointer is null!\n"); + Logger("args pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); @@ -227,7 +227,7 @@ static inline bool IsCmdArgsValid(const struct CmdArgs *args) static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) { if (idList == NULL || idListSize == NULL || devices == NULL) { - fprintf(stderr, "idList, idListSize, devices pointer is null!\n"); + Logger("idList, idListSize, devices pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -265,7 +265,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) { if (args == NULL || config == NULL) { - fprintf(stderr, "args, config pointer is null!\n"); + Logger("args, config pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -322,7 +322,7 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) int SetupContainer(struct CmdArgs *args) { if (args == NULL) { - fprintf(stderr, "args pointer is null!\n"); + Logger("args pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -379,7 +379,7 @@ int SetupContainer(struct CmdArgs *args) int Process(int argc, char **argv) { if (argv == NULL) { - fprintf(stderr, "argv pointer is null!\n"); + Logger("argv pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } int c; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 129f540..d6ed4ac 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -19,7 +19,7 @@ int Mount(const char *src, const char *dst) { if (src == NULL || dst == NULL) { - fprintf(stderr, "src pointer or dst pointer is null!\n"); + Logger("src pointer or dst pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -49,8 +49,8 @@ int Mount(const char *src, const char *dst) static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName, struct PathInfo* pathInfo) { - if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL || pathInfo == NULL) { - fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName, pathInfo pointer are null!\n"); + if (rootfs == NULL || srcDeviceName == NULL || pathInfo == NULL) { + Logger("rootfs, srcDeviceName, dstDeviceName, pathInfo pointer are null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -106,23 +106,22 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { - if (rootfs == NULL || srcDeviceName == NULL || dstDeviceName == NULL) { - fprintf(stderr, "rootfs, srcDeviceName, dstDeviceName pointer is null!\n"); - return -1; - } - + int ret; char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - if (GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo) < 0) { + ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); + if (ret < 0) { str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } + struct stat srcStat; - if (stat((const char *)src, &srcStat) < 0) { + ret = stat((const char *)src, &srcStat); + if (ret < 0) { str = FormatLogMessage("failed to stat src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -130,7 +129,6 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } errno = 0; struct stat dstStat; - int ret; ret = stat((const char *)dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 @@ -143,15 +141,16 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); return -1; } - - if (MakeMountPoints(dst, srcStat.st_mode) < 0) { + ret = MakeMountPoints(dst, srcStat.st_mode); + if (ret < 0) { str = FormatLogMessage("failed to create mount dst file: %s.", dst); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return -1; } - if (Mount(src, dst) < 0) { + ret = Mount(src, dst); + if (ret < 0) { Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -162,7 +161,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { if (rootfs == NULL || device_name == NULL) { - fprintf(stderr, "rootfs, device_name pointer is null!\n"); + Logger("rootfs, device_name pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -193,7 +192,7 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int MountFile(const char *rootfs, const char *filepath) { if (rootfs == NULL || filepath == NULL) { - fprintf(stderr, "rootfs, filepath pointer is null!\n"); + Logger("rootfs, filepath pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -234,7 +233,7 @@ int MountFile(const char *rootfs, const char *filepath) int MountDir(const char *rootfs, const char *src) { if (rootfs == NULL || src == NULL) { - fprintf(stderr, "rootfs, src pointer is null!\n"); + Logger("rootfs, src pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -309,7 +308,7 @@ int DoCtrlDeviceMounting(const char *rootfs) int DoDirectoryMounting(const char *rootfs, const struct MountList *list) { if (rootfs == NULL || list == NULL) { - fprintf(stderr, "rootfs, list pointer is null!\n"); + Logger("rootfs, list pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -330,7 +329,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) int DoFileMounting(const char *rootfs, const struct MountList *list) { if (rootfs == NULL || list == NULL) { - fprintf(stderr, "rootfs, list pointer is null!\n"); + Logger("rootfs, list pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -351,7 +350,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) int DoMounting(const struct ParsedConfig *config) { if (config == NULL) { - fprintf(stderr, "config pointer is null!\n"); + Logger("config pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From 6bbfe3d51a5cf5f8fe6b0d02129ee00f15701c59 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Feb 2022 11:50:04 +0800 Subject: [PATCH 193/296] Match-id-69372e5c8ccb4a7f4589d343034d477664886b4a --- README.md | 2 +- build/scripts/run_main.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d46a11..1911e14 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 ## 下载 ### run包 -开发人员可从昇腾社区下载Toolbox,下载链接为:https://ascend.huawei.com/zh/#/software/cann/commercial, +开发人员可从昇腾社区下载Toolbox,下载链接为:https://www.hiascend.com/software/mindx-dl, 下载后安装Toolbox,Ascend-docker-runtime,已集成至实用工具包toolbox中。 # 功能 diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index a9ae06e..9c4cf90 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -55,9 +55,6 @@ function install() mv ${SRC} ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' - if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then - chmod 600 "/var/log/ascend_seclog/ascend_toolbox_install.log" - fi } function uninstall() -- Gitee From 60215519871ebeb17bd10ab3d500503b5444c99b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Feb 2022 13:38:58 +0800 Subject: [PATCH 194/296] Match-id-ff03cdd81218aca1b63092293fe6dbb175a70db6 --- README.md | 2 +- build/scripts/run_main.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d46a11..1911e14 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 ## 下载 ### run包 -开发人员可从昇腾社区下载Toolbox,下载链接为:https://ascend.huawei.com/zh/#/software/cann/commercial, +开发人员可从昇腾社区下载Toolbox,下载链接为:https://www.hiascend.com/software/mindx-dl, 下载后安装Toolbox,Ascend-docker-runtime,已集成至实用工具包toolbox中。 # 功能 diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 173bc27..9c4cf90 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -55,9 +55,6 @@ function install() mv ${SRC} ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' - if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then - chmod 600 "/var/log/ascend_seclog/ascend_toolbox_install.log" - fi } function uninstall() -- Gitee From 3edfed7dc6e39e5bcc6217cd80fd821382ab47b7 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Feb 2022 14:49:49 +0800 Subject: [PATCH 195/296] Match-id-1a931c5374f41771f23c680159279b16193d9f69 --- cli/test/dt/testcase/gtest_mytest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 8e9378a..0fab616 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -49,7 +49,7 @@ extern "C" char *GetCgroupRoot(char *line, const char *subSystem); extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); -extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); +extern "C" int GetCgroupPath(int pid, char *effPath, const size_t maxSize); extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); @@ -318,7 +318,7 @@ int Stub_ParseFileByLine_Success(char* buffer, int bufferSize, ParseFileLine fn, return 0; } -int Stub_GetCgroupPath_Success(const struct CmdArgs *args, char *effPath, const size_t maxSize) +int Stub_GetCgroupPath_Success(int pid, char *effPath, const size_t maxSize) { return 0; } @@ -796,7 +796,7 @@ TEST(GetCgroupPath, StatusOne) MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; - int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); + int ret = GetCgroupPath(args.pid, cgroupPath, BUF_SIZE); EXPECT_EQ(0, ret); } -- Gitee From b941ebb1a7f83e92ba8b34d90a583802ddba582f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Feb 2022 16:05:37 +0800 Subject: [PATCH 196/296] Match-id-8425b352df357b3039764996a692a1fc847f77b7 --- build/scripts/base.list | 4 +- build/scripts/run_main.sh | 1 + cli/src/basic.c | 2 +- cli/src/basic.h | 6 +- cli/src/cgrp.c | 28 +++--- cli/src/logger.c | 26 ++++-- cli/src/options.c | 2 +- cli/src/u_mount.c | 73 ++++++---------- cli/src/utils.c | 104 ++++++++++++++++------- cli/src/utils.h | 8 +- install/deb/src/CMakeLists.txt | 2 +- install/deb/src/main.c | 151 +++++++++++++++++++++++++++------ 12 files changed, 269 insertions(+), 138 deletions(-) diff --git a/build/scripts/base.list b/build/scripts/base.list index b66432b..0a6470a 100644 --- a/build/scripts/base.list +++ b/build/scripts/base.list @@ -1,6 +1,4 @@ /usr/local/Ascend/driver/lib64 -/usr/local/Ascend/driver/tools /usr/local/Ascend/driver/include /usr/local/dcmi -/usr/local/bin/npu-smi -/var/log/npu/conf/slog/slog.conf \ No newline at end of file +/usr/local/bin/npu-smi \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 173bc27..019db12 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -53,6 +53,7 @@ function install() fi mv ${SRC} ${DST} + chmod 600 ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then diff --git a/cli/src/basic.c b/cli/src/basic.c index d4de536..e11b50b 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -9,7 +9,7 @@ void InitParsedConfig(struct ParsedConfig *parsedConfig) { if (parsedConfig == NULL) { - fprintf(stderr, "parsedConfig pointer is null!\n"); + (void)fprintf(stderr, "parsedConfig pointer is null!\n"); return; } diff --git a/cli/src/basic.h b/cli/src/basic.h index 0dbc67b..f048398 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -21,6 +21,8 @@ #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 + +#define ROOT_UID 0 #define LEVEL_INFO 0 #define LEVEL_WARN 1 @@ -34,9 +36,9 @@ char _content[BUF_SIZE] = {0}; \ int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ if (_ret < 0) { \ - fprintf(stderr, "cannot assemble log content"); \ + (void)fprintf(stderr, "cannot assemble log content"); \ } else { \ - fprintf(stderr, "%s", (const char *)_content); \ + (void)fprintf(stderr, "%s", (const char *)_content); \ } \ } while (0) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index d33af23..3f32155 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -22,7 +22,7 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) { if (pLine == NULL || word == NULL) { - fprintf(stderr, "pLine, word pointer is null!\n"); + (void)fprintf(stderr, "pLine, word pointer is null!\n"); return false; } @@ -41,7 +41,7 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) bool CheckRootDir(char **pLine) { if (pLine == NULL) { - fprintf(stderr, "pLine pointer is null!\n"); + (void)fprintf(stderr, "pLine pointer is null!\n"); return false; } @@ -56,7 +56,7 @@ bool CheckRootDir(char **pLine) bool CheckFsType(char **pLine) { if (pLine == NULL) { - fprintf(stderr, "pLine pointer is null!\n"); + (void)fprintf(stderr, "pLine pointer is null!\n"); return false; } @@ -71,7 +71,7 @@ bool CheckFsType(char **pLine) bool CheckSubStr(char **pLine, const char *subsys) { if (pLine == NULL || subsys == NULL) { - fprintf(stderr, "pLine, subsys pointer is null!\n"); + (void)fprintf(stderr, "pLine, subsys pointer is null!\n"); return false; } @@ -87,7 +87,7 @@ typedef char *(*ParseFileLine)(char *, const char *); int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) { if (buffer == NULL || filepath == NULL) { - fprintf(stderr, "buffer, filepath pointer is null!\n"); + (void)fprintf(stderr, "buffer, filepath pointer is null!\n"); return -1; } @@ -101,7 +101,8 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const Logger("Cannot canonicalize path.", LEVEL_ERROR, SCREEN_YES); return -1; } - if (CheckLegality(resolvedPath) != 0) { + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedPath, strlen(resolvedPath), maxFileSzieMb, true)) { Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -131,7 +132,7 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char *GetCgroupMount(char *line, const char *subsys) { if (line == NULL || subsys == NULL) { - fprintf(stderr, "line, subsys pointer is null!\n"); + (void)fprintf(stderr, "line, subsys pointer is null!\n"); return NULL; } @@ -160,7 +161,7 @@ char *GetCgroupMount(char *line, const char *subsys) char *GetCgroupRoot(char *line, const char *subSystem) { if (line == NULL || subSystem == NULL) { - fprintf(stderr, "line, subSystem pointer is null!\n"); + (void)fprintf(stderr, "line, subSystem pointer is null!\n"); return NULL; } @@ -190,7 +191,7 @@ char *GetCgroupRoot(char *line, const char *subSystem) int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) { if (cgroupAllow == NULL || devName == NULL) { - fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); + (void)fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); return -1; } @@ -225,7 +226,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) int SetupDriverCgroup(FILE *cgroupAllow) { if (cgroupAllow == NULL) { - fprintf(stderr, "cgroupAllow pointer is null!\n"); + (void)fprintf(stderr, "cgroupAllow pointer is null!\n"); return -1; } @@ -260,7 +261,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) int GetCgroupPath(int pid, char *effPath, size_t maxSize) { if (effPath == NULL) { - fprintf(stderr, "effPath pointer is null!\n"); + (void)fprintf(stderr, "effPath pointer is null!\n"); return -1; } @@ -313,7 +314,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { if (config == NULL) { - fprintf(stderr, "config pointer is null!\n"); + (void)fprintf(stderr, "config pointer is null!\n"); return -1; } @@ -325,7 +326,8 @@ int SetupCgroup(const struct ParsedConfig *config) Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); return -1; } - if (CheckLegality(resolvedCgroupPath) != 0) { + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedCgroupPath, strlen(resolvedCgroupPath), maxFileSzieMb, true)) { Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/cli/src/logger.c b/cli/src/logger.c index 4445c78..7958c7b 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -23,7 +23,7 @@ int GetCurrentLocalTime(char* buffer, int length) { if (buffer == NULL) { - fprintf(stderr, "buffer pointer is null!\n"); + (void)fprintf(stderr, "buffer pointer is null!\n"); return -1; } @@ -62,7 +62,7 @@ int CreateLog(const char* filename) long GetLogSize(const char* filename) { if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); + (void)fprintf(stderr, "filename pointer is null!\n"); return -1; } @@ -73,11 +73,15 @@ long GetLogSize(const char* filename) } FILE *fp = NULL; char path[PATH_MAX + 1] = {0x00}; - if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { + if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return -1; } - if (CheckLegality(path) != 0) { - return -1; + struct stat fileStat; + if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { + return -1; + } } fp = fopen(path, "rb"); long length = 0; @@ -96,7 +100,7 @@ long GetLogSize(const char* filename) int LogLoop(const char* filename) { if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); + (void)fprintf(stderr, "filename pointer is null!\n"); return -1; } @@ -121,7 +125,7 @@ int LogLoop(const char* filename) void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) { if (filename == NULL || buffer == NULL) { - fprintf(stderr, "filename, buffer pointer is null!\n"); + (void)fprintf(stderr, "filename, buffer pointer is null!\n"); return; } @@ -142,8 +146,12 @@ void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsign if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { return; } - if (CheckLegality(path) != 0) { - return; + struct stat fileStat; + if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { + return; + } } fp = fopen(path, "a+"); if (fp != NULL) { diff --git a/cli/src/options.c b/cli/src/options.c index 2300016..f5c546f 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -25,7 +25,7 @@ static struct { void ParseRuntimeOptions(const char *options) { if (options == NULL) { - fprintf(stderr, "options pointer is null!\n"); + (void)fprintf(stderr, "options pointer is null!\n"); return; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index d6ed4ac..090ca85 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -26,20 +26,27 @@ int Mount(const char *src, const char *dst) static const unsigned long mountFlags = MS_BIND; static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; int ret; - + struct stat fileStat; + if ((stat(src, &fileStat) == 0) && + ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 + const size_t maxFileSzieMb = 10 * 1024; // max 10 G + if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { + char* str = FormatLogMessage("failed to mount src hehe:%s.", src); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); + Logger("failed to Check src.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + } ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - char* str = FormatLogMessage("failed to mount src:%s.", src); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount src.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - char* str = FormatLogMessage("failed to re-mount. dst:%s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to re-mount. dst.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -80,9 +87,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - char* str = FormatLogMessage("cannot canonicalize device dst: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("cannot canonicalize device dst.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -94,9 +99,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to copy resolved device mnt path to dst.", LEVEL_ERROR, SCREEN_YES); return -1; } } @@ -113,18 +116,14 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to get mount src and dst path.", LEVEL_ERROR, SCREEN_YES); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - str = FormatLogMessage("failed to stat src: %s.", src); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to stat src.", LEVEL_ERROR, SCREEN_YES); return -1; } errno = 0; @@ -133,9 +132,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - str = FormatLogMessage("%s already exists but not a char device as expected.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("dst already exists but not a char device as expected.", LEVEL_ERROR, SCREEN_YES); return -1; } else if (ret < 0 && errno != ENOENT) { Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); @@ -143,9 +140,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to create mount dst file.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -179,9 +174,7 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - char* str = FormatLogMessage("failed to mount device %s.", srcDeviceName); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount device.", LEVEL_ERROR, SCREEN_YES); return -1; } } @@ -201,9 +194,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", filepath); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to assemble file mounting path.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -215,9 +206,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - char* str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to create mount dst file.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -253,17 +242,13 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - char* str = FormatLogMessage("failed to make dir: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to make dir.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = Mount(src, dst); if (ret < 0) { - char* str = FormatLogMessage("failed to mount dir: %s to %s.", src, dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount dir", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -316,9 +301,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - char* str = FormatLogMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to do directory mounting", LEVEL_ERROR, SCREEN_YES); return -1; } } @@ -337,9 +320,7 @@ int DoFileMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountFile(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - char* str = FormatLogMessage("failed to do file mounting for %s.", (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to do file mounting for.", LEVEL_ERROR, SCREEN_YES); return -1; } } diff --git a/cli/src/utils.c b/cli/src/utils.c index 44c89ba..8cb8a1d 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -13,13 +13,14 @@ #include #include #include + #include "securec.h" #include "logger.h" char *FormatLogMessage(char *format, ...) { if (format == NULL) { - fprintf(stderr, "format pointer is null!\n"); + (void)fprintf(stderr, "format pointer is null!\n"); return NULL; } @@ -61,7 +62,7 @@ int StrHasPrefix(const char *str, const char *prefix) int MkDir(const char *dir, int mode) { if (dir == NULL) { - fprintf(stderr, "dir pointer is null!\n"); + (void)fprintf(stderr, "dir pointer is null!\n"); return -1; } @@ -79,7 +80,7 @@ int VerifyPathInfo(const struct PathInfo* pathInfo) int CheckDirExists(const char *dir) { if (dir == NULL) { - fprintf(stderr, "dir pointer is null!\n"); + (void)fprintf(stderr, "dir pointer is null!\n"); return -1; } @@ -95,7 +96,7 @@ int CheckDirExists(const char *dir) int GetParentPathStr(const char *path, char *parent, size_t bufSize) { if (path == NULL || parent == NULL) { - fprintf(stderr, "path pointer or parentPath is null!\n"); + (void)fprintf(stderr, "path pointer or parentPath is null!\n"); return -1; } @@ -120,7 +121,7 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) int MakeDirWithParent(const char *path, mode_t mode) { if (path == NULL) { - fprintf(stderr, "path pointer is null!\n"); + (void)fprintf(stderr, "path pointer is null!\n"); return -1; } @@ -148,7 +149,7 @@ int MakeDirWithParent(const char *path, mode_t mode) int MakeMountPoints(const char *path, mode_t mode) { if (path == NULL) { - fprintf(stderr, "path pointer is null!\n"); + (void)fprintf(stderr, "path pointer is null!\n"); return -1; } @@ -177,32 +178,73 @@ int MakeMountPoints(const char *path, mode_t mode) return 0; } -int CheckLegality(const char* filename) +static bool ShowExceptionInfo(const char* exceptionInfo) { - if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); - return -1; - } - - char buf[PATH_MAX + 1] = {0x00}; - errno_t ret = strncpy_s(buf, PATH_MAX + 1, filename, strlen(filename)); - if (ret != EOK) { - return -1; - } - do { - struct stat fileStat; - if (stat(buf, &fileStat) != 0) { - return -1; - } - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - fprintf(stderr, "Please check the folder owner!\n"); - return -1; + (void)fprintf(stderr, exceptionInfo); + (void)fprintf(stderr, "\n"); + return false; +} + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } } if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 - fprintf(stderr, "Please check the write permission!\n"); - return -1; + return ShowExceptionInfo("Please check the write permission!"); } - } while (strncmp(dirname(buf), "/", strlen(dirname(buf)))); - - return 0; -} \ No newline at end of file + if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { + break; + } + if (strcmp(dirname(buf), ".") == 0) { + break; + } + if (stat(buf, &fileStat) != 0) { + return false; + } + } + return true; +} + +bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + if (strstr(filePath, "..") != NULL) { // 存在".." + return ShowExceptionInfo("filePath has an illegal character!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && + (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + return ShowExceptionInfo("filePath has a soft link!"); + } + return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); +} diff --git a/cli/src/utils.h b/cli/src/utils.h index ab83b5f..7c803ca 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -8,10 +8,11 @@ #include #include #include +#include +#include +#include #include "basic.h" -#define ROOT_UID 0 - char *FormatLogMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); @@ -21,6 +22,7 @@ int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); int MakeMountPoints(const char *path, mode_t mode); -int CheckLegality(const char* filename); +bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner); #endif \ No newline at end of file diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt index e0db884..38d47cb 100644 --- a/install/deb/src/CMakeLists.txt +++ b/install/deb/src/CMakeLists.txt @@ -24,7 +24,7 @@ add_executable(ascend-docker-plugin-install-helper ${SRC}) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC) -# 添加链接库 +# 添加链接库 #该命令要在add_executable命令下方,否则报错 target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now cjson) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 2be6344..7a703fd 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -6,7 +6,13 @@ #include #include #include +#include +#include +#include +#include +#include #include "cJSON.h" +#include "securec.h" #define MAX_JSON_FILE_SIZE 65535 #define MIN_ARGS_NUM 4 @@ -27,7 +33,7 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { if (pf == NULL || text == NULL) { - fprintf(stderr, "file pointer or text pointer are null!\n"); + (void)fprintf(stderr, "file pointer or text pointer are null!\n"); return; } @@ -35,7 +41,7 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) int size = (int)ftell(pf); if (size >= maxBufferSize) { - fprintf(stderr, "file size too large\n"); + (void)fprintf(stderr, "file size too large\n"); return; } @@ -49,21 +55,21 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer are null!\n"); + (void)fprintf(stderr, "runtimePath pointer are null!\n"); return NULL; } cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { - fprintf(stderr, "create ascend runtime info root err\n"); + (void)fprintf(stderr, "create ascend runtime info root err\n"); return NULL; } cJSON *newString = NULL; newString = cJSON_CreateString(runtimePath); if (newString == NULL) { - fprintf(stderr, "create ascend runtime info path value err\n"); + (void)fprintf(stderr, "create ascend runtime info path value err\n"); cJSON_Delete(root); return NULL; } @@ -71,7 +77,7 @@ static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) cJSON *paraArray = NULL; paraArray = cJSON_CreateArray(); if (paraArray == NULL) { - fprintf(stderr, "create ascend runtime info args err\n"); + (void)fprintf(stderr, "create ascend runtime info args err\n"); cJSON_Delete(root); cJSON_Delete(newString); return NULL; @@ -86,21 +92,21 @@ static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) static cJSON *CreateRuntimes(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer is null!\n"); + (void)fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { - fprintf(stderr, "create ascendruntime err\n"); + (void)fprintf(stderr, "create ascendruntime err\n"); return NULL; } cJSON *runtimes = NULL; runtimes = cJSON_CreateObject(); if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); + (void)fprintf(stderr, "create runtimes err\n"); cJSON_Delete(ascendRuntime); return NULL; } @@ -113,7 +119,7 @@ static cJSON *CreateRuntimes(const char *runtimePath) static int DelJsonContent(cJSON *root, const char *key) { if (root == NULL || key == NULL) { - fprintf(stderr, "userInfo pointer is null!\n"); + (void)fprintf(stderr, "userInfo pointer is null!\n"); return -1; } @@ -126,7 +132,7 @@ static int DelJsonContent(cJSON *root, const char *key) cJSON *removedItem = NULL; removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { - fprintf(stderr, "remove %s failed\n", key); + (void)fprintf(stderr, "remove %s failed\n", key); free(existItem); existItem = NULL; return -1; @@ -139,7 +145,7 @@ static int DelJsonContent(cJSON *root, const char *key) static cJSON *CreateContent(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer is null!\n"); + (void)fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } @@ -147,7 +153,7 @@ static cJSON *CreateContent(const char *runtimePath) cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); + (void)fprintf(stderr, "create runtimes err\n"); return NULL; } @@ -162,7 +168,7 @@ static cJSON *CreateContent(const char *runtimePath) root = cJSON_CreateObject(); if (root == NULL) { /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ - fprintf(stderr, "create root err\n"); + (void)fprintf(stderr, "create root err\n"); cJSON_Delete(runtimes); cJSON_Delete(defaultRuntime); return NULL; @@ -178,7 +184,7 @@ static cJSON *CreateContent(const char *runtimePath) static cJSON *ModifyContent(FILE *pf, const char *runtimePath) { if (pf == NULL || runtimePath == NULL) { - fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); + (void)fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); return NULL; } @@ -188,7 +194,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) cJSON *root = NULL; root = cJSON_Parse(jsonStr); if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); return NULL; } @@ -236,7 +242,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) static cJSON *RemoveContent(FILE *pf) { if (pf == NULL) { - fprintf(stderr, "file pointer is null!\n"); + (void)fprintf(stderr, "file pointer is null!\n"); return NULL; } @@ -246,7 +252,7 @@ static cJSON *RemoveContent(FILE *pf) cJSON *root = NULL; root = cJSON_Parse(jsonStr); if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); return NULL; } @@ -261,7 +267,7 @@ static cJSON *RemoveContent(FILE *pf) cJSON *runtimes = NULL; runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); if (runtimes == NULL) { - fprintf(stderr, "no runtime key found\n"); + (void)fprintf(stderr, "no runtime key found\n"); cJSON_Delete(root); return NULL; } @@ -275,14 +281,99 @@ static cJSON *RemoveContent(FILE *pf) return root; } +static bool ShowExceptionInfo(const char* exceptionInfo) +{ + (void)fprintf(stderr, exceptionInfo); + (void)fprintf(stderr, "\n"); + return false; +} + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { + if (checkOwner) { + if ((fileStat.st_uid != 0) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } + } + if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 + return ShowExceptionInfo("Please check the write permission!"); + } + if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { + break; + } + if (strcmp(dirname(buf), ".") == 0) { + break; + } + if (stat(buf, &fileStat) != 0) { + return false; + } + } + return true; +} + +static bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + if (strstr(filePath, "..") != NULL) { // 存在".." + return ShowExceptionInfo("filePath has an illegal character!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && + (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); +} + +static bool CheckJsonFile(const char *jsonFilePath, const size_t jsonFilePathLen) +{ + struct stat fileStat; + if ((stat(jsonFilePath, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 10; // max 10MB + if (!CheckExternalFile(jsonFilePath, jsonFilePathLen, maxFileSzieMb, true)) { + return false; + } + } + return true; +} static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { - fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); + (void)fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); return -1; } + if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath)) || + !CheckJsonFile(runtimePath, strlen(runtimePath))) { + (void)fprintf(stderr, "filePath, tempPath or runtimePath check failed!\n"); + return -1; + } + cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); @@ -294,18 +385,18 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c } if (root == NULL) { - fprintf(stderr, "error: failed to create json\n"); + (void)fprintf(stderr, "error: failed to create json\n"); return -1; } pf = fopen(tempPath, "w"); if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); return -1; } if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); (void)fclose(pf); cJSON_Delete(root); return -1; @@ -320,14 +411,18 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { if (filePath == NULL || tempPath == NULL) { - fprintf(stderr, "filePath or tempPath are null!\n"); + (void)fprintf(stderr, "filePath or tempPath are null!\n"); + return -1; + } + if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath))) { + (void)fprintf(stderr, "filePath, tempPath check failed!\n"); return -1; } FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { - fprintf(stderr, "error: no json files found\n"); + (void)fprintf(stderr, "error: no json files found\n"); return -1; } cJSON *newContent = NULL; @@ -335,7 +430,7 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) (void)fclose(pf); if (newContent == NULL) { - fprintf(stderr, "error: failed to create json\n"); + (void)fprintf(stderr, "error: failed to create json\n"); if (pf != NULL) { (void)fclose(pf); pf = NULL; @@ -345,13 +440,13 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) pf = fopen(tempPath, "w"); if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); return -1; } if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); if (pf != NULL) { (void)fclose(pf); -- Gitee From d5714a6f6d52794b83c70c9ed70b6ebf6ce5f136 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 7 Mar 2022 10:11:30 +0800 Subject: [PATCH 197/296] Match-id-63a2d5278bbd219223e2e3aba406814afd017522 --- build/scripts/base.list | 4 +- build/scripts/run_main.sh | 3 +- cli/src/basic.c | 2 +- cli/src/basic.h | 6 +- cli/src/cgrp.c | 28 +++--- cli/src/logger.c | 28 +++--- cli/src/options.c | 2 +- cli/src/u_mount.c | 67 ++++++--------- cli/src/utils.c | 102 +++++++++++++++------- cli/src/utils.h | 7 +- hook/main.go | 2 - install/deb/src/main.c | 176 +++++++++++++++++++++++++++++--------- 12 files changed, 276 insertions(+), 151 deletions(-) diff --git a/build/scripts/base.list b/build/scripts/base.list index b66432b..0a6470a 100644 --- a/build/scripts/base.list +++ b/build/scripts/base.list @@ -1,6 +1,4 @@ /usr/local/Ascend/driver/lib64 -/usr/local/Ascend/driver/tools /usr/local/Ascend/driver/include /usr/local/dcmi -/usr/local/bin/npu-smi -/var/log/npu/conf/slog/slog.conf \ No newline at end of file +/usr/local/bin/npu-smi \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index a9ae06e..e04ec24 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -52,7 +52,8 @@ function install() exit 1 fi - mv ${SRC} ${DST} + mv ${SRC} ${DST} + chmod 600 ${DST} echo 'create damom.json success' echo 'please reboot docker daemon to take effect' if [ -f "/var/log/ascend_seclog/ascend_toolbox_install.log" ];then diff --git a/cli/src/basic.c b/cli/src/basic.c index d4de536..e11b50b 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -9,7 +9,7 @@ void InitParsedConfig(struct ParsedConfig *parsedConfig) { if (parsedConfig == NULL) { - fprintf(stderr, "parsedConfig pointer is null!\n"); + (void)fprintf(stderr, "parsedConfig pointer is null!\n"); return; } diff --git a/cli/src/basic.h b/cli/src/basic.h index 0dbc67b..47bf0f2 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -22,6 +22,8 @@ #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 +#define ROOT_UID 0 + #define LEVEL_INFO 0 #define LEVEL_WARN 1 #define LEVEL_ERROR 2 @@ -34,9 +36,9 @@ char _content[BUF_SIZE] = {0}; \ int _ret = sprintf_s(_content, BUF_SIZE, fmt, ##__VA_ARGS__); \ if (_ret < 0) { \ - fprintf(stderr, "cannot assemble log content"); \ + (void)fprintf(stderr, "cannot assemble log content"); \ } else { \ - fprintf(stderr, "%s", (const char *)_content); \ + (void)fprintf(stderr, "%s", (const char *)_content); \ } \ } while (0) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index d33af23..3f32155 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -22,7 +22,7 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) { if (pLine == NULL || word == NULL) { - fprintf(stderr, "pLine, word pointer is null!\n"); + (void)fprintf(stderr, "pLine, word pointer is null!\n"); return false; } @@ -41,7 +41,7 @@ bool TakeNthWord(char **pLine, unsigned int n, char **word) bool CheckRootDir(char **pLine) { if (pLine == NULL) { - fprintf(stderr, "pLine pointer is null!\n"); + (void)fprintf(stderr, "pLine pointer is null!\n"); return false; } @@ -56,7 +56,7 @@ bool CheckRootDir(char **pLine) bool CheckFsType(char **pLine) { if (pLine == NULL) { - fprintf(stderr, "pLine pointer is null!\n"); + (void)fprintf(stderr, "pLine pointer is null!\n"); return false; } @@ -71,7 +71,7 @@ bool CheckFsType(char **pLine) bool CheckSubStr(char **pLine, const char *subsys) { if (pLine == NULL || subsys == NULL) { - fprintf(stderr, "pLine, subsys pointer is null!\n"); + (void)fprintf(stderr, "pLine, subsys pointer is null!\n"); return false; } @@ -87,7 +87,7 @@ typedef char *(*ParseFileLine)(char *, const char *); int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) { if (buffer == NULL || filepath == NULL) { - fprintf(stderr, "buffer, filepath pointer is null!\n"); + (void)fprintf(stderr, "buffer, filepath pointer is null!\n"); return -1; } @@ -101,7 +101,8 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const Logger("Cannot canonicalize path.", LEVEL_ERROR, SCREEN_YES); return -1; } - if (CheckLegality(resolvedPath) != 0) { + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedPath, strlen(resolvedPath), maxFileSzieMb, true)) { Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -131,7 +132,7 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char *GetCgroupMount(char *line, const char *subsys) { if (line == NULL || subsys == NULL) { - fprintf(stderr, "line, subsys pointer is null!\n"); + (void)fprintf(stderr, "line, subsys pointer is null!\n"); return NULL; } @@ -160,7 +161,7 @@ char *GetCgroupMount(char *line, const char *subsys) char *GetCgroupRoot(char *line, const char *subSystem) { if (line == NULL || subSystem == NULL) { - fprintf(stderr, "line, subSystem pointer is null!\n"); + (void)fprintf(stderr, "line, subSystem pointer is null!\n"); return NULL; } @@ -190,7 +191,7 @@ char *GetCgroupRoot(char *line, const char *subSystem) int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) { if (cgroupAllow == NULL || devName == NULL) { - fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); + (void)fprintf(stderr, "cgroupAllow, devName pointer is null!\n"); return -1; } @@ -225,7 +226,7 @@ int SetupDeviceCgroup(FILE *cgroupAllow, const char *devName) int SetupDriverCgroup(FILE *cgroupAllow) { if (cgroupAllow == NULL) { - fprintf(stderr, "cgroupAllow pointer is null!\n"); + (void)fprintf(stderr, "cgroupAllow pointer is null!\n"); return -1; } @@ -260,7 +261,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) int GetCgroupPath(int pid, char *effPath, size_t maxSize) { if (effPath == NULL) { - fprintf(stderr, "effPath pointer is null!\n"); + (void)fprintf(stderr, "effPath pointer is null!\n"); return -1; } @@ -313,7 +314,7 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) int SetupCgroup(const struct ParsedConfig *config) { if (config == NULL) { - fprintf(stderr, "config pointer is null!\n"); + (void)fprintf(stderr, "config pointer is null!\n"); return -1; } @@ -325,7 +326,8 @@ int SetupCgroup(const struct ParsedConfig *config) Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); return -1; } - if (CheckLegality(resolvedCgroupPath) != 0) { + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedCgroupPath, strlen(resolvedCgroupPath), maxFileSzieMb, true)) { Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/cli/src/logger.c b/cli/src/logger.c index 4445c78..3871c07 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -23,7 +23,7 @@ int GetCurrentLocalTime(char* buffer, int length) { if (buffer == NULL) { - fprintf(stderr, "buffer pointer is null!\n"); + (void)fprintf(stderr, "buffer pointer is null!\n"); return -1; } @@ -62,7 +62,7 @@ int CreateLog(const char* filename) long GetLogSize(const char* filename) { if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); + (void)fprintf(stderr, "filename pointer is null!\n"); return -1; } @@ -73,11 +73,15 @@ long GetLogSize(const char* filename) } FILE *fp = NULL; char path[PATH_MAX + 1] = {0x00}; - if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { + if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return -1; } - if (CheckLegality(path) != 0) { - return -1; + struct stat fileStat; + if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { + return -1; + } } fp = fopen(path, "rb"); long length = 0; @@ -96,7 +100,7 @@ long GetLogSize(const char* filename) int LogLoop(const char* filename) { if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); + (void)fprintf(stderr, "filename pointer is null!\n"); return -1; } @@ -121,7 +125,7 @@ int LogLoop(const char* filename) void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) { if (filename == NULL || buffer == NULL) { - fprintf(stderr, "filename, buffer pointer is null!\n"); + (void)fprintf(stderr, "filename, buffer pointer is null!\n"); return; } @@ -139,11 +143,15 @@ void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsign return; } } - if (strlen(filename) > PATH_MAX || NULL == realpath(filename, path)) { + if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return; } - if (CheckLegality(path) != 0) { - return; + struct stat fileStat; + if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { + return; + } } fp = fopen(path, "a+"); if (fp != NULL) { diff --git a/cli/src/options.c b/cli/src/options.c index 2300016..f5c546f 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -25,7 +25,7 @@ static struct { void ParseRuntimeOptions(const char *options) { if (options == NULL) { - fprintf(stderr, "options pointer is null!\n"); + (void)fprintf(stderr, "options pointer is null!\n"); return; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 76b9e67..31ba172 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -26,20 +26,25 @@ int Mount(const char *src, const char *dst) static const unsigned long mountFlags = MS_BIND; static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; int ret; - + struct stat fileStat; + if ((stat(src, &fileStat) == 0) && + ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 + const size_t maxFileSzieMb = 10 * 1024; // max 10 G + if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { + char* str = FormatLogMessage("failed to mount src hehe:%s.", src); + Logger(str, LEVEL_ERROR, SCREEN_YES); + return -1; + } + } ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { - char* str = FormatLogMessage("failed to mount src:%s.", src); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount src.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = mount(NULL, dst, NULL, remountFlags, NULL); if (ret < 0) { - char* str = FormatLogMessage("failed to re-mount. dst:%s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to re-mount. dst.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -80,9 +85,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { - char* str = FormatLogMessage("cannot canonicalize device dst: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("cannot canonicalize device dst.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -94,9 +97,7 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, } else { err = strcpy_s(dst, dstBufSize, resolvedDst); if (err != EOK) { - char* str = FormatLogMessage("failed to copy resolved device mnt path to dst: %s.", resolvedDst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to copy resolved device mnt path to dst.", LEVEL_ERROR, SCREEN_YES); return -1; } } @@ -113,18 +114,14 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); if (ret < 0) { - str = FormatLogMessage("failed to get mount src and dst path, device name: %s.", srcDeviceName); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to get mount src and dst path.", LEVEL_ERROR, SCREEN_YES); return -1; } struct stat srcStat; ret = stat((const char *)src, &srcStat); if (ret < 0) { - str = FormatLogMessage("failed to stat src: %s.", src); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to stat src.", LEVEL_ERROR, SCREEN_YES); return -1; } errno = 0; @@ -133,9 +130,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { - str = FormatLogMessage("%s already exists but not a char device as expected.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("dst already exists but not a char device as expected.", LEVEL_ERROR, SCREEN_YES); return -1; } else if (ret < 0 && errno != ENOENT) { Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); @@ -143,9 +138,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe } ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to create mount dst file.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -179,9 +172,7 @@ int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned } int ret = MountDevice(rootfs, srcDeviceName, dstDeviceName); if (ret < 0) { - char* str = FormatLogMessage("failed to mount device %s.", srcDeviceName); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount device.", LEVEL_ERROR, SCREEN_YES); return -1; } } @@ -201,9 +192,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = sprintf_s(dst, BUF_SIZE, "%s%s", rootfs, filepath); if (ret < 0) { - char* str = FormatLogMessage("failed to assemble file mounting path, file: %s.", filepath); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to assemble file mounting path.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -215,9 +204,7 @@ int MountFile(const char *rootfs, const char *filepath) ret = MakeMountPoints(dst, srcStat.st_mode); if (ret < 0) { - char* str = FormatLogMessage("failed to create mount dst file: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to create mount dst file.", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -253,17 +240,13 @@ int MountDir(const char *rootfs, const char *src) ret = MakeDirWithParent(dst, DEFAULT_DIR_MODE); if (ret < 0) { - char* str = FormatLogMessage("failed to make dir: %s.", dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to make dir.", LEVEL_ERROR, SCREEN_YES); return -1; } ret = Mount(src, dst); if (ret < 0) { - char* str = FormatLogMessage("failed to mount dir: %s to %s.", src, dst); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to mount dir", LEVEL_ERROR, SCREEN_YES); return -1; } @@ -316,9 +299,7 @@ int DoDirectoryMounting(const char *rootfs, const struct MountList *list) for (unsigned int i = 0; i < list->count; i++) { ret = MountDir(rootfs, (const char *)&list->list[i][0]); if (ret < 0) { - char* str = FormatLogMessage("failed to do directory mounting for %s.", (const char *)&list->list[i][0]); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); + Logger("failed to do directory mounting", LEVEL_ERROR, SCREEN_YES); return -1; } } diff --git a/cli/src/utils.c b/cli/src/utils.c index bacfd88..29fedff 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -13,13 +13,14 @@ #include #include #include +#include #include "securec.h" #include "logger.h" char *FormatLogMessage(char *format, ...) { if (format == NULL) { - fprintf(stderr, "format pointer is null!\n"); + (void)fprintf(stderr, "format pointer is null!\n"); return NULL; } @@ -61,7 +62,7 @@ int StrHasPrefix(const char *str, const char *prefix) int MkDir(const char *dir, int mode) { if (dir == NULL) { - fprintf(stderr, "dir pointer is null!\n"); + (void)fprintf(stderr, "dir pointer is null!\n"); return -1; } @@ -79,7 +80,7 @@ int VerifyPathInfo(const struct PathInfo* pathInfo) int CheckDirExists(const char *dir) { if (dir == NULL) { - fprintf(stderr, "dir pointer is null!\n"); + (void)fprintf(stderr, "dir pointer is null!\n"); return -1; } @@ -95,7 +96,7 @@ int CheckDirExists(const char *dir) int GetParentPathStr(const char *path, char *parent, size_t bufSize) { if (path == NULL || parent == NULL) { - fprintf(stderr, "path pointer or parentPath is null!\n"); + (void)fprintf(stderr, "path pointer or parentPath is null!\n"); return -1; } @@ -120,7 +121,7 @@ int GetParentPathStr(const char *path, char *parent, size_t bufSize) int MakeDirWithParent(const char *path, mode_t mode) { if (path == NULL) { - fprintf(stderr, "path pointer is null!\n"); + (void)fprintf(stderr, "path pointer is null!\n"); return -1; } @@ -148,7 +149,7 @@ int MakeDirWithParent(const char *path, mode_t mode) int MakeMountPoints(const char *path, mode_t mode) { if (path == NULL) { - fprintf(stderr, "path pointer is null!\n"); + (void)fprintf(stderr, "path pointer is null!\n"); return -1; } @@ -177,32 +178,73 @@ int MakeMountPoints(const char *path, mode_t mode) return 0; } -int CheckLegality(const char* filename) +static bool ShowExceptionInfo(const char* exceptionInfo) { - if (filename == NULL) { - fprintf(stderr, "filename pointer is null!\n"); - return -1; - } - - char buf[PATH_MAX + 1] = {0x00}; - errno_t ret = strncpy_s(buf, PATH_MAX + 1, filename, strlen(filename)); - if (ret != EOK) { - return -1; - } - do { - struct stat fileStat; - if (stat(buf, &fileStat) != 0) { - return -1; - } - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - fprintf(stderr, "Please check the folder owner!\n"); - return -1; + (void)fprintf(stderr, exceptionInfo); + (void)fprintf(stderr, "\n"); + return false; +} + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } } if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 - fprintf(stderr, "Please check the write permission!\n"); - return -1; + return ShowExceptionInfo("Please check the write permission!"); } - } while (strncmp(dirname(buf), "/", strlen(dirname(buf)))); - - return 0; + if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { + break; + } + if (strcmp(dirname(buf), ".") == 0) { + break; + } + if (stat(buf, &fileStat) != 0) { + return false; + } + } + return true; +} + +bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + if (strstr(filePath, "..") != NULL) { // 存在".." + return ShowExceptionInfo("filePath has an illegal character!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && + (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + return ShowExceptionInfo("filePath has a soft link!"); + } + return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); } diff --git a/cli/src/utils.h b/cli/src/utils.h index ab83b5f..293c097 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -8,10 +8,9 @@ #include #include #include +#include #include "basic.h" -#define ROOT_UID 0 - char *FormatLogMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); int StrHasPrefix(const char *str, const char *prefix); @@ -21,6 +20,6 @@ int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); int MakeMountPoints(const char *path, mode_t mode); -int CheckLegality(const char* filename); - +bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner); #endif \ No newline at end of file diff --git a/hook/main.go b/hook/main.go index c909114..332a173 100644 --- a/hook/main.go +++ b/hook/main.go @@ -7,7 +7,6 @@ package main import ( "bufio" "encoding/json" - "flag" "fmt" "log" "os" @@ -364,7 +363,6 @@ func doPrestartHook() error { func main() { log.SetPrefix(loggingPrefix) - flag.Parse() if err := doPrestartHook(); err != nil { log.Fatal(err) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 2be6344..c999836 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -6,16 +6,22 @@ #include #include #include +#include +#include +#include +#include +#include #include "cJSON.h" +#include "securec.h" #define MAX_JSON_FILE_SIZE 65535 -#define MIN_ARGS_NUM 4 -#define ADD_CMD_ARGS_NUM 5 +#define MIN_ARGS_NUM 4 +#define ADD_CMD_ARGS_NUM 5 #define ADD_CMD "add" #define RM_CMD "rm" -#define CMD_INDEX 1 -#define FINAL_FILE_INDEX 2 -#define TEMP_FILE_INDEX 3 +#define CMD_INDEX 1 +#define FINAL_FILE_INDEX 2 +#define TEMP_FILE_INDEX 3 #define RUNTIME_PATH_INDEX 4 #define ASCEND_RUNTIME_PATH_KEY "path" #define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" @@ -23,11 +29,12 @@ #define ASCEND_RUNTIME_NAME "ascend" #define DEFALUT_KEY "default-runtime" #define DEFAULT_VALUE "ascend" +#define ROOT_UID 0 static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) { if (pf == NULL || text == NULL) { - fprintf(stderr, "file pointer or text pointer are null!\n"); + (void)fprintf(stderr, "file pointer or text pointer are null!\n"); return; } @@ -35,7 +42,7 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) int size = (int)ftell(pf); if (size >= maxBufferSize) { - fprintf(stderr, "file size too large\n"); + (void)fprintf(stderr, "file size too large\n"); return; } @@ -49,21 +56,21 @@ static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer are null!\n"); + (void)fprintf(stderr, "runtimePath pointer are null!\n"); return NULL; } cJSON *root = NULL; root = cJSON_CreateObject(); if (root == NULL) { - fprintf(stderr, "create ascend runtime info root err\n"); + (void)fprintf(stderr, "create ascend runtime info root err\n"); return NULL; } cJSON *newString = NULL; newString = cJSON_CreateString(runtimePath); if (newString == NULL) { - fprintf(stderr, "create ascend runtime info path value err\n"); + (void)fprintf(stderr, "create ascend runtime info path value err\n"); cJSON_Delete(root); return NULL; } @@ -71,7 +78,7 @@ static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) cJSON *paraArray = NULL; paraArray = cJSON_CreateArray(); if (paraArray == NULL) { - fprintf(stderr, "create ascend runtime info args err\n"); + (void)fprintf(stderr, "create ascend runtime info args err\n"); cJSON_Delete(root); cJSON_Delete(newString); return NULL; @@ -86,21 +93,21 @@ static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) static cJSON *CreateRuntimes(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer is null!\n"); + (void)fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { - fprintf(stderr, "create ascendruntime err\n"); + (void)fprintf(stderr, "create ascendruntime err\n"); return NULL; } cJSON *runtimes = NULL; runtimes = cJSON_CreateObject(); if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); + (void)fprintf(stderr, "create runtimes err\n"); cJSON_Delete(ascendRuntime); return NULL; } @@ -113,7 +120,7 @@ static cJSON *CreateRuntimes(const char *runtimePath) static int DelJsonContent(cJSON *root, const char *key) { if (root == NULL || key == NULL) { - fprintf(stderr, "userInfo pointer is null!\n"); + (void)fprintf(stderr, "userInfo pointer is null!\n"); return -1; } @@ -126,7 +133,7 @@ static int DelJsonContent(cJSON *root, const char *key) cJSON *removedItem = NULL; removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { - fprintf(stderr, "remove %s failed\n", key); + (void)fprintf(stderr, "remove %s failed\n", key); free(existItem); existItem = NULL; return -1; @@ -139,7 +146,7 @@ static int DelJsonContent(cJSON *root, const char *key) static cJSON *CreateContent(const char *runtimePath) { if (runtimePath == NULL) { - fprintf(stderr, "runtimePath pointer is null!\n"); + (void)fprintf(stderr, "runtimePath pointer is null!\n"); return NULL; } @@ -147,7 +154,7 @@ static cJSON *CreateContent(const char *runtimePath) cJSON *runtimes = NULL; runtimes = CreateRuntimes(runtimePath); if (runtimes == NULL) { - fprintf(stderr, "create runtimes err\n"); + (void)fprintf(stderr, "create runtimes err\n"); return NULL; } @@ -162,7 +169,7 @@ static cJSON *CreateContent(const char *runtimePath) root = cJSON_CreateObject(); if (root == NULL) { /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ - fprintf(stderr, "create root err\n"); + (void)fprintf(stderr, "create root err\n"); cJSON_Delete(runtimes); cJSON_Delete(defaultRuntime); return NULL; @@ -178,7 +185,7 @@ static cJSON *CreateContent(const char *runtimePath) static cJSON *ModifyContent(FILE *pf, const char *runtimePath) { if (pf == NULL || runtimePath == NULL) { - fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); + (void)fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); return NULL; } @@ -188,7 +195,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) cJSON *root = NULL; root = cJSON_Parse(jsonStr); if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); return NULL; } @@ -236,7 +243,7 @@ static cJSON *ModifyContent(FILE *pf, const char *runtimePath) static cJSON *RemoveContent(FILE *pf) { if (pf == NULL) { - fprintf(stderr, "file pointer is null!\n"); + (void)fprintf(stderr, "file pointer is null!\n"); return NULL; } @@ -246,7 +253,7 @@ static cJSON *RemoveContent(FILE *pf) cJSON *root = NULL; root = cJSON_Parse(jsonStr); if (root == NULL) { - fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); return NULL; } @@ -261,7 +268,7 @@ static cJSON *RemoveContent(FILE *pf) cJSON *runtimes = NULL; runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); if (runtimes == NULL) { - fprintf(stderr, "no runtime key found\n"); + (void)fprintf(stderr, "no runtime key found\n"); cJSON_Delete(root); return NULL; } @@ -275,14 +282,99 @@ static cJSON *RemoveContent(FILE *pf) return root; } +static bool ShowExceptionInfo(const char* exceptionInfo) +{ + (void)fprintf(stderr, exceptionInfo); + (void)fprintf(stderr, "\n"); + return false; +} + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } + } + if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 + return ShowExceptionInfo("Please check the write permission!"); + } + if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { + break; + } + if (strcmp(dirname(buf), ".") == 0) { + break; + } + if (stat(buf, &fileStat) != 0) { + return false; + } + } + return true; +} + +static bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + if (strstr(filePath, "..") != NULL) { // 存在".." + return ShowExceptionInfo("filePath has an illegal character!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && + (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); +} + +static bool CheckJsonFile(const char *jsonFilePath, const size_t jsonFilePathLen) +{ + struct stat fileStat; + if ((stat(jsonFilePath, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 10; // max 10MB + if (!CheckExternalFile(jsonFilePath, jsonFilePathLen, maxFileSzieMb, true)) { + return false; + } + } + return true; +} static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) { if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { - fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); + (void)fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); return -1; } + if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath)) || + !CheckJsonFile(runtimePath, strlen(runtimePath))) { + (void)fprintf(stderr, "filePath, tempPath or runtimePath check failed!\n"); + return -1; + } + cJSON *root = NULL; FILE *pf = NULL; pf = fopen(filePath, "r+"); @@ -294,18 +386,18 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c } if (root == NULL) { - fprintf(stderr, "error: failed to create json\n"); + (void)fprintf(stderr, "error: failed to create json\n"); return -1; } pf = fopen(tempPath, "w"); if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); return -1; } if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); (void)fclose(pf); cJSON_Delete(root); return -1; @@ -320,14 +412,19 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) { if (filePath == NULL || tempPath == NULL) { - fprintf(stderr, "filePath or tempPath are null!\n"); + (void)fprintf(stderr, "filePath or tempPath are null!\n"); + return -1; + } + + if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath))) { + (void)fprintf(stderr, "filePath, tempPath check failed!\n"); return -1; } FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { - fprintf(stderr, "error: no json files found\n"); + (void)fprintf(stderr, "error: no json files found\n"); return -1; } cJSON *newContent = NULL; @@ -335,7 +432,7 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) (void)fclose(pf); if (newContent == NULL) { - fprintf(stderr, "error: failed to create json\n"); + (void)fprintf(stderr, "error: failed to create json\n"); if (pf != NULL) { (void)fclose(pf); pf = NULL; @@ -345,13 +442,13 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) pf = fopen(tempPath, "w"); if (pf == NULL) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); return -1; } if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { - fprintf(stderr, "error: failed to create file\n"); + (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); if (pf != NULL) { (void)fclose(pf); @@ -377,13 +474,10 @@ int main(int argc, char *argv[]) printf("%s\n", argv[TEMP_FILE_INDEX]); printf("%s\n", argv[CMD_INDEX]); - if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { - if (argc != ADD_CMD_ARGS_NUM) { - return -1; - } - + if ((strcmp(argv[CMD_INDEX], ADD_CMD) == 0) && (argc == ADD_CMD_ARGS_NUM)) { return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); + } else if ((strcmp(argv[CMD_INDEX], RM_CMD) == 0) && (argc == MIN_ARGS_NUM)) { + return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); } - - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); -} + return -1; +} \ No newline at end of file -- Gitee From 7260559db4cd3f986ca396757c08ca814d571e6d Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 8 Mar 2022 10:19:47 +0800 Subject: [PATCH 198/296] Match-id-81648689b0d2d7e14ebb9a04ae7da1ad14f32832 --- cli/test/dt/testcase/gtest_mytest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 8e9378a..0fab616 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -49,7 +49,7 @@ extern "C" char *GetCgroupRoot(char *line, const char *subSystem); extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); -extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); +extern "C" int GetCgroupPath(int pid, char *effPath, const size_t maxSize); extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); @@ -318,7 +318,7 @@ int Stub_ParseFileByLine_Success(char* buffer, int bufferSize, ParseFileLine fn, return 0; } -int Stub_GetCgroupPath_Success(const struct CmdArgs *args, char *effPath, const size_t maxSize) +int Stub_GetCgroupPath_Success(int pid, char *effPath, const size_t maxSize) { return 0; } @@ -796,7 +796,7 @@ TEST(GetCgroupPath, StatusOne) MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; - int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); + int ret = GetCgroupPath(args.pid, cgroupPath, BUF_SIZE); EXPECT_EQ(0, ret); } -- Gitee From 3838667975dd72c7d65f39105c381398e562e1b2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 8 Mar 2022 13:22:51 +0800 Subject: [PATCH 199/296] Match-id-a5b4728db79cae8c873b2d7a0b82a23898ede1e8 --- cli/test/dt/testcase/gtest_mytest.cpp | 6 +++--- install/deb/src/main.c | 18 +++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 0fab616..8e9378a 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -49,7 +49,7 @@ extern "C" char *GetCgroupRoot(char *line, const char *subSystem); extern "C" int ParseFileByLine(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath); extern "C" int SetupDeviceCgroup(FILE *cgroupAllow, const char *devPath); extern "C" int SetupDriverCgroup(FILE *cgroupAllow); -extern "C" int GetCgroupPath(int pid, char *effPath, const size_t maxSize); +extern "C" int GetCgroupPath(const struct CmdArgs *args, char *effPath, const size_t maxSize); extern "C" int SetupCgroup(const struct ParsedConfig *config); extern "C" int SetupContainer(struct CmdArgs *args); extern "C" int Process(int argc, char **argv); @@ -318,7 +318,7 @@ int Stub_ParseFileByLine_Success(char* buffer, int bufferSize, ParseFileLine fn, return 0; } -int Stub_GetCgroupPath_Success(int pid, char *effPath, const size_t maxSize) +int Stub_GetCgroupPath_Success(const struct CmdArgs *args, char *effPath, const size_t maxSize) { return 0; } @@ -796,7 +796,7 @@ TEST(GetCgroupPath, StatusOne) MOCKER(ParseFileByLine).stubs().will(invoke(Stub_ParseFileByLine_Success)); char cgroupPath[BUF_SIZE] = {0}; - int ret = GetCgroupPath(args.pid, cgroupPath, BUF_SIZE); + int ret = GetCgroupPath(&args, cgroupPath, BUF_SIZE); EXPECT_EQ(0, ret); } diff --git a/install/deb/src/main.c b/install/deb/src/main.c index c999836..f889bf0 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -134,8 +134,6 @@ static int DelJsonContent(cJSON *root, const char *key) removedItem = cJSON_DetachItemViaPointer(root, existItem); if (removedItem == NULL) { (void)fprintf(stderr, "remove %s failed\n", key); - free(existItem); - existItem = NULL; return -1; } @@ -393,6 +391,7 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c pf = fopen(tempPath, "w"); if (pf == NULL) { (void)fprintf(stderr, "error: failed to create file\n"); + cJSON_Delete(root); return -1; } @@ -430,13 +429,10 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) cJSON *newContent = NULL; newContent = RemoveContent(pf); (void)fclose(pf); + pf = NULL; if (newContent == NULL) { (void)fprintf(stderr, "error: failed to create json\n"); - if (pf != NULL) { - (void)fclose(pf); - pf = NULL; - } return -1; } @@ -444,22 +440,22 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (pf == NULL) { (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); + newContent = NULL; return -1; } if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); - if (pf != NULL) { - (void)fclose(pf); - pf = NULL; - } + newContent = NULL; + (void)fclose(pf); + pf = NULL; return -1; } (void)fclose(pf); pf = NULL; cJSON_Delete(newContent); - + newContent = NULL; return 0; } -- Gitee From c0e5f903447387af0c9d62a02096ca0476361568 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 8 Mar 2022 19:00:22 +0800 Subject: [PATCH 200/296] Match-id-0180b206629ea0900ebd7440ec5e05337b2f98da --- build/build.sh | 4 +++- build/scripts/base.list_A200 | 5 +++++ build/scripts/base.list_A500 | 3 +++ build/scripts/help.info | 3 ++- build/scripts/run_main.sh | 19 ++++++++++++++++++- cli/src/cgrp.c | 13 +++++++++++++ cli/src/u_mount.c | 15 ++++++++++++++- 7 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 build/scripts/base.list_A200 create mode 100644 build/scripts/base.list_A500 diff --git a/build/build.sh b/build/build.sh index fe9acea..6de020e 100644 --- a/build/build.sh +++ b/build/build.sh @@ -90,9 +90,11 @@ function build_run_package() /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg + /bin/cp -f scripts/base.list_A500 run_pkg + /bin/cp -f scripts/base.list_A200 run_pkg FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 6 ]; then + if [ $FILECNT -ne 8 ]; then exit 1 fi /bin/cp -rf ${ROOT}/assets run_pkg diff --git a/build/scripts/base.list_A200 b/build/scripts/base.list_A200 new file mode 100644 index 0000000..30ec955 --- /dev/null +++ b/build/scripts/base.list_A200 @@ -0,0 +1,5 @@ +/usr/local/Ascend/driver/lib64 +/usr/local/sbin/npu-smi +/usr/local/Ascend/driver/tools +/etc/hdcBasic.cfg +/etc/sys_version.conf \ No newline at end of file diff --git a/build/scripts/base.list_A500 b/build/scripts/base.list_A500 new file mode 100644 index 0000000..c78a6ce --- /dev/null +++ b/build/scripts/base.list_A500 @@ -0,0 +1,3 @@ +/home/data/miniD/driver/lib64 +/usr/local/dcmi +/usr/local/bin/npu-smi \ No newline at end of file diff --git a/build/scripts/help.info b/build/scripts/help.info index 2bbe1f1..0d8bae1 100644 --- a/build/scripts/help.info +++ b/build/scripts/help.info @@ -2,4 +2,5 @@ --install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime) --uninstall Uninstall the installed ascend-docker-runtime tool --upgrade Upgrade the installed ascend-docker-runtime tool - --devel Install as devel mode \ No newline at end of file + --devel Install as devel mode + --install-type= A500 and A200 need to specify the installation type of Ascend-mindx-toolbox (eg: --install-type=A500) \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index e04ec24..0e292ad 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -35,7 +35,13 @@ function install() fi mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} - cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + if [ "${a500}" == "y" ]; then + cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "${a200}" == "y" ]; then + cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + else + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + fi chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list echo 'install executable files success' @@ -114,6 +120,8 @@ INSTALL_PATH_FLAG=n UNINSTALL_FLAG=n UPGRADE_FLAG=n DEVEL_FLAG=n +a500=n +a200=n while true do @@ -140,6 +148,15 @@ do DEVEL_FLAG=y shift ;; + --install-type=*) + # 去除指定安装目录后所有的 "/" + if [ "$3" == "--install-type=A500" ]; then + a500=y + elif [ "$3" == "--install-type=A200" ]; then + a200=y + fi + shift + ;; *) break ;; diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 3f32155..85947a6 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -238,6 +238,19 @@ int SetupDriverCgroup(FILE *cgroupAllow) free(str); return -1; } + + char devmmPath[PATH_MAX] = {0}; + char hisiPath[PATH_MAX] = {0}; + if ((sprintf_s(devmmPath, PATH_MAX, "/dev/%s", DEVMM_SVM) < 0) || + (sprintf_s(hisiPath, PATH_MAX, "/dev/%s", HISI_HDC) < 0)) { + Logger("failed to assemble dev path.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + struct stat devStat; // 200 soc 不需要挂载此两个设备 + if ((stat(devmmPath, &devStat) != 0) && (stat(hisiPath, &devStat) != 0)) { + Logger("200 Soc.", LEVEL_ERROR, SCREEN_YES); + return 0; + } ret = SetupDeviceCgroup(cgroupAllow, DEVMM_SVM); if (ret < 0) { diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 31ba172..6d3ecd7 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -31,7 +31,7 @@ int Mount(const char *src, const char *dst) ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 const size_t maxFileSzieMb = 10 * 1024; // max 10 G if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { - char* str = FormatLogMessage("failed to mount src hehe:%s.", src); + char* str = FormatLogMessage("failed to mount src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); return -1; } @@ -269,6 +269,19 @@ int DoCtrlDeviceMounting(const char *rootfs) return -1; } + char devmmPath[PATH_MAX] = {0}; + char hisiPath[PATH_MAX] = {0}; + if ((sprintf_s(devmmPath, PATH_MAX, "%s/dev/%s", rootfs, DEVMM_SVM) < 0) && + (sprintf_s(hisiPath, PATH_MAX, "%s/dev/%s", rootfs, HISI_HDC) < 0)) { + Logger("failed to assemble path.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + struct stat devStat; // 200 soc 不需要挂载此两个设备 + if ((stat(devmmPath, &devStat) != 0) && (stat(hisiPath, &devStat) != 0)) { + Logger("200 Soc.", LEVEL_ERROR, SCREEN_YES); + return 0; + } + ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", DEVMM_SVM); -- Gitee From dd236e3bb3968c7b5c3cbc9d1349e26f443b9894 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 10 Mar 2022 19:06:39 +0800 Subject: [PATCH 201/296] Match-id-878cc0ef00de0aa1e3a43e8a9980cb0f4d4333d4 --- cli/src/cgrp.c | 2 +- cli/src/u_mount.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 85947a6..4c2d945 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -243,7 +243,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) char hisiPath[PATH_MAX] = {0}; if ((sprintf_s(devmmPath, PATH_MAX, "/dev/%s", DEVMM_SVM) < 0) || (sprintf_s(hisiPath, PATH_MAX, "/dev/%s", HISI_HDC) < 0)) { - Logger("failed to assemble dev path.", LEVEL_ERROR, SCREEN_YES); + Logger("failed to assemble path.", LEVEL_ERROR, SCREEN_YES); return -1; } struct stat devStat; // 200 soc 不需要挂载此两个设备 diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 6d3ecd7..42d4339 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -78,17 +78,14 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, if (ret < 0) { return -1; } - ret = sprintf_s(unresolvedDst, BUF_SIZE, "%s%s", rootfs, src); if (ret < 0) { return -1; } - if (realpath(unresolvedDst, resolvedDst) == NULL && errno != ENOENT) { Logger("cannot canonicalize device dst.", LEVEL_ERROR, SCREEN_YES); return -1; } - if (dstDeviceName != NULL) { ret = sprintf_s(dst, dstBufSize, "%s/dev/%s", rootfs, dstDeviceName); if (ret < 0) { @@ -271,9 +268,9 @@ int DoCtrlDeviceMounting(const char *rootfs) char devmmPath[PATH_MAX] = {0}; char hisiPath[PATH_MAX] = {0}; - if ((sprintf_s(devmmPath, PATH_MAX, "%s/dev/%s", rootfs, DEVMM_SVM) < 0) && - (sprintf_s(hisiPath, PATH_MAX, "%s/dev/%s", rootfs, HISI_HDC) < 0)) { - Logger("failed to assemble path.", LEVEL_ERROR, SCREEN_YES); + if ((sprintf_s(devmmPath, PATH_MAX, "/dev/%s", DEVMM_SVM) < 0) || + (sprintf_s(hisiPath, PATH_MAX, "/dev/%s", HISI_HDC) < 0)) { + Logger("failed to assemble dev path.", LEVEL_ERROR, SCREEN_YES); return -1; } struct stat devStat; // 200 soc 不需要挂载此两个设备 -- Gitee From 5e8d292f65fb84d4f2fa696966a056e9907f3b68 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 16 Mar 2022 10:33:33 +0800 Subject: [PATCH 202/296] Match-id-02b24c548c6d4abff63e646ae39800f983b729ac --- build/scripts/run_main.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 83cf4dc..287b494 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -124,38 +124,66 @@ while true do case "$3" in --install) + if [ "${INSTALL_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi INSTALL_FLAG=y shift ;; --uninstall) + if [ "${UNINSTALL_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi UNINSTALL_FLAG=y shift ;; --install-path=*) + if [ "${INSTALL_PATH_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi INSTALL_PATH_FLAG=y INSTALL_PATH=$(echo $3 | cut -d"=" -f2) INSTALL_PATH=$(echo ${INSTALL_PATH} | sed "s/\/*$//g") shift ;; --upgrade) + if [ "${UPGRADE_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi UPGRADE_FLAG=y shift ;; --devel) + if [ "${DEVEL_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi DEVEL_FLAG=y shift ;; --install-type=*) + if [ "${a500}" == "y" ] || [ "${a200}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi # 去除指定安装目录后所有的 "/" if [ "$3" == "--install-type=A500" ]; then a500=y elif [ "$3" == "--install-type=A200" ]; then a200=y + else + echo "error :Please check the parameter of --install-type=" + exit 1 fi shift ;; *) - break + echo "warning :Unsupported parameters: $3" + exit 1 ;; esac done -- Gitee From 0d48f02c69580fe4bd2803707f0976a1c42b03d3 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 16 Mar 2022 22:18:31 +0800 Subject: [PATCH 203/296] Match-id-c2e92a30407fb00f8a29592f79189b0e2869a8b2 --- build/scripts/run_main.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 287b494..d4439bd 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -182,8 +182,11 @@ do shift ;; *) - echo "warning :Unsupported parameters: $3" - exit 1 + if [ "x$3" != "x" ]; then + echo "warning :Unsupported parameters: $3" + exit 1 + fi + break ;; esac done -- Gitee From 122a990c086bbbfa960a5970b7a0e53acbc334dc Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 22 Mar 2022 13:39:09 +0800 Subject: [PATCH 204/296] Match-id-f8d27baede65c87a2e39c8d1b65ceb31d0ab5db7 --- cli/test/dt_go/build.sh | 45 +++++++++++++ hook/go.mod | 3 + hook/main.go | 14 +++- mindxcheckutils/go.mod | 3 + mindxcheckutils/mindxcheckutils.go | 85 ++++++++++++++++++++++++ mindxcheckutils/mindxcheckutils_test.go | 86 +++++++++++++++++++++++++ runtime/go.mod | 3 + runtime/main.go | 13 +++- runtime/main_test.go | 2 +- 9 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 cli/test/dt_go/build.sh create mode 100644 mindxcheckutils/go.mod create mode 100644 mindxcheckutils/mindxcheckutils.go create mode 100644 mindxcheckutils/mindxcheckutils_test.go diff --git a/cli/test/dt_go/build.sh b/cli/test/dt_go/build.sh new file mode 100644 index 0000000..54704aa --- /dev/null +++ b/cli/test/dt_go/build.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. +set -e +umask 077 +CUR_DIR=$(dirname "$(readlink -f $0)") +TOP_DIR=$(realpath "${CUR_DIR}"/../../..) +RUNTIME_DIR=${TOP_DIR}/CODE/mindxcheckutils +export GOPATH="${TOP_DIR}/CODE/opensource" +export PATH="${GOPATH}/bin/;$PATH" +export GO111MODULE=on +export GONOSUMDB="*" + +function execute_test() { + cd ${RUNTIME_DIR} + go mod tidy + go install github.com/axw/gocov/gocov@v1.0.0 + go install github.com/matm/gocov-html@latest + go install gotest.tools/gotestsum@latest + if ! (go test -mod=mod -gcflags=all=-l -v -race -coverprofile cov.out ${RUNTIME_DIR} >./$file_input); then + echo '****** go test cases error! ******' + exit 1 + else + echo ${file_detail_output} + ${GOPATH}/bin/gocov convert cov.out | ${GOPATH}/bin/gocov-html >${file_detail_output} + ${GOPATH}/bin/gotestsum --junitfile "${TOP_DIR}"/test/unit-tests.xml "${RUNTIME_DIR}"/... + fi +} + +file_input='testDockerPlugin.txt' +file_detail_output="${TOP_DIR}/test/api.html" + +echo "************************************* Start LLT Test *************************************" +mkdir -p "${TOP_DIR}"/test/ +cd "${TOP_DIR}"/test/ +if [ -f "$file_detail_output" ]; then + rm -rf $file_detail_output +fi +if [ -f "$file_input" ]; then + rm -rf $file_input +fi +execute_test + +echo "************************************* End LLT Test *************************************" + +exit 0 diff --git a/hook/go.mod b/hook/go.mod index b2bb8e2..76ebedb 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,4 +5,7 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 github.com/prashantv/gostub v1.1.0 + mindxcheckutils v1.0.0 ) + +replace mindxcheckutils => ../mindxcheckutils diff --git a/hook/main.go b/hook/main.go index c909114..ddd7949 100644 --- a/hook/main.go +++ b/hook/main.go @@ -1,5 +1,5 @@ /** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. * Description: ascend-docker-hook工具,配置容器挂载Ascend NPU设备 */ package main @@ -19,6 +19,8 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" + + "mindxcheckutils" ) const ( @@ -191,6 +193,10 @@ var getContainerConfig = func() (*containerConfig, error) { } configPath := path.Join(state.Bundle, "config.json") + if _, err := mindxcheckutils.FileChecker(configPath, false, false, 0); err != nil { + return nil, err + } + ociSpec, err := parseOciSpecFile(configPath) if err != nil { return nil, fmt.Errorf("failed to parse OCI spec: %v", err) @@ -233,6 +239,9 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { } fileInfo, err := os.Stat(baseConfigFilePath) + if _, err := mindxcheckutils.FileChecker(baseConfigFilePath, false, true, 0); err != nil { + return nil, nil, err + } if err != nil { return nil, nil, fmt.Errorf("cannot stat base configuration file %s : %v", baseConfigFilePath, err) } @@ -337,6 +346,9 @@ func doPrestartHook() error { if _, err = os.Stat(cliPath); err != nil { return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %v", cliPath, err) } + if _, err := mindxcheckutils.FileChecker(cliPath, false, true, 0); err != nil { + return err + } args := append([]string{cliPath}, "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), diff --git a/mindxcheckutils/go.mod b/mindxcheckutils/go.mod new file mode 100644 index 0000000..8012b43 --- /dev/null +++ b/mindxcheckutils/go.mod @@ -0,0 +1,3 @@ +module mindxcheckutils + +go 1.16 diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go new file mode 100644 index 0000000..9c0d129 --- /dev/null +++ b/mindxcheckutils/mindxcheckutils.go @@ -0,0 +1,85 @@ +/** + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + */ + +// Package mindxcheckutils is a check utils package +package mindxcheckutils + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "syscall" +) + +// FileChecker check if a file/dir is safe to use +func FileChecker(path string, allowDir, checkParent bool, deep int) (bool, error) { + const maxDepth, groupWriteIndex, otherWriteIndex, permLength int = 99, 5, 8, 10 + if deep > maxDepth { + return false, fmt.Errorf("over maxDepth %v", maxDepth) + } + if strings.Contains(path, "..") { + return false, fmt.Errorf("err path %v", path) + } + filePath, err := filepath.Abs(path) + if err != nil { + return false, fmt.Errorf("get abs path failed %v", err) + } + fileInfo, ok, err := normalFileCheck(filePath, allowDir) + if err != nil { + return ok, err + } + perm := fileInfo.Mode().Perm().String() + if len(perm) != permLength { + return false, fmt.Errorf("permission not right %v %v", filePath, perm) + } + for index, char := range perm { + switch index { + case groupWriteIndex, otherWriteIndex: + if char == 'w' { + return false, fmt.Errorf("write permission not right %v %v", filePath, perm) + } + default: + } + } + stat, ok := fileInfo.Sys().(*syscall.Stat_t) + if !ok { + return false, fmt.Errorf("can not get stat %v", filePath) + } + uid := int(stat.Uid) + if !(uid == 0 || uid == os.Getuid()) { + return false, fmt.Errorf("owner not right %v %v", filePath, uid) + } + if filePath != "/" && checkParent { + return FileChecker(filepath.Dir(filePath), true, true, deep+1) + } + return true, nil +} + +func normalFileCheck(filePath string, allowDir bool) (os.FileInfo, bool, error) { + realPath, err := filepath.EvalSymlinks(filePath) + if err != nil || realPath != filePath { + return nil, false, fmt.Errorf("symlinks or not existed, failed %v, %v", filePath, err) + } + fileInfo, err := os.Stat(filePath) + if err != nil { + return nil, false, fmt.Errorf("get file stat failed %v", err) + } + if allowDir { + if !fileInfo.Mode().IsRegular() && !fileInfo.IsDir() { + return nil, false, fmt.Errorf("not regular file/dir %v", filePath) + } + } else { + if !fileInfo.Mode().IsRegular() { + return nil, false, fmt.Errorf("not regular file %v", filePath) + } + } + if fileInfo.Mode()&os.ModeSetuid != 0 { + return nil, false, fmt.Errorf("setuid not allowed %v", filePath) + } + if fileInfo.Mode()&os.ModeSetgid != 0 { + return nil, false, fmt.Errorf("setgid not allowed %v", filePath) + } + return fileInfo, false, nil +} diff --git a/mindxcheckutils/mindxcheckutils_test.go b/mindxcheckutils/mindxcheckutils_test.go new file mode 100644 index 0000000..c094904 --- /dev/null +++ b/mindxcheckutils/mindxcheckutils_test.go @@ -0,0 +1,86 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + */ + +// Package mindxcheckutils is a check utils package +package mindxcheckutils + +import ( + "os" + "strings" + "testing" +) + +func TestNormalFileCheckRegularFile(t *testing.T) { + tmpDir, filePath, err := createTestFile(t, "test_file.txt") + defer removeTmpDir(t, tmpDir) + err = os.Symlink(filePath, tmpDir+"/syslink") + if err != nil { + t.Fatalf("create symlink failed %q: %s", filePath, err) + } + + if _, _, err = normalFileCheck(tmpDir, true); err != nil { + t.Fatalf("check allow dir failed %q: %s", tmpDir+"/__test__", err) + } + + if _, _, err = normalFileCheck(tmpDir, false); !strings.Contains(err.Error(), "not regular file") { + t.Fatalf("check not allow dir failed %q: %s", tmpDir+"/__test__", err) + } + + if _, _, err = normalFileCheck("/dev/zero", true); !strings.Contains(err.Error(), "not regular file/dir") { + t.Fatalf("check /dev/zero failed %q: %s", tmpDir+"/__test__", err) + } + + if _, _, err = normalFileCheck(tmpDir+"/syslink", false); !strings.Contains(err.Error(), "symlinks") { + t.Fatalf("check symlinks failed %q: %s", tmpDir+"/syslink", err) + } + + if _, _, err = normalFileCheck(filePath, false); err != nil { + t.Fatalf("check failed %q: %s", filePath, err) + } + + if _, _, err = normalFileCheck(tmpDir+"/notexisted", false); !strings.Contains(err.Error(), "not existed") { + t.Fatalf("check symlinks failed %q: %s", tmpDir+"/syslink", err) + } +} + +func TestFileCheckRegularFile(t *testing.T) { + tmpDir, filePath, err := createTestFile(t, "test_file.txt") + defer removeTmpDir(t, tmpDir) + err = os.Symlink(filePath, tmpDir+"/syslink") + if err != nil { + t.Fatalf("create symlink failed %q: %s", filePath, err) + } + + if _, err = FileChecker(tmpDir, true, false, 0); err != nil { + t.Fatalf("check allow dir failed %q: %s", tmpDir+"/__test__", err) + } + + if _, err = FileChecker(tmpDir, false, false, 0); err != nil && !strings.Contains(err.Error(), "not regular file") { + t.Fatalf("check not allow dir failed %q: %s", tmpDir+"/__test__", err) + } + + if _, err = FileChecker("/dev/zero", true, false, 0); err != nil && + !strings.Contains(err.Error(), "not regular file/dir") { + t.Fatalf("check /dev/zero failed %q: %s", tmpDir+"/__test__", err) + } +} + +func createTestFile(t *testing.T, fileName string) (string, string, error) { + tmpDir := os.TempDir() + const permission os.FileMode = 0700 + if os.MkdirAll(tmpDir+"/__test__", permission) != nil { + t.Fatalf("MkdirAll failed %q", tmpDir+"/__test__") + } + _, err := os.Create(tmpDir + "/__test__" + fileName) + if err != nil { + t.Fatalf("create file failed %q: %s", tmpDir+"/__test__", err) + } + return tmpDir + "/__test__", tmpDir + "/__test__" + fileName, err +} + +func removeTmpDir(t *testing.T, tmpDir string) { + if os.RemoveAll(tmpDir) != nil { + t.Logf("removeall %v", tmpDir) + } +} diff --git a/runtime/go.mod b/runtime/go.mod index b2bb8e2..76ebedb 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -5,4 +5,7 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 github.com/prashantv/gostub v1.1.0 + mindxcheckutils v1.0.0 ) + +replace mindxcheckutils => ../mindxcheckutils diff --git a/runtime/main.go b/runtime/main.go index 8de4875..9740af5 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -1,5 +1,5 @@ /** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. * Description: ascend-docker-runtime工具,配置容器挂载Ascend NPU设备 */ package main @@ -16,6 +16,8 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" + + "mindxcheckutils" ) const ( @@ -63,6 +65,9 @@ var execRunc = func() error { return fmt.Errorf("failed to find the path of runc: %v", err) } } + if _, err := mindxcheckutils.FileChecker(runcPath, false, true, 0); err != nil { + return err + } if err = syscall.Exec(runcPath, append([]string{runcPath}, os.Args[1:]...), os.Environ()); err != nil { return fmt.Errorf("failed to exec runc: %v", err) @@ -78,6 +83,9 @@ func addHook(spec *specs.Spec) error { } hookCliPath = path.Join(path.Dir(currentExecPath), hookCli) + if _, err := mindxcheckutils.FileChecker(hookCliPath, false, true, 0); err != nil { + return err + } if _, err = os.Stat(hookCliPath); err != nil { return fmt.Errorf("cannot find ascend-docker-hook executable file at %s: %v", hookCliPath, err) } @@ -106,6 +114,9 @@ func modifySpecFile(path string) error { if err != nil { return fmt.Errorf("spec file doesnt exist %s: %v", path, err) } + if _, err := mindxcheckutils.FileChecker(path, false, true, 0); err != nil { + return err + } jsonFile, err := os.OpenFile(path, os.O_RDWR, stat.Mode()) if err != nil { diff --git a/runtime/main_test.go b/runtime/main_test.go index e857617..d106bf4 100644 --- a/runtime/main_test.go +++ b/runtime/main_test.go @@ -199,4 +199,4 @@ func TestExecRunc(t *testing.T) { if err := execRunc(); err != nil { } -} \ No newline at end of file +} -- Gitee From df0c1e6e5cd23f324459324100bf9268387677d4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 29 Mar 2022 10:32:02 +0800 Subject: [PATCH 205/296] Match-id-6fb87fa38cc6165cd4c316ac8aca1756ca8db8c3 --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 6de020e..0bbb85a 100644 --- a/build/build.sh +++ b/build/build.sh @@ -61,7 +61,7 @@ function build_bin() export GONOSUMDB="*" echo "make hook" - go mod tidy + go mod download [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build export CGO_ENABLED=1 @@ -74,7 +74,7 @@ function build_bin() ls echo "make runtime" - go mod tidy + go mod download cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build -- Gitee From cdbf958c5b85569e6341fc022d54b8dfe92ad4dd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Mar 2022 17:11:41 +0800 Subject: [PATCH 206/296] Match-id-0354e63b9bb8c86b7d8b9f14eba3884b6a7da21c --- cli/src/basic.h | 1 + cli/src/main.c | 114 ++++++++++++++++++++++-- cli/src/u_mount.c | 3 +- cli/src/utils.c | 21 +++-- cli/src/utils.h | 1 + cli/test/dt/testcase/gtest_mytest.cpp | 15 ---- hook/main.go | 6 +- install/deb/src/main.c | 21 +++-- mindxcheckutils/mindxcheckutils.go | 13 ++- mindxcheckutils/mindxcheckutils_test.go | 24 ++--- runtime/main.go | 6 +- 11 files changed, 165 insertions(+), 60 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index f048398..afdfd94 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -21,6 +21,7 @@ #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 +#define WHITE_LIST_NUM 4 #define ROOT_UID 0 diff --git a/cli/src/main.c b/cli/src/main.c index 5b1b953..671ec6b 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "securec.h" #include "basic.h" @@ -51,6 +52,12 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } + for (size_t iLoop = 0; iLoop < strlen(arg); iLoop++) { + if ((isdigit(arg[iLoop]) == 0) && (arg[iLoop] != ',')) { + Logger("failed to check devices.", LEVEL_ERROR, SCREEN_YES); + return false; + } + } errno_t err = strcpy_s(args->devices, BUF_SIZE, arg); if (err != EOK) { @@ -63,27 +70,71 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) { + char buff[PATH_MAX] = {0}; + if (args == NULL || arg == NULL) { Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } - errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); + const char* pidMax = "/proc/sys/kernel/pid_max"; + const size_t maxFileSzieMb = 10; // max 10MB + if (!CheckExternalFile(pidMax, strlen(pidMax), maxFileSzieMb, true)) { + Logger("failed to check pid_max path.", LEVEL_ERROR, SCREEN_YES); + return false; + } + FILE* pFile = NULL; + pFile = fopen(pidMax, "r"); + if ((pFile == NULL) || (fgets(buff, PATH_MAX, pFile) == NULL)) { + Logger("failed to get pid_max buff.", LEVEL_ERROR, SCREEN_YES); + return false; + } + (void)fclose(pFile); + if ((strlen(buff) > 0) && (buff[strlen(buff) -1] == '\n')) { + buff[strlen(buff) -1] = '\0'; + } + for (size_t iLoop = 0; iLoop < strlen(buff); iLoop++) { + if (isdigit(buff[iLoop]) == 0) { + Logger("failed to get pid_max value.", LEVEL_ERROR, SCREEN_YES); + return false; + } + } + if ((args->pid < 0) || (args->pid >= strtol(buff, NULL, DECIMAL))) { + Logger("The PID out of bounds.", LEVEL_ERROR, SCREEN_YES); + return false; + } if (errno != 0) { char* str = FormatLogMessage("failed to convert pid string from cmd args, pid string: %s.", arg); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); return false; } + return true; +} - if (args->pid <= 0) { - char* str = FormatLogMessage("invalid pid %d.", args->pid); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); +static bool CheckFileLegality(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb) +{ + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + Logger("filePathLen out of bounds!", LEVEL_ERROR, SCREEN_YES); + return false; + } + for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { + if (!IsValidChar(filePath[iLoop])) { // 非法字符 + Logger("filePath has an illegal character!", LEVEL_ERROR, SCREEN_YES); + return false; + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + Logger("realpath failed!", LEVEL_ERROR, SCREEN_YES); + return false; + } + if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + Logger("filePath has a soft link!", LEVEL_ERROR, SCREEN_YES); return false; } - return true; } @@ -99,6 +150,11 @@ static bool RootfsCmdArgParser(struct CmdArgs *args, const char *arg) Logger("failed to get rootfs path from cmd args", LEVEL_ERROR, SCREEN_YES); return false; } + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckFileLegality(args->rootfs, strlen(args->rootfs), maxFileSzieMb)) { + Logger("failed to check rootf.", LEVEL_ERROR, SCREEN_YES); + return false; + } return true; } @@ -116,6 +172,35 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) return false; } + if ((strcmp(args->options, "NODRV,VIRTUAL") != 0) && + (strcmp(args->options, "NODRV") != 0) && + (strcmp(args->options, "VIRTUAL") != 0)) { + Logger("Whitelist check failed.", LEVEL_ERROR, SCREEN_YES); + return false; + } + + return true; +} + +static bool CheckWhiteList(const char* fileName) +{ + bool fileExists = false; + const char mountWhiteList[WHITE_LIST_NUM][PATH_MAX] = {{"/usr/local/Ascend/driver/lib64"}, + {"/usr/local/Ascend/driver/include"}, + {"/usr/local/dcmi"}, + {"/usr/local/bin/npu-smi"}}; + + for (size_t iLoop = 0; iLoop < WHITE_LIST_NUM; iLoop++) { + if (strcmp(mountWhiteList[iLoop], fileName) == 0) { + fileExists = true; + } + } + if (!fileExists) { + char* str = FormatLogMessage("failed to check whiteList value: %s.", fileName); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); + return false; + } return true; } @@ -142,7 +227,15 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) return false; } - return true; + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckFileLegality(dst, strlen(dst), maxFileSzieMb)) { + char* str = FormatLogMessage("failed to check files: %s", dst); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); + return false; + } + + return CheckWhiteList(dst) ? true : false; } static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) @@ -167,8 +260,13 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) free(str); return false; } + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckFileLegality(dst, strlen(dst), maxFileSzieMb)) { + Logger("failed to check dir.", LEVEL_ERROR, SCREEN_YES); + return false; + } - return true; + return CheckWhiteList(dst) ? true : false; } #define NUM_OF_CMD_ARGS 6 diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 090ca85..d4c1ccb 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -31,10 +31,9 @@ int Mount(const char *src, const char *dst) ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 const size_t maxFileSzieMb = 10 * 1024; // max 10 G if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { - char* str = FormatLogMessage("failed to mount src hehe:%s.", src); + char* str = FormatLogMessage("failed to Check src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - Logger("failed to Check src.", LEVEL_ERROR, SCREEN_YES); return -1; } } diff --git a/cli/src/utils.c b/cli/src/utils.c index 8cb8a1d..67ddc9e 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -222,20 +222,31 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen } return true; } - + +bool IsValidChar(const char c) +{ + if (isalnum(c) != 0) { + return true; + } + // ._-/~为合法字符 + if ((c == '.') || (c == '_') || + (c == '-') || (c == '/') || (c == '~')) { + return true; + } + return false; +} + bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { - int iLoop; if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } if (strstr(filePath, "..") != NULL) { // 存在".." return ShowExceptionInfo("filePath has an illegal character!"); } - for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && - (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { + if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } diff --git a/cli/src/utils.h b/cli/src/utils.h index 7c803ca..88e195b 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -22,6 +22,7 @@ int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); int MakeDirWithParent(const char *path, mode_t mode); int MakeMountPoints(const char *path, mode_t mode); +bool IsValidChar(const char c); bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner); diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 0fab616..71e1404 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -841,21 +841,6 @@ TEST(SetupCgroup, StatusThree) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, StatusFour) -{ - MOCKER(SetupDriverCgroup).stubs().will(invoke(Stub_SetupDriverCgroup_Success)); - MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); - struct ParsedConfig config; - (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); - config.devices[0] = 1; - config.devices[1] = 2; - config.devicesNr = 2; - (void)strcpy_s(config.cgroupPath, sizeof(config.cgroupPath), "devices.allow"); - int ret = SetupCgroup(&config); - GlobalMockObject::verify(); - EXPECT_EQ(0, ret); -} - TEST(SetupContainer, StatusOne) { struct CmdArgs args; diff --git a/hook/main.go b/hook/main.go index ddd7949..b5f63cf 100644 --- a/hook/main.go +++ b/hook/main.go @@ -193,7 +193,7 @@ var getContainerConfig = func() (*containerConfig, error) { } configPath := path.Join(state.Bundle, "config.json") - if _, err := mindxcheckutils.FileChecker(configPath, false, false, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(configPath, false, false, true, 0); err != nil { return nil, err } @@ -239,7 +239,7 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { } fileInfo, err := os.Stat(baseConfigFilePath) - if _, err := mindxcheckutils.FileChecker(baseConfigFilePath, false, true, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(baseConfigFilePath, false, true, false, 0); err != nil { return nil, nil, err } if err != nil { @@ -346,7 +346,7 @@ func doPrestartHook() error { if _, err = os.Stat(cliPath); err != nil { return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %v", cliPath, err) } - if _, err := mindxcheckutils.FileChecker(cliPath, false, true, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(cliPath, false, true, false, 0); err != nil { return err } diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 7a703fd..7375f91 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -325,20 +325,31 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen } return true; } - + +static bool IsValidChar(const char c) +{ + if (isalnum(c) != 0) { + return true; + } + // ._-/~为合法字符 + if ((c == '.') || (c == '_') || + (c == '-') || (c == '/') || (c == '~')) { + return true; + } + return false; +} + static bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { - int iLoop; if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } if (strstr(filePath, "..") != NULL) { // 存在".." return ShowExceptionInfo("filePath has an illegal character!"); } - for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && - (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { + if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go index 9c0d129..3d550e1 100644 --- a/mindxcheckutils/mindxcheckutils.go +++ b/mindxcheckutils/mindxcheckutils.go @@ -1,8 +1,7 @@ +// Package mindxcheckutils is a check utils package /** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. */ - -// Package mindxcheckutils is a check utils package package mindxcheckutils import ( @@ -14,7 +13,7 @@ import ( ) // FileChecker check if a file/dir is safe to use -func FileChecker(path string, allowDir, checkParent bool, deep int) (bool, error) { +func FileChecker(path string, allowDir, checkParent, allowLink bool, deep int) (bool, error) { const maxDepth, groupWriteIndex, otherWriteIndex, permLength int = 99, 5, 8, 10 if deep > maxDepth { return false, fmt.Errorf("over maxDepth %v", maxDepth) @@ -26,7 +25,7 @@ func FileChecker(path string, allowDir, checkParent bool, deep int) (bool, error if err != nil { return false, fmt.Errorf("get abs path failed %v", err) } - fileInfo, ok, err := normalFileCheck(filePath, allowDir) + fileInfo, ok, err := normalFileCheck(filePath, allowDir, allowLink) if err != nil { return ok, err } @@ -52,14 +51,14 @@ func FileChecker(path string, allowDir, checkParent bool, deep int) (bool, error return false, fmt.Errorf("owner not right %v %v", filePath, uid) } if filePath != "/" && checkParent { - return FileChecker(filepath.Dir(filePath), true, true, deep+1) + return FileChecker(filepath.Dir(filePath), true, true, allowLink, deep+1) } return true, nil } -func normalFileCheck(filePath string, allowDir bool) (os.FileInfo, bool, error) { +func normalFileCheck(filePath string, allowDir bool, allowLink bool) (os.FileInfo, bool, error) { realPath, err := filepath.EvalSymlinks(filePath) - if err != nil || realPath != filePath { + if err != nil || (realPath != filePath && !allowLink) { return nil, false, fmt.Errorf("symlinks or not existed, failed %v, %v", filePath, err) } fileInfo, err := os.Stat(filePath) diff --git a/mindxcheckutils/mindxcheckutils_test.go b/mindxcheckutils/mindxcheckutils_test.go index c094904..0a6711e 100644 --- a/mindxcheckutils/mindxcheckutils_test.go +++ b/mindxcheckutils/mindxcheckutils_test.go @@ -1,8 +1,7 @@ -/* +// Package mindxcheckutils is a check utils package +/** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. */ - -// Package mindxcheckutils is a check utils package package mindxcheckutils import ( @@ -19,27 +18,27 @@ func TestNormalFileCheckRegularFile(t *testing.T) { t.Fatalf("create symlink failed %q: %s", filePath, err) } - if _, _, err = normalFileCheck(tmpDir, true); err != nil { + if _, _, err = normalFileCheck(tmpDir, true, false); err != nil { t.Fatalf("check allow dir failed %q: %s", tmpDir+"/__test__", err) } - if _, _, err = normalFileCheck(tmpDir, false); !strings.Contains(err.Error(), "not regular file") { + if _, _, err = normalFileCheck(tmpDir, false, false); !strings.Contains(err.Error(), "not regular file") { t.Fatalf("check not allow dir failed %q: %s", tmpDir+"/__test__", err) } - if _, _, err = normalFileCheck("/dev/zero", true); !strings.Contains(err.Error(), "not regular file/dir") { + if _, _, err = normalFileCheck("/dev/zero", true, false); !strings.Contains(err.Error(), "not regular file/dir") { t.Fatalf("check /dev/zero failed %q: %s", tmpDir+"/__test__", err) } - if _, _, err = normalFileCheck(tmpDir+"/syslink", false); !strings.Contains(err.Error(), "symlinks") { + if _, _, err = normalFileCheck(tmpDir+"/syslink", false, false); !strings.Contains(err.Error(), "symlinks") { t.Fatalf("check symlinks failed %q: %s", tmpDir+"/syslink", err) } - if _, _, err = normalFileCheck(filePath, false); err != nil { + if _, _, err = normalFileCheck(filePath, false, false); err != nil { t.Fatalf("check failed %q: %s", filePath, err) } - if _, _, err = normalFileCheck(tmpDir+"/notexisted", false); !strings.Contains(err.Error(), "not existed") { + if _, _, err = normalFileCheck(tmpDir+"/notexisted", false, false); !strings.Contains(err.Error(), "not existed") { t.Fatalf("check symlinks failed %q: %s", tmpDir+"/syslink", err) } } @@ -52,15 +51,16 @@ func TestFileCheckRegularFile(t *testing.T) { t.Fatalf("create symlink failed %q: %s", filePath, err) } - if _, err = FileChecker(tmpDir, true, false, 0); err != nil { + if _, err = FileChecker(tmpDir, true, false, false, 0); err != nil { t.Fatalf("check allow dir failed %q: %s", tmpDir+"/__test__", err) } - if _, err = FileChecker(tmpDir, false, false, 0); err != nil && !strings.Contains(err.Error(), "not regular file") { + if _, err = FileChecker(tmpDir, false, false, false, 0); err != nil && + !strings.Contains(err.Error(), "not regular file") { t.Fatalf("check not allow dir failed %q: %s", tmpDir+"/__test__", err) } - if _, err = FileChecker("/dev/zero", true, false, 0); err != nil && + if _, err = FileChecker("/dev/zero", true, false, false, 0); err != nil && !strings.Contains(err.Error(), "not regular file/dir") { t.Fatalf("check /dev/zero failed %q: %s", tmpDir+"/__test__", err) } diff --git a/runtime/main.go b/runtime/main.go index 9740af5..17cf47c 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -65,7 +65,7 @@ var execRunc = func() error { return fmt.Errorf("failed to find the path of runc: %v", err) } } - if _, err := mindxcheckutils.FileChecker(runcPath, false, true, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(runcPath, false, true, false, 0); err != nil { return err } @@ -83,7 +83,7 @@ func addHook(spec *specs.Spec) error { } hookCliPath = path.Join(path.Dir(currentExecPath), hookCli) - if _, err := mindxcheckutils.FileChecker(hookCliPath, false, true, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(hookCliPath, false, true, false, 0); err != nil { return err } if _, err = os.Stat(hookCliPath); err != nil { @@ -114,7 +114,7 @@ func modifySpecFile(path string) error { if err != nil { return fmt.Errorf("spec file doesnt exist %s: %v", path, err) } - if _, err := mindxcheckutils.FileChecker(path, false, true, 0); err != nil { + if _, err := mindxcheckutils.FileChecker(path, false, true, true, 0); err != nil { return err } -- Gitee From bf76614a710998a398e7412cf859f23de16dcc7c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 18 Mar 2022 18:41:04 +0800 Subject: [PATCH 207/296] Match-id-5c716d76e688a3a1318647816ea6aa5016092cf1 --- hook/go.mod | 2 +- hook/go.sum | 4 +- runtime/dcmi/dcmi.go | 357 ++++++++++ runtime/dcmi/dcmi_interface_api.h | 1094 +++++++++++++++++++++++++++++ runtime/go.mod | 2 +- runtime/go.sum | 4 +- runtime/main.go | 69 +- 7 files changed, 1516 insertions(+), 16 deletions(-) create mode 100644 runtime/dcmi/dcmi.go create mode 100644 runtime/dcmi/dcmi_interface_api.h diff --git a/hook/go.mod b/hook/go.mod index b2bb8e2..5caee26 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -3,6 +3,6 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 ) diff --git a/hook/go.sum b/hook/go.sum index f87c1c7..9345f6a 100644 --- a/hook/go.sum +++ b/hook/go.sum @@ -1,7 +1,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 h1:9mv9SC7GWmRWE0J/+oD8w3GsN2KYGKtg6uwLN7hfP5E= -github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go new file mode 100644 index 0000000..640429b --- /dev/null +++ b/runtime/dcmi/dcmi.go @@ -0,0 +1,357 @@ +// Package dcmi is used to work with Ascend devices +/* + * Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. + */ +package dcmi + +// #cgo LDFLAGS: -ldl +/* #include + #include + #include + #include + + #include "dcmi_interface_api.h" + + void *dcmiHandle; + #define SO_NOT_FOUND -99999 + #define FUNCTION_NOT_FOUND -99998 + #define SUCCESS 0 + #define ERROR_UNKNOWN -99997 + #define CALL_FUNC(name,...) if(name##_func==NULL){return FUNCTION_NOT_FOUND;}return name##_func(__VA_ARGS__); + + // dcmi + int (*dcmi_init_func)(); + int dcmi_init(){ + CALL_FUNC(dcmi_init) + } + + int (*dcmi_get_card_num_list_func)(int *card_num, int *card_list, int list_length); + int dcmi_get_card_num_list(int *card_num, int *card_list, int list_length){ + CALL_FUNC(dcmi_get_card_num_list,card_num,card_list,list_length) + } + + int (*dcmi_get_device_num_in_card_func)(int card_id, int *device_num); + int dcmi_get_device_num_in_card(int card_id, int *device_num){ + CALL_FUNC(dcmi_get_device_num_in_card,card_id,device_num) + } + + int (*dcmi_get_device_id_in_card_func)(int card_id, int *device_id_max, int *mcu_id, int *cpu_id); + int dcmi_get_device_id_in_card(int card_id, int *device_id_max, int *mcu_id, int *cpu_id){ + CALL_FUNC(dcmi_get_device_id_in_card,card_id,device_id_max,mcu_id,cpu_id) + } + + int (*dcmi_get_device_logic_id_func)(int *device_logic_id, int card_id, int device_id); + int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id){ + CALL_FUNC(dcmi_get_device_logic_id,device_logic_id,card_id,device_id) + } + + int (*dcmi_set_create_vdevice_func)(int card_id, int device_id, struct dcmi_vdev_create_info *info); + int dcmi_set_create_vdevice(int card_id, int device_id, struct dcmi_vdev_create_info *info){ + CALL_FUNC(dcmi_set_create_vdevice,card_id,device_id,info) + } + + int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); + int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int VDevid){ + CALL_FUNC(dcmi_set_destroy_vdevice,card_id,device_id,VDevid) + } + + int (*dcmi_get_vdevice_info_func)(int card_id, int device_id, struct dcmi_vdev_info *info); + int dcmi_get_vdevice_info(int card_id, int device_id, struct dcmi_vdev_info *info){ + CALL_FUNC(dcmi_get_vdevice_info,card_id,device_id,info) + } + + int (*dcmi_get_device_health_func)(int card_id, int device_id, unsigned int *health); + int dcmi_get_device_health(int card_id, int device_id, unsigned int *health){ + CALL_FUNC(dcmi_get_device_health,card_id,device_id,health) + } + + int (*dcmi_get_device_chip_info_func)(int card_id, int device_id, struct dcmi_chip_info *chip_info); + int dcmi_get_device_chip_info(int card_id, int device_id, struct dcmi_chip_info *chip_info){ + CALL_FUNC(dcmi_get_device_chip_info,card_id,device_id,chip_info) + } + + int (*dcmi_create_vdevice_func)(int card_id, int device_id, int vdev_id, const char *template_name, + struct dcmi_create_vdev_out *out); + int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, + struct dcmi_create_vdev_out *out){ + CALL_FUNC(dcmi_create_vdevice,card_id,device_id,vdev_id,template_name,out) + } + + // load .so files and functions + int dcmiInit_dl(void){ + dcmiHandle = dlopen("libdcmi.so",RTLD_LAZY | RTLD_GLOBAL); + if (dcmiHandle == NULL){ + fprintf (stderr,"%s\n",dlerror()); + return SO_NOT_FOUND; + } + + dcmi_init_func = dlsym(dcmiHandle,"dcmi_init"); + + dcmi_get_card_num_list_func = dlsym(dcmiHandle,"dcmi_get_card_num_list"); + + dcmi_get_device_num_in_card_func = dlsym(dcmiHandle,"dcmi_get_device_num_in_card"); + + dcmi_get_device_id_in_card_func = dlsym(dcmiHandle,"dcmi_get_device_id_in_card"); + + dcmi_get_device_logic_id_func = dlsym(dcmiHandle,"dcmi_get_device_logic_id"); + + dcmi_set_create_vdevice_func = dlsym(dcmiHandle,"dcmi_set_create_vdevice"); + + dcmi_set_destroy_vdevice_func = dlsym(dcmiHandle,"dcmi_set_destroy_vdevice"); + + dcmi_get_vdevice_info_func = dlsym(dcmiHandle,"dcmi_get_vdevice_info"); + + dcmi_get_device_health_func = dlsym(dcmiHandle,"dcmi_get_device_health"); + + dcmi_get_device_chip_info_func = dlsym(dcmiHandle,"dcmi_get_device_chip_info"); + + dcmi_create_vdevice_func = dlsym(dcmiHandle,"dcmi_create_vdevice"); + + return SUCCESS; + } + + int dcmiShutDown(void){ + if (dcmiHandle == NULL) { + return SUCCESS; + } + return (dlclose(dcmiHandle) ? ERROR_UNKNOWN : SUCCESS); + } + + int (*dsmi_get_logicid_from_phyid_func)(unsigned int phyid, unsigned int *logicid); + int dsmi_get_logicid_from_phyid(unsigned int phyid, unsigned int *logicid){ + CALL_FUNC(dsmi_get_logicid_from_phyid,phyid,logicid) + } + void *dsmiHandle; + int dsmiInit_dl(void){ + dsmiHandle = dlopen("libdrvdsmi_host.so",RTLD_LAZY); + if (dsmiHandle == NULL) { + dsmiHandle = dlopen("libdrvdsmi.so",RTLD_LAZY); + } + if (dsmiHandle == NULL){ + return SO_NOT_FOUND; + } + + dsmi_get_logicid_from_phyid_func = dlsym(dsmiHandle,"dsmi_get_logicid_from_phyid"); + + return SUCCESS; +} + +int dsmiShutDown(void){ + if (dsmiHandle == NULL) { + return SUCCESS; + } + return (dlclose(dsmiHandle) ? ERROR_UNKNOWN : SUCCESS); +} +*/ +import "C" +import ( + "fmt" + "math" + "strconv" + "strings" + "unsafe" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +const ( + // RetError return error when the function failed + retError = -1 + + // dcmiMaxVdevNum is max number of vdevice, value is from driver specification + dcmiMaxVdevNum = 16 + + // maxErrorCodeCount is the max number of error code + hiAIMaxCardNum = 16 +) + +// VDeviceInfo vdevice created info +type VDeviceInfo struct { + CardID int32 + DeviceID int32 + VdeviceID int32 +} + +// InitDcmi dcmi/dsmi lib +func InitDcmi() error { + if err := C.dcmiInit_dl(); err != C.SUCCESS { + errInfo := fmt.Errorf("dcmi lib load failed, , error code: %d", int32(err)) + return errInfo + } + if err := C.dcmi_init(); err != C.SUCCESS { + errInfo := fmt.Errorf("dcmi init failed, , error code: %d", int32(err)) + return errInfo + } + if err := C.dsmiInit_dl(); err != C.SUCCESS { + errInfo := fmt.Errorf("dsmi lib load failed, , error code: %d", int32(err)) + return errInfo + } + return nil +} + +// ShutDownDcmi shutdown dcmi/dsmi lib +func ShutDownDcmi() { + if err := C.dcmiShutDown(); err != C.SUCCESS { + println(fmt.Errorf("dcmi shut down failed, error code: %d", int32(err))) + } + if err := C.dsmiShutDown(); err != C.SUCCESS { + println(fmt.Errorf("dsmi shut down failed, error code: %d", int32(err))) + } +} + +func getCardList() (int32, []int32, error) { + var ids [hiAIMaxCardNum]C.int + var cNum C.int + if err := C.dcmi_get_card_num_list(&cNum, &ids[0], hiAIMaxCardNum); err != 0 { + errInfo := fmt.Errorf("get card list failed, error code: %d", int32(err)) + return retError, nil, errInfo + } + // checking card's quantity + if cNum <= 0 { + errInfo := fmt.Errorf("get error card quantity: %d", int32(cNum)) + return retError, nil, errInfo + } + var cardNum = int32(cNum) + var i int32 + var cardIDList []int32 + for i = 0; i < cardNum && i < hiAIMaxCardNum; i++ { + cardID := int32(ids[i]) + if cardID < 0 { + continue + } + cardIDList = append(cardIDList, cardID) + } + return cardNum, cardIDList, nil +} + +// GetDeviceNumInCard get device number in the npu card +func GetDeviceNumInCard(cardID int32) (int32, error) { + var deviceNum C.int + if err := C.dcmi_get_device_num_in_card(C.int(cardID), &deviceNum); err != 0 { + errInfo := fmt.Errorf("get device count on the card failed, error code: %d", int32(err)) + return retError, errInfo + } + if deviceNum <= 0 { + errInfo := fmt.Errorf("the number of chips obtained is invalid, the number is: %d", int32(deviceNum)) + return retError, errInfo + } + return int32(deviceNum), nil +} + +// GetDeviceLogicID get device logicID +func GetDeviceLogicID(cardID, deviceID int32) (int32, error) { + var logicID C.int + if err := C.dcmi_get_device_logic_id(&logicID, C.int(cardID), C.int(deviceID)); err != 0 { + errInfo := fmt.Errorf("get logicID failed, error code: %d", int32(err)) + return retError, errInfo + } + + // check whether phyID is too big + if logicID < 0 || uint32(logicID) > uint32(math.MaxInt8) { + errInfo := fmt.Errorf("the logicID value is invalid, logicID is: %d", logicID) + return retError, errInfo + } + return int32(logicID), nil +} + +// SetCreateVDevice create virtual device +func SetCreateVDevice(cardID, deviceID int32, coreNum string) (uint32, error) { + var createInfo C.struct_dcmi_create_vdev_out + createInfo.vdev_id = C.uint(math.MaxUint32) + coreTemplate := C.CString(coreNum) + defer C.free(unsafe.Pointer(coreTemplate)) + err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), C.int(0), coreTemplate, &createInfo) + if err != 0 { + errInfo := fmt.Errorf("create virtual device failed, error code: %d", int32(err)) + return uint32(math.MaxUint32), errInfo + } + println("vdevId", createInfo.vdev_id) + return uint32(createInfo.vdev_id), nil +} + +// SetDestroyVDevice destroy virtual device +func SetDestroyVDevice(cardID, deviceID int32, vDevID uint32) error { + if err := C.dcmi_set_destroy_vdevice(C.int(cardID), C.int(deviceID), C.uint(vDevID)); err != 0 { + errInfo := fmt.Errorf("destroy virtual device failed, error code: %d", int32(err)) + return errInfo + } + return nil +} + +// CreateVDevice will create virtual device +func CreateVDevice(spec *specs.Spec) (VDeviceInfo, error) { + visibleDevice, splitDevice, err := extractVpuParam(spec) + invalidVDevice := VDeviceInfo{CardID: -1, DeviceID: -1, VdeviceID: -1} + if err != nil || visibleDevice == -1 { + return invalidVDevice, err + } + if err := InitDcmi(); err != nil { + return invalidVDevice, fmt.Errorf("cannot init dcmi : %v", err) + } + defer ShutDownDcmi() + var dsmiLogicID C.uint + if err := C.dsmi_get_logicid_from_phyid(C.uint(visibleDevice), &dsmiLogicID); err != 0 { + return invalidVDevice, fmt.Errorf("phy id can not be converted to logic id : %v", err) + } + _, cardList, err := getCardList() + targetDeviceID, targetCardID := int32(math.MaxInt32), int32(math.MaxInt32) + for _, cardID := range cardList { + deviceCount, err := GetDeviceNumInCard(cardID) + if err != nil { + return invalidVDevice, fmt.Errorf("cannot get device num in card : %v", err) + } + for deviceID := int32(0); deviceID < deviceCount; deviceID++ { + logicID, err := GetDeviceLogicID(cardID, deviceID) + println(cardID, deviceID, logicID, dsmiLogicID) + if err != nil { + return invalidVDevice, fmt.Errorf("cannot get logic id : %v", err) + } + if logicID == int32(dsmiLogicID) { + targetCardID, targetDeviceID = cardID, deviceID + } + } + } + + vdeviceID, err := SetCreateVDevice(targetCardID, targetDeviceID, splitDevice) + if err != nil || int(vdeviceID) < 0 { + return invalidVDevice, fmt.Errorf("cannot create vd or vdevice is wrong: %v %v", vdeviceID, err) + } + fmt.Printf("%v", VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}) + return VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}, nil +} + +func extractVpuParam(spec *specs.Spec) (int32, string, error) { + visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" + allowSplit := map[string]string{ + "1C": "vir01", "2C": "vir02", "4C": "vir04", "8C": "vir08", "16C": "vir16", + } + + for _, line := range spec.Process.Env { + words := strings.Split(line, "=") + const LENGTH int = 2 + if len(words) != LENGTH { + continue + } + if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { + visibleDeviceLine = words[1] + } + if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_VPU_DEVICES" { + if split := allowSplit[words[1]]; split != "" { + splitDevice = split + needSplit = true + } else { + return -1, "", fmt.Errorf("cannot parse param : %v", words[1]) + } + } + } + if needSplit { + if cardID, err := strconv.Atoi(visibleDeviceLine); err == nil { + visibleDevice = int32(cardID) + } else { + return -1, "", fmt.Errorf("cannot parse param : %v %v", err, visibleDeviceLine) + } + } else { + return -1, "", nil + } + return visibleDevice, splitDevice, nil +} diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h new file mode 100644 index 0000000..6e994b0 --- /dev/null +++ b/runtime/dcmi/dcmi_interface_api.h @@ -0,0 +1,1094 @@ +/* + * Copyright: Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. + * Author: d00583127 + * Date: 2021-03-17 17:46:08 + * @LastEditors: Hu Haoran h00584933 + * @LastEditTime: 2021-07-10 20:13:31 + * Description: DCMI API Reference + */ + +/********************************************************************************/ + +#ifndef __DCMI_INTERFACE_API_H__ +#define __DCMI_INTERFACE_API_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif /* __cplusplus */ + +#ifdef __linux +#define DCMIDLLEXPORT +#else +#define DCMIDLLEXPORT _declspec(dllexport) +#endif + +#define MAX_VER_LEN 255 // Maximum length of version string + +#define MAX_CARD_NUM 64 // The system supports up to 64 cards + +#define MAX_CHIP_NAME_LEN 32 // Maximum length of chip name + +#define MAX_LENTH 256 // Maximum length of string + +#define DIE_ID_COUNT 5 // Number of die ID characters + +#define MAX_CORE_NUM 16 // Maximum AI CPU + +#define DCMI_SENSOR_DATA_MAX_LEN 16 + +#define DCMI_SENSOR_TEMP_LEN 2 + +#define DCMI_SENSOR_NTC_TEMP_LEN 4 + +#define DCMI_COMPUTE_GROUP_INFO_RES_NUM 8 + +#define DCMI_MAX_VDEV_NUM 16 // max number a device can spilts +#define DCMI_MAX_SPEC_RESERVE 8 + +/*----------------------------------------------* + * Structure description * + *----------------------------------------------*/ +struct dcmi_chip_info { + unsigned char chip_type[MAX_CHIP_NAME_LEN]; + unsigned char chip_name[MAX_CHIP_NAME_LEN]; + unsigned char chip_ver[MAX_CHIP_NAME_LEN]; + unsigned int aicore_cnt; +}; + +struct dcmi_pcie_info { + unsigned int deviceid; + unsigned int venderid; + unsigned int subvenderid; + unsigned int subdeviceid; + unsigned int bdf_deviceid; + unsigned int bdf_busid; + unsigned int bdf_funcid; +}; + +struct dcmi_pcie_info_all { + unsigned int venderid; /* 厂商id */ + unsigned int subvenderid; /* 厂商子id */ + unsigned int deviceid; /* 设备id */ + unsigned int subdeviceid; /* 设备子id */ + int domain; /* pcie domain */ + unsigned int bdf_busid; + unsigned int bdf_deviceid; + unsigned int bdf_funcid; + unsigned char reserve[32]; /* the size of dcmi_pcie_info_all is 64 */ +}; + +struct dcmi_board_info { + unsigned int board_id; + unsigned int pcb_id; + unsigned int bom_id; + unsigned int slot_id; +}; + +struct dcmi_elabel_info { + char product_name[MAX_LENTH]; + char model[MAX_LENTH]; + char manufacturer[MAX_LENTH]; + char manufacturer_date[MAX_LENTH]; + char serial_number[MAX_LENTH]; +}; + +struct dcmi_die_id { + unsigned int soc_die[DIE_ID_COUNT]; +}; + +struct dcmi_aicore_info { + unsigned int freq; + unsigned int cur_freq; +}; + +struct dcmi_aicpu_info { + unsigned int max_freq; + unsigned int cur_freq; + unsigned int aicpu_num; + unsigned int util_rate[MAX_CORE_NUM]; +}; + +struct dcmi_flash_info { + unsigned long long flash_id; + unsigned short device_id; + unsigned short vendor; + unsigned int state; + unsigned long long size; + unsigned int sector_count; + unsigned short manufacturer_id; +}; + +struct dcmi_chip_pcie_err_rate { + unsigned int reg_deskew_fifo_overflow_intr_status; + unsigned int reg_symbol_unlock_intr_status; + unsigned int reg_deskew_unlock_intr_status; + unsigned int reg_phystatus_timeout_intr_status; + unsigned int symbol_unlock_counter; + unsigned int pcs_rx_err_cnt; + unsigned int phy_lane_err_counter; + unsigned int pcs_rcv_err_status; + unsigned int symbol_unlock_err_status; + unsigned int phy_lane_err_status; + unsigned int dl_lcrc_err_num; + unsigned int dl_dcrc_err_num; +}; + +struct dcmi_ecc_info { + int enable_flag; + unsigned int single_bit_error_cnt; + unsigned int double_bit_error_cnt; + unsigned int total_single_bit_error_cnt; + unsigned int total_double_bit_error_cnt; + unsigned int single_bit_isolated_pages_cnt; + unsigned int double_bit_isolated_pages_cnt; +}; + +struct dcmi_hbm_info { + unsigned long long memory_size; + unsigned int freq; + unsigned long long memory_usage; + int temp; + unsigned int bandwith_util_rate; +}; + +struct dcmi_memory_info { + unsigned long long memory_size; /* unit:MB */ + unsigned int freq; + unsigned int utiliza; +}; + +struct dcmi_get_memory_info_stru { + unsigned long long memory_size; /* unit:MB */ + unsigned long long memory_available; /* free + hugepages_free * hugepagesize */ + unsigned int freq; + unsigned long hugepagesize; /* unit:KB */ + unsigned long hugepages_total; + unsigned long hugepages_free; + unsigned int utiliza; /* ddr memory info usages */ + unsigned char reserve[60]; /* the size of dcmi_memory_info is 96 */ +}; + +struct dcmi_dvpp_ratio { + int vdec_ratio; + int vpc_ratio; + int venc_ratio; + int jpege_ratio; + int jpegd_ratio; +}; + +struct dcmi_capability_group_info { + unsigned int group_id; + unsigned int state; + unsigned int extend_attribute; + unsigned int aicore_number; + unsigned int aivector_number; + unsigned int sdma_number; + unsigned int aicpu_number; + unsigned int active_sq_number; + unsigned int res[DCMI_COMPUTE_GROUP_INFO_RES_NUM]; +}; + +struct dcmi_cgroup_info { + unsigned long limit_in_bytes; + unsigned long max_usage_in_bytes; + unsigned long usage_in_bytes; +}; + +struct dcmi_llc_perf { + unsigned int wr_hit_rate; + unsigned int rd_hit_rate; + unsigned int throughput; +}; + +enum dcmi_ip_addr_type { + DCMI_IPADDR_TYPE_V4 = 0, /** IPv4 */ + DCMI_IPADDR_TYPE_V6 = 1, /** IPv6 */ + DCMI_IPADDR_TYPE_ANY = 2 /** IPv4+IPv6 ("dual-stack") */ +}; + +struct dcmi_ip_addr { + union { + unsigned char ip6[16]; + unsigned char ip4[4]; + } u_addr; + enum dcmi_ip_addr_type ip_type; +}; + +struct dcmi_vdev_spec_info { + unsigned char core_num; /* aicore num for virtual device */ + unsigned char reservesd[DCMI_MAX_SPEC_RESERVE]; /* reserved */ +}; + +struct dcmi_vdev_create_info { + unsigned int vdev_num; /* number of vdevice the devid spilt */ + struct dcmi_vdev_spec_info spec[DCMI_MAX_VDEV_NUM]; /* specification of vdevice */ + unsigned int vdevid[DCMI_MAX_VDEV_NUM]; /* id number of vdevice */ +}; + +struct dcmi_sub_vdev_info { + unsigned int status; /* whether the vdevice used by container */ + unsigned int vdevid; /* id number of vdevice */ + unsigned int vfid; + unsigned long long cid; /* container id */ + struct dcmi_vdev_spec_info spec; /* specification of vdevice */ +}; + +struct dcmi_vdev_info { + unsigned int vdev_num; /* number of vdevice the devid had created */ + struct dcmi_vdev_spec_info spec_unused; /* resource the devid unallocated */ + struct dcmi_sub_vdev_info vdev[DCMI_MAX_VDEV_NUM]; +}; + +struct dcmi_proc_mem_info { + int proc_id; + unsigned long proc_mem_usage; +}; + +enum dcmi_reset_channel { + OUTBAND_CHANNEL = 0, + INBAND_CHANNEL +}; + +enum dcmi_unit_type { + NPU_TYPE = 0, + MCU_TYPE = 1, + CPU_TYPE = 2, + INVALID_TYPE = 0xFF +}; + +enum dcmi_die_type { + NDIE, + VDIE +}; + +enum dcmi_rdfx_detect_result { + DCMI_RDFX_DETECT_OK = 0, + DCMI_RDFX_DETECT_SOCK_FAIL = 1, + DCMI_RDFX_DETECT_RECV_TIMEOUT = 2, + DCMI_RDFX_DETECT_UNREACH = 3, + DCMI_RDFX_DETECT_TIME_EXCEEDED = 4, + DCMI_RDFX_DETECT_FAULT = 5, + DCMI_RDFX_DETECT_INIT = 6, + DCMI_RDFX_DETECT_THREAD_ERR = 7, + DCMI_RDFX_DETECT_IP_SET = 8, + DCMI_RDFX_DETECT_MAX = 0xFF +}; + +enum dcmi_port_type { + DCMI_VNIC_PORT = 0, + DCMI_ROCE_PORT = 1, + DCMI_INVALID_PORT +}; + +enum dcmi_revo_type { + DCMI_REVOCATION_TYPE_SOC = 0, + DCMI_REVOCATION_TYPE_MAX +}; + +enum dcmi_main_cmd { + DCMI_MAIN_CMD_DVPP = 0, + DCMI_MAIN_CMD_ISP, + DCMI_MAIN_CMD_TS_GROUP_NUM, + DCMI_MAIN_CMD_CAN, + DCMI_MAIN_CMD_UART, + DCMI_MAIN_CMD_UPGRADE, + DCMI_MAIN_CMD_TEMP = 50, + DCMI_MAIN_CMD_SVM = 51, + DCMI_MAIN_CMD_VDEV_MNG, + DCMI_MAIN_CMD_DEVICE_SHARE = 0x8001, + DCMI_MAIN_CMD_EX_CERT = 0x8003, + DCMI_MAIN_CMD_MAX +}; + +/* DSMI sub vdev mng CMD def */ +typedef enum { + DCMI_VMNG_SUB_CMD_GET_VDEV_RESOURCE, + DCMI_VMNG_SUB_CMD_GET_TOTAL_RESOURCE, + DCMI_VMNG_SUB_CMD_GET_FREE_RESOURCE, + DCMI_VMNG_SUB_CMD_MAX, +} DCMI_VDEV_MNG_SUB_CMD; + +enum dcmi_component_type { + DCMI_COMPONENT_TYPE_NVE, + DCMI_COMPONENT_TYPE_XLOADER, + DCMI_COMPONENT_TYPE_M3FW, + DCMI_COMPONENT_TYPE_UEFI, + DCMI_COMPONENT_TYPE_TEE, + DCMI_COMPONENT_TYPE_KERNEL, + DCMI_COMPONENT_TYPE_DTB, + DCMI_COMPONENT_TYPE_ROOTFS, + DCMI_COMPONENT_TYPE_IMU, + DCMI_COMPONENT_TYPE_IMP, + DCMI_COMPONENT_TYPE_AICPU, + DCMI_COMPONENT_TYPE_HBOOT1_A, + DCMI_COMPONENT_TYPE_HBOOT1_B, + DCMI_COMPONENT_TYPE_HBOOT2, + DCMI_COMPONENT_TYPE_DDR, + DCMI_COMPONENT_TYPE_LP, + DCMI_COMPONENT_TYPE_HSM, + DCMI_COMPONENT_TYPE_SAFETY_ISLAND, + DCMI_COMPONENT_TYPE_HILINK, + DCMI_COMPONENT_TYPE_RAWDATA, + DCMI_COMPONENT_TYPE_SYSDRV, + DCMI_COMPONENT_TYPE_ADSAPP, + DCMI_COMPONENT_TYPE_COMISOLATOR, + DCMI_COMPONENT_TYPE_CLUSTER, + DCMI_COMPONENT_TYPE_CUSTOMIZED, + DCMI_COMPONENT_TYPE_SYS_BASE_CONFIG, + DCMI_COMPONENT_TYPE_MAX, + DCMI_UPGRADE_AND_RESET_ALL_COMPONENT = 0xFFFFFFF7, + DCMI_UPGRADE_ALL_IMAGE_COMPONENT = 0xFFFFFFFD, + DCMI_UPGRADE_ALL_FIRMWARE_COMPONENT = 0xFFFFFFFE, + DCMI_UPGRADE_ALL_COMPONENT = 0xFFFFFFFF +}; + +enum dcmi_upgrade_state { + DCMI_UPGRADE_IDLE = 0, + DCMI_UPGRADE_UPGRADING = 1, + DCMI_UPGRADE_NOT_SUPPORT = 2, + DCMI_UPGRADE_UPGRADE_FAIL = 3, + DCMI_UPGRADE_STATE_NONE +}; + +enum dcmi_upgrade_type { + MCU_UPGRADE_START = 1, + MCU_UPGRADE_VALIDETE = 3, + MCU_UPGRADE_NONE +}; + +enum dcmi_boot_status { + DCMI_BOOT_STATUS_UNINIT = 0, + DCMI_BOOT_STATUS_BIOS, + DCMI_BOOT_STATUS_OS, + DCMI_BOOT_STATUS_FINISH +}; + +enum dcmi_device_type { + DCMI_DEVICE_TYPE_DDR, + DCMI_DEVICE_TYPE_SRAM, + DCMI_DEVICE_TYPE_HBM, + DCMI_DEVICE_TYPE_NPU, + DCMI_DEVICE_TYPE_NONE = 0xff +}; + +enum dcmi_freq_type { + DCMI_FREQ_DDR = 1, + DCMI_FREQ_CTRLCPU = 2, + DCMI_FREQ_HBM = 6, + DCMI_FREQ_AICORE_CURRENT_ = 7, + DCMI_FREQ_AICORE_MAX = 9, + DCMI_FREQ_VECTORCORE_CURRENT = 12 +}; + +#define DCMI_UTILIZATION_RATE_DDR 1 +#define DCMI_UTILIZATION_RATE_AICORE 2 +#define DCMI_UTILIZATION_RATE_AICPU 3 +#define DCMI_UTILIZATION_RATE_CTRLCPU 4 +#define DCMI_UTILIZATION_RATE_DDR_BANDWIDTH 5 +#define DCMI_UTILIZATION_RATE_HBM 6 +#define DCMI_UTILIZATION_RATE_HBM_BANDWIDTH 10 +#define DCMI_UTILIZATION_RATE_VECTORCORE 12 + +enum dcmi_manager_sensor_id { + DCMI_CLUSTER_TEMP_ID = 0, + DCMI_PERI_TEMP_ID = 1, + DCMI_AICORE0_TEMP_ID, + DCMI_AICORE1_TEMP_ID, + DCMI_AICORE_LIMIT_ID, + DCMI_AICORE_TOTAL_PER_ID, + DCMI_AICORE_ELIM_PER_ID, + DCMI_AICORE_BASE_FREQ_ID, + DCMI_NPU_DDR_FREQ_ID, + DCMI_THERMAL_THRESHOLD_ID, + DCMI_NTC_TEMP_ID, + DCMI_SOC_TEMP_ID, + DCMI_FP_TEMP_ID, + DCMI_N_DIE_TEMP_ID, + DCMI_HBM_TEMP_ID, + DCMI_SENSOR_INVALID_ID = 255 +}; + +union dcmi_sensor_info { + unsigned char uchar; + unsigned short ushort; + unsigned int uint; + signed int iint; + signed char temp[DCMI_SENSOR_TEMP_LEN]; + signed int ntc_tmp[DCMI_SENSOR_NTC_TEMP_LEN]; + unsigned int data[DCMI_SENSOR_DATA_MAX_LEN]; +}; + +/*----------------------------------------------* + * dcmi_get_fault_event * + *----------------------------------------------*/ +#define DCMI_EVENT_FILTER_FLAG_EVENT_ID (1UL << 0) +#define DCMI_EVENT_FILTER_FLAG_SERVERITY (1UL << 1) +#define DCMI_EVENT_FILTER_FLAG_NODE_TYPE (1UL << 2) + +#define DCMI_MAX_EVENT_NAME_LENGTH 256 +#define DCMI_MAX_EVENT_DATA_LENGTH 32 +#define DCMI_MAX_EVENT_RESV_LENGTH 32 + +struct dcmi_event_filter { + unsigned long long filter_flag; + unsigned int event_id; + unsigned char severity; + unsigned char node_type; + unsigned char resv[DCMI_MAX_EVENT_RESV_LENGTH]; /**< reserve 32byte */ +}; + +struct dcmi_dms_fault_event { + unsigned int event_id; + unsigned short deviceid; + unsigned char node_type; + unsigned char node_id; + unsigned char sub_node_type; + unsigned char sub_node_id; + unsigned char severity; + unsigned char assertion; + int event_serial_num; + int notify_serial_num; + unsigned long long alarm_raised_time; + char event_name[DCMI_MAX_EVENT_NAME_LENGTH]; + char additional_info[DCMI_MAX_EVENT_DATA_LENGTH]; + unsigned char resv[DCMI_MAX_EVENT_RESV_LENGTH]; /**< reserve 32byte */ +}; + +enum dcmi_event_type { + DCMI_DMS_FAULT_EVENT = 0, + DCMI_EVENT_TYPE_MAX +}; + +struct dcmi_event { + enum dcmi_event_type type; + union { + struct dcmi_dms_fault_event dms_event; + } event_t; +}; + +#define DCMI_VDEV_RES_NAME_LEN 16 +#define DCMI_VDEV_FOR_RESERVE 32 +struct dcmi_base_resource { + unsigned long long token; + unsigned long long token_max; + unsigned long long task_timeout; + unsigned int vfg_id; + unsigned char vip_mode; + unsigned char reserved[DCMI_VDEV_FOR_RESERVE - 1]; /* bytes aligned */ +}; + +/* total types of computing resource */ +struct dcmi_computing_resource { + /* accelator resource */ + float aic; + float aiv; + unsigned short dsa; + unsigned short rtsq; + unsigned short acsq; + unsigned short cdqm; + unsigned short c_core; + unsigned short ffts; + unsigned short sdma; + unsigned short pcie_dma; + + /* memory resource, MB as unit */ + unsigned long long memory_size; + + /* id resource */ + unsigned int event_id; + unsigned int notify_id; + unsigned int stream_id; + unsigned int model_id; + + /* cpu resource */ + unsigned short topic_schedule_aicpu; + unsigned short host_ctrl_cpu; + unsigned short host_aicpu; + unsigned short device_aicpu; + unsigned short topic_ctrl_cpu_slot; + + unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; +}; + +/* configurable computing resource */ +struct dcmi_computing_configurable { + /* memory resource, MB as unit */ + unsigned long long memory_size; + + /* accelator resource */ + float aic; + float aiv; + unsigned short dsa; + unsigned short rtsq; + unsigned short cdqm; + + /* cpu resource */ + unsigned short topic_schedule_aicpu; + unsigned short host_ctrl_cpu; + unsigned short host_aicpu; + unsigned short device_aicpu; + + unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; +}; +struct dcmi_media_resource { + /* dvpp resource */ + float jpegd; + float jpege; + float vpc; + float vdec; + float pngd; + float venc; + unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; +}; + +struct dcmi_create_vdev_in { + char name[DCMI_VDEV_RES_NAME_LEN]; + struct dcmi_base_resource base; + struct dcmi_computing_configurable computing; + struct dcmi_media_resource media; +}; + +struct dcmi_create_vdev_out { + unsigned int vdev_id; + unsigned int pcie_bus; + unsigned int pcie_device; + unsigned int pcie_func; + unsigned int vfg_id; + unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; +}; + +struct dcmi_vdev_query_info { + char name[DCMI_VDEV_RES_NAME_LEN]; + unsigned int status; + unsigned int is_container_used; + unsigned int vfid; + unsigned int vfg_id; + unsigned long long container_id; + struct dcmi_base_resource base; + struct dcmi_computing_resource computing; + struct dcmi_media_resource media; +}; + +/* for single search */ +struct dcmi_vdev_query_stru { + unsigned int vdev_id; + struct dcmi_vdev_query_info query_info; +}; + +struct dcmi_soc_free_resource { + unsigned int vfg_num; + unsigned int vfg_bitmap; + struct dcmi_base_resource base; + struct dcmi_computing_resource computing; + struct dcmi_media_resource media; +}; + +struct dcmi_soc_total_resource { + unsigned int vdev_num; + unsigned int vdev_id[32]; + unsigned int vfg_num; + unsigned int vfg_bitmap; + struct dcmi_base_resource base; + struct dcmi_computing_resource computing; + struct dcmi_media_resource media; +}; + +/*----------------------------------------------* + * Error code description * + *----------------------------------------------*/ + +#define DCMI_OK 0 +#define DCMI_ERROR_CODE_BASE -8000 +#define DCMI_ERR_CODE_INVALID_PARAMETER (DCMI_ERROR_CODE_BASE - 1) +#define DCMI_ERR_CODE_OPER_NOT_PERMITTED (DCMI_ERROR_CODE_BASE - 2) +#define DCMI_ERR_CODE_MEM_OPERATE_FAIL (DCMI_ERROR_CODE_BASE - 3) +#define DCMI_ERR_CODE_SECURE_FUN_FAIL (DCMI_ERROR_CODE_BASE - 4) +#define DCMI_ERR_CODE_INNER_ERR (DCMI_ERROR_CODE_BASE - 5) +#define DCMI_ERR_CODE_TIME_OUT (DCMI_ERROR_CODE_BASE - 6) +#define DCMI_ERR_CODE_INVALID_DEVICE_ID (DCMI_ERROR_CODE_BASE - 7) +#define DCMI_ERR_CODE_DEVICE_NOT_EXIST (DCMI_ERROR_CODE_BASE - 8) +#define DCMI_ERR_CODE_IOCTL_FAIL (DCMI_ERROR_CODE_BASE - 9) +#define DCMI_ERR_CODE_SEND_MSG_FAIL (DCMI_ERROR_CODE_BASE - 10) +#define DCMI_ERR_CODE_RECV_MSG_FAIL (DCMI_ERROR_CODE_BASE - 11) +#define DCMI_ERR_CODE_NOT_REDAY (DCMI_ERROR_CODE_BASE - 12) +#define DCMI_ERR_CODE_NOT_SUPPORT_IN_CONTAINER (DCMI_ERROR_CODE_BASE - 13) +#define DCMI_ERR_CODE_FILE_OPERATE_FAIL (DCMI_ERROR_CODE_BASE - 14) +#define DCMI_ERR_CODE_RESET_FAIL (DCMI_ERROR_CODE_BASE - 15) +#define DCMI_ERR_CODE_ABORT_OPERATE (DCMI_ERROR_CODE_BASE - 16) +#define DCMI_ERR_CODE_IS_UPGRADING (DCMI_ERROR_CODE_BASE - 17) +#define DCMI_ERR_CODE_RESOURCE_OCCUPIED (DCMI_ERROR_CODE_BASE - 20) +#define DCMI_ERR_CODE_PARTITION_NOT_RIGHT (DCMI_ERROR_CODE_BASE - 22) +#define DCMI_ERR_CODE_NOT_SUPPORT (DCMI_ERROR_CODE_BASE - 255) + +#define DCMI_VERSION_1 +#define DCMI_VERSION_2 + +#if defined DCMI_VERSION_2 + +DCMIDLLEXPORT int dcmi_init(void); + +DCMIDLLEXPORT int dcmi_get_dcmi_version(char *dcmi_ver, unsigned int len); + +DCMIDLLEXPORT int dcmi_get_driver_version(char *driver_ver, unsigned int len); + +DCMIDLLEXPORT int dcmi_get_card_list(int *card_num, int *card_list, int list_len); + +DCMIDLLEXPORT int dcmi_get_device_num_in_card(int card_id, int *device_num); + +DCMIDLLEXPORT int dcmi_get_device_id_in_card(int card_id, int *device_id_max, int *mcu_id, int *cpu_id); + +DCMIDLLEXPORT int dcmi_get_device_type(int card_id, int device_id, enum dcmi_unit_type *device_type); + +DCMIDLLEXPORT int dcmi_get_device_chip_info(int card_id, int device_id, struct dcmi_chip_info *chip_info); + +DCMIDLLEXPORT int dcmi_get_device_pcie_info(int card_id, int device_id, struct dcmi_pcie_info *pcie_info); + +DCMIDLLEXPORT int dcmi_get_device_pcie_info_v2(int card_id, int device_id, struct dcmi_pcie_info_all *pcie_info); + +DCMIDLLEXPORT int dcmi_get_device_board_info(int card_id, int device_id, struct dcmi_board_info *board_info); + +DCMIDLLEXPORT int dcmi_get_device_elabel_info(int card_id, int device_id, struct dcmi_elabel_info *elabel_info); + +DCMIDLLEXPORT int dcmi_get_device_power_info(int card_id, int device_id, int *power); + +DCMIDLLEXPORT int dcmi_set_card_customized_info(int card_id, char *info, int len); + +DCMIDLLEXPORT int dcmi_get_card_customized_info(int card_id, char *info, int len); + +DCMIDLLEXPORT int dcmi_set_device_clear_pcie_error(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_get_device_pcie_error_cnt( + int card_id, int device_id, struct dcmi_chip_pcie_err_rate *pcie_err_code_info); + +DCMIDLLEXPORT int dcmi_get_device_die_v2( + int card_id, int device_id, enum dcmi_die_type input_type, struct dcmi_die_id *die_id); + +DCMIDLLEXPORT int dcmi_get_device_health(int card_id, int device_id, unsigned int *health); + +DCMIDLLEXPORT int dcmi_get_device_errorcode_v2( + int card_id, int device_id, int *error_count, unsigned int *error_code_list, unsigned int list_len); + +DCMIDLLEXPORT int dcmi_get_device_errorcode_string( + int card_id, int device_id, unsigned int error_code, unsigned char *error_info, int buf_size); + +DCMIDLLEXPORT int dcmi_get_device_flash_count(int card_id, int device_id, unsigned int *flash_count); + +DCMIDLLEXPORT int dcmi_get_device_flash_info_v2( + int card_id, int device_id, unsigned int flash_index, struct dcmi_flash_info *flash_info); + +DCMIDLLEXPORT int dcmi_get_device_aicore_info(int card_id, int device_id, struct dcmi_aicore_info *aicore_info); + +DCMIDLLEXPORT int dcmi_get_device_aicpu_info(int card_id, int device_id, struct dcmi_aicpu_info *aicpu_info); + +DCMIDLLEXPORT int dcmi_get_device_boot_status(int card_id, int device_id, enum dcmi_boot_status *boot_status); + +DCMIDLLEXPORT int dcmi_set_device_pre_reset(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_set_device_rescan(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_set_device_reset(int card_id, int device_id, enum dcmi_reset_channel channel_type); + +DCMIDLLEXPORT int dcmi_get_mcu_upgrade_status(int card_id, int *status, int *progress); + +DCMIDLLEXPORT int dcmi_get_mcu_version(int card_id, char *version, int len); + +DCMIDLLEXPORT int dcmi_set_mcu_upgrade_stage(int card_id, enum dcmi_upgrade_type input_type); + +DCMIDLLEXPORT int dcmi_set_mcu_upgrade_file(int card_id, const char *file); + +DCMIDLLEXPORT int dcmi_get_device_system_time(int card_id, int device_id, unsigned int *time); + +DCMIDLLEXPORT int dcmi_get_device_temperature(int card_id, int device_id, int *temperature); + +DCMIDLLEXPORT int dcmi_get_device_voltage(int card_id, int device_id, unsigned int *voltage); + +DCMIDLLEXPORT int dcmi_get_device_p2p_enable(int card_id, int device_id, int *enable_flag); + +DCMIDLLEXPORT int dcmi_get_device_ecc_info( + int card_id, int device_id, enum dcmi_device_type input_type, struct dcmi_ecc_info *device_ecc_info); + +DCMIDLLEXPORT int dcmi_set_device_clear_ecc_statistics_info(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_get_device_frequency( + int card_id, int device_id, enum dcmi_freq_type input_type, unsigned int *frequency); + +DCMIDLLEXPORT int dcmi_get_device_hbm_info(int card_id, int device_id, struct dcmi_hbm_info *hbm_info); + +DCMIDLLEXPORT int dcmi_get_device_memory_info_v2(int card_id, int device_id, struct dcmi_memory_info *memory_info); + +DCMIDLLEXPORT int dcmi_get_device_memory_info_v3(int card_id, int device_id, + struct dcmi_get_memory_info_stru *memory_info); + +DCMIDLLEXPORT int dcmi_get_device_utilization_rate( + int card_id, int device_id, int input_type, unsigned int *utilization_rate); + +DCMIDLLEXPORT int dcmi_get_device_sensor_info( + int card_id, int device_id, enum dcmi_manager_sensor_id sensor_id, union dcmi_sensor_info *sensor_info); + +DCMIDLLEXPORT int dcmi_set_container_service_enable(void); + +DCMIDLLEXPORT int dcmi_get_device_board_id(int card_id, int device_id, unsigned int *board_id); + +DCMIDLLEXPORT int dcmi_get_device_component_count(int card_id, int device_id, unsigned int *component_count); + +DCMIDLLEXPORT int dcmi_get_device_component_list( + int card_id, int device_id, enum dcmi_component_type *component_table, unsigned int component_count); + +DCMIDLLEXPORT int dcmi_get_device_component_static_version( + int card_id, int device_id, enum dcmi_component_type component_type, unsigned char *version_str, unsigned int len); + +DCMIDLLEXPORT int dcmi_get_device_cgroup_info(int card_id, int device_id, struct dcmi_cgroup_info *cg_info); + +DCMIDLLEXPORT int dcmi_get_device_llc_perf_para(int card_id, int device_id, struct dcmi_llc_perf *perf_para); + +DCMIDLLEXPORT int dcmi_set_device_info(int card_id, int device_id, enum dcmi_main_cmd main_cmd, unsigned int sub_cmd, + const void *buf, unsigned int buf_size); + +DCMIDLLEXPORT int dcmi_get_device_info( + int card_id, int device_id, enum dcmi_main_cmd main_cmd, unsigned int sub_cmd, void *buf, unsigned int *size); + +DCMIDLLEXPORT int dcmi_set_device_sec_revocation( + int card_id, int device_id, enum dcmi_revo_type input_type, const unsigned char *file_data, unsigned int file_size); + +DCMIDLLEXPORT int dcmi_get_device_mac_count(int card_id, int device_id, int *count); + +DCMIDLLEXPORT int dcmi_set_device_mac(int card_id, int device_id, int mac_id, const char *mac_addr, unsigned int len); + +DCMIDLLEXPORT int dcmi_get_device_mac(int card_id, int device_id, int mac_id, char *mac_addr, unsigned int len); + +DCMIDLLEXPORT int dcmi_get_device_gateway( + int card_id, int device_id, enum dcmi_port_type input_type, int port_id, struct dcmi_ip_addr *gateway); + +DCMIDLLEXPORT int dcmi_set_device_gateway( + int card_id, int device_id, enum dcmi_port_type input_type, int port_id, struct dcmi_ip_addr *gateway); + +DCMIDLLEXPORT int dcmi_set_device_ip(int card_id, int device_id, enum dcmi_port_type input_type, int port_id, + struct dcmi_ip_addr *ip, struct dcmi_ip_addr *mask); + +DCMIDLLEXPORT int dcmi_get_device_ip(int card_id, int device_id, enum dcmi_port_type input_type, int port_id, + struct dcmi_ip_addr *ip, struct dcmi_ip_addr *mask); + +DCMIDLLEXPORT int dcmi_get_device_network_health(int card_id, int device_id, enum dcmi_rdfx_detect_result *result); + +DCMIDLLEXPORT int dcmi_get_device_fan_count(int card_id, int device_id, int *count); + +DCMIDLLEXPORT int dcmi_get_device_fan_speed(int card_id, int device_id, int fan_id, int *speed); + +DCMIDLLEXPORT int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_get_card_elabel_v2(int card_id, struct dcmi_elabel_info *elabel_info); + +DCMIDLLEXPORT int dcmi_mcu_get_chip_temperature(int card_id, char *data_info, int buf_size, int *data_len); + +DCMIDLLEXPORT int dcmi_get_device_ssh_enable(int card_id, int device_id, int *enable_flag); + +DCMIDLLEXPORT int dcmi_set_device_share_enable(int card_id, int device_id, int enable_flag); + +DCMIDLLEXPORT int dcmi_get_device_share_enable(int card_id, int device_id, int *enable_flag); + +DCMIDLLEXPORT int dcmi_get_card_board_info(int card_id, struct dcmi_board_info *board_info); + +DCMIDLLEXPORT int dcmi_get_card_pcie_info(int card_id, char *pcie_info, int pcie_info_len); + +DCMIDLLEXPORT int dcmi_get_card_pcie_slot(int card_id, int *pcie_slot); + +DCMIDLLEXPORT int dcmi_get_fault_device_num_in_card(int card_id, int *device_num); + +DCMIDLLEXPORT int dcmi_mcu_check_i2c(int card_id, int *health_status, int buf_size); + +DCMIDLLEXPORT int dcmi_set_device_user_config( + int card_id, int device_id, const char *config_name, unsigned int buf_size, char *buf); + +DCMIDLLEXPORT int dcmi_mcu_collect_log(int card_id, int log_type); + +DCMIDLLEXPORT int dcmi_get_device_chip_slot(int card_id, int device_id, int *chip_pos_id); + +DCMIDLLEXPORT int dcmi_get_product_type(int card_id, int device_id, char *product_type_str, int buf_size); + +DCMIDLLEXPORT int dcmi_get_device_outband_channel_state(int card_id, int device_id, int *channel_state); + +DCMIDLLEXPORT int dcmi_get_device_aicpu_count_info(int card_id, int device_id, unsigned char *count_info); + +DCMIDLLEXPORT int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, + struct dcmi_create_vdev_out *out); + +DCMIDLLEXPORT int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int vdevid); + +DCMIDLLEXPORT int dcmi_get_board_id(int card_id, int device_id, int *board_id); + +DCMIDLLEXPORT int dcmi_get_first_power_on_date(int card_id, unsigned int *first_power_on_date); + +DCMIDLLEXPORT int dcmi_get_fault_event(int card_id, int device_id, int timeout, struct dcmi_event_filter filter, + struct dcmi_event *event); + +DCMIDLLEXPORT int dcmi_get_device_resource_info(int card_id, int device_id, + struct dcmi_proc_mem_info *proc_info, int *proc_num); + +DCMIDLLEXPORT int dcmi_get_device_dvpp_ratio_info(int card_id, int device_id, struct dcmi_dvpp_ratio *usage); + +#endif + +#if defined DCMI_VERSION_1 +/* The following interfaces are V1 version interfaces. In order to ensure the compatibility is temporarily reserved, + * the later version will be deleted. Please switch to the V2 version interface as soon as possible */ + +struct dcmi_tag_pcie_idinfo { + unsigned int deviceid; + unsigned int venderid; + unsigned int subvenderid; + unsigned int subdeviceid; + unsigned int bdf_deviceid; + unsigned int bdf_busid; + unsigned int bdf_funcid; +}; + +struct dcmi_board_info_stru { + unsigned int board_id; + unsigned int pcb_id; + unsigned int bom_id; + unsigned int slot_id; +}; + +typedef struct dcmi_elabel_info_stru { + char product_name[MAX_LENTH]; + char model[MAX_LENTH]; + char manufacturer[MAX_LENTH]; + char serial_number[MAX_LENTH]; +}DCMI_ELABEL_INFO_STRU, *PDCMI_ELABEL_INFO_STRU; + +struct dcmi_chip_pcie_err_rate_stru { + unsigned int reg_deskew_fifo_overflow_intr_status; + unsigned int reg_symbol_unlock_intr_status; + unsigned int reg_deskew_unlock_intr_status; + unsigned int reg_phystatus_timeout_intr_status; + unsigned int symbol_unlock_counter; + unsigned int pcs_rx_err_cnt; + unsigned int phy_lane_err_counter; + unsigned int pcs_rcv_err_status; + unsigned int symbol_unlock_err_status; + unsigned int phy_lane_err_status; + unsigned int dl_lcrc_err_num; + unsigned int dl_dcrc_err_num; +}; + +struct dcmi_soc_die_stru { + unsigned int soc_die[5]; +}; + +struct dcmi_flash_info_stru { + unsigned long long flash_id; /* combined device & manufacturer code */ + unsigned short device_id; /* device id */ + unsigned short vendor; /* the primary vendor id */ + unsigned int state; /* flash health */ + unsigned long long size; /* total size in bytes */ + unsigned int sector_count; /* number of erase units */ + unsigned short manufacturer_id; /* manufacturer id */ +}; + +struct dcmi_ecc_info_stru { + int enable_flag; + unsigned int single_bit_error_count; + unsigned int double_bit_error_count; +}; + +struct dcmi_memory_info_stru { + unsigned long long memory_size; // 单位 MB + unsigned int freq; + unsigned int utiliza; +}; + +#ifndef __DSMI_COMMON_INTERFACE_H__ + +struct dsmi_soc_die_stru { + unsigned int soc_die[5]; +}; + +struct dsmi_board_info_stru { + unsigned int board_id; + unsigned int pcb_id; + unsigned int bom_id; + unsigned int slot_id; +}; + +struct tag_pcie_idinfo { + unsigned int deviceid; + unsigned int venderid; + unsigned int subvenderid; + unsigned int subdeviceid; + unsigned int bdf_deviceid; + unsigned int bdf_busid; + unsigned int bdf_funcid; +}; + +struct dm_flash_info_stru { + unsigned long flash_id; /* combined device & manufacturer code */ + unsigned short device_id; /* device id */ + unsigned short vendor; /* the primary vendor id */ + unsigned int state; /* flash health, 0x8:normal,0x10:abnormal */ + unsigned long size; /* total size in bytes */ + unsigned int sector_count; /* number of erase units */ + unsigned short manufacturer_id; /* manufacturer id */ +}; + +struct dsmi_aicore_info_stru { + unsigned int freq; /* normal freq */ + unsigned int curfreq; /* current freq */ +}; + +typedef struct dsmi_aicpu_info_stru { + unsigned int maxFreq; + unsigned int curFreq; + unsigned int aicpuNum; + unsigned int utilRate[16]; +} DSMI_AICPU_INFO; + +struct dsmi_ecc_info_stru { + int enable_flag; + unsigned int single_bit_error_count; + unsigned int double_bit_error_count; +}; + +struct dsmi_ecc_pages_stru { + unsigned int corrected_ecc_errors_aggregate_total; // 生命周期内所有可纠正ecc错误统计 + unsigned int uncorrected_ecc_errors_aggregate_total; // 生命周期内所有不可纠正ecc错误统计 + unsigned int isolated_pages_single_bit_error; // 单bit错误隔离内存页数量 + unsigned int isolated_pages_double_bit_error; // 多bit错误隔离内存页数量 +}; + +struct dsmi_hbm_info_stru { + unsigned long long memory_size; /**< HBM total size, KB */ + unsigned int freq; /**< HBM freq, MHZ */ + unsigned long long memory_usage; /**< HBM memory_usage, KB */ + int temp; /**< HBM temperature */ + unsigned int bandwith_util_rate; +}; + +struct dsmi_memory_info_stru { + unsigned long long memory_size; + unsigned int freq; + unsigned int utiliza; +}; + +typedef union tag_sensor_info { + unsigned char uchar; + unsigned short ushort; + unsigned int uint; + signed int iint; + signed char temp[2]; /* < 2 temp size */ + signed int ntc_tmp[4]; /* < 4 ntc_tmp size */ + unsigned int data[16]; +} TAG_SENSOR_INFO; + +struct dsmi_computing_power_info { + unsigned int data1; + unsigned int reserve[3]; +}; +#endif /* __DSMI_COMMON_INTERFACE_H__ */ + +DCMIDLLEXPORT int dcmi_get_card_num_list(int *card_num, int *card_list, int list_len); + +DCMIDLLEXPORT int dcmi_get_pcie_info(int card_id, int device_id, struct dcmi_tag_pcie_idinfo *pcie_idinfo); + +DCMIDLLEXPORT int dcmi_get_board_info(int card_id, int device_id, struct dcmi_board_info_stru *board_info); + +DCMIDLLEXPORT int dcmi_get_card_elabel(int card_id, struct dcmi_elabel_info_stru *elabel_info); + +DCMIDLLEXPORT int dcmi_mcu_set_license_info(int card_id, char *license, int len); + +DCMIDLLEXPORT int dcmi_mcu_get_license_info(int card_id, char *data_info, int *len); + +DCMIDLLEXPORT int dcmi_get_customized_info_api(int card_id, char *data_info, int *len); + +DCMIDLLEXPORT int dcmi_set_customized_info_api(int card_id, const char *data_info, int len); + +DCMIDLLEXPORT int dcmi_clear_pcie_error_cnt(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_get_pcie_error_cnt( + int card_id, int device_id, struct dcmi_chip_pcie_err_rate_stru *pcie_err_code_info); + +DCMIDLLEXPORT int dcmi_get_device_die(int card_id, int device_id, struct dcmi_soc_die_stru *device_die); + +DCMIDLLEXPORT int dcmi_get_device_ndie(int card_id, int device_id, struct dsmi_soc_die_stru *device_ndie); + +DCMIDLLEXPORT int dcmi_get_device_errorcode( + int card_id, int device_id, int *error_count, unsigned int *error_code, int *error_width); + +DCMIDLLEXPORT int dcmi_get_device_errorinfo( + int card_id, int device_id, int errorcode, unsigned char *errorinfo, int buf_size); + +DCMIDLLEXPORT int dcmi_get_device_flash_info( + int card_id, int device_id, unsigned int flash_index, struct dcmi_flash_info_stru *flash_info); + +DCMIDLLEXPORT int dcmi_get_aicore_info(int card_id, int device_id, struct dsmi_aicore_info_stru *aicore_info); + +DCMIDLLEXPORT int dcmi_get_aicpu_info(int card_id, int device_id, struct dsmi_aicpu_info_stru *aicpu_info); + +DCMIDLLEXPORT int dcmi_pre_reset_soc(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_rescan_soc(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_reset_device(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_mcu_get_upgrade_statues(int card_id, int *status, int *progress); + +DCMIDLLEXPORT int dcmi_mcu_get_upgrade_status(int card_id, int *status, int *progress); + +DCMIDLLEXPORT int dcmi_mcu_get_version(int card_id, char *version_str, int max_version_len, int *len); + +DCMIDLLEXPORT int dcmi_mcu_upgrade_control(int card_id, int upgrade_type); + +DCMIDLLEXPORT int dcmi_mcu_upgrade_transfile(int card_id, const char *file); + +DCMIDLLEXPORT int dcmi_get_p2p_enable(int card_id, int device_id, int *enable_flag); + +DCMIDLLEXPORT int dcmi_get_ecc_info( + int card_id, int device_id, int device_type, struct dsmi_ecc_info_stru *device_ecc_info); + +DCMIDLLEXPORT int dcmi_get_hbm_info(int card_id, int device_id, struct dsmi_hbm_info_stru *device_hbm_info); + +DCMIDLLEXPORT int dcmi_get_memory_info(int card_id, int device_id, struct dcmi_memory_info_stru *device_memory_info); + +DCMIDLLEXPORT int dcmi_get_soc_sensor_info( + int card_id, int device_id, int sensor_id, union tag_sensor_info *sensor_info); + +DCMIDLLEXPORT int dcmi_config_ecc_enable(int card_id, int device_id, int enable_flag); + +DCMIDLLEXPORT int dcmi_get_version(int card_id, int device_id, char *verison_str, unsigned int version_len, int *len); + +DCMIDLLEXPORT int dcmi_mcu_get_board_info(int card_id, struct dcmi_board_info *board_info); + +DCMIDLLEXPORT int dcmi_mcu_get_power_info(int card_id, int *power); + +DCMIDLLEXPORT int dcmi_get_computing_power_info( + int card_id, int device_id, int type, struct dsmi_computing_power_info *computing_power); + +DCMIDLLEXPORT int dcmi_set_device_ecc_enable( + int card_id, int device_id, enum dcmi_device_type device_type, int enable_flag); + +DCMIDLLEXPORT int dcmi_set_user_config( + int card_id, int device_id, const char *config_name, unsigned int buf_size, unsigned char *buf); + +DCMIDLLEXPORT int dcmi_get_user_config( + int card_id, int device_id, const char *config_name, unsigned int buf_size, unsigned char *buf); + +DCMIDLLEXPORT int dcmi_clear_device_user_config(int card_id, int device_id, const char *config_name); + +DCMIDLLEXPORT int dcmi_reset_device_inband(int card_id, int device_id); + +DCMIDLLEXPORT int dcmi_get_nve_level(int card_id, int device_id, int *nve_level); + +DCMIDLLEXPORT int dcmi_set_nve_level(int card_id, int device_id, int level); + +DCMIDLLEXPORT int dcmi_get_system_time(int card_id, int device_id, unsigned int *time); + +#endif + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __DCMI_INTERFACE_API_H__ */ diff --git a/runtime/go.mod b/runtime/go.mod index b2bb8e2..5caee26 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -3,6 +3,6 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 ) diff --git a/runtime/go.sum b/runtime/go.sum index f87c1c7..9345f6a 100644 --- a/runtime/go.sum +++ b/runtime/go.sum @@ -1,7 +1,7 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 h1:9mv9SC7GWmRWE0J/+oD8w3GsN2KYGKtg6uwLN7hfP5E= -github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= diff --git a/runtime/main.go b/runtime/main.go index 8de4875..9f5dad8 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -9,6 +9,7 @@ import ( "fmt" "io/ioutil" "log" + "main/dcmi" "os" "os/exec" "path" @@ -21,6 +22,7 @@ import ( const ( loggingPrefix = "ascend-docker-runtime" hookCli = "ascend-docker-hook" + destroyHookCli = "ascend-docker-destroy" hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" dockerRuncFile = "docker-runc" runcFile = "runc" @@ -84,23 +86,70 @@ func addHook(spec *specs.Spec) error { if spec.Hooks == nil { spec.Hooks = &specs.Hooks{} - } else if len(spec.Hooks.Prestart) != 0 { - for _, hook := range spec.Hooks.Prestart { - if !strings.Contains(hook.Path, hookCli) { - continue - } - return nil + } + needUpdate := true + for _, hook := range spec.Hooks.Prestart { + if strings.Contains(hook.Path, hookCli) { + needUpdate = false } } + if needUpdate { + spec.Hooks.Prestart = append(spec.Hooks.Prestart, specs.Hook{ + Path: hookCliPath, + Args: []string{hookCliPath}, + }) + } + + vdevice, err := dcmi.CreateVDevice(spec) + fmt.Printf("create vdevice %v \n", vdevice) + + if err != nil { + return err + } - spec.Hooks.Prestart = append(spec.Hooks.Prestart, specs.Hook{ - Path: hookCliPath, - Args: []string{hookCliPath}, - }) + if vdevice.VdeviceID != -1 { + updateEnvAndPostHook(spec, vdevice) + } return nil } +func updateEnvAndPostHook(spec *specs.Spec, vdevice dcmi.VDeviceInfo) { + newEnv := make([]string, 0) + needAddVirtualFlag := true + for _, line := range spec.Process.Env { + words := strings.Split(line, "=") + const LENGTH int = 2 + if len(words) == LENGTH && strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { + newEnv = append(newEnv, fmt.Sprintf("ASCEND_VISIBLE_DEVICES=%d", vdevice.VdeviceID)) + continue + } + if len(words) == LENGTH && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { + needAddVirtualFlag = false + if strings.Contains(words[1], "VIRTUAL") { + newEnv = append(newEnv, line) + continue + } else { + newEnv = append(newEnv, strings.TrimSpace(line)+",VIRTUAL") + continue + } + } + newEnv = append(newEnv, line) + } + if needAddVirtualFlag { + newEnv = append(newEnv, fmt.Sprintf("ASCEND_RUNTIME_OPTIONS=VIRTUAL")) + } + spec.Process.Env = newEnv + if currentExecPath, err := os.Executable(); err == nil { + postHookCliPath := path.Join(path.Dir(currentExecPath), destroyHookCli) + spec.Hooks.Poststop = append(spec.Hooks.Poststop, specs.Hook{ + Path: postHookCliPath, + Args: []string{postHookCliPath, fmt.Sprintf("%d", vdevice.CardID), fmt.Sprintf("%d", vdevice.DeviceID), + fmt.Sprintf("%d", vdevice.VdeviceID)}, + }) + } +} + func modifySpecFile(path string) error { stat, err := os.Stat(path) if err != nil { -- Gitee From fa3889761004504c70bc97d6d81ffc7721f4d2d7 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 29 Mar 2022 20:02:59 +0800 Subject: [PATCH 208/296] Match-id-3b48835d3ad59ba297c4c0d969f45cce07955e56 --- runtime/dcmi/dcmi.go | 53 +- runtime/dcmi/dcmi_interface_api.h | 966 +----------------------------- 2 files changed, 31 insertions(+), 988 deletions(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 640429b..042dfd9 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -35,41 +35,11 @@ package dcmi CALL_FUNC(dcmi_get_device_num_in_card,card_id,device_num) } - int (*dcmi_get_device_id_in_card_func)(int card_id, int *device_id_max, int *mcu_id, int *cpu_id); - int dcmi_get_device_id_in_card(int card_id, int *device_id_max, int *mcu_id, int *cpu_id){ - CALL_FUNC(dcmi_get_device_id_in_card,card_id,device_id_max,mcu_id,cpu_id) - } - int (*dcmi_get_device_logic_id_func)(int *device_logic_id, int card_id, int device_id); int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id){ CALL_FUNC(dcmi_get_device_logic_id,device_logic_id,card_id,device_id) } - int (*dcmi_set_create_vdevice_func)(int card_id, int device_id, struct dcmi_vdev_create_info *info); - int dcmi_set_create_vdevice(int card_id, int device_id, struct dcmi_vdev_create_info *info){ - CALL_FUNC(dcmi_set_create_vdevice,card_id,device_id,info) - } - - int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); - int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int VDevid){ - CALL_FUNC(dcmi_set_destroy_vdevice,card_id,device_id,VDevid) - } - - int (*dcmi_get_vdevice_info_func)(int card_id, int device_id, struct dcmi_vdev_info *info); - int dcmi_get_vdevice_info(int card_id, int device_id, struct dcmi_vdev_info *info){ - CALL_FUNC(dcmi_get_vdevice_info,card_id,device_id,info) - } - - int (*dcmi_get_device_health_func)(int card_id, int device_id, unsigned int *health); - int dcmi_get_device_health(int card_id, int device_id, unsigned int *health){ - CALL_FUNC(dcmi_get_device_health,card_id,device_id,health) - } - - int (*dcmi_get_device_chip_info_func)(int card_id, int device_id, struct dcmi_chip_info *chip_info); - int dcmi_get_device_chip_info(int card_id, int device_id, struct dcmi_chip_info *chip_info){ - CALL_FUNC(dcmi_get_device_chip_info,card_id,device_id,chip_info) - } - int (*dcmi_create_vdevice_func)(int card_id, int device_id, int vdev_id, const char *template_name, struct dcmi_create_vdev_out *out); int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, @@ -77,6 +47,11 @@ package dcmi CALL_FUNC(dcmi_create_vdevice,card_id,device_id,vdev_id,template_name,out) } + int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); + int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int VDevid){ + CALL_FUNC(dcmi_set_destroy_vdevice,card_id,device_id,VDevid) + } + // load .so files and functions int dcmiInit_dl(void){ dcmiHandle = dlopen("libdcmi.so",RTLD_LAZY | RTLD_GLOBAL); @@ -91,22 +66,12 @@ package dcmi dcmi_get_device_num_in_card_func = dlsym(dcmiHandle,"dcmi_get_device_num_in_card"); - dcmi_get_device_id_in_card_func = dlsym(dcmiHandle,"dcmi_get_device_id_in_card"); - dcmi_get_device_logic_id_func = dlsym(dcmiHandle,"dcmi_get_device_logic_id"); - dcmi_set_create_vdevice_func = dlsym(dcmiHandle,"dcmi_set_create_vdevice"); + dcmi_create_vdevice_func = dlsym(dcmiHandle,"dcmi_create_vdevice"); dcmi_set_destroy_vdevice_func = dlsym(dcmiHandle,"dcmi_set_destroy_vdevice"); - dcmi_get_vdevice_info_func = dlsym(dcmiHandle,"dcmi_get_vdevice_info"); - - dcmi_get_device_health_func = dlsym(dcmiHandle,"dcmi_get_device_health"); - - dcmi_get_device_chip_info_func = dlsym(dcmiHandle,"dcmi_get_device_chip_info"); - - dcmi_create_vdevice_func = dlsym(dcmiHandle,"dcmi_create_vdevice"); - return SUCCESS; } @@ -212,9 +177,8 @@ func getCardList() (int32, []int32, error) { return retError, nil, errInfo } var cardNum = int32(cNum) - var i int32 var cardIDList []int32 - for i = 0; i < cardNum && i < hiAIMaxCardNum; i++ { + for i := int32(0); i < cardNum && i < hiAIMaxCardNum; i++ { cardID := int32(ids[i]) if cardID < 0 { continue @@ -265,7 +229,6 @@ func SetCreateVDevice(cardID, deviceID int32, coreNum string) (uint32, error) { errInfo := fmt.Errorf("create virtual device failed, error code: %d", int32(err)) return uint32(math.MaxUint32), errInfo } - println("vdevId", createInfo.vdev_id) return uint32(createInfo.vdev_id), nil } @@ -302,7 +265,6 @@ func CreateVDevice(spec *specs.Spec) (VDeviceInfo, error) { } for deviceID := int32(0); deviceID < deviceCount; deviceID++ { logicID, err := GetDeviceLogicID(cardID, deviceID) - println(cardID, deviceID, logicID, dsmiLogicID) if err != nil { return invalidVDevice, fmt.Errorf("cannot get logic id : %v", err) } @@ -316,7 +278,6 @@ func CreateVDevice(spec *specs.Spec) (VDeviceInfo, error) { if err != nil || int(vdeviceID) < 0 { return invalidVDevice, fmt.Errorf("cannot create vd or vdevice is wrong: %v %v", vdeviceID, err) } - fmt.Printf("%v", VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}) return VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}, nil } diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h index 6e994b0..e5b47a8 100644 --- a/runtime/dcmi/dcmi_interface_api.h +++ b/runtime/dcmi/dcmi_interface_api.h @@ -1,14 +1,8 @@ /* - * Copyright: Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. - * Author: d00583127 - * Date: 2021-03-17 17:46:08 - * @LastEditors: Hu Haoran h00584933 - * @LastEditTime: 2021-07-10 20:13:31 + * Copyright: Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved. * Description: DCMI API Reference */ -/********************************************************************************/ - #ifndef __DCMI_INTERFACE_API_H__ #define __DCMI_INTERFACE_API_H__ @@ -24,267 +18,16 @@ extern "C" { #define DCMIDLLEXPORT _declspec(dllexport) #endif -#define MAX_VER_LEN 255 // Maximum length of version string - -#define MAX_CARD_NUM 64 // The system supports up to 64 cards - -#define MAX_CHIP_NAME_LEN 32 // Maximum length of chip name - -#define MAX_LENTH 256 // Maximum length of string - -#define DIE_ID_COUNT 5 // Number of die ID characters - -#define MAX_CORE_NUM 16 // Maximum AI CPU - -#define DCMI_SENSOR_DATA_MAX_LEN 16 - -#define DCMI_SENSOR_TEMP_LEN 2 - -#define DCMI_SENSOR_NTC_TEMP_LEN 4 - -#define DCMI_COMPUTE_GROUP_INFO_RES_NUM 8 - -#define DCMI_MAX_VDEV_NUM 16 // max number a device can spilts -#define DCMI_MAX_SPEC_RESERVE 8 - -/*----------------------------------------------* - * Structure description * - *----------------------------------------------*/ -struct dcmi_chip_info { - unsigned char chip_type[MAX_CHIP_NAME_LEN]; - unsigned char chip_name[MAX_CHIP_NAME_LEN]; - unsigned char chip_ver[MAX_CHIP_NAME_LEN]; - unsigned int aicore_cnt; -}; - -struct dcmi_pcie_info { - unsigned int deviceid; - unsigned int venderid; - unsigned int subvenderid; - unsigned int subdeviceid; - unsigned int bdf_deviceid; - unsigned int bdf_busid; - unsigned int bdf_funcid; -}; - -struct dcmi_pcie_info_all { - unsigned int venderid; /* 厂商id */ - unsigned int subvenderid; /* 厂商子id */ - unsigned int deviceid; /* 设备id */ - unsigned int subdeviceid; /* 设备子id */ - int domain; /* pcie domain */ - unsigned int bdf_busid; - unsigned int bdf_deviceid; - unsigned int bdf_funcid; - unsigned char reserve[32]; /* the size of dcmi_pcie_info_all is 64 */ -}; - -struct dcmi_board_info { - unsigned int board_id; - unsigned int pcb_id; - unsigned int bom_id; - unsigned int slot_id; -}; - -struct dcmi_elabel_info { - char product_name[MAX_LENTH]; - char model[MAX_LENTH]; - char manufacturer[MAX_LENTH]; - char manufacturer_date[MAX_LENTH]; - char serial_number[MAX_LENTH]; -}; - -struct dcmi_die_id { - unsigned int soc_die[DIE_ID_COUNT]; -}; - -struct dcmi_aicore_info { - unsigned int freq; - unsigned int cur_freq; -}; - -struct dcmi_aicpu_info { - unsigned int max_freq; - unsigned int cur_freq; - unsigned int aicpu_num; - unsigned int util_rate[MAX_CORE_NUM]; -}; - -struct dcmi_flash_info { - unsigned long long flash_id; - unsigned short device_id; - unsigned short vendor; - unsigned int state; - unsigned long long size; - unsigned int sector_count; - unsigned short manufacturer_id; -}; - -struct dcmi_chip_pcie_err_rate { - unsigned int reg_deskew_fifo_overflow_intr_status; - unsigned int reg_symbol_unlock_intr_status; - unsigned int reg_deskew_unlock_intr_status; - unsigned int reg_phystatus_timeout_intr_status; - unsigned int symbol_unlock_counter; - unsigned int pcs_rx_err_cnt; - unsigned int phy_lane_err_counter; - unsigned int pcs_rcv_err_status; - unsigned int symbol_unlock_err_status; - unsigned int phy_lane_err_status; - unsigned int dl_lcrc_err_num; - unsigned int dl_dcrc_err_num; -}; - -struct dcmi_ecc_info { - int enable_flag; - unsigned int single_bit_error_cnt; - unsigned int double_bit_error_cnt; - unsigned int total_single_bit_error_cnt; - unsigned int total_double_bit_error_cnt; - unsigned int single_bit_isolated_pages_cnt; - unsigned int double_bit_isolated_pages_cnt; -}; - -struct dcmi_hbm_info { - unsigned long long memory_size; - unsigned int freq; - unsigned long long memory_usage; - int temp; - unsigned int bandwith_util_rate; -}; - -struct dcmi_memory_info { - unsigned long long memory_size; /* unit:MB */ - unsigned int freq; - unsigned int utiliza; -}; - -struct dcmi_get_memory_info_stru { - unsigned long long memory_size; /* unit:MB */ - unsigned long long memory_available; /* free + hugepages_free * hugepagesize */ - unsigned int freq; - unsigned long hugepagesize; /* unit:KB */ - unsigned long hugepages_total; - unsigned long hugepages_free; - unsigned int utiliza; /* ddr memory info usages */ - unsigned char reserve[60]; /* the size of dcmi_memory_info is 96 */ -}; - -struct dcmi_dvpp_ratio { - int vdec_ratio; - int vpc_ratio; - int venc_ratio; - int jpege_ratio; - int jpegd_ratio; -}; - -struct dcmi_capability_group_info { - unsigned int group_id; - unsigned int state; - unsigned int extend_attribute; - unsigned int aicore_number; - unsigned int aivector_number; - unsigned int sdma_number; - unsigned int aicpu_number; - unsigned int active_sq_number; - unsigned int res[DCMI_COMPUTE_GROUP_INFO_RES_NUM]; -}; - -struct dcmi_cgroup_info { - unsigned long limit_in_bytes; - unsigned long max_usage_in_bytes; - unsigned long usage_in_bytes; -}; - -struct dcmi_llc_perf { - unsigned int wr_hit_rate; - unsigned int rd_hit_rate; - unsigned int throughput; -}; - -enum dcmi_ip_addr_type { - DCMI_IPADDR_TYPE_V4 = 0, /** IPv4 */ - DCMI_IPADDR_TYPE_V6 = 1, /** IPv6 */ - DCMI_IPADDR_TYPE_ANY = 2 /** IPv4+IPv6 ("dual-stack") */ -}; - -struct dcmi_ip_addr { - union { - unsigned char ip6[16]; - unsigned char ip4[4]; - } u_addr; - enum dcmi_ip_addr_type ip_type; -}; - -struct dcmi_vdev_spec_info { - unsigned char core_num; /* aicore num for virtual device */ - unsigned char reservesd[DCMI_MAX_SPEC_RESERVE]; /* reserved */ -}; - -struct dcmi_vdev_create_info { - unsigned int vdev_num; /* number of vdevice the devid spilt */ - struct dcmi_vdev_spec_info spec[DCMI_MAX_VDEV_NUM]; /* specification of vdevice */ - unsigned int vdevid[DCMI_MAX_VDEV_NUM]; /* id number of vdevice */ -}; - -struct dcmi_sub_vdev_info { - unsigned int status; /* whether the vdevice used by container */ - unsigned int vdevid; /* id number of vdevice */ - unsigned int vfid; - unsigned long long cid; /* container id */ - struct dcmi_vdev_spec_info spec; /* specification of vdevice */ -}; - -struct dcmi_vdev_info { - unsigned int vdev_num; /* number of vdevice the devid had created */ - struct dcmi_vdev_spec_info spec_unused; /* resource the devid unallocated */ - struct dcmi_sub_vdev_info vdev[DCMI_MAX_VDEV_NUM]; -}; - -struct dcmi_proc_mem_info { - int proc_id; - unsigned long proc_mem_usage; -}; - -enum dcmi_reset_channel { - OUTBAND_CHANNEL = 0, - INBAND_CHANNEL -}; - -enum dcmi_unit_type { - NPU_TYPE = 0, - MCU_TYPE = 1, - CPU_TYPE = 2, - INVALID_TYPE = 0xFF -}; - -enum dcmi_die_type { - NDIE, - VDIE -}; - -enum dcmi_rdfx_detect_result { - DCMI_RDFX_DETECT_OK = 0, - DCMI_RDFX_DETECT_SOCK_FAIL = 1, - DCMI_RDFX_DETECT_RECV_TIMEOUT = 2, - DCMI_RDFX_DETECT_UNREACH = 3, - DCMI_RDFX_DETECT_TIME_EXCEEDED = 4, - DCMI_RDFX_DETECT_FAULT = 5, - DCMI_RDFX_DETECT_INIT = 6, - DCMI_RDFX_DETECT_THREAD_ERR = 7, - DCMI_RDFX_DETECT_IP_SET = 8, - DCMI_RDFX_DETECT_MAX = 0xFF -}; - -enum dcmi_port_type { - DCMI_VNIC_PORT = 0, - DCMI_ROCE_PORT = 1, - DCMI_INVALID_PORT -}; - -enum dcmi_revo_type { - DCMI_REVOCATION_TYPE_SOC = 0, - DCMI_REVOCATION_TYPE_MAX +#define DCMI_VDEV_RES_NAME_LEN 16 +#define DCMI_VDEV_FOR_RESERVE 32 +#define DCMI_VDEV_MAX_NUM 32 +struct dcmi_create_vdev_out { + unsigned int vdev_id; + unsigned int pcie_bus; + unsigned int pcie_device; + unsigned int pcie_func; + unsigned int vfg_id; + unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; }; enum dcmi_main_cmd { @@ -310,166 +53,6 @@ typedef enum { DCMI_VMNG_SUB_CMD_MAX, } DCMI_VDEV_MNG_SUB_CMD; -enum dcmi_component_type { - DCMI_COMPONENT_TYPE_NVE, - DCMI_COMPONENT_TYPE_XLOADER, - DCMI_COMPONENT_TYPE_M3FW, - DCMI_COMPONENT_TYPE_UEFI, - DCMI_COMPONENT_TYPE_TEE, - DCMI_COMPONENT_TYPE_KERNEL, - DCMI_COMPONENT_TYPE_DTB, - DCMI_COMPONENT_TYPE_ROOTFS, - DCMI_COMPONENT_TYPE_IMU, - DCMI_COMPONENT_TYPE_IMP, - DCMI_COMPONENT_TYPE_AICPU, - DCMI_COMPONENT_TYPE_HBOOT1_A, - DCMI_COMPONENT_TYPE_HBOOT1_B, - DCMI_COMPONENT_TYPE_HBOOT2, - DCMI_COMPONENT_TYPE_DDR, - DCMI_COMPONENT_TYPE_LP, - DCMI_COMPONENT_TYPE_HSM, - DCMI_COMPONENT_TYPE_SAFETY_ISLAND, - DCMI_COMPONENT_TYPE_HILINK, - DCMI_COMPONENT_TYPE_RAWDATA, - DCMI_COMPONENT_TYPE_SYSDRV, - DCMI_COMPONENT_TYPE_ADSAPP, - DCMI_COMPONENT_TYPE_COMISOLATOR, - DCMI_COMPONENT_TYPE_CLUSTER, - DCMI_COMPONENT_TYPE_CUSTOMIZED, - DCMI_COMPONENT_TYPE_SYS_BASE_CONFIG, - DCMI_COMPONENT_TYPE_MAX, - DCMI_UPGRADE_AND_RESET_ALL_COMPONENT = 0xFFFFFFF7, - DCMI_UPGRADE_ALL_IMAGE_COMPONENT = 0xFFFFFFFD, - DCMI_UPGRADE_ALL_FIRMWARE_COMPONENT = 0xFFFFFFFE, - DCMI_UPGRADE_ALL_COMPONENT = 0xFFFFFFFF -}; - -enum dcmi_upgrade_state { - DCMI_UPGRADE_IDLE = 0, - DCMI_UPGRADE_UPGRADING = 1, - DCMI_UPGRADE_NOT_SUPPORT = 2, - DCMI_UPGRADE_UPGRADE_FAIL = 3, - DCMI_UPGRADE_STATE_NONE -}; - -enum dcmi_upgrade_type { - MCU_UPGRADE_START = 1, - MCU_UPGRADE_VALIDETE = 3, - MCU_UPGRADE_NONE -}; - -enum dcmi_boot_status { - DCMI_BOOT_STATUS_UNINIT = 0, - DCMI_BOOT_STATUS_BIOS, - DCMI_BOOT_STATUS_OS, - DCMI_BOOT_STATUS_FINISH -}; - -enum dcmi_device_type { - DCMI_DEVICE_TYPE_DDR, - DCMI_DEVICE_TYPE_SRAM, - DCMI_DEVICE_TYPE_HBM, - DCMI_DEVICE_TYPE_NPU, - DCMI_DEVICE_TYPE_NONE = 0xff -}; - -enum dcmi_freq_type { - DCMI_FREQ_DDR = 1, - DCMI_FREQ_CTRLCPU = 2, - DCMI_FREQ_HBM = 6, - DCMI_FREQ_AICORE_CURRENT_ = 7, - DCMI_FREQ_AICORE_MAX = 9, - DCMI_FREQ_VECTORCORE_CURRENT = 12 -}; - -#define DCMI_UTILIZATION_RATE_DDR 1 -#define DCMI_UTILIZATION_RATE_AICORE 2 -#define DCMI_UTILIZATION_RATE_AICPU 3 -#define DCMI_UTILIZATION_RATE_CTRLCPU 4 -#define DCMI_UTILIZATION_RATE_DDR_BANDWIDTH 5 -#define DCMI_UTILIZATION_RATE_HBM 6 -#define DCMI_UTILIZATION_RATE_HBM_BANDWIDTH 10 -#define DCMI_UTILIZATION_RATE_VECTORCORE 12 - -enum dcmi_manager_sensor_id { - DCMI_CLUSTER_TEMP_ID = 0, - DCMI_PERI_TEMP_ID = 1, - DCMI_AICORE0_TEMP_ID, - DCMI_AICORE1_TEMP_ID, - DCMI_AICORE_LIMIT_ID, - DCMI_AICORE_TOTAL_PER_ID, - DCMI_AICORE_ELIM_PER_ID, - DCMI_AICORE_BASE_FREQ_ID, - DCMI_NPU_DDR_FREQ_ID, - DCMI_THERMAL_THRESHOLD_ID, - DCMI_NTC_TEMP_ID, - DCMI_SOC_TEMP_ID, - DCMI_FP_TEMP_ID, - DCMI_N_DIE_TEMP_ID, - DCMI_HBM_TEMP_ID, - DCMI_SENSOR_INVALID_ID = 255 -}; - -union dcmi_sensor_info { - unsigned char uchar; - unsigned short ushort; - unsigned int uint; - signed int iint; - signed char temp[DCMI_SENSOR_TEMP_LEN]; - signed int ntc_tmp[DCMI_SENSOR_NTC_TEMP_LEN]; - unsigned int data[DCMI_SENSOR_DATA_MAX_LEN]; -}; - -/*----------------------------------------------* - * dcmi_get_fault_event * - *----------------------------------------------*/ -#define DCMI_EVENT_FILTER_FLAG_EVENT_ID (1UL << 0) -#define DCMI_EVENT_FILTER_FLAG_SERVERITY (1UL << 1) -#define DCMI_EVENT_FILTER_FLAG_NODE_TYPE (1UL << 2) - -#define DCMI_MAX_EVENT_NAME_LENGTH 256 -#define DCMI_MAX_EVENT_DATA_LENGTH 32 -#define DCMI_MAX_EVENT_RESV_LENGTH 32 - -struct dcmi_event_filter { - unsigned long long filter_flag; - unsigned int event_id; - unsigned char severity; - unsigned char node_type; - unsigned char resv[DCMI_MAX_EVENT_RESV_LENGTH]; /**< reserve 32byte */ -}; - -struct dcmi_dms_fault_event { - unsigned int event_id; - unsigned short deviceid; - unsigned char node_type; - unsigned char node_id; - unsigned char sub_node_type; - unsigned char sub_node_id; - unsigned char severity; - unsigned char assertion; - int event_serial_num; - int notify_serial_num; - unsigned long long alarm_raised_time; - char event_name[DCMI_MAX_EVENT_NAME_LENGTH]; - char additional_info[DCMI_MAX_EVENT_DATA_LENGTH]; - unsigned char resv[DCMI_MAX_EVENT_RESV_LENGTH]; /**< reserve 32byte */ -}; - -enum dcmi_event_type { - DCMI_DMS_FAULT_EVENT = 0, - DCMI_EVENT_TYPE_MAX -}; - -struct dcmi_event { - enum dcmi_event_type type; - union { - struct dcmi_dms_fault_event dms_event; - } event_t; -}; - -#define DCMI_VDEV_RES_NAME_LEN 16 -#define DCMI_VDEV_FOR_RESERVE 32 struct dcmi_base_resource { unsigned long long token; unsigned long long token_max; @@ -512,26 +95,6 @@ struct dcmi_computing_resource { unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; }; -/* configurable computing resource */ -struct dcmi_computing_configurable { - /* memory resource, MB as unit */ - unsigned long long memory_size; - - /* accelator resource */ - float aic; - float aiv; - unsigned short dsa; - unsigned short rtsq; - unsigned short cdqm; - - /* cpu resource */ - unsigned short topic_schedule_aicpu; - unsigned short host_ctrl_cpu; - unsigned short host_aicpu; - unsigned short device_aicpu; - - unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; -}; struct dcmi_media_resource { /* dvpp resource */ float jpegd; @@ -543,22 +106,6 @@ struct dcmi_media_resource { unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; }; -struct dcmi_create_vdev_in { - char name[DCMI_VDEV_RES_NAME_LEN]; - struct dcmi_base_resource base; - struct dcmi_computing_configurable computing; - struct dcmi_media_resource media; -}; - -struct dcmi_create_vdev_out { - unsigned int vdev_id; - unsigned int pcie_bus; - unsigned int pcie_device; - unsigned int pcie_func; - unsigned int vfg_id; - unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; -}; - struct dcmi_vdev_query_info { char name[DCMI_VDEV_RES_NAME_LEN]; unsigned int status; @@ -572,11 +119,13 @@ struct dcmi_vdev_query_info { }; /* for single search */ +// vdev struct dcmi_vdev_query_stru { unsigned int vdev_id; struct dcmi_vdev_query_info query_info; }; +// free struct dcmi_soc_free_resource { unsigned int vfg_num; unsigned int vfg_bitmap; @@ -585,9 +134,10 @@ struct dcmi_soc_free_resource { struct dcmi_media_resource media; }; +// total struct dcmi_soc_total_resource { unsigned int vdev_num; - unsigned int vdev_id[32]; + unsigned int vdev_id[DCMI_VDEV_MAX_NUM]; unsigned int vfg_num; unsigned int vfg_bitmap; struct dcmi_base_resource base; @@ -595,495 +145,27 @@ struct dcmi_soc_total_resource { struct dcmi_media_resource media; }; -/*----------------------------------------------* - * Error code description * - *----------------------------------------------*/ - -#define DCMI_OK 0 -#define DCMI_ERROR_CODE_BASE -8000 -#define DCMI_ERR_CODE_INVALID_PARAMETER (DCMI_ERROR_CODE_BASE - 1) -#define DCMI_ERR_CODE_OPER_NOT_PERMITTED (DCMI_ERROR_CODE_BASE - 2) -#define DCMI_ERR_CODE_MEM_OPERATE_FAIL (DCMI_ERROR_CODE_BASE - 3) -#define DCMI_ERR_CODE_SECURE_FUN_FAIL (DCMI_ERROR_CODE_BASE - 4) -#define DCMI_ERR_CODE_INNER_ERR (DCMI_ERROR_CODE_BASE - 5) -#define DCMI_ERR_CODE_TIME_OUT (DCMI_ERROR_CODE_BASE - 6) -#define DCMI_ERR_CODE_INVALID_DEVICE_ID (DCMI_ERROR_CODE_BASE - 7) -#define DCMI_ERR_CODE_DEVICE_NOT_EXIST (DCMI_ERROR_CODE_BASE - 8) -#define DCMI_ERR_CODE_IOCTL_FAIL (DCMI_ERROR_CODE_BASE - 9) -#define DCMI_ERR_CODE_SEND_MSG_FAIL (DCMI_ERROR_CODE_BASE - 10) -#define DCMI_ERR_CODE_RECV_MSG_FAIL (DCMI_ERROR_CODE_BASE - 11) -#define DCMI_ERR_CODE_NOT_REDAY (DCMI_ERROR_CODE_BASE - 12) -#define DCMI_ERR_CODE_NOT_SUPPORT_IN_CONTAINER (DCMI_ERROR_CODE_BASE - 13) -#define DCMI_ERR_CODE_FILE_OPERATE_FAIL (DCMI_ERROR_CODE_BASE - 14) -#define DCMI_ERR_CODE_RESET_FAIL (DCMI_ERROR_CODE_BASE - 15) -#define DCMI_ERR_CODE_ABORT_OPERATE (DCMI_ERROR_CODE_BASE - 16) -#define DCMI_ERR_CODE_IS_UPGRADING (DCMI_ERROR_CODE_BASE - 17) -#define DCMI_ERR_CODE_RESOURCE_OCCUPIED (DCMI_ERROR_CODE_BASE - 20) -#define DCMI_ERR_CODE_PARTITION_NOT_RIGHT (DCMI_ERROR_CODE_BASE - 22) -#define DCMI_ERR_CODE_NOT_SUPPORT (DCMI_ERROR_CODE_BASE - 255) - -#define DCMI_VERSION_1 -#define DCMI_VERSION_2 - -#if defined DCMI_VERSION_2 +enum dcmi_unit_type { + NPU_TYPE = 0, + MCU_TYPE = 1, + CPU_TYPE = 2, + INVALID_TYPE = 0xFF +}; DCMIDLLEXPORT int dcmi_init(void); -DCMIDLLEXPORT int dcmi_get_dcmi_version(char *dcmi_ver, unsigned int len); - -DCMIDLLEXPORT int dcmi_get_driver_version(char *driver_ver, unsigned int len); - -DCMIDLLEXPORT int dcmi_get_card_list(int *card_num, int *card_list, int list_len); +DCMIDLLEXPORT int dcmi_get_card_num_list(int *card_num, int *card_list, int list_len); DCMIDLLEXPORT int dcmi_get_device_num_in_card(int card_id, int *device_num); -DCMIDLLEXPORT int dcmi_get_device_id_in_card(int card_id, int *device_id_max, int *mcu_id, int *cpu_id); - -DCMIDLLEXPORT int dcmi_get_device_type(int card_id, int device_id, enum dcmi_unit_type *device_type); - -DCMIDLLEXPORT int dcmi_get_device_chip_info(int card_id, int device_id, struct dcmi_chip_info *chip_info); - -DCMIDLLEXPORT int dcmi_get_device_pcie_info(int card_id, int device_id, struct dcmi_pcie_info *pcie_info); - -DCMIDLLEXPORT int dcmi_get_device_pcie_info_v2(int card_id, int device_id, struct dcmi_pcie_info_all *pcie_info); - -DCMIDLLEXPORT int dcmi_get_device_board_info(int card_id, int device_id, struct dcmi_board_info *board_info); - -DCMIDLLEXPORT int dcmi_get_device_elabel_info(int card_id, int device_id, struct dcmi_elabel_info *elabel_info); - -DCMIDLLEXPORT int dcmi_get_device_power_info(int card_id, int device_id, int *power); - -DCMIDLLEXPORT int dcmi_set_card_customized_info(int card_id, char *info, int len); - -DCMIDLLEXPORT int dcmi_get_card_customized_info(int card_id, char *info, int len); - -DCMIDLLEXPORT int dcmi_set_device_clear_pcie_error(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_get_device_pcie_error_cnt( - int card_id, int device_id, struct dcmi_chip_pcie_err_rate *pcie_err_code_info); - -DCMIDLLEXPORT int dcmi_get_device_die_v2( - int card_id, int device_id, enum dcmi_die_type input_type, struct dcmi_die_id *die_id); - -DCMIDLLEXPORT int dcmi_get_device_health(int card_id, int device_id, unsigned int *health); - -DCMIDLLEXPORT int dcmi_get_device_errorcode_v2( - int card_id, int device_id, int *error_count, unsigned int *error_code_list, unsigned int list_len); - -DCMIDLLEXPORT int dcmi_get_device_errorcode_string( - int card_id, int device_id, unsigned int error_code, unsigned char *error_info, int buf_size); - -DCMIDLLEXPORT int dcmi_get_device_flash_count(int card_id, int device_id, unsigned int *flash_count); - -DCMIDLLEXPORT int dcmi_get_device_flash_info_v2( - int card_id, int device_id, unsigned int flash_index, struct dcmi_flash_info *flash_info); - -DCMIDLLEXPORT int dcmi_get_device_aicore_info(int card_id, int device_id, struct dcmi_aicore_info *aicore_info); - -DCMIDLLEXPORT int dcmi_get_device_aicpu_info(int card_id, int device_id, struct dcmi_aicpu_info *aicpu_info); - -DCMIDLLEXPORT int dcmi_get_device_boot_status(int card_id, int device_id, enum dcmi_boot_status *boot_status); - -DCMIDLLEXPORT int dcmi_set_device_pre_reset(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_set_device_rescan(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_set_device_reset(int card_id, int device_id, enum dcmi_reset_channel channel_type); - -DCMIDLLEXPORT int dcmi_get_mcu_upgrade_status(int card_id, int *status, int *progress); - -DCMIDLLEXPORT int dcmi_get_mcu_version(int card_id, char *version, int len); - -DCMIDLLEXPORT int dcmi_set_mcu_upgrade_stage(int card_id, enum dcmi_upgrade_type input_type); - -DCMIDLLEXPORT int dcmi_set_mcu_upgrade_file(int card_id, const char *file); - -DCMIDLLEXPORT int dcmi_get_device_system_time(int card_id, int device_id, unsigned int *time); - -DCMIDLLEXPORT int dcmi_get_device_temperature(int card_id, int device_id, int *temperature); - -DCMIDLLEXPORT int dcmi_get_device_voltage(int card_id, int device_id, unsigned int *voltage); - -DCMIDLLEXPORT int dcmi_get_device_p2p_enable(int card_id, int device_id, int *enable_flag); - -DCMIDLLEXPORT int dcmi_get_device_ecc_info( - int card_id, int device_id, enum dcmi_device_type input_type, struct dcmi_ecc_info *device_ecc_info); - -DCMIDLLEXPORT int dcmi_set_device_clear_ecc_statistics_info(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_get_device_frequency( - int card_id, int device_id, enum dcmi_freq_type input_type, unsigned int *frequency); - -DCMIDLLEXPORT int dcmi_get_device_hbm_info(int card_id, int device_id, struct dcmi_hbm_info *hbm_info); - -DCMIDLLEXPORT int dcmi_get_device_memory_info_v2(int card_id, int device_id, struct dcmi_memory_info *memory_info); - -DCMIDLLEXPORT int dcmi_get_device_memory_info_v3(int card_id, int device_id, - struct dcmi_get_memory_info_stru *memory_info); - -DCMIDLLEXPORT int dcmi_get_device_utilization_rate( - int card_id, int device_id, int input_type, unsigned int *utilization_rate); - -DCMIDLLEXPORT int dcmi_get_device_sensor_info( - int card_id, int device_id, enum dcmi_manager_sensor_id sensor_id, union dcmi_sensor_info *sensor_info); - -DCMIDLLEXPORT int dcmi_set_container_service_enable(void); - -DCMIDLLEXPORT int dcmi_get_device_board_id(int card_id, int device_id, unsigned int *board_id); - -DCMIDLLEXPORT int dcmi_get_device_component_count(int card_id, int device_id, unsigned int *component_count); - -DCMIDLLEXPORT int dcmi_get_device_component_list( - int card_id, int device_id, enum dcmi_component_type *component_table, unsigned int component_count); - -DCMIDLLEXPORT int dcmi_get_device_component_static_version( - int card_id, int device_id, enum dcmi_component_type component_type, unsigned char *version_str, unsigned int len); - -DCMIDLLEXPORT int dcmi_get_device_cgroup_info(int card_id, int device_id, struct dcmi_cgroup_info *cg_info); - -DCMIDLLEXPORT int dcmi_get_device_llc_perf_para(int card_id, int device_id, struct dcmi_llc_perf *perf_para); - -DCMIDLLEXPORT int dcmi_set_device_info(int card_id, int device_id, enum dcmi_main_cmd main_cmd, unsigned int sub_cmd, - const void *buf, unsigned int buf_size); - -DCMIDLLEXPORT int dcmi_get_device_info( - int card_id, int device_id, enum dcmi_main_cmd main_cmd, unsigned int sub_cmd, void *buf, unsigned int *size); - -DCMIDLLEXPORT int dcmi_set_device_sec_revocation( - int card_id, int device_id, enum dcmi_revo_type input_type, const unsigned char *file_data, unsigned int file_size); - -DCMIDLLEXPORT int dcmi_get_device_mac_count(int card_id, int device_id, int *count); - -DCMIDLLEXPORT int dcmi_set_device_mac(int card_id, int device_id, int mac_id, const char *mac_addr, unsigned int len); - -DCMIDLLEXPORT int dcmi_get_device_mac(int card_id, int device_id, int mac_id, char *mac_addr, unsigned int len); - -DCMIDLLEXPORT int dcmi_get_device_gateway( - int card_id, int device_id, enum dcmi_port_type input_type, int port_id, struct dcmi_ip_addr *gateway); - -DCMIDLLEXPORT int dcmi_set_device_gateway( - int card_id, int device_id, enum dcmi_port_type input_type, int port_id, struct dcmi_ip_addr *gateway); - -DCMIDLLEXPORT int dcmi_set_device_ip(int card_id, int device_id, enum dcmi_port_type input_type, int port_id, - struct dcmi_ip_addr *ip, struct dcmi_ip_addr *mask); - -DCMIDLLEXPORT int dcmi_get_device_ip(int card_id, int device_id, enum dcmi_port_type input_type, int port_id, - struct dcmi_ip_addr *ip, struct dcmi_ip_addr *mask); - -DCMIDLLEXPORT int dcmi_get_device_network_health(int card_id, int device_id, enum dcmi_rdfx_detect_result *result); - -DCMIDLLEXPORT int dcmi_get_device_fan_count(int card_id, int device_id, int *count); - -DCMIDLLEXPORT int dcmi_get_device_fan_speed(int card_id, int device_id, int fan_id, int *speed); - -DCMIDLLEXPORT int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_get_card_elabel_v2(int card_id, struct dcmi_elabel_info *elabel_info); - -DCMIDLLEXPORT int dcmi_mcu_get_chip_temperature(int card_id, char *data_info, int buf_size, int *data_len); - -DCMIDLLEXPORT int dcmi_get_device_ssh_enable(int card_id, int device_id, int *enable_flag); - -DCMIDLLEXPORT int dcmi_set_device_share_enable(int card_id, int device_id, int enable_flag); - -DCMIDLLEXPORT int dcmi_get_device_share_enable(int card_id, int device_id, int *enable_flag); - -DCMIDLLEXPORT int dcmi_get_card_board_info(int card_id, struct dcmi_board_info *board_info); - -DCMIDLLEXPORT int dcmi_get_card_pcie_info(int card_id, char *pcie_info, int pcie_info_len); - -DCMIDLLEXPORT int dcmi_get_card_pcie_slot(int card_id, int *pcie_slot); - -DCMIDLLEXPORT int dcmi_get_fault_device_num_in_card(int card_id, int *device_num); - -DCMIDLLEXPORT int dcmi_mcu_check_i2c(int card_id, int *health_status, int buf_size); - -DCMIDLLEXPORT int dcmi_set_device_user_config( - int card_id, int device_id, const char *config_name, unsigned int buf_size, char *buf); - -DCMIDLLEXPORT int dcmi_mcu_collect_log(int card_id, int log_type); - -DCMIDLLEXPORT int dcmi_get_device_chip_slot(int card_id, int device_id, int *chip_pos_id); - -DCMIDLLEXPORT int dcmi_get_product_type(int card_id, int device_id, char *product_type_str, int buf_size); - -DCMIDLLEXPORT int dcmi_get_device_outband_channel_state(int card_id, int device_id, int *channel_state); - -DCMIDLLEXPORT int dcmi_get_device_aicpu_count_info(int card_id, int device_id, unsigned char *count_info); - DCMIDLLEXPORT int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, struct dcmi_create_vdev_out *out); DCMIDLLEXPORT int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int vdevid); -DCMIDLLEXPORT int dcmi_get_board_id(int card_id, int device_id, int *board_id); - -DCMIDLLEXPORT int dcmi_get_first_power_on_date(int card_id, unsigned int *first_power_on_date); - -DCMIDLLEXPORT int dcmi_get_fault_event(int card_id, int device_id, int timeout, struct dcmi_event_filter filter, - struct dcmi_event *event); - -DCMIDLLEXPORT int dcmi_get_device_resource_info(int card_id, int device_id, - struct dcmi_proc_mem_info *proc_info, int *proc_num); - -DCMIDLLEXPORT int dcmi_get_device_dvpp_ratio_info(int card_id, int device_id, struct dcmi_dvpp_ratio *usage); - -#endif - -#if defined DCMI_VERSION_1 -/* The following interfaces are V1 version interfaces. In order to ensure the compatibility is temporarily reserved, - * the later version will be deleted. Please switch to the V2 version interface as soon as possible */ - -struct dcmi_tag_pcie_idinfo { - unsigned int deviceid; - unsigned int venderid; - unsigned int subvenderid; - unsigned int subdeviceid; - unsigned int bdf_deviceid; - unsigned int bdf_busid; - unsigned int bdf_funcid; -}; - -struct dcmi_board_info_stru { - unsigned int board_id; - unsigned int pcb_id; - unsigned int bom_id; - unsigned int slot_id; -}; - -typedef struct dcmi_elabel_info_stru { - char product_name[MAX_LENTH]; - char model[MAX_LENTH]; - char manufacturer[MAX_LENTH]; - char serial_number[MAX_LENTH]; -}DCMI_ELABEL_INFO_STRU, *PDCMI_ELABEL_INFO_STRU; - -struct dcmi_chip_pcie_err_rate_stru { - unsigned int reg_deskew_fifo_overflow_intr_status; - unsigned int reg_symbol_unlock_intr_status; - unsigned int reg_deskew_unlock_intr_status; - unsigned int reg_phystatus_timeout_intr_status; - unsigned int symbol_unlock_counter; - unsigned int pcs_rx_err_cnt; - unsigned int phy_lane_err_counter; - unsigned int pcs_rcv_err_status; - unsigned int symbol_unlock_err_status; - unsigned int phy_lane_err_status; - unsigned int dl_lcrc_err_num; - unsigned int dl_dcrc_err_num; -}; - -struct dcmi_soc_die_stru { - unsigned int soc_die[5]; -}; - -struct dcmi_flash_info_stru { - unsigned long long flash_id; /* combined device & manufacturer code */ - unsigned short device_id; /* device id */ - unsigned short vendor; /* the primary vendor id */ - unsigned int state; /* flash health */ - unsigned long long size; /* total size in bytes */ - unsigned int sector_count; /* number of erase units */ - unsigned short manufacturer_id; /* manufacturer id */ -}; - -struct dcmi_ecc_info_stru { - int enable_flag; - unsigned int single_bit_error_count; - unsigned int double_bit_error_count; -}; - -struct dcmi_memory_info_stru { - unsigned long long memory_size; // 单位 MB - unsigned int freq; - unsigned int utiliza; -}; - -#ifndef __DSMI_COMMON_INTERFACE_H__ - -struct dsmi_soc_die_stru { - unsigned int soc_die[5]; -}; - -struct dsmi_board_info_stru { - unsigned int board_id; - unsigned int pcb_id; - unsigned int bom_id; - unsigned int slot_id; -}; - -struct tag_pcie_idinfo { - unsigned int deviceid; - unsigned int venderid; - unsigned int subvenderid; - unsigned int subdeviceid; - unsigned int bdf_deviceid; - unsigned int bdf_busid; - unsigned int bdf_funcid; -}; - -struct dm_flash_info_stru { - unsigned long flash_id; /* combined device & manufacturer code */ - unsigned short device_id; /* device id */ - unsigned short vendor; /* the primary vendor id */ - unsigned int state; /* flash health, 0x8:normal,0x10:abnormal */ - unsigned long size; /* total size in bytes */ - unsigned int sector_count; /* number of erase units */ - unsigned short manufacturer_id; /* manufacturer id */ -}; - -struct dsmi_aicore_info_stru { - unsigned int freq; /* normal freq */ - unsigned int curfreq; /* current freq */ -}; - -typedef struct dsmi_aicpu_info_stru { - unsigned int maxFreq; - unsigned int curFreq; - unsigned int aicpuNum; - unsigned int utilRate[16]; -} DSMI_AICPU_INFO; - -struct dsmi_ecc_info_stru { - int enable_flag; - unsigned int single_bit_error_count; - unsigned int double_bit_error_count; -}; - -struct dsmi_ecc_pages_stru { - unsigned int corrected_ecc_errors_aggregate_total; // 生命周期内所有可纠正ecc错误统计 - unsigned int uncorrected_ecc_errors_aggregate_total; // 生命周期内所有不可纠正ecc错误统计 - unsigned int isolated_pages_single_bit_error; // 单bit错误隔离内存页数量 - unsigned int isolated_pages_double_bit_error; // 多bit错误隔离内存页数量 -}; - -struct dsmi_hbm_info_stru { - unsigned long long memory_size; /**< HBM total size, KB */ - unsigned int freq; /**< HBM freq, MHZ */ - unsigned long long memory_usage; /**< HBM memory_usage, KB */ - int temp; /**< HBM temperature */ - unsigned int bandwith_util_rate; -}; - -struct dsmi_memory_info_stru { - unsigned long long memory_size; - unsigned int freq; - unsigned int utiliza; -}; - -typedef union tag_sensor_info { - unsigned char uchar; - unsigned short ushort; - unsigned int uint; - signed int iint; - signed char temp[2]; /* < 2 temp size */ - signed int ntc_tmp[4]; /* < 4 ntc_tmp size */ - unsigned int data[16]; -} TAG_SENSOR_INFO; - -struct dsmi_computing_power_info { - unsigned int data1; - unsigned int reserve[3]; -}; -#endif /* __DSMI_COMMON_INTERFACE_H__ */ - -DCMIDLLEXPORT int dcmi_get_card_num_list(int *card_num, int *card_list, int list_len); - -DCMIDLLEXPORT int dcmi_get_pcie_info(int card_id, int device_id, struct dcmi_tag_pcie_idinfo *pcie_idinfo); - -DCMIDLLEXPORT int dcmi_get_board_info(int card_id, int device_id, struct dcmi_board_info_stru *board_info); - -DCMIDLLEXPORT int dcmi_get_card_elabel(int card_id, struct dcmi_elabel_info_stru *elabel_info); - -DCMIDLLEXPORT int dcmi_mcu_set_license_info(int card_id, char *license, int len); - -DCMIDLLEXPORT int dcmi_mcu_get_license_info(int card_id, char *data_info, int *len); - -DCMIDLLEXPORT int dcmi_get_customized_info_api(int card_id, char *data_info, int *len); - -DCMIDLLEXPORT int dcmi_set_customized_info_api(int card_id, const char *data_info, int len); - -DCMIDLLEXPORT int dcmi_clear_pcie_error_cnt(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_get_pcie_error_cnt( - int card_id, int device_id, struct dcmi_chip_pcie_err_rate_stru *pcie_err_code_info); - -DCMIDLLEXPORT int dcmi_get_device_die(int card_id, int device_id, struct dcmi_soc_die_stru *device_die); - -DCMIDLLEXPORT int dcmi_get_device_ndie(int card_id, int device_id, struct dsmi_soc_die_stru *device_ndie); - -DCMIDLLEXPORT int dcmi_get_device_errorcode( - int card_id, int device_id, int *error_count, unsigned int *error_code, int *error_width); - -DCMIDLLEXPORT int dcmi_get_device_errorinfo( - int card_id, int device_id, int errorcode, unsigned char *errorinfo, int buf_size); - -DCMIDLLEXPORT int dcmi_get_device_flash_info( - int card_id, int device_id, unsigned int flash_index, struct dcmi_flash_info_stru *flash_info); - -DCMIDLLEXPORT int dcmi_get_aicore_info(int card_id, int device_id, struct dsmi_aicore_info_stru *aicore_info); - -DCMIDLLEXPORT int dcmi_get_aicpu_info(int card_id, int device_id, struct dsmi_aicpu_info_stru *aicpu_info); - -DCMIDLLEXPORT int dcmi_pre_reset_soc(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_rescan_soc(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_reset_device(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_mcu_get_upgrade_statues(int card_id, int *status, int *progress); - -DCMIDLLEXPORT int dcmi_mcu_get_upgrade_status(int card_id, int *status, int *progress); - -DCMIDLLEXPORT int dcmi_mcu_get_version(int card_id, char *version_str, int max_version_len, int *len); - -DCMIDLLEXPORT int dcmi_mcu_upgrade_control(int card_id, int upgrade_type); - -DCMIDLLEXPORT int dcmi_mcu_upgrade_transfile(int card_id, const char *file); - -DCMIDLLEXPORT int dcmi_get_p2p_enable(int card_id, int device_id, int *enable_flag); - -DCMIDLLEXPORT int dcmi_get_ecc_info( - int card_id, int device_id, int device_type, struct dsmi_ecc_info_stru *device_ecc_info); - -DCMIDLLEXPORT int dcmi_get_hbm_info(int card_id, int device_id, struct dsmi_hbm_info_stru *device_hbm_info); - -DCMIDLLEXPORT int dcmi_get_memory_info(int card_id, int device_id, struct dcmi_memory_info_stru *device_memory_info); - -DCMIDLLEXPORT int dcmi_get_soc_sensor_info( - int card_id, int device_id, int sensor_id, union tag_sensor_info *sensor_info); - -DCMIDLLEXPORT int dcmi_config_ecc_enable(int card_id, int device_id, int enable_flag); - -DCMIDLLEXPORT int dcmi_get_version(int card_id, int device_id, char *verison_str, unsigned int version_len, int *len); - -DCMIDLLEXPORT int dcmi_mcu_get_board_info(int card_id, struct dcmi_board_info *board_info); - -DCMIDLLEXPORT int dcmi_mcu_get_power_info(int card_id, int *power); - -DCMIDLLEXPORT int dcmi_get_computing_power_info( - int card_id, int device_id, int type, struct dsmi_computing_power_info *computing_power); - -DCMIDLLEXPORT int dcmi_set_device_ecc_enable( - int card_id, int device_id, enum dcmi_device_type device_type, int enable_flag); - -DCMIDLLEXPORT int dcmi_set_user_config( - int card_id, int device_id, const char *config_name, unsigned int buf_size, unsigned char *buf); - -DCMIDLLEXPORT int dcmi_get_user_config( - int card_id, int device_id, const char *config_name, unsigned int buf_size, unsigned char *buf); - -DCMIDLLEXPORT int dcmi_clear_device_user_config(int card_id, int device_id, const char *config_name); - -DCMIDLLEXPORT int dcmi_reset_device_inband(int card_id, int device_id); - -DCMIDLLEXPORT int dcmi_get_nve_level(int card_id, int device_id, int *nve_level); - -DCMIDLLEXPORT int dcmi_set_nve_level(int card_id, int device_id, int level); - -DCMIDLLEXPORT int dcmi_get_system_time(int card_id, int device_id, unsigned int *time); +DCMIDLLEXPORT int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id); -#endif +DCMIDLLEXPORT int dcmi_get_device_type(int card_id, int device_id, enum dcmi_unit_type *device_type); #ifdef __cplusplus #if __cplusplus -- Gitee From 8d7f0bb299dbf3088f24010c7606d6e86204394a Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 30 Mar 2022 16:18:56 +0800 Subject: [PATCH 209/296] Match-id-ce0ccd5599eae8f1f49c9dbc3d268bf48b20d988 --- runtime/dcmi/dcmi.go | 4 ++-- runtime/main.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 042dfd9..dcf9b49 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -284,7 +284,7 @@ func CreateVDevice(spec *specs.Spec) (VDeviceInfo, error) { func extractVpuParam(spec *specs.Spec) (int32, string, error) { visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" allowSplit := map[string]string{ - "1C": "vir01", "2C": "vir02", "4C": "vir04", "8C": "vir08", "16C": "vir16", + "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", } for _, line := range spec.Process.Env { @@ -296,7 +296,7 @@ func extractVpuParam(spec *specs.Spec) (int32, string, error) { if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { visibleDeviceLine = words[1] } - if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_VPU_DEVICES" { + if strings.TrimSpace(words[0]) == "ASCEND_VNPU_SPECS" { if split := allowSplit[words[1]]; split != "" { splitDevice = split needSplit = true diff --git a/runtime/main.go b/runtime/main.go index 9f5dad8..ab6d095 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -101,7 +101,6 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(spec) - fmt.Printf("create vdevice %v \n", vdevice) if err != nil { return err -- Gitee From bbd6b60e70fc7b717bbb425f46ffd3c91f6c0a64 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 24 Mar 2022 19:26:00 +0800 Subject: [PATCH 210/296] Match-id-05ba41f4516153c409e8b60df1ea0ae4187fc4e1 --- build/build.sh | 15 ++- build/scripts/run_main.sh | 4 + destroy/src/CMakeLists.txt | 15 +++ destroy/src/main.c | 217 +++++++++++++++++++++++++++++++++++++ 4 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 destroy/src/CMakeLists.txt create mode 100644 destroy/src/main.c diff --git a/build/build.sh b/build/build.sh index 6de020e..3715631 100644 --- a/build/build.sh +++ b/build/build.sh @@ -12,6 +12,7 @@ OUTPUT=${ROOT}/output BUILD=${ROOT}/build CLIDIR=${ROOT}/cli +DESTROYDIR=${ROOT}/destroy CLISRCNAME="main.c" INSTALLHELPERDIR=${ROOT}/install @@ -25,6 +26,8 @@ RUNTIMESRCNAME="main.go" CLISRCPATH=$(find ${CLIDIR} -name "${CLISRCNAME}") CLISRCDIR=${CLISRCPATH%/${CLISRCNAME}} +DESTROYSRCPATH=$(find ${DESTROYDIR} -name "${CLISRCNAME}") +DESTROYDIR=${DESTROYSRCPATH%/${CLISRCNAME}} INSTALLHELPERSRCPATH=$(find ${INSTALLHELPERDIR} -name "${INSTALLHELPERSRCNAME}") INSTALLHELPERSRCDIR=${INSTALLHELPERSRCPATH%/${INSTALLHELPERSRCNAME}} HOOKSRCPATH=$(find ${HOOKDIR} -name "${HOOKSRCNAME}") @@ -38,6 +41,14 @@ CPUARCH=$(uname -m) function build_bin() { + echo "make destroy" + [ -d "${BUILD}/build/destroy/build" ] && rm -rf ${BUILD}/build/destroy/build + mkdir -p ${BUILD}/build/destroy/build && cd ${BUILD}/build/destroy/build + + cmake ${DESTROYDIR} + make clean + make + echo "make cli" [ -d "${BUILD}/build/cli/build" ] && rm -rf ${BUILD}/build/cli/build mkdir -p ${BUILD}/build/cli/build && cd ${BUILD}/build/cli/build @@ -87,14 +98,14 @@ function build_run_package() cd ${BUILD} mkdir run_pkg - /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli}/build/ascend-docker* run_pkg + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli,${BUILD}/build/destroy}/build/ascend-docker* run_pkg /bin/cp -f scripts/uninstall.sh run_pkg /bin/cp -f scripts/base.list run_pkg /bin/cp -f scripts/base.list_A500 run_pkg /bin/cp -f scripts/base.list_A200 run_pkg FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) echo "prepare package $FILECNT bins" - if [ $FILECNT -ne 8 ]; then + if [ $FILECNT -ne 9 ]; then exit 1 fi /bin/cp -rf ${ROOT}/assets run_pkg diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index d4439bd..768422c 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -19,10 +19,12 @@ function install() cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + chmod 550 ${INSTALL_PATH}/ascend-docker-destroy cp -rf ./assets ${INSTALL_PATH}/assets cp -f ./README.md ${INSTALL_PATH}/README.md @@ -100,12 +102,14 @@ function upgrade() cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + chmod 550 ${INSTALL_PATH}/ascend-docker-destroy chmod 500 ${INSTALL_PATH}/script/uninstall.sh chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list diff --git a/destroy/src/CMakeLists.txt b/destroy/src/CMakeLists.txt new file mode 100644 index 0000000..1b413ee --- /dev/null +++ b/destroy/src/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.26) +project(ascend-docker-destroy C) +set(CMAKE_C_STANDARD 11) +## The common options using by both c and cxx + +add_compile_options(-fstack-protector-all -D _GNU_SOURCE -Wl,--no-undefined) + +message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") +aux_source_directory(. SRC) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC) +add_executable(ascend-docker-destroy ${SRC}) +target_compile_options(ascend-docker-destroy PRIVATE -fstack-protector-all -fpie -ldl -D_FORTIFY_SOURCE=2 -O2) +target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/destroy/src/main.c b/destroy/src/main.c new file mode 100644 index 0000000..aea8618 --- /dev/null +++ b/destroy/src/main.c @@ -0,0 +1,217 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved. + * Description: 算力切分数据销毁入口 +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "securec.h" + +#define DCMI_INIT "dcmi_init" +#define DCMI_SET_DESTROY_VDEVICE "dcmi_set_destroy_vdevice" +#define ROOT_UID 0 +#define DECIMAL 10 +#define DESTROY_PARAMS_NUM 4 +#define PARAMS_SECOND 1 +#define PARAMS_THIRD 2 +#define PARAMS_FOURTH 3 +#define ID_MAX 65535 + +static bool ShowExceptionInfo(const char* exceptionInfo) +{ + (void)fprintf(stderr, exceptionInfo); + (void)fprintf(stderr, "\n"); + return false; +} + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } + } + if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 + return ShowExceptionInfo("Please check the write permission!"); + } + if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { + break; + } + if (strcmp(dirname(buf), ".") == 0) { + break; + } + if (stat(buf, &fileStat) != 0) { + return false; + } + } + return true; +} + +static bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + if (strstr(filePath, "..") != NULL) { // 存在".." + return ShowExceptionInfo("filePath has an illegal character!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && + (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + return ShowExceptionInfo("filePath has a soft link!"); + } + return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); +} + +static bool DeclareDcmiApiAndCheck(void **handle) +{ + *handle = dlopen("libdcmi.so", RTLD_LAZY); + if (*handle == NULL) { + (void)fprintf(stderr, "dlopen failed.\n"); + return false; + } + char pLinkMap[sizeof(struct link_map)] = {0}; + int ret = dlinfo(*handle, RTLD_DI_LINKMAP, &pLinkMap); + if (ret == 0) { + struct link_map* pLink = *(struct link_map**)pLinkMap; + const size_t maxFileSzieMb = 10; // max 10 mb + if (!CheckExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { + (void)fprintf(stderr, "check sofile failed.\n"); + return false; + } + } else { + (void)fprintf(stderr, "dlinfo sofile failed.\n"); + return false; + } + + return true; +} + +static void DcmiDlAbnormalExit(void **handle, const char* errorInfo) +{ + (void)fprintf(stderr, errorInfo); + (void)fprintf(stderr, "\n"); + if (*handle != NULL) { + dlclose(*handle); + *handle = NULL; + } +} + +static void DcmiDlclose(void **handle) +{ + if (*handle != NULL) { + dlclose(*handle); + *handle = NULL; + } +} + +static int DestroyEntrance(const char *argv[]) +{ + if (argv == NULL) { + return -1; + } + errno = 0; + int cardId = atoi(argv[PARAMS_SECOND]); + if ((errno != 0) || (cardId < 0) || (cardId > ID_MAX)) { + return -1; + } + int deviceId = atoi(argv[PARAMS_THIRD]); + if ((errno != 0) || (deviceId < 0) || (deviceId > ID_MAX)) { + return -1; + } + int vDeviceId = atoi(argv[PARAMS_FOURTH]); + if ((errno != 0) || (vDeviceId < 0) || (vDeviceId > ID_MAX)) { + return -1; + } + void *handle = NULL; + if (!DeclareDcmiApiAndCheck(&handle)) { + (void)fprintf(stderr, "Declare dcmi failed.\n"); + return -1; + } + int (*dcmi_init)(void) = NULL; + int (*dcmi_set_destroy_vdevice)(int, int, int) = NULL; + dcmi_init = dlsym(handle, DCMI_INIT); + if (dcmi_init == NULL) { + DcmiDlAbnormalExit(&handle, "DeclareDlApi failed"); + return -1; + } + dcmi_set_destroy_vdevice = dlsym(handle, DCMI_SET_DESTROY_VDEVICE); + if (dcmi_set_destroy_vdevice == NULL) { + DcmiDlAbnormalExit(&handle, "DeclareDlApi failed"); + return -1; + } + int ret = dcmi_init(); + if (ret != 0) { + (void)fprintf(stderr, "dcmi_init failed, ret = %d\n", ret); + DcmiDlclose(&handle); + return -1; + } + ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); + if (ret != 0) { + (void)fprintf(stderr, "dcmi_set_destroy_vdevice failed, ret = %d\n", ret); + DcmiDlclose(&handle); + return -1; + } + DcmiDlclose(&handle); + return ret; +} + +static bool EntryCheck(const int argc, const char *argv[]) +{ + if (argc != DESTROY_PARAMS_NUM) { + (void)fprintf(stderr, "destroy params namber error.\n"); + return false; + } + for (int iLoop = 1; iLoop < argc; iLoop++) { + for (size_t jLoop = 0; jLoop < strlen(argv[iLoop]); jLoop++) { + if (isdigit(argv[iLoop][jLoop]) == 0) { + return false; + } + } + } + return true; +} + +int main(const int argc, const char *argv[]) +{ + if (!EntryCheck(argc, argv)) { + (void)fprintf(stderr, "destroy params value error.\n"); + return -1; + } + + return DestroyEntrance(argv); +} \ No newline at end of file -- Gitee From 80ec9d482201ae12901981947bd3067eb2f121ac Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 7 Apr 2022 16:56:59 +0800 Subject: [PATCH 211/296] Match-id-cd2735ec23dcbe357a3201737c9de4694aee8177 --- cli/src/cgrp.c | 112 ++++++++++-------- cli/src/logger.c | 163 +++++++++++++++---------- cli/src/main.c | 1 - cli/src/u_mount.c | 167 +++++++++++++++++--------- cli/src/u_mount.h | 2 + cli/src/utils.c | 68 +++++++---- destroy/src/main.c | 185 +++++++++++++++++++++-------- install/deb/src/main.c | 263 +++++++++++++++++++++++++++-------------- 8 files changed, 624 insertions(+), 337 deletions(-) diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 4c2d945..9e77f63 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -15,6 +15,7 @@ #include "securec.h" +#include "u_mount.h" #include "utils.h" #include "options.h" #include "logger.h" @@ -82,34 +83,17 @@ bool CheckSubStr(char **pLine, const char *subsys) return strstr(substr, subsys) != NULL; } - typedef char *(*ParseFileLine)(char *, const char *); -int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) +static bool GetFileInfo(const char* resolvedPath, char* buffer, const int bufferSize, const ParseFileLine fn) { - if (buffer == NULL || filepath == NULL) { - (void)fprintf(stderr, "buffer, filepath pointer is null!\n"); - return -1; - } - FILE *fp = NULL; - char *result = NULL; char *line = NULL; size_t len = 0; - char resolvedPath[PATH_MAX] = {0x0}; - - if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { - Logger("Cannot canonicalize path.", LEVEL_ERROR, SCREEN_YES); - return -1; - } - const size_t maxFileSzieMb = 1024; // max 1G - if (!CheckExternalFile(resolvedPath, strlen(resolvedPath), maxFileSzieMb, true)) { - Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); - return -1; - } + char *result = NULL; fp = fopen(resolvedPath, "r"); if (fp == NULL) { Logger("cannot open file.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } while (getline(&line, &len, fp) != -1) { @@ -123,6 +107,30 @@ int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const free(line); fclose(fp); if (ret != EOK) { + return false; + } + return true; +} + +int ParseFileByLine(char* buffer, int bufferSize, const ParseFileLine fn, const char* filepath) +{ + if (buffer == NULL || filepath == NULL) { + (void)fprintf(stderr, "buffer, filepath pointer is null!\n"); + return -1; + } + + char resolvedPath[PATH_MAX] = {0x0}; + + if (realpath(filepath, resolvedPath) == NULL && errno != ENOENT) { + Logger("Cannot canonicalize path.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedPath, strlen(resolvedPath), maxFileSzieMb, true)) { + Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + if (!GetFileInfo(resolvedPath, buffer, bufferSize, fn)) { return -1; } @@ -239,16 +247,11 @@ int SetupDriverCgroup(FILE *cgroupAllow) return -1; } - char devmmPath[PATH_MAX] = {0}; - char hisiPath[PATH_MAX] = {0}; - if ((sprintf_s(devmmPath, PATH_MAX, "/dev/%s", DEVMM_SVM) < 0) || - (sprintf_s(hisiPath, PATH_MAX, "/dev/%s", HISI_HDC) < 0)) { - Logger("failed to assemble path.", LEVEL_ERROR, SCREEN_YES); + bool is200Rc = false; + if (!DoMounting200RC(&is200Rc)) { return -1; } - struct stat devStat; // 200 soc 不需要挂载此两个设备 - if ((stat(devmmPath, &devStat) != 0) && (stat(hisiPath, &devStat) != 0)) { - Logger("200 Soc.", LEVEL_ERROR, SCREEN_YES); + if (is200Rc) { return 0; } @@ -324,36 +327,21 @@ int GetCgroupPath(int pid, char *effPath, size_t maxSize) return 0; } -int SetupCgroup(const struct ParsedConfig *config) +static bool SetupCgroupProcess(const char* resolvedCgroupPath, const struct ParsedConfig *config) { - if (config == NULL) { - (void)fprintf(stderr, "config pointer is null!\n"); - return -1; - } - char *str = NULL; - char deviceName[BUF_SIZE] = {0}; - char resolvedCgroupPath[PATH_MAX] = {0}; FILE *cgroupAllow = NULL; - if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { - Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); - return -1; - } - const size_t maxFileSzieMb = 1024; // max 1G - if (!CheckExternalFile(resolvedCgroupPath, strlen(resolvedCgroupPath), maxFileSzieMb, true)) { - Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); - return -1; - } - cgroupAllow = fopen((const char *)resolvedCgroupPath, "a"); + char deviceName[BUF_SIZE] = {0}; + cgroupAllow = fopen(resolvedCgroupPath, "a"); if (cgroupAllow == NULL) { Logger("failed to open cgroup file.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } if (SetupDriverCgroup(cgroupAllow) < 0) { fclose(cgroupAllow); Logger("failed to setup driver cgroup.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } for (size_t idx = 0; idx < config->devicesNr; idx++) { if (sprintf_s(deviceName, BUF_SIZE, "%s%u", @@ -363,16 +351,40 @@ int SetupCgroup(const struct ParsedConfig *config) str = FormatLogMessage("failed to assemble device path for no.%u.", config->devices[idx]); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } if (SetupDeviceCgroup(cgroupAllow, (const char *)deviceName) < 0) { fclose(cgroupAllow); Logger("failed to setup cgroup.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } } free(str); fclose(cgroupAllow); + return true; +} + +int SetupCgroup(const struct ParsedConfig *config) +{ + if (config == NULL) { + (void)fprintf(stderr, "config pointer is null!\n"); + return -1; + } + + char resolvedCgroupPath[PATH_MAX] = {0}; + if (realpath(config->cgroupPath, resolvedCgroupPath) == NULL && errno != ENOENT) { + Logger("cannot canonicalize cgroup.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + const size_t maxFileSzieMb = 1024; // max 1G + if (!CheckExternalFile(resolvedCgroupPath, strlen(resolvedCgroupPath), maxFileSzieMb, true)) { + Logger("Check file legality failed.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + if (!SetupCgroupProcess(resolvedCgroupPath, config)) { + return -1; + } + return 0; } \ No newline at end of file diff --git a/cli/src/logger.c b/cli/src/logger.c index 3871c07..d119738 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -59,6 +59,22 @@ int CreateLog(const char* filename) return 0; } +static long GetLogSizeProcess(const char* path) +{ + FILE *fp = NULL; + fp = fopen(path, "rb"); + long length = 0; + if (fp != NULL) { + fseek(fp, 0, SEEK_END); + length = ftell(fp); + } + if (fp != NULL) { + fclose(fp); + fp = NULL; + } + return length; +} + long GetLogSize(const char* filename) { if (filename == NULL) { @@ -71,7 +87,7 @@ long GetLogSize(const char* filename) if (ret < 0) { return -1; } - FILE *fp = NULL; + char path[PATH_MAX + 1] = {0x00}; if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return -1; @@ -83,17 +99,7 @@ long GetLogSize(const char* filename) return -1; } } - fp = fopen(path, "rb"); - long length = 0; - if (fp != NULL) { - fseek(fp, 0, SEEK_END); - length = ftell(fp); - } - if (NULL != fp) { - fclose(fp); - fp = NULL; - } - return length; + return GetLogSizeProcess(path); } @@ -122,86 +128,98 @@ int LogLoop(const char* filename) return ret; } -void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) +static void WriteLogInfo(const char* path, size_t pathLen, const char* buffer, const unsigned bufferSize) { - if (filename == NULL || buffer == NULL) { - (void)fprintf(stderr, "filename, buffer pointer is null!\n"); + if (path == NULL) { return; } - - if (filename != NULL && buffer != NULL) { - char path[PATH_MAX + 1] = {0x00}; - FILE *fp = NULL; - int ret; - long length = GetLogSize(filename); - if (length < 0) { - return; - } - if (length > maxSize) { - ret = LogLoop(filename); - if (ret < 0) { - return; - } - } - if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { + FILE *fp = NULL; + int ret = 0; + fp = fopen(path, "a+"); + if (fp != NULL) { + char now[TEMP_BUFFER] = {0}; + ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); + if (ret < 0) { + fclose(fp); return; } - struct stat fileStat; - if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { - const size_t maxFileSzieMb = 50; // max 50MB - if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { - return; - } - } - fp = fopen(path, "a+"); - if (fp != NULL) { - char now[TEMP_BUFFER] = {0}; - ret = GetCurrentLocalTime(now, sizeof(now) / sizeof(char)); - if (ret < 0) { - fclose(fp); - return; - } - fwrite(now, strlen(now), 1, fp); - fwrite(buffer, bufferSize, 1, fp); - fclose(fp); - fp = NULL; + fwrite(now, strlen(now), 1, fp); + fwrite(buffer, bufferSize, 1, fp); + fclose(fp); + fp = NULL; + } + return; +} + +static bool LogConvertStorage(const char* filename, const long maxSize) +{ + long length = GetLogSize(filename); + if (length < 0) { + return false; + } + if (length > maxSize) { + int ret = LogLoop(filename); + if (ret < 0) { + return false; } } + return true; } -void Logger(const char *msg, int level, int screen) +static void LogFileProcess(const char* filename, const long maxSize, const char* buffer, const unsigned bufferSize) { - if (msg == NULL) { + if (filename == NULL) { return; } - if (screen == SCREEN_YES) { - LOG_ERROR(msg); + int ret = 0; + char path[PATH_MAX + 1] = {0x00}; + if (!LogConvertStorage(filename, maxSize)) { + return; } - int ret; - char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; - if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_LOGDIR_MODE) < 0) { + if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return; } - int destMax = LOG_LENGTH; - if (destMax <= 0) { + struct stat fileStat; + if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { + const size_t maxFileSzieMb = 50; // max 50MB + if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { + return; + } + } + WriteLogInfo(path, PATH_MAX + 1, buffer, bufferSize); +} + +void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsigned bufferSize) +{ + if (filename == NULL || buffer == NULL) { + (void)fprintf(stderr, "filename, buffer pointer is null!\n"); return; } - char* buffer = malloc(destMax); + + if (filename != NULL && buffer != NULL) { + LogFileProcess(filename, maxSize, buffer, bufferSize); + } +} + +static void DivertAndWrite(const char *logPath, const char *msg, const int level) +{ + int ret; + char* buffer = malloc(LOG_LENGTH); if (buffer == NULL) { return; } switch (level) { case LEVEL_DEBUG: - ret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); + ret = sprintf_s(buffer, LOG_LENGTH, "[Debug]%s\n", msg); break; case LEVEL_ERROR: - ret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); + ret = sprintf_s(buffer, LOG_LENGTH, "[Error]%s\n", msg); break; case LEVEL_WARN: - ret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); + ret = sprintf_s(buffer, LOG_LENGTH, "[Warn]%s\n", msg); break; default: - ret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); + ret = sprintf_s(buffer, LOG_LENGTH, "[Info]%s\n", msg); } if (ret < 0) { free(buffer); @@ -210,3 +228,20 @@ void Logger(const char *msg, int level, int screen) WriteLogFile(logPath, FILE_MAX_SIZE, buffer, strlen(buffer)); free(buffer); } + +void Logger(const char *msg, int level, int screen) +{ + if (msg == NULL) { + return; + } + if (screen == SCREEN_YES) { + LOG_ERROR(msg); + } + int ret; + char *logPath = LOG_PATH_DIR"docker-runtime-log.log"; + if (MakeDirWithParent(LOG_PATH_DIR, DEFAULT_LOGDIR_MODE) < 0) { + return; + } + + DivertAndWrite(logPath, msg, level); +} diff --git a/cli/src/main.c b/cli/src/main.c index 0cba8bd..a5efd10 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -291,7 +291,6 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config) free(str); return -1; } - ret = GetCgroupPath(args->pid, config->cgroupPath, BUF_SIZE); if (ret < 0) { Logger("failed to get cgroup path.", LEVEL_ERROR, SCREEN_YES); diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 42d4339..44d1b3a 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -16,16 +16,8 @@ #include "options.h" #include "logger.h" -int Mount(const char *src, const char *dst) +static bool checkSrcFile(const char *src) { - if (src == NULL || dst == NULL) { - Logger("src pointer or dst pointer is null!", LEVEL_ERROR, SCREEN_YES); - return -1; - } - - static const unsigned long mountFlags = MS_BIND; - static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; - int ret; struct stat fileStat; if ((stat(src, &fileStat) == 0) && ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 @@ -33,10 +25,25 @@ int Mount(const char *src, const char *dst) if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { char* str = FormatLogMessage("failed to mount src: %s.", src); Logger(str, LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } } - ret = mount(src, dst, NULL, mountFlags, NULL); + return true; +} + +int Mount(const char *src, const char *dst) +{ + if (src == NULL || dst == NULL) { + Logger("src pointer or dst pointer is null!", LEVEL_ERROR, SCREEN_YES); + return -1; + } + + static const unsigned long mountFlags = MS_BIND; + static const unsigned long remountFlags = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID; + if (!checkSrcFile(src)) { + return -1; + } + int ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { Logger("failed to mount src.", LEVEL_ERROR, SCREEN_YES); return -1; @@ -51,24 +58,26 @@ int Mount(const char *src, const char *dst) return 0; } -static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, - const char *dstDeviceName, struct PathInfo* pathInfo) +static bool GetDeviceCheckParam(const char *rootfs, const char *srcDeviceName, + struct PathInfo* pathInfo) { if (rootfs == NULL || srcDeviceName == NULL || pathInfo == NULL) { Logger("rootfs, srcDeviceName, pathInfo pointer are null!", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } + return true; +} - int ret; +static int GetDeviceMntSrcDstProcess(const char *rootfs, const char *srcDeviceName, + const char *dstDeviceName, struct PathInfo* pathInfo) +{ + if (!GetDeviceCheckParam(rootfs, srcDeviceName, pathInfo)) { + return -1; + } + int ret = 0; errno_t err; char unresolvedDst[BUF_SIZE] = {0}; char resolvedDst[PATH_MAX] = {0}; - - ret = VerifyPathInfo(pathInfo); - if (ret < 0) { - return -1; - } - size_t srcBufSize = pathInfo->srcLen; size_t dstBufSize = pathInfo->dstLen; char *src = pathInfo->src; @@ -98,53 +107,75 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, return -1; } } - return 0; } -int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) +static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, + const char *dstDeviceName, struct PathInfo* pathInfo) { - int ret; - char *str = NULL; - char src[BUF_SIZE] = {0}; - char dst[BUF_SIZE] = {0}; - struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; - ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); - if (ret < 0) { - Logger("failed to get mount src and dst path.", LEVEL_ERROR, SCREEN_YES); + if (!GetDeviceCheckParam(rootfs, srcDeviceName, pathInfo)) { return -1; } - struct stat srcStat; - ret = stat((const char *)src, &srcStat); + int ret = VerifyPathInfo(pathInfo); if (ret < 0) { - Logger("failed to stat src.", LEVEL_ERROR, SCREEN_YES); return -1; } + + return GetDeviceMntSrcDstProcess(rootfs, srcDeviceName, dstDeviceName, pathInfo); +} + +static bool MountDeviceProcess(const char* dst, const char* src, const mode_t mode) +{ + int ret; errno = 0; struct stat dstStat; - ret = stat((const char *)dst, &dstStat); + ret = stat(dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { Logger("dst already exists but not a char device as expected.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } else if (ret < 0 && errno != ENOENT) { Logger("failed to check dst stat", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } - ret = MakeMountPoints(dst, srcStat.st_mode); + ret = MakeMountPoints(dst, mode); if (ret < 0) { Logger("failed to create mount dst file.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } ret = Mount(src, dst); if (ret < 0) { Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); + return false; + } + return true; +} + +int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) +{ + int ret; + char src[BUF_SIZE] = {0}; + char dst[BUF_SIZE] = {0}; + struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; + ret = GetDeviceMntSrcDst(rootfs, srcDeviceName, dstDeviceName, &pathInfo); + if (ret < 0) { + Logger("failed to get mount src and dst path.", LEVEL_ERROR, SCREEN_YES); + return -1; + } + + struct stat srcStat; + ret = stat((const char *)src, &srcStat); + if (ret < 0) { + Logger("failed to stat src.", LEVEL_ERROR, SCREEN_YES); return -1; } - free(str); + if (!MountDeviceProcess(dst, src, srcStat.st_mode)) { + return -1; + } + return 0; } @@ -250,41 +281,31 @@ int MountDir(const char *rootfs, const char *src) return 0; } -int DoCtrlDeviceMounting(const char *rootfs) +bool DoMounting200RC(bool* is200Rc) { - if (rootfs == NULL) { - Logger("rootfs pointer is null!", LEVEL_ERROR, SCREEN_YES); - return -1; - } - - /* device */ - int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); - if (ret < 0) { - char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); // error1 - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); - return -1; - } - char devmmPath[PATH_MAX] = {0}; char hisiPath[PATH_MAX] = {0}; if ((sprintf_s(devmmPath, PATH_MAX, "/dev/%s", DEVMM_SVM) < 0) || (sprintf_s(hisiPath, PATH_MAX, "/dev/%s", HISI_HDC) < 0)) { Logger("failed to assemble dev path.", LEVEL_ERROR, SCREEN_YES); - return -1; + return false; } struct stat devStat; // 200 soc 不需要挂载此两个设备 if ((stat(devmmPath, &devStat) != 0) && (stat(hisiPath, &devStat) != 0)) { Logger("200 Soc.", LEVEL_ERROR, SCREEN_YES); - return 0; + *is200Rc = true; } + return true; +} - ret = MountDevice(rootfs, DEVMM_SVM, NULL); +static bool DoMountingDevice(const char *rootfs) +{ + int ret = MountDevice(rootfs, DEVMM_SVM, NULL); if (ret < 0) { char* str = FormatLogMessage("failed to mount device %s.", DEVMM_SVM); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } ret = MountDevice(rootfs, HISI_HDC, NULL); @@ -292,6 +313,34 @@ int DoCtrlDeviceMounting(const char *rootfs) char* str = FormatLogMessage("failed to mount device %s.", HISI_HDC); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); + return false; + } + return true; +} + +int DoCtrlDeviceMounting(const char *rootfs) +{ + if (rootfs == NULL) { + Logger("rootfs pointer is null!", LEVEL_ERROR, SCREEN_YES); + return -1; + } + + /* device */ + int ret = MountDevice(rootfs, DAVINCI_MANAGER, NULL); + if (ret < 0) { + char* str = FormatLogMessage("failed to mount device %s.", DAVINCI_MANAGER); // error1 + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); + return -1; + } + bool is200Rc = false; + if (!DoMounting200RC(&is200Rc)) { + return -1; + } + if (is200Rc) { + return 0; + } + if (!DoMountingDevice(rootfs)) { return -1; } diff --git a/cli/src/u_mount.h b/cli/src/u_mount.h index f1bb6ff..0e987ee 100644 --- a/cli/src/u_mount.h +++ b/cli/src/u_mount.h @@ -5,8 +5,10 @@ #ifndef _MOUNT_H #define _MOUNT_H +#include #include "basic.h" int DoMounting(const struct ParsedConfig *config); +bool DoMounting200RC(bool* is200Rc); #endif \ No newline at end of file diff --git a/cli/src/utils.c b/cli/src/utils.c index 29fedff..c607f32 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -184,28 +184,27 @@ static bool ShowExceptionInfo(const char* exceptionInfo) (void)fprintf(stderr, "\n"); return false; } - -static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, - const unsigned long long maxFileSzieMb, const bool checkOwner) + +static bool CheckFileOwner(const struct stat fileStat, const bool checkOwner) +{ + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } + } + return true; +} + +static bool CheckParentDir(const char* resolvedPath, const size_t resolvedPathLen, + struct stat fileStat, const bool checkOwner) { - const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; char buf[PATH_MAX] = {0}; if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { return false; } - struct stat fileStat; - if ((stat(buf, &fileStat) != 0) || - ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); - } - if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 - return ShowExceptionInfo("fileSize out of bounds!"); - } for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { - if (checkOwner) { - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - return ShowExceptionInfo("Please check the folder owner!"); - } + if (!CheckFileOwner(fileStat, checkOwner)) { + return false; } if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 return ShowExceptionInfo("Please check the write permission!"); @@ -222,7 +221,36 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen } return true; } - + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + struct stat fileStat; + if ((stat(resolvedPath, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + (void)fprintf(stderr, "[3: %s]\n", resolvedPath); + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + return CheckParentDir(resolvedPath, resolvedPathLen, fileStat, checkOwner); +} + +static bool IsValidChar(const char c) +{ + if (isalnum(c) != 0) { + return true; + } + // ._-/~为合法字符 + if ((c == '.') || (c == '_') || + (c == '-') || (c == '/') || (c == '~')) { + return true; + } + return false; +} + bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { @@ -230,12 +258,8 @@ bool CheckExternalFile(const char* filePath, const size_t filePathLen, if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } - if (strstr(filePath, "..") != NULL) { // 存在".." - return ShowExceptionInfo("filePath has an illegal character!"); - } for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && - (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } diff --git a/destroy/src/main.c b/destroy/src/main.c index aea8618..8149f9b 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -32,28 +32,25 @@ static bool ShowExceptionInfo(const char* exceptionInfo) (void)fprintf(stderr, "\n"); return false; } - -static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, - const unsigned long long maxFileSzieMb, const bool checkOwner) + +static bool CheckFileOwner(const struct stat fileStat, const bool checkOwner) { - const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; - char buf[PATH_MAX] = {0}; - if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { - return false; - } - struct stat fileStat; - if ((stat(buf, &fileStat) != 0) || - ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } } - if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 - return ShowExceptionInfo("fileSize out of bounds!"); + return true; +} + +static bool CheckParentDir(char* buf, const size_t bufLen, struct stat fileStat, const bool checkOwner) +{ + if (buf == NULL) { + return false; } for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { - if (checkOwner) { - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - return ShowExceptionInfo("Please check the folder owner!"); - } + if (!CheckFileOwner(fileStat, checkOwner)) { + return false; } if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 return ShowExceptionInfo("Please check the write permission!"); @@ -70,23 +67,63 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen } return true; } - -static bool CheckExternalFile(const char* filePath, const size_t filePathLen, - const size_t maxFileSzieMb, const bool checkOwner) + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + (void)fprintf(stderr, "[2: %s]\n", buf); + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + return CheckParentDir(buf, PATH_MAX, fileStat, checkOwner); +} + +static bool IsValidChar(const char c) +{ + if (isalnum(c) != 0) { + return true; + } + // ._-/~为合法字符 + if ((c == '.') || (c == '_') || + (c == '-') || (c == '/') || (c == '~')) { + return true; + } + return false; +} + +static bool CheckFileName(const char* filePath, const size_t filePathLen) { int iLoop; if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } - if (strstr(filePath, "..") != NULL) { // 存在".." - return ShowExceptionInfo("filePath has an illegal character!"); - } for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && - (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } + return true; +} + +static bool CheckExternalFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkOwner) +{ + if (filePath == NULL) { + return false; + } + if (!CheckFileName(filePath, filePathLen)) { + return false; + } char resolvedPath[PATH_MAX] = {0}; if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { return ShowExceptionInfo("realpath failed!"); @@ -139,55 +176,99 @@ static void DcmiDlclose(void **handle) } } -static int DestroyEntrance(const char *argv[]) +static bool CheckLimitId(const int IdValue) { - if (argv == NULL) { - return -1; + if (IdValue < 0 || IdValue > ID_MAX) { + return false; } + return true; +} + +static bool GetAndCheckID(const char *argv[], int *cardId, + int *deviceId, int *vDeviceId) +{ errno = 0; - int cardId = atoi(argv[PARAMS_SECOND]); - if ((errno != 0) || (cardId < 0) || (cardId > ID_MAX)) { - return -1; + *cardId = atoi(argv[PARAMS_SECOND]); + if ((errno != 0) || !CheckLimitId(*cardId)) { + return false; } - int deviceId = atoi(argv[PARAMS_THIRD]); - if ((errno != 0) || (deviceId < 0) || (deviceId > ID_MAX)) { - return -1; + *deviceId = atoi(argv[PARAMS_THIRD]); + if ((errno != 0) || !CheckLimitId(*deviceId)) { + return false; } - int vDeviceId = atoi(argv[PARAMS_FOURTH]); - if ((errno != 0) || (vDeviceId < 0) || (vDeviceId > ID_MAX)) { - return -1; + *vDeviceId = atoi(argv[PARAMS_FOURTH]); + if ((errno != 0) || !CheckLimitId(*vDeviceId)) { + return false; } - void *handle = NULL; - if (!DeclareDcmiApiAndCheck(&handle)) { - (void)fprintf(stderr, "Declare dcmi failed.\n"); - return -1; + return true; +} + +static bool DcmiInitProcess(void *handle) +{ + if (handle == NULL) { + return false; } int (*dcmi_init)(void) = NULL; - int (*dcmi_set_destroy_vdevice)(int, int, int) = NULL; dcmi_init = dlsym(handle, DCMI_INIT); if (dcmi_init == NULL) { DcmiDlAbnormalExit(&handle, "DeclareDlApi failed"); - return -1; - } - dcmi_set_destroy_vdevice = dlsym(handle, DCMI_SET_DESTROY_VDEVICE); - if (dcmi_set_destroy_vdevice == NULL) { - DcmiDlAbnormalExit(&handle, "DeclareDlApi failed"); - return -1; + return false; } int ret = dcmi_init(); if (ret != 0) { (void)fprintf(stderr, "dcmi_init failed, ret = %d\n", ret); DcmiDlclose(&handle); - return -1; + return false; + } + return true; +} + +static bool DcmiDestroyProcess(void *handle, const int cardId, + const int deviceId, const int vDeviceId) +{ + if (handle == NULL) { + return false; + } + int (*dcmi_set_destroy_vdevice)(int, int, int) = NULL; + dcmi_set_destroy_vdevice = dlsym(handle, DCMI_SET_DESTROY_VDEVICE); + if (dcmi_set_destroy_vdevice == NULL) { + DcmiDlAbnormalExit(&handle, "DeclareDlApi failed"); + return false; } - ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); + int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { (void)fprintf(stderr, "dcmi_set_destroy_vdevice failed, ret = %d\n", ret); DcmiDlclose(&handle); + return false; + } + return true; +} + +static int DestroyEntrance(const char *argv[]) +{ + if (argv == NULL) { + return -1; + } + int cardId = 0; + int deviceId = 0; + int vDeviceId = 0; + if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { + return -1; + } + + void *handle = NULL; + if (!DeclareDcmiApiAndCheck(&handle)) { + (void)fprintf(stderr, "Declare dcmi failed.\n"); + return -1; + } + if (!DcmiInitProcess(handle)) { + return -1; + } + if (!DcmiDestroyProcess(handle, cardId, deviceId, vDeviceId)) { return -1; } DcmiDlclose(&handle); - return ret; + return 0; } static bool EntryCheck(const int argc, const char *argv[]) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index f889bf0..fe544d9 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -180,60 +180,76 @@ static cJSON *CreateContent(const char *runtimePath) return root; } -static cJSON *ModifyContent(FILE *pf, const char *runtimePath) +static bool AddAscendRuntime(cJSON **root, const char *runtimePath) { - if (pf == NULL || runtimePath == NULL) { - (void)fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); - return NULL; - } - - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 插入ascend runtime */ cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); + runtimes = cJSON_GetObjectItem(*root, "runtimes"); if (runtimes == NULL) { runtimes = CreateRuntimes(runtimePath); if (runtimes == NULL) { - cJSON_Delete(root); - return NULL; + cJSON_Delete(*root); + return false; } - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); + cJSON_AddItemToObject(*root, RUNTIME_KEY, runtimes); } else { int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); if (ret != 0) { - cJSON_Delete(root); - return NULL; + cJSON_Delete(*root); + return false; } cJSON *ascendRuntime = NULL; ascendRuntime = CreateAscendRuntimeInfo(runtimePath); if (ascendRuntime == NULL) { - cJSON_Delete(root); - return NULL; + cJSON_Delete(*root); + return false; } cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); } + return true; +} - /* 插入defaul runtime */ - int ret = DelJsonContent(root, DEFALUT_KEY); +static bool AddDefaultRuntime(cJSON **root) +{ + int ret = DelJsonContent(*root, DEFALUT_KEY); if (ret != 0) { - cJSON_Delete(root); - return NULL; + cJSON_Delete(*root); + return false; } cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); if (defaultRuntime == NULL) { - cJSON_Delete(root); + cJSON_Delete(*root); + return false; + } + cJSON_AddItemToObject(*root, DEFALUT_KEY, defaultRuntime); + return true; +} + +static cJSON *ModifyContent(FILE *pf, const char *runtimePath) +{ + if (pf == NULL || runtimePath == NULL) { + (void)fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); + return NULL; + } + + char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; + ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); + + cJSON *root = NULL; + root = cJSON_Parse(jsonStr); + if (root == NULL) { + (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); + return NULL; + } + + /* 插入ascend runtime */ + if (!AddAscendRuntime(&root, runtimePath)) { + return NULL; + } + + /* 插入defaul runtime */ + if (!AddDefaultRuntime(&root)) { return NULL; } - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); return root; } @@ -286,28 +302,25 @@ static bool ShowExceptionInfo(const char* exceptionInfo) (void)fprintf(stderr, "\n"); return false; } - -static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, - const unsigned long long maxFileSzieMb, const bool checkOwner) + +static bool CheckFileOwner(const struct stat fileStat, const bool checkOwner) { - const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; - char buf[PATH_MAX] = {0}; - if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { - return false; - } - struct stat fileStat; - if ((stat(buf, &fileStat) != 0) || - ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + if (checkOwner) { + if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 + return ShowExceptionInfo("Please check the folder owner!"); + } } - if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 - return ShowExceptionInfo("fileSize out of bounds!"); + return true; +} + +static bool CheckParentDir(char* buf, const size_t bufLen, struct stat fileStat, const bool checkOwner) +{ + if (buf == NULL) { + return false; } for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { - if (checkOwner) { - if ((fileStat.st_uid != ROOT_UID) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - return ShowExceptionInfo("Please check the folder owner!"); - } + if (!CheckFileOwner(fileStat, checkOwner)) { + return false; } if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 return ShowExceptionInfo("Please check the write permission!"); @@ -324,7 +337,40 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen } return true; } - + +static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, + const unsigned long long maxFileSzieMb, const bool checkOwner) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + return false; + } + struct stat fileStat; + if ((stat(buf, &fileStat) != 0) || + ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { + (void)fprintf(stderr, "[1: %s]\n", buf); + return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + return CheckParentDir(buf, PATH_MAX, fileStat, checkOwner); +} + +static bool IsValidChar(const char c) +{ + if (isalnum(c) != 0) { + return true; + } + // ._-/~为合法字符 + if ((c == '.') || (c == '_') || + (c == '-') || (c == '/') || (c == '~')) { + return true; + } + return false; +} + static bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { @@ -332,12 +378,8 @@ static bool CheckExternalFile(const char* filePath, const size_t filePathLen, if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } - if (strstr(filePath, "..") != NULL) { // 存在".." - return ShowExceptionInfo("filePath has an illegal character!"); - } for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if ((isalnum(filePath[iLoop]) == 0) && (filePath[iLoop] != '.') && (filePath[iLoop] != '_') && - (filePath[iLoop] != '-') && (filePath[iLoop] != '/') && (filePath[iLoop] != '~')) { // 非法字符 + if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } @@ -360,102 +402,145 @@ static bool CheckJsonFile(const char *jsonFilePath, const size_t jsonFilePathLen return true; } -static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) +static bool CheckJsonFileParam(const char *filePath, const char *tempPath, const char *runtimePath) { if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { (void)fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); - return -1; + return false; } if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath)) || !CheckJsonFile(runtimePath, strlen(runtimePath))) { (void)fprintf(stderr, "filePath, tempPath or runtimePath check failed!\n"); - return -1; + return false; } + return true; +} - cJSON *root = NULL; +static bool GetJsonRoot(cJSON **root, const char *filePath, const char *runtimePath) +{ FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { - root = CreateContent(runtimePath); + *root = CreateContent(runtimePath); } else { - root = ModifyContent(pf, runtimePath); + *root = ModifyContent(pf, runtimePath); fclose(pf); } - if (root == NULL) { + if (*root == NULL) { (void)fprintf(stderr, "error: failed to create json\n"); - return -1; + return false; } + return true; +} +static bool WriteJsonRoot(cJSON **root, const char *tempPath) +{ + FILE *pf = NULL; pf = fopen(tempPath, "w"); if (pf == NULL) { (void)fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(root); - return -1; + cJSON_Delete(*root); + return false; } - if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { + if (fprintf(pf, "%s", cJSON_Print(*root)) < 0) { (void)fprintf(stderr, "error: failed to create file\n"); (void)fclose(pf); - cJSON_Delete(root); - return -1; + cJSON_Delete(*root); + return false; } (void)fclose(pf); - cJSON_Delete(root); + cJSON_Delete(*root); + return true; +} + +static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) +{ + if (!CheckJsonFileParam(filePath, tempPath, runtimePath)) { + return -1; + } + + cJSON *root = NULL; + if (!GetJsonRoot(&root, filePath, runtimePath) || root == NULL) { + return -1; + } + if (!WriteJsonRoot(&root, tempPath)) { + return -1; + } return 0; } -static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) +static bool CheckRevisedJsonFileParam(const char *filePath, const char *tempPath) { if (filePath == NULL || tempPath == NULL) { (void)fprintf(stderr, "filePath or tempPath are null!\n"); - return -1; + return false; } if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath))) { (void)fprintf(stderr, "filePath, tempPath check failed!\n"); - return -1; + return false; } + return true; +} +static bool GetNewContent(const char *filePath, cJSON **newContent) +{ FILE *pf = NULL; pf = fopen(filePath, "r+"); if (pf == NULL) { (void)fprintf(stderr, "error: no json files found\n"); - return -1; + return false; } - cJSON *newContent = NULL; - newContent = RemoveContent(pf); + *newContent = RemoveContent(pf); (void)fclose(pf); pf = NULL; + return true; +} - if (newContent == NULL) { - (void)fprintf(stderr, "error: failed to create json\n"); - return -1; - } - +static bool WriteNewContent(const char *tempPath, cJSON **newContent) +{ + FILE *pf = NULL; pf = fopen(tempPath, "w"); if (pf == NULL) { (void)fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - newContent = NULL; - return -1; + cJSON_Delete(*newContent); + *newContent = NULL; + return false; } - if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { + if (fprintf(pf, "%s", cJSON_Print(*newContent)) < 0) { (void)fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - newContent = NULL; + cJSON_Delete(*newContent); + *newContent = NULL; (void)fclose(pf); pf = NULL; - return -1; + return false; } (void)fclose(pf); pf = NULL; - cJSON_Delete(newContent); - newContent = NULL; + cJSON_Delete(*newContent); + *newContent = NULL; + return true; +} + +static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) +{ + if (!CheckRevisedJsonFileParam(filePath, tempPath)) { + return -1; + } + cJSON *newContent = NULL; + if (!GetNewContent(filePath, &newContent) || newContent == NULL) { + (void)fprintf(stderr, "error: failed to create json\n"); + return -1; + } + if (!WriteNewContent(tempPath, &newContent)) { + return -1; + } return 0; } -- Gitee From 6cb2eb0eada6943d8ff8c94b66edd6be97d2d928 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 6 Apr 2022 14:40:36 +0800 Subject: [PATCH 212/296] Match-id-3ce9f074c94ae4bba453ca74ae0d9bd6399c3df0 --- cli/src/main.c | 2 +- cli/src/u_mount.c | 8 +++++ cli/src/utils.c | 72 +++++++++++++++++++++++++++++++++++++++--- cli/src/utils.h | 2 +- install/deb/src/main.c | 5 +-- 5 files changed, 79 insertions(+), 10 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 671ec6b..cf2f47f 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -131,7 +131,7 @@ static bool CheckFileLegality(const char* filePath, const size_t filePathLen, Logger("realpath failed!", LEVEL_ERROR, SCREEN_YES); return false; } - if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + if (strcmp(resolvedPath, filePath) != 0) { // 存在软链接 Logger("filePath has a soft link!", LEVEL_ERROR, SCREEN_YES); return false; } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index d4c1ccb..db2bfcc 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -37,6 +37,14 @@ int Mount(const char *src, const char *dst) return -1; } } + if (S_ISDIR(fileStat.st_mode) != 0) { // 目录则增加递归校验子集 + if (!GetFileSubsetAndCheck(src, strlen(src))) { + char* str = FormatLogMessage("Check file subset failed: %s.", src); + Logger(str, LEVEL_ERROR, SCREEN_YES); + free(str); + return -1; + } + } ret = mount(src, dst, NULL, mountFlags, NULL); if (ret < 0) { Logger("failed to mount src.", LEVEL_ERROR, SCREEN_YES); diff --git a/cli/src/utils.c b/cli/src/utils.c index 67ddc9e..49dcdb7 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -242,9 +242,6 @@ bool CheckExternalFile(const char* filePath, const size_t filePathLen, if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } - if (strstr(filePath, "..") != NULL) { // 存在".." - return ShowExceptionInfo("filePath has an illegal character!"); - } for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); @@ -254,8 +251,75 @@ bool CheckExternalFile(const char* filePath, const size_t filePathLen, if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { return ShowExceptionInfo("realpath failed!"); } - if (strstr(resolvedPath, filePath) == NULL) { // 存在软链接 + if (strcmp(resolvedPath, filePath) != 0) { // 存在软链接 return ShowExceptionInfo("filePath has a soft link!"); } return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); } + +static bool CheckFileSubset(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb) +{ + const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + int iLoop; + if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 + return ShowExceptionInfo("filePathLen out of bounds!"); + } + for (iLoop = 0; iLoop < filePathLen; iLoop++) { + if (!IsValidChar(filePath[iLoop])) { // 非法字符 + return ShowExceptionInfo("filePath has an illegal character!"); + } + } + char resolvedPath[PATH_MAX] = {0}; + if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { + return ShowExceptionInfo("realpath failed!"); + } + if (strcmp(resolvedPath, filePath) != 0) { // 存在软链接 + return ShowExceptionInfo("filePath has a soft link!"); + } + struct stat fileStat; + if (stat(filePath, &fileStat) != 0) { + return ShowExceptionInfo("filePath does not exist or is not a file!"); + } + if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + return ShowExceptionInfo("fileSize out of bounds!"); + } + return true; +} + +bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen) +{ + DIR *dir = NULL; + struct dirent *ptr = NULL; + char base[PATH_MAX] = {0}; + + if ((dir = opendir(basePath)) == NULL) { + return ShowExceptionInfo("Open dir error!"); + } + while ((ptr = readdir(dir)) != NULL) { + if (strcmp(ptr->d_name, ".") == 0 || strcmp(ptr->d_name, "..") == 0) { + continue; + } + memset_s(base, PATH_MAX, 0, PATH_MAX); + if (strcpy_s(base, PATH_MAX, basePath) != 0) { + return ShowExceptionInfo("Strcpy failed!"); + } + if (strcat_sp(base, PATH_MAX, "/") != 0 || + strcat_sp(base, PATH_MAX, ptr->d_name) != 0) { + return ShowExceptionInfo("Strcat failed!"); + } + if (ptr->d_type == DT_REG) { // 文件 + const size_t maxFileSzieMb = 10; // max 10 MB + if (!CheckFileSubset(base, strlen(base), maxFileSzieMb)) { + return false; + } + } else if (ptr->d_type == DT_LNK) { // 软链接 + return ShowExceptionInfo("FilePath has a soft link!"); + } else if (ptr->d_type == DT_DIR) { // 目录 + if (!GetFileSubsetAndCheck(base, strlen(base))) { + return false; + } + } + } + return true; +} \ No newline at end of file diff --git a/cli/src/utils.h b/cli/src/utils.h index 88e195b..e320446 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -25,5 +25,5 @@ int MakeMountPoints(const char *path, mode_t mode); bool IsValidChar(const char c); bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner); - +bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen); #endif \ No newline at end of file diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 7375f91..46359dd 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -331,7 +331,7 @@ static bool IsValidChar(const char c) if (isalnum(c) != 0) { return true; } - // ._-/~为合法字符 + if ((c == '.') || (c == '_') || (c == '-') || (c == '/') || (c == '~')) { return true; @@ -345,9 +345,6 @@ static bool CheckExternalFile(const char* filePath, const size_t filePathLen, if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 return ShowExceptionInfo("filePathLen out of bounds!"); } - if (strstr(filePath, "..") != NULL) { // 存在".." - return ShowExceptionInfo("filePath has an illegal character!"); - } for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { if (!IsValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); -- Gitee From 18547a9eb55f4e750b7a84f3796f0fd27564c511 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 9 Apr 2022 14:34:14 +0800 Subject: [PATCH 213/296] Match-id-aac180f030a7ea1c2093c4490f9778b3b43e9e8d --- build/scripts/run_main.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 78189ee..e8c09fc 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -14,7 +14,10 @@ function install() if [ ! -d "${INSTALL_PATH}" ]; then mkdir -p ${INSTALL_PATH} fi - + if [ -L "${INSTALL_PATH}" ]; then + echo "error: ${INSTALL_PATH} is symbolic link." + exit 1 + fi cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli @@ -24,6 +27,10 @@ function install() chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + if [ -L "${INSTALL_PATH}/script" ]; then + echo "error: ${INSTALL_PATH}/script is symbolic link." + exit 1 + fi cp -rf ./assets ${INSTALL_PATH}/assets cp -f ./README.md ${INSTALL_PATH}/README.md mkdir -p ${INSTALL_PATH}/script @@ -33,6 +40,10 @@ function install() if [ -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} fi + if [ -L "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + echo "error: ${ASCEND_RUNTIME_CONFIG_DIR} is symbolic link." + exit 1 + fi mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list @@ -89,7 +100,10 @@ function upgrade() echo 'ERROR: the configuration directory does not exist' exit 1 fi - + if [ -L "${INSTALL_PATH}" ]; then + echo "error: ${INSTALL_PATH} is symbolic link." + exit 1 + fi cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli -- Gitee From 518fc269028673459fdf36bf09d860031e39a0c1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 13 Apr 2022 20:50:31 +0800 Subject: [PATCH 214/296] Match-id-199d65c96dbe9e4917754ef3c04eeebb79f76af9 --- cli/src/main.c | 5 ++--- cli/src/u_mount.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index a5efd10..fd991c0 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -130,7 +130,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } char *dst = &args->files.list[args->files.count++][0]; @@ -156,7 +156,7 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } char *dst = &args->dirs.list[args->dirs.count++][0]; @@ -381,7 +381,6 @@ int Process(int argc, char **argv) Logger("argv pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } - int c; int ret; int optionIndex; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 44d1b3a..9e29b3b 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -132,7 +132,7 @@ static bool MountDeviceProcess(const char* dst, const char* src, const mode_t mo struct stat dstStat; ret = stat(dst, &dstStat); if (ret == 0 && S_ISCHR(dstStat.st_mode)) { - return 0; // 特权容器自动挂载HOST所有设备,故此处跳过 + return true; // 特权容器自动挂载HOST所有设备,故此处跳过 } else if (ret == 0) { Logger("dst already exists but not a char device as expected.", LEVEL_ERROR, SCREEN_YES); return false; -- Gitee From f13720f7bd89597f41fcf9a76ade05be898b001c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 28 Apr 2022 16:12:49 +0800 Subject: [PATCH 215/296] Match-id-da710ec79804990caf850320ea9fadadd25ad256 --- cli/src/logger.c | 4 ++++ cli/src/main.c | 3 +++ cli/src/ns.c | 13 +++++++++++-- cli/src/ns.h | 4 ++-- cli/src/utils.c | 2 +- install/deb/src/main.c | 12 ++++++------ 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index 7958c7b..88ab1ff 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -12,6 +12,7 @@ #include "securec.h" #include "basic.h" #include "utils.h" +#include "logger.h" #define FILE_MAX_SIZE (1024 * 1024 * 10) #define LOG_PATH_DIR "/var/log/ascend-docker-runtime/" @@ -46,6 +47,9 @@ int GetCurrentLocalTime(char* buffer, int length) int CreateLog(const char* filename) { + if (filename == NULL) { + return -1; + } int exist; exist = access(filename, 0); int fd = 0; diff --git a/cli/src/main.c b/cli/src/main.c index cf2f47f..b59cdaf 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -184,6 +184,9 @@ static bool OptionsCmdArgParser(struct CmdArgs *args, const char *arg) static bool CheckWhiteList(const char* fileName) { + if (fileName == NULL) { + return false; + } bool fileExists = false; const char mountWhiteList[WHITE_LIST_NUM][PATH_MAX] = {{"/usr/local/Ascend/driver/lib64"}, {"/usr/local/Ascend/driver/include"}, diff --git a/cli/src/ns.c b/cli/src/ns.c index df62101..94b280e 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -13,14 +13,20 @@ #include "utils.h" #include "logger.h" -int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize) +int GetNsPath(const int pid, const char *nsType, char *buf, const size_t bufSize) { + if ((nsType == NULL) || (buf == NULL)) { + return -1; + } static const char *fmtStr = "/proc/%d/ns/%s"; return sprintf_s(buf, bufSize, fmtStr, pid, nsType); } -int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize) +int GetSelfNsPath(const char *nsType, char *buf, const size_t bufSize) { + if ((nsType == NULL) || (buf == NULL)) { + return -1; + } static const char *fmtStr = "/proc/self/ns/%s"; return sprintf_s(buf, bufSize, fmtStr, nsType); } @@ -39,6 +45,9 @@ int EnterNsByFd(int fd, int nsType) int EnterNsByPath(const char *path, int nsType) { + if (path == NULL) { + return -1; + } int fd; int ret; diff --git a/cli/src/ns.h b/cli/src/ns.h index 18c4be3..36f7671 100644 --- a/cli/src/ns.h +++ b/cli/src/ns.h @@ -7,8 +7,8 @@ #include -int GetNsPath(int pid, const char *nsType, char *buf, size_t bufSize); -int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); +int GetNsPath(int pid, const char *nsType, char *buf, const size_t bufSize); +int GetSelfNsPath(const char *nsType, char *buf, const size_t bufSize); int EnterNsByFd(int fd, int nsType); int EnterNsByPath(const char *path, int nsType); diff --git a/cli/src/utils.c b/cli/src/utils.c index 49dcdb7..2cf088b 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -51,7 +51,7 @@ char *FormatLogMessage(char *format, ...) int IsStrEqual(const char *s1, const char *s2) { - return (!strcmp(s1, s2)); + return (strcmp(s1, s2) == 0); } int StrHasPrefix(const char *str, const char *prefix) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 46359dd..96ebec7 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -126,7 +126,7 @@ static int DelJsonContent(cJSON *root, const char *key) cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); if (existItem == NULL) { - return 0; + return -1; } cJSON *removedItem = NULL; @@ -390,6 +390,7 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c } else { root = ModifyContent(pf, runtimePath); fclose(pf); + pf = NULL; } if (root == NULL) { @@ -406,11 +407,12 @@ static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, c if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { (void)fprintf(stderr, "error: failed to create file\n"); (void)fclose(pf); + pf = NULL; cJSON_Delete(root); return -1; } (void)fclose(pf); - + pf = NULL; cJSON_Delete(root); return 0; @@ -456,10 +458,8 @@ static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { (void)fprintf(stderr, "error: failed to create file\n"); cJSON_Delete(newContent); - if (pf != NULL) { - (void)fclose(pf); - pf = NULL; - } + (void)fclose(pf); + pf = NULL; return -1; } (void)fclose(pf); -- Gitee From 6ba465bed25c0cd9e054cd9229362760f577f854 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 6 May 2022 18:16:42 +0800 Subject: [PATCH 216/296] Match-id-192b0883f53afaea8061627c4192d433432ac5ef --- install/deb/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/deb/src/main.c b/install/deb/src/main.c index 96ebec7..d0033a5 100644 --- a/install/deb/src/main.c +++ b/install/deb/src/main.c @@ -126,7 +126,7 @@ static int DelJsonContent(cJSON *root, const char *key) cJSON *existItem = NULL; existItem = cJSON_GetObjectItem(root, key); if (existItem == NULL) { - return -1; + return 0; } cJSON *removedItem = NULL; -- Gitee From 14bf63b920b899be6f90adf3a56c3c71d7ed9823 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 16 May 2022 18:12:18 +0800 Subject: [PATCH 217/296] Match-id-2a905d507cbceee439b94e4b2f4958654603e555 --- cli/src/main.c | 8 ++++++-- cli/src/u_mount.c | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index b59cdaf..7cb680a 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -87,6 +87,10 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) FILE* pFile = NULL; pFile = fopen(pidMax, "r"); if ((pFile == NULL) || (fgets(buff, PATH_MAX, pFile) == NULL)) { + if (pFile != NULL) { + (void)fclose(pFile); + } + pFile = NULL; Logger("failed to get pid_max buff.", LEVEL_ERROR, SCREEN_YES); return false; } @@ -218,7 +222,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } char *dst = &args->files.list[args->files.count++][0]; @@ -252,7 +256,7 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); - return -1; + return false; } char *dst = &args->dirs.list[args->dirs.count++][0]; diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index db2bfcc..3afe5bc 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -117,7 +117,6 @@ static int GetDeviceMntSrcDst(const char *rootfs, const char *srcDeviceName, int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDeviceName) { int ret; - char *str = NULL; char src[BUF_SIZE] = {0}; char dst[BUF_SIZE] = {0}; struct PathInfo pathInfo = {src, BUF_SIZE, dst, BUF_SIZE}; @@ -156,13 +155,12 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe Logger("failed to mount dev.", LEVEL_ERROR, SCREEN_YES); return -1; } - free(str); return 0; } int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) { - if (rootfs == NULL || device_name == NULL) { + if (rootfs == NULL || device_name == NULL || ids == NULL) { Logger("rootfs, device_name pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From 41c575da4b6d3c636501f322abf765075b6ecb7e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 25 May 2022 14:42:27 +0800 Subject: [PATCH 218/296] Match-id-5d552df824d5089453568558e6a1ac304eb88282 --- build/build.sh | 19 +- install/deb/src/CMakeLists.txt | 32 --- install/deb/src/go.mod | 9 + install/deb/src/main.c | 492 --------------------------------- install/deb/src/main.go | 192 +++++++++++++ 5 files changed, 211 insertions(+), 533 deletions(-) delete mode 100644 install/deb/src/CMakeLists.txt create mode 100644 install/deb/src/go.mod delete mode 100644 install/deb/src/main.c create mode 100644 install/deb/src/main.go diff --git a/build/build.sh b/build/build.sh index fe9acea..b3af7ae 100644 --- a/build/build.sh +++ b/build/build.sh @@ -15,7 +15,7 @@ CLIDIR=${ROOT}/cli CLISRCNAME="main.c" INSTALLHELPERDIR=${ROOT}/install -INSTALLHELPERSRCNAME="main.c" +INSTALLHELPERSRCNAME="main.go" HOOKDIR=${ROOT}/hook HOOKSRCNAME="main.go" @@ -46,21 +46,22 @@ function build_bin() make clean make - echo "make installhelper" - [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build - mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build - cmake ${INSTALLHELPERSRCDIR} - make clean - make - [ -d "${ROOT}/opensource/src" ] && rm -rf ${ROOT}/opensource/src mkdir ${ROOT}/opensource/src - cd ${HOOKDIR} export GOPATH="${ROOT}/opensource" export GO111MODULE=on export GONOSUMDB="*" + echo "make installhelper" + cd ${INSTALLHELPERSRCDIR} + go mod tidy + [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build + mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} + mv main ascend-docker-plugin-install-helper + echo "make hook" + cd ${HOOKDIR} go mod tidy [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build diff --git a/install/deb/src/CMakeLists.txt b/install/deb/src/CMakeLists.txt deleted file mode 100644 index 38d47cb..0000000 --- a/install/deb/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# CMake 最低版本号要求 -cmake_minimum_required (VERSION 2.8) - -# 项目信息 -project (ascend-docker-plugin-install-helper) - -message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") - - -#导入头文件所在路径 -#PROJECT_SOURCE_DIR为cmake宏 -include_directories("../../../opensource/cJSON-1.7.14") -include_directories("../../../platform/HuaweiSecureC/include") - -# 查找当前目录下的所有源文件 -# 并将名称保存到 SRC 变量 -aux_source_directory(. SRC) - -# 指定生成目标 -add_executable(ascend-docker-plugin-install-helper ${SRC}) - -# 添加子目录 -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/cjson) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/HuaweiSecureC) - -# 添加链接库 -#该命令要在add_executable命令下方,否则报错 -target_compile_options(ascend-docker-plugin-install-helper PRIVATE -fstack-protector-all -fpie) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now cjson) -target_link_libraries(ascend-docker-plugin-install-helper -pie -Wl,-s,-z,now HuaweiSecureC) - diff --git a/install/deb/src/go.mod b/install/deb/src/go.mod new file mode 100644 index 0000000..5d8e2d2 --- /dev/null +++ b/install/deb/src/go.mod @@ -0,0 +1,9 @@ +module main + +go 1.16 + +require ( + mindxcheckutils v1.0.0 +) + +replace mindxcheckutils => ../../../mindxcheckutils diff --git a/install/deb/src/main.c b/install/deb/src/main.c deleted file mode 100644 index d0033a5..0000000 --- a/install/deb/src/main.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend_docker_install工具,用于辅助用户安装ascend_docker -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cJSON.h" -#include "securec.h" - -#define MAX_JSON_FILE_SIZE 65535 -#define MIN_ARGS_NUM 4 -#define ADD_CMD_ARGS_NUM 5 -#define ADD_CMD "add" -#define RM_CMD "rm" -#define CMD_INDEX 1 -#define FINAL_FILE_INDEX 2 -#define TEMP_FILE_INDEX 3 -#define RUNTIME_PATH_INDEX 4 -#define ASCEND_RUNTIME_PATH_KEY "path" -#define ASCEND_RUNTIME_ARGS_KEY "runtimeArgs" -#define RUNTIME_KEY "runtimes" -#define ASCEND_RUNTIME_NAME "ascend" -#define DEFALUT_KEY "default-runtime" -#define DEFAULT_VALUE "ascend" - -static void ReadJsonFile(FILE *pf, char *text, int maxBufferSize) -{ - if (pf == NULL || text == NULL) { - (void)fprintf(stderr, "file pointer or text pointer are null!\n"); - return; - } - - (void)fseek(pf, 0, SEEK_END); - - int size = (int)ftell(pf); - if (size >= maxBufferSize) { - (void)fprintf(stderr, "file size too large\n"); - return; - } - - (void)fseek(pf, 0, SEEK_SET); - if (fread(text, sizeof(char), size, pf) != 0) { - return; - } - text[size] = '\0'; -} - -static cJSON *CreateAscendRuntimeInfo(const char *runtimePath) -{ - if (runtimePath == NULL) { - (void)fprintf(stderr, "runtimePath pointer are null!\n"); - return NULL; - } - - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - (void)fprintf(stderr, "create ascend runtime info root err\n"); - return NULL; - } - - cJSON *newString = NULL; - newString = cJSON_CreateString(runtimePath); - if (newString == NULL) { - (void)fprintf(stderr, "create ascend runtime info path value err\n"); - cJSON_Delete(root); - return NULL; - } - - cJSON *paraArray = NULL; - paraArray = cJSON_CreateArray(); - if (paraArray == NULL) { - (void)fprintf(stderr, "create ascend runtime info args err\n"); - cJSON_Delete(root); - cJSON_Delete(newString); - return NULL; - } - - cJSON_AddItemToObject(root, ASCEND_RUNTIME_PATH_KEY, newString); - cJSON_AddItemToObject(root, ASCEND_RUNTIME_ARGS_KEY, paraArray); - - return root; -} - -static cJSON *CreateRuntimes(const char *runtimePath) -{ - if (runtimePath == NULL) { - (void)fprintf(stderr, "runtimePath pointer is null!\n"); - return NULL; - } - - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(runtimePath); - if (ascendRuntime == NULL) { - (void)fprintf(stderr, "create ascendruntime err\n"); - return NULL; - } - - cJSON *runtimes = NULL; - runtimes = cJSON_CreateObject(); - if (runtimes == NULL) { - (void)fprintf(stderr, "create runtimes err\n"); - cJSON_Delete(ascendRuntime); - return NULL; - } - - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - - return runtimes; -} - -static int DelJsonContent(cJSON *root, const char *key) -{ - if (root == NULL || key == NULL) { - (void)fprintf(stderr, "userInfo pointer is null!\n"); - return -1; - } - - cJSON *existItem = NULL; - existItem = cJSON_GetObjectItem(root, key); - if (existItem == NULL) { - return 0; - } - - cJSON *removedItem = NULL; - removedItem = cJSON_DetachItemViaPointer(root, existItem); - if (removedItem == NULL) { - (void)fprintf(stderr, "remove %s failed\n", key); - free(existItem); - existItem = NULL; - return -1; - } - - cJSON_Delete(removedItem); - return 0; -} - -static cJSON *CreateContent(const char *runtimePath) -{ - if (runtimePath == NULL) { - (void)fprintf(stderr, "runtimePath pointer is null!\n"); - return NULL; - } - - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = CreateRuntimes(runtimePath); - if (runtimes == NULL) { - (void)fprintf(stderr, "create runtimes err\n"); - return NULL; - } - - cJSON *defaultRuntime = NULL; - defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(runtimes); - return NULL; - } - - cJSON *root = NULL; - root = cJSON_CreateObject(); - if (root == NULL) { - /* ascendRuntime已经挂载到runtimes上了,再释放会coredump */ - (void)fprintf(stderr, "create root err\n"); - cJSON_Delete(runtimes); - cJSON_Delete(defaultRuntime); - return NULL; - } - - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -static cJSON *ModifyContent(FILE *pf, const char *runtimePath) -{ - if (pf == NULL || runtimePath == NULL) { - (void)fprintf(stderr, "file pointer or runtimePath pointer is null!\n"); - return NULL; - } - - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 插入ascend runtime */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, "runtimes"); - if (runtimes == NULL) { - runtimes = CreateRuntimes(runtimePath); - if (runtimes == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, RUNTIME_KEY, runtimes); - } else { - int ret = DelJsonContent(runtimes, ASCEND_RUNTIME_NAME); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *ascendRuntime = NULL; - ascendRuntime = CreateAscendRuntimeInfo(runtimePath); - if (ascendRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(runtimes, ASCEND_RUNTIME_NAME, ascendRuntime); - } - - /* 插入defaul runtime */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - cJSON *defaultRuntime = cJSON_CreateString(DEFAULT_VALUE); - if (defaultRuntime == NULL) { - cJSON_Delete(root); - return NULL; - } - cJSON_AddItemToObject(root, DEFALUT_KEY, defaultRuntime); - - return root; -} - -static cJSON *RemoveContent(FILE *pf) -{ - if (pf == NULL) { - (void)fprintf(stderr, "file pointer is null!\n"); - return NULL; - } - - char jsonStr[MAX_JSON_FILE_SIZE] = {0x0}; - ReadJsonFile(pf, &jsonStr[0], MAX_JSON_FILE_SIZE); - - cJSON *root = NULL; - root = cJSON_Parse(jsonStr); - if (root == NULL) { - (void)fprintf(stderr, "Error before: [%s]\n", cJSON_GetErrorPtr()); - return NULL; - } - - /* 去除default runtimes */ - int ret = DelJsonContent(root, DEFALUT_KEY); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - /* 去除runtimes */ - cJSON *runtimes = NULL; - runtimes = cJSON_GetObjectItem(root, RUNTIME_KEY); - if (runtimes == NULL) { - (void)fprintf(stderr, "no runtime key found\n"); - cJSON_Delete(root); - return NULL; - } - - ret = DelJsonContent(runtimes, DEFAULT_VALUE); - if (ret != 0) { - cJSON_Delete(root); - return NULL; - } - - return root; -} - -static bool ShowExceptionInfo(const char* exceptionInfo) -{ - (void)fprintf(stderr, exceptionInfo); - (void)fprintf(stderr, "\n"); - return false; -} - -static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, - const unsigned long long maxFileSzieMb, const bool checkOwner) -{ - const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; - char buf[PATH_MAX] = {0}; - if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { - return false; - } - struct stat fileStat; - if ((stat(buf, &fileStat) != 0) || - ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); - } - if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 - return ShowExceptionInfo("fileSize out of bounds!"); - } - for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { - if (checkOwner) { - if ((fileStat.st_uid != 0) && (fileStat.st_uid != geteuid())) { // 操作文件owner非root/自己 - return ShowExceptionInfo("Please check the folder owner!"); - } - } - if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 - return ShowExceptionInfo("Please check the write permission!"); - } - if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { - break; - } - if (strcmp(dirname(buf), ".") == 0) { - break; - } - if (stat(buf, &fileStat) != 0) { - return false; - } - } - return true; -} - -static bool IsValidChar(const char c) -{ - if (isalnum(c) != 0) { - return true; - } - - if ((c == '.') || (c == '_') || - (c == '-') || (c == '/') || (c == '~')) { - return true; - } - return false; -} - -static bool CheckExternalFile(const char* filePath, const size_t filePathLen, - const size_t maxFileSzieMb, const bool checkOwner) -{ - if ((filePathLen > PATH_MAX) || (filePathLen <= 0)) { // 长度越界 - return ShowExceptionInfo("filePathLen out of bounds!"); - } - for (size_t iLoop = 0; iLoop < filePathLen; iLoop++) { - if (!IsValidChar(filePath[iLoop])) { // 非法字符 - return ShowExceptionInfo("filePath has an illegal character!"); - } - } - char resolvedPath[PATH_MAX] = {0}; - if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { - return ShowExceptionInfo("realpath failed!"); - } - return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); -} - -static bool CheckJsonFile(const char *jsonFilePath, const size_t jsonFilePathLen) -{ - struct stat fileStat; - if ((stat(jsonFilePath, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { - const size_t maxFileSzieMb = 10; // max 10MB - if (!CheckExternalFile(jsonFilePath, jsonFilePathLen, maxFileSzieMb, true)) { - return false; - } - } - return true; -} - -static int DetectAndCreateJsonFile(const char *filePath, const char *tempPath, const char *runtimePath) -{ - if (filePath == NULL || tempPath == NULL || runtimePath == NULL) { - (void)fprintf(stderr, "filePath, tempPath or runtimePath are null!\n"); - return -1; - } - - if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath)) || - !CheckJsonFile(runtimePath, strlen(runtimePath))) { - (void)fprintf(stderr, "filePath, tempPath or runtimePath check failed!\n"); - return -1; - } - - cJSON *root = NULL; - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - root = CreateContent(runtimePath); - } else { - root = ModifyContent(pf, runtimePath); - fclose(pf); - pf = NULL; - } - - if (root == NULL) { - (void)fprintf(stderr, "error: failed to create json\n"); - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - (void)fprintf(stderr, "error: failed to create file\n"); - return -1; - } - - if (fprintf(pf, "%s", cJSON_Print(root)) < 0) { - (void)fprintf(stderr, "error: failed to create file\n"); - (void)fclose(pf); - pf = NULL; - cJSON_Delete(root); - return -1; - } - (void)fclose(pf); - pf = NULL; - cJSON_Delete(root); - - return 0; -} - -static int CreateRevisedJsonFile(const char *filePath, const char *tempPath) -{ - if (filePath == NULL || tempPath == NULL) { - (void)fprintf(stderr, "filePath or tempPath are null!\n"); - return -1; - } - if (!CheckJsonFile(filePath, strlen(filePath)) || !CheckJsonFile(tempPath, strlen(tempPath))) { - (void)fprintf(stderr, "filePath, tempPath check failed!\n"); - return -1; - } - - FILE *pf = NULL; - pf = fopen(filePath, "r+"); - if (pf == NULL) { - (void)fprintf(stderr, "error: no json files found\n"); - return -1; - } - cJSON *newContent = NULL; - newContent = RemoveContent(pf); - (void)fclose(pf); - - if (newContent == NULL) { - (void)fprintf(stderr, "error: failed to create json\n"); - if (pf != NULL) { - (void)fclose(pf); - pf = NULL; - } - return -1; - } - - pf = fopen(tempPath, "w"); - if (pf == NULL) { - (void)fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - return -1; - } - - if (fprintf(pf, "%s", cJSON_Print(newContent)) < 0) { - (void)fprintf(stderr, "error: failed to create file\n"); - cJSON_Delete(newContent); - (void)fclose(pf); - pf = NULL; - return -1; - } - (void)fclose(pf); - pf = NULL; - cJSON_Delete(newContent); - - return 0; -} - -/* 该函数只负责生成json.bak文件,由调用者进行覆盖操作 */ -int main(int argc, char *argv[]) -{ - if (argc < MIN_ARGS_NUM) { - return -1; - } - - printf("%s\n", argv[FINAL_FILE_INDEX]); - printf("%s\n", argv[TEMP_FILE_INDEX]); - printf("%s\n", argv[CMD_INDEX]); - - if (strcmp(argv[CMD_INDEX], ADD_CMD) == 0) { - if (argc != ADD_CMD_ARGS_NUM) { - return -1; - } - - return DetectAndCreateJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX], argv[RUNTIME_PATH_INDEX]); - } - - return CreateRevisedJsonFile(argv[FINAL_FILE_INDEX], argv[TEMP_FILE_INDEX]); -} diff --git a/install/deb/src/main.go b/install/deb/src/main.go new file mode 100644 index 0000000..3319a9b --- /dev/null +++ b/install/deb/src/main.go @@ -0,0 +1,192 @@ +/** + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Description: ascend-docker-runtime工具,辅助安装配置 + */ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + + "mindxcheckutils" +) + +const template = `{ + "runtimes": { + "ascend": { + "path": "%s", + "runtimeArgs": [] + } + }, + "default-runtime": "ascend" +}` + +const ( + actionPosition = 0 + srcFilePosition = 1 + destFilePosition = 2 + runtimeFilePosition = 3 + rmCommandLength = 3 + addCommandLength = 4 +) + +func main() { + log.SetPrefix("LOG: ") + log.Printf("running %s", os.Args) + err := process() + if err != nil { + log.Printf("run %s failed", os.Args) + log.Fatal(err) + } else { + log.Printf("run %s success", os.Args) + } +} + +func process() error { + const helpMessage = "\tadd \n" + + "\t rm \n" + + "\t -h help command" + helpFlag := flag.Bool("h", false, helpMessage) + flag.Parse() + if *helpFlag { + _, err := fmt.Println(helpMessage) + return err + } + command := flag.Args() + action := command[actionPosition] + correctParam := false + if action == "add" && len(command) == addCommandLength { + correctParam = true + } + if action == "rm" && len(command) == rmCommandLength { + correctParam = true + } + if !correctParam { + return fmt.Errorf("error param") + } + + srcFilePath := command[srcFilePosition] + if _, err := mindxcheckutils.FileChecker(srcFilePath, false, true, false, 0); err != nil { + return err + } + destFilePath := command[destFilePosition] + if _, err := mindxcheckutils.FileChecker(filepath.Dir(destFilePath), true, true, false, 0); err != nil { + return err + } + + runtimeFilePath := "" + if len(command) == addCommandLength { + runtimeFilePath = command[runtimeFilePosition] + } + + // check file permission + writeContent, err := createJsonString(srcFilePath, runtimeFilePath, action) + if err != nil { + return err + } + return writeJson(destFilePath, writeContent) +} + +func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { + var writeContent []byte + if _, err := os.Stat(srcFilePath); err == nil { + daemon, err := modifyDaemon(srcFilePath, runtimeFilePath, action) + if err != nil { + return nil, err + } + writeContent, err = json.MarshalIndent(daemon, "", " ") + if err != nil { + return nil, err + } + } else { + // not existed + writeContent = []byte(fmt.Sprintf(template, runtimeFilePath)) + } + return writeContent, nil +} + +func writeJson(destFilePath string, writeContent []byte) error { + if _, err := os.Stat(destFilePath); os.IsNotExist(err) { + file, err := os.OpenFile(destFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0600) + if err != nil { + return fmt.Errorf("create target file failed") + } + _, err = file.Write(writeContent) + if err != nil { + return fmt.Errorf("write target file failed") + } + err = file.Close() + if err != nil { + return fmt.Errorf("close target file failed") + } + return nil + } else { + return fmt.Errorf("target file already existed") + } +} + +func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]interface{}, error) { + // existed... + daemon, err := loadOriginJson(srcFilePath) + if err != nil { + return nil, err + } + + if _, ok := daemon["runtimes"]; !ok && action == "add" { + daemon["runtimes"] = map[string]interface{}{} + } + runtimeValue := daemon["runtimes"] + runtimeConfig, runtimeConfigOk := runtimeValue.(map[string]interface{}) + if !runtimeConfigOk && action == "add" { + return nil, fmt.Errorf("extract runtime failed") + } + if action == "add" { + if _, ok := runtimeConfig["ascend"]; !ok { + runtimeConfig["ascend"] = map[string]interface{}{} + } + ascendConfig, ok := runtimeConfig["ascend"].(map[string]interface{}) + if !ok { + return nil, fmt.Errorf("extract ascend failed") + } + ascendConfig["path"] = runtimeFilePath + if _, ok := ascendConfig["runtimeArgs"]; !ok { + ascendConfig["runtimeArgs"] = []string{} + } + daemon["default-runtime"] = "ascend" + } else if action == "rm" { + if runtimeConfigOk { + delete(runtimeConfig, "ascend") + } + delete(daemon, "default-runtime") + } else { + return nil, fmt.Errorf("param error") + } + return daemon, nil +} + +func loadOriginJson(srcFilePath string) (map[string]interface{}, error) { + file, err := os.Open(srcFilePath) + if err != nil { + return nil, fmt.Errorf("open daemon.json failed") + } + content, err := ioutil.ReadAll(file) + if err != nil { + return nil, fmt.Errorf("read daemon.json failed") + } + err = file.Close() + if err != nil { + return nil, fmt.Errorf("close daemon.json failed") + } + + var daemon map[string]interface{} + err = json.Unmarshal(content, &daemon) + if err != nil { + return nil, fmt.Errorf("load daemon.json failed") + } + return daemon, nil +} -- Gitee From 40c5a51b28239c6b092a119d250d8eb3c13dfdf3 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 25 May 2022 15:30:11 +0800 Subject: [PATCH 219/296] Match-id-c6cf59a7d8f0bcecb9278dc08c2e60985081ba77 --- build/build.sh | 4 +- cli/test/dt/Depend/ut_main.cpp | 3 +- cli/test/dt/Scripts/pre.sh | 5 +- cli/test/dt/build.sh | 19 ++++- cli/test/dt/testcase/main.cpp | 3 +- install/deb/src/main.go | 76 ++++++++++++------- install/deb/src/main_test.go | 135 +++++++++++++++++++++++++++++++++ 7 files changed, 210 insertions(+), 35 deletions(-) create mode 100644 install/deb/src/main_test.go diff --git a/build/build.sh b/build/build.sh index b3af7ae..925f28b 100644 --- a/build/build.sh +++ b/build/build.sh @@ -56,9 +56,9 @@ function build_bin() cd ${INSTALLHELPERSRCDIR} go mod tidy [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build - mkdir -p ${BUILD}/build/helper/build && cd ${BUILD}/build/helper/build + mkdir -p ${BUILD}/build/helper/build go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} - mv main ascend-docker-plugin-install-helper + mv main ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper echo "make hook" cd ${HOOKDIR} diff --git a/cli/test/dt/Depend/ut_main.cpp b/cli/test/dt/Depend/ut_main.cpp index 9af0f43..2ead79e 100644 --- a/cli/test/dt/Depend/ut_main.cpp +++ b/cli/test/dt/Depend/ut_main.cpp @@ -10,6 +10,7 @@ using namespace testing; int main(int argc, char* argv[]) { - int result = testing::Init_UT(argc, argv,true); + InitGoogleTest(&argc, argv); + int result = RUN_ALL_TESTS(); return result; } diff --git a/cli/test/dt/Scripts/pre.sh b/cli/test/dt/Scripts/pre.sh index 7ed2019..63442c0 100644 --- a/cli/test/dt/Scripts/pre.sh +++ b/cli/test/dt/Scripts/pre.sh @@ -17,8 +17,9 @@ cmake .. make mkdir ../lib -cp gtest.out/libgtest.a ../lib -cp mockcpp.out/libmockcpp.a ../lib +find . -name "*a" +cp ./lib/libgtest.a ../lib +cp ./mockcpp.out/src/libmockcpp.a ../lib cp libut_main.a ../lib cd .. diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh index c1b569d..f5eaa23 100644 --- a/cli/test/dt/build.sh +++ b/cli/test/dt/build.sh @@ -17,6 +17,7 @@ makepre() if [ -f ${CUR_DIR}/../../../googletest.tar.gz ]; then cd ${CUR_DIR}/../../../ tar xf ${CUR_DIR}/../../../googletest.tar.gz + mv googletest-release-1.10.0/ googletest cd ${CUR_DIR} fi if [ -d ${CUR_DIR}/../../../googletest ]; then @@ -30,6 +31,15 @@ makepre() fi if [ -d ${CUR_DIR}/../../../mockcpp ]; then cp -rf ${CUR_DIR}/../../../mockcpp/* ${CUR_DIR}/Depend/mockcpp/ + cd ${CUR_DIR}/Depend/mockcpp + sed -i 's/${PYTHON_EXECUTABLE}/python2/g' src/CMakeLists.txt + sed -i '57i #if 0' ./include/mockcpp/mockcpp.h + sed -i '64i #endif' ./include/mockcpp/mockcpp.h + sed -i '5s/SET(PYTHON ${PYTHON_EXECUTABLE})/SET(PYTHON python2)/' ./src/CMakeLists.txt + sed -i '14s/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR})/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR}\/mockcpp)/' ./src/CMakeLists.txt + cmake . + make + cd ${CUR_DIR} fi # 如果没有生成过,则需要生成 @@ -38,7 +48,7 @@ makepre() echo "-------------make pre begin-------------------" cd Scripts chmod u+x ./pre.sh - ./pre.sh + bash -ex ./pre.sh cd - echo "-------------make pre end---------------------" fi @@ -57,6 +67,7 @@ build_huaweisecurec() if [ -f ${CUR_DIR}/../../../HuaweiSecureC.tar.gz ]; then cd ${CUR_DIR}/../../../ tar xf ${CUR_DIR}/../../../HuaweiSecureC.tar.gz + mv huawei_secure_c-tag_Huawei_Secure_C_V100R001C01SPC011B003_00001/ HuaweiSecureC cd ${CUR_DIR} fi if [ -d ${CUR_DIR}/../../../HuaweiSecureC/ ]; then @@ -82,6 +93,8 @@ build_cli() if [ -d ${CUR_DIR}/build ]; then rm -rf ${CUR_DIR}/build fi + pwd + find ../.. -name "*a" mkdir ${CUR_DIR}/build cd ${CUR_DIR}/build cmake .. @@ -93,14 +106,14 @@ run_lcov_cli() { echo "-------------run_ut cli begin-------------------" cd ${CUR_DIR}/build - ./ut_demo + ./ut_demo --gtest_output=xml:${CUR_DIR}/test_detail.xml cd ${SRC_ROOT}/.. ENABLE_BRANCH_COV="--rc lcov_branch_coverage=1" lcov --no-external -o result.info -b . -d . -c $ENABLE_BRANCH_COV genhtml --branch-coverage result.info -o Report $ENABLE_BRANCH_COV cd ${CUR_DIR} mkdir xml - cp -f buildDTCenter.xml ./xml/test_detail.xml + cp -f test_detail.xml ./xml/test_detail.xml mkdir html cp -rf ${SRC_ROOT}/../Report/* ./html/ echo "-------------run_ut cli end-------------------" diff --git a/cli/test/dt/testcase/main.cpp b/cli/test/dt/testcase/main.cpp index 2dd952f..9fb3d12 100644 --- a/cli/test/dt/testcase/main.cpp +++ b/cli/test/dt/testcase/main.cpp @@ -12,7 +12,8 @@ using namespace testing; int main(int argc, char* argv[], char* evn[]) { - int ret = Init_UT(argc, argv, true); + InitGoogleTest(&argc, argv); + int ret = RUN_ALL_TESTS(); if (1 == ret) { printf("有用例错误,请按任意键继续。。。"); } diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 3319a9b..a60377f 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -1,7 +1,6 @@ -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. - * Description: ascend-docker-runtime工具,辅助安装配置 - */ +// Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. + +// Description: ascend-docker-runtime工具,辅助安装配置 package main import ( @@ -27,12 +26,15 @@ const template = `{ }` const ( - actionPosition = 0 - srcFilePosition = 1 - destFilePosition = 2 + actionPosition = 0 + srcFilePosition = 1 + destFilePosition = 2 runtimeFilePosition = 3 - rmCommandLength = 3 - addCommandLength = 4 + rmCommandLength = 3 + addCommandLength = 4 + addCommand = "add" + rmCommand = "rm" + maxFileSize = 1024 * 1024 * 10 ) func main() { @@ -49,21 +51,24 @@ func main() { func process() error { const helpMessage = "\tadd \n" + - "\t rm \n" + - "\t -h help command" - helpFlag := flag.Bool("h", false, helpMessage) + "\t rm \n" + + "\t -h help command" + helpFlag := flag.Bool("h", false, helpMessage) flag.Parse() if *helpFlag { _, err := fmt.Println(helpMessage) return err } command := flag.Args() + if len(command) == 0 { + return fmt.Errorf("error param") + } action := command[actionPosition] correctParam := false - if action == "add" && len(command) == addCommandLength { + if action == addCommand && len(command) == addCommandLength { correctParam = true } - if action == "rm" && len(command) == rmCommandLength { + if action == rmCommand && len(command) == rmCommandLength { correctParam = true } if !correctParam { @@ -71,14 +76,20 @@ func process() error { } srcFilePath := command[srcFilePosition] - if _, err := mindxcheckutils.FileChecker(srcFilePath, false, true, false, 0); err != nil { - return err + if _, err := os.Stat(srcFilePath); os.IsNotExist(err) { + if _, err := mindxcheckutils.FileChecker(filepath.Dir(srcFilePath), true, true, false, 0); err != nil { + return err + } + } else { + if _, err := mindxcheckutils.FileChecker(srcFilePath, false, true, false, 0); err != nil { + return err + } } + destFilePath := command[destFilePosition] if _, err := mindxcheckutils.FileChecker(filepath.Dir(destFilePath), true, true, false, 0); err != nil { return err } - runtimeFilePath := "" if len(command) == addCommandLength { runtimeFilePath = command[runtimeFilePosition] @@ -103,22 +114,26 @@ func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, erro if err != nil { return nil, err } - } else { + } else if os.IsNotExist(err) { // not existed writeContent = []byte(fmt.Sprintf(template, runtimeFilePath)) + } else { + return nil, err } return writeContent, nil } func writeJson(destFilePath string, writeContent []byte) error { if _, err := os.Stat(destFilePath); os.IsNotExist(err) { - file, err := os.OpenFile(destFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0600) + const perm = 0600 + file, err := os.OpenFile(destFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm) if err != nil { return fmt.Errorf("create target file failed") } _, err = file.Write(writeContent) if err != nil { - return fmt.Errorf("write target file failed") + closeErr := file.Close() + return fmt.Errorf("write target file failed with close err %v", closeErr) } err = file.Close() if err != nil { @@ -137,15 +152,15 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter return nil, err } - if _, ok := daemon["runtimes"]; !ok && action == "add" { + if _, ok := daemon["runtimes"]; !ok && action == addCommand { daemon["runtimes"] = map[string]interface{}{} } runtimeValue := daemon["runtimes"] runtimeConfig, runtimeConfigOk := runtimeValue.(map[string]interface{}) - if !runtimeConfigOk && action == "add" { + if !runtimeConfigOk && action == addCommand { return nil, fmt.Errorf("extract runtime failed") } - if action == "add" { + if action == addCommand { if _, ok := runtimeConfig["ascend"]; !ok { runtimeConfig["ascend"] = map[string]interface{}{} } @@ -158,11 +173,13 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter ascendConfig["runtimeArgs"] = []string{} } daemon["default-runtime"] = "ascend" - } else if action == "rm" { + } else if action == rmCommand { if runtimeConfigOk { delete(runtimeConfig, "ascend") } - delete(daemon, "default-runtime") + if value, ok := daemon["default-runtime"]; ok && value == "ascend" { + delete(daemon, "default-runtime") + } } else { return nil, fmt.Errorf("param error") } @@ -170,13 +187,20 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter } func loadOriginJson(srcFilePath string) (map[string]interface{}, error) { + if fileInfo, err := os.Stat(srcFilePath); err != nil { + return nil, err + } else if fileInfo.Size() > maxFileSize { + return nil, fmt.Errorf("file size too large") + } + file, err := os.Open(srcFilePath) if err != nil { return nil, fmt.Errorf("open daemon.json failed") } content, err := ioutil.ReadAll(file) if err != nil { - return nil, fmt.Errorf("read daemon.json failed") + closeErr := file.Close() + return nil, fmt.Errorf("read daemon.json failed, close file err is %v", closeErr) } err = file.Close() if err != nil { diff --git a/install/deb/src/main_test.go b/install/deb/src/main_test.go new file mode 100644 index 0000000..427b124 --- /dev/null +++ b/install/deb/src/main_test.go @@ -0,0 +1,135 @@ +// Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. + +// Description: ascend-docker-runtime工具,辅助安装配置 +package main + +import ( + "encoding/json" + "os" + "reflect" + "testing" +) + +const oldString = `{ + "runtimes": { + "ascend": { + "path": "/test/runtime", + "runtimeArgs": [] + } + }, + "default-runtime": "ascend" + }` + +func jSONBytesEqual(a, b []byte) (bool, error) { + var contentA, contentB interface{} + if err := json.Unmarshal(a, &contentA); err != nil { + return false, err + } + if err := json.Unmarshal(b, &contentB); err != nil { + return false, err + } + return reflect.DeepEqual(contentB, contentA), nil +} + +func TestCreateJsonStringWholeNew(t *testing.T) { + data, err := createJsonString("/notExistedFile", "/test/runtime", "add") + if err != nil { + t.Fatalf("create string failed %s", err) + } + + if eq, err := jSONBytesEqual([]byte(oldString), data); err != nil || !eq { + t.Fatalf("empty create equal failed %s, %v", err, string(data)) + } +} + +func TestCreateJsonStringUpdate(t *testing.T) { + const perm = 0600 + if fid, err := os.OpenFile("old.json", os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm); err == nil { + _, err = fid.Write([]byte(oldString)) + closeErr := fid.Close() + if err != nil || closeErr != nil { + t.Fatalf("create old failed %s", err) + } + } + data, err := createJsonString("old.json", "/test/runtime1", "add") + if err != nil { + t.Fatalf("update failed %s", err) + } + expectString := `{ + "runtimes": { + "ascend": { + "path": "/test/runtime1", + "runtimeArgs": [] + } + }, + "default-runtime": "ascend" + }` + if eq, err := jSONBytesEqual([]byte(expectString), data); err != nil || !eq { + t.Fatalf("update failed %s, %v", err, string(data)) + } +} + +func TestCreateJsonStringUpdateWithOtherParam(t *testing.T) { + const perm = 0600 + oldStringWithParam := `{ + "runtimes": { + "ascend": { + "path": "/test/runtime", + "runtimeArgs": [1,2,3] + }, + "runc2": { + "path": "/test/runtime2", + "runtimeArgs": [1,2,3] + } + }, + "default-runtime": "runc" + }` + if fid, err := os.OpenFile("old.json", os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm); err == nil { + _, err = fid.Write([]byte(oldStringWithParam)) + closeErr := fid.Close() + if err != nil || closeErr != nil { + t.Fatalf("create old failed %s", err) + } + } + data, err := createJsonString("old.json", "/test/runtime1", "add") + if err != nil { + t.Fatalf("update failed %s", err) + } + expectString := `{ + "runtimes": { + "ascend": { + "path": "/test/runtime1", + "runtimeArgs": [1,2,3] + }, + "runc2": { + "path": "/test/runtime2", + "runtimeArgs": [1,2,3] + } + }, + "default-runtime": "ascend" + }` + if eq, err := jSONBytesEqual([]byte(expectString), data); err != nil || !eq { + t.Fatalf("update failed %s, %v", err, string(data)) + } +} + +func TestCreateJsonStrinRm(t *testing.T) { + const perm = 0600 + if fid, err := os.OpenFile("old.json", os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm); err == nil { + _, err = fid.Write([]byte(oldString)) + closeErr := fid.Close() + if err != nil || closeErr != nil { + t.Fatalf("create old failed %s", err) + } + } + data, err := createJsonString("old.json", "", "rm") + if err != nil { + t.Fatalf("update failed %s", err) + } + expectString := `{ + "runtimes": {} + }` + if eq, err := jSONBytesEqual([]byte(expectString), data); err != nil || !eq { + t.Fatalf("update failed %s, %v", err, string(data)) + } +} -- Gitee From 62b58e99de11b6ce3c85466d057143ac452d6ddc Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 1 Jun 2022 13:38:44 +0800 Subject: [PATCH 220/296] Match-id-f711436095c57c791fafc20b43bfe743878d4814 --- runtime/dcmi/dcmi.go | 224 +++++------------------------- runtime/dcmi/dcmi_api.go | 87 ++++++++++++ runtime/dcmi/dcmi_api_test.go | 70 ++++++++++ runtime/dcmi/dcmi_interface_api.h | 203 ++++++++++----------------- runtime/main.go | 2 +- 5 files changed, 265 insertions(+), 321 deletions(-) create mode 100644 runtime/dcmi/dcmi_api.go create mode 100644 runtime/dcmi/dcmi_api_test.go diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index dcf9b49..0a5fbe7 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -5,118 +5,12 @@ package dcmi // #cgo LDFLAGS: -ldl -/* #include - #include - #include - #include - - #include "dcmi_interface_api.h" - - void *dcmiHandle; - #define SO_NOT_FOUND -99999 - #define FUNCTION_NOT_FOUND -99998 - #define SUCCESS 0 - #define ERROR_UNKNOWN -99997 - #define CALL_FUNC(name,...) if(name##_func==NULL){return FUNCTION_NOT_FOUND;}return name##_func(__VA_ARGS__); - - // dcmi - int (*dcmi_init_func)(); - int dcmi_init(){ - CALL_FUNC(dcmi_init) - } - - int (*dcmi_get_card_num_list_func)(int *card_num, int *card_list, int list_length); - int dcmi_get_card_num_list(int *card_num, int *card_list, int list_length){ - CALL_FUNC(dcmi_get_card_num_list,card_num,card_list,list_length) - } - - int (*dcmi_get_device_num_in_card_func)(int card_id, int *device_num); - int dcmi_get_device_num_in_card(int card_id, int *device_num){ - CALL_FUNC(dcmi_get_device_num_in_card,card_id,device_num) - } - - int (*dcmi_get_device_logic_id_func)(int *device_logic_id, int card_id, int device_id); - int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id){ - CALL_FUNC(dcmi_get_device_logic_id,device_logic_id,card_id,device_id) - } - - int (*dcmi_create_vdevice_func)(int card_id, int device_id, int vdev_id, const char *template_name, - struct dcmi_create_vdev_out *out); - int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, - struct dcmi_create_vdev_out *out){ - CALL_FUNC(dcmi_create_vdevice,card_id,device_id,vdev_id,template_name,out) - } - - int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); - int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int VDevid){ - CALL_FUNC(dcmi_set_destroy_vdevice,card_id,device_id,VDevid) - } - - // load .so files and functions - int dcmiInit_dl(void){ - dcmiHandle = dlopen("libdcmi.so",RTLD_LAZY | RTLD_GLOBAL); - if (dcmiHandle == NULL){ - fprintf (stderr,"%s\n",dlerror()); - return SO_NOT_FOUND; - } - - dcmi_init_func = dlsym(dcmiHandle,"dcmi_init"); - - dcmi_get_card_num_list_func = dlsym(dcmiHandle,"dcmi_get_card_num_list"); - - dcmi_get_device_num_in_card_func = dlsym(dcmiHandle,"dcmi_get_device_num_in_card"); - - dcmi_get_device_logic_id_func = dlsym(dcmiHandle,"dcmi_get_device_logic_id"); - - dcmi_create_vdevice_func = dlsym(dcmiHandle,"dcmi_create_vdevice"); - - dcmi_set_destroy_vdevice_func = dlsym(dcmiHandle,"dcmi_set_destroy_vdevice"); - - return SUCCESS; - } - - int dcmiShutDown(void){ - if (dcmiHandle == NULL) { - return SUCCESS; - } - return (dlclose(dcmiHandle) ? ERROR_UNKNOWN : SUCCESS); - } - - int (*dsmi_get_logicid_from_phyid_func)(unsigned int phyid, unsigned int *logicid); - int dsmi_get_logicid_from_phyid(unsigned int phyid, unsigned int *logicid){ - CALL_FUNC(dsmi_get_logicid_from_phyid,phyid,logicid) - } - void *dsmiHandle; - int dsmiInit_dl(void){ - dsmiHandle = dlopen("libdrvdsmi_host.so",RTLD_LAZY); - if (dsmiHandle == NULL) { - dsmiHandle = dlopen("libdrvdsmi.so",RTLD_LAZY); - } - if (dsmiHandle == NULL){ - return SO_NOT_FOUND; - } - - dsmi_get_logicid_from_phyid_func = dlsym(dsmiHandle,"dsmi_get_logicid_from_phyid"); - - return SUCCESS; -} - -int dsmiShutDown(void){ - if (dsmiHandle == NULL) { - return SUCCESS; - } - return (dlclose(dsmiHandle) ? ERROR_UNKNOWN : SUCCESS); -} -*/ +// #include "dcmi_interface_api.h" import "C" import ( "fmt" "math" - "strconv" - "strings" "unsafe" - - "github.com/opencontainers/runtime-spec/specs-go" ) const ( @@ -130,15 +24,12 @@ const ( hiAIMaxCardNum = 16 ) -// VDeviceInfo vdevice created info -type VDeviceInfo struct { - CardID int32 - DeviceID int32 - VdeviceID int32 +// NpuWorker Dcmi worker +type NpuWorker struct { } -// InitDcmi dcmi/dsmi lib -func InitDcmi() error { +// Initialize dcmi lib init +func (w *NpuWorker) Initialize() error { if err := C.dcmiInit_dl(); err != C.SUCCESS { errInfo := fmt.Errorf("dcmi lib load failed, , error code: %d", int32(err)) return errInfo @@ -147,24 +38,18 @@ func InitDcmi() error { errInfo := fmt.Errorf("dcmi init failed, , error code: %d", int32(err)) return errInfo } - if err := C.dsmiInit_dl(); err != C.SUCCESS { - errInfo := fmt.Errorf("dsmi lib load failed, , error code: %d", int32(err)) - return errInfo - } return nil } -// ShutDownDcmi shutdown dcmi/dsmi lib -func ShutDownDcmi() { +// ShutDown shutdown dcmi lib +func (w *NpuWorker) ShutDown() { if err := C.dcmiShutDown(); err != C.SUCCESS { println(fmt.Errorf("dcmi shut down failed, error code: %d", int32(err))) } - if err := C.dsmiShutDown(); err != C.SUCCESS { - println(fmt.Errorf("dsmi shut down failed, error code: %d", int32(err))) - } } -func getCardList() (int32, []int32, error) { +// GetCardList list all cards on system +func GetCardList() (int32, []int32, error) { var ids [hiAIMaxCardNum]C.int var cNum C.int if err := C.dcmi_get_card_num_list(&cNum, &ids[0], hiAIMaxCardNum); err != 0 { @@ -172,7 +57,7 @@ func getCardList() (int32, []int32, error) { return retError, nil, errInfo } // checking card's quantity - if cNum <= 0 { + if cNum <= 0 || cNum > hiAIMaxCardNum { errInfo := fmt.Errorf("get error card quantity: %d", int32(cNum)) return retError, nil, errInfo } @@ -218,8 +103,8 @@ func GetDeviceLogicID(cardID, deviceID int32) (int32, error) { return int32(logicID), nil } -// SetCreateVDevice create virtual device -func SetCreateVDevice(cardID, deviceID int32, coreNum string) (uint32, error) { +// CreateVDevice create virtual device +func (w *NpuWorker) CreateVDevice(cardID, deviceID int32, coreNum string) (int32, error) { var createInfo C.struct_dcmi_create_vdev_out createInfo.vdev_id = C.uint(math.MaxUint32) coreTemplate := C.CString(coreNum) @@ -227,13 +112,19 @@ func SetCreateVDevice(cardID, deviceID int32, coreNum string) (uint32, error) { err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), C.int(0), coreTemplate, &createInfo) if err != 0 { errInfo := fmt.Errorf("create virtual device failed, error code: %d", int32(err)) - return uint32(math.MaxUint32), errInfo + return math.MaxInt32, errInfo } - return uint32(createInfo.vdev_id), nil + if createInfo.vdev_id > math.MaxInt32 { + return math.MaxInt32, fmt.Errorf("create virtual device failed, vdeviceId too large") + } + return int32(createInfo.vdev_id), nil } -// SetDestroyVDevice destroy virtual device -func SetDestroyVDevice(cardID, deviceID int32, vDevID uint32) error { +// DestroyVDevice destroy virtual device +func (w *NpuWorker) DestroyVDevice(cardID, deviceID int32, vDevID int32) error { + if vDevID < 0 { + return fmt.Errorf("param error on vDevID") + } if err := C.dcmi_set_destroy_vdevice(C.int(cardID), C.int(deviceID), C.uint(vDevID)); err != 0 { errInfo := fmt.Errorf("destroy virtual device failed, error code: %d", int32(err)) return errInfo @@ -241,78 +132,31 @@ func SetDestroyVDevice(cardID, deviceID int32, vDevID uint32) error { return nil } -// CreateVDevice will create virtual device -func CreateVDevice(spec *specs.Spec) (VDeviceInfo, error) { - visibleDevice, splitDevice, err := extractVpuParam(spec) - invalidVDevice := VDeviceInfo{CardID: -1, DeviceID: -1, VdeviceID: -1} - if err != nil || visibleDevice == -1 { - return invalidVDevice, err - } - if err := InitDcmi(); err != nil { - return invalidVDevice, fmt.Errorf("cannot init dcmi : %v", err) +// FindDevice find device by phyical id +func (w *NpuWorker) FindDevice(visibleDevice int32) (int32, int32, error) { + var logicID C.uint + if err := C.dcmi_get_device_logicid_from_phyid(C.uint(visibleDevice), &logicID); err != 0 { + return 0, 0, fmt.Errorf("phy id can not be converted to logic id : %v", err) } - defer ShutDownDcmi() - var dsmiLogicID C.uint - if err := C.dsmi_get_logicid_from_phyid(C.uint(visibleDevice), &dsmiLogicID); err != 0 { - return invalidVDevice, fmt.Errorf("phy id can not be converted to logic id : %v", err) + _, cardList, err := GetCardList() + if err != nil { + return 0, 0, fmt.Errorf("get card list err : %v", err) } - _, cardList, err := getCardList() targetDeviceID, targetCardID := int32(math.MaxInt32), int32(math.MaxInt32) for _, cardID := range cardList { deviceCount, err := GetDeviceNumInCard(cardID) if err != nil { - return invalidVDevice, fmt.Errorf("cannot get device num in card : %v", err) + return 0, 0, fmt.Errorf("cannot get device num in card : %v", err) } for deviceID := int32(0); deviceID < deviceCount; deviceID++ { logicID, err := GetDeviceLogicID(cardID, deviceID) if err != nil { - return invalidVDevice, fmt.Errorf("cannot get logic id : %v", err) + return 0, 0, fmt.Errorf("cannot get logic id : %v", err) } - if logicID == int32(dsmiLogicID) { + if logicID == int32(logicID) { targetCardID, targetDeviceID = cardID, deviceID } } } - - vdeviceID, err := SetCreateVDevice(targetCardID, targetDeviceID, splitDevice) - if err != nil || int(vdeviceID) < 0 { - return invalidVDevice, fmt.Errorf("cannot create vd or vdevice is wrong: %v %v", vdeviceID, err) - } - return VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}, nil -} - -func extractVpuParam(spec *specs.Spec) (int32, string, error) { - visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" - allowSplit := map[string]string{ - "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", - } - - for _, line := range spec.Process.Env { - words := strings.Split(line, "=") - const LENGTH int = 2 - if len(words) != LENGTH { - continue - } - if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { - visibleDeviceLine = words[1] - } - if strings.TrimSpace(words[0]) == "ASCEND_VNPU_SPECS" { - if split := allowSplit[words[1]]; split != "" { - splitDevice = split - needSplit = true - } else { - return -1, "", fmt.Errorf("cannot parse param : %v", words[1]) - } - } - } - if needSplit { - if cardID, err := strconv.Atoi(visibleDeviceLine); err == nil { - visibleDevice = int32(cardID) - } else { - return -1, "", fmt.Errorf("cannot parse param : %v %v", err, visibleDeviceLine) - } - } else { - return -1, "", nil - } - return visibleDevice, splitDevice, nil + return targetDeviceID, targetCardID, nil } diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go new file mode 100644 index 0000000..10e6cf3 --- /dev/null +++ b/runtime/dcmi/dcmi_api.go @@ -0,0 +1,87 @@ +// Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. + +// Package dcmi is used to work with Ascend devices +package dcmi + +import ( + "fmt" + "math" + "strconv" + "strings" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +// VDeviceInfo vdevice created info +type VDeviceInfo struct { + CardID int32 + DeviceID int32 + VdeviceID int32 +} + +// WorkerInterface worker interface +type WorkerInterface interface { + Initialize() error + ShutDown() + FindDevice(visibleDevice int32) (int32, int32, error) + CreateVDevice(cardID, deviceID int32, coreNum string) (int32, error) + DestroyVDevice(cardID, deviceID int32, vDevID int32) error +} + +// CreateVDevice will create virtual device +func CreateVDevice(w WorkerInterface, spec *specs.Spec) (VDeviceInfo, error) { + visibleDevice, splitDevice, err := extractVpuParam(spec) + invalidVDevice := VDeviceInfo{CardID: -1, DeviceID: -1, VdeviceID: -1} + if err != nil || visibleDevice < 0 { + return invalidVDevice, err + } + if err := w.Initialize(); err != nil { + return invalidVDevice, fmt.Errorf("cannot init dcmi : %v", err) + } + defer w.ShutDown() + targetDeviceID, targetCardID, err := w.FindDevice(visibleDevice) + if err != nil { + return invalidVDevice, err + } + + vdeviceID, err := w.CreateVDevice(targetCardID, targetDeviceID, splitDevice) + if err != nil || vdeviceID < 0 { + return invalidVDevice, fmt.Errorf("cannot create vd or vdevice is wrong: %v %v", vdeviceID, err) + } + return VDeviceInfo{CardID: targetCardID, DeviceID: targetDeviceID, VdeviceID: int32(vdeviceID)}, nil +} + +func extractVpuParam(spec *specs.Spec) (int32, string, error) { + visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" + allowSplit := map[string]string{ + "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", + } + + for _, line := range spec.Process.Env { + words := strings.Split(line, "=") + const LENGTH int = 2 + if len(words) != LENGTH { + continue + } + if strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { + visibleDeviceLine = words[1] + } + if strings.TrimSpace(words[0]) == "ASCEND_VNPU_SPECS" { + if split, ok := allowSplit[words[1]]; split != "" && ok { + splitDevice = split + needSplit = true + } else { + return -1, "", fmt.Errorf("cannot parse param : %v", words[1]) + } + } + } + if !needSplit { + return -1, "", nil + } + if cardID, err := strconv.Atoi(visibleDeviceLine); err == nil && cardID >= 0 && cardID <= math.MaxInt32 { + visibleDevice = int32(cardID) + } else { + return -1, "", fmt.Errorf("cannot parse param : %v %v", err, visibleDeviceLine) + } + return visibleDevice, splitDevice, nil +} diff --git a/runtime/dcmi/dcmi_api_test.go b/runtime/dcmi/dcmi_api_test.go new file mode 100644 index 0000000..b7e0cb3 --- /dev/null +++ b/runtime/dcmi/dcmi_api_test.go @@ -0,0 +1,70 @@ +// Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + +// Description: dcmi DT测试 +package dcmi + +import ( + "testing" + + "github.com/opencontainers/runtime-spec/specs-go" +) + +const mockDeviceId = 100 + +type mockWorker struct{} + +func (w *mockWorker) Initialize() error { + return nil +} + +// ShutDown shutdown mock lib +func (w *mockWorker) ShutDown() { + return +} + +// CreateVDevice create v device +func (w *mockWorker) CreateVDevice(_, _ int32, _ string) (int32, error) { + + return int32(mockDeviceId), nil +} + +// DestroyVDevice destroy virtual device +func (w *mockWorker) DestroyVDevice(_, _, _ int32) error { + return nil +} + +// FindDevice find device by phyical id +func (w *mockWorker) FindDevice(_ int32) (int32, int32, error) { + return 0, 0, nil +} + +func TestCreateVDevice(t *testing.T) { + t.Log("TestCreateVDevice start") + process := specs.Process{} + spec := specs.Spec{Process: &process} + spec.Process.Env = []string{} + + // no split, all ok + vdevice, err := CreateVDevice(&mockWorker{}, &spec) + if err != nil { + t.Fatalf("%v %v", vdevice, err) + } + + // no npu assigin for split + spec.Process.Env = []string{"ASCEND_VNPU_SPECS=vir04"} + vdevice, err = CreateVDevice(&mockWorker{}, &spec) + if err == nil { + t.Fatalf("%v %v", vdevice, err) + } + + // split ok + spec.Process.Env = []string{"ASCEND_VNPU_SPECS=vir04", "ASCEND_VISIBLE_DEVICES=0"} + vdevice, err = CreateVDevice(&mockWorker{}, &spec) + if err != nil { + t.Fatalf("%v %v", vdevice, err) + } + if vdevice.VdeviceID != mockDeviceId { + t.Fatalf("%v %v", vdevice, err) + } + +} diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h index e5b47a8..e7e3f7a 100644 --- a/runtime/dcmi/dcmi_interface_api.h +++ b/runtime/dcmi/dcmi_interface_api.h @@ -5,22 +5,23 @@ #ifndef __DCMI_INTERFACE_API_H__ #define __DCMI_INTERFACE_API_H__ - +#include +#include +#include +#include #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ -#ifdef __linux -#define DCMIDLLEXPORT -#else -#define DCMIDLLEXPORT _declspec(dllexport) -#endif - -#define DCMI_VDEV_RES_NAME_LEN 16 -#define DCMI_VDEV_FOR_RESERVE 32 -#define DCMI_VDEV_MAX_NUM 32 +void *dcmiHandle; +#define SO_NOT_FOUND (-99999) +#define FUNCTION_NOT_FOUND (-99998) +#define SUCCESS (0) +#define ERROR_UNKNOWN (-99997) +#define CALL_FUNC(name, ...) if (name##_func == NULL) {return FUNCTION_NOT_FOUND;}return name##_func(__VA_ARGS__) +#define DCMI_VDEV_FOR_RESERVE (32) struct dcmi_create_vdev_out { unsigned int vdev_id; unsigned int pcie_bus; @@ -30,142 +31,84 @@ struct dcmi_create_vdev_out { unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; }; -enum dcmi_main_cmd { - DCMI_MAIN_CMD_DVPP = 0, - DCMI_MAIN_CMD_ISP, - DCMI_MAIN_CMD_TS_GROUP_NUM, - DCMI_MAIN_CMD_CAN, - DCMI_MAIN_CMD_UART, - DCMI_MAIN_CMD_UPGRADE, - DCMI_MAIN_CMD_TEMP = 50, - DCMI_MAIN_CMD_SVM = 51, - DCMI_MAIN_CMD_VDEV_MNG, - DCMI_MAIN_CMD_DEVICE_SHARE = 0x8001, - DCMI_MAIN_CMD_EX_CERT = 0x8003, - DCMI_MAIN_CMD_MAX -}; +// dcmi +int (*dcmi_init_func)(); +int dcmi_init() +{ + CALL_FUNC(dcmi_init); +} -/* DSMI sub vdev mng CMD def */ -typedef enum { - DCMI_VMNG_SUB_CMD_GET_VDEV_RESOURCE, - DCMI_VMNG_SUB_CMD_GET_TOTAL_RESOURCE, - DCMI_VMNG_SUB_CMD_GET_FREE_RESOURCE, - DCMI_VMNG_SUB_CMD_MAX, -} DCMI_VDEV_MNG_SUB_CMD; - -struct dcmi_base_resource { - unsigned long long token; - unsigned long long token_max; - unsigned long long task_timeout; - unsigned int vfg_id; - unsigned char vip_mode; - unsigned char reserved[DCMI_VDEV_FOR_RESERVE - 1]; /* bytes aligned */ -}; +int (*dcmi_get_card_num_list_func)(int *card_num, int *card_list, int list_length); +int dcmi_get_card_num_list(int *card_num, int *card_list, int list_length) +{ + CALL_FUNC(dcmi_get_card_num_list, card_num, card_list, list_length); +} -/* total types of computing resource */ -struct dcmi_computing_resource { - /* accelator resource */ - float aic; - float aiv; - unsigned short dsa; - unsigned short rtsq; - unsigned short acsq; - unsigned short cdqm; - unsigned short c_core; - unsigned short ffts; - unsigned short sdma; - unsigned short pcie_dma; - - /* memory resource, MB as unit */ - unsigned long long memory_size; - - /* id resource */ - unsigned int event_id; - unsigned int notify_id; - unsigned int stream_id; - unsigned int model_id; - - /* cpu resource */ - unsigned short topic_schedule_aicpu; - unsigned short host_ctrl_cpu; - unsigned short host_aicpu; - unsigned short device_aicpu; - unsigned short topic_ctrl_cpu_slot; +int (*dcmi_get_device_num_in_card_func)(int card_id, int *device_num); +int dcmi_get_device_num_in_card(int card_id, int *device_num) +{ + CALL_FUNC(dcmi_get_device_num_in_card, card_id, device_num); +} - unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; -}; +int (*dcmi_get_device_logic_id_func)(int *device_logic_id, int card_id, int device_id); +int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id) +{ + CALL_FUNC(dcmi_get_device_logic_id, device_logic_id, card_id, device_id); +} -struct dcmi_media_resource { - /* dvpp resource */ - float jpegd; - float jpege; - float vpc; - float vdec; - float pngd; - float venc; - unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; -}; +int (*dcmi_create_vdevice_func)(int card_id, int device_id, int vdev_id, const char *template_name, + struct dcmi_create_vdev_out *out); +int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, + struct dcmi_create_vdev_out *out) +{ + CALL_FUNC(dcmi_create_vdevice, card_id, device_id, vdev_id, template_name, out); +} -struct dcmi_vdev_query_info { - char name[DCMI_VDEV_RES_NAME_LEN]; - unsigned int status; - unsigned int is_container_used; - unsigned int vfid; - unsigned int vfg_id; - unsigned long long container_id; - struct dcmi_base_resource base; - struct dcmi_computing_resource computing; - struct dcmi_media_resource media; -}; +int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); +int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int VDevid) +{ + CALL_FUNC(dcmi_set_destroy_vdevice, card_id, device_id, VDevid); +} -/* for single search */ -// vdev -struct dcmi_vdev_query_stru { - unsigned int vdev_id; - struct dcmi_vdev_query_info query_info; -}; +int (*dcmi_get_device_logicid_from_phyid_func)(unsigned int phyid, unsigned int *logicid); +int dcmi_get_device_logicid_from_phyid(unsigned int phyid, unsigned int *logicid) +{ + CALL_FUNC(dcmi_get_device_logicid_from_phyid, phyid, logicid); +} -// free -struct dcmi_soc_free_resource { - unsigned int vfg_num; - unsigned int vfg_bitmap; - struct dcmi_base_resource base; - struct dcmi_computing_resource computing; - struct dcmi_media_resource media; -}; +// load .so files and functions +int dcmiInit_dl(void) +{ + dcmiHandle = dlopen("libdcmi.so", RTLD_LAZY | RTLD_GLOBAL); + if (dcmiHandle == NULL) { + fprintf (stderr, "%s\n", dlerror()); + return SO_NOT_FOUND; + } -// total -struct dcmi_soc_total_resource { - unsigned int vdev_num; - unsigned int vdev_id[DCMI_VDEV_MAX_NUM]; - unsigned int vfg_num; - unsigned int vfg_bitmap; - struct dcmi_base_resource base; - struct dcmi_computing_resource computing; - struct dcmi_media_resource media; -}; + dcmi_init_func = dlsym(dcmiHandle, "dcmi_init"); -enum dcmi_unit_type { - NPU_TYPE = 0, - MCU_TYPE = 1, - CPU_TYPE = 2, - INVALID_TYPE = 0xFF -}; + dcmi_get_card_num_list_func = dlsym(dcmiHandle, "dcmi_get_card_num_list"); -DCMIDLLEXPORT int dcmi_init(void); + dcmi_get_device_num_in_card_func = dlsym(dcmiHandle, "dcmi_get_device_num_in_card"); -DCMIDLLEXPORT int dcmi_get_card_num_list(int *card_num, int *card_list, int list_len); + dcmi_get_device_logic_id_func = dlsym(dcmiHandle, "dcmi_get_device_logic_id"); -DCMIDLLEXPORT int dcmi_get_device_num_in_card(int card_id, int *device_num); + dcmi_create_vdevice_func = dlsym(dcmiHandle, "dcmi_create_vdevice"); -DCMIDLLEXPORT int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, - struct dcmi_create_vdev_out *out); + dcmi_set_destroy_vdevice_func = dlsym(dcmiHandle, "dcmi_set_destroy_vdevice"); -DCMIDLLEXPORT int dcmi_set_destroy_vdevice(int card_id, int device_id, unsigned int vdevid); + dcmi_get_device_logicid_from_phyid_func = dlsym(dcmiHandle, "dcmi_get_device_logicid_from_phyid"); -DCMIDLLEXPORT int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id); + return SUCCESS; +} -DCMIDLLEXPORT int dcmi_get_device_type(int card_id, int device_id, enum dcmi_unit_type *device_type); +int dcmiShutDown(void) +{ + if (dcmiHandle == NULL) { + return SUCCESS; + } + return (dlclose(dcmiHandle) ? ERROR_UNKNOWN : SUCCESS); +} #ifdef __cplusplus #if __cplusplus diff --git a/runtime/main.go b/runtime/main.go index ab6d095..135ba52 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -100,7 +100,7 @@ func addHook(spec *specs.Spec) error { }) } - vdevice, err := dcmi.CreateVDevice(spec) + vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) if err != nil { return err -- Gitee From a2a2ca22b93d74aa2e88f69231269d2f7a3ec793 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 2 Jun 2022 19:57:15 +0800 Subject: [PATCH 221/296] Match-id-73e3ba7c6756a2005266b89b264440d2d4757027 --- build/conf/ascend-docker-plugin.yaml | 108 +++++++++++++++++++++++++++ build/conf/cli.yaml | 17 +++++ build/conf/config.yaml | 5 ++ build/conf/destroy.yaml | 17 +++++ build/conf/hook.yaml | 32 ++++++++ build/conf/installhelper.yaml | 17 +++++ build/conf/runtime.yaml | 32 ++++++++ 7 files changed, 228 insertions(+) create mode 100644 build/conf/ascend-docker-plugin.yaml create mode 100644 build/conf/cli.yaml create mode 100644 build/conf/config.yaml create mode 100644 build/conf/destroy.yaml create mode 100644 build/conf/hook.yaml create mode 100644 build/conf/installhelper.yaml create mode 100644 build/conf/runtime.yaml diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml new file mode 100644 index 0000000..4044643 --- /dev/null +++ b/build/conf/ascend-docker-plugin.yaml @@ -0,0 +1,108 @@ +component: ascend-docker-plugin +product: ascend-docker-plugin +systemEnv: + - workspace + - processor +version: 3.0.RC2 +compile: + ## 组件名称 + name: ascend-docker-plugin + version: + ## 构建输入源:皆为依赖如自研代码、开源软件、三方软件源码等 + ## 构建准备:指定需要移动、删除、权限修改的文件 + input: + dependency: + - name: destroy + offering: ascend-docker-plugin + version: + type: self-component + src: + des: + buildType: + buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/" + - name: cli + offering: ascend-docker-plugin + version: + type: self-component + src: + des: + buildType: + buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/" + - name: installhelper + offering: ascend-docker-plugin + version: + type: self-component + src: + des: + buildType: + buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/" + - name: hook + offering: ascend-docker-plugin + version: + type: self-component + src: + des: + buildType: + buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/" + - name: runtime + offering: ascend-docker-plugin + version: + type: self-component + src: + des: + buildType: + buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/" + files: "" + process: + language: c + compilerTool: make + parameters: [] + sourcePath: "" + buildPath: "" + output: + +package: + name: Ascend-docker-runtime + service: Ascend-docker-runtime + MindXSDK: b050 + packageInfo: + - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.run" + input: + files: + include: + - remove: ["{{ systemEnv.workspace }}/ascend-docker-plugin/output/*"] + - copy: + src: + - "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker*" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build/ascend-docker*" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/destroy/build/ascend-docker*" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/uninstall.sh" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A500" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/assets" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/README.md" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/run_main.sh" + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/" + - copy: + src: + - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh" + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/" + - mode: + src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" ] + mode: "550" + + + process: + type: run + srcRoot: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/" + parameters: [ makeself, help.info, "{{systemEnv.DATE }}"] + output: + include: + - move: + - src: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/{{ package.name }}" + - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output" + diff --git a/build/conf/cli.yaml b/build/conf/cli.yaml new file mode 100644 index 0000000..3f84548 --- /dev/null +++ b/build/conf/cli.yaml @@ -0,0 +1,17 @@ +component: cli +product: ToolBox +systemEnv: + - workspace + - processor +compile: + name: cli + version: + input: + files: "" + process: + language: c + compilerTool: cmake + parameters: [] + sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/cli/src" + buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build" + output: \ No newline at end of file diff --git a/build/conf/config.yaml b/build/conf/config.yaml new file mode 100644 index 0000000..e664b69 --- /dev/null +++ b/build/conf/config.yaml @@ -0,0 +1,5 @@ +version: + pkgversion: + AtlasEdge: +projects: +compilers: diff --git a/build/conf/destroy.yaml b/build/conf/destroy.yaml new file mode 100644 index 0000000..7cdd683 --- /dev/null +++ b/build/conf/destroy.yaml @@ -0,0 +1,17 @@ +component: destroy +product: ToolBox +systemEnv: + - workspace + - processor +compile: + name: destroy + version: + input: + files: "" + process: + language: c + compilerTool: cmake + parameters: [] + sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/destroy/src" + buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin//build/destroy/build" + output: \ No newline at end of file diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml new file mode 100644 index 0000000..0ec006a --- /dev/null +++ b/build/conf/hook.yaml @@ -0,0 +1,32 @@ +component: hook +product: ToolBox +systemEnv: + - workspace + - processor +compile: + name: hook + version: + input: + files: + exclude: + - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" ] + include: + - commands: + - command: " mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build " + process: + language: go + compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build " + parameters: [ + [ "buildmode","pie" ], + [ "ldflags",'-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s '], + [ "trimpath","{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main.go"], + ] + output: + files: + include: + - copy: + src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/main" ] + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook" + rename: true + # exclude: + # - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" ] \ No newline at end of file diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml new file mode 100644 index 0000000..5ab758b --- /dev/null +++ b/build/conf/installhelper.yaml @@ -0,0 +1,17 @@ +component: installhelper +product: ToolBox +systemEnv: + - workspace + - processor +compile: + name: installhelper + version: + input: + files: "" + process: + language: c + compilerTool: cmake + parameters: [] + sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" + buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" + output: \ No newline at end of file diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml new file mode 100644 index 0000000..084d747 --- /dev/null +++ b/build/conf/runtime.yaml @@ -0,0 +1,32 @@ +component: runtime +product: ToolBox +systemEnv: + - workspace + - processor +compile: + name: runtime + version: + input: + files: + exclude: + - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" ] + include: + - commands: + - command: " mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build " + process: + language: go + compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" + parameters: [ + [ "buildmode", "pie" ], + [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], + [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main.go" ], + ] + output: + files: + include: + - copy: + src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/main" ] + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime" + rename: true + # exclude: + # - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" ] \ No newline at end of file -- Gitee From e1e073cdae3b194da8a9288ce3f3bb4778795d8e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 7 Jun 2022 13:47:47 +0800 Subject: [PATCH 222/296] Match-id-8abc1363b57a379fefd756d92c235648cfab1d0f --- build/conf/hook.yaml | 11 +++++------ build/conf/installhelper.yaml | 28 +++++++++++++++++++++------- build/conf/runtime.yaml | 11 +++++------ 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 0ec006a..7e6115c 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -12,10 +12,11 @@ compile: - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" ] include: - commands: - - command: " mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build " + - command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook/ && go mod download" process: language: go - compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build " + compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/" parameters: [ [ "buildmode","pie" ], [ "ldflags",'-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s '], @@ -25,8 +26,6 @@ compile: files: include: - copy: - src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/main" ] + src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main" ] des: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook" - rename: true - # exclude: - # - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" ] \ No newline at end of file + rename: true \ No newline at end of file diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index 5ab758b..cba6542 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -7,11 +7,25 @@ compile: name: installhelper version: input: - files: "" + files: + exclude: + - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" ] + include: + - commands: + - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/ && go mod tidy" process: - language: c - compilerTool: cmake - parameters: [] - sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" - buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" - output: \ No newline at end of file + language: go + compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" + parameters: [ + [ "buildmode", "pie" ], + [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], + [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"], + ] + output: + files: + include: + - copy: + src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main" ] + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker-plugin-install-helper" + rename: true \ No newline at end of file diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 084d747..faf0359 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -12,10 +12,11 @@ compile: - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" ] include: - commands: - - command: " mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build " + - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime && go mod download" process: language: go - compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" + compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime" parameters: [ [ "buildmode", "pie" ], [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], @@ -25,8 +26,6 @@ compile: files: include: - copy: - src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/main" ] + src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main" ] des: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime" - rename: true - # exclude: - # - remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" ] \ No newline at end of file + rename: true \ No newline at end of file -- Gitee From 334d3325b78a3018f6d3310e6b397320742491cb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 7 Jun 2022 21:00:07 +0800 Subject: [PATCH 223/296] Match-id-15eff2a644219bec00028536d9ba25138595e2a2 --- build/conf/ascend-docker-plugin.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index 4044643..5b48d0d 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -101,8 +101,9 @@ package: srcRoot: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/" parameters: [ makeself, help.info, "{{systemEnv.DATE }}"] output: - include: - - move: - - src: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/{{ package.name }}" - - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output" + files: + include: + - move: + src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/*.run"] + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output" -- Gitee From 2e58fbf915367017ff230ffffdbc5799aec33687 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 9 Jun 2022 22:11:27 +0800 Subject: [PATCH 224/296] Match-id-c0ca3c01b48a89f9d26b7a5755f9bc7b4690d804 --- runtime/dcmi/dcmi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 0a5fbe7..f679987 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -109,7 +109,7 @@ func (w *NpuWorker) CreateVDevice(cardID, deviceID int32, coreNum string) (int32 createInfo.vdev_id = C.uint(math.MaxUint32) coreTemplate := C.CString(coreNum) defer C.free(unsafe.Pointer(coreTemplate)) - err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), C.int(0), coreTemplate, &createInfo) + err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), C.int(-1), coreTemplate, &createInfo) if err != 0 { errInfo := fmt.Errorf("create virtual device failed, error code: %d", int32(err)) return math.MaxInt32, errInfo -- Gitee From bcea561b2147d3e3cde052ce6c0a7c4dfd0d2484 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 10 Jun 2022 19:50:35 +0800 Subject: [PATCH 225/296] Match-id-a9bc6f82d57cb37c8f7a8deb5e1ba4d8f3f2c5ae --- runtime/dcmi/dcmi_api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index 10e6cf3..da6cf0f 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -5,6 +5,7 @@ package dcmi import ( "fmt" + "log" "math" "strconv" "strings" @@ -40,6 +41,7 @@ func CreateVDevice(w WorkerInterface, spec *specs.Spec) (VDeviceInfo, error) { } defer w.ShutDown() targetDeviceID, targetCardID, err := w.FindDevice(visibleDevice) + log.Fatal(fmt.Errorf("found device: %v %v", targetDeviceID, targetCardID)) if err != nil { return invalidVDevice, err } -- Gitee From 58c66d7577c36b54295323d99007f88254867013 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 10 Jun 2022 20:01:11 +0800 Subject: [PATCH 226/296] Match-id-e3384d78d5f35e95ce173a2969920a01dfc9124e --- runtime/dcmi/dcmi.go | 10 +++++++--- runtime/dcmi/dcmi_api.go | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index f679987..5f1e0c8 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -134,10 +134,14 @@ func (w *NpuWorker) DestroyVDevice(cardID, deviceID int32, vDevID int32) error { // FindDevice find device by phyical id func (w *NpuWorker) FindDevice(visibleDevice int32) (int32, int32, error) { - var logicID C.uint - if err := C.dcmi_get_device_logicid_from_phyid(C.uint(visibleDevice), &logicID); err != 0 { + var dcmiLogicID C.uint + if err := C.dcmi_get_device_logicid_from_phyid(C.uint(visibleDevice), &dcmiLogicID); err != 0 { return 0, 0, fmt.Errorf("phy id can not be converted to logic id : %v", err) } + if uint(dcmiLogicID) > math.MaxInt32 { + return 0, 0, fmt.Errorf("logic id too large") + } + targetLogicID := int32(dcmiLogicID) _, cardList, err := GetCardList() if err != nil { return 0, 0, fmt.Errorf("get card list err : %v", err) @@ -153,7 +157,7 @@ func (w *NpuWorker) FindDevice(visibleDevice int32) (int32, int32, error) { if err != nil { return 0, 0, fmt.Errorf("cannot get logic id : %v", err) } - if logicID == int32(logicID) { + if logicID == int32(targetLogicID) { targetCardID, targetDeviceID = cardID, deviceID } } diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index da6cf0f..10e6cf3 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -5,7 +5,6 @@ package dcmi import ( "fmt" - "log" "math" "strconv" "strings" @@ -41,7 +40,6 @@ func CreateVDevice(w WorkerInterface, spec *specs.Spec) (VDeviceInfo, error) { } defer w.ShutDown() targetDeviceID, targetCardID, err := w.FindDevice(visibleDevice) - log.Fatal(fmt.Errorf("found device: %v %v", targetDeviceID, targetCardID)) if err != nil { return invalidVDevice, err } -- Gitee From 32b45190bf4afc2e994dd84cf9260ad30a89781f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 13 Jun 2022 17:45:20 +0800 Subject: [PATCH 227/296] Match-id-736351bcbab9825232a29001080a89b7d32c4ff3 --- runtime/main.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index 436738d..8244d63 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -28,6 +28,7 @@ const ( hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" dockerRuncFile = "docker-runc" runcFile = "runc" + envLength = 2 ) var ( @@ -108,6 +109,19 @@ func addHook(spec *specs.Spec) error { }) } + hasVirtualFlag := false + for _, line := range spec.Process.Env { + words := strings.Split(line, "=") + if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { + if strings.Contains(words[1], "VIRTUAL") { + hasVirtualFlag = true + } + } + } + if hasVirtualFlag { + return nil + } + vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) if err != nil { @@ -126,12 +140,11 @@ func updateEnvAndPostHook(spec *specs.Spec, vdevice dcmi.VDeviceInfo) { needAddVirtualFlag := true for _, line := range spec.Process.Env { words := strings.Split(line, "=") - const LENGTH int = 2 - if len(words) == LENGTH && strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { + if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_VISIBLE_DEVICES" { newEnv = append(newEnv, fmt.Sprintf("ASCEND_VISIBLE_DEVICES=%d", vdevice.VdeviceID)) continue } - if len(words) == LENGTH && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { + if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { needAddVirtualFlag = false if strings.Contains(words[1], "VIRTUAL") { newEnv = append(newEnv, line) -- Gitee From 3051dc666d8f6918818ddeb09ef4e5b0f6ef6d3f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 14 Jun 2022 15:38:30 +0800 Subject: [PATCH 228/296] Match-id-0564baf09bb178fd45f166def3a8d1aac178ff32 --- hook/main.go | 5 +++++ install/deb/src/main.go | 5 +++++ runtime/main.go | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/hook/main.go b/hook/main.go index d178622..c1cf237 100644 --- a/hook/main.go +++ b/hook/main.go @@ -374,6 +374,11 @@ func doPrestartHook() error { } func main() { + defer func() { + if err := recover(); err != nil { + log.Fatal(err) + } + }() log.SetPrefix(loggingPrefix) if err := doPrestartHook(); err != nil { diff --git a/install/deb/src/main.go b/install/deb/src/main.go index a60377f..3e49aef 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -38,6 +38,11 @@ const ( ) func main() { + defer func() { + if err := recover(); err != nil { + log.Fatal(err) + } + }() log.SetPrefix("LOG: ") log.Printf("running %s", os.Args) err := process() diff --git a/runtime/main.go b/runtime/main.go index 8244d63..a7dec7b 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -239,6 +239,11 @@ func doProcess() error { } func main() { + defer func() { + if err := recover(); err != nil { + log.Fatal(err) + } + }() log.SetPrefix(loggingPrefix) if err := doProcess(); err != nil { log.Fatal(err) -- Gitee From 7869bb730b053d7f7bb8f8aaf4170887114c194f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 17 Jun 2022 11:46:28 +0800 Subject: [PATCH 229/296] Match-id-42d6774fb12b4d9dde40e7c7f5ce88232ca0baec --- build/conf/ascend-docker-plugin.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index 5b48d0d..6ed0692 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -91,10 +91,8 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh" - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh" des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/" - - mode: - src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" ] - mode: "550" - + - commands: + - command: "chmod 550 {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" process: type: run -- Gitee From 75dcd990cf4fff074e4eb9644b7abe631b583ca2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 20 Jun 2022 14:18:40 +0800 Subject: [PATCH 230/296] Match-id-2b390e7b3829146bd86b7d023bb263bfe86bd037 --- build/build.sh | 4 +- hook/go.mod | 7 +- hook/main.go | 72 ++++++++++++-- install/deb/src/main.go | 6 +- mindxcheckutils/mindxcheckutils.go | 124 ++++++++++++++++++++++++ mindxcheckutils/mindxcheckutils_test.go | 72 ++++++++++++++ runtime/go.mod | 7 +- runtime/go.sum | 4 + runtime/main.go | 69 +++++++++++-- 9 files changed, 346 insertions(+), 19 deletions(-) diff --git a/build/build.sh b/build/build.sh index 438bcdf..f521e66 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # Description: ascend-docker-runtime构建脚本 -set -e +set -ex ROOT=$(cd $(dirname $0); pwd)/.. TOP_DIR=$ROOT/.. @@ -62,6 +62,8 @@ function build_bin() export GOPATH="${ROOT}/opensource" export GO111MODULE=on export GONOSUMDB="*" + export GONOPROXY=*.huawei.com + export GOFLAGS="-mod=mod" echo "make installhelper" cd ${INSTALLHELPERSRCDIR} diff --git a/hook/go.mod b/hook/go.mod index 215a958..aab06b2 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,7 +5,12 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 + huawei.com/npu-exporter v0.2.7 mindxcheckutils v1.0.0 ) -replace mindxcheckutils => ../mindxcheckutils +replace ( + mindxcheckutils => ../mindxcheckutils + huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 +) diff --git a/hook/main.go b/hook/main.go index c1cf237..7e5aea1 100644 --- a/hook/main.go +++ b/hook/main.go @@ -18,12 +18,16 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" + "go.uber.org/zap" + "huawei.com/npu-exporter/hwlog" "mindxcheckutils" ) const ( loggingPrefix = "ascend-docker-hook" + runLogPath = "/var/log/ascend-docker-runtime/hook-run.log" + operateLogPath = "/var/log/ascend-docker-runtime/hook-operate.log" ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES" ascendRuntimeOptions = "ASCEND_RUNTIME_OPTIONS" ascendRuntimeMounts = "ASCEND_RUNTIME_MOUNTS" @@ -33,8 +37,10 @@ const ( baseConfig = "base" configFileSuffix = "list" - borderNum = 2 - kvPairSize = 2 + borderNum = 2 + kvPairSize = 2 + maxLogLength = 1024 + maxCommandLength = 65535 ) var ( @@ -55,6 +61,32 @@ type containerConfig struct { Env []string } +func initLogModule(stopCh <-chan struct{}) error { + const backups = 2 + const logMaxAge = 365 + runLogConfig := hwlog.LogConfig{ + LogFileName: runLogPath, + LogLevel: 0, + MaxBackups: backups, + MaxAge: logMaxAge, + } + if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { + fmt.Printf("hwlog init failed, error is %v", err) + return err + } + operateLogConfig := hwlog.LogConfig{ + LogFileName: operateLogPath, + LogLevel: 0, + MaxBackups: backups, + MaxAge: logMaxAge, + } + if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { + fmt.Printf("hwlog init failed, error is %v", err) + return err + } + return nil +} + func removeDuplication(devices []int) []int { list := make([]int, 0, len(devices)) prev := -1 @@ -192,7 +224,7 @@ var getContainerConfig = func() (*containerConfig, error) { } configPath := path.Join(state.Bundle, "config.json") - if _, err := mindxcheckutils.FileChecker(configPath, false, false, true, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(configPath, false, true, mindxcheckutils.DefaultSize); err != nil { return nil, err } @@ -238,7 +270,8 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { } fileInfo, err := os.Stat(baseConfigFilePath) - if _, err := mindxcheckutils.FileChecker(baseConfigFilePath, false, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(baseConfigFilePath, true, false, + mindxcheckutils.DefaultSize); err != nil { return nil, nil, err } if err != nil { @@ -345,7 +378,7 @@ func doPrestartHook() error { if _, err = os.Stat(cliPath); err != nil { return fmt.Errorf("cannot find ascend-docker-cli executable file at %s: %v", cliPath, err) } - if _, err := mindxcheckutils.FileChecker(cliPath, false, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(cliPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } @@ -365,11 +398,9 @@ func doPrestartHook() error { if len(parsedOptions) > 0 { args = append(args, "--options", strings.Join(parsedOptions, ",")) } - if err := doExec(cliPath, args, os.Environ()); err != nil { return fmt.Errorf("failed to exec ascend-docker-cli %v: %v", args, err) } - return nil } @@ -381,7 +412,34 @@ func main() { }() log.SetPrefix(loggingPrefix) + stopCh := make(chan struct{}) + if err := initLogModule(stopCh); err != nil { + close(stopCh) + log.Fatal(err) + } + logPrefixWords, err := mindxcheckutils.GetLogPrefix() + if err != nil { + close(stopCh) + log.Fatal(err) + } + hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.RunLog.Infof("ascend docker hook starting") + if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, + maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + close(stopCh) + log.Fatal("command error") + } + logWords := fmt.Sprintf("running %v", os.Args) + if len(logWords) > maxLogLength { + logWords = logWords[0:maxLogLength-1] + "..." + } + hwlog.OpLog.Infof(logWords) if err := doPrestartHook(); err != nil { + hwlog.RunLog.Errorf("ascend docker hook failed") + hwlog.OpLog.Errorf("failed: err %v", err) + close(stopCh) log.Fatal(err) } + close(stopCh) } diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 3e49aef..d8c702d 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -82,17 +82,17 @@ func process() error { srcFilePath := command[srcFilePosition] if _, err := os.Stat(srcFilePath); os.IsNotExist(err) { - if _, err := mindxcheckutils.FileChecker(filepath.Dir(srcFilePath), true, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealDirChecker(filepath.Dir(srcFilePath), true, false); err != nil { return err } } else { - if _, err := mindxcheckutils.FileChecker(srcFilePath, false, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(srcFilePath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } } destFilePath := command[destFilePosition] - if _, err := mindxcheckutils.FileChecker(filepath.Dir(destFilePath), true, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealDirChecker(filepath.Dir(destFilePath), true, false); err != nil { return err } runtimeFilePath := "" diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go index 3d550e1..2643165 100644 --- a/mindxcheckutils/mindxcheckutils.go +++ b/mindxcheckutils/mindxcheckutils.go @@ -12,6 +12,83 @@ import ( "syscall" ) +const ( + maxLogFieldLength = 64 + notValidPath = "not-valid-file-path" + maxAllowFileSize = 102400 // in megabytes + oneMegabytes = 1048576 + // DefaultSize default size of file allowed + DefaultSize = 100 // in megabytes + // DefaultWhiteList default white list in string + DefaultWhiteList = "-_./~" + // DefaultStringSize default string max length + DefaultStringSize = 256 + // DefaultPathSize default string max length + DefaultPathSize = 4096 +) + +var logPrefix = "" + +// RealFileChecker check if a file is safe to use +func RealFileChecker(path string, checkParent, allowLink bool, size int) (string, error) { + if !StringChecker(path, 0, DefaultPathSize, DefaultWhiteList) { + return notValidPath, fmt.Errorf("invalid path") + } + _, err := FileChecker(path, false, checkParent, allowLink, 0) + if err != nil { + return notValidPath, err + } + realPath, err := filepath.Abs(path) + if err != nil { + return notValidPath, err + } + realPath, err = filepath.EvalSymlinks(realPath) + if err != nil { + return notValidPath, err + } + fileInfo, err := os.Stat(realPath) + if err != nil { + return notValidPath, err + } + if !fileInfo.Mode().IsRegular() { + return notValidPath, fmt.Errorf("invalid regular file") + } + if size > maxAllowFileSize || size < 0 { + return notValidPath, fmt.Errorf("invalid size") + } + if fileInfo.Size() > int64(size)*int64(oneMegabytes) { + return notValidPath, fmt.Errorf("size too large") + } + return realPath, nil +} + +// RealDirChecker check if a dir is safe to use +func RealDirChecker(path string, checkParent, allowLink bool) (string, error) { + if !StringChecker(path, 0, DefaultPathSize, DefaultWhiteList) { + return notValidPath, fmt.Errorf("invalid path") + } + _, err := FileChecker(path, true, checkParent, allowLink, 0) + if err != nil { + return notValidPath, err + } + realPath, err := filepath.Abs(path) + if err != nil { + return notValidPath, err + } + realPath, err = filepath.EvalSymlinks(realPath) + if err != nil { + return notValidPath, err + } + fileInfo, err := os.Stat(realPath) + if err != nil { + return notValidPath, err + } + if !fileInfo.IsDir() { + return notValidPath, fmt.Errorf("not a dir") + } + return realPath, nil +} + // FileChecker check if a file/dir is safe to use func FileChecker(path string, allowDir, checkParent, allowLink bool, deep int) (bool, error) { const maxDepth, groupWriteIndex, otherWriteIndex, permLength int = 99, 5, 8, 10 @@ -25,6 +102,9 @@ func FileChecker(path string, allowDir, checkParent, allowLink bool, deep int) ( if err != nil { return false, fmt.Errorf("get abs path failed %v", err) } + if len(filepath.Base(filePath)) > DefaultStringSize { + return false, fmt.Errorf("path too long") + } fileInfo, ok, err := normalFileCheck(filePath, allowDir, allowLink) if err != nil { return ok, err @@ -82,3 +162,47 @@ func normalFileCheck(filePath string, allowDir bool, allowLink bool) (os.FileInf } return fileInfo, false, nil } + +// GetLogPrefix get log prefix +func GetLogPrefix() (string, error) { + if logPrefix != "" { + return logPrefix, nil + } + uid := os.Geteuid() + if uid < 0 { + return "", fmt.Errorf("err: uid not right") + } + tty, err := filepath.EvalSymlinks("/proc/self/fd/0") + if err != nil || !StringChecker(tty, 0, DefaultStringSize, "/:") { + tty = "unknown" + } + + logPrefix = fmt.Sprintf("uid: %d tty: %v ", uid, tty) + return logPrefix, nil +} + +func isLetter(c rune) bool { + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') +} + +func isNumber(c rune) bool { + return '0' <= c && c <= '9' +} + +func isInWhiteList(c rune, whiteList string) bool { + return strings.Contains(whiteList, string(c)) +} + +// StringChecker check string +func StringChecker(text string, minLength, maxLength int, whiteList string) bool { + if len(text) <= minLength || len(text) >= maxLength { + return false + } + for _, char := range text { + if isLetter(char) || isNumber(char) || isInWhiteList(char, whiteList) { + continue + } + return false + } + return true +} diff --git a/mindxcheckutils/mindxcheckutils_test.go b/mindxcheckutils/mindxcheckutils_test.go index 0a6711e..100d8fd 100644 --- a/mindxcheckutils/mindxcheckutils_test.go +++ b/mindxcheckutils/mindxcheckutils_test.go @@ -66,6 +66,78 @@ func TestFileCheckRegularFile(t *testing.T) { } } +func TestGetLogPrefix(t *testing.T) { + logPrefix = "" + prefix, err := GetLogPrefix() + if err != nil { + t.Fatalf("get log prefix failed %v %v", prefix, err) + } + if logPrefix == "" || prefix != logPrefix { + t.Fatalf("get log prefix failed 2 %v %v", prefix, prefix) + } +} + +func TestRealFileChecker(t *testing.T) { + tmpDir, filePath, err := createTestFile(t, "test_file.txt") + if err != nil { + t.Fatalf("create file failed %q: %s", filePath, err) + } + defer removeTmpDir(t, tmpDir) + const permission os.FileMode = 0700 + err = os.WriteFile(filePath, []byte("hello\n"), permission) + if err != nil { + t.Fatalf("create file failed %q: %s", filePath, err) + } + if _, err = RealFileChecker(filePath, false, true, 0); err == nil { + t.Fatalf("size check wrong 0 %q: %s", filePath, err) + } + if _, err = RealFileChecker(filePath, false, true, 1); err != nil { + t.Fatalf("size check wrong 1 %q: %s", filePath, err) + } +} + +func TestRealDirChecker(t *testing.T) { + tmpDir, filePath, err := createTestFile(t, "test_file.txt") + if err != nil { + t.Fatalf("create file failed %q: %s", filePath, err) + } + defer removeTmpDir(t, tmpDir) + if _, err = RealDirChecker(filePath, false, true); err == nil { + t.Fatalf("should be dir 0 %q: %s", filePath, err) + } + if _, err = RealDirChecker(tmpDir, false, true); err != nil { + t.Fatalf("should be dir 1 %q: %s", filePath, err) + } +} + +func TestStringChecker(t *testing.T) { + if ok := StringChecker("0123456789abcABC", 0, DefaultStringSize, ""); !ok { + t.Fatalf("failed on regular letters") + } + const testSize = 3 + if ok := StringChecker("123", 0, testSize, ""); ok { + t.Fatalf("failed on max length") + } + if ok := StringChecker("1234", 0, testSize, ""); ok { + t.Fatalf("failed on max length") + } + if ok := StringChecker("12", 0, testSize, ""); !ok { + t.Fatalf("failed on max length") + } + if ok := StringChecker("", 0, testSize, ""); ok { + t.Fatalf("failed on min length") + } + if ok := StringChecker("123", testSize, DefaultStringSize, ""); ok { + t.Fatalf("failed on min length") + } + if ok := StringChecker("123%", 0, DefaultStringSize, ""); ok { + t.Fatalf("failed on strange words") + } + if ok := StringChecker("123.-/~", 0, DefaultStringSize, DefaultWhiteList); !ok { + t.Fatalf("failed on strange words") + } +} + func createTestFile(t *testing.T, fileName string) (string, string, error) { tmpDir := os.TempDir() const permission os.FileMode = 0700 diff --git a/runtime/go.mod b/runtime/go.mod index 215a958..aab06b2 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -5,7 +5,12 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 + huawei.com/npu-exporter v0.2.7 mindxcheckutils v1.0.0 ) -replace mindxcheckutils => ../mindxcheckutils +replace ( + mindxcheckutils => ../mindxcheckutils + huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 +) diff --git a/runtime/go.sum b/runtime/go.sum index 9345f6a..deb268c 100644 --- a/runtime/go.sum +++ b/runtime/go.sum @@ -13,3 +13,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 h1:yKnqOCGmdknfWhfDBqSKYWuioQzdiXz7VeKh56EGhjw= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7/go.mod h1:sUdarWqC4+C7fr0rpGUNvx1n1JixILyKOlS1gDfpi/w= +codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 h1:QO4JTYr7hsyjd8VeE9ARivO3iIes/1GS6DkLiS5w3Xo= +codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6/go.mod h1:mbUvvh/0ox+lNtLoraCsf+NMpTCL2h4L/NtfboraaH4= \ No newline at end of file diff --git a/runtime/main.go b/runtime/main.go index a7dec7b..212900a 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -17,12 +17,17 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" + "go.uber.org/zap" + "huawei.com/npu-exporter/hwlog" "mindxcheckutils" ) const ( - loggingPrefix = "ascend-docker-runtime" + runLogPath = "/var/log/ascend-docker-runtime/runtime-run.log" + operateLogPath = "/var/log/ascend-docker-runtime/runtime-operate.log" + maxLogLength = 1024 + maxCommandLength = 65535 hookCli = "ascend-docker-hook" destroyHookCli = "ascend-docker-destroy" hookDefaultFilePath = "/usr/local/bin/ascend-docker-hook" @@ -60,6 +65,32 @@ func getArgs() (*args, error) { return args, nil } +func initLogModule(stopCh <-chan struct{}) error { + const backups = 2 + const logMaxAge = 365 + runLogConfig := hwlog.LogConfig{ + LogFileName: runLogPath, + LogLevel: 0, + MaxBackups: backups, + MaxAge: logMaxAge, + } + if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { + fmt.Printf("hwlog init failed, error is %v", err) + return err + } + operateLogConfig := hwlog.LogConfig{ + LogFileName: operateLogPath, + LogLevel: 0, + MaxBackups: backups, + MaxAge: logMaxAge, + } + if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { + fmt.Printf("hwlog init failed, error is %v", err) + return err + } + return nil +} + var execRunc = func() error { runcPath, err := exec.LookPath(dockerRuncName) if err != nil { @@ -68,7 +99,7 @@ var execRunc = func() error { return fmt.Errorf("failed to find the path of runc: %v", err) } } - if _, err := mindxcheckutils.FileChecker(runcPath, false, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(runcPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } @@ -86,7 +117,7 @@ func addHook(spec *specs.Spec) error { } hookCliPath = path.Join(path.Dir(currentExecPath), hookCli) - if _, err := mindxcheckutils.FileChecker(hookCliPath, false, true, false, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(hookCliPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } if _, err = os.Stat(hookCliPath); err != nil { @@ -123,7 +154,7 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) - + hwlog.RunLog.Infof("vnpu split done: vdevice: %v err: %v", vdevice.VdeviceID, err) if err != nil { return err } @@ -175,7 +206,7 @@ func modifySpecFile(path string) error { if err != nil { return fmt.Errorf("spec file doesnt exist %s: %v", path, err) } - if _, err := mindxcheckutils.FileChecker(path, false, true, true, 0); err != nil { + if _, err := mindxcheckutils.RealFileChecker(path, true, true, mindxcheckutils.DefaultSize); err != nil { return err } @@ -244,8 +275,34 @@ func main() { log.Fatal(err) } }() - log.SetPrefix(loggingPrefix) + stopCh := make(chan struct{}) + if err := initLogModule(stopCh); err != nil { + close(stopCh) + log.Fatal(err) + } + logPrefixWords, err := mindxcheckutils.GetLogPrefix() + if err != nil { + close(stopCh) + log.Fatal(err) + } + hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.RunLog.Infof("ascend docker runtime starting") + if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, + maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + close(stopCh) + log.Fatal("command error") + } + logWords := fmt.Sprintf("running %v", os.Args) + if len(logWords) > maxLogLength { + logWords = logWords[0:maxLogLength-1] + "..." + } + hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { + hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) + hwlog.OpLog.Errorf("%v failed", logWords) + close(stopCh) log.Fatal(err) } + close(stopCh) } -- Gitee From e19736dbaf670a483f69ab2483e42aea808c8a39 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 22 Jun 2022 14:21:28 +0800 Subject: [PATCH 231/296] Match-id-6b1150d20beff1efde2654461ec07a0afa9e8a88 --- cli/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main.c b/cli/src/main.c index 52d8549..72fcdb2 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -76,7 +76,6 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } - errno = 0; args->pid = strtol(optarg, NULL, DECIMAL); const char* pidMax = "/proc/sys/kernel/pid_max"; const size_t maxFileSzieMb = 10; // max 10MB @@ -84,6 +83,7 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) Logger("failed to check pid_max path.", LEVEL_ERROR, SCREEN_YES); return false; } + errno = 0; FILE* pFile = NULL; pFile = fopen(pidMax, "r"); if ((pFile == NULL) || (fgets(buff, PATH_MAX, pFile) == NULL)) { -- Gitee From 5fe4f2c5625d4a31889a03dcaad2cfdffa388e7b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 23 Jun 2022 20:19:58 +0800 Subject: [PATCH 232/296] Match-id-8f37dc4e0c50790da9e1aa9da055d4b777595bde --- cli/src/basic.h | 2 +- cli/src/main.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index 95fde2c..ab7b159 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -21,7 +21,7 @@ #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 -#define WHITE_LIST_NUM 4 +#define WHITE_LIST_NUM 9 #define ROOT_UID 0 diff --git a/cli/src/main.c b/cli/src/main.c index 72fcdb2..616c14d 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -195,7 +195,13 @@ static bool CheckWhiteList(const char* fileName) const char mountWhiteList[WHITE_LIST_NUM][PATH_MAX] = {{"/usr/local/Ascend/driver/lib64"}, {"/usr/local/Ascend/driver/include"}, {"/usr/local/dcmi"}, - {"/usr/local/bin/npu-smi"}}; + {"/usr/local/bin/npu-smi"}, + {"/home/data/miniD/driver/lib64"}, + {"/usr/local/sbin/npu-smi"}, + {"/usr/local/Ascend/driver/tools"}, + {"/etc/hdcBasic.cfg"}, + {"/etc/sys_version.conf"} + }; for (size_t iLoop = 0; iLoop < WHITE_LIST_NUM; iLoop++) { if (strcmp(mountWhiteList[iLoop], fileName) == 0) { -- Gitee From d4a7429f185a7f28848a266d240b9975a7700ba4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 15:31:35 +0800 Subject: [PATCH 233/296] Match-id-9f4635510003d220df7b39d766083c1f8b9d50b1 --- destroy/src/CMakeLists.txt | 2 +- destroy/src/main.c | 44 +++++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/destroy/src/CMakeLists.txt b/destroy/src/CMakeLists.txt index 1b413ee..e01591e 100644 --- a/destroy/src/CMakeLists.txt +++ b/destroy/src/CMakeLists.txt @@ -10,6 +10,6 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") aux_source_directory(. SRC) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC) -add_executable(ascend-docker-destroy ${SRC}) +add_executable(ascend-docker-destroy ../../cli/src/logger.c ../../cli/src/utils.c ${SRC} ) target_compile_options(ascend-docker-destroy PRIVATE -fstack-protector-all -fpie -ldl -D_FORTIFY_SOURCE=2 -O2) target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/destroy/src/main.c b/destroy/src/main.c index 8149f9b..2f33731 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -15,6 +15,9 @@ #include #include #include "securec.h" +#include "../../cli/src/logger.h" +#include "../../cli/src/utils.h" +#include "../../cli/src/basic.h" #define DCMI_INIT "dcmi_init" #define DCMI_SET_DESTROY_VDEVICE "dcmi_set_destroy_vdevice" @@ -28,8 +31,7 @@ static bool ShowExceptionInfo(const char* exceptionInfo) { - (void)fprintf(stderr, exceptionInfo); - (void)fprintf(stderr, "\n"); + Logger(exceptionInfo, LEVEL_INFO, SCREEN_YES); return false; } @@ -79,7 +81,8 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen struct stat fileStat; if ((stat(buf, &fileStat) != 0) || ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - (void)fprintf(stderr, "[2: %s]\n", buf); + char *str = FormatLogMessage("[2: %s]\n", buf); + Logger(str, LEVEL_ERROR, SCREEN_YES); return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); } if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 @@ -88,7 +91,7 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen return CheckParentDir(buf, PATH_MAX, fileStat, checkOwner); } -static bool IsValidChar(const char c) +static bool IsAValidChar(const char c) { if (isalnum(c) != 0) { return true; @@ -108,14 +111,14 @@ static bool CheckFileName(const char* filePath, const size_t filePathLen) return ShowExceptionInfo("filePathLen out of bounds!"); } for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if (!IsValidChar(filePath[iLoop])) { // 非法字符 + if (!IsAValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } return true; } -static bool CheckExternalFile(const char* filePath, const size_t filePathLen, +static bool CheckAExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { if (filePath == NULL) { @@ -138,7 +141,8 @@ static bool DeclareDcmiApiAndCheck(void **handle) { *handle = dlopen("libdcmi.so", RTLD_LAZY); if (*handle == NULL) { - (void)fprintf(stderr, "dlopen failed.\n"); + char *str = FormatLogMessage("dlopen failed.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return false; } char pLinkMap[sizeof(struct link_map)] = {0}; @@ -146,12 +150,14 @@ static bool DeclareDcmiApiAndCheck(void **handle) if (ret == 0) { struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb - if (!CheckExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { - (void)fprintf(stderr, "check sofile failed.\n"); + if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { + char *str = FormatLogMessage("check sofile failed.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return false; } } else { - (void)fprintf(stderr, "dlinfo sofile failed.\n"); + char *str = FormatLogMessage("dlinfo sofile failed.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return false; } @@ -160,8 +166,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) static void DcmiDlAbnormalExit(void **handle, const char* errorInfo) { - (void)fprintf(stderr, errorInfo); - (void)fprintf(stderr, "\n"); + Logger(errorInfo, LEVEL_INFO, SCREEN_YES); if (*handle != NULL) { dlclose(*handle); *handle = NULL; @@ -216,7 +221,8 @@ static bool DcmiInitProcess(void *handle) } int ret = dcmi_init(); if (ret != 0) { - (void)fprintf(stderr, "dcmi_init failed, ret = %d\n", ret); + char *str = FormatLogMessage("dcmi_init failed, ret = %d\n", ret); + Logger(str, LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -237,7 +243,8 @@ static bool DcmiDestroyProcess(void *handle, const int cardId, } int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { - (void)fprintf(stderr, "dcmi_set_destroy_vdevice failed, ret = %d\n", ret); + char *str = FormatLogMessage("dcmi_set_destroy_vdevice failed, ret = %d\n", ret); + Logger(str, LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -258,7 +265,8 @@ static int DestroyEntrance(const char *argv[]) void *handle = NULL; if (!DeclareDcmiApiAndCheck(&handle)) { - (void)fprintf(stderr, "Declare dcmi failed.\n"); + char *str = FormatLogMessage("Declare dcmi failed.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return -1; } if (!DcmiInitProcess(handle)) { @@ -274,7 +282,8 @@ static int DestroyEntrance(const char *argv[]) static bool EntryCheck(const int argc, const char *argv[]) { if (argc != DESTROY_PARAMS_NUM) { - (void)fprintf(stderr, "destroy params namber error.\n"); + char *str = FormatLogMessage("destroy params namber error.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return false; } for (int iLoop = 1; iLoop < argc; iLoop++) { @@ -290,7 +299,8 @@ static bool EntryCheck(const int argc, const char *argv[]) int main(const int argc, const char *argv[]) { if (!EntryCheck(argc, argv)) { - (void)fprintf(stderr, "destroy params value error.\n"); + char *str = FormatLogMessage("destroy params value error.\n"); + Logger(str, LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From 7e694dcf809e1ca3df600cc6ad646c5e4bf6016c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 16:33:10 +0800 Subject: [PATCH 234/296] Match-id-7b43a8b775fb4044034c77198a3dcf6a071b8df4 --- destroy/src/CMakeLists.txt | 3 ++- destroy/src/main.c | 30 +++++++++--------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/destroy/src/CMakeLists.txt b/destroy/src/CMakeLists.txt index e01591e..95a1496 100644 --- a/destroy/src/CMakeLists.txt +++ b/destroy/src/CMakeLists.txt @@ -8,8 +8,9 @@ add_compile_options(-fstack-protector-all -D _GNU_SOURCE -Wl,--no-undefined) message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") +include_directories("${PROJECT_SOURCE_DIR}/../../cli/src") aux_source_directory(. SRC) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC) -add_executable(ascend-docker-destroy ../../cli/src/logger.c ../../cli/src/utils.c ${SRC} ) +add_executable(ascend-docker-destroy ../../cli/src/logger.c ../../cli/src/utils.c ../../cli/src/basic.c ${SRC} ) target_compile_options(ascend-docker-destroy PRIVATE -fstack-protector-all -fpie -ldl -D_FORTIFY_SOURCE=2 -O2) target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/destroy/src/main.c b/destroy/src/main.c index 2f33731..6d33309 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -15,9 +15,7 @@ #include #include #include "securec.h" -#include "../../cli/src/logger.h" -#include "../../cli/src/utils.h" -#include "../../cli/src/basic.h" +#include "basic.h" #define DCMI_INIT "dcmi_init" #define DCMI_SET_DESTROY_VDEVICE "dcmi_set_destroy_vdevice" @@ -81,8 +79,6 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen struct stat fileStat; if ((stat(buf, &fileStat) != 0) || ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - char *str = FormatLogMessage("[2: %s]\n", buf); - Logger(str, LEVEL_ERROR, SCREEN_YES); return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); } if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 @@ -141,8 +137,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) { *handle = dlopen("libdcmi.so", RTLD_LAZY); if (*handle == NULL) { - char *str = FormatLogMessage("dlopen failed.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("dlopen failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } char pLinkMap[sizeof(struct link_map)] = {0}; @@ -151,13 +146,11 @@ static bool DeclareDcmiApiAndCheck(void **handle) struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { - char *str = FormatLogMessage("check sofile failed.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("check sofile failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } } else { - char *str = FormatLogMessage("dlinfo sofile failed.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("dlinfo sofile failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } @@ -221,8 +214,7 @@ static bool DcmiInitProcess(void *handle) } int ret = dcmi_init(); if (ret != 0) { - char *str = FormatLogMessage("dcmi_init failed, ret = %d\n", ret); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_init faile.\n", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -243,8 +235,7 @@ static bool DcmiDestroyProcess(void *handle, const int cardId, } int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { - char *str = FormatLogMessage("dcmi_set_destroy_vdevice failed, ret = %d\n", ret); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_set_destroy_vdevice failed.\n", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -265,8 +256,7 @@ static int DestroyEntrance(const char *argv[]) void *handle = NULL; if (!DeclareDcmiApiAndCheck(&handle)) { - char *str = FormatLogMessage("Declare dcmi failed.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("Declare dcmi failed.\n", LEVEL_ERROR, SCREEN_YES); return -1; } if (!DcmiInitProcess(handle)) { @@ -282,8 +272,7 @@ static int DestroyEntrance(const char *argv[]) static bool EntryCheck(const int argc, const char *argv[]) { if (argc != DESTROY_PARAMS_NUM) { - char *str = FormatLogMessage("destroy params namber error.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("destroy params namber error.\n", LEVEL_ERROR, SCREEN_YES); return false; } for (int iLoop = 1; iLoop < argc; iLoop++) { @@ -299,8 +288,7 @@ static bool EntryCheck(const int argc, const char *argv[]) int main(const int argc, const char *argv[]) { if (!EntryCheck(argc, argv)) { - char *str = FormatLogMessage("destroy params value error.\n"); - Logger(str, LEVEL_ERROR, SCREEN_YES); + Logger("destroy params value error.\n", LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From f1978808579b16819a00413992985b10f9198acf Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 16:56:58 +0800 Subject: [PATCH 235/296] Match-id-d27475bada8f117d41e77aff1058a74207e39d15 --- destroy/src/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/destroy/src/main.c b/destroy/src/main.c index 6d33309..c652c08 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -29,7 +29,7 @@ static bool ShowExceptionInfo(const char* exceptionInfo) { - Logger(exceptionInfo, LEVEL_INFO, SCREEN_YES); + Logger(exceptionInfo, LEVEL_ERROR, SCREEN_YES); return false; } @@ -250,6 +250,9 @@ static int DestroyEntrance(const char *argv[]) int cardId = 0; int deviceId = 0; int vDeviceId = 0; + char *str = FormatLogMessage("start to destroy v-device %d start...\n", vDeviceId); + Logger(str, LEVEL_INFO, SCREEN_YES); //start to destroy v-device + free(str); if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { return -1; } @@ -266,6 +269,9 @@ static int DestroyEntrance(const char *argv[]) return -1; } DcmiDlclose(&handle); + char *strEnd = FormatLogMessage("destroy v-device %d successfully.\n", vDeviceId); + Logger(strEnd, LEVEL_INFO, SCREEN_YES); //start to destroy v-device + free(strEnd); return 0; } -- Gitee From 856b5c58453619fb43e675f16d57e654f9a955f5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 16:59:28 +0800 Subject: [PATCH 236/296] Match-id-820f6251f8bde699fb30b212670e05aa20f8b2ff --- destroy/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/destroy/src/main.c b/destroy/src/main.c index c652c08..82ff43e 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -251,7 +251,7 @@ static int DestroyEntrance(const char *argv[]) int deviceId = 0; int vDeviceId = 0; char *str = FormatLogMessage("start to destroy v-device %d start...\n", vDeviceId); - Logger(str, LEVEL_INFO, SCREEN_YES); //start to destroy v-device + Logger(str, LEVEL_INFO, SCREEN_YES); free(str); if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { return -1; @@ -270,7 +270,7 @@ static int DestroyEntrance(const char *argv[]) } DcmiDlclose(&handle); char *strEnd = FormatLogMessage("destroy v-device %d successfully.\n", vDeviceId); - Logger(strEnd, LEVEL_INFO, SCREEN_YES); //start to destroy v-device + Logger(strEnd, LEVEL_INFO, SCREEN_YES); free(strEnd); return 0; } -- Gitee From c3765b7fdedf13daa16a2abea9a9c2c311879ff7 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 17:02:57 +0800 Subject: [PATCH 237/296] Match-id-9b031a41a79c5d84e26cc0fafd35fa1f88434e2a --- destroy/src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/destroy/src/main.c b/destroy/src/main.c index 82ff43e..9974082 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -16,6 +16,8 @@ #include #include "securec.h" #include "basic.h" +#include "logger.h" +#include "utils.h" #define DCMI_INIT "dcmi_init" #define DCMI_SET_DESTROY_VDEVICE "dcmi_set_destroy_vdevice" -- Gitee From 643ba53c0a65641ac4cf8c870e7cb907429e4ad5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 18:31:13 +0800 Subject: [PATCH 238/296] Match-id-09d2bc5b9a36bbbc76315b00256129aa20140634 --- build/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.sh b/build/build.sh index f521e66..c179ea9 100644 --- a/build/build.sh +++ b/build/build.sh @@ -69,6 +69,10 @@ function build_bin() cd ${INSTALLHELPERSRCDIR} go mod tidy [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build + export CGO_ENABLED=1 + export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" + export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" mkdir -p ${BUILD}/build/helper/build go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} mv main ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper @@ -77,10 +81,6 @@ function build_bin() go mod download [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - export CGO_ENABLED=1 - export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" - export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} mv main ascend-docker-hook echo `pwd` -- Gitee From 2bb9bfa00bc38b570033d3fd47d3a15c141e6ee1 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 24 Jun 2022 19:18:03 +0800 Subject: [PATCH 239/296] Match-id-07c112cdd8cc885546cc9ab91bfc4de70eaafc66 --- destroy/src/CMakeLists.txt | 3 ++- destroy/src/main.c | 40 ++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/destroy/src/CMakeLists.txt b/destroy/src/CMakeLists.txt index 1b413ee..95a1496 100644 --- a/destroy/src/CMakeLists.txt +++ b/destroy/src/CMakeLists.txt @@ -8,8 +8,9 @@ add_compile_options(-fstack-protector-all -D _GNU_SOURCE -Wl,--no-undefined) message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include") +include_directories("${PROJECT_SOURCE_DIR}/../../cli/src") aux_source_directory(. SRC) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC) -add_executable(ascend-docker-destroy ${SRC}) +add_executable(ascend-docker-destroy ../../cli/src/logger.c ../../cli/src/utils.c ../../cli/src/basic.c ${SRC} ) target_compile_options(ascend-docker-destroy PRIVATE -fstack-protector-all -fpie -ldl -D_FORTIFY_SOURCE=2 -O2) target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now HuaweiSecureC) diff --git a/destroy/src/main.c b/destroy/src/main.c index 8149f9b..9974082 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -15,6 +15,9 @@ #include #include #include "securec.h" +#include "basic.h" +#include "logger.h" +#include "utils.h" #define DCMI_INIT "dcmi_init" #define DCMI_SET_DESTROY_VDEVICE "dcmi_set_destroy_vdevice" @@ -28,8 +31,7 @@ static bool ShowExceptionInfo(const char* exceptionInfo) { - (void)fprintf(stderr, exceptionInfo); - (void)fprintf(stderr, "\n"); + Logger(exceptionInfo, LEVEL_ERROR, SCREEN_YES); return false; } @@ -79,7 +81,6 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen struct stat fileStat; if ((stat(buf, &fileStat) != 0) || ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - (void)fprintf(stderr, "[2: %s]\n", buf); return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); } if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 @@ -88,7 +89,7 @@ static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen return CheckParentDir(buf, PATH_MAX, fileStat, checkOwner); } -static bool IsValidChar(const char c) +static bool IsAValidChar(const char c) { if (isalnum(c) != 0) { return true; @@ -108,14 +109,14 @@ static bool CheckFileName(const char* filePath, const size_t filePathLen) return ShowExceptionInfo("filePathLen out of bounds!"); } for (iLoop = 0; iLoop < filePathLen; iLoop++) { - if (!IsValidChar(filePath[iLoop])) { // 非法字符 + if (!IsAValidChar(filePath[iLoop])) { // 非法字符 return ShowExceptionInfo("filePath has an illegal character!"); } } return true; } -static bool CheckExternalFile(const char* filePath, const size_t filePathLen, +static bool CheckAExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner) { if (filePath == NULL) { @@ -138,7 +139,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) { *handle = dlopen("libdcmi.so", RTLD_LAZY); if (*handle == NULL) { - (void)fprintf(stderr, "dlopen failed.\n"); + Logger("dlopen failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } char pLinkMap[sizeof(struct link_map)] = {0}; @@ -146,12 +147,12 @@ static bool DeclareDcmiApiAndCheck(void **handle) if (ret == 0) { struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb - if (!CheckExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { - (void)fprintf(stderr, "check sofile failed.\n"); + if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { + Logger("check sofile failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } } else { - (void)fprintf(stderr, "dlinfo sofile failed.\n"); + Logger("dlinfo sofile failed.\n", LEVEL_ERROR, SCREEN_YES); return false; } @@ -160,8 +161,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) static void DcmiDlAbnormalExit(void **handle, const char* errorInfo) { - (void)fprintf(stderr, errorInfo); - (void)fprintf(stderr, "\n"); + Logger(errorInfo, LEVEL_INFO, SCREEN_YES); if (*handle != NULL) { dlclose(*handle); *handle = NULL; @@ -216,7 +216,7 @@ static bool DcmiInitProcess(void *handle) } int ret = dcmi_init(); if (ret != 0) { - (void)fprintf(stderr, "dcmi_init failed, ret = %d\n", ret); + Logger("dcmi_init faile.\n", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -237,7 +237,7 @@ static bool DcmiDestroyProcess(void *handle, const int cardId, } int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { - (void)fprintf(stderr, "dcmi_set_destroy_vdevice failed, ret = %d\n", ret); + Logger("dcmi_set_destroy_vdevice failed.\n", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -252,13 +252,16 @@ static int DestroyEntrance(const char *argv[]) int cardId = 0; int deviceId = 0; int vDeviceId = 0; + char *str = FormatLogMessage("start to destroy v-device %d start...\n", vDeviceId); + Logger(str, LEVEL_INFO, SCREEN_YES); + free(str); if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { return -1; } void *handle = NULL; if (!DeclareDcmiApiAndCheck(&handle)) { - (void)fprintf(stderr, "Declare dcmi failed.\n"); + Logger("Declare dcmi failed.\n", LEVEL_ERROR, SCREEN_YES); return -1; } if (!DcmiInitProcess(handle)) { @@ -268,13 +271,16 @@ static int DestroyEntrance(const char *argv[]) return -1; } DcmiDlclose(&handle); + char *strEnd = FormatLogMessage("destroy v-device %d successfully.\n", vDeviceId); + Logger(strEnd, LEVEL_INFO, SCREEN_YES); + free(strEnd); return 0; } static bool EntryCheck(const int argc, const char *argv[]) { if (argc != DESTROY_PARAMS_NUM) { - (void)fprintf(stderr, "destroy params namber error.\n"); + Logger("destroy params namber error.\n", LEVEL_ERROR, SCREEN_YES); return false; } for (int iLoop = 1; iLoop < argc; iLoop++) { @@ -290,7 +296,7 @@ static bool EntryCheck(const int argc, const char *argv[]) int main(const int argc, const char *argv[]) { if (!EntryCheck(argc, argv)) { - (void)fprintf(stderr, "destroy params value error.\n"); + Logger("destroy params value error.\n", LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From 173a98dc763e3cc1af43a8e0629a419c467da765 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 25 Jun 2022 11:59:03 +0800 Subject: [PATCH 240/296] Match-id-a2bd2bf388a96f77fb42cfb7e5761e41fb00770e --- destroy/src/main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/destroy/src/main.c b/destroy/src/main.c index 9974082..11e81ee 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -139,7 +139,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) { *handle = dlopen("libdcmi.so", RTLD_LAZY); if (*handle == NULL) { - Logger("dlopen failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dlopen failed.", LEVEL_ERROR, SCREEN_YES); return false; } char pLinkMap[sizeof(struct link_map)] = {0}; @@ -148,11 +148,11 @@ static bool DeclareDcmiApiAndCheck(void **handle) struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { - Logger("check sofile failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("check sofile failed.", LEVEL_ERROR, SCREEN_YES); return false; } } else { - Logger("dlinfo sofile failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dlinfo sofile failed.", LEVEL_ERROR, SCREEN_YES); return false; } @@ -216,7 +216,7 @@ static bool DcmiInitProcess(void *handle) } int ret = dcmi_init(); if (ret != 0) { - Logger("dcmi_init faile.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_init faile.", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -237,7 +237,7 @@ static bool DcmiDestroyProcess(void *handle, const int cardId, } int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { - Logger("dcmi_set_destroy_vdevice failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_set_destroy_vdevice failed.", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -252,7 +252,7 @@ static int DestroyEntrance(const char *argv[]) int cardId = 0; int deviceId = 0; int vDeviceId = 0; - char *str = FormatLogMessage("start to destroy v-device %d start...\n", vDeviceId); + char *str = FormatLogMessage("start to destroy v-device %d start...", vDeviceId); Logger(str, LEVEL_INFO, SCREEN_YES); free(str); if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { @@ -261,7 +261,7 @@ static int DestroyEntrance(const char *argv[]) void *handle = NULL; if (!DeclareDcmiApiAndCheck(&handle)) { - Logger("Declare dcmi failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("Declare dcmi failed.", LEVEL_ERROR, SCREEN_YES); return -1; } if (!DcmiInitProcess(handle)) { @@ -271,7 +271,7 @@ static int DestroyEntrance(const char *argv[]) return -1; } DcmiDlclose(&handle); - char *strEnd = FormatLogMessage("destroy v-device %d successfully.\n", vDeviceId); + char *strEnd = FormatLogMessage("destroy v-device %d successfully", vDeviceId); Logger(strEnd, LEVEL_INFO, SCREEN_YES); free(strEnd); return 0; @@ -280,7 +280,7 @@ static int DestroyEntrance(const char *argv[]) static bool EntryCheck(const int argc, const char *argv[]) { if (argc != DESTROY_PARAMS_NUM) { - Logger("destroy params namber error.\n", LEVEL_ERROR, SCREEN_YES); + Logger("destroy params namber error.", LEVEL_ERROR, SCREEN_YES); return false; } for (int iLoop = 1; iLoop < argc; iLoop++) { @@ -296,7 +296,7 @@ static bool EntryCheck(const int argc, const char *argv[]) int main(const int argc, const char *argv[]) { if (!EntryCheck(argc, argv)) { - Logger("destroy params value error.\n", LEVEL_ERROR, SCREEN_YES); + Logger("destroy params value error.", LEVEL_ERROR, SCREEN_YES); return -1; } -- Gitee From 7bb45f9520c68d2f84cb265bef9977191a38e39f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 27 Jun 2022 17:31:09 +0800 Subject: [PATCH 241/296] Match-id-df7c81f0f1089c74e726fb1f638c3dbd4a4db210 --- hook/go.mod | 6 +++++- runtime/go.mod | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index aab06b2..6cc6c2b 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -12,5 +12,9 @@ require ( replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.8 + k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 + k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 + k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 + k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 ) diff --git a/runtime/go.mod b/runtime/go.mod index aab06b2..6cc6c2b 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -12,5 +12,9 @@ require ( replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.8 + k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 + k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 + k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 + k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 ) -- Gitee From d6444e79accd814ad9e592de4f1e23bd920dc124 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 28 Jun 2022 15:36:13 +0800 Subject: [PATCH 242/296] Match-id-edce9dc957c4e7ded0cd061086ebc03fb99b1b11 --- hook/go.mod | 13 +++++++++++++ runtime/go.mod | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/hook/go.mod b/hook/go.mod index 6cc6c2b..70e6665 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -17,4 +17,17 @@ replace ( k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 + github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 + github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.9 + github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 + github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible + github.com/pkg/errors => github.com/pkg/errors v0.9.1 + github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.11.1 + github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v1.6.4 + github.com/stretchr/testify => github.com/stretchr/testify v1.7.0 + go.uber.org/zap => go.uber.org/zap v1.16.0 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b + google.golang.org/grpc => google.golang.org/grpc v1.28.0 + gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) diff --git a/runtime/go.mod b/runtime/go.mod index 6cc6c2b..70e6665 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -17,4 +17,17 @@ replace ( k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 + github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 + github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.9 + github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 + github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible + github.com/pkg/errors => github.com/pkg/errors v0.9.1 + github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.11.1 + github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v1.6.4 + github.com/stretchr/testify => github.com/stretchr/testify v1.7.0 + go.uber.org/zap => go.uber.org/zap v1.16.0 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b + google.golang.org/grpc => google.golang.org/grpc v1.28.0 + gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) -- Gitee From 9971be57dfe5cf43cc64453a82022399d824bf4f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 28 Jun 2022 19:39:05 +0800 Subject: [PATCH 243/296] Match-id-772e93d2c932cade9d54802d5929b635a3edf068 --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index c179ea9..d96da33 100644 --- a/build/build.sh +++ b/build/build.sh @@ -78,7 +78,7 @@ function build_bin() mv main ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper echo "make hook" - go mod download + go mod tidy [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} @@ -87,7 +87,7 @@ function build_bin() ls echo "make runtime" - go mod download + go mod tidy cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build -- Gitee From e7079bd77bb54e327ad81e4f170776723a4b4660 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 28 Jun 2022 20:07:47 +0800 Subject: [PATCH 244/296] Match-id-4de807b010f3a859fba2374665d7bfb29ede9db6 --- build/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/build.sh b/build/build.sh index d96da33..d192c7e 100644 --- a/build/build.sh +++ b/build/build.sh @@ -67,7 +67,6 @@ function build_bin() echo "make installhelper" cd ${INSTALLHELPERSRCDIR} - go mod tidy [ -d "${BUILD}/build/helper/build" ] && rm -rf ${BUILD}/build/helper/build export CGO_ENABLED=1 export CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" @@ -78,7 +77,6 @@ function build_bin() mv main ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper echo "make hook" - go mod tidy [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} @@ -87,7 +85,6 @@ function build_bin() ls echo "make runtime" - go mod tidy cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build -- Gitee From 1e9495a7a5736492eb37498943d348cf298588a7 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 1 Jul 2022 18:11:00 +0800 Subject: [PATCH 245/296] Match-id-ae938ba1d029d579892fccb242933e756a2a26c0 --- build/conf/hook.yaml | 3 ++- build/conf/installhelper.yaml | 3 ++- build/conf/runtime.yaml | 3 ++- destroy/src/main.c | 20 ++++++++++---------- runtime/dcmi/dcmi_api.go | 1 + 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 7e6115c..119dde7 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook/ && go mod download" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/" diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index cba6542..1a8d8a5 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/ && go mod tidy" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index faf0359..50650af 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime && go mod download" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime" diff --git a/destroy/src/main.c b/destroy/src/main.c index 9974082..11e81ee 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -139,7 +139,7 @@ static bool DeclareDcmiApiAndCheck(void **handle) { *handle = dlopen("libdcmi.so", RTLD_LAZY); if (*handle == NULL) { - Logger("dlopen failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dlopen failed.", LEVEL_ERROR, SCREEN_YES); return false; } char pLinkMap[sizeof(struct link_map)] = {0}; @@ -148,11 +148,11 @@ static bool DeclareDcmiApiAndCheck(void **handle) struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { - Logger("check sofile failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("check sofile failed.", LEVEL_ERROR, SCREEN_YES); return false; } } else { - Logger("dlinfo sofile failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dlinfo sofile failed.", LEVEL_ERROR, SCREEN_YES); return false; } @@ -216,7 +216,7 @@ static bool DcmiInitProcess(void *handle) } int ret = dcmi_init(); if (ret != 0) { - Logger("dcmi_init faile.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_init faile.", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -237,7 +237,7 @@ static bool DcmiDestroyProcess(void *handle, const int cardId, } int ret = dcmi_set_destroy_vdevice(cardId, deviceId, vDeviceId); if (ret != 0) { - Logger("dcmi_set_destroy_vdevice failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("dcmi_set_destroy_vdevice failed.", LEVEL_ERROR, SCREEN_YES); DcmiDlclose(&handle); return false; } @@ -252,7 +252,7 @@ static int DestroyEntrance(const char *argv[]) int cardId = 0; int deviceId = 0; int vDeviceId = 0; - char *str = FormatLogMessage("start to destroy v-device %d start...\n", vDeviceId); + char *str = FormatLogMessage("start to destroy v-device %d start...", vDeviceId); Logger(str, LEVEL_INFO, SCREEN_YES); free(str); if (!GetAndCheckID(argv, &cardId, &deviceId, &vDeviceId)) { @@ -261,7 +261,7 @@ static int DestroyEntrance(const char *argv[]) void *handle = NULL; if (!DeclareDcmiApiAndCheck(&handle)) { - Logger("Declare dcmi failed.\n", LEVEL_ERROR, SCREEN_YES); + Logger("Declare dcmi failed.", LEVEL_ERROR, SCREEN_YES); return -1; } if (!DcmiInitProcess(handle)) { @@ -271,7 +271,7 @@ static int DestroyEntrance(const char *argv[]) return -1; } DcmiDlclose(&handle); - char *strEnd = FormatLogMessage("destroy v-device %d successfully.\n", vDeviceId); + char *strEnd = FormatLogMessage("destroy v-device %d successfully", vDeviceId); Logger(strEnd, LEVEL_INFO, SCREEN_YES); free(strEnd); return 0; @@ -280,7 +280,7 @@ static int DestroyEntrance(const char *argv[]) static bool EntryCheck(const int argc, const char *argv[]) { if (argc != DESTROY_PARAMS_NUM) { - Logger("destroy params namber error.\n", LEVEL_ERROR, SCREEN_YES); + Logger("destroy params namber error.", LEVEL_ERROR, SCREEN_YES); return false; } for (int iLoop = 1; iLoop < argc; iLoop++) { @@ -296,7 +296,7 @@ static bool EntryCheck(const int argc, const char *argv[]) int main(const int argc, const char *argv[]) { if (!EntryCheck(argc, argv)) { - Logger("destroy params value error.\n", LEVEL_ERROR, SCREEN_YES); + Logger("destroy params value error.", LEVEL_ERROR, SCREEN_YES); return -1; } diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index 10e6cf3..f62c924 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -55,6 +55,7 @@ func extractVpuParam(spec *specs.Spec) (int32, string, error) { visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" allowSplit := map[string]string{ "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", + "vir04_3c": "vir04_3c", "vir02_1c": "vir02_1c", } for _, line := range spec.Process.Env { -- Gitee From 842b6beb68ea83b3926e650594675f55d8b82520 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 2 Jul 2022 10:52:49 +0800 Subject: [PATCH 246/296] Match-id-a17244334fed2aa827af352dc3f08597d8e7721b --- build/conf/hook.yaml | 2 +- build/conf/installhelper.yaml | 2 +- build/conf/runtime.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 119dde7..62ac88a 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/" diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index 1a8d8a5..4d140bf 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 50650af..6a2753f 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime" -- Gitee From 6a4b11840d9bb48c2b6b5e504381a652cae87d54 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 2 Jul 2022 18:08:39 +0800 Subject: [PATCH 247/296] Match-id-6e26167810db58b1cb199f1970444dbfe0803e61 --- runtime/main.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index 212900a..a32578a 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -17,7 +17,6 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" - "go.uber.org/zap" "huawei.com/npu-exporter/hwlog" "mindxcheckutils" @@ -154,7 +153,6 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) - hwlog.RunLog.Infof("vnpu split done: vdevice: %v err: %v", vdevice.VdeviceID, err) if err != nil { return err } @@ -275,34 +273,7 @@ func main() { log.Fatal(err) } }() - stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) - log.Fatal(err) - } - logPrefixWords, err := mindxcheckutils.GetLogPrefix() - if err != nil { - close(stopCh) - log.Fatal(err) - } - hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.RunLog.Infof("ascend docker runtime starting") - if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, - maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { - close(stopCh) - log.Fatal("command error") - } - logWords := fmt.Sprintf("running %v", os.Args) - if len(logWords) > maxLogLength { - logWords = logWords[0:maxLogLength-1] + "..." - } - hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { - hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v failed", logWords) - close(stopCh) log.Fatal(err) } - close(stopCh) } -- Gitee From e91f5a9a1e640e8469bfc1fe82a14fee0885b00f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 13:44:21 +0800 Subject: [PATCH 248/296] Match-id-a5746886a50545867abf79f944b09223bc51afef --- build/conf/hook.yaml | 3 +- build/conf/installhelper.yaml | 3 +- build/conf/runtime.yaml | 3 +- cli/test/dt/testcase/gtest_mytest.cpp | 171 +++++++++++++++++--------- runtime/dcmi/dcmi_api.go | 1 + 5 files changed, 118 insertions(+), 63 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 7e6115c..119dde7 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook/ && go mod download" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/" diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index cba6542..1a8d8a5 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/ && go mod tidy" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index faf0359..50650af 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -13,7 +13,8 @@ compile: include: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime && go mod download" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime" + - command: "env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime" diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 71e1404..cf1da7a 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -60,6 +60,8 @@ extern "C" int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config extern "C" int ParseRuntimeOptions(const char *options); extern "C" bool IsOptionNoDrvSet(); extern "C" bool IsVirtual(); +extern "C" int MakeMountPoints(const char *path, mode_t mode); +extern "C" int LogLoop(const char* filename); struct MountList { unsigned int count; @@ -364,7 +366,7 @@ TEST_F(Test_Fhho, ClassEQ) EXPECT_LE(0, ret); } -TEST(EnterNsByFd, StatusOne) +TEST_F(Test_Fhho, StatusOne) { int pid = 1; int nsType = 1; @@ -376,7 +378,7 @@ TEST(EnterNsByFd, StatusOne) EXPECT_LE(0, ret); } -TEST(EnterNsByFd, StatusTwo) +TEST_F(Test_Fhho, StatusTwo) { // The test does not have a file handle into the namespace int pid = 1; @@ -385,7 +387,7 @@ TEST(EnterNsByFd, StatusTwo) EXPECT_LE(-1, ret); } -TEST(EnterNsByPath, StatusOne) +TEST_F(Test_Fhho, StatusOne1) { char containerNsPath[BUF_SIZE] = {0}; int nsType = 1; @@ -395,7 +397,7 @@ TEST(EnterNsByPath, StatusOne) EXPECT_LE(-1, ret); } -TEST(EnterNsByPath, StatusTwo) +TEST_F(Test_Fhho, StatusTwo1) { // The test has no path into the namespace char containerNsPath[BUF_SIZE] = {0}; @@ -413,7 +415,7 @@ TEST_F(Test_Fhho, GetNsPathAndGetSelfNsPath) EXPECT_LE(0, GetSelfNsPath("mnt", nsPath, BUF_SIZE)); } -TEST(MountDevice, StatusOne) +TEST_F(Test_Fhho, StatusOne2) { char *rootfs="/home"; MOCKER(Mount).stubs().will(invoke(stub_Mount_failed)); @@ -422,16 +424,16 @@ TEST(MountDevice, StatusOne) GlobalMockObject::verify(); } -TEST(MountDevice, StatusTwo) +TEST_F(Test_Fhho, StatusTwo2) { // Test root file system does not exist mount // Assign a false file path char *rootfs="/home/notexists"; char *deviceName="davinci0"; - EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); + EXPECT_EQ(0, MountDevice(rootfs, deviceName)); } -TEST(MountDevice, StatusThree) +TEST_F(Test_Fhho, StatusThree1) { char *rootfs="/home"; MOCKER(stat).stubs().will(invoke(stub_stat_success)); @@ -440,21 +442,21 @@ TEST(MountDevice, StatusThree) MOCKER(mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci0"; GlobalMockObject::verify(); - EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); + EXPECT_EQ(0, MountDevice(rootfs, deviceName)); } -TEST(MountDevice, StatusFour) +TEST_F(Test_Fhho, StatusFour) { char *rootfs="/home"; MOCKER(mount).stubs().will(invoke(stub_mount_success)); MOCKER(stat).stubs().will(invoke(stub_stat_failed)); char *deviceName="davinci0"; GlobalMockObject::verify(); - EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); + EXPECT_EQ(0, MountDevice(rootfs, deviceName)); } -TEST(DoDeviceMounting, StatusOne) +TEST_F(Test_Fhho, StatusOneDoDeviceMounting) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; @@ -466,7 +468,7 @@ TEST(DoDeviceMounting, StatusOne) EXPECT_EQ(0, ret); } -TEST(DoDeviceMounting, StatusTwo) +TEST_F(Test_Fhho, StatusTwoDoDeviceMounting) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Failed)); char *rootfs = "/home"; @@ -478,7 +480,7 @@ TEST(DoDeviceMounting, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(DoDirectoryMounting, StatusOne) +TEST_F(Test_Fhho, StatusOneDoDirectoryMounting) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); struct MountList list = {0}; @@ -489,7 +491,7 @@ TEST(DoDirectoryMounting, StatusOne) EXPECT_EQ(-1, ret); } -TEST(DoDirectoryMounting, StatusTwo) +TEST_F(Test_Fhho, StatusTwoDoDirectoryMounting) { MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Success)); struct MountList list = {0}; @@ -500,7 +502,7 @@ TEST(DoDirectoryMounting, StatusTwo) EXPECT_EQ(0, ret); } -TEST(DoMounting, StatusOne) +TEST_F(Test_Fhho, StatusOneDoMounting) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Failed)); struct ParsedConfig config; @@ -513,7 +515,7 @@ TEST(DoMounting, StatusOne) EXPECT_EQ(-1, ret); } -TEST(DoMounting, StatusTwo) +TEST_F(Test_Fhho, StatusTwoDoMounting) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); @@ -527,7 +529,18 @@ TEST(DoMounting, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(DoMounting, StatusThree) +TEST_F(Test_Fhho, StatusTwoDoMountingNULL) +{ + MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); + MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Failed)); + struct ParsedConfig *config = NULL; + int ret = DoMounting(config); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + + +TEST_F(Test_Fhho, StatusThreeDoMounting) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); @@ -543,7 +556,7 @@ TEST(DoMounting, StatusThree) EXPECT_EQ(-1, ret); } -TEST(DoMounting, StatusFour) +TEST_F(Test_Fhho, StatusFourDoMounting) { MOCKER(DoDeviceMounting).stubs().will(invoke(Stub_DoDeviceMounting_Success)); MOCKER(DoCtrlDeviceMounting).stubs().will(invoke(Stub_DoCtrlDeviceMounting_Success)); @@ -561,7 +574,7 @@ TEST(DoMounting, StatusFour) } -TEST(CheckDirExists, StatusOne) +TEST_F(Test_Fhho, StatusOneCheckDirExists) { // Test directory exists char *dir = "/home"; @@ -570,7 +583,8 @@ TEST(CheckDirExists, StatusOne) EXPECT_EQ(0, ret); } -TEST(CheckDirExists, StatusTwo) + +TEST_F(Test_Fhho, StatusTwoCheckDirExists) { // Test directory does not exist char *dir = "/home/notexist"; @@ -579,7 +593,7 @@ TEST(CheckDirExists, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(GetParentPathStr, StatusOne) +TEST_F(Test_Fhho, StatusOneCheckDirExists1) { // Test get path parent directory char *path = "/usr/bin"; @@ -588,7 +602,16 @@ TEST(GetParentPathStr, StatusOne) EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, StatusOne) +TEST_F(Test_Fhho, StatusOneCheckDirExists11) +{ + // Test get path parent directory + char *path = nullptr; + char parent[BUF_SIZE] = {0}; + int ret = GetParentPathStr(path, parent, BUF_SIZE); + EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusOneMakeDirWithParent) { // The test create directory contains the parent directory mode_t mode = 0755; @@ -597,7 +620,35 @@ TEST(MakeDirWithParent, StatusOne) EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, StatusTwo) +TEST_F(Test_Fhho, MakeMountPoints1) +{ + // The test create directory contains the parent directory + mode_t mode = 0755; + char *path = "/home"; + int ret = MakeMountPoints(path, mode); + EXPECT_EQ(-1, ret); +} + + +TEST_F(Test_Fhho, MkDirtestsuccess) +{ + // The test create directory contains the parent directory + mode_t mode = 0755; + char *dir = "/home"; + int ret = MkDir(dir, mode); + EXPECT_EQ(-1, ret); +} + + +TEST_F(Test_Fhho, LogLoopSuccess) +{ + // The test create directory contains the parent directory + char* filename = "/home/var/log/sys.log"; + int ret = LogLoop(filename); + EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusTwoMakeDirWithParent) { mode_t mode = 0755; char parentDir[BUF_SIZE] = {0}; @@ -607,7 +658,7 @@ TEST(MakeDirWithParent, StatusTwo) EXPECT_EQ(0, ret); } -TEST(MakeDirWithParent, StatusThree) +TEST_F(Test_Fhho, StatusThreeMakeDirWithParent) { char *pathData = "/path/abc/abcd"; mode_t mode = 0755; @@ -621,7 +672,7 @@ TEST(MakeDirWithParent, StatusThree) EXPECT_EQ(0, ret); } -TEST(MountDir, StatusOne) +TEST_F(Test_Fhho, StatusOneMountDir) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); char *rootfs = "/dev"; @@ -631,7 +682,7 @@ TEST(MountDir, StatusOne) EXPECT_EQ(0, ret); } -TEST(MountDir, StatusTwo) +TEST_F(Test_Fhho, StatusTwoMountDir) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Failed)); @@ -642,7 +693,7 @@ TEST(MountDir, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(MountDir, StatusThree) +TEST_F(Test_Fhho, StatusThreeMountDir) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MkDir).stubs().will(invoke(stub_MkDir_failed)); @@ -653,7 +704,7 @@ TEST(MountDir, StatusThree) EXPECT_EQ(-1, ret); } -TEST(MountDir, StatusFour) +TEST_F(Test_Fhho, StatusFourMountDir) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); @@ -665,7 +716,7 @@ TEST(MountDir, StatusFour) EXPECT_EQ(-1, ret); } -TEST(MountDir, StatusFive) +TEST_F(Test_Fhho, StatusFiveMountDir) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); MOCKER(MakeDirWithParent).stubs().will(invoke(Stub_MakeDirWithParent_Success)); @@ -677,16 +728,16 @@ TEST(MountDir, StatusFive) EXPECT_EQ(0, ret); } -TEST(DoCtrlDeviceMounting, StatusOne) +TEST_F(Test_Fhho, StatusOneDoCtrlDeviceMounting) { char *rootfs = "/home"; MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); int ret = DoCtrlDeviceMounting(rootfs); GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); + EXPECT_EQ(0, ret); } -TEST(DoCtrlDeviceMounting, StatusTwo) +TEST_F(Test_Fhho, StatusTwoDoCtrlDeviceMounting) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; @@ -695,7 +746,7 @@ TEST(DoCtrlDeviceMounting, StatusTwo) EXPECT_EQ(0, ret); } -TEST(GetCgroupMount, StatusOne) +TEST_F(Test_Fhho, StatusOneGetCgroupMount) { char *lineData = "406 403 0:27 /docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2 /sys/fs/cgroup/devices ro,nosuid,nodev,noexec,relatime master:15 - cgroup cgroup rw,devices"; char *line = NULL; @@ -706,7 +757,7 @@ TEST(GetCgroupMount, StatusOne) EXPECT_EQ(0, strcmp(actualRes, expectRes)); } -TEST(GetCgroupRoot, StatusOne) +TEST_F(Test_Fhho, StatusOneGetCgroupMount1) { char *lineData = "3:devices:/docker/ba186404524744c189c6a03d2b66288a963a562a79b11005ae935104fc8c47b2"; char *line = NULL; @@ -717,7 +768,7 @@ TEST(GetCgroupRoot, StatusOne) EXPECT_EQ(0, strcmp(actualRes, expectRes)); } -TEST(ParseFileByLine, StatusOne) +TEST_F(Test_Fhho, StatusOneParseFileByLine) { // Test parse file content does not exist char *mountPath= "/not_exist_dir/mountinfo.txt"; @@ -726,7 +777,7 @@ TEST(ParseFileByLine, StatusOne) EXPECT_EQ(-1, ret); } -TEST(SetupDeviceCgroup, StatusOne) +TEST_F(Test_Fhho, StatusOneSetupDeviceCgroup) { char *cgroupPathData = "devices.allow"; char *cgroupPath = NULL; @@ -741,7 +792,7 @@ TEST(SetupDeviceCgroup, StatusOne) EXPECT_EQ(-1, ret); } -TEST(SetupDeviceCgroup, StatusTwo) +TEST_F(Test_Fhho, StatusTwoSetupDeviceCgroup) { char *cgroupPathData = "/not_exist_dir/devices1.allow"; char *cgroupPath = NULL; @@ -757,7 +808,7 @@ TEST(SetupDeviceCgroup, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(SetupDriverCgroup, StatusOne) +TEST_F(Test_Fhho, StatusOneSetupDriverCgroup) { char *cgroupPath = "devices.allow"; FILE *cgroupAllow = NULL; @@ -771,7 +822,7 @@ TEST(SetupDriverCgroup, StatusOne) EXPECT_EQ(0, ret); } -TEST(SetupDriverCgroup, StatusTwo) +TEST_F(Test_Fhho, StatusTwoSetupDriverCgroup) { char *cgroupPath = "devices1.allow"; FILE *cgroupAllow = NULL; @@ -785,7 +836,7 @@ TEST(SetupDriverCgroup, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(GetCgroupPath, StatusOne) +TEST_F(Test_Fhho, StatusOneSetupDriverCgroup1) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -800,7 +851,7 @@ TEST(GetCgroupPath, StatusOne) EXPECT_EQ(0, ret); } -TEST(SetupCgroup, StatusOne) +TEST_F(Test_Fhho, StatusOneSetupDriverCgroup2) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -812,7 +863,7 @@ TEST(SetupCgroup, StatusOne) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, StatusTwo) +TEST_F(Test_Fhho, StatusTwoSetupCgroup) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -826,7 +877,7 @@ TEST(SetupCgroup, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(SetupCgroup, StatusThree) +TEST_F(Test_Fhho, StatusThreeSetupCgroup) { struct ParsedConfig config; (void)strcpy_s(config.rootfs, sizeof(config.rootfs), "/home"); @@ -841,7 +892,7 @@ TEST(SetupCgroup, StatusThree) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusOne) +TEST_F(Test_Fhho, StatusOneSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -854,7 +905,7 @@ TEST(SetupContainer, StatusOne) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusTwo) +TEST_F(Test_Fhho, StatusTwoSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -868,7 +919,7 @@ TEST(SetupContainer, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusThree) +TEST_F(Test_Fhho, StatusThreeSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -883,7 +934,7 @@ TEST(SetupContainer, StatusThree) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusFour) +TEST_F(Test_Fhho, StatusFourSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -899,7 +950,7 @@ TEST(SetupContainer, StatusFour) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusFive) +TEST_F(Test_Fhho, StatusFiveSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -916,7 +967,7 @@ TEST(SetupContainer, StatusFive) EXPECT_EQ(-1, ret); } -TEST(SetupContainer, StatusSix) +TEST_F(Test_Fhho, StatusSixSetupContainer) { struct CmdArgs args; (void)strcpy_s(args.rootfs, sizeof(args.rootfs), "/home"); @@ -934,7 +985,7 @@ TEST(SetupContainer, StatusSix) EXPECT_EQ(0, ret); } -TEST(Process, StatusOne) +TEST_F(Test_Fhho, StatusOneProcess) { // test parameter is null int argc = 0; @@ -943,7 +994,7 @@ TEST(Process, StatusOne) EXPECT_EQ(-1, ret); } -TEST(Process, StatusTwo) +TEST_F(Test_Fhho, StatusTwoProcess) { // Test the correct options int argc = 7; @@ -952,7 +1003,7 @@ TEST(Process, StatusTwo) EXPECT_EQ(-1, ret); } -TEST(Process, StatusThree) +TEST_F(Test_Fhho, StatusThreeProcess) { // Test error options int argc = 7; @@ -961,7 +1012,7 @@ TEST(Process, StatusThree) EXPECT_EQ(-1, ret); } -TEST(Process, StatusFour) +TEST_F(Test_Fhho, StatusFourProcess) { int argc = 7; const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; @@ -971,7 +1022,7 @@ TEST(Process, StatusFour) EXPECT_EQ(-1, ret); } -TEST(ParseRuntimeOptions, StatusOne) +TEST_F(Test_Fhho, StatusOneParseRuntimeOptions) { // Test the right options const char options[BUF_SIZE] = "1,2"; @@ -980,7 +1031,7 @@ TEST(ParseRuntimeOptions, StatusOne) EXPECT_EQ(0, ret); } -TEST(DoPrepare, StatusOne) +TEST_F(Test_Fhho, StatusOneDoPrepare) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; @@ -995,7 +1046,7 @@ TEST(DoPrepare, StatusOne) EXPECT_EQ(0, ret); } -TEST(DoPrepare, StatusTwo) +TEST_F(Test_Fhho, StatusTwoDoPrepare) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); struct CmdArgs args; @@ -1010,7 +1061,7 @@ TEST(DoPrepare, StatusTwo) EXPECT_EQ(0, ret); } -TEST(DoPrepare, StatusThree) +TEST_F(Test_Fhho, StatusThreeDoPrepare) { MOCKER(GetNsPath).stubs().will(invoke(Stub_GetNsPath_Failed)); struct CmdArgs args; @@ -1025,7 +1076,7 @@ TEST(DoPrepare, StatusThree) EXPECT_EQ(-1, ret); } -TEST(DoPrepare, StatusFour) +TEST_F(Test_Fhho, StatusFourDoPrepare) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(GetSelfNsPath).stubs().will(invoke(Stub_GetSelfNsPath_Failed)); @@ -1041,7 +1092,7 @@ TEST(DoPrepare, StatusFour) EXPECT_EQ(-1, ret); } -TEST(DoPrepare, StatusFive) +TEST_F(Test_Fhho, StatusFiveDoPrepare) { MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); MOCKER(open).stubs().will(invoke(stub_open_failed)); diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index 10e6cf3..f62c924 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -55,6 +55,7 @@ func extractVpuParam(spec *specs.Spec) (int32, string, error) { visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" allowSplit := map[string]string{ "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", + "vir04_3c": "vir04_3c", "vir02_1c": "vir02_1c", } for _, line := range spec.Process.Env { -- Gitee From 971ab2cc3040373c84d963842d8f0b775fd9e974 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 14:14:23 +0800 Subject: [PATCH 249/296] Match-id-148245535ef06bbaf9c6750a8635dab5e18ad922 --- build/conf/hook.yaml | 2 +- build/conf/installhelper.yaml | 2 +- build/conf/runtime.yaml | 2 +- runtime/main.go | 29 ----------------------------- 4 files changed, 3 insertions(+), 32 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 119dde7..62ac88a 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/" diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index 1a8d8a5..4d140bf 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src" diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 50650af..6a2753f 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -14,7 +14,7 @@ compile: - commands: - command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime" - - command: "env" + - command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env" process: language: go compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime" diff --git a/runtime/main.go b/runtime/main.go index 212900a..a32578a 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -17,7 +17,6 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" - "go.uber.org/zap" "huawei.com/npu-exporter/hwlog" "mindxcheckutils" @@ -154,7 +153,6 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) - hwlog.RunLog.Infof("vnpu split done: vdevice: %v err: %v", vdevice.VdeviceID, err) if err != nil { return err } @@ -275,34 +273,7 @@ func main() { log.Fatal(err) } }() - stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) - log.Fatal(err) - } - logPrefixWords, err := mindxcheckutils.GetLogPrefix() - if err != nil { - close(stopCh) - log.Fatal(err) - } - hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.RunLog.Infof("ascend docker runtime starting") - if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, - maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { - close(stopCh) - log.Fatal("command error") - } - logWords := fmt.Sprintf("running %v", os.Args) - if len(logWords) > maxLogLength { - logWords = logWords[0:maxLogLength-1] + "..." - } - hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { - hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v failed", logWords) - close(stopCh) log.Fatal(err) } - close(stopCh) } -- Gitee From ee2de19091cb61fd8d043d8e20cd423b29015850 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 14:23:24 +0800 Subject: [PATCH 250/296] Match-id-4136e4ebb712cab825147bf9299982c51f1151dc --- cli/test/dt/testcase/gtest_mytest.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index cf1da7a..bb83725 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -430,7 +430,7 @@ TEST_F(Test_Fhho, StatusTwo2) // Assign a false file path char *rootfs="/home/notexists"; char *deviceName="davinci0"; - EXPECT_EQ(0, MountDevice(rootfs, deviceName)); + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } TEST_F(Test_Fhho, StatusThree1) @@ -442,8 +442,7 @@ TEST_F(Test_Fhho, StatusThree1) MOCKER(mount).stubs().will(invoke(stub_Mount_failed)); char *deviceName="davinci0"; GlobalMockObject::verify(); - EXPECT_EQ(0, MountDevice(rootfs, deviceName)); - + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } TEST_F(Test_Fhho, StatusFour) @@ -453,7 +452,7 @@ TEST_F(Test_Fhho, StatusFour) MOCKER(stat).stubs().will(invoke(stub_stat_failed)); char *deviceName="davinci0"; GlobalMockObject::verify(); - EXPECT_EQ(0, MountDevice(rootfs, deviceName)); + EXPECT_EQ(-1, MountDevice(rootfs, deviceName)); } TEST_F(Test_Fhho, StatusOneDoDeviceMounting) @@ -734,7 +733,7 @@ TEST_F(Test_Fhho, StatusOneDoCtrlDeviceMounting) MOCKER(MountDir).stubs().will(invoke(Stub_MountDir_Failed)); int ret = DoCtrlDeviceMounting(rootfs); GlobalMockObject::verify(); - EXPECT_EQ(0, ret); + EXPECT_EQ(-1, ret); } TEST_F(Test_Fhho, StatusTwoDoCtrlDeviceMounting) -- Gitee From 6aab69905d9f62fe69e7fab2713122a98caf6b55 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 14:47:32 +0800 Subject: [PATCH 251/296] Match-id-ba3691225b14eb8e1f45d83b842f26b92066c709 --- cli/test/dt/testcase/gtest_mytest.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index bb83725..14cbe4e 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -62,6 +62,8 @@ extern "C" bool IsOptionNoDrvSet(); extern "C" bool IsVirtual(); extern "C" int MakeMountPoints(const char *path, mode_t mode); extern "C" int LogLoop(const char* filename); +extern "C" bool TakeNthWord(char **pLine, unsigned int n, char **word); +extern "C" bool CheckRootDir(char **pLine); struct MountList { unsigned int count; @@ -993,6 +995,25 @@ TEST_F(Test_Fhho, StatusOneProcess) EXPECT_EQ(-1, ret); } +TEST_F(Test_Fhho, TakeNthWord) +{ + // test parameter is null + char **pLine = nullptr; + unsigned int n = 2; + char **word = nullptr; + bool ret = TakeNthWord(pLine, n, word); + EXPECT_EQ(false, ret); +} + + +TEST_F(Test_Fhho, CheckRootDir) +{ + // test parameter is null + char **pLine = nullptr; + bool ret = CheckRootDir(pLine); + EXPECT_EQ(false, ret); +} + TEST_F(Test_Fhho, StatusTwoProcess) { // Test the correct options -- Gitee From f1e31b55189e8130653be3de588761f35824665f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 15:14:38 +0800 Subject: [PATCH 252/296] Match-id-53156e597239e5b05b84675c76687c15e29120eb --- hook/go.mod | 4 ++-- runtime/go.mod | 6 +++--- runtime/main.go | 30 ++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index 70e6665..056cd22 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,14 +5,14 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.7 + huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 ) replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.8 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 diff --git a/runtime/go.mod b/runtime/go.mod index 70e6665..4e07835 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -3,16 +3,16 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.2 + github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.7 + huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 ) replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.8 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 diff --git a/runtime/main.go b/runtime/main.go index a32578a..bb40090 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -16,6 +16,7 @@ import ( "strings" "syscall" + "go.uber.org/zap" "github.com/opencontainers/runtime-spec/specs-go" "huawei.com/npu-exporter/hwlog" @@ -82,6 +83,7 @@ func initLogModule(stopCh <-chan struct{}) error { LogLevel: 0, MaxBackups: backups, MaxAge: logMaxAge, + OnlyToFile: true, } if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { fmt.Printf("hwlog init failed, error is %v", err) @@ -153,6 +155,7 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) + hwlog.RunLog.Infof("vnpu split done: vdevice: %v err: %v", vdevice.VdeviceID, err) if err != nil { return err } @@ -273,7 +276,34 @@ func main() { log.Fatal(err) } }() + stopCh := make(chan struct{}) + if err := initLogModule(stopCh); err != nil { + close(stopCh) + log.Fatal(err) + } + logPrefixWords, err := mindxcheckutils.GetLogPrefix() + if err != nil { + close(stopCh) + log.Fatal(err) + } + hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.RunLog.Infof("ascend docker runtime starting") + if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, + maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + close(stopCh) + log.Fatal("command error") + } + logWords := fmt.Sprintf("running %v", os.Args) + if len(logWords) > maxLogLength { + logWords = logWords[0:maxLogLength-1] + "..." + } + hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { + hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) + hwlog.OpLog.Errorf("%v failed", logWords) + close(stopCh) log.Fatal(err) } + close(stopCh) } -- Gitee From 588598435897201e29375b5115216e3b7a0466a5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 15:24:41 +0800 Subject: [PATCH 253/296] Match-id-874f9137671e2f25234dd973d24aaf4775719f90 --- runtime/main.go | 53 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index bb40090..847308a 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -16,11 +16,12 @@ import ( "strings" "syscall" - "go.uber.org/zap" "github.com/opencontainers/runtime-spec/specs-go" + "go.uber.org/zap" - "huawei.com/npu-exporter/hwlog" "mindxcheckutils" + + "huawei.com/npu-exporter/hwlog" ) const ( @@ -277,32 +278,32 @@ func main() { } }() stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) - log.Fatal(err) - } - logPrefixWords, err := mindxcheckutils.GetLogPrefix() - if err != nil { - close(stopCh) - log.Fatal(err) - } - hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.RunLog.Infof("ascend docker runtime starting") - if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, - maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { - close(stopCh) - log.Fatal("command error") - } - logWords := fmt.Sprintf("running %v", os.Args) - if len(logWords) > maxLogLength { - logWords = logWords[0:maxLogLength-1] + "..." - } - hwlog.OpLog.Infof(logWords) + if err := initLogModule(stopCh); err != nil { + close(stopCh) + log.Fatal(err) + } + logPrefixWords, err := mindxcheckutils.GetLogPrefix() + if err != nil { + close(stopCh) + log.Fatal(err) + } + hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.RunLog.Infof("ascend docker runtime starting") + if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, + maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + close(stopCh) + log.Fatal("command error") + } + logWords := fmt.Sprintf("running %v", os.Args) + if len(logWords) > maxLogLength { + logWords = logWords[0:maxLogLength-1] + "..." + } + hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v failed", logWords) - close(stopCh) + hwlog.OpLog.Errorf("%v failed", logWords) + close(stopCh) log.Fatal(err) } close(stopCh) -- Gitee From fb6ad111b5724b566409a3f7034d864fd0f8a58c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 17:45:13 +0800 Subject: [PATCH 254/296] Match-id-1e87107c3e24b4d20298eaa1b6a44ff3faa8e550 --- install/deb/src/main.go | 9 ++++----- runtime/dcmi/dcmi_api_test.go | 2 +- runtime/main.go | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/install/deb/src/main.go b/install/deb/src/main.go index d8c702d..fdb6c80 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -108,7 +108,7 @@ func process() error { return writeJson(destFilePath, writeContent) } -func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { +func createJSONString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { var writeContent []byte if _, err := os.Stat(srcFilePath); err == nil { daemon, err := modifyDaemon(srcFilePath, runtimeFilePath, action) @@ -128,7 +128,7 @@ func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, erro return writeContent, nil } -func writeJson(destFilePath string, writeContent []byte) error { +func writeJSON(destFilePath string, writeContent []byte) error { if _, err := os.Stat(destFilePath); os.IsNotExist(err) { const perm = 0600 file, err := os.OpenFile(destFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm) @@ -145,9 +145,8 @@ func writeJson(destFilePath string, writeContent []byte) error { return fmt.Errorf("close target file failed") } return nil - } else { - return fmt.Errorf("target file already existed") } + return fmt.Errorf("target file already existed") } func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]interface{}, error) { @@ -191,7 +190,7 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter return daemon, nil } -func loadOriginJson(srcFilePath string) (map[string]interface{}, error) { +func loadOrigin(srcFilePath string) (map[string]interface{}, error) { if fileInfo, err := os.Stat(srcFilePath); err != nil { return nil, err } else if fileInfo.Size() > maxFileSize { diff --git a/runtime/dcmi/dcmi_api_test.go b/runtime/dcmi/dcmi_api_test.go index b7e0cb3..4464677 100644 --- a/runtime/dcmi/dcmi_api_test.go +++ b/runtime/dcmi/dcmi_api_test.go @@ -9,7 +9,7 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" ) -const mockDeviceId = 100 +const mockDeviceID = 100 type mockWorker struct{} diff --git a/runtime/main.go b/runtime/main.go index 847308a..dc3bbf6 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -19,9 +19,8 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" "go.uber.org/zap" - "mindxcheckutils" - "huawei.com/npu-exporter/hwlog" + "mindxcheckutils" ) const ( -- Gitee From cfaa40a35dc9bca55c1b5c884acc331247f0b540 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 18:59:40 +0800 Subject: [PATCH 255/296] Match-id-2c4a209b79531059d6c13bc1ecc5ec60b7b6df08 --- install/deb/src/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/deb/src/main.go b/install/deb/src/main.go index fdb6c80..77c7e1d 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -190,7 +190,7 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter return daemon, nil } -func loadOrigin(srcFilePath string) (map[string]interface{}, error) { +func loadOriginJSON(srcFilePath string) (map[string]interface{}, error) { if fileInfo, err := os.Stat(srcFilePath); err != nil { return nil, err } else if fileInfo.Size() > maxFileSize { -- Gitee From f13470ce66158e036ef5525ae473f29dec1147fa Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 19:11:22 +0800 Subject: [PATCH 256/296] Match-id-39ce06c2de1c941a836935fe91c32025c3111068 --- install/deb/src/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 77c7e1d..327d0e9 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -101,11 +101,11 @@ func process() error { } // check file permission - writeContent, err := createJsonString(srcFilePath, runtimeFilePath, action) + writeContent, err := createJSONString(srcFilePath, runtimeFilePath, action) if err != nil { return err } - return writeJson(destFilePath, writeContent) + return writeJSON(destFilePath, writeContent) } func createJSONString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { @@ -151,7 +151,7 @@ func writeJSON(destFilePath string, writeContent []byte) error { func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]interface{}, error) { // existed... - daemon, err := loadOriginJson(srcFilePath) + daemon, err := loadOriginJSON(srcFilePath) if err != nil { return nil, err } -- Gitee From bee60bbc60017869f2d1081383d2486e05a877ff Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 19:51:09 +0800 Subject: [PATCH 257/296] Match-id-99553ebfb5ae57a1cbf5b28f541b893664920a65 --- hook/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook/go.mod b/hook/go.mod index 056cd22..4e07835 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -3,7 +3,7 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.2 + github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 github.com/prashantv/gostub v1.1.0 huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 -- Gitee From 14028aa0c9d3cac091d2573b3fd89636df8b27e6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 4 Jul 2022 20:45:53 +0800 Subject: [PATCH 258/296] Match-id-45eef49aa6fb63e725414804bf09b1bb933bd935 --- hook/go.mod | 2 +- runtime/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index 4e07835..056cd22 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -3,7 +3,7 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 diff --git a/runtime/go.mod b/runtime/go.mod index 4e07835..056cd22 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -3,7 +3,7 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.3-0.20200520003142-237cc4f519e2 + github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 -- Gitee From 6467c3bf45ebd6f53b90af40ec35d7008b3f1bb6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 5 Jul 2022 19:44:18 +0800 Subject: [PATCH 259/296] Match-id-7904ccd4e2e603703ad94236438bc0cb8c408810 --- runtime/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/main.go b/runtime/main.go index dc3bbf6..c41b92d 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -73,6 +73,7 @@ func initLogModule(stopCh <-chan struct{}) error { LogLevel: 0, MaxBackups: backups, MaxAge: logMaxAge, + OnlyToFile: true, } if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { fmt.Printf("hwlog init failed, error is %v", err) -- Gitee From 33e58486bc6c5f8c878d5e18c8cbc89e369de1bb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 6 Jul 2022 11:32:49 +0800 Subject: [PATCH 260/296] Match-id-aa9414be36c97beb23076851f9ad503951c01ac4 --- runtime/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index c41b92d..c2fedd5 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -13,6 +13,7 @@ import ( "os" "os/exec" "path" + "path/filepath" "strings" "syscall" @@ -94,13 +95,17 @@ func initLogModule(stopCh <-chan struct{}) error { } var execRunc = func() error { - runcPath, err := exec.LookPath(dockerRuncName) + tempRuncPath, err := exec.LookPath(dockerRuncName) if err != nil { - runcPath, err = exec.LookPath(runcName) + tempRuncPath, err = exec.LookPath(runcName) if err != nil { return fmt.Errorf("failed to find the path of runc: %v", err) } } + runcPath, err := filepath.EvalSymlinks(tempRuncPath) + if err != nil { + return fmt.Errorf("failed to find realpath of runc %v", err) + } if _, err := mindxcheckutils.RealFileChecker(runcPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } -- Gitee From cbe06d621d11fd8dd91b8574a564425b95807b1b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 7 Jul 2022 20:57:20 +0800 Subject: [PATCH 261/296] Match-id-219757b6406123617c7563f71eb46c80e74864ac --- build/build.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build/build.sh b/build/build.sh index d192c7e..e75f569 100644 --- a/build/build.sh +++ b/build/build.sh @@ -73,14 +73,12 @@ function build_bin() export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" mkdir -p ${BUILD}/build/helper/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} - mv main ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} -o ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} - mv main ascend-docker-hook + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} -o ascend-docker-hook echo `pwd` ls @@ -88,8 +86,7 @@ function build_bin() cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} - mv main ascend-docker-runtime + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} -o ascend-docker-runtime } function build_run_package() -- Gitee From d81473e1f4103eb1a94b8d1f39708d063613bc0f Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 8 Jul 2022 11:17:11 +0800 Subject: [PATCH 262/296] Match-id-4c83e8548653a6a7a9824ffba9749a43f1d367b5 --- build/conf/hook.yaml | 1 + build/conf/installhelper.yaml | 1 + build/conf/runtime.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 62ac88a..279e9c6 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -22,6 +22,7 @@ compile: [ "buildmode","pie" ], [ "ldflags",'-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s '], [ "trimpath","{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main.go"], + [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook"] ] output: files: diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index 4d140bf..d02d7a0 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -22,6 +22,7 @@ compile: [ "buildmode", "pie" ], [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"], + [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker-plugin-install-helper"], ] output: files: diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 6a2753f..4daf089 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -22,6 +22,7 @@ compile: [ "buildmode", "pie" ], [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main.go" ], + [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime"] ] output: files: -- Gitee From ba074ae6edb5d403b1f0e2d9b2ab5f15d79ddbe0 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 8 Jul 2022 16:14:15 +0800 Subject: [PATCH 263/296] Match-id-31e9f3c1234a3780f7f94c19ce085552f56f0058 --- build/conf/hook.yaml | 2 +- build/conf/installhelper.yaml | 2 +- build/conf/runtime.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index 279e9c6..b8f1c73 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -21,8 +21,8 @@ compile: parameters: [ [ "buildmode","pie" ], [ "ldflags",'-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s '], + [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook"], [ "trimpath","{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main.go"], - [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook"] ] output: files: diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index d02d7a0..d83314b 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -21,8 +21,8 @@ compile: parameters: [ [ "buildmode", "pie" ], [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], - [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"], [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker-plugin-install-helper"], + [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"], ] output: files: diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 4daf089..50f89aa 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -21,8 +21,8 @@ compile: parameters: [ [ "buildmode", "pie" ], [ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'], + [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime"], [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main.go" ], - [ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime"] ] output: files: -- Gitee From 1e147377d5da5baafd768b6bcff1b45e77bb01bc Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sat, 9 Jul 2022 09:10:42 +0800 Subject: [PATCH 264/296] Match-id-d07fc3f7b7b47a682e16096b5427f9620f92ead7 --- build/conf/hook.yaml | 6 ------ build/conf/installhelper.yaml | 6 ------ build/conf/runtime.yaml | 6 ------ 3 files changed, 18 deletions(-) diff --git a/build/conf/hook.yaml b/build/conf/hook.yaml index b8f1c73..209f49a 100644 --- a/build/conf/hook.yaml +++ b/build/conf/hook.yaml @@ -25,9 +25,3 @@ compile: [ "trimpath","{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main.go"], ] output: - files: - include: - - copy: - src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main" ] - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook" - rename: true \ No newline at end of file diff --git a/build/conf/installhelper.yaml b/build/conf/installhelper.yaml index d83314b..205e041 100644 --- a/build/conf/installhelper.yaml +++ b/build/conf/installhelper.yaml @@ -25,9 +25,3 @@ compile: [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"], ] output: - files: - include: - - copy: - src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main" ] - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker-plugin-install-helper" - rename: true \ No newline at end of file diff --git a/build/conf/runtime.yaml b/build/conf/runtime.yaml index 50f89aa..d255704 100644 --- a/build/conf/runtime.yaml +++ b/build/conf/runtime.yaml @@ -25,9 +25,3 @@ compile: [ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main.go" ], ] output: - files: - include: - - copy: - src: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main" ] - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime" - rename: true \ No newline at end of file -- Gitee From 3d467abd7c99fcdb427b3bf3be14296a37ca6b38 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 12 Jul 2022 16:37:47 +0800 Subject: [PATCH 265/296] Match-id-36b288e72058be93e6862f00fb37f3456ff5196f --- runtime/dcmi/dcmi.go | 20 ++++++++++++++++---- runtime/dcmi/dcmi_interface_api.h | 15 ++++++++++++--- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 5f1e0c8..5990562 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -10,7 +10,6 @@ import "C" import ( "fmt" "math" - "unsafe" ) const ( @@ -22,6 +21,8 @@ const ( // maxErrorCodeCount is the max number of error code hiAIMaxCardNum = 16 + coreNumLen = 32 + deviceNum = 4294967295 // vfg_id表示指定虚拟设备所属的虚拟分组ID,默认自动分配,默认值为0xFFFFFFFF,转换成10进制为4294967295。 ) // NpuWorker Dcmi worker @@ -107,9 +108,20 @@ func GetDeviceLogicID(cardID, deviceID int32) (int32, error) { func (w *NpuWorker) CreateVDevice(cardID, deviceID int32, coreNum string) (int32, error) { var createInfo C.struct_dcmi_create_vdev_out createInfo.vdev_id = C.uint(math.MaxUint32) - coreTemplate := C.CString(coreNum) - defer C.free(unsafe.Pointer(coreTemplate)) - err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), C.int(-1), coreTemplate, &createInfo) + var deviceCreateStr C.struct_dcmi_create_vdev_res_stru + deviceCreateStr = C.struct_dcmi_create_vdev_res_stru{ + vdev_id: C.uint(deviceNum), + vfg_id: C.uint(deviceNum), + } + deviceCreateStrArr := [coreNumLen]C.char{0} + for i := 0; i < len(coreNum); i++ { + if i >= coreNumLen { + return math.MaxInt32, fmt.Errorf("wrong template") + } + deviceCreateStrArr[i] = C.char(coreNum[i]) + } + deviceCreateStr.template_name = deviceCreateStrArr + err := C.dcmi_create_vdevice(C.int(cardID), C.int(deviceID), &deviceCreateStr, &createInfo) if err != 0 { errInfo := fmt.Errorf("create virtual device failed, error code: %d", int32(err)) return math.MaxInt32, errInfo diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h index e7e3f7a..a7094a0 100644 --- a/runtime/dcmi/dcmi_interface_api.h +++ b/runtime/dcmi/dcmi_interface_api.h @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef __cplusplus #if __cplusplus extern "C" { @@ -30,6 +31,12 @@ struct dcmi_create_vdev_out { unsigned int vfg_id; unsigned char reserved[DCMI_VDEV_FOR_RESERVE]; }; +struct dcmi_create_vdev_res_stru { + unsigned int vdev_id; + unsigned int vfg_id; + char template_name[32]; + unsigned char reserved[64]; +}; // dcmi int (*dcmi_init_func)(); @@ -56,12 +63,14 @@ int dcmi_get_device_logic_id(int *device_logic_id, int card_id, int device_id) CALL_FUNC(dcmi_get_device_logic_id, device_logic_id, card_id, device_id); } -int (*dcmi_create_vdevice_func)(int card_id, int device_id, int vdev_id, const char *template_name, +int (*dcmi_create_vdevice_func)(int card_id, int device_id, + struct dcmi_create_vdev_res_stru *vdev, struct dcmi_create_vdev_out *out); -int dcmi_create_vdevice(int card_id, int device_id, int vdev_id, const char *template_name, +int dcmi_create_vdevice(int card_id, int device_id, + struct dcmi_create_vdev_res_stru *vdev, struct dcmi_create_vdev_out *out) { - CALL_FUNC(dcmi_create_vdevice, card_id, device_id, vdev_id, template_name, out); + CALL_FUNC(dcmi_create_vdevice, card_id, device_id, vdev, out); } int (*dcmi_set_destroy_vdevice_func)(int card_id, int device_id, unsigned int VDevid); -- Gitee From 99bf80de4738256c71e7ddd586e53328ea519e24 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 13 Jul 2022 16:39:18 +0800 Subject: [PATCH 266/296] Match-id-0f6b4437cc6ed2a8d8b9d2d3b74dcc8e38c74aac --- hook/go.mod | 4 ++-- runtime/go.mod | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index 056cd22..f923acc 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.13 + huawei.com/npu-exporter v0.2.14 mindxcheckutils v1.0.0 ) @@ -18,7 +18,7 @@ replace ( k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 - github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.9 + github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.5.1 github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible github.com/pkg/errors => github.com/pkg/errors v0.9.1 diff --git a/runtime/go.mod b/runtime/go.mod index 056cd22..f923acc 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.13 + huawei.com/npu-exporter v0.2.14 mindxcheckutils v1.0.0 ) @@ -18,7 +18,7 @@ replace ( k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 - github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.9 + github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.5.1 github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible github.com/pkg/errors => github.com/pkg/errors v0.9.1 -- Gitee From d01b73684c6e2914c1037c3adced8b95b02224fb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 26 Aug 2022 14:12:39 +0800 Subject: [PATCH 267/296] Match-id-1220148b0e357016a0d9b11bfe29203c8ef1984f --- runtime/dcmi/dcmi_api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index f62c924..92da7e5 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -55,7 +55,8 @@ func extractVpuParam(spec *specs.Spec) (int32, string, error) { visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" allowSplit := map[string]string{ "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", - "vir04_3c": "vir04_3c", "vir02_1c": "vir02_1c", + "vir04_3c": "vir04_3c", "vir02_1c": "vir02_1c", "vir04_4c_dvpp": "vir04_4c_dvpp", + "vir04_3c_ndvpp": "vir04_3c_ndvpp", } for _, line := range spec.Process.Env { -- Gitee From 39686c4f2d9da838e5ef66c6d9dbec1f6fc2cd40 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 5 Sep 2022 16:44:57 +0800 Subject: [PATCH 268/296] Match-id-cdbea457685cb750a3355aebbfa814a9d3bd5cfd --- cli/src/basic.h | 8 +-- cli/src/cgrp.c | 3 +- cli/src/cgrp.h | 2 +- cli/src/logger.c | 52 +++++++++-------- cli/src/main.c | 11 ++-- cli/src/ns.c | 2 +- cli/src/ns.h | 2 +- cli/src/options.c | 6 +- cli/src/u_mount.c | 8 ++- cli/src/utils.c | 83 +++++++++++++++++---------- cli/src/utils.h | 5 +- cli/test/dt/testcase/gtest_mytest.cpp | 73 ++++++++++++----------- 12 files changed, 146 insertions(+), 109 deletions(-) diff --git a/cli/src/basic.h b/cli/src/basic.h index ab7b159..f584fa4 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -15,9 +15,9 @@ #define DEVMM_SVM "devmm_svm" #define HISI_HDC "hisi_hdc" #define DEFAULT_DIR_MODE 0755 -#define DEFAULT_LOG_MODE 0640 -#define DUMP_LOG_MODE 0440 -#define DEFAULT_LOGDIR_MODE 0750 +#define DEFAULT_LOG_MODE 0600 +#define DUMP_LOG_MODE 0400 +#define DEFAULT_LOGDIR_MODE 0700 #define BUF_SIZE 1024 #define MAX_DEVICE_NR 1024 #define MAX_MOUNT_NR 512 @@ -65,7 +65,7 @@ struct MountList { struct ParsedConfig { char rootfs[BUF_SIZE]; - unsigned int devices[MAX_DEVICE_NR]; + size_t devices[MAX_DEVICE_NR]; size_t devicesNr; char containerNsPath[BUF_SIZE]; char cgroupPath[BUF_SIZE]; diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 9e77f63..32e49e9 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -83,6 +83,7 @@ bool CheckSubStr(char **pLine, const char *subsys) return strstr(substr, subsys) != NULL; } + typedef char *(*ParseFileLine)(char *, const char *); static bool GetFileInfo(const char* resolvedPath, char* buffer, const int bufferSize, const ParseFileLine fn) { @@ -274,7 +275,7 @@ int SetupDriverCgroup(FILE *cgroupAllow) return 0; } -int GetCgroupPath(int pid, char *effPath, size_t maxSize) +int GetCgroupPath(const long pid, char *effPath, size_t maxSize) { if (effPath == NULL) { (void)fprintf(stderr, "effPath pointer is null!\n"); diff --git a/cli/src/cgrp.h b/cli/src/cgrp.h index e66dd1e..3befd76 100644 --- a/cli/src/cgrp.h +++ b/cli/src/cgrp.h @@ -7,7 +7,7 @@ #include "basic.h" -int GetCgroupPath(int pid, char *effPath, size_t maxSize); +int GetCgroupPath(const long pid, char *effPath, size_t maxSize); int SetupCgroup(const struct ParsedConfig *config); #endif \ No newline at end of file diff --git a/cli/src/logger.c b/cli/src/logger.c index f7364a1..e4fb6d5 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -29,6 +29,9 @@ int GetCurrentLocalTime(char* buffer, int length) } time_t timep = time(NULL); + if (timep == (time_t)-1) { + return -1; + } struct tm result = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct tm *timeinfo = localtime_r(&timep, &result); if (timeinfo == NULL) { @@ -96,12 +99,8 @@ long GetLogSize(const char* filename) if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return -1; } - struct stat fileStat; - if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { - const size_t maxFileSzieMb = 50; // max 50MB - if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { - return -1; - } + if (!CheckExistsFile(path, strlen(path), 0, false)) { + return -1; } return GetLogSizeProcess(path); } @@ -115,12 +114,19 @@ int LogLoop(const char* filename) int ret; char* loopPath = LOG_PATH_DIR"docker-runtime-log.log.1"; - int exist; - exist = access(loopPath, 0); - if (exist == 0) { + + if (!CheckExistsFile(loopPath, strlen(loopPath), 0, false)) { + return -1; + } + if (!CheckExistsFile(filename, strlen(filename), 0, false)) { + return -1; + } + if (access(loopPath, 0) == 0) { unlink(loopPath); } - rename(filename, loopPath); + if (rename(filename, loopPath) == -1) { + return -1; + } if (chmod(loopPath, DUMP_LOG_MODE) != 0) { return -1; } @@ -182,12 +188,8 @@ static void LogFileProcess(const char* filename, const long maxSize, const char* if (strlen(filename) > PATH_MAX || realpath(filename, path) == NULL) { return; } - struct stat fileStat; - if ((stat(path, &fileStat) == 0) && (S_ISREG(fileStat.st_mode) != 0)) { - const size_t maxFileSzieMb = 50; // max 50MB - if (!CheckExternalFile(path, strlen(path), maxFileSzieMb, true)) { - return; - } + if (!CheckExistsFile(path, strlen(path), 0, false)) { + return; } WriteLogInfo(path, PATH_MAX + 1, buffer, bufferSize); } @@ -199,30 +201,32 @@ void WriteLogFile(const char* filename, long maxSize, const char* buffer, unsign return; } - if (filename != NULL && buffer != NULL) { - LogFileProcess(filename, maxSize, buffer, bufferSize); - } + LogFileProcess(filename, maxSize, buffer, bufferSize); } static void DivertAndWrite(const char *logPath, const char *msg, const int level) { int ret; - char* buffer = malloc(LOG_LENGTH); + size_t destMax = LOG_LENGTH; + if (destMax <= 0) { + return; + } + char* buffer = (char*)malloc(destMax * sizeof(char)); if (buffer == NULL) { return; } switch (level) { case LEVEL_DEBUG: - ret = sprintf_s(buffer, LOG_LENGTH, "[Debug]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Debug]%s\n", msg); break; case LEVEL_ERROR: - ret = sprintf_s(buffer, LOG_LENGTH, "[Error]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Error]%s\n", msg); break; case LEVEL_WARN: - ret = sprintf_s(buffer, LOG_LENGTH, "[Warn]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Warn]%s\n", msg); break; default: - ret = sprintf_s(buffer, LOG_LENGTH, "[Info]%s\n", msg); + ret = sprintf_s(buffer, destMax, "[Info]%s\n", msg); } if (ret < 0) { free(buffer); diff --git a/cli/src/main.c b/cli/src/main.c index 616c14d..3c64540 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -28,7 +28,7 @@ struct CmdArgs { char devices[BUF_SIZE]; char rootfs[BUF_SIZE]; - int pid; + long pid; char options[BUF_SIZE]; struct MountList files; struct MountList dirs; @@ -224,7 +224,7 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) return false; } - if (args->files.count == MAX_MOUNT_NR) { + if (args->files.count >= MAX_MOUNT_NR) { char* str = FormatLogMessage("too many files to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -239,7 +239,6 @@ static bool MountFileCmdArgParser(struct CmdArgs *args, const char *arg) free(str); return false; } - const size_t maxFileSzieMb = 50; // max 50MB if (!CheckFileLegality(dst, strlen(dst), maxFileSzieMb)) { char* str = FormatLogMessage("failed to check files: %s", dst); @@ -258,7 +257,7 @@ static bool MountDirCmdArgParser(struct CmdArgs *args, const char *arg) return false; } - if (args->dirs.count == MAX_MOUNT_NR) { + if (args->dirs.count >= MAX_MOUNT_NR) { char* str = FormatLogMessage("too many directories to mount, max number is %u", MAX_MOUNT_NR); Logger(str, LEVEL_ERROR, SCREEN_YES); free(str); @@ -335,7 +334,7 @@ static inline bool IsCmdArgsValid(const struct CmdArgs *args) return (strlen(args->devices) > 0) && (strlen(args->rootfs) > 0) && (args->pid > 0); } -static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *devices) +static int ParseDeviceIDs(size_t *idList, size_t *idListSize, char *devices) { if (idList == NULL || idListSize == NULL || devices == NULL) { Logger("idList, idListSize, devices pointer is null!", LEVEL_ERROR, SCREEN_YES); @@ -348,7 +347,7 @@ static int ParseDeviceIDs(unsigned int *idList, size_t *idListSize, char *device size_t idx = 0; token = strtok_s(devices, sep, &context); - while (token != NULL) { + while (token != NULL && idx < *idListSize) { if (idx >= *idListSize) { char* str = FormatLogMessage("too many devices(%u), support %u devices maximally", idx, *idListSize); Logger(str, LEVEL_ERROR, SCREEN_YES); diff --git a/cli/src/ns.c b/cli/src/ns.c index 94b280e..d9fca09 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -13,7 +13,7 @@ #include "utils.h" #include "logger.h" -int GetNsPath(const int pid, const char *nsType, char *buf, const size_t bufSize) +int GetNsPath(const long pid, const char *nsType, char *buf, const size_t bufSize) { if ((nsType == NULL) || (buf == NULL)) { return -1; diff --git a/cli/src/ns.h b/cli/src/ns.h index 36f7671..dc7ecc4 100644 --- a/cli/src/ns.h +++ b/cli/src/ns.h @@ -7,7 +7,7 @@ #include -int GetNsPath(int pid, const char *nsType, char *buf, const size_t bufSize); +int GetNsPath(const long pid, const char *nsType, char *buf, const size_t bufSize); int GetSelfNsPath(const char *nsType, char *buf, const size_t bufSize); int EnterNsByFd(int fd, int nsType); int EnterNsByPath(const char *path, int nsType); diff --git a/cli/src/options.c b/cli/src/options.c index f5c546f..603ee98 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -35,6 +35,10 @@ void ParseRuntimeOptions(const char *options) static const char *seperator = ","; char *runtimeOptions = strdup(options); + if (runtimeOptions == NULL) { + (void)fprintf(stderr, "strdup failed!\n"); + return; + } char *context = NULL; char *token = NULL; @@ -42,7 +46,7 @@ void ParseRuntimeOptions(const char *options) token != NULL; token = strtok_s(NULL, seperator, &context)) { for (int i = 0; g_optionNameFlagTable[i].name != NULL; i++) { - if (!strcmp((const char *)token, g_optionNameFlagTable[i].name)) { + if (strcmp((const char *)token, g_optionNameFlagTable[i].name) == 0) { *g_optionNameFlagTable[i].flag = true; } } diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 7f1b482..32f9a72 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -19,8 +19,10 @@ static bool checkSrcFile(const char *src) { struct stat fileStat; - if ((stat(src, &fileStat) == 0) && - ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0))) { // 只校验文件和目录 + if (stat(src, &fileStat) != 0) { + return -1; // 待挂载源文件不存在 + } + if ((S_ISREG(fileStat.st_mode) != 0) || (S_ISDIR(fileStat.st_mode) != 0)) { // 只校验文件和目录 const size_t maxFileSzieMb = 10 * 1024; // max 10 G if (!CheckExternalFile(src, strlen(src), maxFileSzieMb, false)) { char* str = FormatLogMessage("failed to mount src: %s.", src); @@ -187,7 +189,7 @@ int MountDevice(const char *rootfs, const char *srcDeviceName, const char *dstDe return 0; } -int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) +int DoDeviceMounting(const char *rootfs, const char *device_name, const size_t ids[], size_t idsNr) { if (rootfs == NULL || device_name == NULL || ids == NULL) { Logger("rootfs, device_name pointer is null!", LEVEL_ERROR, SCREEN_YES); diff --git a/cli/src/utils.c b/cli/src/utils.c index 8b11d6d..57e45db 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -17,6 +17,8 @@ #include "securec.h" #include "logger.h" +static bool g_checkWgroup = true; + char *FormatLogMessage(char *format, ...) { if (format == NULL) { @@ -28,11 +30,12 @@ char *FormatLogMessage(char *format, ...) // 获取格式化后字符串的长度 va_start(list, format); char buff[1024] = {0}; - int size = vsnprintf_s(buff, sizeof(buff), sizeof(buff) - 1, format, list); + int ret = vsnprintf_s(buff, sizeof(buff), sizeof(buff) - 1, format, list); va_end(list); - if (size <= 0) { + if (ret <= 0) { return NULL; } + size_t size = (size_t)ret; size++; // 复位va_list, 将格式化字符串写入到buf va_start(list, format); @@ -40,7 +43,7 @@ char *FormatLogMessage(char *format, ...) if (buf == NULL) { return NULL; } - int ret = vsnprintf_s(buf, size, size - 1, format, list); + ret = vsnprintf_s(buf, size, size - 1, format, list); va_end(list); if (ret <= 0) { free(buf); @@ -54,12 +57,12 @@ int IsStrEqual(const char *s1, const char *s2) return (strcmp(s1, s2) == 0); } -int StrHasPrefix(const char *str, const char *prefix) +bool StrHasPrefix(const char *str, const char *prefix) { - return (!strncmp(str, prefix, strlen(prefix))); + return (strncmp(str, prefix, strlen(prefix)) == 0); } -int MkDir(const char *dir, int mode) +static int MkDir(const char *dir, mode_t mode) { if (dir == NULL) { (void)fprintf(stderr, "dir pointer is null!\n"); @@ -195,11 +198,11 @@ static bool CheckFileOwner(const struct stat fileStat, const bool checkOwner) return true; } -static bool CheckParentDir(const char* resolvedPath, const size_t resolvedPathLen, +static bool CheckParentDir(const char* filePath, const size_t filePathLen, struct stat fileStat, const bool checkOwner) { char buf[PATH_MAX] = {0}; - if (strncpy_s(buf, sizeof(buf), resolvedPath, resolvedPathLen) != EOK) { + if (strncpy_s(buf, sizeof(buf), filePath, filePathLen) != EOK) { return false; } for (int iLoop = 0; iLoop < PATH_MAX; iLoop++) { @@ -209,32 +212,42 @@ static bool CheckParentDir(const char* resolvedPath, const size_t resolvedPathLe if ((fileStat.st_mode & S_IWOTH) != 0) { // 操作文件对other用户可写 return ShowExceptionInfo("Please check the write permission!"); } + if (g_checkWgroup && ((fileStat.st_mode & S_IWGRP) != 0)) { // 除日志文件外对group可写 + return ShowExceptionInfo("Please check the write permission!"); + } + if (S_ISLNK(fileStat.st_mode) != 0) { // 存在软链接 + return ShowExceptionInfo("resolvedPath is symbolic link!"); + } if ((strcmp(buf, "/") == 0) || (strstr(buf, "/") == NULL)) { break; } if (strcmp(dirname(buf), ".") == 0) { break; } - if (stat(buf, &fileStat) != 0) { + if (lstat(buf, &fileStat) != 0) { return false; } } return true; } -static bool CheckLegality(const char* resolvedPath, const size_t resolvedPathLen, +static bool CheckLegality(const char* filePath, const size_t filePathLen, const unsigned long long maxFileSzieMb, const bool checkOwner) { const unsigned long long maxFileSzieB = maxFileSzieMb * 1024 * 1024; + char buf[PATH_MAX] = {0}; + if (strncpy_s(buf, sizeof(buf), filePath, filePathLen) != EOK) { + return false; + } struct stat fileStat; - if ((stat(resolvedPath, &fileStat) != 0) || + if ((lstat(buf, &fileStat) != 0) || ((S_ISREG(fileStat.st_mode) == 0) && (S_ISDIR(fileStat.st_mode) == 0))) { - return ShowExceptionInfo("resolvedPath does not exist or is not a file!"); + return ShowExceptionInfo("filePath does not exist or is not a file/dir!"); } - if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 + if ((maxFileSzieMb > 0) && (fileStat.st_size >= maxFileSzieB)) { // 文件大小超限,日志文件不校验大小,由轮滚机制保护 return ShowExceptionInfo("fileSize out of bounds!"); } - return CheckParentDir(resolvedPath, resolvedPathLen, fileStat, checkOwner); + return CheckParentDir(filePath, filePathLen, fileStat, checkOwner); } bool IsValidChar(const char c) @@ -261,14 +274,26 @@ bool CheckExternalFile(const char* filePath, const size_t filePathLen, return ShowExceptionInfo("filePath has an illegal character!"); } } - char resolvedPath[PATH_MAX] = {0}; - if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { - return ShowExceptionInfo("realpath failed!"); + return CheckLegality(filePath, filePathLen, maxFileSzieMb, checkOwner); +} + +bool CheckExistsFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkWgroup) +{ + struct stat fileStat; + if (lstat(filePath, &fileStat) != 0) { + return true; // 文件不存在 + } + if (S_ISREG(fileStat.st_mode) == 0) { // 不是文件 + return false; } - if (strcmp(resolvedPath, filePath) != 0) { // 存在软链接 - return ShowExceptionInfo("filePath has a soft link!"); + g_checkWgroup = checkWgroup; + if (!CheckExternalFile(filePath, filePathLen, maxFileSzieMb, true)) { + g_checkWgroup = true; + return false; } - return CheckLegality(resolvedPath, strlen(resolvedPath), maxFileSzieMb, checkOwner); + g_checkWgroup = true; + return true; } static bool CheckFileSubset(const char* filePath, const size_t filePathLen, @@ -284,23 +309,19 @@ static bool CheckFileSubset(const char* filePath, const size_t filePathLen, return ShowExceptionInfo("filePath has an illegal character!"); } } - char resolvedPath[PATH_MAX] = {0}; - if (realpath(filePath, resolvedPath) == NULL && errno != ENOENT) { - return ShowExceptionInfo("realpath failed!"); - } - if (strcmp(resolvedPath, filePath) != 0) { // 存在软链接 - return ShowExceptionInfo("filePath has a soft link!"); - } struct stat fileStat; - if (stat(filePath, &fileStat) != 0) { - return ShowExceptionInfo("filePath does not exist or is not a file!"); + if (lstat(filePath, &fileStat) != 0) { + return ShowExceptionInfo("filePath does not exist!"); + } + if (S_ISLNK(fileStat.st_mode) != 0) { // 存在软链接 + return ShowExceptionInfo("filePath is symbolic link!"); } if (fileStat.st_size >= maxFileSzieB) { // 文件大小超限 return ShowExceptionInfo("fileSize out of bounds!"); } return true; } - + bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen) { DIR *dir = NULL; @@ -324,7 +345,7 @@ bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen) } if (ptr->d_type == DT_REG) { // 文件 const size_t maxFileSzieMb = 10; // max 10 MB - if (!CheckFileSubset(base, strlen(base), maxFileSzieMb)) { + if (!(base, strlen(base), maxFileSzieMb)) { return false; } } else if (ptr->d_type == DT_LNK) { // 软链接 diff --git a/cli/src/utils.h b/cli/src/utils.h index e320446..e4ba957 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -15,8 +15,7 @@ char *FormatLogMessage(char *format, ...); int IsStrEqual(const char *s1, const char *s2); -int StrHasPrefix(const char *str, const char *prefix); -int MkDir(const char *dir, int mode); +bool StrHasPrefix(const char *str, const char *prefix); int VerifyPathInfo(const struct PathInfo* pathInfo); int CheckDirExists(const char *dir); int GetParentPathStr(const char *path, char *parent, size_t bufSize); @@ -26,4 +25,6 @@ bool IsValidChar(const char c); bool CheckExternalFile(const char* filePath, const size_t filePathLen, const size_t maxFileSzieMb, const bool checkOwner); bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen); +bool CheckExistsFile(const char* filePath, const size_t filePathLen, + const size_t maxFileSzieMb, const bool checkWgroup); #endif \ No newline at end of file diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 14cbe4e..320b515 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -11,10 +11,15 @@ #include "gtest/gtest.h" #include "mockcpp/mockcpp.hpp" - using namespace std; using namespace testing; +#ifndef GOOGLE_TEST +# define STATIC static +#else +# define STATIC +#endif + #define DAVINCI_MANAGER_PATH "/dev/davinci_manager" #define DEVICE_NAME "davinci" #define BUF_SIZE 1024 @@ -30,15 +35,15 @@ extern "C" int stat(const char *file_name, struct stat *buf); extern "C" int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); extern "C" int Mount(const char *src, const char *dst); -extern "C" int MkDir(const char *dir, int mode); +STATIC int MkDir(const char *dir, mode_t mode); extern "C" int rmdir(const char *pathname); extern "C" int EnterNsByFd(int fd, int nsType); -extern "C" int StrHasPrefix(const char *str, const char *prefix); +extern "C" bool StrHasPrefix(const char *str, const char *prefix); extern "C" int GetNsPath(const int pid, const char *nsType, char *buf, size_t bufSize); extern "C" int GetSelfNsPath(const char *nsType, char *buf, size_t bufSize); extern "C" int EnterNsByPath(const char *path, int nsType); extern "C" int MountDevice(const char *rootfs, const char *deviceName); -extern "C" int DoDeviceMounting(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr); +extern "C" int DoDeviceMounting(const char *rootfs, const char *device_name, const size_t ids[], size_t idsNr); extern "C" int CheckDirExists(char *dir, int len); extern "C" int GetParentPathStr(const char *path, char *parent, size_t bufSize); extern "C" int MakeDirWithParent(const char *path, mode_t mode); @@ -222,12 +227,12 @@ int Stub_EnterNsByPath_Failed(const char *path, int nsType) return 0; } -int Stub_DoDeviceMounting_Success(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) +int Stub_DoDeviceMounting_Success(const char *rootfs, const char *device_name, const size_t ids[], size_t idsNr) { return 0; } -int Stub_DoDeviceMounting_Failed(const char *rootfs, const char *device_name, const unsigned int ids[], size_t idsNr) +int Stub_DoDeviceMounting_Failed(const char *rootfs, const char *device_name, const size_t ids[], size_t idsNr) { return -1; } @@ -461,7 +466,7 @@ TEST_F(Test_Fhho, StatusOneDoDeviceMounting) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Success)); char *rootfs = "/home"; - unsigned int devicesList[2] = {1, 2}; + size_t devicesList[2] = {1, 2}; size_t idNr = 2; char *device_name = "davinci"; int ret = DoDeviceMounting(rootfs, device_name, devicesList, idNr); @@ -473,7 +478,7 @@ TEST_F(Test_Fhho, StatusTwoDoDeviceMounting) { MOCKER(MountDevice).stubs().will(invoke(Stub_MountDevice_Failed)); char *rootfs = "/home"; - unsigned int devicesList[2] = {1, 2}; + size_t devicesList[2] = {1, 2}; size_t idNr = 2; char *device_name = "davinci"; int ret = DoDeviceMounting(rootfs, device_name, devicesList, idNr); @@ -630,17 +635,6 @@ TEST_F(Test_Fhho, MakeMountPoints1) EXPECT_EQ(-1, ret); } - -TEST_F(Test_Fhho, MkDirtestsuccess) -{ - // The test create directory contains the parent directory - mode_t mode = 0755; - char *dir = "/home"; - int ret = MkDir(dir, mode); - EXPECT_EQ(-1, ret); -} - - TEST_F(Test_Fhho, LogLoopSuccess) { // The test create directory contains the parent directory @@ -659,6 +653,16 @@ TEST_F(Test_Fhho, StatusTwoMakeDirWithParent) EXPECT_EQ(0, ret); } +#ifdef GOOGLE_TEST +TEST_F(Test_Fhho, MkDirtestsuccess) +{ + // The test create directory contains the parent directory + mode_t mode = 0755; + char *dir = "/home"; + int ret = MkDir(dir, mode); + EXPECT_EQ(-1, ret); +} + TEST_F(Test_Fhho, StatusThreeMakeDirWithParent) { char *pathData = "/path/abc/abcd"; @@ -673,6 +677,18 @@ TEST_F(Test_Fhho, StatusThreeMakeDirWithParent) EXPECT_EQ(0, ret); } +TEST_F(Test_Fhho, StatusThreeMountDir) +{ + MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); + MOCKER(MkDir).stubs().will(invoke(stub_MkDir_failed)); + char *rootfs = "/rootfs"; + unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; + int ret = MountDir(rootfs, "/home", reMountRwFlag); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} +#endif + TEST_F(Test_Fhho, StatusOneMountDir) { MOCKER(stat).stubs().will(invoke(stub_stat_failed)); @@ -694,17 +710,6 @@ TEST_F(Test_Fhho, StatusTwoMountDir) EXPECT_EQ(-1, ret); } -TEST_F(Test_Fhho, StatusThreeMountDir) -{ - MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); - MOCKER(MkDir).stubs().will(invoke(stub_MkDir_failed)); - char *rootfs = "/rootfs"; - unsigned long reMountRwFlag = MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC; - int ret = MountDir(rootfs, "/home", reMountRwFlag); - GlobalMockObject::verify(); - EXPECT_EQ(-1, ret); -} - TEST_F(Test_Fhho, StatusFourMountDir) { MOCKER(CheckDirExists).stubs().will(invoke(Stub_CheckDirExists_Failed)); @@ -788,7 +793,7 @@ TEST_F(Test_Fhho, StatusOneSetupDeviceCgroup) MOCKER(stat).stubs().will(invoke(stub_stat_failed)); int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); if (cgroupAllow != NULL) { - fclose(cgroupAllow); + (void)fclose(cgroupAllow); } EXPECT_EQ(-1, ret); } @@ -803,7 +808,7 @@ TEST_F(Test_Fhho, StatusTwoSetupDeviceCgroup) MOCKER(stat).stubs().will(invoke(stub_stat_success)); int ret = SetupDeviceCgroup(cgroupAllow, cgroupPath); if (cgroupAllow != NULL) { - fclose(cgroupAllow); + (void)fclose(cgroupAllow); } GlobalMockObject::verify(); EXPECT_EQ(-1, ret); @@ -817,7 +822,7 @@ TEST_F(Test_Fhho, StatusOneSetupDriverCgroup) MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Success)); int ret = SetupDriverCgroup(cgroupAllow); if (cgroupAllow != NULL) { - fclose(cgroupAllow); + (void)fclose(cgroupAllow); } GlobalMockObject::verify(); EXPECT_EQ(0, ret); @@ -831,7 +836,7 @@ TEST_F(Test_Fhho, StatusTwoSetupDriverCgroup) MOCKER(SetupDeviceCgroup).stubs().will(invoke(Stub_SetupDeviceCgroup_Failed)); int ret = SetupDriverCgroup(cgroupAllow); if (cgroupAllow != NULL) { - fclose(cgroupAllow); + (void)fclose(cgroupAllow); } GlobalMockObject::verify(); EXPECT_EQ(-1, ret); -- Gitee From 6f728efe8cebc5d525825eb381fffc810e636d92 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 7 Sep 2022 16:09:40 +0800 Subject: [PATCH 269/296] Match-id-d4d4549820b7bf33aaaafbcc2d31a01d584ca3c3 --- hook/go.mod | 15 +---- hook/main.go | 89 +++++++++++++++++++----------- install/deb/src/go.mod | 11 +++- install/deb/src/main.go | 70 +++++++++++++++++------ mindxcheckutils/mindxcheckutils.go | 40 +++++++++++++- runtime/main.go | 12 ++++ 6 files changed, 171 insertions(+), 66 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index f923acc..57453b4 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.14 + huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 ) @@ -17,17 +17,4 @@ replace ( k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 - github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 - github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.5.1 - github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 - github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible - github.com/pkg/errors => github.com/pkg/errors v0.9.1 - github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a - github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.11.1 - github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v1.6.4 - github.com/stretchr/testify => github.com/stretchr/testify v1.7.0 - go.uber.org/zap => go.uber.org/zap v1.16.0 - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b - google.golang.org/grpc => google.golang.org/grpc v1.28.0 - gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) diff --git a/hook/main.go b/hook/main.go index 7e5aea1..d77ddd7 100644 --- a/hook/main.go +++ b/hook/main.go @@ -20,8 +20,9 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" "go.uber.org/zap" - "huawei.com/npu-exporter/hwlog" "mindxcheckutils" + + "huawei.com/npu-exporter/hwlog" ) const ( @@ -39,7 +40,6 @@ const ( borderNum = 2 kvPairSize = 2 - maxLogLength = 1024 maxCommandLength = 65535 ) @@ -69,6 +69,7 @@ func initLogModule(stopCh <-chan struct{}) error { LogLevel: 0, MaxBackups: backups, MaxAge: logMaxAge, + OnlyToFile: true, } if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { fmt.Printf("hwlog init failed, error is %v", err) @@ -79,6 +80,7 @@ func initLogModule(stopCh <-chan struct{}) error { LogLevel: 0, MaxBackups: backups, MaxAge: logMaxAge, + OnlyToFile: true, } if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { fmt.Printf("hwlog init failed, error is %v", err) @@ -105,6 +107,7 @@ func removeDuplication(devices []int) []int { func parseDevices(visibleDevices string) ([]int, error) { devices := make([]int, 0) + const maxDevice = 128 for _, d := range strings.Split(visibleDevices, ",") { d = strings.TrimSpace(d) @@ -118,12 +121,12 @@ func parseDevices(visibleDevices string) ([]int, error) { borders[1] = strings.TrimSpace(borders[1]) left, err := strconv.Atoi(borders[0]) - if err != nil { + if err != nil || left < 0 { return nil, fmt.Errorf("invalid left boarder range parameter: %s", borders[0]) } right, err := strconv.Atoi(borders[1]) - if err != nil { + if err != nil || right > maxDevice { return nil, fmt.Errorf("invalid right boarder range parameter: %s", borders[1]) } @@ -152,6 +155,10 @@ func parseMounts(mounts string) []string { if mounts == "" { return []string{baseConfig} } + const maxMountLength = 128 + if len(mounts) > maxMountLength { + return []string{baseConfig} + } mountConfigs := make([]string, 0) for _, m := range strings.Split(mounts, ",") { @@ -179,11 +186,15 @@ func parseRuntimeOptions(runtimeOptions string) ([]string, error) { if runtimeOptions == "" { return parsedOptions, nil } + const maxLength = 128 + if len(runtimeOptions) > maxLength { + return nil, fmt.Errorf("invalid runtime option") + } for _, option := range strings.Split(runtimeOptions, ",") { option = strings.TrimSpace(option) if !isRuntimeOptionValid(option) { - return nil, fmt.Errorf("invalid runtime option %s", option) + return nil, fmt.Errorf("invalid runtime option") } parsedOptions = append(parsedOptions, option) @@ -224,7 +235,7 @@ var getContainerConfig = func() (*containerConfig, error) { } configPath := path.Join(state.Bundle, "config.json") - if _, err := mindxcheckutils.RealFileChecker(configPath, false, true, mindxcheckutils.DefaultSize); err != nil { + if _, err := mindxcheckutils.RealFileChecker(configPath, true, true, mindxcheckutils.DefaultSize); err != nil { return nil, err } @@ -247,14 +258,14 @@ var getContainerConfig = func() (*containerConfig, error) { return ret, nil } -func getValueByKey(data []string, key string) string { +func getValueByKey(data []string, name string) string { for _, s := range data { p := strings.SplitN(s, "=", 2) if len(p) != kvPairSize { log.Panicln("environment error") } - if p[0] == key { + if p[0] == name && len(p) == kvPairSize { return p[1] } } @@ -288,12 +299,16 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { } defer f.Close() - fileMountList := make([]string, 0) - dirMountList := make([]string, 0) - + fileMountList, dirMountList := make([]string, 0), make([]string, 0) + const maxEntryNumber = 128 + entryCount := 0 scanner := bufio.NewScanner(f) for scanner.Scan() { mountPath := scanner.Text() + entryCount = entryCount + 1 + if entryCount > maxEntryNumber { + return nil, nil, fmt.Errorf("mount list too long") + } absMountPath, err := filepath.Abs(mountPath) if err != nil { continue // skipping files/dirs with any problems @@ -305,7 +320,7 @@ func readMountConfig(dir string, name string) ([]string, []string, error) { continue // skipping files/dirs with any problems } - if stat.Mode().IsRegular() || stat.Mode()&os.ModeSocket != 0 { + if stat.Mode().IsRegular() { fileMountList = append(fileMountList, mountPath) } else if stat.Mode().IsDir() { dirMountList = append(dirMountList, mountPath) @@ -341,6 +356,20 @@ func readConfigsOfDir(dir string, configs []string) ([]string, []string, error) return fileMountList, dirMountList, nil } +func getArgs(cliPath string, devices []int, containerConfig *containerConfig, + fileMountList []string, dirMountList []string) []string { + args := append([]string{cliPath}, + "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), + "--pid", fmt.Sprintf("%d", containerConfig.Pid), "--rootfs", containerConfig.Rootfs) + for _, filePath := range fileMountList { + args = append(args, "--mount-file", filePath) + } + for _, dirPath := range dirMountList { + args = append(args, "--mount-dir", dirPath) + } + return args +} + func doPrestartHook() error { containerConfig, err := getContainerConfig() if err != nil { @@ -381,23 +410,14 @@ func doPrestartHook() error { if _, err := mindxcheckutils.RealFileChecker(cliPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err } - - args := append([]string{cliPath}, - "--devices", strings.Trim(strings.Join(strings.Fields(fmt.Sprint(devices)), ","), "[]"), - "--pid", fmt.Sprintf("%d", containerConfig.Pid), - "--rootfs", containerConfig.Rootfs) - - for _, filePath := range fileMountList { - args = append(args, "--mount-file", filePath) - } - - for _, dirPath := range dirMountList { - args = append(args, "--mount-dir", dirPath) - } - + args := getArgs(cliPath, devices, containerConfig, fileMountList, dirMountList) if len(parsedOptions) > 0 { args = append(args, "--options", strings.Join(parsedOptions, ",")) } + hwlog.OpLog.Infof("ascend docker hook success, will start cli") + if err := mindxcheckutils.ChangeRuntimeLogMode("hook-run-", "hook-operate-"); err != nil { + return err + } if err := doExec(cliPath, args, os.Environ()); err != nil { return fmt.Errorf("failed to exec ascend-docker-cli %v: %v", args, err) } @@ -422,24 +442,27 @@ func main() { close(stopCh) log.Fatal(err) } + defer func() { + if err := mindxcheckutils.ChangeRuntimeLogMode("hook-run-", "hook-operate-"); err != nil { + fmt.Println("defer changeFileMode function failed") + } + }() hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) + hwlog.OpLog.Infof("ascend docker hook starting, try to setup container") hwlog.RunLog.Infof("ascend docker hook starting") if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + hwlog.RunLog.Errorf("ascend docker hook failed") + hwlog.OpLog.Errorf("ascend docker hook failed") close(stopCh) log.Fatal("command error") } - logWords := fmt.Sprintf("running %v", os.Args) - if len(logWords) > maxLogLength { - logWords = logWords[0:maxLogLength-1] + "..." - } - hwlog.OpLog.Infof(logWords) if err := doPrestartHook(); err != nil { hwlog.RunLog.Errorf("ascend docker hook failed") - hwlog.OpLog.Errorf("failed: err %v", err) + hwlog.OpLog.Errorf("ascend docker hook failed") close(stopCh) - log.Fatal(err) + log.Fatal(fmt.Errorf("failed in runtime.doProcess ")) } close(stopCh) } diff --git a/install/deb/src/go.mod b/install/deb/src/go.mod index 5d8e2d2..2f5b9c4 100644 --- a/install/deb/src/go.mod +++ b/install/deb/src/go.mod @@ -3,7 +3,16 @@ module main go 1.16 require ( + huawei.com/npu-exporter v0.2.13 mindxcheckutils v1.0.0 ) -replace mindxcheckutils => ../../../mindxcheckutils +replace ( + mindxcheckutils => ../../../mindxcheckutils + huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 + huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 + k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 + k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 + k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 + k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 +) \ No newline at end of file diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 327d0e9..7aaddfd 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -11,6 +11,9 @@ import ( "log" "os" "path/filepath" + "strings" + + "huawei.com/npu-exporter/hwlog" "mindxcheckutils" ) @@ -33,27 +36,59 @@ const ( rmCommandLength = 3 addCommandLength = 4 addCommand = "add" + maxCommandLength = 65535 + logPath = "/var/log/ascend-docker-runtime/installer.log" rmCommand = "rm" maxFileSize = 1024 * 1024 * 10 ) func main() { - defer func() { - if err := recover(); err != nil { - log.Fatal(err) - } - }() - log.SetPrefix("LOG: ") - log.Printf("running %s", os.Args) - err := process() + stopCh := make(chan struct{}) + if err := initLogModule(stopCh); err != nil { + close(stopCh) + log.Fatal(err) + } + logPrefixWords, err := mindxcheckutils.GetLogPrefix() if err != nil { - log.Printf("run %s failed", os.Args) + close(stopCh) log.Fatal(err) + } + hwlog.OpLog.Infof("%v installer started", logPrefixWords) + + if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, + maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + hwlog.OpLog.Infof("%v run failed", logPrefixWords) + close(stopCh) + log.Fatal("command error") + } + + err = process() + if err != nil { + hwlog.OpLog.Infof("%v run %s failed", logPrefixWords, os.Args) + close(stopCh) + log.Fatal(fmt.Errorf("error in installation")) } else { - log.Printf("run %s success", os.Args) + hwlog.OpLog.Infof("%v run %s success", logPrefixWords, os.Args) + close(stopCh) } } +func initLogModule(stopCh <-chan struct{}) error { + const backups = 2 + const logMaxAge = 365 + logConfig := hwlog.LogConfig{ + LogFileName: logPath, + LogLevel: 0, + MaxBackups: backups, + MaxAge: logMaxAge, + } + if err := hwlog.InitOperateLogger(&logConfig, stopCh); err != nil { + fmt.Printf("hwlog init failed, error is %v", err) + return err + } + return nil +} + func process() error { const helpMessage = "\tadd \n" + "\t rm \n" + @@ -101,14 +136,14 @@ func process() error { } // check file permission - writeContent, err := createJSONString(srcFilePath, runtimeFilePath, action) + writeContent, err := createJsonString(srcFilePath, runtimeFilePath, action) if err != nil { return err } - return writeJSON(destFilePath, writeContent) + return writeJson(destFilePath, writeContent) } -func createJSONString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { +func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { var writeContent []byte if _, err := os.Stat(srcFilePath); err == nil { daemon, err := modifyDaemon(srcFilePath, runtimeFilePath, action) @@ -128,7 +163,7 @@ func createJSONString(srcFilePath, runtimeFilePath, action string) ([]byte, erro return writeContent, nil } -func writeJSON(destFilePath string, writeContent []byte) error { +func writeJson(destFilePath string, writeContent []byte) error { if _, err := os.Stat(destFilePath); os.IsNotExist(err) { const perm = 0600 file, err := os.OpenFile(destFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, perm) @@ -145,13 +180,14 @@ func writeJSON(destFilePath string, writeContent []byte) error { return fmt.Errorf("close target file failed") } return nil + } else { + return fmt.Errorf("target file already existed") } - return fmt.Errorf("target file already existed") } func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]interface{}, error) { // existed... - daemon, err := loadOriginJSON(srcFilePath) + daemon, err := loadOriginJson(srcFilePath) if err != nil { return nil, err } @@ -190,7 +226,7 @@ func modifyDaemon(srcFilePath, runtimeFilePath, action string) (map[string]inter return daemon, nil } -func loadOriginJSON(srcFilePath string) (map[string]interface{}, error) { +func loadOriginJson(srcFilePath string) (map[string]interface{}, error) { if fileInfo, err := os.Stat(srcFilePath); err != nil { return nil, err } else if fileInfo.Size() > maxFileSize { diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go index 2643165..9418f7c 100644 --- a/mindxcheckutils/mindxcheckutils.go +++ b/mindxcheckutils/mindxcheckutils.go @@ -24,7 +24,11 @@ const ( // DefaultStringSize default string max length DefaultStringSize = 256 // DefaultPathSize default string max length - DefaultPathSize = 4096 + DefaultPathSize = 4096 + runLogDir = "/var/log/ascend-docker-runtime/" + backupLogFileMode os.FileMode = 0400 + runLogFileMode os.FileMode = 0750 + maxFileNum = 32 ) var logPrefix = "" @@ -206,3 +210,37 @@ func StringChecker(text string, minLength, maxLength int, whiteList string) bool } return true } + +// ChangeRuntimeLogMode change log mode +func ChangeRuntimeLogMode(runLog, operLog string) error { + runLogDirLen := len(runLogDir) + var logMode os.FileMode + counter := 0 + err := filepath.Walk(runLogDir, func(fileOrPath string, fileInfo os.FileInfo, err error) error { + counter += 1 + if counter > maxFileNum { + return fmt.Errorf("the counter file is over maxFileNum") + } + if err != nil { + fmt.Printf("prevent panic by handling failure accessing a path %q: %v\n", fileOrPath, err) + return err + } + hasLogPrefix := strings.HasPrefix(fileOrPath[runLogDirLen:], + runLog) || strings.HasPrefix(fileOrPath[runLogDirLen:], operLog) + if !hasLogPrefix { + return nil + } + logMode = backupLogFileMode + if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + return fmt.Errorf("the file or path is symlink") + } + if errChmod := os.Chmod(fileOrPath, logMode); errChmod != nil { + return fmt.Errorf("set file mode %s failed", fileOrPath) + } + return nil + }) + if err != nil { + return fmt.Errorf("traversal runLogDir failed") + } + return nil +} diff --git a/runtime/main.go b/runtime/main.go index c2fedd5..3dde37e 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -110,6 +110,10 @@ var execRunc = func() error { return err } + hwlog.OpLog.Infof("ascend docker runtime success, will start runc") + if err := mindxcheckutils.ChangeRuntimeLogMode("runtime-run-", "runtime-operate-"); err != nil { + return err + } if err = syscall.Exec(runcPath, append([]string{runcPath}, os.Args[1:]...), os.Environ()); err != nil { return fmt.Errorf("failed to exec runc: %v", err) } @@ -292,11 +296,19 @@ func main() { close(stopCh) log.Fatal(err) } + defer func() { + if err := mindxcheckutils.ChangeRuntimeLogMode("runtime-run-", "runtime-operate-"); err != nil { + fmt.Println("defer changeFileMode function failed") + } + }() hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) hwlog.RunLog.Infof("ascend docker runtime starting") + hwlog.OpLog.Infof("ascend docker runtime starting, try to setup container") if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { + hwlog.RunLog.Infof("ascend docker runtime failed") + hwlog.OpLog.Errorf("ascend docker runtime failed") close(stopCh) log.Fatal("command error") } -- Gitee From 1b1c720ef488148b6eeb1ac8754d61b9707509d8 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 9 Sep 2022 16:56:36 +0800 Subject: [PATCH 270/296] Match-id-b2b83a77afe8a357183c0d8b630fbfa1b93b38db --- hook/go.mod | 4 ++-- install/deb/src/go.mod | 4 ++-- runtime/go.mod | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index 57453b4..adfadad 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -5,14 +5,14 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.13 + huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 ) replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 diff --git a/install/deb/src/go.mod b/install/deb/src/go.mod index 2f5b9c4..6dbc5a2 100644 --- a/install/deb/src/go.mod +++ b/install/deb/src/go.mod @@ -3,14 +3,14 @@ module main go 1.16 require ( - huawei.com/npu-exporter v0.2.13 + huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 ) replace ( mindxcheckutils => ../../../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 diff --git a/runtime/go.mod b/runtime/go.mod index f923acc..b3dc9eb 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -5,14 +5,14 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 - huawei.com/npu-exporter v0.2.14 + huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 ) replace ( mindxcheckutils => ../mindxcheckutils huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/npu-exporter => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.13 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 -- Gitee From 7562447cafa80a1fdeb070295d3709b4430fe435 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 13 Sep 2022 16:25:06 +0800 Subject: [PATCH 271/296] Match-id-f60ea0393a38345cdbd5733d30c9782882bfd891 --- hook/go.mod | 8 ++----- hook/go.sum | 26 ++++++++++++++++++++++- hook/main.go | 27 +++++++++--------------- install/deb/src/go.mod | 12 ++++------- install/deb/src/go.sum | 25 ++++++++++++++++++++++ install/deb/src/main.go | 16 ++++++-------- runtime/go.mod | 23 ++++----------------- runtime/go.sum | 46 +++++++++++++++++++++++++++++++---------- runtime/main.go | 31 +++++++++++---------------- 9 files changed, 123 insertions(+), 91 deletions(-) create mode 100644 install/deb/src/go.sum diff --git a/hook/go.mod b/hook/go.mod index adfadad..38fc157 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -10,11 +10,7 @@ require ( ) replace ( - mindxcheckutils => ../mindxcheckutils - huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 - k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 - k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 - k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 - k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 + huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 + mindxcheckutils => ../mindxcheckutils ) diff --git a/hook/go.sum b/hook/go.sum index 9345f6a..af039e2 100644 --- a/hook/go.sum +++ b/hook/go.sum @@ -1,15 +1,39 @@ +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 h1:Dq2tZTuClykBv1tS6C2XU6hY/waVK0K5lyr/8tJcT/I= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3/go.mod h1:tuvVYh4aDcHqpiyNKZNiBgt1XBehJ130VubLidKWNjY= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 h1:nGlHkoj7L6DdSYFFLjceD6t5XrNAKrM+Gk3wT0iOfWE= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6/go.mod h1:gzaoiHwloaNTtm46GVe93KtXMcXVHJ8LBVqWEAjmh+0= +github.com/agiledragon/gomonkey/v2 v2.8.0 h1:u2K2nNGyk0ippzklz1CWalllEB9ptD+DtSXeCX5O000= +github.com/agiledragon/gomonkey/v2 v2.8.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hook/main.go b/hook/main.go index d77ddd7..4467329 100644 --- a/hook/main.go +++ b/hook/main.go @@ -6,6 +6,7 @@ package main import ( "bufio" + "context" "encoding/json" "fmt" "log" @@ -18,11 +19,10 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" - "go.uber.org/zap" "mindxcheckutils" - "huawei.com/npu-exporter/hwlog" + "huawei.com/mindx/common/hwlog" ) const ( @@ -61,7 +61,7 @@ type containerConfig struct { Env []string } -func initLogModule(stopCh <-chan struct{}) error { +func initLogModule(ctx context.Context) error { const backups = 2 const logMaxAge = 365 runLogConfig := hwlog.LogConfig{ @@ -71,7 +71,7 @@ func initLogModule(stopCh <-chan struct{}) error { MaxAge: logMaxAge, OnlyToFile: true, } - if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { + if err := hwlog.InitRunLogger(&runLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) return err } @@ -82,7 +82,7 @@ func initLogModule(stopCh <-chan struct{}) error { MaxAge: logMaxAge, OnlyToFile: true, } - if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { + if err := hwlog.InitOperateLogger(&operateLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) return err } @@ -432,14 +432,12 @@ func main() { }() log.SetPrefix(loggingPrefix) - stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) + ctx, _ := context.WithCancel(context.Background()) + if err := initLogModule(ctx); err != nil { log.Fatal(err) } logPrefixWords, err := mindxcheckutils.GetLogPrefix() if err != nil { - close(stopCh) log.Fatal(err) } defer func() { @@ -447,22 +445,17 @@ func main() { fmt.Println("defer changeFileMode function failed") } }() - hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.Infof("ascend docker hook starting, try to setup container") + hwlog.OpLog.Infof("%v ascend docker hook starting, try to setup container", logPrefixWords) hwlog.RunLog.Infof("ascend docker hook starting") if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { hwlog.RunLog.Errorf("ascend docker hook failed") - hwlog.OpLog.Errorf("ascend docker hook failed") - close(stopCh) + hwlog.OpLog.Errorf("%v ascend docker hook failed", logPrefixWords) log.Fatal("command error") } if err := doPrestartHook(); err != nil { hwlog.RunLog.Errorf("ascend docker hook failed") - hwlog.OpLog.Errorf("ascend docker hook failed") - close(stopCh) + hwlog.OpLog.Errorf("%v ascend docker hook failed", logPrefixWords) log.Fatal(fmt.Errorf("failed in runtime.doProcess ")) } - close(stopCh) } diff --git a/install/deb/src/go.mod b/install/deb/src/go.mod index 6dbc5a2..d5b1dd7 100644 --- a/install/deb/src/go.mod +++ b/install/deb/src/go.mod @@ -3,16 +3,12 @@ module main go 1.16 require ( - huawei.com/mindx/common/hwlog v0.0.0 + huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 ) replace ( - mindxcheckutils => ../../../mindxcheckutils - huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 - k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 - k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 - k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 - k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 -) \ No newline at end of file + huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 + mindxcheckutils => ../../../mindxcheckutils +) diff --git a/install/deb/src/go.sum b/install/deb/src/go.sum new file mode 100644 index 0000000..3e15b58 --- /dev/null +++ b/install/deb/src/go.sum @@ -0,0 +1,25 @@ +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 h1:Dq2tZTuClykBv1tS6C2XU6hY/waVK0K5lyr/8tJcT/I= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3/go.mod h1:tuvVYh4aDcHqpiyNKZNiBgt1XBehJ130VubLidKWNjY= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 h1:nGlHkoj7L6DdSYFFLjceD6t5XrNAKrM+Gk3wT0iOfWE= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6/go.mod h1:gzaoiHwloaNTtm46GVe93KtXMcXVHJ8LBVqWEAjmh+0= +github.com/agiledragon/gomonkey/v2 v2.8.0 h1:u2K2nNGyk0ippzklz1CWalllEB9ptD+DtSXeCX5O000= +github.com/agiledragon/gomonkey/v2 v2.8.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 7aaddfd..90ff7be 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -4,6 +4,7 @@ package main import ( + "context" "encoding/json" "flag" "fmt" @@ -13,7 +14,7 @@ import ( "path/filepath" "strings" - "huawei.com/npu-exporter/hwlog" + "huawei.com/mindx/common/hwlog" "mindxcheckutils" ) @@ -43,14 +44,12 @@ const ( ) func main() { - stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) + ctx, _ := context.WithCancel(context.Background()) + if err := initLogModule(ctx); err != nil { log.Fatal(err) } logPrefixWords, err := mindxcheckutils.GetLogPrefix() if err != nil { - close(stopCh) log.Fatal(err) } hwlog.OpLog.Infof("%v installer started", logPrefixWords) @@ -58,22 +57,19 @@ func main() { if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { hwlog.OpLog.Infof("%v run failed", logPrefixWords) - close(stopCh) log.Fatal("command error") } err = process() if err != nil { hwlog.OpLog.Infof("%v run %s failed", logPrefixWords, os.Args) - close(stopCh) log.Fatal(fmt.Errorf("error in installation")) } else { hwlog.OpLog.Infof("%v run %s success", logPrefixWords, os.Args) - close(stopCh) } } -func initLogModule(stopCh <-chan struct{}) error { +func initLogModule(ctx context.Context) error { const backups = 2 const logMaxAge = 365 logConfig := hwlog.LogConfig{ @@ -82,7 +78,7 @@ func initLogModule(stopCh <-chan struct{}) error { MaxBackups: backups, MaxAge: logMaxAge, } - if err := hwlog.InitOperateLogger(&logConfig, stopCh); err != nil { + if err := hwlog.InitOperateLogger(&logConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) return err } diff --git a/runtime/go.mod b/runtime/go.mod index b3dc9eb..bb1ddad 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -5,29 +5,14 @@ go 1.16 require ( github.com/opencontainers/runtime-spec v1.0.2 github.com/prashantv/gostub v1.1.0 + github.com/stretchr/testify v1.8.0 // indirect huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 ) replace ( - mindxcheckutils => ../mindxcheckutils - huawei.com/kmc => codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 - huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 - k8s.io/api v0.0.0 => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/api v1.19.4-h4 - k8s.io/apimachinery => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/apimachinery v1.19.4-h4 - k8s.io/client-go => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/client-go v1.19.4-h4 - k8s.io/cri-api => codehub-dg-y.huawei.com/OpenSourceCenter/kubernetes.git/staging/src/k8s.io/cri-api v1.19.4-h4 - github.com/agiledragon/gomonkey/v2 => github.com/agiledragon/gomonkey/v2 v2.2.0 - github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.5.1 - github.com/golang/protobuf => github.com/golang/protobuf v1.5.1 - github.com/patrickmn/go-cache => github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible - github.com/pkg/errors => github.com/pkg/errors v0.9.1 github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a - github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.11.1 - github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v1.6.4 - github.com/stretchr/testify => github.com/stretchr/testify v1.7.0 - go.uber.org/zap => go.uber.org/zap v1.16.0 - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b - google.golang.org/grpc => google.golang.org/grpc v1.28.0 - gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 + huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 + mindxcheckutils => ../mindxcheckutils ) diff --git a/runtime/go.sum b/runtime/go.sum index deb268c..7e0fec5 100644 --- a/runtime/go.sum +++ b/runtime/go.sum @@ -1,19 +1,43 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 h1:Dq2tZTuClykBv1tS6C2XU6hY/waVK0K5lyr/8tJcT/I= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3/go.mod h1:tuvVYh4aDcHqpiyNKZNiBgt1XBehJ130VubLidKWNjY= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 h1:nGlHkoj7L6DdSYFFLjceD6t5XrNAKrM+Gk3wT0iOfWE= +codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6/go.mod h1:gzaoiHwloaNTtm46GVe93KtXMcXVHJ8LBVqWEAjmh+0= +github.com/agiledragon/gomonkey/v2 v2.8.0 h1:u2K2nNGyk0ippzklz1CWalllEB9ptD+DtSXeCX5O000= +github.com/agiledragon/gomonkey/v2 v2.8.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a h1:tkiehFUSAXqIwMzuwKutcjSIZhpc3OKax/c9oKDz5mY= +github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a/go.mod h1:dP1v6T1QzyGJJKFocwAU0lSZKpfjstjH8TlhkEU0on0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7 h1:yKnqOCGmdknfWhfDBqSKYWuioQzdiXz7VeKh56EGhjw= -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/npu-exporter.git v0.2.7/go.mod h1:sUdarWqC4+C7fr0rpGUNvx1n1JixILyKOlS1gDfpi/w= -codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6 h1:QO4JTYr7hsyjd8VeE9ARivO3iIes/1GS6DkLiS5w3Xo= -codehub-dg-y.huawei.com/it-edge-native/edge-native-core/coastguard.git v1.0.6/go.mod h1:mbUvvh/0ox+lNtLoraCsf+NMpTCL2h4L/NtfboraaH4= \ No newline at end of file +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/runtime/main.go b/runtime/main.go index 3dde37e..5a57a3d 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -5,6 +5,7 @@ package main import ( + "context" "encoding/json" "fmt" "io/ioutil" @@ -18,9 +19,8 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" - "go.uber.org/zap" - "huawei.com/npu-exporter/hwlog" + "huawei.com/mindx/common/hwlog" "mindxcheckutils" ) @@ -66,7 +66,7 @@ func getArgs() (*args, error) { return args, nil } -func initLogModule(stopCh <-chan struct{}) error { +func initLogModule(ctx context.Context) error { const backups = 2 const logMaxAge = 365 runLogConfig := hwlog.LogConfig{ @@ -76,7 +76,7 @@ func initLogModule(stopCh <-chan struct{}) error { MaxAge: logMaxAge, OnlyToFile: true, } - if err := hwlog.InitRunLogger(&runLogConfig, stopCh); err != nil { + if err := hwlog.InitRunLogger(&runLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) return err } @@ -87,7 +87,7 @@ func initLogModule(stopCh <-chan struct{}) error { MaxAge: logMaxAge, OnlyToFile: true, } - if err := hwlog.InitOperateLogger(&operateLogConfig, stopCh); err != nil { + if err := hwlog.InitOperateLogger(&operateLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) return err } @@ -286,14 +286,12 @@ func main() { log.Fatal(err) } }() - stopCh := make(chan struct{}) - if err := initLogModule(stopCh); err != nil { - close(stopCh) + ctx, _ := context.WithCancel(context.Background()) + if err := initLogModule(ctx); err != nil { log.Fatal(err) } logPrefixWords, err := mindxcheckutils.GetLogPrefix() if err != nil { - close(stopCh) log.Fatal(err) } defer func() { @@ -301,27 +299,22 @@ func main() { fmt.Println("defer changeFileMode function failed") } }() - hwlog.RunLog.ZapLogger = hwlog.RunLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) - hwlog.OpLog.ZapLogger = hwlog.OpLog.ZapLogger.With(zap.String("user-info", logPrefixWords)) hwlog.RunLog.Infof("ascend docker runtime starting") - hwlog.OpLog.Infof("ascend docker runtime starting, try to setup container") + hwlog.OpLog.Infof("%v ascend docker runtime starting, try to setup container", logPrefixWords) if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { - hwlog.RunLog.Infof("ascend docker runtime failed") - hwlog.OpLog.Errorf("ascend docker runtime failed") - close(stopCh) + hwlog.RunLog.Infof("%v ascend docker runtime failed", logPrefixWords) + hwlog.OpLog.Errorf("%v ascend docker runtime failed", logPrefixWords) log.Fatal("command error") } - logWords := fmt.Sprintf("running %v", os.Args) + logWords := fmt.Sprintf("%v running %v", logPrefixWords, os.Args) if len(logWords) > maxLogLength { logWords = logWords[0:maxLogLength-1] + "..." } hwlog.OpLog.Infof(logWords) if err := doProcess(); err != nil { hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v failed", logWords) - close(stopCh) + hwlog.OpLog.Errorf("%v %v failed", logPrefixWords, logWords) log.Fatal(err) } - close(stopCh) } -- Gitee From 2ddcf4b0fece5d158464ecefd3f0932f7185a671 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 22 Sep 2022 09:59:46 +0800 Subject: [PATCH 272/296] Match-id-855bca2b8a0bfb1466b848478f35654bcd2c1a63 --- cli/test/dt/testcase/gtest_mytest.cpp | 57 ++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 320b515..3d6ebb2 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -1022,8 +1022,8 @@ TEST_F(Test_Fhho, CheckRootDir) TEST_F(Test_Fhho, StatusTwoProcess) { // Test the correct options - int argc = 7; - const char *argvData[7] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; + const int argc = 7; + const char *argvData[argc] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", "/home"}; int ret = Process(argc,const_cast(argvData)); EXPECT_EQ(-1, ret); } @@ -1031,16 +1031,49 @@ TEST_F(Test_Fhho, StatusTwoProcess) TEST_F(Test_Fhho, StatusThreeProcess) { // Test error options - int argc = 7; - const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + const int argc = 7; + const char *argvData[argc] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; int ret = Process(argc, const_cast(argvData)); EXPECT_EQ(-1, ret); } TEST_F(Test_Fhho, StatusFourProcess) { - int argc = 7; - const char *argvData[7] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + const int argc = 7; + const char *argvData[argc] = {"ascend-docker-cli", "--evices", "1,2", "--idd", "123", "--ootfs", "/home"}; + MOCKER(SetupContainer).stubs().will(invoke(Stub_SetupContainer_Success)); + int ret = Process(argc,const_cast(argvData)); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusFiveProcess) +{ + const int argc = 13; + const char *argvData[argc] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", + "/home", "--options", "base", "--mount-file", "a.list", "--mount-dir", "/home/code"}; + MOCKER(SetupContainer).stubs().will(invoke(Stub_SetupContainer_Success)); + int ret = Process(argc,const_cast(argvData)); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusSixProcess) +{ + const int argc = 13; + const char *argvData[argc] = {"ascend-docker-cli", "--devices", "1,2", "--pid", "123", "--rootfs", + "/home", "--opt", "base", "--mount-f", "a.list", "--mount-dir", "/root/sxv"}; + MOCKER(SetupContainer).stubs().will(invoke(Stub_SetupContainer_Success)); + int ret = Process(argc,const_cast(argvData)); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusSevenProcess) +{ + const int argc = 13; + const char *argvData[argc] = {"ascend-docker-cli", "--ops", "--devices", "1,2", "--pid", "123", + "--rootfs", "/home", "base", "--mounle", "a.list", "--mount-dir", "/home/code"}; MOCKER(SetupContainer).stubs().will(invoke(Stub_SetupContainer_Success)); int ret = Process(argc,const_cast(argvData)); GlobalMockObject::verify(); @@ -1131,4 +1164,16 @@ TEST_F(Test_Fhho, StatusFiveDoPrepare) int ret = DoPrepare(&args, &config); GlobalMockObject::verify(); EXPECT_EQ(-1, ret); +} + +TEST_F(Test_Fhho, StatusSixDoPrepare) +{ + MOCKER(GetCgroupPath).stubs().will(invoke(Stub_GetCgroupPath_Success)); + MOCKER(open).stubs().will(invoke(stub_open_failed)); + + struct ParsedConfig config; + config.devicesNr = 1024; + int ret = DoPrepare(NULL, &config); + GlobalMockObject::verify(); + EXPECT_EQ(-1, ret); } \ No newline at end of file -- Gitee From 26f50ffdbf70f83c8bc6d2348fdaddb2ba8c74af Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 22 Sep 2022 20:54:03 +0800 Subject: [PATCH 273/296] Match-id-1c5eeb8dd8fc78b849c71029695ab7e126b8273c --- build/conf/ascend-docker-plugin.yaml | 1 + build/scripts/base.list_A200ISoC | 3 +++ build/scripts/help.info | 3 +-- build/scripts/run_main.sh | 21 ++++++++------------- 4 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 build/scripts/base.list_A200ISoC diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index 6ed0692..ae2469b 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -82,6 +82,7 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A500" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200ISoC" - "{{ systemEnv.workspace }}/ascend-docker-plugin/assets" - "{{ systemEnv.workspace }}/ascend-docker-plugin/README.md" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/run_main.sh" diff --git a/build/scripts/base.list_A200ISoC b/build/scripts/base.list_A200ISoC new file mode 100644 index 0000000..7befba7 --- /dev/null +++ b/build/scripts/base.list_A200ISoC @@ -0,0 +1,3 @@ +/usr/local/bin/npu-smi +/etc/hdcBasic.cfg +/etc/sys_version.conf \ No newline at end of file diff --git a/build/scripts/help.info b/build/scripts/help.info index 0d8bae1..f1703ef 100644 --- a/build/scripts/help.info +++ b/build/scripts/help.info @@ -2,5 +2,4 @@ --install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime) --uninstall Uninstall the installed ascend-docker-runtime tool --upgrade Upgrade the installed ascend-docker-runtime tool - --devel Install as devel mode - --install-type= A500 and A200 need to specify the installation type of Ascend-mindx-toolbox (eg: --install-type=A500) \ No newline at end of file + --install-type= A500, A200ISoC and A200 need to specify the installation type of Ascend-mindx-toolbox (eg: --install-type=A500) \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 417ca0b..f7551b2 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -52,6 +52,8 @@ function install() cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list elif [ "${a200}" == "y" ]; then cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "${a200isoc}" == "y" ]; then + cp -f ./base.list_A200ISoC ${ASCEND_RUNTIME_CONFIG_DIR}/base.list else cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list fi @@ -134,9 +136,9 @@ INSTALL_FLAG=n INSTALL_PATH_FLAG=n UNINSTALL_FLAG=n UPGRADE_FLAG=n -DEVEL_FLAG=n a500=n a200=n +a200isoc=n while true do @@ -175,16 +177,8 @@ do UPGRADE_FLAG=y shift ;; - --devel) - if [ "${DEVEL_FLAG}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - DEVEL_FLAG=y - shift - ;; --install-type=*) - if [ "${a500}" == "y" ] || [ "${a200}" == "y" ]; then + if [ "${a500}" == "y" ] || [ "${a200}" == "y" ] || [ "${a200isoc}" == "y" ]; then echo "warning :Repeat parameter!" exit 1 fi @@ -193,6 +187,8 @@ do a500=y elif [ "$3" == "--install-type=A200" ]; then a200=y + elif [ "$3" == "--install-type=A200ISoC" ]; then + a200isoc=y else echo "error :Please check the parameter of --install-type=" exit 1 @@ -219,8 +215,7 @@ fi if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ [ "${INSTALL_FLAG}" == "n" ] && \ [ "${UNINSTALL_FLAG}" == "n" ] && \ - [ "${UPGRADE_FLAG}" == "n" ] && \ - [ "${DEVEL_FLAG}" == "n" ]; then + [ "${UPGRADE_FLAG}" == "n" ]; then echo "Error:only input command. When use --install-path you also need intput --install or --uninstall or --upgrade or --devel" exit 1 fi @@ -231,7 +226,7 @@ if [ "${UID}" != "0" ]; then exit 1 fi -if [ "${INSTALL_FLAG}" == "y" ] || [ "${DEVEL_FLAG}" == "y" ]; then +if [ "${INSTALL_FLAG}" == "y" ]; then install exit 0 fi -- Gitee From 7055fdc728ffb81312dc0204c7049115757e8724 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 29 Sep 2022 11:15:20 +0800 Subject: [PATCH 274/296] Match-id-0ba59c2557ec169b45587229f04dc191c1750545 --- hook/go.mod | 2 +- runtime/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hook/go.mod b/hook/go.mod index 38fc157..9f6c644 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -3,7 +3,7 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.2 + github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b github.com/prashantv/gostub v1.1.0 huawei.com/mindx/common/hwlog v0.0.0 mindxcheckutils v1.0.0 diff --git a/runtime/go.mod b/runtime/go.mod index bb1ddad..d05bf10 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -3,7 +3,7 @@ module main go 1.16 require ( - github.com/opencontainers/runtime-spec v1.0.2 + github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b github.com/prashantv/gostub v1.1.0 github.com/stretchr/testify v1.8.0 // indirect huawei.com/mindx/common/hwlog v0.0.0 -- Gitee From 1ec83666d9dbf652bd4255eb7bf5775664f3cee6 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 30 Sep 2022 09:50:16 +0800 Subject: [PATCH 275/296] Match-id-f31a2e2817c5ce32c6f50e17c656b45161e6a933 --- build/conf/ascend-docker-plugin.yaml | 13 +- build/scripts/run_main.sh | 242 --------------------------- 2 files changed, 3 insertions(+), 252 deletions(-) delete mode 100644 build/scripts/run_main.sh diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index ae2469b..a954b90 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -66,7 +66,7 @@ package: service: Ascend-docker-runtime MindXSDK: b050 packageInfo: - - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.run" + - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.zip" input: files: include: @@ -85,24 +85,17 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200ISoC" - "{{ systemEnv.workspace }}/ascend-docker-plugin/assets" - "{{ systemEnv.workspace }}/ascend-docker-plugin/README.md" - - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/run_main.sh" des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/" - - copy: - src: - - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh" - - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh" - des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/" - commands: - - command: "chmod 550 {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" + - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg && zip -r Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.zip ./*" process: type: run srcRoot: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/" - parameters: [ makeself, help.info, "{{systemEnv.DATE }}"] output: files: include: - move: - src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/*.run"] + src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/*.zip"] des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output" diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh deleted file mode 100644 index f7551b2..0000000 --- a/build/scripts/run_main.sh +++ /dev/null @@ -1,242 +0,0 @@ -#!/bin/bash -# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -# Description: ascend-docker-runtime run包脚本文件 -set -e - -ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d -DOCKER_CONFIG_DIR=/etc/docker -INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime - -function install() -{ - echo 'installing ascend docker runtime' - - if [ ! -d "${INSTALL_PATH}" ]; then - mkdir -p ${INSTALL_PATH} - fi - if [ -L "${INSTALL_PATH}" ]; then - echo "error: ${INSTALL_PATH} is symbolic link." - exit 1 - fi - cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime - cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook - cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli - cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper - cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy - chmod 550 ${INSTALL_PATH}/ascend-docker-runtime - chmod 550 ${INSTALL_PATH}/ascend-docker-hook - chmod 550 ${INSTALL_PATH}/ascend-docker-cli - chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper - chmod 550 ${INSTALL_PATH}/ascend-docker-destroy - - if [ -L "${INSTALL_PATH}/script" ]; then - echo "error: ${INSTALL_PATH}/script is symbolic link." - exit 1 - fi - cp -rf ./assets ${INSTALL_PATH}/assets - cp -f ./README.md ${INSTALL_PATH}/README.md - mkdir -p ${INSTALL_PATH}/script - cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh - chmod 500 ${INSTALL_PATH}/script/uninstall.sh - - if [ -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then - rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} - fi - if [ -L "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then - echo "error: ${ASCEND_RUNTIME_CONFIG_DIR} is symbolic link." - exit 1 - fi - mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} - chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} - if [ "${a500}" == "y" ]; then - cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - elif [ "${a200}" == "y" ]; then - cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - elif [ "${a200isoc}" == "y" ]; then - cp -f ./base.list_A200ISoC ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - else - cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - fi - chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - - echo 'install executable files success' - - if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then - mkdir -p ${DOCKER_CONFIG_DIR} - fi - - SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" - DST="${DOCKER_CONFIG_DIR}/daemon.json" - ./ascend-docker-plugin-install-helper add ${DST} ${SRC} ${INSTALL_PATH}/ascend-docker-runtime - if [ "$?" != "0" ]; then - echo 'create damon.json failed' - exit 1 - fi - - mv ${SRC} ${DST} - chmod 600 ${DST} - echo 'create damom.json success' - echo 'please reboot docker daemon to take effect' -} - -function uninstall() -{ - echo 'uninstalling ascend docker runtime' - - if [ ! -d "${INSTALL_PATH}" ]; then - echo 'WARNING: the specified install path does not exist, skipping' - exit 0 - fi - - ${INSTALL_PATH}/script/uninstall.sh - echo 'remove daemon.json setting success' - - [ -n "${INSTALL_PATH}" ] && rm -rf ${INSTALL_PATH} - echo 'remove executable files success' - - echo 'del damom.json success' -} - -function upgrade() -{ - echo 'upgrading ascend docker runtime' - - if [ ! -d "${INSTALL_PATH}" ]; then - echo 'ERROR: the specified install path does not exist, stopping upgrading' - exit 1 - fi - - if [ ! -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then - echo 'ERROR: the configuration directory does not exist' - exit 1 - fi - if [ -L "${INSTALL_PATH}" ]; then - echo "error: ${INSTALL_PATH} is symbolic link." - exit 1 - fi - cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime - cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook - cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli - cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper - cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy - cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh - cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - chmod 550 ${INSTALL_PATH}/ascend-docker-runtime - chmod 550 ${INSTALL_PATH}/ascend-docker-hook - chmod 550 ${INSTALL_PATH}/ascend-docker-cli - chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper - chmod 550 ${INSTALL_PATH}/ascend-docker-destroy - chmod 500 ${INSTALL_PATH}/script/uninstall.sh - chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - - echo 'upgrade ascend docker runtime success' -} - -INSTALL_FLAG=n -INSTALL_PATH_FLAG=n -UNINSTALL_FLAG=n -UPGRADE_FLAG=n -a500=n -a200=n -a200isoc=n - -while true -do - case "$3" in - --install) - if [ "${INSTALL_FLAG}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - INSTALL_FLAG=y - shift - ;; - --uninstall) - if [ "${UNINSTALL_FLAG}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - UNINSTALL_FLAG=y - shift - ;; - --install-path=*) - if [ "${INSTALL_PATH_FLAG}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - INSTALL_PATH_FLAG=y - INSTALL_PATH=$(echo $3 | cut -d"=" -f2) - INSTALL_PATH=$(echo ${INSTALL_PATH} | sed "s/\/*$//g") - shift - ;; - --upgrade) - if [ "${UPGRADE_FLAG}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - UPGRADE_FLAG=y - shift - ;; - --install-type=*) - if [ "${a500}" == "y" ] || [ "${a200}" == "y" ] || [ "${a200isoc}" == "y" ]; then - echo "warning :Repeat parameter!" - exit 1 - fi - # 去除指定安装目录后所有的 "/" - if [ "$3" == "--install-type=A500" ]; then - a500=y - elif [ "$3" == "--install-type=A200" ]; then - a200=y - elif [ "$3" == "--install-type=A200ISoC" ]; then - a200isoc=y - else - echo "error :Please check the parameter of --install-type=" - exit 1 - fi - shift - ;; - *) - if [ "x$3" != "x" ]; then - echo "warning :Unsupported parameters: $3" - exit 1 - fi - break - ;; - esac -done - -# 安装为相对路径时报错 -if [ "${INSTALL_PATH}" == ".." ] || [ "${INSTALL_PATH}" == "." ]; then - echo "error :Please follow the installation address after the --install-path=" - exit 1 -fi - -# 单纯只有--install-path的判定处理 -if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ - [ "${INSTALL_FLAG}" == "n" ] && \ - [ "${UNINSTALL_FLAG}" == "n" ] && \ - [ "${UPGRADE_FLAG}" == "n" ]; then - echo "Error:only input command. When use --install-path you also need intput --install or --uninstall or --upgrade or --devel" - exit 1 -fi - -# 需root用户权限 -if [ "${UID}" != "0" ]; then - echo 'please run with root permission' - exit 1 -fi - -if [ "${INSTALL_FLAG}" == "y" ]; then - install - exit 0 -fi - -if [ "${UNINSTALL_FLAG}" == "y" ]; then - uninstall - exit 0 -fi - -if [ "${UPGRADE_FLAG}" == "y" ]; then - upgrade - exit 0 -fi -- Gitee From 98ceb1b029d5a902a6f634b018f70e08ad079dff Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 7 Oct 2022 14:11:24 +0800 Subject: [PATCH 276/296] Match-id-b00888d3f2b083a9f3f9a4d86adae13c41458c48 --- build/conf/ascend-docker-plugin.yaml | 1 - build/scripts/uninstall.sh | 36 ---------------------------- 2 files changed, 37 deletions(-) delete mode 100644 build/scripts/uninstall.sh diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index a954b90..d4061d2 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -78,7 +78,6 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker*" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build/ascend-docker*" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/destroy/build/ascend-docker*" - - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/uninstall.sh" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A500" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200" diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh deleted file mode 100644 index 2cb5b28..0000000 --- a/build/scripts/uninstall.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -# Description: ascend-docker-runtime 卸载脚本 -set -e -LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" -echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" -echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} -ROOT=$(cd $(dirname $0); pwd)/.. -DST='/etc/docker/daemon.json' -SRC="${DST}.${PPID}" -ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d - -if [ ! -f "${DST}" ]; then - exit 0 -fi - -${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} -if [ "$?" != "0" ]; then - echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" - echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} - exit 1 -fi - -mv ${SRC} ${DST} - -[ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} -INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) - -if test -d ${INSTALL_ROOT_PATH} -then - rm -rf ${INSTALL_ROOT_PATH} - echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" - echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" >>${LOG_FILE} -fi -echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" -echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" >>${LOG_FILE} \ No newline at end of file -- Gitee From 58f4a1776d422f4d44fa9dd9d9d744df0458b9c2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 9 Oct 2022 17:54:51 +0800 Subject: [PATCH 277/296] Match-id-6bcf6df615b8b9224fb86abcc22e046dc910403a --- README.md | 149 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 104 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 1911e14..0bd205b 100644 --- a/README.md +++ b/README.md @@ -25,20 +25,6 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 2.在Host上配置该容器的device cgroup,确保该容器只可以使用指定的NPU,保证设备的隔离。 3.将Host上的CANN Runtime Library挂载到容器的namespace。 -# 发行说明 -## Ascend-Docker-Runtime2.0 -### 更新说明 - - 容器内设备序号保持不变 - - 添加NODRV选项不挂载驱动目录 - - 适配驱动--run安装模式 - - 适配训练驱动npu-smi位置从sbin移动到bin - - 挂载列表可配置 - - 适配海思驱动移除add-ons目录修改 - - 跳过不存在的挂载项 - -### 约束 - - Ascend-Docker-Runtime暂不支持Atlas 200 AI加速模块(RC场景)和Atlas 500智能小站 - # 下载和安装 ## 安装前准备 @@ -46,40 +32,102 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 - 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373) 的“准备硬件环境”章节。 - - - ## 下载 ### run包 -开发人员可从昇腾社区下载Toolbox,下载链接为:https://www.hiascend.com/software/mindx-dl, -下载后安装Toolbox,Ascend-docker-runtime,已集成至实用工具包toolbox中。 +开发人员可从昇腾社区下载Toolbox,下载链接为:https://www.hiascend.com/software/mindx-dl/community, +下载后安装Toolbox,Ascend-docker-runtime已集成至实用工具包toolbox中。 # 功能 -## 默认挂载目录 -| 挂载项 | 备注 | -|:-----------:| :-------------:| -|/dev/davinciX|NPU设备,X是物理ID号例如davinci0| -|/dev/davinci_manager |管理设备| -| /dev/devmm_svm| 管理设备| -|/dev/hisi_hdc | 管理设备| -|/usr/local/Ascend/driver/{lib64, include, tools} |驱动目录| - |/usr/local/dcmi | DCMI目录| -|/usr/local/bin/npu-smi | npu-smi工具| +## 默认挂载内容 +### Atlas 200 AI加速模块 RC场景 +| 挂载项 | 备注 | +|:------------------------------:|:-----------------------:| +| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | +| /dev/davinci_manager | 管理设备 | +| /usr/local/Ascend/driver/tools | 目录,驱动提供的工具包 | +| /usr/local/Ascend/driver/lib64 | 目录,驱动提供的用户态库 | +| /usr/local/sbin/npu-smi | 文件,npu-smi工具 | +| /etc/hdcBasic.cfg | 文件,hdc基础文件 | +| /etc/sys_version.conf | 文件,驱动的版本信息 | + + +### Atlas 200I SoC A1核心板 +| 挂载项 | 备注 | +|:------------------------------------------------:|:-------------------------:| +| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | +| /dev/davinci_manager | 管理设备 | +| /usr/local/bin/npu-smi | 文件,npu-smi工具 | +| /etc/hdcBasic.cfg | 文件,hdc基础文件 | +| /etc/sys_version.conf | 文件,驱动的版本信息 | + +### Atlas 500 智能小站 +| 挂载项 | 备注 | +|:-----------------------------:|:-----------------------:| +| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | +| /dev/davinci_manager | 管理设备 | +| /dev/hisi_hdc | 管理设备 | +| /dev/devmm_svm | 管理设备 | +| /home/data/miniD/driver/lib64 | 目录,驱动提供的用户态库 | +| /usr/local/dcmi | 目录,DCMI头文件和库 | +| /usr/local/bin/npu-smi | 文件,npu-smi工具 | + +### 其他设备 +| 挂载项 | 备注 | +|:---------------------------------:|:-----------------------:| +| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | +| /dev/davinci_manager | 管理设备 | +| /dev/hisi_hdc | 管理设备 | +| /dev/devmm_svm | 管理设备 | +| /home/data/miniD/driver/lib64 | 目录,驱动提供的用户态库 | +| /usr/local/Ascend/driver/include | 目录,驱动提供的头文件 | +| /usr/local/dcmi | 目录,DCMI头文件和库 | +| /usr/local/bin/npu-smi | 文件,npu-smi工具 | ## Ascend-Docker-runtime安装 -单独安装 -``` -chmod +x Ascend-cann-toolbox*.run -./Ascend-cann-toolbox*.run --install --whitelist=docker-runtime +### 单独安装 +```shell +chmod +x Ascend-mindx-toolbox_{version}_linux-{arch}.run +./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --whitelist=docker-runtime systemctl daemon-reload systenctl restart docker ``` -集成工具toolboox安装 -``` -chmod +x Ascend-cann-toolbox*.run -./Ascend-cann-toolbox*.run --install +### 或者 集成工具toolboox安装 +```shell +chmod +x Ascend-mindx-toolbox_{version}_linux-{arch}.run +./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install systemctl daemon-reload systemctl restart docker ``` +### 说明 +``` +· Atlas 200 AI加速模块(RC场景)、Atlas 200I SoC A1核心板和Atlas 500 智能小站支持Ascend-Docker-Runtime工具 + + 安装时需指定--install-type=用于设置Ascend-Docker-Runtime的默认挂载: + + Atlas 200 AI加速模块(RC场景)安装时执行如下命令: + + ./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --install-type=A200 + + Atlas 200I SoC A1核心板安装时执行如下命令: + + ./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --install-type=A200ISoC + + Atlas 500 智能小站安装时执行如下命令: + + ./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --whitelist=docker-runtime --install-type=A500 + +· 如果以root用户安装,建议不要安装在非root用户目录下,否则存在被非root用户替换root用户文件以达到提权目的的安全风险。 + +· 如果用户指定路径安装时,请确认指定路径符合所在组织的安全要求。 + +· 如果用户未指定安装路径,则软件会安装到默认路径下,默认安装路径如下: + + root用户:“/usr/local/Ascend” + + 非root用户:“${HOME}/Ascend” + + 其中${HOME}为当前用户目录。 +``` + 安装docker-runtime后会修改配置文件/etc/docker/daemon.json ![image](assets/20210329103157123.png) @@ -87,15 +135,16 @@ systemctl restart docker 同时自动生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list ![image](assets/20210329103157125.png) + ## 挂载单芯片 例子: -``` +```shell docker run -it -e ASCEND_VISIBLE_DEVICES=0 imageId /bin/bash ``` imageId 替换为实际镜像名或者ID 检查挂载成功: -``` +```shell ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin ``` ![image](assets/20210329103157126.png) @@ -103,7 +152,7 @@ ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc & ASCEND_VISIBLE_DEVICES=0,参数0替换为要挂载的芯片物理ID ## 挂载多芯片 例子: -``` +```shell docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-3 imageId /bin/bash 或者 docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0,1,2,3 imageId /bin/bash @@ -111,10 +160,20 @@ docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0,1,2,3 imageId /bin/bash docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-2,3 imageId /bin/bash ``` 检查挂载成功: -``` +```shell ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin ``` ![image](assets/20210329103157128.png) +## 挂载虚拟芯片 +```shell +docker run -it -e ASCEND_VISIBLE_DEVICES=100 -e ASCEND_RUNTIME_OPTIONS=VIRTUAL imageId /bin/bash +``` +该命令会挂载虚拟芯片ID为100的芯片 +## 切分AI Core +```shell +docker run -it --rm -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_VNPU_SPECS=vir04 imageId /bin/bash +``` +该命令表示,启动容器时,从物理芯片ID为0的芯片上,切分出4个AI Core作为虚拟设备并挂载至容器中。 ## 在默认的挂载的基础上新增挂载内容 ``` 在/etc/ascend-docker-runtime.d目录下新建挂载文件xxx.list,内容格式例子: @@ -136,8 +195,8 @@ xxx是新增挂载内容文件名,文件名必须是小写 ## 卸载 集成工具toolboox卸载 -``` -./Ascend-cann-toolbox*.run --uninstall +```shell +./Ascend-mindx-toolbox_{version}_linux-{arch}.run --uninstall ``` 卸载docker-runtime后会自动删除安装时配置文件/etc/docker/daemon.json中新增的内 @@ -147,7 +206,7 @@ xxx是新增挂载内容文件名,文件名必须是小写 ## 升级 集成工具toolboox安装方式升级 -``` -./Ascend-cann-toolbox*.run --upgrade +```shell +./Ascend-mindx-toolbox_{version}_linux-{arch}.run --upgrade ``` -- Gitee From f41941ee5a36a9dbe0c7e5b25d7b35e51b09f14e Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 12 Oct 2022 20:30:41 +0800 Subject: [PATCH 278/296] Match-id-82544eda218c1088bfd0b9d0597377b0bb6a031d --- cli/src/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/utils.c b/cli/src/utils.c index 57e45db..8db402f 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -17,6 +17,8 @@ #include "securec.h" #include "logger.h" +#define LOG_LENGTH 1024 + static bool g_checkWgroup = true; char *FormatLogMessage(char *format, ...) @@ -29,7 +31,7 @@ char *FormatLogMessage(char *format, ...) va_list list; // 获取格式化后字符串的长度 va_start(list, format); - char buff[1024] = {0}; + char buff[LOG_LENGTH] = {0}; int ret = vsnprintf_s(buff, sizeof(buff), sizeof(buff) - 1, format, list); va_end(list); if (ret <= 0) { -- Gitee From 16ce58828fe5c4bc33a9a2bdaf8a8a8840a3d380 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 18 Oct 2022 14:49:09 +0800 Subject: [PATCH 279/296] Match-id-f15d1775adb3b1051897dcc8b871cd75a782e386 --- build/build.sh | 38 +++++++++++++++----------------------- build/scripts/help.info | 5 ----- 2 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 build/scripts/help.info diff --git a/build/build.sh b/build/build.sh index e75f569..cfb5e65 100644 --- a/build/build.sh +++ b/build/build.sh @@ -73,12 +73,12 @@ function build_bin() export CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -fPIC -ftrapv" export CGO_LDFLAGS="-Wl,-z,now -Wl,-s,--build-id=none -pie" mkdir -p ${BUILD}/build/helper/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} -o ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath -o ${BUILD}/build/helper/build/ascend-docker-plugin-install-helper ${INSTALLHELPERSRCDIR}/${INSTALLHELPERSRCNAME} echo "make hook" [ -d "${HOOKSRCDIR}/build" ] && rm -rf ${HOOKSRCDIR}/build mkdir ${HOOKSRCDIR}/build && cd ${HOOKSRCDIR}/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${HOOKSRCNAME} -o ascend-docker-hook + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath -o ascend-docker-hook ../${HOOKSRCNAME} echo `pwd` ls @@ -86,34 +86,26 @@ function build_bin() cd ${RUNTIMEDIR} [ -d "${RUNTIMESRCDIR}/build" ] && rm -rf ${RUNTIMESRCDIR}/build mkdir ${RUNTIMESRCDIR}/build&&cd ${RUNTIMESRCDIR}/build - go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath ../${RUNTIMESRCNAME} -o ascend-docker-runtime + go build -buildmode=pie -ldflags='-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s' -trimpath -o ascend-docker-runtime ../${RUNTIMESRCNAME} } -function build_run_package() +function copy_file_output() { cd ${BUILD} - mkdir run_pkg - - /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli,${BUILD}/build/destroy}/build/ascend-docker* run_pkg - /bin/cp -f scripts/uninstall.sh run_pkg - /bin/cp -f scripts/base.list run_pkg - /bin/cp -f scripts/base.list_A500 run_pkg - /bin/cp -f scripts/base.list_A200 run_pkg - FILECNT=$(ls -l run_pkg |grep "^-"|wc -l) + mkdir -p ${OUTPUT} + + /bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli,${BUILD}/build/destroy}/build/ascend-docker* ${OUTPUT} + /bin/cp -f scripts/base.list ${OUTPUT} + /bin/cp -f scripts/base.list_A500 ${OUTPUT} + /bin/cp -f scripts/base.list_A200 ${OUTPUT} + /bin/cp -f scripts/base.list_A200ISoC ${OUTPUT} + FILECNT=$(ls -l ${OUTPUT} |grep "^-"|wc -l) echo "prepare package $FILECNT bins" if [ $FILECNT -ne 9 ]; then exit 1 fi - /bin/cp -rf ${ROOT}/assets run_pkg - /bin/cp -f ${ROOT}/README.md run_pkg - /bin/cp -f scripts/run_main.sh run_pkg - chmod 550 run_pkg/run_main.sh - - RUN_PKG_NAME="${PACKAGENAME}-${VERSION}-${CPUARCH}.run" - DATE=$(date -u "+%Y-%m-%d") - bash ${OPENSRC}/makeself-release-2.4.2/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ - --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh - mv ${RUN_PKG_NAME} ${OUTPUT} + /bin/cp -rf ${ROOT}/assets ${OUTPUT} + /bin/cp -f ${ROOT}/README.md ${OUTPUT} } function clean() @@ -123,4 +115,4 @@ function clean() clean build_bin -build_run_package +copy_file_output \ No newline at end of file diff --git a/build/scripts/help.info b/build/scripts/help.info deleted file mode 100644 index f1703ef..0000000 --- a/build/scripts/help.info +++ /dev/null @@ -1,5 +0,0 @@ - --install Install into this system - --install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime) - --uninstall Uninstall the installed ascend-docker-runtime tool - --upgrade Upgrade the installed ascend-docker-runtime tool - --install-type= A500, A200ISoC and A200 need to specify the installation type of Ascend-mindx-toolbox (eg: --install-type=A500) \ No newline at end of file -- Gitee From d6252eb43eb7189b764a4d958bc079d0ecfd79c5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 18 Oct 2022 17:18:34 +0800 Subject: [PATCH 280/296] Match-id-ca6c163b9b73228a9cdee8044427156acb258fc4 --- install/deb/src/main.go | 5 ++--- runtime/main.go | 33 ++++++++++++++------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 90ff7be..dd073f2 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -62,11 +62,10 @@ func main() { err = process() if err != nil { - hwlog.OpLog.Infof("%v run %s failed", logPrefixWords, os.Args) + hwlog.OpLog.Errorf("%v run install failed: %v", logPrefixWords, err) log.Fatal(fmt.Errorf("error in installation")) - } else { - hwlog.OpLog.Infof("%v run %s success", logPrefixWords, os.Args) } + hwlog.OpLog.Infof("%v run install success", logPrefixWords) } func initLogModule(ctx context.Context) error { diff --git a/runtime/main.go b/runtime/main.go index 5a57a3d..4e2e648 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -10,7 +10,6 @@ import ( "fmt" "io/ioutil" "log" - "main/dcmi" "os" "os/exec" "path" @@ -19,8 +18,9 @@ import ( "syscall" "github.com/opencontainers/runtime-spec/specs-go" - "huawei.com/mindx/common/hwlog" + + "main/dcmi" "mindxcheckutils" ) @@ -165,10 +165,10 @@ func addHook(spec *specs.Spec) error { } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) - hwlog.RunLog.Infof("vnpu split done: vdevice: %v err: %v", vdevice.VdeviceID, err) if err != nil { return err } + hwlog.RunLog.Infof("vnpu split done: vdevice: %v", vdevice.VdeviceID) if vdevice.VdeviceID != -1 { updateEnvAndPostHook(spec, vdevice) @@ -217,7 +217,7 @@ func modifySpecFile(path string) error { if err != nil { return fmt.Errorf("spec file doesnt exist %s: %v", path, err) } - if _, err := mindxcheckutils.RealFileChecker(path, true, true, mindxcheckutils.DefaultSize); err != nil { + if _, err = mindxcheckutils.RealFileChecker(path, true, true, mindxcheckutils.DefaultSize); err != nil { return err } @@ -234,11 +234,11 @@ func modifySpecFile(path string) error { } var spec specs.Spec - if err := json.Unmarshal(jsonContent, &spec); err != nil { + if err = json.Unmarshal(jsonContent, &spec); err != nil { return fmt.Errorf("failed to unmarshal oci spec file %s: %v", path, err) } - if err := addHook(&spec); err != nil { + if err = addHook(&spec); err != nil { return fmt.Errorf("failed to inject hook: %v", err) } @@ -247,7 +247,7 @@ func modifySpecFile(path string) error { return fmt.Errorf("failed to marshal OCI spec file: %v", err) } - if _, err := jsonFile.WriteAt(jsonOutput, 0); err != nil { + if _, err = jsonFile.WriteAt(jsonOutput, 0); err != nil { return fmt.Errorf("failed to write OCI spec file: %v", err) } @@ -273,7 +273,7 @@ func doProcess() error { specFilePath := args.bundleDirPath + "/config.json" - if err := modifySpecFile(specFilePath); err != nil { + if err = modifySpecFile(specFilePath); err != nil { return fmt.Errorf("failed to modify spec file %s: %v", specFilePath, err) } @@ -295,7 +295,7 @@ func main() { log.Fatal(err) } defer func() { - if err := mindxcheckutils.ChangeRuntimeLogMode("runtime-run-", "runtime-operate-"); err != nil { + if err = mindxcheckutils.ChangeRuntimeLogMode("runtime-run-", "runtime-operate-"); err != nil { fmt.Println("defer changeFileMode function failed") } }() @@ -303,18 +303,13 @@ func main() { hwlog.OpLog.Infof("%v ascend docker runtime starting, try to setup container", logPrefixWords) if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { - hwlog.RunLog.Infof("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v ascend docker runtime failed", logPrefixWords) + hwlog.RunLog.Errorf("%v ascend docker runtime args check failed", logPrefixWords) + hwlog.OpLog.Errorf("%v ascend docker runtime args check failed", logPrefixWords) log.Fatal("command error") } - logWords := fmt.Sprintf("%v running %v", logPrefixWords, os.Args) - if len(logWords) > maxLogLength { - logWords = logWords[0:maxLogLength-1] + "..." - } - hwlog.OpLog.Infof(logWords) - if err := doProcess(); err != nil { - hwlog.RunLog.Errorf("%v ascend docker runtime failed", logPrefixWords) - hwlog.OpLog.Errorf("%v %v failed", logPrefixWords, logWords) + if err = doProcess(); err != nil { + hwlog.RunLog.Errorf("%v docker runtime failed: %v", logPrefixWords, err) + hwlog.OpLog.Errorf("%v docker runtime failed: %v", logPrefixWords, err) log.Fatal(err) } } -- Gitee From 587d80a870601225c884b8c880aeba75beae3bef Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Fri, 21 Oct 2022 17:05:13 +0800 Subject: [PATCH 281/296] Match-id-508211299ab9ae50c24590730e7e4082f0df6e28 --- cli/src/main.c | 23 ++++++++++++++--------- cli/src/utils.c | 2 +- destroy/src/main.c | 5 ++--- hook/go.mod | 3 ++- hook/main.go | 3 +++ install/deb/src/go.mod | 3 ++- runtime/dcmi/dcmi.go | 29 ++++++++++++++++++----------- runtime/dcmi/dcmi_interface_api.h | 17 ++++++++++++++++- runtime/go.mod | 3 ++- runtime/main.go | 5 +++++ 10 files changed, 65 insertions(+), 28 deletions(-) diff --git a/cli/src/main.c b/cli/src/main.c index 3c64540..21a8bf1 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -24,6 +24,8 @@ #include "logger.h" #define DECIMAL 10 +#define MAX_ARGC 1024 +#define MAX_ARG_LEN 1024 struct CmdArgs { char devices[BUF_SIZE]; @@ -52,6 +54,11 @@ static bool DevicesCmdArgParser(struct CmdArgs *args, const char *arg) Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } + if (strlen(arg) > MAX_ARG_LEN) { + Logger("argument value too long!", LEVEL_ERROR, SCREEN_YES); + return false; + } + for (size_t iLoop = 0; iLoop < strlen(arg); iLoop++) { if ((isdigit(arg[iLoop]) == 0) && (arg[iLoop] != ',')) { Logger("failed to check devices.", LEVEL_ERROR, SCREEN_YES); @@ -76,7 +83,7 @@ static bool PidCmdArgParser(struct CmdArgs *args, const char *arg) Logger("args, arg pointer is null!", LEVEL_ERROR, SCREEN_YES); return false; } - args->pid = strtol(optarg, NULL, DECIMAL); + args->pid = strtol(arg, NULL, DECIMAL); const char* pidMax = "/proc/sys/kernel/pid_max"; const size_t maxFileSzieMb = 10; // max 10MB if (!CheckExternalFile(pidMax, strlen(pidMax), maxFileSzieMb, true)) { @@ -206,6 +213,7 @@ static bool CheckWhiteList(const char* fileName) for (size_t iLoop = 0; iLoop < WHITE_LIST_NUM; iLoop++) { if (strcmp(mountWhiteList[iLoop], fileName) == 0) { fileExists = true; + break; } } if (!fileExists) { @@ -309,12 +317,6 @@ static int ParseOneCmdArg(struct CmdArgs *args, char indicator, const char *valu } } - if (i == NUM_OF_CMD_ARGS) { - char* str = FormatLogMessage("unrecognized cmd arg: indicate char: %c, value: %s.", indicator, value); - Logger(str, LEVEL_ERROR, SCREEN_YES); - free(str); - return -1; - } bool isOK = g_cmdArgParsers[i].parser(args, value); if (!isOK) { char* str = FormatLogMessage("failed while parsing cmd arg, indicate char: %c, value: %s.", indicator, value); @@ -491,13 +493,16 @@ int Process(int argc, char **argv) Logger("argv pointer is null!", LEVEL_ERROR, SCREEN_YES); return -1; } + if (argc > MAX_ARGC) { + Logger("too many arguments!", LEVEL_ERROR, SCREEN_YES); + return -1; + } int c; int ret; - int optionIndex; struct CmdArgs args = {0}; Logger("runc start prestart-hook ...", LEVEL_INFO, SCREEN_YES); - while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, &optionIndex)) != -1) { + while ((c = getopt_long(argc, argv, "d:p:r:o:f:i", g_cmdOpts, NULL)) != -1) { ret = ParseOneCmdArg(&args, (char)c, optarg); if (ret < 0) { Logger("failed to parse cmd args.", LEVEL_ERROR, SCREEN_YES); diff --git a/cli/src/utils.c b/cli/src/utils.c index 8db402f..50c827e 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -347,7 +347,7 @@ bool GetFileSubsetAndCheck(const char *basePath, const size_t basePathLen) } if (ptr->d_type == DT_REG) { // 文件 const size_t maxFileSzieMb = 10; // max 10 MB - if (!(base, strlen(base), maxFileSzieMb)) { + if (!CheckFileSubset(base, strlen(base), maxFileSzieMb)) { return false; } } else if (ptr->d_type == DT_LNK) { // 软链接 diff --git a/destroy/src/main.c b/destroy/src/main.c index 11e81ee..ce3e68b 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -142,12 +142,11 @@ static bool DeclareDcmiApiAndCheck(void **handle) Logger("dlopen failed.", LEVEL_ERROR, SCREEN_YES); return false; } - char pLinkMap[sizeof(struct link_map)] = {0}; + struct link_map *pLinkMap; int ret = dlinfo(*handle, RTLD_DI_LINKMAP, &pLinkMap); if (ret == 0) { - struct link_map* pLink = *(struct link_map**)pLinkMap; const size_t maxFileSzieMb = 10; // max 10 mb - if (!CheckAExternalFile(pLink->l_name, strlen(pLink->l_name), maxFileSzieMb, true)) { + if (!CheckAExternalFile(pLinkMap->l_name, strlen(pLinkMap->l_name), maxFileSzieMb, true)) { Logger("check sofile failed.", LEVEL_ERROR, SCREEN_YES); return false; } diff --git a/hook/go.mod b/hook/go.mod index 9f6c644..469a222 100644 --- a/hook/go.mod +++ b/hook/go.mod @@ -10,7 +10,8 @@ require ( ) replace ( - huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 + huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10 huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 mindxcheckutils => ../mindxcheckutils ) diff --git a/hook/main.go b/hook/main.go index 4467329..3fc47c4 100644 --- a/hook/main.go +++ b/hook/main.go @@ -243,6 +243,9 @@ var getContainerConfig = func() (*containerConfig, error) { if err != nil { return nil, fmt.Errorf("failed to parse OCI spec: %v", err) } + if len(ociSpec.Process.Env) > maxCommandLength { + return nil, fmt.Errorf("too many items in spec file") + } // when use ctr->containerd. the rootfs in config.json is a relative path rfs := ociSpec.Root.Path if !filepath.IsAbs(rfs) { diff --git a/install/deb/src/go.mod b/install/deb/src/go.mod index d5b1dd7..302ce93 100644 --- a/install/deb/src/go.mod +++ b/install/deb/src/go.mod @@ -8,7 +8,8 @@ require ( ) replace ( - huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 + huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10 huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 mindxcheckutils => ../../../mindxcheckutils ) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 5990562..7a9dbaa 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -10,19 +10,20 @@ import "C" import ( "fmt" "math" + "mindxcheckutils" + "unsafe" ) const ( // RetError return error when the function failed retError = -1 + // hiAIMaxCardNum is the max number of cards + hiAIMaxCardNum = 64 + // hiAIMaxDeviceNum is the max number of devices in a card + hiAIMaxDeviceNum = 4 - // dcmiMaxVdevNum is max number of vdevice, value is from driver specification - dcmiMaxVdevNum = 16 - - // maxErrorCodeCount is the max number of error code - hiAIMaxCardNum = 16 - coreNumLen = 32 - deviceNum = 4294967295 // vfg_id表示指定虚拟设备所属的虚拟分组ID,默认自动分配,默认值为0xFFFFFFFF,转换成10进制为4294967295。 + coreNumLen = 32 + vfgID = 4294967295 // vfg_id表示指定虚拟设备所属的虚拟分组ID,默认自动分配,默认值为0xFFFFFFFF,转换成10进制为4294967295。 ) // NpuWorker Dcmi worker @@ -31,10 +32,16 @@ type NpuWorker struct { // Initialize dcmi lib init func (w *NpuWorker) Initialize() error { - if err := C.dcmiInit_dl(); err != C.SUCCESS { + cDlPath := C.CString(string(make([]byte, int32(C.PATH_MAX)))) + defer C.free(unsafe.Pointer(cDlPath)) + if err := C.dcmiInit_dl(cDlPath); err != C.SUCCESS { errInfo := fmt.Errorf("dcmi lib load failed, , error code: %d", int32(err)) return errInfo } + dlPath := C.GoString(cDlPath) + if _, err := mindxcheckutils.RealFileChecker(dlPath, true, false, mindxcheckutils.DefaultSize); err != nil { + return err + } if err := C.dcmi_init(); err != C.SUCCESS { errInfo := fmt.Errorf("dcmi init failed, , error code: %d", int32(err)) return errInfo @@ -81,7 +88,7 @@ func GetDeviceNumInCard(cardID int32) (int32, error) { errInfo := fmt.Errorf("get device count on the card failed, error code: %d", int32(err)) return retError, errInfo } - if deviceNum <= 0 { + if deviceNum <= 0 || deviceNum > hiAIMaxDeviceNum { errInfo := fmt.Errorf("the number of chips obtained is invalid, the number is: %d", int32(deviceNum)) return retError, errInfo } @@ -110,8 +117,8 @@ func (w *NpuWorker) CreateVDevice(cardID, deviceID int32, coreNum string) (int32 createInfo.vdev_id = C.uint(math.MaxUint32) var deviceCreateStr C.struct_dcmi_create_vdev_res_stru deviceCreateStr = C.struct_dcmi_create_vdev_res_stru{ - vdev_id: C.uint(deviceNum), - vfg_id: C.uint(deviceNum), + vdev_id: C.uint(vfgID), + vfg_id: C.uint(vfgID), } deviceCreateStrArr := [coreNumLen]C.char{0} for i := 0; i < len(coreNum); i++ { diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h index a7094a0..356916a 100644 --- a/runtime/dcmi/dcmi_interface_api.h +++ b/runtime/dcmi/dcmi_interface_api.h @@ -6,7 +6,10 @@ #ifndef __DCMI_INTERFACE_API_H__ #define __DCMI_INTERFACE_API_H__ #include +#define _GNU_SOURCE +#include #include +#include #include #include #include @@ -21,6 +24,7 @@ void *dcmiHandle; #define FUNCTION_NOT_FOUND (-99998) #define SUCCESS (0) #define ERROR_UNKNOWN (-99997) +#define SO_NOT_CORRECT (-99996) #define CALL_FUNC(name, ...) if (name##_func == NULL) {return FUNCTION_NOT_FOUND;}return name##_func(__VA_ARGS__) #define DCMI_VDEV_FOR_RESERVE (32) struct dcmi_create_vdev_out { @@ -86,13 +90,24 @@ int dcmi_get_device_logicid_from_phyid(unsigned int phyid, unsigned int *logicid } // load .so files and functions -int dcmiInit_dl(void) +int dcmiInit_dl(char *dl_path) { dcmiHandle = dlopen("libdcmi.so", RTLD_LAZY | RTLD_GLOBAL); if (dcmiHandle == NULL) { fprintf (stderr, "%s\n", dlerror()); return SO_NOT_FOUND; } + struct link_map *pLinkMap; + int ret = dlinfo(dcmiHandle, RTLD_DI_LINKMAP, &pLinkMap); + if (ret != 0) { + fprintf(stderr, "dlinfo sofile failed :%s\n", dlerror()); + return SO_NOT_CORRECT; + } + + size_t path_size = strlen(pLinkMap->l_name); + for (int i = 0; i < path_size && i < PATH_MAX; i++) { + dl_path[i] = pLinkMap->l_name[i]; + } dcmi_init_func = dlsym(dcmiHandle, "dcmi_init"); diff --git a/runtime/go.mod b/runtime/go.mod index d05bf10..304392a 100644 --- a/runtime/go.mod +++ b/runtime/go.mod @@ -11,8 +11,9 @@ require ( ) replace ( + huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2 github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a - huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 + huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10 huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 mindxcheckutils => ../mindxcheckutils ) diff --git a/runtime/main.go b/runtime/main.go index 4e2e648..bde9049 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -138,6 +138,7 @@ func addHook(spec *specs.Spec) error { if spec.Hooks == nil { spec.Hooks = &specs.Hooks{} } + needUpdate := true for _, hook := range spec.Hooks.Prestart { if strings.Contains(hook.Path, hookCli) { @@ -238,6 +239,10 @@ func modifySpecFile(path string) error { return fmt.Errorf("failed to unmarshal oci spec file %s: %v", path, err) } + if len(spec.Process.Env) > maxCommandLength || len(spec.Hooks.Prestart) > maxCommandLength { + return fmt.Errorf("too many items in spec file. ") + } + if err = addHook(&spec); err != nil { return fmt.Errorf("failed to inject hook: %v", err) } -- Gitee From 0888e90e76e1508f09d58c31ab60ac5fbafafd73 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 25 Oct 2022 16:43:41 +0800 Subject: [PATCH 282/296] Match-id-f7e528845ce901319453aa532800f9bad09292e0 --- runtime/dcmi/dcmi.go | 7 ++++--- runtime/dcmi/dcmi_api.go | 14 +++++++------- runtime/main.go | 2 ++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 7a9dbaa..0c9e483 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -10,8 +10,9 @@ import "C" import ( "fmt" "math" - "mindxcheckutils" "unsafe" + + "mindxcheckutils" ) const ( @@ -71,7 +72,7 @@ func GetCardList() (int32, []int32, error) { } var cardNum = int32(cNum) var cardIDList []int32 - for i := int32(0); i < cardNum && i < hiAIMaxCardNum; i++ { + for i := int32(0); i < cardNum; i++ { cardID := int32(ids[i]) if cardID < 0 { continue @@ -157,7 +158,7 @@ func (w *NpuWorker) FindDevice(visibleDevice int32) (int32, int32, error) { if err := C.dcmi_get_device_logicid_from_phyid(C.uint(visibleDevice), &dcmiLogicID); err != 0 { return 0, 0, fmt.Errorf("phy id can not be converted to logic id : %v", err) } - if uint(dcmiLogicID) > math.MaxInt32 { + if int32(dcmiLogicID) < 0 || int32(dcmiLogicID) >= hiAIMaxCardNum*hiAIMaxDeviceNum { return 0, 0, fmt.Errorf("logic id too large") } targetLogicID := int32(dcmiLogicID) diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index 92da7e5..0884bee 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -5,7 +5,6 @@ package dcmi import ( "fmt" - "math" "strconv" "strings" @@ -52,7 +51,7 @@ func CreateVDevice(w WorkerInterface, spec *specs.Spec) (VDeviceInfo, error) { } func extractVpuParam(spec *specs.Spec) (int32, string, error) { - visibleDevice, splitDevice, needSplit, visibleDeviceLine := int32(-1), "", false, "" + splitDevice, needSplit, visibleDeviceLine := "", false, "" allowSplit := map[string]string{ "vir01": "vir01", "vir02": "vir02", "vir04": "vir04", "vir08": "vir08", "vir16": "vir16", "vir04_3c": "vir04_3c", "vir02_1c": "vir02_1c", "vir04_4c_dvpp": "vir04_4c_dvpp", @@ -80,10 +79,11 @@ func extractVpuParam(spec *specs.Spec) (int32, string, error) { if !needSplit { return -1, "", nil } - if cardID, err := strconv.Atoi(visibleDeviceLine); err == nil && cardID >= 0 && cardID <= math.MaxInt32 { - visibleDevice = int32(cardID) - } else { - return -1, "", fmt.Errorf("cannot parse param : %v %v", err, visibleDeviceLine) + visibleDevice, err := strconv.Atoi(visibleDeviceLine) + if err != nil || visibleDevice < 0 || visibleDevice >= hiAIMaxCardNum*hiAIMaxDeviceNum { + return -1, "", fmt.Errorf("cannot parse param : %v %s", err, visibleDeviceLine) + } - return visibleDevice, splitDevice, nil + + return int32(visibleDevice), splitDevice, nil } diff --git a/runtime/main.go b/runtime/main.go index bde9049..7d02e5c 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -143,6 +143,7 @@ func addHook(spec *specs.Spec) error { for _, hook := range spec.Hooks.Prestart { if strings.Contains(hook.Path, hookCli) { needUpdate = false + break } } if needUpdate { @@ -158,6 +159,7 @@ func addHook(spec *specs.Spec) error { if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { if strings.Contains(words[1], "VIRTUAL") { hasVirtualFlag = true + break } } } -- Gitee From 4be7dbac7e9eca26f1240126652168bade41ef70 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 17 Nov 2022 14:09:59 +0800 Subject: [PATCH 283/296] Match-id-e9a3d04d0441456f544e2b3090bc937d1cdf1c3d --- runtime/main.go | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index 7d02e5c..a3ce3a0 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -140,6 +140,9 @@ func addHook(spec *specs.Spec) error { } needUpdate := true + if len(spec.Hooks.Prestart) > maxCommandLength { + return fmt.Errorf("too many items in Prestart ") + } for _, hook := range spec.Hooks.Prestart { if strings.Contains(hook.Path, hookCli) { needUpdate = false @@ -153,19 +156,16 @@ func addHook(spec *specs.Spec) error { }) } - hasVirtualFlag := false + if len(spec.Process.Env) > maxCommandLength { + return fmt.Errorf("too many items in Env ") + } for _, line := range spec.Process.Env { words := strings.Split(line, "=") - if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" { - if strings.Contains(words[1], "VIRTUAL") { - hasVirtualFlag = true - break - } + if len(words) == envLength && strings.TrimSpace(words[0]) == "ASCEND_RUNTIME_OPTIONS" && + strings.Contains(words[1], "VIRTUAL") { + return nil } } - if hasVirtualFlag { - return nil - } vdevice, err := dcmi.CreateVDevice(&dcmi.NpuWorker{}, spec) if err != nil { @@ -241,10 +241,6 @@ func modifySpecFile(path string) error { return fmt.Errorf("failed to unmarshal oci spec file %s: %v", path, err) } - if len(spec.Process.Env) > maxCommandLength || len(spec.Hooks.Prestart) > maxCommandLength { - return fmt.Errorf("too many items in spec file. ") - } - if err = addHook(&spec); err != nil { return fmt.Errorf("failed to inject hook: %v", err) } -- Gitee From 624d8b2fba4d184d89ac9f117862e1ff26525c37 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Nov 2022 14:10:26 +0800 Subject: [PATCH 284/296] Match-id-c18c69ed7f25316be55a9d9b5f459d74a873989b --- cli/src/logger.c | 2 +- hook/main.go | 2 ++ install/deb/src/main.go | 1 + runtime/main.go | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/logger.c b/cli/src/logger.c index e4fb6d5..d4b8184 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -14,7 +14,7 @@ #include "utils.h" #include "logger.h" -#define FILE_MAX_SIZE (1024 * 1024 * 10) +#define FILE_MAX_SIZE (1024 * 1024 * 2) #define LOG_PATH_DIR "/var/log/ascend-docker-runtime/" #define TEMP_BUFFER 30 #define YEAR_OFFSET 1900 diff --git a/hook/main.go b/hook/main.go index 3fc47c4..e5695cc 100644 --- a/hook/main.go +++ b/hook/main.go @@ -70,6 +70,7 @@ func initLogModule(ctx context.Context) error { MaxBackups: backups, MaxAge: logMaxAge, OnlyToFile: true, + FileMaxSize: 2, } if err := hwlog.InitRunLogger(&runLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) @@ -81,6 +82,7 @@ func initLogModule(ctx context.Context) error { MaxBackups: backups, MaxAge: logMaxAge, OnlyToFile: true, + FileMaxSize: 2, } if err := hwlog.InitOperateLogger(&operateLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) diff --git a/install/deb/src/main.go b/install/deb/src/main.go index dd073f2..e60f34b 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -76,6 +76,7 @@ func initLogModule(ctx context.Context) error { LogLevel: 0, MaxBackups: backups, MaxAge: logMaxAge, + FileMaxSize: 2, } if err := hwlog.InitOperateLogger(&logConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) diff --git a/runtime/main.go b/runtime/main.go index a3ce3a0..a067eeb 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -75,6 +75,7 @@ func initLogModule(ctx context.Context) error { MaxBackups: backups, MaxAge: logMaxAge, OnlyToFile: true, + FileMaxSize: 2, } if err := hwlog.InitRunLogger(&runLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) @@ -86,6 +87,7 @@ func initLogModule(ctx context.Context) error { MaxBackups: backups, MaxAge: logMaxAge, OnlyToFile: true, + FileMaxSize: 2, } if err := hwlog.InitOperateLogger(&operateLogConfig, ctx); err != nil { fmt.Printf("hwlog init failed, error is %v", err) -- Gitee From 67eb8fad6dd9393bea9df5fc203b799cf99c9630 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 28 Nov 2022 14:30:37 +0800 Subject: [PATCH 285/296] Match-id-0a51bca7530c8791f9cd6c6b9abb330ef962a99a --- build/conf/ascend-docker-plugin.yaml | 14 +- build/scripts/help.info | 5 + build/scripts/run_main.sh | 242 +++++++++++++++++++++++++++ build/scripts/uninstall.sh | 36 ++++ 4 files changed, 294 insertions(+), 3 deletions(-) create mode 100644 build/scripts/help.info create mode 100644 build/scripts/run_main.sh create mode 100644 build/scripts/uninstall.sh diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index d4061d2..61200a2 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -66,7 +66,7 @@ package: service: Ascend-docker-runtime MindXSDK: b050 packageInfo: - - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.zip" + - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.run" input: files: include: @@ -78,23 +78,31 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker*" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build/ascend-docker*" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/destroy/build/ascend-docker*" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/uninstall.sh" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A500" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200" - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200ISoC" - "{{ systemEnv.workspace }}/ascend-docker-plugin/assets" - "{{ systemEnv.workspace }}/ascend-docker-plugin/README.md" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/run_main.sh" des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/" + - copy: + src: + - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh" + - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh" + des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/" - commands: - - command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg && zip -r Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.zip ./*" + - command: "chmod 550 {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" process: type: run srcRoot: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/" + parameters: [ makeself, help.info, "{{systemEnv.DATE }}"] output: files: include: - move: - src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/*.zip"] + src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/*.run"] des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output" diff --git a/build/scripts/help.info b/build/scripts/help.info new file mode 100644 index 0000000..31fe6e0 --- /dev/null +++ b/build/scripts/help.info @@ -0,0 +1,5 @@ + --install Install into this system + --install-path Specify the installation path (default: /usr/local/Ascend/Ascend-Docker-Runtime) + --uninstall Uninstall the installed ascend-docker-runtime tool + --upgrade Upgrade the installed ascend-docker-runtime tool + --install-type= Only A500, A200ISoC and A200 need to specify the installation type of Ascend-docker-runtime (eg: --install-type=A500) \ No newline at end of file diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh new file mode 100644 index 0000000..d0edd77 --- /dev/null +++ b/build/scripts/run_main.sh @@ -0,0 +1,242 @@ +#!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +# Description: ascend-docker-runtime run package script +set -e + +ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d +DOCKER_CONFIG_DIR=/etc/docker +INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime + +function install() +{ + echo 'installing ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + mkdir -p ${INSTALL_PATH} + fi + if [ -L "${INSTALL_PATH}" ]; then + echo "ERROR: ${INSTALL_PATH} is symbolic link." + exit 1 + fi + cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime + cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook + cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy + chmod 550 ${INSTALL_PATH}/ascend-docker-runtime + chmod 550 ${INSTALL_PATH}/ascend-docker-hook + chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + chmod 550 ${INSTALL_PATH}/ascend-docker-destroy + + if [ -L "${INSTALL_PATH}/script" ]; then + echo "ERROR: ${INSTALL_PATH}/script is symbolic link." + exit 1 + fi + cp -rf ./assets ${INSTALL_PATH}/assets + cp -f ./README.md ${INSTALL_PATH}/README.md + mkdir -p ${INSTALL_PATH}/script + cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh + chmod 500 ${INSTALL_PATH}/script/uninstall.sh + + if [ -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} + fi + if [ -L "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + echo "ERROR: ${ASCEND_RUNTIME_CONFIG_DIR} is symbolic link." + exit 1 + fi + mkdir -p ${ASCEND_RUNTIME_CONFIG_DIR} + chmod 750 ${ASCEND_RUNTIME_CONFIG_DIR} + if [ "${a500}" == "y" ]; then + cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "${a200}" == "y" ]; then + cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "${a200isoc}" == "y" ]; then + cp -f ./base.list_A200ISoC ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + else + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + fi + chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + + echo 'install executable files success' + + if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then + mkdir -p ${DOCKER_CONFIG_DIR} + fi + + SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}" + DST="${DOCKER_CONFIG_DIR}/daemon.json" + ./ascend-docker-plugin-install-helper add ${DST} ${SRC} ${INSTALL_PATH}/ascend-docker-runtime + if [ "$?" != "0" ]; then + echo 'create damon.json failed' + exit 1 + fi + + mv ${SRC} ${DST} + chmod 600 ${DST} + echo 'create damom.json success' + echo 'please reboot docker daemon to take effect' +} + +function uninstall() +{ + echo 'uninstalling ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + echo 'WARNING: the specified install path does not exist, skipping' + exit 0 + fi + + ${INSTALL_PATH}/script/uninstall.sh + echo 'remove daemon.json setting success' + + [ -n "${INSTALL_PATH}" ] && rm -rf ${INSTALL_PATH} + echo 'remove executable files success' + + echo 'del damom.json success' +} + +function upgrade() +{ + echo 'upgrading ascend docker runtime' + + if [ ! -d "${INSTALL_PATH}" ]; then + echo 'ERROR: the specified install path does not exist, stopping upgrading' + exit 1 + fi + + if [ ! -d "${ASCEND_RUNTIME_CONFIG_DIR}" ]; then + echo 'ERROR: the configuration directory does not exist' + exit 1 + fi + if [ -L "${INSTALL_PATH}" ]; then + echo "ERROR: ${INSTALL_PATH} is symbolic link." + exit 1 + fi + cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime + cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook + cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli + cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper + cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy + cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + chmod 550 ${INSTALL_PATH}/ascend-docker-runtime + chmod 550 ${INSTALL_PATH}/ascend-docker-hook + chmod 550 ${INSTALL_PATH}/ascend-docker-cli + chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper + chmod 550 ${INSTALL_PATH}/ascend-docker-destroy + chmod 500 ${INSTALL_PATH}/script/uninstall.sh + chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + + echo 'upgrade ascend docker runtime success' +} + +INSTALL_FLAG=n +INSTALL_PATH_FLAG=n +UNINSTALL_FLAG=n +UPGRADE_FLAG=n +a500=n +a200=n +a200isoc=n + +while true +do + case "$3" in + --install) + if [ "${INSTALL_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi + INSTALL_FLAG=y + shift + ;; + --uninstall) + if [ "${UNINSTALL_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi + UNINSTALL_FLAG=y + shift + ;; + --install-path=*) + if [ "${INSTALL_PATH_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi + INSTALL_PATH_FLAG=y + INSTALL_PATH=$(echo $3 | cut -d"=" -f2) + INSTALL_PATH=$(echo ${INSTALL_PATH} | sed "s/\/*$//g") + shift + ;; + --upgrade) + if [ "${UPGRADE_FLAG}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi + UPGRADE_FLAG=y + shift + ;; + --install-type=*) + if [ "${a500}" == "y" ] || [ "${a200}" == "y" ] || [ "${a200isoc}" == "y" ]; then + echo "warning :Repeat parameter!" + exit 1 + fi + + if [ "$3" == "--install-type=A500" ]; then + a500=y + elif [ "$3" == "--install-type=A200" ]; then + a200=y + elif [ "$3" == "--install-type=A200ISoC" ]; then + a200isoc=y + else + echo "ERROR :Please check the parameter of --install-type=" + exit 1 + fi + shift + ;; + *) + if [ "x$3" != "x" ]; then + echo "warning :Unsupported parameters: $3" + exit 1 + fi + break + ;; + esac +done + +# install path must be absolute path +if [[ ! "${INSTALL_PATH}" =~ ^/.* ]]; then + echo "ERROR :Please follow the installation address after the --install-path=" + exit 1 +fi + +# it is not allowed to input only install-path +if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ + [ "${INSTALL_FLAG}" == "n" ] && \ + [ "${UNINSTALL_FLAG}" == "n" ] && \ + [ "${UPGRADE_FLAG}" == "n" ]; then + echo "Error:only input command. When use --install-path you also need intput --install or --uninstall or --upgrade or --devel" + exit 1 +fi + +# must run with root permission +if [ "${UID}" != "0" ]; then + echo 'please run with root permission' + exit 1 +fi + +if [ "${INSTALL_FLAG}" == "y" ]; then + install + exit 0 +fi + +if [ "${UNINSTALL_FLAG}" == "y" ]; then + uninstall + exit 0 +fi + +if [ "${UPGRADE_FLAG}" == "y" ]; then + upgrade + exit 0 +fi diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh new file mode 100644 index 0000000..b3c7529 --- /dev/null +++ b/build/scripts/uninstall.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +# Description: ascend-docker-runtime uninstall script +set -e +LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" >>${LOG_FILE} +ROOT=$(cd $(dirname $0); pwd)/.. +DST='/etc/docker/daemon.json' +SRC="${DST}.${PPID}" +ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d + +if [ ! -f "${DST}" ]; then + exit 0 +fi + +${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} +if [ "$?" != "0" ]; then + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" + echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "ERROR: del damon.json failed" >>${LOG_FILE} + exit 1 +fi + +mv ${SRC} ${DST} + +[ -n "${ASCEND_RUNTIME_CONFIG_DIR}" ] && rm -rf ${ASCEND_RUNTIME_CONFIG_DIR} +INSTALL_ROOT_PATH=$(dirname $(dirname ${ROOT})) + +if test -d ${INSTALL_ROOT_PATH} +then + rm -rf ${INSTALL_ROOT_PATH} + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" + echo "Ascend-Docker-Runtime $(date +%Y%m%d-%H:%M:%S) delete ${INSTALL_ROOT_PATH} succesfull" >>${LOG_FILE} +fi +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" +echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "uninstall successfully" >>${LOG_FILE} \ No newline at end of file -- Gitee From ba192bb825076fb066d2d19ecd5ce2dbae6174c2 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 1 Dec 2022 14:53:54 +0800 Subject: [PATCH 286/296] Match-id-58680a01f05d5393f45c7bb0c59e2af8f2b65e2b --- build/conf/ascend-docker-plugin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index 61200a2..5ce85c7 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -66,7 +66,7 @@ package: service: Ascend-docker-runtime MindXSDK: b050 packageInfo: - - name: "Ascend-docker-runtime-{{ version }}-{{ systemEnv.processor }}.run" + - name: "Ascend-docker-runtime_{{ version }}_linux-{{ systemEnv.processor }}.run" input: files: include: -- Gitee From 3b54f03a309ea92bc2d4ce4ab7727e6697f27abd Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 5 Dec 2022 15:57:14 +0800 Subject: [PATCH 287/296] Match-id-c9c7f28b3c953429ce8fd29743f5a9f40542dba1 --- build/conf/ascend-docker-plugin.yaml | 4 +++ build/scripts/run_main.sh | 43 ++++++++++++++++++++++++++-- install/deb/src/main.go | 30 ++++++++++--------- 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/build/conf/ascend-docker-plugin.yaml b/build/conf/ascend-docker-plugin.yaml index 5ce85c7..9d16006 100644 --- a/build/conf/ascend-docker-plugin.yaml +++ b/build/conf/ascend-docker-plugin.yaml @@ -92,6 +92,10 @@ package: - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh" - "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh" des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/" + - sed: + option: "-i" + srcstr: 's/%{PACKAGE_VERSION}%/{{ version }}/g' + curfile: '{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh' - commands: - command: "chmod 550 {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh" diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index d0edd77..6fcd42a 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -6,6 +6,24 @@ set -e ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d DOCKER_CONFIG_DIR=/etc/docker INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime +readonly PACKAGE_VERSION=%{PACKAGE_VERSION}% + + +function save_install_args() { + if [ -f "${INSTALL_PATH}"/ascend_docker_runtime_install.info ]; then + rm "${INSTALL_PATH}"/ascend_docker_runtime_install.info + fi + { + echo -e "version=${PACKAGE_VERSION}" + echo -e "arch=$(uname -m)" + echo -e "os=linux" + echo -e "path=${INSTALL_PATH}" + echo -e "build=Ascend-docker-runtime_${PACKAGE_VERSION}-$(uname -m)" + echo -e "a500=${a500}" + echo -e "a200=${a200}" + echo -e "a200isoc=${a200isoc}" + } >> "${INSTALL_PATH}"/ascend_docker_runtime_install.info +} function install() { @@ -76,12 +94,15 @@ function install() mv ${SRC} ${DST} chmod 600 ${DST} echo 'create damom.json success' + save_install_args + echo "[INFO]: Ascend Docker Runtime has been installed in: ${INSTALL_PATH}" + echo "[INFO]: The version of Ascend Docker Runtime is: ${PACKAGE_VERSION}" echo 'please reboot docker daemon to take effect' } function uninstall() { - echo 'uninstalling ascend docker runtime' + echo "[INFO]: Uninstalling ascend docker runtime ${PACKAGE_VERSION}" if [ ! -d "${INSTALL_PATH}" ]; then echo 'WARNING: the specified install path does not exist, skipping' @@ -120,16 +141,32 @@ function upgrade() cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper cp -f ./ascend-docker-destroy ${INSTALL_PATH}/ascend-docker-destroy cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh - cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list chmod 550 ${INSTALL_PATH}/ascend-docker-runtime chmod 550 ${INSTALL_PATH}/ascend-docker-hook chmod 550 ${INSTALL_PATH}/ascend-docker-cli chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper chmod 550 ${INSTALL_PATH}/ascend-docker-destroy chmod 500 ${INSTALL_PATH}/script/uninstall.sh + if [ -f "${INSTALL_PATH}"/ascend_docker_runtime_install.info ]; then + if [ "$(grep "a500=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "a500=y" ];then + a500=y + cp -f ./base.list_A500 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "$(grep "a200=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "a200=y" ]; then + a200=y + cp -f ./base.list_A200 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + elif [ "x$(grep "a200isoc=y" "${INSTALL_PATH}"/ascend_docker_runtime_install.info)" == "xa200isoc=y" ]; then + a200isoc=y + cp -f ./base.list_A200ISoC ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + else + cp -f ./base.list ${ASCEND_RUNTIME_CONFIG_DIR}/base.list + fi + save_install_args + fi chmod 440 ${ASCEND_RUNTIME_CONFIG_DIR}/base.list - echo 'upgrade ascend docker runtime success' + echo "[INFO]: Ascend Docker Runtime has been installed in: ${INSTALL_PATH}" + echo '[INFO]: upgrade ascend docker runtime success' + echo "[INFO]: The version of Ascend Docker Runtime is: ${PACKAGE_VERSION}" } INSTALL_FLAG=n diff --git a/install/deb/src/main.go b/install/deb/src/main.go index e60f34b..1a4c40c 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -52,7 +52,7 @@ func main() { if err != nil { log.Fatal(err) } - hwlog.OpLog.Infof("%v installer started", logPrefixWords) + hwlog.OpLog.Infof("%v start running script", logPrefixWords) if !mindxcheckutils.StringChecker(strings.Join(os.Args, " "), 0, maxCommandLength, mindxcheckutils.DefaultWhiteList+" ") { @@ -60,12 +60,12 @@ func main() { log.Fatal("command error") } - err = process() + err, behavior := process() if err != nil { - hwlog.OpLog.Errorf("%v run install failed: %v", logPrefixWords, err) + hwlog.OpLog.Errorf("%v run script failed: %v", logPrefixWords, err) log.Fatal(fmt.Errorf("error in installation")) } - hwlog.OpLog.Infof("%v run install success", logPrefixWords) + hwlog.OpLog.Infof("%v run %v success", logPrefixWords, behavior) } func initLogModule(ctx context.Context) error { @@ -85,7 +85,7 @@ func initLogModule(ctx context.Context) error { return nil } -func process() error { +func process() (error, string) { const helpMessage = "\tadd \n" + "\t rm \n" + "\t -h help command" @@ -93,38 +93,40 @@ func process() error { flag.Parse() if *helpFlag { _, err := fmt.Println(helpMessage) - return err + return err, "" } command := flag.Args() if len(command) == 0 { - return fmt.Errorf("error param") + return fmt.Errorf("error param"), "" } - action := command[actionPosition] + action, behavior := command[actionPosition], "" correctParam := false if action == addCommand && len(command) == addCommandLength { correctParam = true + behavior = "install" } if action == rmCommand && len(command) == rmCommandLength { correctParam = true + behavior = "uninstall" } if !correctParam { - return fmt.Errorf("error param") + return fmt.Errorf("error param"), "" } srcFilePath := command[srcFilePosition] if _, err := os.Stat(srcFilePath); os.IsNotExist(err) { if _, err := mindxcheckutils.RealDirChecker(filepath.Dir(srcFilePath), true, false); err != nil { - return err + return err, behavior } } else { if _, err := mindxcheckutils.RealFileChecker(srcFilePath, true, false, mindxcheckutils.DefaultSize); err != nil { - return err + return err, behavior } } destFilePath := command[destFilePosition] if _, err := mindxcheckutils.RealDirChecker(filepath.Dir(destFilePath), true, false); err != nil { - return err + return err, behavior } runtimeFilePath := "" if len(command) == addCommandLength { @@ -134,9 +136,9 @@ func process() error { // check file permission writeContent, err := createJsonString(srcFilePath, runtimeFilePath, action) if err != nil { - return err + return err, behavior } - return writeJson(destFilePath, writeContent) + return writeJson(destFilePath, writeContent), behavior } func createJsonString(srcFilePath, runtimeFilePath, action string) ([]byte, error) { -- Gitee From 68a2e4512e68bfe9e64ca7a11c70b138f9becb7b Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 5 Dec 2022 19:45:03 +0800 Subject: [PATCH 288/296] Match-id-cb036190de76026a33b76f600cd2fd9005921c9b --- build/scripts/run_main.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 6fcd42a..3a51608 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -176,10 +176,18 @@ UPGRADE_FLAG=n a500=n a200=n a200isoc=n +quiet_flag=n while true do case "$3" in + --check) + exit 0 + ;; + --quiet) + quiet_flag=y + shift + ;; --install) if [ "${INSTALL_FLAG}" == "y" ]; then echo "warning :Repeat parameter!" -- Gitee From 57af10846f1e48a9fe5a25d309677bc187b6c28c Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 12 Dec 2022 16:02:24 +0800 Subject: [PATCH 289/296] Match-id-c3fed31ef34bd8a17d9ce90e835f95d2bb638ab9 --- build/scripts/run_main.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index 3a51608..ce128df 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -265,6 +265,15 @@ if [ "${INSTALL_PATH_FLAG}" == "y" ] && \ exit 1 fi +# it is not allowed to input only quiet +if [ "${quiet_flag}" == "y" ] && \ + [ "${INSTALL_FLAG}" == "n" ] && \ + [ "${UNINSTALL_FLAG}" == "n" ] && \ + [ "${UPGRADE_FLAG}" == "n" ]; then + echo "[ERROR] parameter error ! Mode is neither install, uninstall, upgrade." + exit 1 +fi + # must run with root permission if [ "${UID}" != "0" ]; then echo 'please run with root permission' -- Gitee From 54849e7239f2559c178212dfd7b728b175293f40 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 14 Dec 2022 17:24:46 +0800 Subject: [PATCH 290/296] Match-id-860cd95ec8fb18ce00a4680ef0274f67cd2d5068 --- LICENSE | 201 ++++++++++++++++++++++++ build/build.sh | 18 ++- build/scripts/run_main.sh | 14 ++ build/scripts/uninstall.sh | 14 ++ cli/src/basic.c | 16 +- cli/src/basic.h | 16 +- cli/src/cgrp.c | 16 +- cli/src/cgrp.h | 16 +- cli/src/logger.c | 16 +- cli/src/logger.h | 17 +- cli/src/main.c | 16 +- cli/src/ns.c | 16 +- cli/src/ns.h | 16 +- cli/src/options.c | 16 +- cli/src/options.h | 16 +- cli/src/u_mount.c | 16 +- cli/src/u_mount.h | 16 +- cli/src/utils.c | 16 +- cli/src/utils.h | 16 +- cli/test/dt/Depend/public_stub.cpp | 16 +- cli/test/dt/Depend/ut_main.cpp | 16 +- cli/test/dt/Scripts/pre.sh | 15 ++ cli/test/dt/build.sh | 17 +- cli/test/dt/testcase/gtest_mytest.cpp | 16 +- cli/test/dt/testcase/main.cpp | 16 +- cli/test/dt_go/build.sh | 16 +- destroy/src/main.c | 16 +- hook/main.go | 19 ++- hook/main_test.go | 19 ++- install/deb/src/main.go | 16 +- install/deb/src/main_test.go | 16 +- mindxcheckutils/mindxcheckutils.go | 19 ++- mindxcheckutils/mindxcheckutils_test.go | 19 ++- runtime/dcmi/dcmi.go | 19 ++- runtime/dcmi/dcmi_api.go | 14 +- runtime/dcmi/dcmi_api_test.go | 16 +- runtime/dcmi/dcmi_interface_api.h | 15 +- runtime/main.go | 19 ++- runtime/main_test.go | 19 ++- 39 files changed, 723 insertions(+), 103 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/build/build.sh b/build/build.sh index cfb5e65..8099b1d 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,20 @@ #!/bin/bash -# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -# Description: ascend-docker-runtime构建脚本 +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +# Description: ascend-docker-runtime build script +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + set -ex ROOT=$(cd $(dirname $0); pwd)/.. diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index ce128df..acaf7e1 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -1,6 +1,20 @@ #!/bin/bash # Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. # Description: ascend-docker-runtime run package script +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + set -e ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d diff --git a/build/scripts/uninstall.sh b/build/scripts/uninstall.sh index b3c7529..4c320d5 100644 --- a/build/scripts/uninstall.sh +++ b/build/scripts/uninstall.sh @@ -1,6 +1,20 @@ #!/bin/bash # Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. # Description: ascend-docker-runtime uninstall script +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + set -e LOG_FILE="/var/log/ascend_seclog/ascend_toolbox_install.log" echo "Ascend-Docker-Runtime" $(date +%Y%m%d-%H:%M:%S) "start uninstall" diff --git a/cli/src/basic.c b/cli/src/basic.c index e11b50b..fd06d73 100644 --- a/cli/src/basic.c +++ b/cli/src/basic.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具公共宏和结构体定义 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "basic.h" #include #include diff --git a/cli/src/basic.h b/cli/src/basic.h index f584fa4..36d7065 100644 --- a/cli/src/basic.h +++ b/cli/src/basic.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具公共宏和结构体定义 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _BASIC_H #define _BASIC_H diff --git a/cli/src/cgrp.c b/cli/src/cgrp.c index 32e49e9..16bd9d9 100644 --- a/cli/src/cgrp.c +++ b/cli/src/cgrp.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器CGroup配置模块 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "cgrp.h" #include #include diff --git a/cli/src/cgrp.h b/cli/src/cgrp.h index 3befd76..9df72f2 100644 --- a/cli/src/cgrp.h +++ b/cli/src/cgrp.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器CGroup配置模块头文件 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _CGRP_H #define _CGRP_H diff --git a/cli/src/logger.c b/cli/src/logger.c index d4b8184..c29daa8 100644 --- a/cli/src/logger.c +++ b/cli/src/logger.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. - * Description: ascend-docker-cli日志模块 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/cli/src/logger.h b/cli/src/logger.h index 5f94eef..a2f45c8 100644 --- a/cli/src/logger.h +++ b/cli/src/logger.h @@ -1,8 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. - * Description: ascend-docker-cli工具容器logger日志模块头文件 -*/ - + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _LOGGER_H #define _LOGGER_H diff --git a/cli/src/main.c b/cli/src/main.c index 21a8bf1..834c92a 100644 --- a/cli/src/main.c +++ b/cli/src/main.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具,配置容器挂载Ascend NPU设备 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #define _GNU_SOURCE #include #include diff --git a/cli/src/ns.c b/cli/src/ns.c index d9fca09..3f4fb3e 100644 --- a/cli/src/ns.c +++ b/cli/src/ns.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器Namespace实用函数模块 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #define _GNU_SOURCE #include "ns.h" diff --git a/cli/src/ns.h b/cli/src/ns.h index dc7ecc4..c9d2052 100644 --- a/cli/src/ns.h +++ b/cli/src/ns.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器Namespace实用函数模块头文件 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _NS_H #define _NS_H diff --git a/cli/src/options.c b/cli/src/options.c index 603ee98..e34a3a4 100644 --- a/cli/src/options.c +++ b/cli/src/options.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具挂载选项 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "options.h" #include diff --git a/cli/src/options.h b/cli/src/options.h index e30eda1..aade70b 100644 --- a/cli/src/options.h +++ b/cli/src/options.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具挂载选项头文件 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _OPTIONS_H #define _OPTIONS_H diff --git a/cli/src/u_mount.c b/cli/src/u_mount.c index 32f9a72..99b88f9 100644 --- a/cli/src/u_mount.c +++ b/cli/src/u_mount.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器设备与驱动挂载模块 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "u_mount.h" #include diff --git a/cli/src/u_mount.h b/cli/src/u_mount.h index 0e987ee..59d90fe 100644 --- a/cli/src/u_mount.h +++ b/cli/src/u_mount.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具容器设备与驱动挂载模块头文件 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _MOUNT_H #define _MOUNT_H diff --git a/cli/src/utils.c b/cli/src/utils.c index 50c827e..605e381 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具实用函数模块 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "utils.h" #include diff --git a/cli/src/utils.h b/cli/src/utils.h index e4ba957..70d93d1 100644 --- a/cli/src/utils.h +++ b/cli/src/utils.h @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: ascend-docker-cli工具实用函数模块头文件 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef _UTILS_H #define _UTILS_H diff --git a/cli/test/dt/Depend/public_stub.cpp b/cli/test/dt/Depend/public_stub.cpp index 09ce4c2..d00bb6e 100644 --- a/cli/test/dt/Depend/public_stub.cpp +++ b/cli/test/dt/Depend/public_stub.cpp @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: 测试框架 -*/ + * Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef __PUBLIC_STUB_H__ #define __PUBLIC_STUB_H__ diff --git a/cli/test/dt/Depend/ut_main.cpp b/cli/test/dt/Depend/ut_main.cpp index 2ead79e..4fa6a69 100644 --- a/cli/test/dt/Depend/ut_main.cpp +++ b/cli/test/dt/Depend/ut_main.cpp @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: 测试框架 -*/ + * Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "gtest/gtest.h" #include diff --git a/cli/test/dt/Scripts/pre.sh b/cli/test/dt/Scripts/pre.sh index 63442c0..6f546ba 100644 --- a/cli/test/dt/Scripts/pre.sh +++ b/cli/test/dt/Scripts/pre.sh @@ -1,4 +1,19 @@ #!/bin/sh +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + cd ../Depend/ if [ -d "./lib" ]; then diff --git a/cli/test/dt/build.sh b/cli/test/dt/build.sh index f5eaa23..a0d5050 100644 --- a/cli/test/dt/build.sh +++ b/cli/test/dt/build.sh @@ -1,8 +1,23 @@ #!/bin/bash +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + CUR_DIR=$(cd `dirname $0`;pwd) SRC_ROOT="../../src" -# 检测执行pre脚本 +# execute pre script usage() { echo "usage:" diff --git a/cli/test/dt/testcase/gtest_mytest.cpp b/cli/test/dt/testcase/gtest_mytest.cpp index 3d6ebb2..cee96e8 100644 --- a/cli/test/dt/testcase/gtest_mytest.cpp +++ b/cli/test/dt/testcase/gtest_mytest.cpp @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: 测试集 -*/ + * Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/cli/test/dt/testcase/main.cpp b/cli/test/dt/testcase/main.cpp index 9fb3d12..e8b6588 100644 --- a/cli/test/dt/testcase/main.cpp +++ b/cli/test/dt/testcase/main.cpp @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: 测试框架主函数 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include "gtest/gtest.h" diff --git a/cli/test/dt_go/build.sh b/cli/test/dt_go/build.sh index 54704aa..8eb0fee 100644 --- a/cli/test/dt_go/build.sh +++ b/cli/test/dt_go/build.sh @@ -1,5 +1,19 @@ #!/bin/bash -# Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. +# Copyright(C) Huawei Technologies Co.,Ltd. 2020-2022. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ + set -e umask 077 CUR_DIR=$(dirname "$(readlink -f $0)") diff --git a/destroy/src/main.c b/destroy/src/main.c index ce3e68b..16136f1 100644 --- a/destroy/src/main.c +++ b/destroy/src/main.c @@ -1,7 +1,17 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved. - * Description: 算力切分数据销毁入口 -*/ + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/hook/main.go b/hook/main.go index e5695cc..e1128c7 100644 --- a/hook/main.go +++ b/hook/main.go @@ -1,7 +1,18 @@ -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. - * Description: ascend-docker-hook工具,配置容器挂载Ascend NPU设备 - */ +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( diff --git a/hook/main_test.go b/hook/main_test.go index 7a26252..b58ca14 100644 --- a/hook/main_test.go +++ b/hook/main_test.go @@ -1,7 +1,18 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: hook main 函数单元测试 - */ +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( diff --git a/install/deb/src/main.go b/install/deb/src/main.go index 1a4c40c..96ee722 100644 --- a/install/deb/src/main.go +++ b/install/deb/src/main.go @@ -1,6 +1,18 @@ -// Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. +/* Copyright(C) 2021. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -// Description: ascend-docker-runtime工具,辅助安装配置 + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( diff --git a/install/deb/src/main_test.go b/install/deb/src/main_test.go index 427b124..ebecd29 100644 --- a/install/deb/src/main_test.go +++ b/install/deb/src/main_test.go @@ -1,6 +1,18 @@ -// Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. +/* Copyright(C) 2021. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -// Description: ascend-docker-runtime工具,辅助安装配置 + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go index 9418f7c..2e03b8e 100644 --- a/mindxcheckutils/mindxcheckutils.go +++ b/mindxcheckutils/mindxcheckutils.go @@ -1,7 +1,18 @@ -// Package mindxcheckutils is a check utils package -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. - */ +/* Copyright(C) 2021. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package mindxcheckutils package mindxcheckutils import ( diff --git a/mindxcheckutils/mindxcheckutils_test.go b/mindxcheckutils/mindxcheckutils_test.go index 100d8fd..1d19a29 100644 --- a/mindxcheckutils/mindxcheckutils_test.go +++ b/mindxcheckutils/mindxcheckutils_test.go @@ -1,7 +1,18 @@ -// Package mindxcheckutils is a check utils package -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. - */ +/* Copyright(C) 2021. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package mindxcheckutils package mindxcheckutils import ( diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 0c9e483..f11ad75 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -1,7 +1,18 @@ -// Package dcmi is used to work with Ascend devices -/* - * Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. - */ +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package dcmi package dcmi // #cgo LDFLAGS: -ldl diff --git a/runtime/dcmi/dcmi_api.go b/runtime/dcmi/dcmi_api.go index 0884bee..677888f 100644 --- a/runtime/dcmi/dcmi_api.go +++ b/runtime/dcmi/dcmi_api.go @@ -1,4 +1,16 @@ -// Copyright(C) Huawei Technologies Co.,Ltd. 2020-2021. All rights reserved. +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ // Package dcmi is used to work with Ascend devices package dcmi diff --git a/runtime/dcmi/dcmi_api_test.go b/runtime/dcmi/dcmi_api_test.go index 4464677..e609d6f 100644 --- a/runtime/dcmi/dcmi_api_test.go +++ b/runtime/dcmi/dcmi_api_test.go @@ -1,6 +1,18 @@ -// Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -// Description: dcmi DT测试 + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Description: dcmi DT Test package dcmi import ( diff --git a/runtime/dcmi/dcmi_interface_api.h b/runtime/dcmi/dcmi_interface_api.h index 356916a..43233ed 100644 --- a/runtime/dcmi/dcmi_interface_api.h +++ b/runtime/dcmi/dcmi_interface_api.h @@ -1,8 +1,17 @@ /* - * Copyright: Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved. - * Description: DCMI API Reference + * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ - #ifndef __DCMI_INTERFACE_API_H__ #define __DCMI_INTERFACE_API_H__ #include diff --git a/runtime/main.go b/runtime/main.go index a067eeb..d173a67 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -1,7 +1,18 @@ -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved. - * Description: ascend-docker-runtime工具,配置容器挂载Ascend NPU设备 - */ +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( diff --git a/runtime/main_test.go b/runtime/main_test.go index d106bf4..8838313 100644 --- a/runtime/main_test.go +++ b/runtime/main_test.go @@ -1,7 +1,18 @@ -/** - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * Description: Runtime DT测试 - */ +/* Copyright(C) 2022. Huawei Technologies Co.,Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package main package main import ( -- Gitee From f4d78cc2fff6e19409bbc8939da6b448129bc871 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 15 Dec 2022 15:16:16 +0800 Subject: [PATCH 291/296] Match-id-02258f4d478a1e71dd60b93ca7dbff6cb2684ee6 --- build/cjson/CMakeLists.txt | 8 ---- ci/dependency.xml | 37 --------------- hook/glide.lock | 8 ---- hook/glide.yaml | 6 --- install/deb/scripts/control | 3 -- install/deb/scripts/postinst | 15 ------- install/deb/scripts/prerm | 15 ------- install/deb/src/install | 10 ----- install/rpm/ascend-docker-plgugin.spec | 62 -------------------------- runtime/glide.lock | 10 ----- runtime/glide.yaml | 8 ---- 11 files changed, 182 deletions(-) delete mode 100644 build/cjson/CMakeLists.txt delete mode 100644 ci/dependency.xml delete mode 100644 hook/glide.lock delete mode 100644 hook/glide.yaml delete mode 100644 install/deb/scripts/control delete mode 100644 install/deb/scripts/postinst delete mode 100644 install/deb/scripts/prerm delete mode 100644 install/deb/src/install delete mode 100644 install/rpm/ascend-docker-plgugin.spec delete mode 100644 runtime/glide.lock delete mode 100644 runtime/glide.yaml diff --git a/build/cjson/CMakeLists.txt b/build/cjson/CMakeLists.txt deleted file mode 100644 index 5f16c79..0000000 --- a/build/cjson/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# 查找当前目录下的所有源文件 -# 并将名称保存到 LIB_SRC 变量 -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../opensource/cJSON-1.7.14/ LIB_SRC) - -#生成链接库 -add_library(cjson ${LIB_SRC}) -target_compile_options(cjson PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2) - diff --git a/ci/dependency.xml b/ci/dependency.xml deleted file mode 100644 index 00e256f..0000000 --- a/ci/dependency.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - Component - Generic - - MindX - ascend-docker-plugin - 20.10.0.B010 - - - N - - - output/ - - - - - - - - BVersion - Generic - - Huawei Secure C - Huawei Secure C V100R001C01SPC011B003 - - - - /* - platform/ - - - - - diff --git a/hook/glide.lock b/hook/glide.lock deleted file mode 100644 index 24929cd..0000000 --- a/hook/glide.lock +++ /dev/null @@ -1,8 +0,0 @@ -hash: 2e6cc5f93b02ceb464215129229dab3c94e03effb60af73d3bc3e808db6573dc -updated: 2020-05-18T17:43:37.4199572+08:00 -imports: -- name: github.com/opencontainers/runtime-spec - version: c4ee7d12c742ffe806cd9350b6af3b4b19faed6f - subpackages: - - specs-go -testImports: [] diff --git a/hook/glide.yaml b/hook/glide.yaml deleted file mode 100644 index 6ae118f..0000000 --- a/hook/glide.yaml +++ /dev/null @@ -1,6 +0,0 @@ -package: ascend-docker-hook -import: -- package: github.com/opencontainers/runtime-spec - version: 1.0.2 - subpackages: - - specs-go diff --git a/install/deb/scripts/control b/install/deb/scripts/control deleted file mode 100644 index 65fdc00..0000000 --- a/install/deb/scripts/control +++ /dev/null @@ -1,3 +0,0 @@ -Maintainer: huawei -Description: asenddockertool. - The asend docker tool help usr to modify a customed deamon.json. diff --git a/install/deb/scripts/postinst b/install/deb/scripts/postinst deleted file mode 100644 index 29dc923..0000000 --- a/install/deb/scripts/postinst +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -DIR=/etc/docker -if [ ! -d "${DIR}" ]; then -mkdir ${DIR} -fi -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -BINDIR=/usr/bin -${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "create damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "create damom.json success\n" diff --git a/install/deb/scripts/prerm b/install/deb/scripts/prerm deleted file mode 100644 index ebfb388..0000000 --- a/install/deb/scripts/prerm +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -DIR=/etc/docker -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -if [ ! -f "${DST}" ]; then -exit 0 -fi -BINDIR=/usr/bin -${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "del damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "del damom.json success\n" diff --git a/install/deb/src/install b/install/deb/src/install deleted file mode 100644 index 10c46f6..0000000 --- a/install/deb/src/install +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash -echo "extract files\n" -if [ ! -d "../cjson" ];then - mkdir ../src -else - rm -rf ../src -fi -/bin/cp -rf ${files} ../cjson -tar -zxvf ../*.tar.gz -files=`find ../ -name "cJSON.*"` diff --git a/install/rpm/ascend-docker-plgugin.spec b/install/rpm/ascend-docker-plgugin.spec deleted file mode 100644 index f6f27aa..0000000 --- a/install/rpm/ascend-docker-plgugin.spec +++ /dev/null @@ -1,62 +0,0 @@ -Name: ascend-docker-runtime -Version: 20.10.0.B020 -Release: 1 -Summary: simple RPM package -License: FIXME - -%define _binaries_in_noarch_packages_terminate_build 0 - -%description -ascend-docker-plugin helps usrs to use NPU in docker - -%prep - -%build - -%install -mkdir -p %{buildroot}/usr/bin/ -cp -rf %{buildroot}/../../SOURCES/ascend* %{buildroot}/usr/bin/ - -%pre - -%post -#!/bin/bash -DIR=/etc/docker -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -BINDIR=/usr/bin -if [ ! -d "${DIR}" ]; then -mkdir ${DIR} -fi -${BINDIR}/ascend-docker-plugin-install-helper add ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "create damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "create damom.json success\n" - -%preun -#!/bin/bash -DIR=/etc/docker -BINDIR=/usr/bin -SRC="${DIR}/daemon.json.${PPID}" -DST="${DIR}/daemon.json" -if [ ! -f "${DST}" ]; then -exit 0 -fi -${BINDIR}/ascend-docker-plugin-install-helper rm ${DST} ${SRC} -if [ "$?" != "0" ]; then -echo "del damon.json failed\n" -exit 1 -fi -\mv ${SRC} ${DST} -echo "del damom.json success\n" - -%postun - -%clean - -%files -%defattr(0755,root,root,0755) -/usr/bin/* diff --git a/runtime/glide.lock b/runtime/glide.lock deleted file mode 100644 index 9756eec..0000000 --- a/runtime/glide.lock +++ /dev/null @@ -1,10 +0,0 @@ -hash: a46c3790a0bd1e9a947dbc2b99b121124f0fa20ced6c16cb92be7c37fa397ed9 -updated: 2020-05-28T16:15:29.2965911+08:00 -imports: -- name: github.com/opencontainers/runtime-spec - version: c4ee7d12c742ffe806cd9350b6af3b4b19faed6f - subpackages: - - specs-go -- name: github.com/prashantv/gostub - version: 24ed9cdea43de1d52ea20cab2b7a38e7ed6886b3 -testImports: [] diff --git a/runtime/glide.yaml b/runtime/glide.yaml deleted file mode 100644 index f731cf9..0000000 --- a/runtime/glide.yaml +++ /dev/null @@ -1,8 +0,0 @@ -package: ascend-docker-runtime -import: -- package: github.com/opencontainers/runtime-spec - version: ^1.0.2 - subpackages: - - specs-go -- package: github.com/prashantv/gostub - version: ^1.0.0 -- Gitee From 175c397cb900b6e5907d39bf2f897fb7639e7146 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Thu, 15 Dec 2022 17:39:40 +0800 Subject: [PATCH 292/296] Match-id-7d2b04013a4bf51dbc264c00d0fd6f854997f199 --- build/scripts/run_main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index acaf7e1..1e6ea5f 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -225,7 +225,7 @@ do fi INSTALL_PATH_FLAG=y INSTALL_PATH=$(echo $3 | cut -d"=" -f2) - INSTALL_PATH=$(echo ${INSTALL_PATH} | sed "s/\/*$//g") + INSTALL_PATH=$(echo ${INSTALL_PATH}/Ascend-Docker-Runtime | sed "s/\/*$//g") shift ;; --upgrade) -- Gitee From f3fbdfa5744b63e9f22ae3d14c24e546c0bed228 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 27 Dec 2022 17:30:13 +0800 Subject: [PATCH 293/296] Match-id-01fa6b385d40e24add634cf100168ba39bdd5e36 --- mindxcheckutils/mindxcheckutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindxcheckutils/mindxcheckutils.go b/mindxcheckutils/mindxcheckutils.go index 2e03b8e..7fee4d0 100644 --- a/mindxcheckutils/mindxcheckutils.go +++ b/mindxcheckutils/mindxcheckutils.go @@ -251,7 +251,7 @@ func ChangeRuntimeLogMode(runLog, operLog string) error { return nil }) if err != nil { - return fmt.Errorf("traversal runLogDir failed") + return fmt.Errorf("traversal runLogDir failed: %s", err) } return nil } -- Gitee From 7a515f00e351718f907b33838f60682401fb47b5 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Sun, 29 Jan 2023 19:03:32 +0800 Subject: [PATCH 294/296] Match-id-9c948d43139f7302d7a02a1b5be784eab9606c6d --- install/deb/src/go.sum | 664 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 652 insertions(+), 12 deletions(-) diff --git a/install/deb/src/go.sum b/install/deb/src/go.sum index 3e15b58..91dc4f9 100644 --- a/install/deb/src/go.sum +++ b/install/deb/src/go.sum @@ -1,25 +1,665 @@ -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 h1:Dq2tZTuClykBv1tS6C2XU6hY/waVK0K5lyr/8tJcT/I= -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3/go.mod h1:tuvVYh4aDcHqpiyNKZNiBgt1XBehJ130VubLidKWNjY= -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 h1:nGlHkoj7L6DdSYFFLjceD6t5XrNAKrM+Gk3wT0iOfWE= -codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6/go.mod h1:gzaoiHwloaNTtm46GVe93KtXMcXVHJ8LBVqWEAjmh+0= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0 h1:JfB5Kmce3mWEzbtAhybJozGp6+yJH+jU7D6WytEcOzs= +gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0/go.mod h1:78lAYBVM18u8mobeoKqhJP7POvbayTYBk32hnm9IkfQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/agiledragon/gomonkey/v2 v2.8.0 h1:u2K2nNGyk0ippzklz1CWalllEB9ptD+DtSXeCX5O000= github.com/agiledragon/gomonkey/v2 v2.8.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs= +github.com/smartystreets/assertions v1.13.0/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956 h1:XeJjHH1KiLpKGb6lvMiksZ9l0fVUh+AmGcm0nOMEBOY= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/cri-api v0.19.4/go.mod h1:UN/iU9Ua0iYdDREBXNE9vqCJ7MIh/FW3VIL0d8pw7Fw= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -- Gitee From 26d3facd3bdde484d068d049c918bffd96895331 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Mon, 30 Jan 2023 10:23:51 +0800 Subject: [PATCH 295/296] Match-id-55e8cf78245b4f80b3c57191c7fddcd8953cf4bc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 043bd4c..0ca9e4c 100644 --- a/README.md +++ b/README.md @@ -253,4 +253,4 @@ systemctl daemon-reload && systemctl restart docker ## 版本更新记录 | 版本 | 发布日期 | 修改说明 | |:------:|:----:|:-----:| -| v3.0.0 | 1230 | 第一次发布 | +| v3.0.0 | 2023-01-18 | 第一次发布 | -- Gitee From c86088687fa7dc0c16d9ff7ea5d93d925be267e4 Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Tue, 31 Jan 2023 14:06:54 +0800 Subject: [PATCH 296/296] Match-id-6e1b38f2f1ae74d3d9fe0ab6ad371d9e92e9e497 --- OWNERS | 9 ++ README.md | 238 ++++---------------------------------- build/build.sh | 10 +- build/scripts/run_main.sh | 3 +- 4 files changed, 41 insertions(+), 219 deletions(-) create mode 100644 OWNERS diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..ed1b165 --- /dev/null +++ b/OWNERS @@ -0,0 +1,9 @@ +approvers: + - songxiangbing + - luorui +reviewers: + - songxiangbing + - luorui + - biantanggui + - kangfuan + - lining \ No newline at end of file diff --git a/README.md b/README.md index 0ca9e4c..c95a1f1 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ +# Ascend Docker Runtime.zh +[组件介绍](##"组件介绍") +[编译Ascend Docker Runtime](##"编译Ascend Docker Runtime") +[组件安装](##"组件安装") +[更新日志](##"更新日志") - # 简介 +## 组件介绍 容器引擎插件(Ascend Docker,又叫昇腾容器)是CANN的基础组件,为所有的AI训练/推理作业提供Ascend NPU(昇腾处理器)容器化支持,使用户AI作业能够以Docker容器的方式平滑运行在昇腾设备之上,如图1-1所示。 图1-1 Ascend Docker ![image](assets/20210329102949456.png) -## Ascend Docker价值 -- 充分解耦:与Docker解耦,无需修改Docker代码,Runtime可以独立演进。 -- 后向兼容:提供可选装的Runtime,不影响原生Docker使用方式。 -- 易适配:与客户现有平台和系统平滑适配,不影响原Docker的命令接口。 -- 易部署:提供run包部署,用户安装后即可用Docker创建挂载Ascend NPU的容器。 -## Ascend Docker设计简介 +### Ascend Docker设计简介 + Ascend Docker本质上是基于OCI标准实现的Docker Runtime,不修改Docker引擎,对Docker以插件方式提供Ascend NPU适配功能。 如图1-2所示,Ascend Docker通过OCI接口与原生Docker对接。在原生Docker的runc启动容器过程中,会调用prestart-hook对容器进行配置管理。 @@ -26,231 +27,36 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置 3.将Host上的CANN Runtime Library挂载到容器的namespace。 *** -# 安装、使用和卸载 -*注意:目前Ascend Docker Runtime只支持root用户安装Ascend Docker Runtime* -## 安装前准备 - -* 安装大于18.03版本的docker,请进入[安装详情](https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/)。 -* 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373) 的“准备硬件环境”章节。 - -## 安装步骤 -### 下载源码 +## 编译Ascend Docker Runtime +执行以下步骤进行编译 ```shell -# 下载Ascend Docker Runtime源码 +# 1、下载Ascend Docker Runtime源码 git clone https://gitee.com/ascend/ascend-docker-runtime.git -# 下载安全函数库 + +# 2、下载安全函数库 cd ascend-docker-runtime/platform git clone https://gitee.com/openeuler/libboundscheck.git -# 下载makeself + +# 3、下载makeself cd ../opensource git clone https://gitee.com/src-openeuler/makeself.git tar -zxvf makeself/makeself-2.4.2.tar.gz -``` -### 编译 -```shell +# 4、编译 cd ../build -# 编译 bash build.sh ``` - -### 安装 +编译完成后,会在output文件夹看到相应的二进制run包 ```shell -cd ../output -chmod +x Ascend-docker-runtime_{version}_linux-{arch}.run -./Ascend-docker-runtime_{version}_linux-{arch}.run --install -``` - -### 安装成功后需要运行以下命令让Ascend Docker Runtime生效 -```shell -systemctl daemon-reload && systemctl restart docker -``` - -### 组件状态确认 -安装完成之后,验证Ascend Docker Runtime是否安装成功,可执行如下步骤: -* 安装Ascend-docker-runtime后,配置文件“/etc/docker/daemon.json”中的内容会被修改,其中"default-runtime"与"runtimes"字段如下所示: -```json -{ - "default-runtime": "ascend", - ... - "runtimes": { - "ascend": { - "path": "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime", - "runtimeArgs": [] - } - } -} -``` -* 执行docker info查看默认Runtime是否为ascend,若是则表示Ascend Docker Runtime安装成功,示例如下: -```shell -$docker info +root@#:ascend-docker-runtime/output# ll ... -Runtimes: ascend runc -Default Runtime: ascend -... -``` -*** -### 说明 -```text -· Atlas 200 AI加速模块(RC场景)、Atlas 200I SoC A1核心板和Atlas 500 智能小站支持Ascend-Docker-Runtime工具 - - 安装时需指定--install-type=用于设置Ascend-Docker-Runtime的默认挂载: - - Atlas 200 AI加速模块(RC场景)安装时执行如下命令: - - ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-type=A200 - - Atlas 200I SoC A1核心板安装时执行如下命令: - - ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-type=A200ISoC - - Atlas 500 智能小站安装时执行如下命令: - - ./Ascend-docker-runtime_{version}_linux-{arch}.run --install --whitelist=docker-runtime --install-type=A500 - -· 如果以root用户安装,建议不要安装在非root用户目录下,否则存在被非root用户替换root用户文件以达到提权目的的安全风险。 - -· 如果用户指定路径安装时,请确认指定路径符合所在组织的安全要求。 - -· 如果用户未指定安装路径,则软件会安装到默认路径下,默认安装路径为:/usr/local/Ascend +-rwxr-xr-x ... Ascend-docker-runtime_3.0.0_linux-x86_64.run* ``` -*** -## 使用 -### 在Docker客户端使用 -* 示例1:启动容器时,挂载物理芯片ID为0的芯片。 -```shell -docker run -it -e ASCEND_VISIBLE_DEVICES=0 image-name:tag /bin/bash -``` -* 示例2:启动容器时,仅挂载NPU设备和管理设备,不挂载驱动相关目录。 -```shell -docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_OPTIONS=NODRV image-name:tag /bin/bash -``` -* 示例3:启动容器时,挂载物理芯片ID为0的芯片,读取自定义配置文件hostlog中的挂载内容。 -```shell -run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=hostlog image-name:tag /bin/bash -``` -* 示例4:启动容器时,挂载虚拟芯片ID为100的芯片。 -```shell -docker run -it -e ASCEND_VISIBLE_DEVICES=100 -e ASCEND_RUNTIME_OPTIONS=VIRTUAL image-name:tag /bin/bash -``` -* 示例5:启动容器时,从物理芯片ID为0的芯片上,切分出4个AI Core作为虚拟设备并挂载至容器中。 -```shell -docker run -it --rm -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_VNPU_SPECS=vir04 image-name:tag /bin/bash -``` -容器启动后,可使用 -*ls /dev | grep davinci\* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin* -命令来检查相应设备和驱动是否挂载成功,每台机型具体的挂载目录参考Ascend Docker Runtime[默认挂载内容](##"默认挂载内容")。如下所示(具体内容因机型而异): -```shell -root@ee30eeda9058:/# ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin -davinci0 -davinci1 -davinci2 -davinci4 -davinci_manager -devmm_svm -hisi_hdc -include lib64 -dcmi -npu-smi -``` - -## 默认挂载内容 - -### Atlas 200 AI加速模块 RC场景 -| 挂载项 | 备注 | -|:------------------------------:|:-----------------------:| -| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | -| /dev/davinci_manager | 管理设备 | -| /usr/local/Ascend/driver/tools | 目录,驱动提供的工具包 | -| /usr/local/Ascend/driver/lib64 | 目录,驱动提供的用户态库 | -| /usr/local/sbin/npu-smi | 文件,npu-smi工具 | -| /etc/hdcBasic.cfg | 文件,hdc基础文件 | -| /etc/sys_version.conf | 文件,驱动的版本信息 | - - -### Atlas 200I SoC A1核心板 -| 挂载项 | 备注 | -|:------------------------------------------------:|:-------------------------:| -| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | -| /dev/davinci_manager | 管理设备 | -| /usr/local/bin/npu-smi | 文件,npu-smi工具 | -| /etc/hdcBasic.cfg | 文件,hdc基础文件 | -| /etc/sys_version.conf | 文件,驱动的版本信息 | - -### Atlas 500 智能小站 -| 挂载项 | 备注 | -|:-----------------------------:|:-----------------------:| -| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | -| /dev/davinci_manager | 管理设备 | -| /dev/hisi_hdc | 管理设备 | -| /dev/devmm_svm | 管理设备 | -| /home/data/miniD/driver/lib64 | 目录,驱动提供的用户态库 | -| /usr/local/lib/libdcmi.so | 文件,DCMI的动态库 | -| /usr/local/bin/npu-smi | 文件,npu-smi工具 | - -### 其他设备 -| 挂载项 | 备注 | -|:---------------------------------:|:-----------------------:| -| /dev/davinciX | NPU设备,X是ID号,例如,davinci0 | -| /dev/davinci_manager | 管理设备 | -| /dev/hisi_hdc | 管理设备 | -| /dev/devmm_svm | 管理设备 | -| /home/data/miniD/driver/lib64 | 目录,驱动提供的用户态库 | -| /usr/local/Ascend/driver/include | 目录,驱动提供的头文件 | -| /usr/local/dcmi | 目录,DCMI头文件和库 | -| /usr/local/bin/npu-smi | 文件,npu-smi工具 | - - - - -## 卸载 - -当不需要使用Ascend Docker Runtime时,可使用如下两种方法进行卸载 -*** -方法一:软件包卸载 -* 首先进入安装包(run包)所在路径 -```shell -cd -``` -* 用户可通过以下命令卸载Ascend Docker Runtime -```shell -./Ascend-docker-runtime_{version}_linux-{arch}.run --uninstall -``` -*** -方法二:脚本卸载 -* 首先进入Ascend Docker的安装路径下的“script”目录(默认安装路径为:“/usr/local/Ascend/Ascend-Docker-Runtime”) -```shell -cd /usr/local/Ascend/Ascend-Docker-Runtime/script -``` -* 运行卸载的脚本进行卸载 -```shell -./uninstall.sh -``` -*** -卸载后需要运行以下命令使用默认的runc -```shell -systemctl daemon-reload && systemctl restart docker -``` - -## 升级 - -在升级Ascend Docker Runtime时,可执行如下步骤升级 -* 安装包下载完成后,首先进入安装包(run包)所在路径。 -```shell -cd -``` -* 可通过以下命令安装Ascend Docker Runtime。 -```shell -chmod +x Ascend-docker-runtime_{version}_linux-{arch}.run -./Ascend-docker-runtime_{version}_linux-{arch}.run --upgrade -``` -* 安装成功后需要运行以下命令让Ascend Docker Runtime生效。 -```shell -systemctl daemon-reload && systemctl restart docker -``` +## 组件安装 +请参考[《MindX DL用户指南》](https://www.hiascend.com/software/mindx-dl)中的“集群调度用户指南 > 安装部署指导 > 安装集群调度组件 > 典型安装场景 > 集群调度场景”进行。 -## 版本更新记录 +## 更新日志 | 版本 | 发布日期 | 修改说明 | |:------:|:----:|:-----:| | v3.0.0 | 2023-01-18 | 第一次发布 | diff --git a/build/build.sh b/build/build.sh index 0cd66c7..6f4bbb3 100644 --- a/build/build.sh +++ b/build/build.sh @@ -50,7 +50,14 @@ RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}") RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}} PACKAGENAME="Ascend-docker-runtime" -VERSION="3.0.0" + +VERSION="v3.0.0" +version_file="${TOP_DIR}"/service_config.ini +if [ -f "$version_file" ]; then + line=$(sed -n '4p' "$version_file" 2>&1) + #cut the chars after ':' + VERSION=${line#*:} +fi CPUARCH=$(uname -m) @@ -127,6 +134,7 @@ function copy_file_output() RUN_PKG_NAME="${PACKAGENAME}_${VERSION}_linux-${CPUARCH}.run" DATE=$(date -u "+%Y-%m-%d") + sed -i "s/REPLACE_VERSION/${VERSION}/g" run_pkg/run_main.sh bash ${OPENSRC}/makeself-release-2.4.2/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \ --tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh mv ${RUN_PKG_NAME} ${OUTPUT} diff --git a/build/scripts/run_main.sh b/build/scripts/run_main.sh index d9a8370..95673c5 100644 --- a/build/scripts/run_main.sh +++ b/build/scripts/run_main.sh @@ -20,8 +20,7 @@ set -e ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d DOCKER_CONFIG_DIR=/etc/docker INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime -readonly PACKAGE_VERSION=3.0.0 - +readonly PACKAGE_VERSION=REPLACE_VERSION function save_install_args() { if [ -f "${INSTALL_PATH}"/ascend_docker_runtime_install.info ]; then -- Gitee