diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-04-22 08:55:35 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-04-22 08:55:35 -0700 |
commit | 5d3642b8ef920316693031d2ea34b9def0b1abc5 (patch) | |
tree | 8100890ed5b2e4ecdbde09615e0820346ccc3f41 /sys/cmd/cat | |
parent | e30f8b22069bec1a3fb68f089a9a7198671eb09a (diff) |
chore: rm unfinished projects
Diffstat (limited to 'sys/cmd/cat')
-rw-r--r-- | sys/cmd/cat/cat.c | 40 | ||||
-rw-r--r-- | sys/cmd/cat/rules.mk | 13 | ||||
-rw-r--r-- | sys/cmd/cat/test.c | 8 |
3 files changed, 0 insertions, 61 deletions
diff --git a/sys/cmd/cat/cat.c b/sys/cmd/cat/cat.c deleted file mode 100644 index a82cfe4..0000000 --- a/sys/cmd/cat/cat.c +++ /dev/null @@ -1,40 +0,0 @@ -#include <u.h> -#include <libn.h> - -static -void -cat(Stream *f, byte *name) -{ - long n; - static byte buf[8192]; - - while(n = io·read(f, 1, arrlen(buf), buf), n > 0) { - if (io·write(stdout, 1, n, buf) != n) { - panicf("failed to write while copying stream '%s'", name); - } - } - - if (n < 0) { - panicf("failed to read from buffer '%s'", name); - } -} - - -int -main(int argc, char *argv[]) -{ - int i; - Stream *f; - - if (argc == 1) { - f = stdin; - cat(f, "<stdin>"); - } else for (i = 1; i < argc; i++) { - if (f = io·open(argv[i], "r"), f == nil) - panicf("can't open %s", argv[i]); - cat(f, argv[i]); - io·close(f); - } - - exit(0); -} diff --git a/sys/cmd/cat/rules.mk b/sys/cmd/cat/rules.mk deleted file mode 100644 index 27eac26..0000000 --- a/sys/cmd/cat/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -include share/push.mk - -# Local sources -SRCS_$(d) := $(d)/cat.c -BINS_$(d) := $(d)/cat - -include share/paths.mk - -$(BINS_$(d)): TCLIBS := $(OBJ_DIR)/libn/libn.a -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libn/libn.a - $(LINK) - -include share/pop.mk diff --git a/sys/cmd/cat/test.c b/sys/cmd/cat/test.c deleted file mode 100644 index c1b850e..0000000 --- a/sys/cmd/cat/test.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <u.h> -#include <libn.h> - -error -main() -{ - return 0; -} |