X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhl.c;h=ef5f86099601f52b3d260b9a844aef2d45c208ab;hp=98e58d01948b5eac108ff4fd517e0aaced35fbf0;hb=e11983f44e59d8de236affa5b0d0d3067c192e24;hpb=dee26acad9bca6aec7dca5c428b07a386909081b diff --git a/uip/mhl.c b/uip/mhl.c index 98e58d0..ef5f860 100644 --- a/uip/mhl.c +++ b/uip/mhl.c @@ -41,41 +41,37 @@ #define QUOTE '\\' static struct swit mhlswitches[] = { -#define BELLSW 0 - { "bell", 0 }, -#define NBELLSW 1 - { "nobell", 0 }, -#define CLRSW 2 +#define CLRSW 0 { "clear", 0 }, -#define NCLRSW 3 +#define NCLRSW 1 { "noclear", 0 }, -#define FOLDSW 4 +#define FOLDSW 2 { "folder +folder", 0 }, -#define FORMSW 5 +#define FORMSW 3 { "form formfile", 0 }, -#define PROGSW 6 +#define PROGSW 4 { "moreproc program", 0 }, -#define LENSW 7 +#define LENSW 5 { "length lines", 0 }, -#define WIDTHSW 8 +#define WIDTHSW 6 { "width columns", 0 }, -#define SLEEPSW 9 +#define SLEEPSW 7 { "sleep seconds", 0 }, -#define VERSIONSW 10 +#define VERSIONSW 8 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 9 { "help", 0 }, -#define FORW1SW 12 +#define FORW1SW 10 { "forward", -7 }, -#define FORW2SW 13 +#define FORW2SW 11 { "forwall", -7 }, -#define DGSTSW 14 +#define DGSTSW 12 { "digest list", -6 }, -#define VOLUMSW 15 +#define VOLUMSW 13 { "volume number", -6 }, -#define ISSUESW 16 +#define ISSUESW 14 { "issue number", -5 }, -#define NBODYSW 17 +#define NBODYSW 15 { "nobody", -6 }, { NULL, 0 } }; @@ -90,13 +86,12 @@ static struct swit mhlswitches[] = { #define LEFTADJUST 0x000080 /* left justify multiple lines */ #define COMPRESS 0x000100 /* compress text */ #define ADDRFMT 0x000200 /* contains addresses */ -#define BELL 0x000400 /* sound bell at EOP */ -#define DATEFMT 0x000800 /* contains dates */ -#define FORMAT 0x001000 /* parse address/date/RFC-2047 field */ -#define INIT 0x002000 /* initialize component */ -#define SPLIT 0x004000 /* split headers (don't concatenate) */ -#define NONEWLINE 0x008000 /* don't write trailing newline */ -#define LBITS "\020\01NOCOMPONENT\02UPPERCASE\03CENTER\04CLEARTEXT\05EXTRA\06HDROUTPUT\07CLEARSCR\010LEFTADJUST\011COMPRESS\012ADDRFMT\013BELL\014DATEFMT\015FORMAT\016INIT\017SPLIT\020NONEWLINE" +#define DATEFMT 0x000400 /* contains dates */ +#define FORMAT 0x000800 /* parse address/date/RFC-2047 field */ +#define INIT 0x001000 /* initialize component */ +#define SPLIT 0x002000 /* split headers (don't concatenate) */ +#define NONEWLINE 0x004000 /* don't write trailing newline */ +#define LBITS "\020\01NOCOMPONENT\02UPPERCASE\03CENTER\04CLEARTEXT\05EXTRA\06HDROUTPUT\07CLEARSCR\010LEFTADJUST\011COMPRESS\012ADDRFMT\013DATEFMT\014FORMAT\015INIT\016SPLIT\017NONEWLINE" #define GFLAGS (NOCOMPONENT | UPPERCASE | CENTER | LEFTADJUST | COMPRESS | SPLIT) struct mcomp { @@ -120,7 +115,7 @@ static struct mcomp *fmthd = NULL; static struct mcomp *fmttl = NULL; static struct mcomp global = { - NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, BELL, 0 + NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, 0, 0 }; static struct mcomp holder = { @@ -172,8 +167,6 @@ static struct triple triples[] = { { "split", SPLIT, 0 }, { "nosplit", 0, SPLIT }, { "addrfield", ADDRFMT, DATEFMT }, - { "bell", BELL, 0 }, - { "nobell", 0, BELL }, { "datefield", DATEFMT, ADDRFMT }, { "newline", 0, NONEWLINE }, { "nonewline", NONEWLINE, 0 }, @@ -181,7 +174,6 @@ static struct triple triples[] = { }; -static int bellflg = 0; static int clearflg = 0; static int dobody = 1; static int forwflg = 0; @@ -312,13 +304,6 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case BELLSW: - bellflg = 1; - continue; - case NBELLSW: - bellflg = -1; - continue; - case CLRSW: clearflg = 1; continue; @@ -505,7 +490,7 @@ mhl_format(char *file, int length, int width) global.c_cwidth = -1; if ((i = sc_length()) > 5) global.c_length = i - 1; - global.c_flags = BELL; /* BELL is default */ + global.c_flags = 0; *(ip = ignores) = NULL; while (vfgets(fp, &ap) == OK) { @@ -604,15 +589,6 @@ out: global.c_flags &= ~CLEARSCR; } - switch (bellflg) { /* command line may override format file */ - case 1: - global.c_flags |= BELL; - break; - case -1: - global.c_flags &= ~BELL; - break; - } - if (length) global.c_length = length; if (width) @@ -1305,8 +1281,6 @@ putch(char ch) row++; if (row != global.c_length) break; - if (global.c_flags & BELL) - putchar('\007'); fflush(stdout); buf[0] = 0; read(fileno(stdout), buf, sizeof(buf));