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 &lt;nitro/os.h&gt;</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 using the <CODE><A href="../../tools/buryarg.html">buryarg</A></CODE> tool. For TWL ROMs, arguments are embedded as argument data in the ROM file using the <CODE><A href="../../tools/buryargTWL.html">buryarg.TWL</A></CODE> tool. This function is used to look up the the number of arguments within the argument data, but since the program name (the ROM file name specified when <CODE><A href="../../tools/buryarg.html">buryarg</A></CODE> is executed) is included in the count, this function will return 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>Example</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( &quot;argc=%d\n&quot;, OS_GetArgc() );</CODE><BR><BR> (The same is true with <CODE>buryarg.TWL</CODE>)</BLOCKQUOTE>
35<H2>See Also</H2>
36<P><CODE><A href="OS_GetArgv.html">OS_GetArgv</A>, <A href="OS_GetOpt.html">OS_GetOpt</A><BR> <A href="../../tools/buryarg.html">buryarg Tool</A>, <A href="../../tools/buryargTWL.html">buryarg.TWL Tool</A></CODE></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>