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 char* buffer, 19 u32 bufferSize ); 20 </CODE></PRE> 21</DL> 22<H2>Arguments</H2> 23<TABLE border="1"> 24 <TBODY> 25 <TR> 26 <TD><EM><B>str</B></EM></TD> 27 <TD>The string used for the argument data.</TD> 28 </TR> 29 <TR> 30 <TD><EM><B>cs</B></EM></TD> 31 <TD>Separates characters in arguments.</TD> 32 </TR> 33 <TR> 34 <TD><EM><B>buffer</B></EM></TD> 35 <TD>Argument buffer for storing argument data.</TD> 36 </TR> 37 <TR> 38 <TD><EM><B>bufferSize</B></EM></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>The string is converted into argument data and stored 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>, <CODE><A href="OS_GetArgv.html">OS_GetArgv</A></CODE> or <CODE><A href="OS_GetOpt.html">OS_GetOpt</A></CODE>. Although by default the argument buffer area held in the system is used (argument data can be embedded here using the <CODE><A href="../../tools/buryarg.html">buryarg</A></CODE> or <CODE><A href="../../tools/buryargTWL.html">buryarg.TWL</A></CODE> tools), you can switch to another argument buffer using <CODE><A href="../../tools/buryargTWL.html">OS_SetArgumentBuffer()</A></CODE>.</P> 48<P>Specify the string used for argument data in <EM><B>str</B></EM> and the separator character for arguments in <EM><B>cs</B></EM>.</P> 49<BLOCKQUOTE><B>(Example)<BR></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 51<BLOCKQUOTE style="background-color:#ffffcc;"> <PRE>OS_ConvertToArguments( "dummy -a 123 \"test string\"", 52 ' ', buffer, size );</PRE></BLOCKQUOTE> 53 54<BLOCKQUOTE> </BLOCKQUOTE> 55<BLOCKQUOTE>Because <CODE>OS_GetArgv(0)</CODE> is the program name by default and<CODE> OS_GetOpt()</CODE> begins anaylsis from the item corresponding to <CODE>OS_GetArgv(1)</CODE>, the dummy program name "<CODE>dummy</CODE>" is assigned to the string.</BLOCKQUOTE> 56<BLOCKQUOTE>" <CODE>test string</CODE>" includes a space (delimiter) in the middle, but is handled as a single argument by enclosing with " ".</BLOCKQUOTE> 57<P><EM><B>buffer</B></EM> specifies the buffer area in which argument data is to be stored.<EM><B>bufferSize</B></EM> specifies the buffer size. Data is not written to the buffer beyond this region.</P> 58<P>This function does nothing in the FINALROM build.</P> 59<H2>See Also</H2> 60<P><CODE><A href="OS_GetArgv.html">OS_GetArgv</A>, <A href="OS_GetArgc.html">OS_GetArgc</A>, <A href="OS_GetOpt.html">OS_GetOpt</A><BR> <A href="../../tools/buryarg.html">buryarg Tool</A>,</CODE> <CODE><A href="../../tools/buryargTWL.html">buryarg.TWL Tool</A></CODE><BR> <CODE><A href="OS_GetArgumentBuffer.html">OS_GetArgumentBuffer</A>, <A href="OS_ConvertToArguments.html">OS_ConvertToArguments</A></CODE></P> 61<H2>Revision History</H2> 62<P>2008/07/09 Added information on <CODE><A href="../../tools/buryargTWL.html">buryarg.TWL</A></CODE>. <BR>2005/09/09 Initial version.</P> 63<hr><p>CONFIDENTIAL</p></body> 64</HTML>