X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/98ea3924ffaa6d7cc759da49322dde5f54335870..1f79a056146f0b172111b8379ccc344002848e66:/mdwopt.h diff --git a/mdwopt.h b/mdwopt.h index 1205b7b..ba3a024 100644 --- a/mdwopt.h +++ b/mdwopt.h @@ -1,7 +1,5 @@ /* -*-c-*- * - * $Id: mdwopt.h,v 1.8 1999/08/19 18:37:43 mdw Exp $ - * * Options parsing, similar to GNU @getopt_long@ * * (c) 1996 Straylight/Edgeware @@ -27,54 +25,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: mdwopt.h,v $ - * Revision 1.8 1999/08/19 18:37:43 mdw - * Fix stupid error. - * - * Revision 1.7 1999/08/19 18:35:10 mdw - * Add a couple more flag constants. - * - * Revision 1.6 1999/05/20 23:00:30 mdw - * Carry through changes to the interface properly in the documentation. - * Other little formatting things. - * - * Revision 1.5 1999/05/19 20:23:59 mdw - * Change naming to match newer mLib conventions. - * - * Revision 1.4 1999/05/15 10:25:38 mdw - * Fix copyright information. - * - * Revision 1.3 1999/05/14 18:51:42 mdw - * Reformat the LGPL notice slightly. - * - * Revision 1.2 1999/05/13 22:57:23 mdw - * Change `-ise' to `-ize' throughout. - * - * Revision 1.1.1.1 1999/05/05 19:23:47 mdw - * New import. The old CVS repository was lost in a disk disaster. - * - * --- Previous lives --- - * - * %Log: mdwopt.h,v % - * Revision 1.5 1997/08/09 20:27:59 mdw - * Fix spelling of `Licensing'. - * - * Revision 1.4 1997/07/29 21:11:49 mdw - * Fixed address of the FSF. - * - * Revision 1.3 1996/12/31 19:41:33 mdw - * Formatting changes. - * - * Revision 1.2 1996/11/23 00:47:25 mdw - * Added `MdwOpt' object from the `anagram' source code. - * - * Revision 1.1 1996/09/24 18:01:43 mdw - * Initial revision - * - */ - #ifndef MDWOPT_H #define MDWOPT_H @@ -152,28 +102,22 @@ enum { /* --- New style flag names --- */ -enum { - OPTF_NOARG = 0, /* No argument */ - OPTF_ARGREQ = 1, /* Required argument */ - OPTF_ARGOPT = 2, /* Optional argument */ - OPTF_ARG = 3, /* Argument type bitmask */ - OPTF_SWITCH = 4, /* OR val into flag, don't store */ - OPTF_NEGATE = 8 /* Allow long option to be negated */ -}; - -enum { - OPTF_NOLONGS = 1, /* Don't read long options */ - OPTF_NOSHORTS = 2, /* Don't read short options */ - OPTF_NUMBERS = 4, /* Read numeric options */ - OPTF_NEGATION = 8, /* Allow `%|+|%' for negations */ - OPTF_ENVVAR = 16, /* Parse options from env var */ - OPTF_NOPROGNAME = 32, /* Don't set @optprog@ */ - OPTF_NEGNUMBER = 64 /* Allow negated number options */ -}; - -enum { - OPTF_NEGATED = 256 /* Option flag was negated by user */ -}; +#define OPTF_NOARG 0u /* No argument */ +#define OPTF_ARGREQ 1u /* Required argument */ +#define OPTF_ARGOPT 2u /* Optional argument */ +#define OPTF_ARG 3u /* Argument type bitmask */ +#define OPTF_SWITCH 4u /* OR val into flag, don't store */ +#define OPTF_NEGATE 8u /* Allow long option to be negated */ + +#define OPTF_NOLONGS 1u /* Don't read long options */ +#define OPTF_NOSHORTS 2u /* Don't read short options */ +#define OPTF_NUMBERS 4u /* Read numeric options */ +#define OPTF_NEGATION 8u /* Allow `%|+|%' for negations */ +#define OPTF_ENVVAR 16u /* Parse options from env var */ +#define OPTF_NOPROGNAME 32u /* Don't set @optprog@ */ +#define OPTF_NEGNUMBER 64u /* Allow negated number options */ + +#define OPTF_NEGATED 256u /* Option flag was negated by user */ /* --- Older new-style names --- */