1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
25 #include <cppuhelper/factory.hxx>
26 #include <cppuhelper/implementationentry.hxx>
27 #include <debugservices/doctok/DocTokTestService.hxx>
28 #include <debugservices/doctok/DocTokAnalyzeService.hxx>
29 #include <debugservices/ooxml/OOXMLTestService.hxx>
30 #include <debugservices/ooxml/OOXMLAnalyzeService.hxx>
31 
32 #include <stdio.h>
33 
34 using namespace com::sun::star;
35 
36 
37 extern "C"
38 {
39 /* shared lib exports implemented with helpers */
40 static struct ::cppu::ImplementationEntry s_component_entries [] =
41 {//uno -l writerfilter.uno.dll -c debugservices.rtftok.ScannerTestService -- a b c
42 	DOCTOK_SCANNERTESTSERVICE_COMPONENT_ENTRY, /* debugservices.doctok.ScannerTestService */
43 	DOCTOK_ANALYZESERVICE_COMPONENT_ENTRY, /* debugservices.doctok.AnalyzeService */
44 	OOXML_SCANNERTESTSERVICE_COMPONENT_ENTRY, /* debugservices.ooxml.ScannerTestService */
45 	OOXML_ANALYZESERVICE_COMPONENT_ENTRY, /* debugservices.ooxml.AnalyzeService */
46 	{ 0, 0, 0, 0, 0, 0 } // terminate with NULL
47 };
48 
49 
50 SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)51 component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
52 {
53 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
54 }
55 
56 SAL_DLLPUBLIC_EXPORT void * SAL_CALL
component_getFactory(sal_Char const * implName,::com::sun::star::lang::XMultiServiceFactory * xMgr,::com::sun::star::registry::XRegistryKey * xRegistry)57 component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry )
58 {
59     fprintf(stderr, "Loading service: %s: ", implName);
60 
61     void * pResult = ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries );
62 
63     fprintf(stderr, "%p\n", pResult);
64 
65 	return pResult;
66 }
67 
68 }
69