Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
plzombie committed Oct 21, 2023
2 parents 4d53179 + f26bc53 commit 928e788
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 31 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
9 changes: 5 additions & 4 deletions man/man1/faxg4coder.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand All @@ -52,6 +52,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007

.SH SEE ALSO
faxlzwcoder(1)
netpbm(1)

.SH CONTACTS
Website:
Expand Down
5 changes: 3 additions & 2 deletions man/man1/faxlzwcoder.1
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -35,6 +35,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007

.SH SEE ALSO
faxg4coder(1)
netpbm(1)

.SH CONTACTS
Website:
Expand Down
35 changes: 20 additions & 15 deletions src/faxg4coder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 6 additions & 7 deletions src/faxlzwcoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 928e788

Please sign in to comment.