LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
module.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_OSL_MODULE_H
21 #define INCLUDED_OSL_MODULE_H
22 
23 #include <sal/config.h>
24 
25 #include <rtl/tencinfo.h>
26 #include <rtl/ustring.h>
27 #include <sal/saldllapi.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifdef SAL_DLLPREFIX
34 #define SAL_MODULENAME(name) SAL_DLLPREFIX name SAL_DLLEXTENSION
35 #else
36 #define SAL_MODULENAME(name) name SAL_DLLEXTENSION
37 #endif
38 
39 #if defined(SAL_W32)
40 #define SAL_MODULENAME_WITH_VERSION(name, version) name version SAL_DLLEXTENSION
41 
42 #elif defined(SAL_UNX)
43 #if defined(MACOSX)
44 #define SAL_MODULENAME_WITH_VERSION(name, version) SAL_DLLPREFIX name ".dylib." version
45 #else
46 #define SAL_MODULENAME_WITH_VERSION(name, version) SAL_DLLPREFIX name SAL_DLLEXTENSION "." version
47 #endif
48 
49 #endif
50 
51 #define SAL_LOADMODULE_DEFAULT 0x00000
52 #define SAL_LOADMODULE_LAZY 0x00001
53 #define SAL_LOADMODULE_NOW 0x00002
54 #define SAL_LOADMODULE_GLOBAL 0x00100
55 
56 typedef void* oslModule;
57 
62 typedef void ( SAL_CALL *oslGenericFunction )( void );
63 
64 #ifndef DISABLE_DYNLOADING
65 
71 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode);
72 
79 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode);
80 
98 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleRelative(
99  oslGenericFunction baseModule, rtl_uString * relativePath, sal_Int32 mode);
100 
119 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleRelativeAscii(
120  oslGenericFunction baseModule, char const * relativePath, sal_Int32 mode);
121  /* This function is guaranteed not to call into
122  FullTextEncodingDataSingleton in sal/textenc/textenc.cxx, so can be used
123  in its implementation without running into circles. */
124 
125 #endif
126 
147 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getModuleHandle(rtl_uString *pModuleName, oslModule *pResult);
148 
149 #ifndef DISABLE_DYNLOADING
150 
153 SAL_DLLPUBLIC void SAL_CALL osl_unloadModule(oslModule Module);
154 
155 #endif
156 
160 SAL_DLLPUBLIC void* SAL_CALL osl_getSymbol( oslModule Module, rtl_uString *strSymbolName);
161 
185  oslModule Module, rtl_uString *ustrFunctionSymbolName );
186 
210  oslModule Module, const sal_Char *pSymbol );
211 
212 
219  void *pv, rtl_uString **pustrURL );
220 
243  oslGenericFunction pf, rtl_uString **pustrFunctionURL );
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif // INCLUDED_OSL_MODULE_H
250 
251 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC oslModule osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode)
Load a shared library or module.
SAL_DLLPUBLIC sal_Bool osl_getModuleURLFromFunctionAddress(oslGenericFunction pf, rtl_uString **pustrFunctionURL)
Lookup URL of module which is mapped at the specified function address.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
char sal_Char
A legacy synonym for char.
Definition: types.h:130
SAL_DLLPUBLIC sal_Bool osl_getModuleHandle(rtl_uString *pModuleName, oslModule *pResult)
Retrieve the handle of an already loaded module.
SAL_DLLPUBLIC oslModule osl_loadModuleRelativeAscii(oslGenericFunction baseModule, char const *relativePath, sal_Int32 mode)
Load a module located relative to some other module.
SAL_DLLPUBLIC oslGenericFunction osl_getAsciiFunctionSymbol(oslModule Module, const sal_Char *pSymbol)
Lookup the specified function symbol name.
SAL_DLLPUBLIC oslModule osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode)
Load a shared library or module.
SAL_DLLPUBLIC sal_Bool osl_getModuleURLFromAddress(void *pv, rtl_uString **pustrURL)
Lookup URL of module which is mapped at the specified address.
void(* oslGenericFunction)(void)
Generic Function pointer type that will be used as symbol address.
Definition: module.h:62
SAL_DLLPUBLIC oslGenericFunction osl_getFunctionSymbol(oslModule Module, rtl_uString *ustrFunctionSymbolName)
Lookup the specified function symbol name.
unsigned char sal_Bool
Definition: types.h:48
SAL_DLLPUBLIC void osl_unloadModule(oslModule Module)
Release the module.
SAL_DLLPUBLIC oslModule osl_loadModuleRelative(oslGenericFunction baseModule, rtl_uString *relativePath, sal_Int32 mode)
Load a module located relative to some other module.
SAL_DLLPUBLIC void * osl_getSymbol(oslModule Module, rtl_uString *strSymbolName)
lookup the specified symbol name.
void * oslModule
Definition: module.h:56