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_GetArgc</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_GetArgc <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <DIV align="left"> 16 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 17 </DIV> 18 <PRE><CODE>int OS_GetArgc( void ); 19 </CODE></PRE> 20</DL> 21<H2>Arguments</H2> 22<P>None.</P> 23<H2>Return Values</H2> 24 25<P>The number of arguments including the program name are returned.</P> 26<P>However, if argument data is not stored in the argument buffer, zero is returned. If data is stored in the argument buffer and there are no arguments, one is returned.</P> 27<H2>Description</H2> 28 29<P>Returns the number of arguments according to the argument data embedded in the ROM file.</P> 30<P>For NITRO ROMs, arguments are embedded as argument data in the ROM file with the <A href="../../tools/buryarg.html"><CODE>buryarg</CODE></A> tool. For TWL ROMs, arguments are embedded as argument data in the ROM file with the <A href="../../tools/buryarg.html"><CODE>buryarg.TWL</CODE></A> tool. This function looks up the the number of arguments within the argument data, but because the program name (the ROM filename specified when <A href="../../tools/buryarg.html"><CODE>buryarg</CODE></A> is executed) is included in the count, this function returns 1 even though there are no arguments.</P> 31<P>Zero is returned if no argument data has been embedded.</P> 32<P><FONT color="#ff0000">Always returns zero with FINALROM builds.</FONT></P> 33<P><B>Example</B></P> 34<BLOCKQUOTE style="background-color:#ffffc0">If <CODE>buryarg main.srl A B C</CODE> was specified, running the following code will display <CODE>argc=3</CODE>. <BR><BR><CODE>OS_Printf( "argc=%d\n", OS_GetArgc() );</CODE><BR><BR> (The same is true with <CODE>buryarg.TWL</CODE>.)</BLOCKQUOTE> 35<H2>See Also</H2> 36<P><A href="OS_GetArgv.html"><CODE>OS_GetArgv</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></P> 37<H2>Revision History</H2> 38<P>2008/06/23 Split into separate cases for NITRO and TWL.<BR>2005/07/21 Initial version.</P> 39<hr><p>CONFIDENTIAL</p></body> 40</HTML>