1*f3cac8d6SAndrew Rist /**************************************************************
2*f3cac8d6SAndrew Rist  *
3*f3cac8d6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f3cac8d6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f3cac8d6SAndrew Rist  * distributed with this work for additional information
6*f3cac8d6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f3cac8d6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f3cac8d6SAndrew Rist  * "License"); you may not use this file except in compliance
9*f3cac8d6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f3cac8d6SAndrew Rist  *
11*f3cac8d6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f3cac8d6SAndrew Rist  *
13*f3cac8d6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f3cac8d6SAndrew Rist  * software distributed under the License is distributed on an
15*f3cac8d6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f3cac8d6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f3cac8d6SAndrew Rist  * specific language governing permissions and limitations
18*f3cac8d6SAndrew Rist  * under the License.
19*f3cac8d6SAndrew Rist  *
20*f3cac8d6SAndrew Rist  *************************************************************/
21*f3cac8d6SAndrew Rist 
22cdf0e10cSrcweir 
23cdf0e10cSrcweir #include  <salhelper/dynload.hxx>
24cdf0e10cSrcweir #include <rtl/ustring>
25cdf0e10cSrcweir #include <stdio.h>
26cdf0e10cSrcweir #include "samplelib.hxx"
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir using namespace salhelper;
30cdf0e10cSrcweir using namespace rtl;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class SampleLibLoader
34cdf0e10cSrcweir 	: public ::salhelper::ODynamicLoader<SampleLib_Api>
35cdf0e10cSrcweir {
36cdf0e10cSrcweir public:
SampleLibLoader()37cdf0e10cSrcweir 	SampleLibLoader():
38cdf0e10cSrcweir 		::salhelper::ODynamicLoader<SampleLib_Api>
39cdf0e10cSrcweir 			(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME( "samplelib") ) ),
40cdf0e10cSrcweir 			 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SAMPLELIB_INIT_FUNCTION_NAME) ))
41cdf0e10cSrcweir 		{}
42cdf0e10cSrcweir 
43cdf0e10cSrcweir };
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 
main(int argc,char * argv[],char * envp[])46cdf0e10cSrcweir int main( int argc, char *argv[ ], char *envp[ ] )
47cdf0e10cSrcweir {
48cdf0e10cSrcweir 	SampleLibLoader Loader;
49cdf0e10cSrcweir 	SampleLibLoader Loader2;
50cdf0e10cSrcweir 	Loader= Loader2;
51cdf0e10cSrcweir 	SampleLib_Api *pApi= Loader.getApi();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	sal_Int32 retint= pApi->funcA( 10);
54cdf0e10cSrcweir 	double retdouble= pApi->funcB( 3.14);
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	return 0;
58cdf0e10cSrcweir }
59