LibreOffice
LibreOffice 6.0 SDK C/C++ API Reference
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 
63 typedef void ( SAL_CALL *oslGenericFunction )( void );
64 
65 #ifndef DISABLE_DYNLOADING
66 
74 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode);
75 
85 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode);
86 
98 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleRelative(
99  oslGenericFunction baseModule, rtl_uString * relativePath, sal_Int32 mode);
100 
113 SAL_DLLPUBLIC oslModule SAL_CALL osl_loadModuleRelativeAscii(
114  oslGenericFunction baseModule, char const * relativePath, sal_Int32 mode);
115  /* This function is guaranteed not to call into
116  FullTextEncodingDataSingleton in sal/textenc/textenc.cxx, so can be used
117  in its implementation without running into circles. */
118 
119 #endif
120 
138 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getModuleHandle(rtl_uString *pModuleName, oslModule *pResult);
139 
140 #ifndef DISABLE_DYNLOADING
141 
144 SAL_DLLPUBLIC void SAL_CALL osl_unloadModule(oslModule Module);
145 
146 #endif
147 
157 SAL_DLLPUBLIC void* SAL_CALL osl_getSymbol( oslModule Module, rtl_uString *strSymbolName);
158 
174  oslModule Module, rtl_uString *ustrFunctionSymbolName );
175 
194  oslModule Module, const sal_Char *pSymbol );
195 
203  void *pv, rtl_uString **pustrURL );
204 
219  oslGenericFunction pf, rtl_uString **pustrFunctionURL );
220 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #endif // INCLUDED_OSL_MODULE_H
226 
227 /* 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:121
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.
SAL_DLLPUBLIC oslGenericFunction osl_getFunctionSymbol(oslModule Module, rtl_uString *ustrFunctionSymbolName)
Lookup the specified function symbol name.
unsigned char sal_Bool
Definition: types.h:39
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(* oslGenericFunction)(void)
Generic Function pointer type that will be used as symbol address.
Definition: module.h:63
void * oslModule
Definition: module.h:56