pr_findsymbolandlibrary.rst (1530B)
1 PR_FindSymbolAndLibrary 2 ======================= 3 4 Finds a symbol in one of the currently loaded libraries, and returns 5 both the symbol and the library in which it was found. 6 7 8 Syntax 9 ------ 10 11 .. code:: 12 13 #include <prlink.h> 14 15 void* PR_FindSymbolAndLibrary ( 16 const char *name, 17 PRLibrary **lib); 18 19 20 Parameters 21 ~~~~~~~~~~ 22 23 The function has these parameters: 24 25 ``name`` 26 The textual representation of the symbol to locate. 27 ``lib`` 28 A reference to a location at which the runtime will store the library 29 in which the symbol was discovered. This location must be 30 pre-allocated by the caller. 31 32 33 Returns 34 ~~~~~~~ 35 36 If successful, returns a non-``NULL`` pointer to the found symbol, and 37 stores a pointer to the library in which it was found at the location 38 pointed to by lib. 39 40 If the symbol could not be found, returns ``NULL``. 41 42 43 Description 44 ----------- 45 46 This function finds the specified symbol in one of the currently loaded 47 libraries. It returns the address of the symbol. Upon return, the 48 location pointed to by the parameter lib contains a pointer to the 49 library that contains that symbol. The location must be pre-allocated by 50 the caller. 51 52 The function returns ``NULL`` if no such function can be found. The 53 order in which the known libraries are searched in not specified. This 54 function is equivalent to calling first :ref:`PR_LoadLibrary`, then 55 :ref:`PR_FindSymbol`. 56 57 The identity returned from this function must be the target of a 58 :ref:`PR_UnloadLibrary` in order to return the runtime to its original 59 state.