2011-05-23 01:36:34 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2011-05-24 10:05:36 +00:00
|
|
|
#include <unistd.h>
|
2013-03-05 20:46:48 +00:00
|
|
|
|
2011-05-26 17:18:42 +00:00
|
|
|
#include "text.h"
|
2011-05-23 01:36:34 +00:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
FILE *fp;
|
2012-05-31 18:38:18 +00:00
|
|
|
int i;
|
2011-05-23 01:36:34 +00:00
|
|
|
|
2012-05-31 18:38:18 +00:00
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
eprintf("usage: %s [files...]\n", argv0);
|
|
|
|
} ARGEND;
|
|
|
|
|
2013-03-05 20:46:48 +00:00
|
|
|
if(argc == 0) {
|
2011-05-26 17:18:42 +00:00
|
|
|
concat(stdin, "<stdin>", stdout, "<stdout>");
|
2013-03-05 20:46:48 +00:00
|
|
|
} else for(i = 0; i < argc; i++) {
|
2012-05-31 18:38:18 +00:00
|
|
|
if(!(fp = fopen(argv[i], "r")))
|
|
|
|
eprintf("fopen %s:", argv[i]);
|
2013-03-05 20:46:48 +00:00
|
|
|
|
2012-05-31 18:38:18 +00:00
|
|
|
concat(fp, argv[i], stdout, "<stdout>");
|
2011-05-23 01:36:34 +00:00
|
|
|
fclose(fp);
|
|
|
|
}
|
2013-03-05 20:46:48 +00:00
|
|
|
|
|
|
|
return 0;
|
2011-05-23 01:36:34 +00:00
|
|
|
}
|