diff options
| author | Yuichiro MASUI <[email protected]> | 2012-12-29 05:37:55 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2013-01-03 02:24:15 +0900 |
| commit | 7c469c0b9dadd1de09fed18c3e5cc551012c38c1 (patch) | |
| tree | b79aa703ef7c528896c4f1be8280d0691314008b /tools/xpcat | |
| parent | a48fc0d7952ad1f10ae777637269fe6a3f9ad0a2 (diff) | |
| download | mruby-7c469c0b9dadd1de09fed18c3e5cc551012c38c1.tar.gz mruby-7c469c0b9dadd1de09fed18c3e5cc551012c38c1.zip | |
Rebuild CRuby based building script without Makefile
Tested CRuby 1.8.6 and 1.9.3
You can see building configuration in build_config.rb
Diffstat (limited to 'tools/xpcat')
| -rw-r--r-- | tools/xpcat/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | tools/xpcat/xpcat.c | 72 |
2 files changed, 0 insertions, 77 deletions
diff --git a/tools/xpcat/CMakeLists.txt b/tools/xpcat/CMakeLists.txt deleted file mode 100644 index bb4d326f5..000000000 --- a/tools/xpcat/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# build tools/xpcat internal executable - -add_executable(xpcat xpcat.c) - -# vim: ts=2 sts=2 sw=2 et diff --git a/tools/xpcat/xpcat.c b/tools/xpcat/xpcat.c deleted file mode 100644 index e39babcb5..000000000 --- a/tools/xpcat/xpcat.c +++ /dev/null @@ -1,72 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -static void -usage(const char *program) -{ - printf("Usage: %s -o outputfile FILE...\n", program); -} - -int -main(int argc, char *argv[]) -{ - int i, ch; - const char *output = NULL; - FILE *infile = NULL; - FILE *outfile = NULL; - - if (argc < 4) { - usage(argv[0]); - return EXIT_FAILURE; - } - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-o") == 0) { - i++; - if (i < argc) - output = argv[i]; - else { - usage(argv[0]); - return EXIT_FAILURE; - } - } - } - - if (output) { - outfile = fopen(output, "wb"); - if (!outfile) { - fprintf(stderr, "[ERROR] unable to open output file: %s\n", output); - return EXIT_FAILURE; - } - setbuf(outfile, NULL); - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-o") == 0) { - i++; - continue; - } - - infile = fopen(argv[i], "rb"); - if (!infile) { - fprintf(stderr, "[ERROR] unable to open input file: %s\n", argv[i]); - return EXIT_FAILURE; - } - setbuf(infile, NULL); - - while ((ch = getc(infile)) != EOF) { - if (putc(ch, outfile) == EOF) { - fprintf(stderr, "[ERROR] error writing output file: %s\n", output); - return EXIT_FAILURE; - } - } - - fclose(infile); - } - } - - fclose(outfile); - return EXIT_SUCCESS; -} - -/* vim: set ts=2 sts=2 sw=2 et: */ |
