incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1333456 - in /incubator/ooo/trunk/main/sal: inc/osl/module.h osl/all/loadmodulerelative.cxx osl/os2/module.c osl/unx/module.c osl/w32/module.cxx util/sal.map
Date Thu, 03 May 2012 13:44:30 GMT
Author: hdu
Date: Thu May  3 13:44:29 2012
New Revision: 1333456

URL: http://svn.apache.org/viewvc?rev=1333456&view=rev
Log:
add convenience method for dynamic loading

Modified:
    incubator/ooo/trunk/main/sal/inc/osl/module.h
    incubator/ooo/trunk/main/sal/osl/all/loadmodulerelative.cxx
    incubator/ooo/trunk/main/sal/osl/os2/module.c
    incubator/ooo/trunk/main/sal/osl/unx/module.c
    incubator/ooo/trunk/main/sal/osl/w32/module.cxx
    incubator/ooo/trunk/main/sal/util/sal.map

Modified: incubator/ooo/trunk/main/sal/inc/osl/module.h
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/inc/osl/module.h?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/inc/osl/module.h (original)
+++ incubator/ooo/trunk/main/sal/inc/osl/module.h Thu May  3 13:44:29 2012
@@ -66,9 +66,16 @@ typedef void ( SAL_CALL *oslGenericFunct
 
 /** Load a shared library or module.
     @param strModuleName denotes the name of the module to be loaded.
+    @param nRtldMode mode defined by logically OR-ing of SAL_LOADMODULE_* flags.
     @return NULL if the module could not be loaded, otherwise a handle to the module.
 */
 oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode);
+/** Load a shared library or module.
+    @param pModuleName denotes the name of the module to be loaded.
+    @param nRtldMode mode defined by logically OR-ing of SAL_LOADMODULE_* flags.
+    @return NULL if the module could not be loaded, otherwise a handle to the module.
+*/
+oslModule SAL_CALL osl_loadAsciiModule( const sal_Char* pModuleName, sal_Int32 nRtldMode);
 
 /** Load a module located relative to some other module.
 
@@ -79,8 +86,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uS
     @param relativePath
     a relative URL; must not be NULL.
 
-    @param mode
-    the SAL_LOADMODULE_xxx flags.
+    @param nRtldMode mode defined by logically OR-ing of SAL_LOADMODULE_* flags.
 
     @return
     a non-NULL handle to the loaded module, or NULL if an error occurred.
@@ -88,7 +94,23 @@ oslModule SAL_CALL osl_loadModule(rtl_uS
     @since UDK 3.2.8
 */
 oslModule SAL_CALL osl_loadModuleRelative(
-    oslGenericFunction baseModule, rtl_uString * relativePath, sal_Int32 mode);
+    oslGenericFunction baseModule, rtl_uString* relativePath, sal_Int32 nRtldMode);
+/** Load a module located relative to some other module.
+
+    @param baseModule
+    must point to a function that is part of the code of some loaded module;
+    must not be NULL.
+
+    @param relativePath
+    a relative URL; must not be NULL.
+
+    @param nRtldMode mode defined by logically OR-ing of SAL_LOADMODULE_* flags.
+
+    @return
+    a non-NULL handle to the loaded module, or NULL if an error occurred.
+*/
+oslModule SAL_CALL osl_loadAsciiModuleRelative(
+    oslGenericFunction baseModule, const sal_Char* relativePath, sal_Int32 nRtldMode);
 
 /** Retrieve the handle of an already loaded module.
 
@@ -153,7 +175,7 @@ oslGenericFunction SAL_CALL osl_getFunct
     @param Module
     [in] a module handle as returned by osl_loadModule or osl_getModuleHandle
 
-    @param pFunctionSymbolName
+    @param pSymbolName
     [in] Name of the function that will be looked up. 
    
     @return
@@ -167,7 +189,7 @@ oslGenericFunction SAL_CALL osl_getFunct
     @see osl_getModuleHandle
     @see osl_getFunctionSymbol
 */
