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_CalcEnoughBufferSizeforLink*</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">EL_CalcEnoughBufferSizeforLink* <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> <BR> <CODE>s32 EL_CalcEnoughBufferSizeforLink( <A href="ELReadImage.html">ELReadImage</A> readfunc, u32 len, const void* buf, <a href="ELLinkMode.html">ELLinkMode</a> link_mode );</CODE><br> <CODE>s32 EL_CalcEnoughBufferSizeforLinkFile( const char* FilePath, const void* buf, <a href="ELLinkMode.html">ELLinkMode</a> link_mode);</CODE><br> <CODE>s32 EL_CalcEnoughBufferSizeforLinkImage( void* obj_image, u32 obj_len, const void* buf, <a href="ELLinkMode.html">ELLinkMode</a> link_mode );</CODE>
16  </DD>
17</DL>
18<H2>Arguments</H2>
19<TABLE border="1" width="100%">
20  <TBODY>
21    <TR>
22<TD><EM><STRONG>readfunc</STRONG></EM></TD>
23<TD>Developer-specific Read function.</TD>
24    </TR>
25    <TR>
26<TD><EM><STRONG>FilePath</STRONG></EM></TD>
27<TD>Path name of the dynamic module to register.</TD>
28    </TR>
29    <TR>
30<TD><EM><STRONG>obj_image</STRONG></EM></TD>
31<TD>Memory address of the dynamic module to register.</TD>
32    </TR>
33    <TR>
34<TD><EM><STRONG>len / obj_len</STRONG></EM></TD>
35<TD>Size of the dynamic module to register.</TD>
36    </TR>
37    <TR>
38<TD><EM><STRONG>buf</STRONG></EM></TD>
39<TD>Buffer where the dynamic module will be registered.<br>Nothing is actually written here.</TD>
40    </TR>
41    <TR>
42<TD><EM><STRONG>link_mode</STRONG></EM></TD>
43<TD>Mode when the dynamic link is tested.<br>As of now, the only mode that can be specified is <CODE>EL_LINKMODE_ONESHOT</CODE>.</TD>
44    </TR>
45  </TBODY>
46</TABLE>
47
48<H2>Return Values</H2>
49<P>
50If the process succeeds, the function returns the required buffer size.<BR>If it fails, it returns a value of -1.
51</P>
52
53<H2>Description</H2>
54<P>
55Determines what size buffer is enough to register the dynamic module to the EL library.<BR>If the dynamic module makes external references, this function may return a somewhat larger size.<BR><BR> The <code>EL_CalcEnoughBufferSizeforLink</code> function uses the user-specified read function to read the dynamic module.<BR>The <code>EL_CalcEnoughBufferSizeforLinkFile</code> function reads the dynamic module being registered from ROM.<BR>The <code>EL_CalcEnoughBufferSizeforLinkImage</code> function uses the dynamic module that has been loaded into memory.<BR>
56</P>
57
58<H2>See Also</H2>
59<P><CODE><A href="ELReadImage.html">ELReadImage</CODE></A></P>
60<H2>Revision History</H2>
61<P>
622009/01/14 Initial version.</P>
63<hr><p>CONFIDENTIAL</p></body>
64</HTML>
65