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.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>OS_ConvertToArguments</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_ConvertToArguments <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>void OS_ConvertToArguments( const char* str, 17 char cs, 18 chat* buffer, 19 u32 bufferSize ); 20 </CODE></PRE> 21</DL> 22<H2>Arguments</H2> 23<TABLE border="1"> 24 <TBODY> 25 <TR> 26<TD><SPAN class="argument">str</SPAN></TD> 27<TD>String used for the argument data.</TD> 28 </TR> 29 <TR> 30<TD><SPAN class="argument">cs</SPAN></TD> 31<TD>Separates characters in arguments.</TD> 32 </TR> 33 <TR> 34<TD><SPAN class="argument">buffer</SPAN></TD> 35<TD>Argument buffer for storing argument data.</TD> 36 </TR> 37 <TR> 38<TD><SPAN class="argument">bufferSize</SPAN></TD> 39<TD>Size of argument buffer.</TD> 40 </TR> 41 </TBODY> 42</TABLE> 43<H2>Return Values</H2> 44<P>None.</P> 45<H2>Description</H2> 46<P>Converts the string into argument data and stores it in the specified buffer.</P> 47<P>This converted argument data can be retrieved by <A href="OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A>, <A href="OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A>, or <A href="OS_GetOpt.html"><CODE>OS_GetOpt</CODE></A>. Although by default the argument buffer area held in the system is used (argument data can be embedded here using the <A href="../../tools/buryarg.html"><CODE>buryarg</CODE></A> or <A href="../../tools/buryarg.html"><CODE>buryarg.TWL</CODE></A> tools), you can switch to another argument buffer using the <A href="../../tools/buryarg.html"><CODE>OS_SetArgumentBuffer</CODE></A> function.</P> 48<P>Specify the string used for argument data in <SPAN class="argument">str</SPAN> and the separator character for arguments in <SPAN class="argument">cs</SPAN>.</P> 49<BLOCKQUOTE><B>Example:</B> If " " (space) is used as the separator and the three arguments "-a", "123", and "test string" are to be passed, specify as follows.</BLOCKQUOTE> 50<BLOCKQUOTE style="background-color:#ffffcc;"> <CODE>OS_ConvertToArguments( "dummy -a 123 \"test string\"",<BR> ' ', buffer, size );</CODE></BLOCKQUOTE> 51<BLOCKQUOTE> </BLOCKQUOTE> 52<BLOCKQUOTE>Because <CODE>OS_GetArgv(0)</CODE> is the program name by default and <CODE>OS_GetOpt</CODE> begins analysis from the item corresponding to <CODE>OS_GetArgv(1)</CODE>, the dummy program name "<CODE>dummy</CODE>" is assigned to the string.</BLOCKQUOTE> 53<BLOCKQUOTE>" <CODE>test string</CODE>" includes a space (delimiter) in the middle, but is handled as a single argument by enclosing with " ".</BLOCKQUOTE> 54<P><SPAN class="argument">buffer</SPAN> specifies the buffer area in which argument data is to be stored. <SPAN class="argument">bufferSize</SPAN> specifies the buffer size. Data is not written to the buffer beyond this region.</P> 55<P>This function does nothing in the FINALROM build.</P> 56<H2>See Also</H2> 57<P><A href="OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A><BR> <A href="OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A><BR> <A href="OS_GetOpt.html"><CODE>OS_GetOpt</CODE></A><BR> <A href="../../tools/buryarg.html"><CODE>buryarg</CODE> Tool</A><BR> <A href="../../tools/buryarg.html"><CODE>buryarg.TWL</CODE> Tool</A><BR> <A href="OS_GetArgumentBuffer.html"><CODE>OS_GetArgumentBuffer</CODE></A><BR> <A href="OS_ConvertToArguments.html"><CODE>OS_ConvertToArguments</CODE></A></P> 58<H2>Revision History</H2> 59<P>2008/07/09 Added information on <A href="../../tools/buryarg.html"><CODE>buryarg.TWL</CODE></A>.<BR> 2005/09/09 Initial version.</P> 60<hr><p>CONFIDENTIAL</p></body> 61</HTML>