*
* DO NOT EDIT THIS FILE (clktest-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:53 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:03 AM EDT
* From the definitions clktest-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
{
static const struct {const int rmin, rmax;} rng[ 1 ] = {
{ 0, 255 } };
- long val;
+ int val;
int ix;
char const* pzIndent = "\t\t\t\t ";
extern FILE* option_usage_fp;
return;
valid_return:
- pOptDesc->optArg.argString = (char*)val;
+ pOptDesc->optArg.argInt = val;
}
#endif /* defined CLKLDISC */
{
static const struct {const int rmin, rmax;} rng[ 1 ] = {
{ 0, 255 } };
- long val;
+ int val;
int ix;
char const* pzIndent = "\t\t\t\t ";
extern FILE* option_usage_fp;
return;
valid_return:
- pOptDesc->optArg.argString = (char*)val;
+ pOptDesc->optArg.argInt = val;
}
#endif /* defined CLKLDISC */
{
static const struct {const int rmin, rmax;} rng[ 1 ] = {
{ 1, 600 } };
- long val;
+ int val;
int ix;
char const* pzIndent = "\t\t\t\t ";
extern FILE* option_usage_fp;
return;
valid_return:
- pOptDesc->optArg.argString = (char*)val;
+ pOptDesc->optArg.argInt = val;
}
/* extracted from optmain.tpl near line 92 */
*
* DO NOT EDIT THIS FILE (clktest-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:53 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:02 AM EDT
* From the definitions clktest-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
endif
libopts_la_SOURCES = libopts.c
libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 27:4:3
+libopts_la_LDFLAGS = -version-info 27:5:3
EXTRA_DIST = \
COPYING.lgpl COPYING.mbsd MakeDefs.inc \
README autoopts/options.h autoopts/usage-txt.h \
/*
- * $Id: autoopts.c,v 4.26 2006/09/24 02:10:44 bkorb Exp $
- * Time-stamp: "2006-09-22 18:21:53 bkorb"
+ * $Id: autoopts.c,v 4.27 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-04 19:32:32 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
pOD->optActualIndex = pOD->optIndex;
}
- pOD->fOptState &= OPTST_PERSISTENT;
- pOD->fOptState |= (pOptState->flags & ~OPTST_PERSISTENT);
+ pOD->fOptState &= OPTST_PERSISTENT_MASK;
+ pOD->fOptState |= (pOptState->flags & ~OPTST_PERSISTENT_MASK);
/*
* Keep track of count only for DEFINED (command line) options.
{
tSuccess res;
enum { ARG_NONE, ARG_MAY, ARG_MUST } arg_type = ARG_NONE;
+ teOptArgType at;
res = findOptDesc( pOpts, pOptState );
if (! SUCCESSFUL( res ))
return res;
- pOptState->flags |= (pOptState->pOD->fOptState & OPTST_PERSISTENT);
+ pOptState->flags |= (pOptState->pOD->fOptState & OPTST_PERSISTENT_MASK);
+ at = OPTST_GET_ARGTYPE(pOptState->flags);
/*
* Figure out what to do about option arguments. An argument may be
*/
if ((pOptState->flags & OPTST_DISABLED) != 0)
arg_type = ARG_NONE;
- else if (OPTST_GET_ARGTYPE(pOptState->flags) == OPARG_TYPE_NONE)
+ else if (at == OPARG_TYPE_NONE)
arg_type = ARG_NONE;
else if (pOptState->flags & OPTST_ARG_OPTIONAL)
arg_type = ARG_MAY;
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:25 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:13 PM PDT
* From the definitions funcs.def
* and the template file options_h
*
* values for "opt_name" are available.
*/
+#define OPTIONS_STRUCT_VERSION 110597
+#define OPTIONS_VERSION_STRING "27:5:3"
+#define OPTIONS_MINIMUM_VERSION 98304
+#define OPTIONS_MIN_VER_STRING "24:0:0"
+
typedef enum {
OPARG_TYPE_NONE = 0,
OPARG_TYPE_STRING = 1, /* default type/ vanilla string */
char* pzName;
union {
char strVal[1]; /* OPARG_TYPE_STRING */
- int enumVal; /* OPARG_TYPE_ENUMERATION */
- int boolVal; /* OPARG_TYPE_BOOLEAN */
- long setVal; /* OPARG_TYPE_MEMBERSHIP */
+ unsigned int enumVal; /* OPARG_TYPE_ENUMERATION */
+ unsigned int boolVal; /* OPARG_TYPE_BOOLEAN */
+ unsigned long setVal; /* OPARG_TYPE_MEMBERSHIP */
long longVal; /* OPARG_TYPE_NUMERIC */
void* nestVal; /* OPARG_TYPE_HIERARCHY */
} v;
} tOptionValue;
-#define OPTST_SET_ARGTYPE(n) ((n) << 12)
-#define OPTST_GET_ARGTYPE(f) (((f) & OPTST_ARG_TYPE_MASK) >> 12)
-
/*
* Bits in the fOptState option descriptor field.
*/
-#define OPTST_INIT 0x0000000U /* Initial compiled value */
-#define OPTST_SET 0x0000001U /* Set via the "SET_OPT()" macro */
-#define OPTST_PRESET 0x0000002U /* Set via an RC/INI file */
-#define OPTST_DEFINED 0x0000004U /* Set via a command line option */
-
-#define OPTST_SET_MASK 0x0000007U /* mask of flags that show set state */
-
-#define OPTST_EQUIVALENCE 0x0000010U /* selected by equiv'ed option */
-#define OPTST_DISABLED 0x0000020U /* option is in disabled state */
-
-#define OPTST_NO_INIT 0x0000100U /* option cannot be preset */
-#define OPTST_NUMBER_OPT 0x0000200U /* opt value (flag) is any digit */
-#define OPTST_STACKED 0x0000400U /* opt uses optionStackArg procedure */
-#define OPTST_INITENABLED 0x0000800U /* option defaults to enabled */
-#define OPTST_ARG_TYPE_MASK 0x000F000U /* bits used to specify opt arg type */
-#define OPTST_ARG_OPTIONAL 0x0010000U /* the option argument not required */
-#define OPTST_IMM 0x0020000U /* process option on first pass */
-#define OPTST_DISABLE_IMM 0x0040000U /* process disablement on first pass */
-#define OPTST_OMITTED 0x0080000U /* compiled out of program */
-#define OPTST_MUST_SET 0x0100000U /* must be set or pre-set */
-#define OPTST_DOCUMENT 0x0200000U /* opt is for documentation only */
-#define OPTST_TWICE 0x0400000U /* process option twice - imm + reg */
-#define OPTST_DISABLE_TWICE 0x0800000U /* process disabled option twice */
-
-#define OPTST_PERSISTENT 0xFFFFF00U /* mask of flags that do not change */
-
-#define SELECTED_OPT( pod ) ( (pod)->fOptState & (OPTST_SET | OPTST_DEFINED))
-#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
-#define DISABLED_OPT( pod ) ( (pod)->fOptState & OPTST_DISABLED)
-#define OPTION_STATE( pod ) ((pod)->fOptState)
+typedef enum {
+ OPTST_SET_ID = 0, /* Set via the "SET_OPT()" macro */
+ OPTST_PRESET_ID = 1, /* Set via an RC/INI file */
+ OPTST_DEFINED_ID = 2, /* Set via a command line option */
+ OPTST_EQUIVALENCE_ID = 4, /* selected by equiv'ed option */
+ OPTST_DISABLED_ID = 5, /* option is in disabled state */
+ OPTST_NO_INIT_ID = 8, /* option cannot be preset */
+ OPTST_NUMBER_OPT_ID = 9, /* opt value (flag) is any digit */
+ OPTST_STACKED_ID = 10, /* opt uses optionStackArg proc */
+ OPTST_INITENABLED_ID = 11, /* option defaults to enabled */
+ OPTST_ARG_TYPE_1_ID = 12, /* bit 1 of arg type enum */
+ OPTST_ARG_TYPE_2_ID = 13, /* bit 2 of arg type enum */
+ OPTST_ARG_TYPE_3_ID = 14, /* bit 3 of arg type enum */
+ OPTST_ARG_TYPE_4_ID = 15, /* bit 4 of arg type enum */
+ OPTST_ARG_OPTIONAL_ID = 16, /* the option arg not required */
+ OPTST_IMM_ID = 17, /* process opt on first pass */
+ OPTST_DISABLE_IMM_ID = 18, /* process disablement immed. */
+ OPTST_OMITTED_ID = 19, /* compiled out of program */
+ OPTST_MUST_SET_ID = 20, /* must be set or pre-set */
+ OPTST_DOCUMENT_ID = 21, /* opt is for doc only */
+ OPTST_TWICE_ID = 22, /* process opt twice - imm + reg */
+ OPTST_DISABLE_TWICE_ID = 23 /* process disabled option twice */
+} opt_state_enum_t;
+
+#define OPTST_INIT 0U
+#define OPTST_SET (1U << OPTST_SET_ID)
+#define OPTST_PRESET (1U << OPTST_PRESET_ID)
+#define OPTST_DEFINED (1U << OPTST_DEFINED_ID)
+#define OPTST_EQUIVALENCE (1U << OPTST_EQUIVALENCE_ID)
+#define OPTST_DISABLED (1U << OPTST_DISABLED_ID)
+#define OPTST_NO_INIT (1U << OPTST_NO_INIT_ID)
+#define OPTST_NUMBER_OPT (1U << OPTST_NUMBER_OPT_ID)
+#define OPTST_STACKED (1U << OPTST_STACKED_ID)
+#define OPTST_INITENABLED (1U << OPTST_INITENABLED_ID)
+#define OPTST_ARG_TYPE_1 (1U << OPTST_ARG_TYPE_1_ID)
+#define OPTST_ARG_TYPE_2 (1U << OPTST_ARG_TYPE_2_ID)
+#define OPTST_ARG_TYPE_3 (1U << OPTST_ARG_TYPE_3_ID)
+#define OPTST_ARG_TYPE_4 (1U << OPTST_ARG_TYPE_4_ID)
+#define OPTST_ARG_OPTIONAL (1U << OPTST_ARG_OPTIONAL_ID)
+#define OPTST_IMM (1U << OPTST_IMM_ID)
+#define OPTST_DISABLE_IMM (1U << OPTST_DISABLE_IMM_ID)
+#define OPTST_OMITTED (1U << OPTST_OMITTED_ID)
+#define OPTST_MUST_SET (1U << OPTST_MUST_SET_ID)
+#define OPTST_DOCUMENT (1U << OPTST_DOCUMENT_ID)
+#define OPTST_TWICE (1U << OPTST_TWICE_ID)
+#define OPTST_DISABLE_TWICE (1U << OPTST_DISABLE_TWICE_ID)
+#define OPT_STATE_MASK 0x00FFFF37U
+
+#define OPTST_SET_MASK ( \
+ OPTST_SET | \
+ OPTST_PRESET | \
+ OPTST_DEFINED )
+
+#define OPTST_MUTABLE_MASK ( \
+ OPTST_SET | \
+ OPTST_PRESET | \
+ OPTST_DEFINED | \
+ OPTST_EQUIVALENCE | \
+ OPTST_DISABLED )
+
+#define OPTST_SELECTED_MASK ( \
+ OPTST_SET | \
+ OPTST_DEFINED )
+
+#define OPTST_ARG_TYPE_MASK ( \
+ OPTST_ARG_TYPE_1 | \
+ OPTST_ARG_TYPE_2 | \
+ OPTST_ARG_TYPE_3 | \
+ OPTST_ARG_TYPE_4 )
+
+#define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK)
+
+#define SELECTED_OPT( pod ) ((pod)->fOptState & OPTST_SELECTED_MASK)
+#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
+#define DISABLED_OPT( pod ) ((pod)->fOptState & OPTST_DISABLED)
+#define OPTION_STATE( pod ) ((pod)->fOptState)
+
+#define OPTST_SET_ARGTYPE(n) ((n) << OPTST_ARG_TYPE_1_ID)
+#define OPTST_GET_ARGTYPE(f) (((f) & OPTST_ARG_TYPE_MASK)>>OPTST_ARG_TYPE_1_ID)
/*
* PRIVATE INTERFACES
*/
/*
- * Define any special processing flags
- */
-#define OPTPROC_NONE 0x000000
-#define OPTPROC_LONGOPT 0x000001 /* Process long style options */
-#define OPTPROC_SHORTOPT 0x000002 /* Process short style "flags" */
-#define OPTPROC_ERRSTOP 0x000004 /* Stop on argument errors */
-#define OPTPROC_DISABLEDOPT 0x000008 /* Current option is disabled */
-#define OPTPROC_NO_REQ_OPT 0x000010 /* no options are required */
-#define OPTPROC_NUM_OPT 0x000020 /* there is a number option */
-#define OPTPROC_INITDONE 0x000040 /* have initializations been done? */
-#define OPTPROC_NEGATIONS 0x000080 /* any negation options? */
-#define OPTPROC_ENVIRON 0x000100 /* check environment? */
-#define OPTPROC_NO_ARGS 0x000200 /* Disallow remaining arguments */
-#define OPTPROC_ARGS_REQ 0x000400 /* Require arguments after options */
-#define OPTPROC_REORDER 0x000800 /* reorder arguments after options */
-#define OPTPROC_GNUUSAGE 0x001000 /* emit usage in GNU style */
-#define OPTPROC_TRANSLATE 0x002000 /* Translate strings in tOptions */
-#define OPTPROC_HAS_IMMED 0x004000 /* program defines immed options */
-#define OPTPROC_PRESETTING 0x800000 /* opt processing in preset state */
+ * Define the processing state flags
+ */
+typedef enum {
+ OPTPROC_LONGOPT_ID = 0, /* Process long style options */
+ OPTPROC_SHORTOPT_ID = 1, /* Process short style "flags" */
+ OPTPROC_ERRSTOP_ID = 2, /* Stop on argument errors */
+ OPTPROC_DISABLEDOPT_ID = 3, /* Current option is disabled */
+ OPTPROC_NO_REQ_OPT_ID = 4, /* no options are required */
+ OPTPROC_NUM_OPT_ID = 5, /* there is a number option */
+ OPTPROC_INITDONE_ID = 6, /* have initializations been done? */
+ OPTPROC_NEGATIONS_ID = 7, /* any negation options? */
+ OPTPROC_ENVIRON_ID = 8, /* check environment? */
+ OPTPROC_NO_ARGS_ID = 9, /* Disallow remaining arguments */
+ OPTPROC_ARGS_REQ_ID = 10, /* Require arguments after options */
+ OPTPROC_REORDER_ID = 11, /* reorder operands after options */
+ OPTPROC_GNUUSAGE_ID = 12, /* emit usage in GNU style */
+ OPTPROC_TRANSLATE_ID = 13, /* Translate strings in tOptions */
+ OPTPROC_HAS_IMMED_ID = 14, /* program defines immed options */
+ OPTPROC_PRESETTING_ID = 19 /* opt processing in preset state */
+} optproc_state_enum_t;
+
+#define OPTPROC_NONE 0U
+#define OPTPROC_LONGOPT (1U << OPTPROC_LONGOPT_ID)
+#define OPTPROC_SHORTOPT (1U << OPTPROC_SHORTOPT_ID)
+#define OPTPROC_ERRSTOP (1U << OPTPROC_ERRSTOP_ID)
+#define OPTPROC_DISABLEDOPT (1U << OPTPROC_DISABLEDOPT_ID)
+#define OPTPROC_NO_REQ_OPT (1U << OPTPROC_NO_REQ_OPT_ID)
+#define OPTPROC_NUM_OPT (1U << OPTPROC_NUM_OPT_ID)
+#define OPTPROC_INITDONE (1U << OPTPROC_INITDONE_ID)
+#define OPTPROC_NEGATIONS (1U << OPTPROC_NEGATIONS_ID)
+#define OPTPROC_ENVIRON (1U << OPTPROC_ENVIRON_ID)
+#define OPTPROC_NO_ARGS (1U << OPTPROC_NO_ARGS_ID)
+#define OPTPROC_ARGS_REQ (1U << OPTPROC_ARGS_REQ_ID)
+#define OPTPROC_REORDER (1U << OPTPROC_REORDER_ID)
+#define OPTPROC_GNUUSAGE (1U << OPTPROC_GNUUSAGE_ID)
+#define OPTPROC_TRANSLATE (1U << OPTPROC_TRANSLATE_ID)
+#define OPTPROC_HAS_IMMED (1U << OPTPROC_HAS_IMMED_ID)
+#define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID)
+#define OPTPROC_STATE_MASK 0x00087FFFU
#define STMTS(s) do { s; } while (0)
typedef union {
char const * argString;
+ uintptr_t argEnum;
uintptr_t argIntptr;
- int argInt;
- unsigned int argUint;
- ag_bool argBool;
+ long argInt;
+ unsigned long argUint;
+ unsigned int argBool;
} optArgBucket_t;
/*
const tAoUS default_opt;
};
-#define OPTIONS_STRUCT_VERSION 110595
-#define OPTIONS_VERSION_STRING "27:4:3"
-#define OPTIONS_MINIMUM_VERSION 98304
-#define OPTIONS_MIN_VER_STRING "24:0:0"
-
/*
* The procedure generated for translating option text
*/
extern void optionOnlyUsage( tOptions*, int );
-/* From: autoopts.c line 980
+/* From: autoopts.c line 982
*
* optionProcess - this is the main option processing routine
*
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:22 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:10 PM PDT
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
/*
- * $Id: configfile.c,v 4.28 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: configfile.c,v 4.29 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:18:51 bkorb"
*
* configuration/rc/ini file handling.
/*
- * $Id: cook.c,v 4.8 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: cook.c,v 4.9 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:21:02 bkorb"
*
* This file contains the routines that deal with processing quoted strings
/*
* $Id: enumeration.c,v 4.14 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:00:53 bkorb"
+ * Time-stamp: "2006-10-05 21:10:21 bkorb"
*
* Automated Options Paged Usage module.
*
{
tOptDesc od;
- od.optArg.argIntptr = enum_val;
+ od.optArg.argEnum = enum_val;
(*(pOD->pOptProc))( (void*)(2UL), &od );
return od.optArg.argString;
}
case 1UL:
{
- unsigned int ix = pOD->optArg.argIntptr;
+ unsigned int ix = pOD->optArg.argEnum;
/*
* print the name string.
*/
case 2UL:
{
tSCC zInval[] = "*INVALID*";
- unsigned int ix = pOD->optArg.argIntptr;
+ unsigned int ix = pOD->optArg.argEnum;
/*
* Replace the enumeration value with the name string.
*/
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:26 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:14 PM PDT
* From the definitions genshell.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:26 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:14 PM PDT
* From the definitions genshell.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
/*
- * $Id: load.c,v 4.25 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: load.c,v 4.26 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:23:01 bkorb"
*
* This file contains the routines that deal with processing text strings
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Sunday September 24, 2006 at 03:28:29 PM PDT
+dnl It has been AutoGen-ed Thursday October 5, 2006 at 09:15:16 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.17 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:19:24 bkorb"
+ * $Id: makeshell.c,v 4.18 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 20:41:23 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
* Numeric and membership bit options are just printed as a number.
*/
case OPARG_TYPE_NUMERIC:
- case OPARG_TYPE_MEMBERSHIP:
snprintf( zVal, sizeof( zVal ), "%d",
- (int)pOptDesc->optArg.argIntptr );
+ (int)pOptDesc->optArg.argInt );
pzDefault = zVal;
break;
+ case OPARG_TYPE_MEMBERSHIP:
+ snprintf( zVal, sizeof( zVal ), "%lu",
+ (unsigned long)pOptDesc->optArg.argIntptr );
+ pzDefault = zVal;
+ break;
+
+ case OPARG_TYPE_BOOLEAN:
+ pzDefault = (pOptDesc->optArg.argBool) ? "true" : "false";
+ break;
+
default:
if (pOptDesc->optArg.argString == NULL) {
if (pzFmt == zSingleDef)
/*
- * $Id: nested.c,v 4.13 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: nested.c,v 4.14 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:27:32 bkorb"
*
* Automated Options Nested Values module.
/*
- * $Id: numeric.c,v 4.9 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:14:38 bkorb"
+ * $Id: numeric.c,v 4.10 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-04 16:12:34 bkorb"
*/
/*
optionNumericVal( tOptions* pOpts, tOptDesc* pOD )
{
char* pz;
- int val;
+ long val;
/*
* Numeric options may have a range associated with it.
if ((pOD == NULL) || (pOD->optArg.argString == NULL))
return;
- val = (int)strtol( pOD->optArg.argString, &pz, 0 );
+ val = strtol( pOD->optArg.argString, &pz, 0 );
if (*pz != NUL) {
fprintf( stderr, zNotNumber, pOpts->pzProgName, pOD->optArg.argString );
(*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE);
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sun Sep 24 15:28:27 PDT 2006
+ * Generated Thu Oct 5 21:15:15 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.14 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-24 15:28:15 bkorb"
+ * $Id: putshell.c,v 4.16 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 20:37:42 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and print them to standard out in a fashion that
if (pOD->optActualIndex != optIx) {
tOptDesc* p = pOpts->pOptDesc + pOD->optActualIndex;
p->optArg = pOD->optArg;
- p->fOptState &= OPTST_PERSISTENT;
- p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT;
+ p->fOptState &= OPTST_PERSISTENT_MASK;
+ p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT_MASK;
printf( zEquivMode, pOpts->pzPROGNAME, pOD->pz_NAME, p->pz_NAME );
pOD = p;
}
* of bitmask value and we need to emit the bit values.
*/
if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) {
- char* pz;
+ char const * pz;
uintptr_t val = 1;
printf( zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
(uintptr_t)(pOD->optCookie) );
* We are building the typeset list. The list returned starts with
* 'none + ' for use by option saving stuff. We must ignore that.
*/
- pz = (char*)pOD->optArg.argString + 7;
+ pz = pOD->optArg.argString + 7;
while (*pz != NUL) {
printf( "typeset -x -i %s_", pOD->pz_NAME );
pz += strspn( pz, " +\t\n\f" );
*/
else if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NUMERIC)
printf( zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
- pOD->optArg.argIntptr );
+ (int)pOD->optArg.argInt );
/*
* If the argument type is an enumeration, then it is much
*/
else if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_BOOLEAN)
printf( zFullOptFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
- (pOD->optArg.argIntptr == 0) ? "false" : "true" );
+ (pOD->optArg.argBool == 0) ? "false" : "true" );
/*
* IF the option has an empty value,
/*
- * restore.c $Id: restore.c,v 4.8 2006/09/24 02:10:45 bkorb Exp $
+ * restore.c $Id: restore.c,v 4.9 2006/10/05 03:39:53 bkorb Exp $
* Time-stamp: "2005-02-23 15:10:20 bkorb"
*
* This module's routines will save the current option state to memory
if ( (p->fOptState & OPTST_STACKED)
&& (p->optCookie != NULL)) {
AGFREE( p->optCookie );
- p->fOptState &= OPTST_PERSISTENT;
+ p->fOptState &= OPTST_PERSISTENT_MASK;
if ((p->fOptState & OPTST_INITENABLED) == 0)
p->fOptState |= OPTST_DISABLED;
}
/*
- * save.c $Id: save.c,v 4.19 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:11:20 bkorb"
+ * save.c $Id: save.c,v 4.20 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 21:09:18 bkorb"
*
* This module's routines will take the currently set options and
* store them into an ".rc" file for re-interpretation the next
switch (arg_state) {
case 0:
case OPARG_TYPE_NUMERIC:
- printEntry( fp, p, p->optArg.argString );
+ printEntry( fp, p, (void*)(p->optArg.argInt));
break;
case OPARG_TYPE_STRING:
case OPARG_TYPE_ENUMERATION:
case OPARG_TYPE_MEMBERSHIP:
{
- tCC* val = p->optArg.argString;
+ uintptr_t val = p->optArg.argEnum;
/*
* This is a magic incantation that will convert the
* bit flag values back into a string suitable for printing.
*/
(*(p->pOptProc))( (tOptions*)2UL, p );
- printEntry( fp, p, p->optArg.argString );
+ printEntry( fp, p, (void*)(p->optArg.argString));
if ( (p->optArg.argString != NULL)
&& (arg_state != OPARG_TYPE_ENUMERATION))
/*
* bit flag and enumeration strings get allocated
*/
AGFREE( (void*)p->optArg.argString );
- p->optArg.argString = val;
+ p->optArg.argEnum = val;
break;
}
case OPARG_TYPE_BOOLEAN:
- printEntry( fp, p, (p->optArg.argBool != AG_FALSE)
- ? "true" : "false" );
+ printEntry( fp, p, p->optArg.argBool ? "true" : "false" );
break;
default:
/*
* stack.c
- * $Id: stack.c,v 4.12 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: stack.c,v 4.13 2006/10/05 03:39:53 bkorb Exp $
* Time-stamp: "2006-09-22 18:13:19 bkorb"
*
* This is a special option processing routine that will save the
* THEN indicate that we don't have any of these options
*/
if (pAL == NULL) {
- pOptDesc->fOptState &= OPTST_PERSISTENT;
+ pOptDesc->fOptState &= OPTST_PERSISTENT_MASK;
if ( (pOptDesc->fOptState & OPTST_INITENABLED) == 0)
pOptDesc->fOptState |= OPTST_DISABLED;
return;
* THEN indicate that we don't have any of these options
*/
if (pAL->useCt == 0) {
- pOptDesc->fOptState &= OPTST_PERSISTENT;
+ pOptDesc->fOptState &= OPTST_PERSISTENT_MASK;
if ( (pOptDesc->fOptState & OPTST_INITENABLED) == 0)
pOptDesc->fOptState |= OPTST_DISABLED;
free( (void*)pAL );
*
* DO NOT EDIT THIS FILE (ntpd-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:56 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:05 AM EDT
* From the definitions ntpd-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (ntpd-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:55 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:04 AM EDT
* From the definitions ntpd-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
*
* DO NOT EDIT THIS FILE (ntpdsim-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:58 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:07 AM EDT
* From the definitions ntpdsim-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (ntpdsim-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:57 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:06 AM EDT
* From the definitions ntpdsim-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
*
* DO NOT EDIT THIS FILE (ntpdc-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:00 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:09 AM EDT
* From the definitions ntpdc-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (ntpdc-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:49:59 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:09 AM EDT
* From the definitions ntpdc-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
*
* DO NOT EDIT THIS FILE (ntpq-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:02 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:10 AM EDT
* From the definitions ntpq-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (ntpq-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:01 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:10 AM EDT
* From the definitions ntpq-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
#
# DO NOT EDIT THIS FILE (ntpq-opts.texi)
#
-# It has been AutoGen-ed Monday September 25, 2006 at 08:59:28 AM EDT
+# It has been AutoGen-ed Sunday October 8, 2006 at 03:44:53 AM EDT
# From the definitions ntpq-opts.def
# and the template file aginfo.tpl
@end ignore
## LIBOPTS Makefile
-MAINTAINERCLEANFILES = Makefile.in
-lib_LTLIBRARIES = libopts.la
-libopts_la_SOURCES = libopts.c
-libopts_la_CPPFLAGS = -I$(top_srcdir)
-libopts_la_LDFLAGS = -version-info 27:4:2
-EXTRA_DIST = \
+MAINTAINERCLEANFILES = Makefile.in
+if INSTALL_LIBOPTS
+lib_LTLIBRARIES = libopts.la
+else
+noinst_LTLIBRARIES = libopts.la
+endif
+libopts_la_SOURCES = libopts.c
+libopts_la_CPPFLAGS = -I$(top_srcdir)
+libopts_la_LDFLAGS = -version-info 27:5:3
+EXTRA_DIST = \
COPYING.lgpl COPYING.mbsd MakeDefs.inc \
README autoopts/options.h autoopts/usage-txt.h \
autoopts.c autoopts.h boolean.c \
/*
- * $Id: autoopts.c,v 4.26 2006/09/24 02:10:44 bkorb Exp $
- * Time-stamp: "2006-09-22 18:21:53 bkorb"
+ * $Id: autoopts.c,v 4.27 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-04 19:32:32 bkorb"
*
* This file contains all of the routines that must be linked into
* an executable to use the generated option processing. The optional
pOD->optActualIndex = pOD->optIndex;
}
- pOD->fOptState &= OPTST_PERSISTENT;
- pOD->fOptState |= (pOptState->flags & ~OPTST_PERSISTENT);
+ pOD->fOptState &= OPTST_PERSISTENT_MASK;
+ pOD->fOptState |= (pOptState->flags & ~OPTST_PERSISTENT_MASK);
/*
* Keep track of count only for DEFINED (command line) options.
{
tSuccess res;
enum { ARG_NONE, ARG_MAY, ARG_MUST } arg_type = ARG_NONE;
+ teOptArgType at;
res = findOptDesc( pOpts, pOptState );
if (! SUCCESSFUL( res ))
return res;
- pOptState->flags |= (pOptState->pOD->fOptState & OPTST_PERSISTENT);
+ pOptState->flags |= (pOptState->pOD->fOptState & OPTST_PERSISTENT_MASK);
+ at = OPTST_GET_ARGTYPE(pOptState->flags);
/*
* Figure out what to do about option arguments. An argument may be
*/
if ((pOptState->flags & OPTST_DISABLED) != 0)
arg_type = ARG_NONE;
- else if (OPTST_GET_ARGTYPE(pOptState->flags) == OPARG_TYPE_NONE)
+ else if (at == OPARG_TYPE_NONE)
arg_type = ARG_NONE;
else if (pOptState->flags & OPTST_ARG_OPTIONAL)
arg_type = ARG_MAY;
*
* DO NOT EDIT THIS FILE (options.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:25 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:13 PM PDT
* From the definitions funcs.def
* and the template file options_h
*
* values for "opt_name" are available.
*/
+#define OPTIONS_STRUCT_VERSION 110597
+#define OPTIONS_VERSION_STRING "27:5:3"
+#define OPTIONS_MINIMUM_VERSION 98304
+#define OPTIONS_MIN_VER_STRING "24:0:0"
+
typedef enum {
OPARG_TYPE_NONE = 0,
OPARG_TYPE_STRING = 1, /* default type/ vanilla string */
char* pzName;
union {
char strVal[1]; /* OPARG_TYPE_STRING */
- int enumVal; /* OPARG_TYPE_ENUMERATION */
- int boolVal; /* OPARG_TYPE_BOOLEAN */
- long setVal; /* OPARG_TYPE_MEMBERSHIP */
+ unsigned int enumVal; /* OPARG_TYPE_ENUMERATION */
+ unsigned int boolVal; /* OPARG_TYPE_BOOLEAN */
+ unsigned long setVal; /* OPARG_TYPE_MEMBERSHIP */
long longVal; /* OPARG_TYPE_NUMERIC */
void* nestVal; /* OPARG_TYPE_HIERARCHY */
} v;
} tOptionValue;
-#define OPTST_SET_ARGTYPE(n) ((n) << 12)
-#define OPTST_GET_ARGTYPE(f) (((f) & OPTST_ARG_TYPE_MASK) >> 12)
-
/*
* Bits in the fOptState option descriptor field.
*/
-#define OPTST_INIT 0x0000000U /* Initial compiled value */
-#define OPTST_SET 0x0000001U /* Set via the "SET_OPT()" macro */
-#define OPTST_PRESET 0x0000002U /* Set via an RC/INI file */
-#define OPTST_DEFINED 0x0000004U /* Set via a command line option */
-
-#define OPTST_SET_MASK 0x0000007U /* mask of flags that show set state */
-
-#define OPTST_EQUIVALENCE 0x0000010U /* selected by equiv'ed option */
-#define OPTST_DISABLED 0x0000020U /* option is in disabled state */
-
-#define OPTST_NO_INIT 0x0000100U /* option cannot be preset */
-#define OPTST_NUMBER_OPT 0x0000200U /* opt value (flag) is any digit */
-#define OPTST_STACKED 0x0000400U /* opt uses optionStackArg procedure */
-#define OPTST_INITENABLED 0x0000800U /* option defaults to enabled */
-#define OPTST_ARG_TYPE_MASK 0x000F000U /* bits used to specify opt arg type */
-#define OPTST_ARG_OPTIONAL 0x0010000U /* the option argument not required */
-#define OPTST_IMM 0x0020000U /* process option on first pass */
-#define OPTST_DISABLE_IMM 0x0040000U /* process disablement on first pass */
-#define OPTST_OMITTED 0x0080000U /* compiled out of program */
-#define OPTST_MUST_SET 0x0100000U /* must be set or pre-set */
-#define OPTST_DOCUMENT 0x0200000U /* opt is for documentation only */
-#define OPTST_TWICE 0x0400000U /* process option twice - imm + reg */
-#define OPTST_DISABLE_TWICE 0x0800000U /* process disabled option twice */
-
-#define OPTST_PERSISTENT 0xFFFFF00U /* mask of flags that do not change */
-
-#define SELECTED_OPT( pod ) ( (pod)->fOptState & (OPTST_SET | OPTST_DEFINED))
-#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
-#define DISABLED_OPT( pod ) ( (pod)->fOptState & OPTST_DISABLED)
-#define OPTION_STATE( pod ) ((pod)->fOptState)
+typedef enum {
+ OPTST_SET_ID = 0, /* Set via the "SET_OPT()" macro */
+ OPTST_PRESET_ID = 1, /* Set via an RC/INI file */
+ OPTST_DEFINED_ID = 2, /* Set via a command line option */
+ OPTST_EQUIVALENCE_ID = 4, /* selected by equiv'ed option */
+ OPTST_DISABLED_ID = 5, /* option is in disabled state */
+ OPTST_NO_INIT_ID = 8, /* option cannot be preset */
+ OPTST_NUMBER_OPT_ID = 9, /* opt value (flag) is any digit */
+ OPTST_STACKED_ID = 10, /* opt uses optionStackArg proc */
+ OPTST_INITENABLED_ID = 11, /* option defaults to enabled */
+ OPTST_ARG_TYPE_1_ID = 12, /* bit 1 of arg type enum */
+ OPTST_ARG_TYPE_2_ID = 13, /* bit 2 of arg type enum */
+ OPTST_ARG_TYPE_3_ID = 14, /* bit 3 of arg type enum */
+ OPTST_ARG_TYPE_4_ID = 15, /* bit 4 of arg type enum */
+ OPTST_ARG_OPTIONAL_ID = 16, /* the option arg not required */
+ OPTST_IMM_ID = 17, /* process opt on first pass */
+ OPTST_DISABLE_IMM_ID = 18, /* process disablement immed. */
+ OPTST_OMITTED_ID = 19, /* compiled out of program */
+ OPTST_MUST_SET_ID = 20, /* must be set or pre-set */
+ OPTST_DOCUMENT_ID = 21, /* opt is for doc only */
+ OPTST_TWICE_ID = 22, /* process opt twice - imm + reg */
+ OPTST_DISABLE_TWICE_ID = 23 /* process disabled option twice */
+} opt_state_enum_t;
+
+#define OPTST_INIT 0U
+#define OPTST_SET (1U << OPTST_SET_ID)
+#define OPTST_PRESET (1U << OPTST_PRESET_ID)
+#define OPTST_DEFINED (1U << OPTST_DEFINED_ID)
+#define OPTST_EQUIVALENCE (1U << OPTST_EQUIVALENCE_ID)
+#define OPTST_DISABLED (1U << OPTST_DISABLED_ID)
+#define OPTST_NO_INIT (1U << OPTST_NO_INIT_ID)
+#define OPTST_NUMBER_OPT (1U << OPTST_NUMBER_OPT_ID)
+#define OPTST_STACKED (1U << OPTST_STACKED_ID)
+#define OPTST_INITENABLED (1U << OPTST_INITENABLED_ID)
+#define OPTST_ARG_TYPE_1 (1U << OPTST_ARG_TYPE_1_ID)
+#define OPTST_ARG_TYPE_2 (1U << OPTST_ARG_TYPE_2_ID)
+#define OPTST_ARG_TYPE_3 (1U << OPTST_ARG_TYPE_3_ID)
+#define OPTST_ARG_TYPE_4 (1U << OPTST_ARG_TYPE_4_ID)
+#define OPTST_ARG_OPTIONAL (1U << OPTST_ARG_OPTIONAL_ID)
+#define OPTST_IMM (1U << OPTST_IMM_ID)
+#define OPTST_DISABLE_IMM (1U << OPTST_DISABLE_IMM_ID)
+#define OPTST_OMITTED (1U << OPTST_OMITTED_ID)
+#define OPTST_MUST_SET (1U << OPTST_MUST_SET_ID)
+#define OPTST_DOCUMENT (1U << OPTST_DOCUMENT_ID)
+#define OPTST_TWICE (1U << OPTST_TWICE_ID)
+#define OPTST_DISABLE_TWICE (1U << OPTST_DISABLE_TWICE_ID)
+#define OPT_STATE_MASK 0x00FFFF37U
+
+#define OPTST_SET_MASK ( \
+ OPTST_SET | \
+ OPTST_PRESET | \
+ OPTST_DEFINED )
+
+#define OPTST_MUTABLE_MASK ( \
+ OPTST_SET | \
+ OPTST_PRESET | \
+ OPTST_DEFINED | \
+ OPTST_EQUIVALENCE | \
+ OPTST_DISABLED )
+
+#define OPTST_SELECTED_MASK ( \
+ OPTST_SET | \
+ OPTST_DEFINED )
+
+#define OPTST_ARG_TYPE_MASK ( \
+ OPTST_ARG_TYPE_1 | \
+ OPTST_ARG_TYPE_2 | \
+ OPTST_ARG_TYPE_3 | \
+ OPTST_ARG_TYPE_4 )
+
+#define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK)
+
+#define SELECTED_OPT( pod ) ((pod)->fOptState & OPTST_SELECTED_MASK)
+#define UNUSED_OPT( pod ) (((pod)->fOptState & OPTST_SET_MASK) == 0)
+#define DISABLED_OPT( pod ) ((pod)->fOptState & OPTST_DISABLED)
+#define OPTION_STATE( pod ) ((pod)->fOptState)
+
+#define OPTST_SET_ARGTYPE(n) ((n) << OPTST_ARG_TYPE_1_ID)
+#define OPTST_GET_ARGTYPE(f) (((f) & OPTST_ARG_TYPE_MASK)>>OPTST_ARG_TYPE_1_ID)
/*
* PRIVATE INTERFACES
*/
/*
- * Define any special processing flags
- */
-#define OPTPROC_NONE 0x000000
-#define OPTPROC_LONGOPT 0x000001 /* Process long style options */
-#define OPTPROC_SHORTOPT 0x000002 /* Process short style "flags" */
-#define OPTPROC_ERRSTOP 0x000004 /* Stop on argument errors */
-#define OPTPROC_DISABLEDOPT 0x000008 /* Current option is disabled */
-#define OPTPROC_NO_REQ_OPT 0x000010 /* no options are required */
-#define OPTPROC_NUM_OPT 0x000020 /* there is a number option */
-#define OPTPROC_INITDONE 0x000040 /* have initializations been done? */
-#define OPTPROC_NEGATIONS 0x000080 /* any negation options? */
-#define OPTPROC_ENVIRON 0x000100 /* check environment? */
-#define OPTPROC_NO_ARGS 0x000200 /* Disallow remaining arguments */
-#define OPTPROC_ARGS_REQ 0x000400 /* Require arguments after options */
-#define OPTPROC_REORDER 0x000800 /* reorder arguments after options */
-#define OPTPROC_GNUUSAGE 0x001000 /* emit usage in GNU style */
-#define OPTPROC_TRANSLATE 0x002000 /* Translate strings in tOptions */
-#define OPTPROC_HAS_IMMED 0x004000 /* program defines immed options */
-#define OPTPROC_PRESETTING 0x800000 /* opt processing in preset state */
+ * Define the processing state flags
+ */
+typedef enum {
+ OPTPROC_LONGOPT_ID = 0, /* Process long style options */
+ OPTPROC_SHORTOPT_ID = 1, /* Process short style "flags" */
+ OPTPROC_ERRSTOP_ID = 2, /* Stop on argument errors */
+ OPTPROC_DISABLEDOPT_ID = 3, /* Current option is disabled */
+ OPTPROC_NO_REQ_OPT_ID = 4, /* no options are required */
+ OPTPROC_NUM_OPT_ID = 5, /* there is a number option */
+ OPTPROC_INITDONE_ID = 6, /* have initializations been done? */
+ OPTPROC_NEGATIONS_ID = 7, /* any negation options? */
+ OPTPROC_ENVIRON_ID = 8, /* check environment? */
+ OPTPROC_NO_ARGS_ID = 9, /* Disallow remaining arguments */
+ OPTPROC_ARGS_REQ_ID = 10, /* Require arguments after options */
+ OPTPROC_REORDER_ID = 11, /* reorder operands after options */
+ OPTPROC_GNUUSAGE_ID = 12, /* emit usage in GNU style */
+ OPTPROC_TRANSLATE_ID = 13, /* Translate strings in tOptions */
+ OPTPROC_HAS_IMMED_ID = 14, /* program defines immed options */
+ OPTPROC_PRESETTING_ID = 19 /* opt processing in preset state */
+} optproc_state_enum_t;
+
+#define OPTPROC_NONE 0U
+#define OPTPROC_LONGOPT (1U << OPTPROC_LONGOPT_ID)
+#define OPTPROC_SHORTOPT (1U << OPTPROC_SHORTOPT_ID)
+#define OPTPROC_ERRSTOP (1U << OPTPROC_ERRSTOP_ID)
+#define OPTPROC_DISABLEDOPT (1U << OPTPROC_DISABLEDOPT_ID)
+#define OPTPROC_NO_REQ_OPT (1U << OPTPROC_NO_REQ_OPT_ID)
+#define OPTPROC_NUM_OPT (1U << OPTPROC_NUM_OPT_ID)
+#define OPTPROC_INITDONE (1U << OPTPROC_INITDONE_ID)
+#define OPTPROC_NEGATIONS (1U << OPTPROC_NEGATIONS_ID)
+#define OPTPROC_ENVIRON (1U << OPTPROC_ENVIRON_ID)
+#define OPTPROC_NO_ARGS (1U << OPTPROC_NO_ARGS_ID)
+#define OPTPROC_ARGS_REQ (1U << OPTPROC_ARGS_REQ_ID)
+#define OPTPROC_REORDER (1U << OPTPROC_REORDER_ID)
+#define OPTPROC_GNUUSAGE (1U << OPTPROC_GNUUSAGE_ID)
+#define OPTPROC_TRANSLATE (1U << OPTPROC_TRANSLATE_ID)
+#define OPTPROC_HAS_IMMED (1U << OPTPROC_HAS_IMMED_ID)
+#define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID)
+#define OPTPROC_STATE_MASK 0x00087FFFU
#define STMTS(s) do { s; } while (0)
typedef union {
char const * argString;
+ uintptr_t argEnum;
uintptr_t argIntptr;
- int argInt;
- unsigned int argUint;
- ag_bool argBool;
+ long argInt;
+ unsigned long argUint;
+ unsigned int argBool;
} optArgBucket_t;
/*
const tAoUS default_opt;
};
-#define OPTIONS_STRUCT_VERSION 110595
-#define OPTIONS_VERSION_STRING "27:4:3"
-#define OPTIONS_MINIMUM_VERSION 98304
-#define OPTIONS_MIN_VER_STRING "24:0:0"
-
/*
* The procedure generated for translating option text
*/
extern void optionOnlyUsage( tOptions*, int );
-/* From: autoopts.c line 980
+/* From: autoopts.c line 982
*
* optionProcess - this is the main option processing routine
*
*
* DO NOT EDIT THIS FILE (usage-txt.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:22 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:10 PM PDT
* From the definitions usage-txt.def
* and the template file usage-txt.tpl
*
/*
- * $Id: configfile.c,v 4.28 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: configfile.c,v 4.29 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:18:51 bkorb"
*
* configuration/rc/ini file handling.
/*
- * $Id: cook.c,v 4.8 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: cook.c,v 4.9 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:21:02 bkorb"
*
* This file contains the routines that deal with processing quoted strings
/*
* $Id: enumeration.c,v 4.14 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:00:53 bkorb"
+ * Time-stamp: "2006-10-05 21:10:21 bkorb"
*
* Automated Options Paged Usage module.
*
{
tOptDesc od;
- od.optArg.argIntptr = enum_val;
+ od.optArg.argEnum = enum_val;
(*(pOD->pOptProc))( (void*)(2UL), &od );
return od.optArg.argString;
}
case 1UL:
{
- unsigned int ix = pOD->optArg.argIntptr;
+ unsigned int ix = pOD->optArg.argEnum;
/*
* print the name string.
*/
case 2UL:
{
tSCC zInval[] = "*INVALID*";
- unsigned int ix = pOD->optArg.argIntptr;
+ unsigned int ix = pOD->optArg.argEnum;
/*
* Replace the enumeration value with the name string.
*/
*
* DO NOT EDIT THIS FILE (genshell.c)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:26 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:14 PM PDT
* From the definitions genshell.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (genshell.h)
*
- * It has been AutoGen-ed Sunday September 24, 2006 at 03:28:26 PM PDT
+ * It has been AutoGen-ed Thursday October 5, 2006 at 09:15:14 PM PDT
* From the definitions genshell.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
/*
- * $Id: load.c,v 4.25 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: load.c,v 4.26 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:23:01 bkorb"
*
* This file contains the routines that deal with processing text strings
dnl
dnl DO NOT EDIT THIS FILE (libopts.m4)
dnl
-dnl It has been AutoGen-ed Sunday September 24, 2006 at 03:28:29 PM PDT
+dnl It has been AutoGen-ed Thursday October 5, 2006 at 09:15:16 PM PDT
dnl From the definitions libopts.def
dnl and the template file conftest.tpl
dnl
/*
- * $Id: makeshell.c,v 4.17 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:19:24 bkorb"
+ * $Id: makeshell.c,v 4.18 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 20:41:23 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and create a Bourne shell script capable of parsing them.
* Numeric and membership bit options are just printed as a number.
*/
case OPARG_TYPE_NUMERIC:
- case OPARG_TYPE_MEMBERSHIP:
snprintf( zVal, sizeof( zVal ), "%d",
- (int)pOptDesc->optArg.argIntptr );
+ (int)pOptDesc->optArg.argInt );
pzDefault = zVal;
break;
+ case OPARG_TYPE_MEMBERSHIP:
+ snprintf( zVal, sizeof( zVal ), "%lu",
+ (unsigned long)pOptDesc->optArg.argIntptr );
+ pzDefault = zVal;
+ break;
+
+ case OPARG_TYPE_BOOLEAN:
+ pzDefault = (pOptDesc->optArg.argBool) ? "true" : "false";
+ break;
+
default:
if (pOptDesc->optArg.argString == NULL) {
if (pzFmt == zSingleDef)
/*
- * $Id: nested.c,v 4.13 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: nested.c,v 4.14 2006/09/28 01:26:16 bkorb Exp $
* Time-stamp: "2006-09-24 15:27:32 bkorb"
*
* Automated Options Nested Values module.
/*
- * $Id: numeric.c,v 4.9 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:14:38 bkorb"
+ * $Id: numeric.c,v 4.10 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-04 16:12:34 bkorb"
*/
/*
optionNumericVal( tOptions* pOpts, tOptDesc* pOD )
{
char* pz;
- int val;
+ long val;
/*
* Numeric options may have a range associated with it.
if ((pOD == NULL) || (pOD->optArg.argString == NULL))
return;
- val = (int)strtol( pOD->optArg.argString, &pz, 0 );
+ val = strtol( pOD->optArg.argString, &pz, 0 );
if (*pz != NUL) {
fprintf( stderr, zNotNumber, pOpts->pzProgName, pOD->optArg.argString );
(*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE);
/* -*- buffer-read-only: t -*- vi: set ro:
*
* Prototypes for autoopts
- * Generated Sun Sep 24 15:28:27 PDT 2006
+ * Generated Thu Oct 5 21:15:15 PDT 2006
*/
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1
/*
- * $Id: putshell.c,v 4.14 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-24 15:28:15 bkorb"
+ * $Id: putshell.c,v 4.16 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 20:37:42 bkorb"
*
* This module will interpret the options set in the tOptions
* structure and print them to standard out in a fashion that
if (pOD->optActualIndex != optIx) {
tOptDesc* p = pOpts->pOptDesc + pOD->optActualIndex;
p->optArg = pOD->optArg;
- p->fOptState &= OPTST_PERSISTENT;
- p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT;
+ p->fOptState &= OPTST_PERSISTENT_MASK;
+ p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT_MASK;
printf( zEquivMode, pOpts->pzPROGNAME, pOD->pz_NAME, p->pz_NAME );
pOD = p;
}
* of bitmask value and we need to emit the bit values.
*/
if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) {
- char* pz;
+ char const * pz;
uintptr_t val = 1;
printf( zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
(uintptr_t)(pOD->optCookie) );
* We are building the typeset list. The list returned starts with
* 'none + ' for use by option saving stuff. We must ignore that.
*/
- pz = (char*)pOD->optArg.argString + 7;
+ pz = pOD->optArg.argString + 7;
while (*pz != NUL) {
printf( "typeset -x -i %s_", pOD->pz_NAME );
pz += strspn( pz, " +\t\n\f" );
*/
else if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NUMERIC)
printf( zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
- pOD->optArg.argIntptr );
+ (int)pOD->optArg.argInt );
/*
* If the argument type is an enumeration, then it is much
*/
else if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_BOOLEAN)
printf( zFullOptFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
- (pOD->optArg.argIntptr == 0) ? "false" : "true" );
+ (pOD->optArg.argBool == 0) ? "false" : "true" );
/*
* IF the option has an empty value,
/*
- * restore.c $Id: restore.c,v 4.8 2006/09/24 02:10:45 bkorb Exp $
+ * restore.c $Id: restore.c,v 4.9 2006/10/05 03:39:53 bkorb Exp $
* Time-stamp: "2005-02-23 15:10:20 bkorb"
*
* This module's routines will save the current option state to memory
if ( (p->fOptState & OPTST_STACKED)
&& (p->optCookie != NULL)) {
AGFREE( p->optCookie );
- p->fOptState &= OPTST_PERSISTENT;
+ p->fOptState &= OPTST_PERSISTENT_MASK;
if ((p->fOptState & OPTST_INITENABLED) == 0)
p->fOptState |= OPTST_DISABLED;
}
/*
- * save.c $Id: save.c,v 4.19 2006/09/24 02:10:45 bkorb Exp $
- * Time-stamp: "2006-09-22 18:11:20 bkorb"
+ * save.c $Id: save.c,v 4.20 2006/10/05 03:39:53 bkorb Exp $
+ * Time-stamp: "2006-10-05 21:09:18 bkorb"
*
* This module's routines will take the currently set options and
* store them into an ".rc" file for re-interpretation the next
switch (arg_state) {
case 0:
case OPARG_TYPE_NUMERIC:
- printEntry( fp, p, p->optArg.argString );
+ printEntry( fp, p, (void*)(p->optArg.argInt));
break;
case OPARG_TYPE_STRING:
case OPARG_TYPE_ENUMERATION:
case OPARG_TYPE_MEMBERSHIP:
{
- tCC* val = p->optArg.argString;
+ uintptr_t val = p->optArg.argEnum;
/*
* This is a magic incantation that will convert the
* bit flag values back into a string suitable for printing.
*/
(*(p->pOptProc))( (tOptions*)2UL, p );
- printEntry( fp, p, p->optArg.argString );
+ printEntry( fp, p, (void*)(p->optArg.argString));
if ( (p->optArg.argString != NULL)
&& (arg_state != OPARG_TYPE_ENUMERATION))
/*
* bit flag and enumeration strings get allocated
*/
AGFREE( (void*)p->optArg.argString );
- p->optArg.argString = val;
+ p->optArg.argEnum = val;
break;
}
case OPARG_TYPE_BOOLEAN:
- printEntry( fp, p, (p->optArg.argBool != AG_FALSE)
- ? "true" : "false" );
+ printEntry( fp, p, p->optArg.argBool ? "true" : "false" );
break;
default:
/*
* stack.c
- * $Id: stack.c,v 4.12 2006/09/24 02:10:45 bkorb Exp $
+ * $Id: stack.c,v 4.13 2006/10/05 03:39:53 bkorb Exp $
* Time-stamp: "2006-09-22 18:13:19 bkorb"
*
* This is a special option processing routine that will save the
* THEN indicate that we don't have any of these options
*/
if (pAL == NULL) {
- pOptDesc->fOptState &= OPTST_PERSISTENT;
+ pOptDesc->fOptState &= OPTST_PERSISTENT_MASK;
if ( (pOptDesc->fOptState & OPTST_INITENABLED) == 0)
pOptDesc->fOptState |= OPTST_DISABLED;
return;
* THEN indicate that we don't have any of these options
*/
if (pAL->useCt == 0) {
- pOptDesc->fOptState &= OPTST_PERSISTENT;
+ pOptDesc->fOptState &= OPTST_PERSISTENT_MASK;
if ( (pOptDesc->fOptState & OPTST_INITENABLED) == 0)
pOptDesc->fOptState |= OPTST_DISABLED;
free( (void*)pAL );
*
* DO NOT EDIT THIS FILE (sntp-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:04 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:12 AM EDT
* From the definitions sntp-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
*
* DO NOT EDIT THIS FILE (sntp-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:03 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:12 AM EDT
* From the definitions sntp-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*
*
* DO NOT EDIT THIS FILE (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:06 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:14 AM EDT
* From the definitions ntp-keygen-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
{
static const struct {const int rmin, rmax;} rng[ 1 ] = {
{ 256, 2048 } };
- long val;
+ int val;
int ix;
char const* pzIndent = "\t\t\t\t ";
extern FILE* option_usage_fp;
return;
valid_return:
- pOptDesc->optArg.argString = (char*)val;
+ pOptDesc->optArg.argInt = val;
}
#endif /* defined OPENSSL */
*
* DO NOT EDIT THIS FILE (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed Monday September 25, 2006 at 02:50:05 PM EDT
+ * It has been AutoGen-ed Sunday October 8, 2006 at 03:53:13 AM EDT
* From the definitions ntp-keygen-opts.def
* and the template file options
+ *
+ * Generated from AutoOpts 27:5:3 templates.
*/
/*
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 110592
+#define AO_TEMPLATE_VERSION 110597
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define CLEAR_OPT(n) STMTS( \
- DESC(n).fOptState &= OPTST_PERSISTENT; \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define SET_OPT_SAVE_OPTS(a) STMTS( \
- DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT; \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
/*