diff options
author | rsc <devnull@localhost> | 2004-04-29 17:13:24 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-29 17:13:24 +0000 |
commit | be36ff68854c86247fdc769c0eaa89eb284b5ca7 (patch) | |
tree | a523e17071eb0e3088f906446b158b3d184b77fe /src/cmd/jpg | |
parent | 3d72637f9b4c42b1fc9b7d95d278ea3dd65c748d (diff) | |
download | plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.gz plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.bz2 plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.zip |
add -W to specify window size.
various other little fixes.
Diffstat (limited to 'src/cmd/jpg')
-rw-r--r-- | src/cmd/jpg/bmp.c | 13 | ||||
-rw-r--r-- | src/cmd/jpg/gif.c | 14 | ||||
-rw-r--r-- | src/cmd/jpg/ico.c | 5 | ||||
-rw-r--r-- | src/cmd/jpg/jpg.c | 13 | ||||
-rw-r--r-- | src/cmd/jpg/png.c | 13 | ||||
-rw-r--r-- | src/cmd/jpg/ppm.c | 13 | ||||
-rw-r--r-- | src/cmd/jpg/yuv.c | 13 |
7 files changed, 71 insertions, 13 deletions
diff --git a/src/cmd/jpg/bmp.c b/src/cmd/jpg/bmp.c index f7e07a01..ba1b813a 100644 --- a/src/cmd/jpg/bmp.c +++ b/src/cmd/jpg/bmp.c @@ -44,12 +44,22 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: bmp -39cdektv -W winsize [file.bmp ...]\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int fd, i; char *err; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */ threeflag++; /* fall through */ @@ -89,8 +99,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: bmp -39cdektv [file.bmp ...]\n"); - exits("usage"); + usage(); }ARGEND; err = nil; diff --git a/src/cmd/jpg/gif.c b/src/cmd/jpg/gif.c index f9927017..f8f89de9 100644 --- a/src/cmd/jpg/gif.c +++ b/src/cmd/jpg/gif.c @@ -57,12 +57,23 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: gif -39cdektv -W winsize [file.gif ...]\n"); + exits("usage"); +} + + +void main(int argc, char *argv[]) { int fd, i; char *err; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */ threeflag++; /* fall through */ @@ -102,8 +113,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: gif -39cdektv [file.gif ...]\n"); - exits("usage"); + usage(); }ARGEND; err = nil; diff --git a/src/cmd/jpg/ico.c b/src/cmd/jpg/ico.c index 3a275e65..1380b18f 100644 --- a/src/cmd/jpg/ico.c +++ b/src/cmd/jpg/ico.c @@ -258,7 +258,7 @@ Bgeticon(Biobuf *b, Icon *icon) void usage(void) { - fprint(2, "usage: %s [file]\n", argv0); + fprint(2, "usage: %s -W winsize [file]\n", argv0); exits("usage"); } @@ -444,6 +444,9 @@ main(int argc, char **argv) Event e; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case 'd': debug = 1; break; diff --git a/src/cmd/jpg/jpg.c b/src/cmd/jpg/jpg.c index cf438a93..f61172a5 100644 --- a/src/cmd/jpg/jpg.c +++ b/src/cmd/jpg/jpg.c @@ -46,6 +46,13 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: jpg -39cdefFkJrtv -W winsize [file.jpg ...]\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int fd, i, yflag; @@ -54,6 +61,9 @@ main(int argc, char *argv[]) yflag = 0; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case 'c': /* produce encoded, compressed, bitmap file; no display by default */ cflag++; dflag++; @@ -110,8 +120,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: jpg -39cdefFkJrtv [file.jpg ...]\n"); - exits("usage"); + usage(); }ARGEND; if(yflag==0 && dflag==0 && colorspace==CYCbCr){ /* see if we should convert right to RGB */ diff --git a/src/cmd/jpg/png.c b/src/cmd/jpg/png.c index d653fe6a..a815abfc 100644 --- a/src/cmd/jpg/png.c +++ b/src/cmd/jpg/png.c @@ -44,6 +44,13 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: png -39cdekrtv -W winsize [file.png ...]\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int fd, i; @@ -51,6 +58,9 @@ main(int argc, char *argv[]) char buf[12+1]; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case 'c': /* produce encoded, compressed, bitmap file; no display by default */ cflag++; dflag++; @@ -96,8 +106,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: png -39cdekrtv [file.png ...]\n"); - exits("usage"); + usage(); }ARGEND; if(dflag==0 && colorspace==CYCbCr){ /* see if we should convert right to RGB */ diff --git a/src/cmd/jpg/ppm.c b/src/cmd/jpg/ppm.c index 24019dfa..d90344ed 100644 --- a/src/cmd/jpg/ppm.c +++ b/src/cmd/jpg/ppm.c @@ -42,12 +42,22 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: ppm -39cdektv -W winsize [file.ppm ...]\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int fd, i; char *err; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */ threeflag++; /* fall through */ @@ -87,8 +97,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: ppm -39cdektv [file.ppm ...]\n"); - exits("usage"); + usage(); }ARGEND; err = nil; diff --git a/src/cmd/jpg/yuv.c b/src/cmd/jpg/yuv.c index 929ccf39..6027236b 100644 --- a/src/cmd/jpg/yuv.c +++ b/src/cmd/jpg/yuv.c @@ -44,12 +44,22 @@ eresized(int new) } void +usage(void) +{ + fprint(2, "usage: yuv -39cdektv -W winsize [file.yuv ...]\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int fd, i; char *err; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */ threeflag++; /* fall through */ @@ -89,8 +99,7 @@ main(int argc, char *argv[]) outchan = CMAP8; break; default: - fprint(2, "usage: yuv -39cdektv [file.yuv ...]\n"); - exits("usage"); + usage(); }ARGEND; err = nil; |