From 869862a4db0c727e3797b15d41d6b865cb8f3350 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 1 Jul 2024 19:13:14 -0400 Subject: listbas: use a8cat instead of a8utf8 or a8eol. --- listbas.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'listbas.c') diff --git a/listbas.c b/listbas.c index a278bd7..329ff97 100644 --- a/listbas.c +++ b/listbas.c @@ -12,7 +12,7 @@ #include "bcdfp.h" #include "tokens.h" -int immediate = 0, a8utf8 = 0, a8eol = 1; +int immediate = 0, a8cat = 1, magazine = 0; FILE *outfh; @@ -21,18 +21,18 @@ void print_help(void) { printf(" -v: verbose.\n"); printf(" -i: show immediate mode command (line 32768).\n"); printf(" -a: output raw ATASCII.\n"); - printf(" -u: output Unicode.\n"); + printf(" -m: magazine style listing (see a8cat(1)).\n"); } void parse_args(int argc, char **argv) { int opt; - while( (opt = getopt(argc, argv, "viau")) != -1) { + while( (opt = getopt(argc, argv, "viam")) != -1) { switch(opt) { case 'v': verbose = 1; break; case 'i': immediate = 1; break; - case 'a': a8utf8 = a8eol = 0; break; - case 'u': a8utf8 = 1; a8eol = 0; break; + case 'a': a8cat = magazine = 0; break; + case 'm': a8cat = magazine = 1; break; default: print_help(); exit(1); @@ -50,10 +50,11 @@ void setup_outfh(void) { /* search current dir before PATH. no easy way to detect errors here, have to wait until we call pclose(). */ - if(a8eol) { - cmd = "./a8eol -u -c 2>/dev/null || a8eol -u -c 2>/dev/null || exit 1"; - } else if(a8utf8) { - cmd = "./a8utf8 2>/dev/null || a8utf8 2>/dev/null || exit 1"; + if(a8cat) { + if(magazine) + cmd = "./a8cat -m 2>/dev/null || a8cat -m 2>/dev/null || exit 1"; + else + cmd = "./a8cat 2>/dev/null || a8cat 2>/dev/null || exit 1"; } else { if(isatty(fileno(stdout))) { die("Refusing to write ATASCII data to the terminal."); @@ -72,9 +73,9 @@ void setup_outfh(void) { } void close_outfh(void) { - if(a8eol || a8utf8) { + if(a8cat) { if(pclose(outfh)) { - die("output filter failed; a8eol or a8utf8 not in current dir or $PATH."); + die("output filter failed; a8cat not in current dir or $PATH."); } } } -- cgit v1.2.3