diff --git a/Makefile b/Makefile index 230cf4b..61f8193 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ SRCSG4=src/g4code.c src/faxg4coder.c SRCSLZW=src/lzwcode.c src/faxlzwcoder.c CFLAGS=-O3 -funroll-all-loops -finline-functions -Wall +LDFLAGS=-s +RM=rm -f OBJSPBM=$(SRCSPBM:.c=.o) OBJSG4=$(SRCSG4:.c=.o) @@ -15,10 +17,10 @@ OBJSLZW=$(SRCSLZW:.c=.o) all: $(PROGS) clean: - rm -f $(PROGS) $(OBJSPBM) $(OBJSG4) $(OBJSLZW) + $(RM) $(PROGS) $(OBJSPBM) $(OBJSG4) $(OBJSLZW) $(PROGG4): $(OBJSPBM) $(OBJSG4) - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(PROGLZW): $(OBJSPBM) $(OBJSLZW) - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) diff --git a/man/man1/faxg4coder.1 b/man/man1/faxg4coder.1 index f42384a..ab8bf84 100644 --- a/man/man1/faxg4coder.1 +++ b/man/man1/faxg4coder.1 @@ -1,4 +1,4 @@ -.TH "faxg4coder" 1 0.2 "20 Oct 2023" "User Manual" +.TH "faxg4coder" 1 0.2.1 "21 Oct 2023" "User Manual" .SH NAME faxg4coder @@ -26,12 +26,12 @@ Put/Read MMR header to file -decode{W} Decode to pbm-file, using image width {W}, e.g. -decode1728 (default, if not given), else : encode from pbm-file .TP --p -Write plain pbm -.TP -b Read/Write bitstrings .TP +-p +Write plain pbm +.TP -h Show help @@ -52,6 +52,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 .SH SEE ALSO faxlzwcoder(1) + netpbm(1) .SH CONTACTS Website: diff --git a/man/man1/faxlzwcoder.1 b/man/man1/faxlzwcoder.1 index f6b3188..cc7c484 100644 --- a/man/man1/faxlzwcoder.1 +++ b/man/man1/faxlzwcoder.1 @@ -1,10 +1,10 @@ -.TH "faxlzwcoder" 1 0.2 "20 Oct 2023" "User Manual" +.TH "faxlzwcoder" 1 0.2.1 "21 Oct 2023" "User Manual" .SH NAME faxlzwcoder .SH DESCRIPTION -LZW BW En-/Decoder. +LZW Fax En-/Decoder. .SH SYNOPSIS faxlzwcoder [options] [infile] [outfile] @@ -35,6 +35,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 .SH SEE ALSO faxg4coder(1) + netpbm(1) .SH CONTACTS Website: diff --git a/src/faxg4coder.c b/src/faxg4coder.c index ebeff5c..8032aba 100644 --- a/src/faxg4coder.c +++ b/src/faxg4coder.c @@ -28,21 +28,26 @@ void usage(const char *name) printf("G3 and G4 En-/Decoder\n" "(c) 2006,2007 by Tobias Hoffmann\n\n" - "Usage: %s [-g3|-g3K|-g4] [-decodeW] [-hdr] [-h -p -b] [infile] [outfile]\n\n" - - " -g3: G3 1-dimensional code (default)\n" - " -g3K: G3 2-dimensional code, parameter K, e.g. -g32 for K=2\n" - " -g4: G4 (2-dim) code\n\n" - - " -hdr: Put/Read MMR header to file\n\n" - - "-decodeW: Decode to pbm-file, using image width W,\n" - " e.g. -decode1728 (default, if not given)\n" - " else : Encode from pbm-file\n\n" - - " -h: Show this help\n" - " -p: Write plain pbm\n" - " -b: Read/Write bitstrings\n\n" + "Usage: %s [options] [infile] [outfile]\n\n" + + "options:\n" + " algorithm:\n" + " -g3: G3 1-dimensional code (default)\n" + " -g3{K}: G3 2-dimensional code, parameter {K}, e.g. -g32 for K=2\n" + " -g4: G4 (2-dim) code\n\n" + + " mmr:\n" + " -hdr: Put/Read MMR header to file\n\n" + + " direct:\n" + "-decode{W}: Decode to pbm-file, using image width {W},\n" + " e.g. -decode1728 (default, if not given)\n" + " else : Encode from pbm-file\n\n" + + " other:\n" + " -b: Read/Write bitstrings\n" + " -p: Write plain pbm\n" + " -h: Show this help\n\n" "Only K=2 (low resolution) and K=4 (high resolution) are standardized.\n" "If outfile or both infile and outfile are not given\n" diff --git a/src/faxlzwcoder.c b/src/faxlzwcoder.c index 2ed6d06..0a05864 100644 --- a/src/faxlzwcoder.c +++ b/src/faxlzwcoder.c @@ -19,17 +19,16 @@ void usage(const char *name) printf("LZW En-/Decoder\n" "(c) 2007 by Tobias Hoffmann\n\n" - "Usage: %s [-d] [-pbmW] [-h] [-earlyE] [infile] [outfile]\n\n" + "Usage: %s [options] [infile] [outfile]\n\n" - " -d: Decode\n" - " else : Encode\n\n" + "options:\n" + " -d: Decode, else Encode\n\n" - " -earlyE: Enlarge the code length E entries early (default: 1)\n\n" + "-early{E}: Enlarge the code length {E} entries early (default: 1)\n\n" - " -pbmW: Read/Write pbm-file; using image width W (for decoding)\n\n" + " -pbm{W}: Read/Write pbm-file; using image width {W} (for decoding)\n\n" - " -h: Show this help\n\n" -// " -x: Read/Write hexstrings\n\n" + " -h: Show this help\n\n" "If outfile or both infile and outfile are not given\n" "standard output and maybe standard input are used.\n\n"