XINU
Functions
xsh_argecho.c File Reference

引数を順に表示する。 More...

#include <xinu.h>
#include <stdio.h>
Include dependency graph for xsh_argecho.c:

Go to the source code of this file.

Functions

shellcmd xsh_argecho (int nargs, char *args[])
 引数を順に表示する。 More...
 

Detailed Description

引数を順に表示する。

Definition in file xsh_argecho.c.

Function Documentation

◆ xsh_argecho()

shellcmd xsh_argecho ( int  nargs,
char *  args[] 
)

引数を順に表示する。

「引数番号」と「引数番号に対応する引数(文字列として扱う)」が1行単位で出力される。

Parameters
[in]nargs引数の数
[in]args引数(引数を持つ配列)
Returns
0を返す。

Definition at line 15 of file xsh_argecho.c.

References printf().

16 {
17  int32 i;
18 
19  printf("\n\nThe %d arguments are:\n", nargs);
20  for (i = 0; i < nargs; i++)
21  {
22  printf(" %2d: %s\n", i, args[i]);
23  }
24  printf("\n");
25 
26  return 0;
27 }
int32 printf(const char *,...)
Definition: printf.c:13
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
Here is the call graph for this function: