#include <nitro/os.h>
int OS_GetArgc( void );
None.
The number of arguments including the program name are returned.
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.
Returns the number of arguments according to the argument data embedded in the ROM file.
For NITRO ROMs, arguments are embedded as argument data in the ROM file with the buryarg
tool. For TWL ROMs, arguments are embedded as argument data in the ROM file with the buryarg.TWL
tool. This function looks up the the number of arguments within the argument data, but because the program name (the ROM filename specified when buryarg
is executed) is included in the count, this function returns 1 even though there are no arguments.
Zero is returned if no argument data has been embedded.
Always returns zero with FINALROM builds.
Example
Ifburyarg main.srl A B C
was specified, running the following code will displayargc=3
.OS_Printf( "argc=%d\n", OS_GetArgc() );
(The same is true withburyarg.TWL
.)
OS_GetArgv
OS_GetOpt
buryarg
Tool
buryarg.TWL
Tool
2008/06/23 Split into separate cases for NITRO and TWL.
2005/07/21 Initial version.
CONFIDENTIAL