-oslGenericFunction SAL_CALL osl_getAsciiFunctionSymbol(oslModule Module, const sal_Char *pSymbol);
+oslGenericFunction SAL_CALL osl_getAsciiFunctionSymbol(oslModule Module, const sal_Char *pSymbolName);
 
 
 /** Lookup URL of module which is mapped at the specified address.

Modified: incubator/ooo/trunk/main/sal/osl/all/loadmodulerelative.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/all/loadmodulerelative.cxx?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/osl/all/loadmodulerelative.cxx (original)
+++ incubator/ooo/trunk/main/sal/osl/all/loadmodulerelative.cxx Thu May  3 13:44:29 2012
@@ -64,4 +64,14 @@ oslModule SAL_CALL osl_loadModuleRelativ
     return ::osl_loadModule(abs.pData, mode);
 }
 
+oslModule SAL_CALL osl_loadAsciiModuleRelative(
+    oslGenericFunction const baseModule, const sal_Char* pRelativePathName,
+    sal_Int32 const nRtldMode)
+{
+	rtl_uString* pUniName = NULL;
+	rtl_uString_newFromAscii( &pUniName, pRelativePathName );
+	oslModule aModule = osl_loadModuleRelative( baseModule, pUniName, nRtldMode );
+	rtl_uString_release( pUniName );
+}
+
 }

Modified: incubator/ooo/trunk/main/sal/osl/os2/module.c
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/os2/module.c?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/osl/os2/module.c (original)
+++ incubator/ooo/trunk/main/sal/osl/os2/module.c Thu May  3 13:44:29 2012
@@ -54,6 +54,15 @@ ULONG APIENTRY _DosLoadModule (PSZ pszOb
 	return rc;
 }
 
+oslModule SAL_CALL osl_loadAsciiModule( const sal_Char* pModuleName, sal_Int32 nRtldMode
)
+{
+	rtl_uString* pUniName = NULL;
+	rtl_uString_newFromAscii( &pUniName, pModuleName );
+	oslModule aModule = osl_loadModule( pUniName, nRtldMode );
+	rtl_uString_release( pUniName );
+	return aModule;
+}
+
 oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMode)
 {
     HMODULE hModule;

Modified: incubator/ooo/trunk/main/sal/osl/unx/module.c
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/unx/module.c?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/osl/unx/module.c (original)
+++ incubator/ooo/trunk/main/sal/osl/unx/module.c Thu May  3 13:44:29 2012
@@ -37,8 +37,6 @@
 /* implemented in file.c */
 extern int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32);
 
-oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode);
-
 /*****************************************************************************/
 /* osl_loadModule */
 /*****************************************************************************/
@@ -59,7 +57,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uS
         char buffer[PATH_MAX];
 
         if (UnicodeToText(buffer, PATH_MAX, ustrTmp->buffer, ustrTmp->length))
-            pModule = osl_psz_loadModule(buffer, nRtldMode);
+            pModule = osl_loadAsciiModule(buffer, nRtldMode);
         rtl_uString_release(ustrTmp);
     }
 
@@ -67,10 +65,10 @@ oslModule SAL_CALL osl_loadModule(rtl_uS
 }
 
 /*****************************************************************************/
-/* osl_psz_loadModule */
+/* osl_loadAsciiModule */
 /*****************************************************************************/
 
-oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode)
+oslModule SAL_CALL osl_loadAsciiModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode)
 {
     OSL_ASSERT(
         (nRtldMode & SAL_LOADMODULE_LAZY) == 0 ||

Modified: incubator/ooo/trunk/main/sal/osl/w32/module.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/w32/module.cxx?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/osl/w32/module.cxx (original)
+++ incubator/ooo/trunk/main/sal/osl/w32/module.cxx Thu May  3 13:44:29 2012
@@ -101,6 +101,18 @@ oslModule SAL_CALL osl_loadModule(rtl_uS
 }
 
 /*****************************************************************************/
+/* osl_loadAsciiModule */
+/*****************************************************************************/
+oslModule SAL_CALL osl_loadAsciiModule( const sal_Char* pModuleName, sal_Int32 nRtldMode
)
+{
+	rtl_uString* pUniName = NULL;
+	rtl_uString_newFromAscii( &pUniName, pModuleName );
+	oslModule aModule = osl_loadModule( pUniName, nRtldMode );
+	rtl_uString_release( pUniName );
+	return aModule;
+}
+
+/*****************************************************************************/
 /* osl_getModuleHandle */
 /*****************************************************************************/
 

Modified: incubator/ooo/trunk/main/sal/util/sal.map
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/util/sal.map?rev=1333456&r1=1333455&r2=1333456&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/util/sal.map (original)
+++ incubator/ooo/trunk/main/sal/util/sal.map Thu May  3 13:44:29 2012
@@ -618,13 +618,19 @@ UDK_3.10 { # OOo 3.2
 } UDK_3.9;
 
 
-UDK_3.11 { # OOo 3.4
+UDK_3.11 { # AOO 3.4
     global:
         osl_setEnvironment;
         osl_clearEnvironment;
         osl_setThreadName;
 } UDK_3.10;
 
+UDK_3.12 { # AOO 3.5
+    global:
+        osl_loadAsciiModule;
+        osl_loadAsciiModuleRelative;
+} UDK_3.11;
+
 PRIVATE_1.0 {
     global:
         osl_detail_ObjectRegistry_storeAddresses;



Mime
View raw message