1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>EL_GetGlobalAdr</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">EL_GetGlobalAdr <img src="../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <CODE>#include &lt;twl/el.h&gt;</CODE><BR>
16  <BR>
17  <CODE>typedef u32   ELDlld;</CODE><BR>
18  <BR>
19  <CODE>void* EL_GetGlobalAdr( ELDlld my_dlld, const char* ent_name );
20  </CODE>
21</DL>
22<H2>Arguments</H2>
23<TABLE border="1" width="100%">
24  <TBODY>
25    <TR>
26      <TD><EM><STRONG>my_dlld</STRONG></EM></TD>
27      <TD>Dynamic module to search for symbols.</TD>
28    </TR>
29    <TR>
30      <TD><EM><STRONG>ent_name</STRONG></EM></TD>
31      <TD>Symbol name for which an address will be obtained.</TD>
32    </TR>
33  </TBODY>
34</TABLE>
35
36<H2>Return Values</H2>
37<P>
38Returns the symbol's address if the symbol is found in the specified dynamic module.<BR>Returns 0 if not found.<BR>
39</P>
40
41<H2>Description</H2>
42<P>
43Returns the address for the symbol corresponding to the specified string from the specified dynamic module. (If 0 is specified for the <CODE>my_dlld</CODE> argument, this will search all dynamic modules that were attempted to be linked.) In cases such as calling a dynamic module function from the static module, get its address using this function, and then call the function through the function pointer.<BR><BR>Because pointers are used to access dynamic module symbols from the static module and type checking is not performed when compiling, make sure to verify the correct type by checking the dynamic module's header file and substituting the correct pointer type for this function's return value or by taking similar measures. <BR>
44<P><BR> Example: Accessing a dynamic module's <CODE>u16</CODE> variable.<BR> <BR> <CODE>u16* dll_data_p;</CODE><BR> <CODE>dll_data_p = (u16*)EL_GetGlobalAdr( dlld, &quot;dll_data&quot;);</CODE><BR> <CODE>OS_TPrintf( &quot;dll_data:%d\n&quot;, *dll_data_p);</CODE><BR>
45</P><BR>
46<P><BR> Example: Calling a dynamic module function.<BR> <BR> <CODE>typedef void (*dllfunc)( u16 a)</CODE><BR> <CODE>dllfunc dll_func1;</CODE><BR> <CODE>dll_func1 = (dllfunc)EL_GetGlobalAdr( dlld, &quot;dll_func1&quot;);</CODE><BR> <CODE>dll_func1( 0x1234);</CODE><BR>
47</P>
48</P>
49
50<H2>See Also</H2>
51<P></CODE><CODE><A href="EL_AddStaticSym.html">EL_AddStaticSym</A></CODE></P>
52<H2>Revision History</H2>
53<P>
542008/07/11 Added <CODE>ELDlld</CODE>. <BR>2007/08/21 Initial version.</P>
55<hr><p>CONFIDENTIAL</p></body>
56</HTML>
57