comparison mc09/test/cp.c @ 160:1a30cd6e5973

move mc09 to top
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 05 Feb 2019 09:03:07 +0900
parents os9/mc09/test/cp.c@36000611014b
children
comparison
equal deleted inserted replaced
159:1d574c5b3383 160:1a30cd6e5973
1 #include "mclibos9.c"
2
3 int
4 main(argc,argv)
5 int argc;char *argv[]; {
6 FILE *input ;
7 FILE *output ;
8 int c;
9 int i;
10
11 input = stdin;
12 output = stdout;
13
14 i = 1;
15 if (argv[i]) { input = fopen(argv[i++],"r"); }
16 if (argv[i]) { output = fopen(argv[i++],"w"); }
17 if (input==0 || output==0) return 0;
18 while( (c = getc(input) ) != -1) {
19 putc(c,output);
20 }
21 return 1;
22 }