X-Git-Url: https://git.distorted.org.uk/~mdw/xtoys/blobdiff_plain/c4efa11c1a060884e0d2f3c61a769d1e51396ae6..ad97c83b25b61bf4a7be58148884c6f50a4685d5:/xscsize.c diff --git a/xscsize.c b/xscsize.c index bae703d..6b206ae 100644 --- a/xscsize.c +++ b/xscsize.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: xscsize.c,v 1.3 1998/12/11 09:50:05 mdw Exp $ + * $Id: xscsize.c,v 1.6 2004/04/08 01:36:29 mdw Exp $ * * Return X display size to shell script * @@ -26,21 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: xscsize.c,v $ - * Revision 1.3 1998/12/11 09:50:05 mdw - * Minor modifications to work with mLib and mgLib. - * - * Revision 1.2 1998/11/21 22:30:22 mdw - * Support GNU-style long options throughout, and introduce proper help - * text to all programs. Update manual pages to match. - * - * Revision 1.1 1998/11/16 23:00:49 mdw - * Initial versions. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -70,12 +55,10 @@ int main(int argc, char *argv[]) unsigned f = 0; unsigned long wd, ht; - enum { - f_sh = 1, - f_csh = 2, - f_shell = 3, - f_export = 4 - }; +#define f_sh 1u +#define f_csh 2u +#define f_shell 3u +#define f_export 4u /* --- Parse command line options --- */ @@ -83,14 +66,14 @@ int main(int argc, char *argv[]) for (;;) { static struct option opt[] = { - { "help", 0, 0, 'h' }, - { "usage", 0, 0, 'u' }, - { "version", 0, 0, 'v' }, - { "display", required_argument, 0, 'd' }, - { "bourne-shell", 0, 0, 'b' }, - { "c-shell", 0, 0, 'c' }, - { "export", 0, 0, 'x' }, - { 0, 0, 0, 0 } + { "help", 0, 0, 'h' }, + { "usage", 0, 0, 'u' }, + { "version", 0, 0, 'v' }, + { "display", OPTF_ARGREQ, 0, 'd' }, + { "bourne-shell", 0, 0, 'b' }, + { "c-shell", 0, 0, 'c' }, + { "export", 0, 0, 'x' }, + { 0, 0, 0, 0 } }; int i = getopt_long(argc, argv, "huv d:bcx", opt, 0);