Mercurial > hg > minc-tools
changeset 1651:c59daa2c4e0c
Call ParseArgv() so that invert_raw_image can print its version information
author | bert <bert> |
---|---|
date | Mon, 02 Feb 2004 18:25:38 +0000 (2004-02-02) |
parents | e39b57176764 |
children | 3e48e8c9ccc7 |
files | progs/mincview/invert_raw_image.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/progs/mincview/invert_raw_image.c +++ b/progs/mincview/invert_raw_image.c @@ -17,6 +17,7 @@ ---------------------------------------------------------------------------- */ #include <stdlib.h> #include <stdio.h> +#include <ParseArgv.h> #define ABS( x ) ( ((x) > (0)) ? (x) : (-(x)) ) #define MAX( x, y ) ( ((x) >= (y)) ? (x) : (y) ) @@ -25,6 +26,11 @@ #define ERROR_STATUS -1 #define NORMAL_STATUS 0 +/* Argument table */ +ArgvInfo argTable[] = { + {NULL, ARGV_END, NULL, NULL, NULL} +}; + int main(int argc, char *argv[]) { int i,j,k,oi,image_size,offset,bytes_per_pixel,row_size,nread; @@ -34,7 +40,7 @@ /* Check arguments */ pname=argv[0]; - if ((argc != 3)&&(argc != 4)) { + if (ParseArgv(&argc, argv, argTable, 0) || (argc < 3) || (argc > 4)) { (void) fprintf(stderr,"Usage : %s xsize ysize <bytesperpixel>\n",pname); exit(ERROR_STATUS); }