Philipp Lohmann - Sun Germany wrote
Since osl_getModuleHandle simply can not fail on unix, another option
would be to always return '-1' and map this to RTLD_DEFAULT in
osl_getAsciiFunctionSymbol.
What do you think ?
Well, that happens to be RTLD_NEXT on Linux. This would not be a problem
currently, but could become insurmountable if we ever want to use
RTLD_NEXT. I suggest separating returned handle and and error handling;
IMHO the sal_Bool (rtl_uString*,oslModule*) is the right thing to do.
I probably wasn't clear enough. I meant something like (pseudo code):
oslModule osl_getModuleHandle(rtl_uString *) { return -1; };
oslFunctionSymbel getAsciiFunctionSymbol(oslModule module, const
sal_Char *sym) {
if( module == -1 ) module = RTLD_DEFAULT;
[..]
}
The updated description would be:
This function can be used to search for a function symbol in the
process space.
Do not use the returned handle as an argument of osl_unloadModule.
On Unix platforms,
strModuleName gets ignored and the special handle ((void *) -1) is
returned, which is
treated as RTLD_DEFAULT by osl_getFunctionSymbol and
osl_getAsciiFunctionSymbol.
@param strModuleName
[in] denotes the name of the module to search for. Ignored on Unix
@return
NULL if the module could not be found, otherwise a handle to the
module or the
special handle '((void *) -1)'on Unix.
NOTE: do not call osl_unloadModule on the returned handle !
Thanks,
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]