Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // Part of : libdl library
16 // Dll entry point functions
23 #include <dlfcn.h> //RTLD_DEFAULT
24 #include "libdl_r.h" //_r functions
28 // EXTERNAL FUNCTION PROTOTYPES
31 //-----------------------------------------------------------------------------
32 //Function Name : void* dlopen(const char* filename, int flag)
33 //Description : It takes the filename of the dynamic library to be loaded.
34 // The dynamic library is loaded and a "handle" to this executable
35 // is returned to the caller.
36 //Return Value : valid handle if succesful otherwise NULL and an error message
37 // is logged. The user can retrieve the error message through a
39 //-----------------------------------------------------------------------------
40 EXPORT_C void* dlopen(const char* filename, int flag)
46 return __dlopen_r(filename, flag);;
49 //-----------------------------------------------------------------------------
50 //Function Name : void* dlsym(void* handle, const char* symbol)
51 //Description : It takes the handle (as returned by dlopen or RTLD_DEFAULT/
52 // RTLD_NEXT/RTLD_SELF) and the NULL terminated string for symbol
53 // name or the ordinal number. It locates the symbol corresponding
54 // to this name or ordinal number.
55 //Return Value : Symbols address address if the symbol name or ordinal number
56 // is found, otherwise NULL is returned and an error message is
57 // logged. The user can retrieve the error message through a call
59 //-----------------------------------------------------------------------------
60 EXPORT_C void* dlsym(void* handle, const char* symbol)
62 return __dlsym_r(handle, symbol);
65 //-----------------------------------------------------------------------------
66 //Function Name : char* dlerror(void)
67 //Description : Gives the last error that occurred due to any of the dl
69 //Return Value : a NULL-terminated character string that gives the last error
70 // that occurred due to any of the dl operations. If no errors
71 // have occurred since the last call to dlerror(), dlerror()
73 //-----------------------------------------------------------------------------
74 EXPORT_C char* dlerror(void)
76 return (char*) __dlerror_r();
80 //-----------------------------------------------------------------------------
81 //Function Name : int dlclose(void* handle)
82 //Description : Decrements the reference count corresponding to the handle.
83 // If refrence count becomes zero library is unloaded.
84 //Return Value : 0 on success otherwise non zero value
85 //-----------------------------------------------------------------------------
86 EXPORT_C int dlclose(void* handle)
88 return __dlclose_r(handle);