diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-26 14:22:34 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-26 14:22:34 -0400 |
commit | eb5931167b60e44a8bdbcaf2e4b59e8112ac02b1 (patch) | |
tree | fc5fc121a3d6282b75ed5214c33cb4c98f6084ae /f2toxex.c | |
parent | 7ac47df9cdcf7aaf550694a0bd64bc630e47de92 (diff) | |
download | bw-atari8-tools-eb5931167b60e44a8bdbcaf2e4b59e8112ac02b1.tar.gz |
f2toxex: added (stub).
Diffstat (limited to 'f2toxex.c')
-rw-r--r-- | f2toxex.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/f2toxex.c b/f2toxex.c new file mode 100644 index 0000000..c2a4934 --- /dev/null +++ b/f2toxex.c @@ -0,0 +1,64 @@ +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <errno.h> + +#include "xex.h" + +#define SELF "f2toxex" + +void version() { + printf(SELF " " VERSION "\n"); +} + +void usage() { + version(); + printf(" Usage: " SELF " [-h | -v] | infile [outfile]\n"); +} + +char *make_outfile(char *infile) { +} + +int main(int argc, char **argv) { + int c; + char *infile, *outfile; + + while( (c = getopt(argc, argv, "hv")) > 0) { + switch(c) { + case 'h': + usage(); + exit(0); + break; + case 'v': + version(); + exit(0); + break; + default: + fprintf(stderr, SELF ": unknown option '-%c'.\n", c); + usage(); + exit(1); + break; + } + } + + if(argc > optind) { + infile = argv[optind]; + optind++; + } + + if(argc > optind) { + strcpy(outfile, argv[optind]); + optind++; + + if(argc > optind) + fprintf(stderr, SELF ": " + "ignoring extra junk on command line: '%s'.\n", argv[optind]); + } else if(strcmp(infile, "-") != 0) { + outfile = make_outfile(infile); + } + + + return 0; +} |