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 <twl/el.h></CODE><BR> 16 <BR> 17 <CODE>s32 EL_CalcEnoughBufferSizeforLink( <A href="ELReadImage.html">ELReadImage</A> readfunc, u32 len, const void* buf, ELLinkMode link_mode );</CODE><br> 18 <CODE>s32 EL_CalcEnoughBufferSizeforLinkFile( const char* FilePath, const void* buf, ELLinkMode link_mode);</CODE><br> 19 <CODE>s32 EL_CalcEnoughBufferSizeforLinkImage( void* obj_image, u32 obj_len, const void* buf, ELLinkMode link_mode );</CODE> 20 </DD> 21</DL> 22<H2>Arguments</H2> 23<TABLE border="1" width="100%"> 24 <TBODY> 25 <TR> 26 <TD><SPAN class="argument">readfunc</SPAN></TD> 27 <TD>Developer-specific read function.</TD> 28 </TR> 29 <TR> 30 <TD><SPAN class="argument">FilePath</SPAN></TD> 31 <TD>Path name of the dynamic module to be registered.</TD> 32 </TR> 33 <TR> 34 <TD><SPAN class="argument">obj_image</SPAN></TD> 35 <TD>Memory address of the dynamic module to be registered.</TD> 36 </TR> 37 <TR> 38 <TD><SPAN class="argument">len / obj_len</SPAN></TD> 39 <TD>Size of the dynamic module to be registered.</TD> 40 </TR> 41 <TR> 42 <TD><SPAN class="argument">buf</SPAN></TD> 43 <TD>Buffer where the dynamic module will be registered.<br>Nothing is actually written here.</TD> 44 </TR> 45 <TR> 46 <TD><SPAN class="argument">link_mode</SPAN></TD> 47 <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> 48 </TR> 49 </TBODY> 50</TABLE> 51 52<H2>Return Values</H2> 53<P> 54If the process succeeds, the function returns the required buffer size.<BR> If it fails, it returns a value of -1. 55</P> 56 57<H2>Description</H2> 58<P> 59Determines 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> 60</P> 61 62<H2>See Also</H2> 63<P><A href="ELReadImage.html"><CODE>ELReadImage</CODE></A></P> 64<H2>Revision History</H2> 65<P> 662009/01/14 Initial version.</P> 67<hr><p>CONFIDENTIAL</p></body> 68</HTML> 69