rsstats 0.0.1
Redis Enterprise Statistic collector
rsstats-opts.h File Reference
#include "config.h"
#include <autoopts/options.h>
#include <stdarg.h>
#include <stdnoreturn.h>
Include dependency graph for rsstats-opts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AO_TEMPLATE_VERSION   172033
 This file contains the programmatic interface to the Automated Options generated for the rsstats program. More...
 
#define NOT_REACHED
 
#define OPTION_CT   9
 count of all options for rsstats More...
 
#define RSSTATS_VERSION   "0.0.1"
 rsstats version More...
 
#define RSSTATS_FULL_VERSION   "rsstats 0.0.1"
 Full rsstats version text. More...
 
#define DESC(n)   (rsstatsOptions.pOptDesc[INDEX_OPT_## n])
 Interface defines for all options. More...
 
#define HAVE_OPT(n)   (! UNUSED_OPT(& DESC(n)))
 'true' if an option has been specified in any way More...
 
#define OPT_ARG(n)   (DESC(n).optArg.argString)
 The string argument to an option. More...
 
#define STATE_OPT(n)   (DESC(n).fOptState & OPTST_SET_MASK)
 Mask the option state revealing how an option was specified. More...
 
#define COUNT_OPT(n)   (DESC(n).optOccCt)
 Count of option's occurrances on the command line. More...
 
#define ISSEL_OPT(n)   (SELECTED_OPT(&DESC(n)))
 mask of OPTST_SET and OPTST_DEFINED. More...
 
#define ISUNUSED_OPT(n)   (UNUSED_OPT(& DESC(n)))
 'true' if HAVE_OPT would yield 'false'. More...
 
#define ENABLED_OPT(n)   (! DISABLED_OPT(& DESC(n)))
 'true' if OPTST_DISABLED bit not set. More...
 
#define STACKCT_OPT(n)   (((tArgList*)(DESC(n).optCookie))->useCt)
 number of stacked option arguments. More...
 
#define STACKLST_OPT(n)   (((tArgList*)(DESC(n).optCookie))->apzArgs)
 stacked argument vector. More...
 
#define CLEAR_OPT(n)
 Reset an option. More...
 

Enumerations

enum  teOptIndex {
  INDEX_OPT_INPUT = 0 , INDEX_OPT_OUTPUT = 1 , INDEX_OPT_CLUSTERS = 2 , INDEX_OPT_REPORTS = 3 ,
  INDEX_OPT_VERSION = 4 , INDEX_OPT_HELP = 5 , INDEX_OPT_MORE_HELP = 6 , INDEX_OPT_SAVE_OPTS = 7 ,
  INDEX_OPT_LOAD_OPTS = 8
}
 Enumeration of each option type for rsstats. More...
 
enum  rsstats_exit_code_t {
  RSSTATS_EXIT_SUCCESS = 0 , RSSTATS_EXIT_FAILURE = 1 , RSSTATS_EXIT_USAGE_ERROR = 64 , RSSTATS_EXIT_NO_CONFIG_INPUT = 66 ,
  RSSTATS_EXIT_LIBOPTS_FAILURE = 70
}
 Enumeration of rsstats exit codes. More...
 
#define VALUE_OPT_INPUT   'i'
 Interface defines for specific options. More...
 
#define VALUE_OPT_OUTPUT   'o'
 
#define VALUE_OPT_CLUSTERS   'c'
 
#define VALUE_OPT_REPORTS   'r'
 
#define REPORTS_BDBS   0x1UL
 
#define REPORTS_CLUSTER   0x2UL
 
#define REPORTS_MEMBERSHIP_MASK   0x3UL
 
#define OPT_VALUE_REPORTS   ((uintptr_t)DESC(REPORTS).optCookie)
 
#define OPT_MEMLST_REPORTS   optionMemberList(&DESC(REPORTS))
 
#define VALUE_OPT_HELP   'h'
 option flag (value) for help-value option More...
 
#define VALUE_OPT_MORE_HELP   'H'
 option flag (value) for more-help-value option More...
 
#define VALUE_OPT_VERSION   'v'
 option flag (value) for version-value option More...
 
#define VALUE_OPT_SAVE_OPTS   '>'
 option flag (value) for save-opts-value option More...
 
#define VALUE_OPT_LOAD_OPTS   '<'
 option flag (value) for load-opts-value option More...
 
#define SET_OPT_SAVE_OPTS(a)
 
#define ERRSKIP_OPTERR   STMTS(rsstatsOptions.fOptSet &= ~OPTPROC_ERRSTOP)
 
#define ERRSTOP_OPTERR   STMTS(rsstatsOptions.fOptSet |= OPTPROC_ERRSTOP)
 
#define RESTART_OPT(n)
 
#define START_OPT   RESTART_OPT(1)
 
#define USAGE(c)   (*rsstatsOptions.pUsageProc)(&rsstatsOptions, c)
 
#define OPT_NO_XLAT_CFG_NAMES
 
#define OPT_NO_XLAT_OPT_NAMES
 
#define OPT_XLAT_CFG_NAMES
 
#define OPT_XLAT_OPT_NAMES
 
#define _(_s)   _s
 
tOptions rsstatsOptions
 The option definitions for rsstats. More...
 

Macro Definition Documentation

◆ _

#define _ (   _s)    _s

Definition at line 229 of file rsstats-opts.h.

◆ AO_TEMPLATE_VERSION

#define AO_TEMPLATE_VERSION   172033

This file contains the programmatic interface to the Automated Options generated for the rsstats program.

These macros are documented in the AutoGen info file in the "AutoOpts" chapter. Please refer to that doc for usage help. Ensure that the library used for compiling this generated header is at least as new as the version current when the header template was released (not counting patch version increments). Also ensure that the oldest tolerable version is at least as old as what was current when the header template was released.

Definition at line 60 of file rsstats-opts.h.

◆ CLEAR_OPT

#define CLEAR_OPT (   n)
Value:
STMTS( \
DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
DESC(n).fOptState |= OPTST_DISABLED; \
DESC(n).optCookie = NULL )
#define NULL
Definition: rsstats-opts.c:64
#define DESC(n)
Interface defines for all options.
Definition: rsstats-opts.h:99

Reset an option.

Definition at line 124 of file rsstats-opts.h.

◆ COUNT_OPT

#define COUNT_OPT (   n)    (DESC(n).optOccCt)

Count of option's occurrances on the command line.

Definition at line 110 of file rsstats-opts.h.

◆ DESC

#define DESC (   n)    (rsstatsOptions.pOptDesc[INDEX_OPT_## n])

Interface defines for all options.

Replace "n" with the UPPER_CASED option name (as in the teOptIndex enumeration above). e.g. HAVE_OPT(INPUT)

Definition at line 99 of file rsstats-opts.h.

◆ ENABLED_OPT

#define ENABLED_OPT (   n)    (! DISABLED_OPT(& DESC(n)))

'true' if OPTST_DISABLED bit not set.

Definition at line 116 of file rsstats-opts.h.

◆ ERRSKIP_OPTERR

#define ERRSKIP_OPTERR   STMTS(rsstatsOptions.fOptSet &= ~OPTPROC_ERRSTOP)

Definition at line 171 of file rsstats-opts.h.

◆ ERRSTOP_OPTERR

#define ERRSTOP_OPTERR   STMTS(rsstatsOptions.fOptSet |= OPTPROC_ERRSTOP)

Definition at line 172 of file rsstats-opts.h.

◆ HAVE_OPT

#define HAVE_OPT (   n)    (! UNUSED_OPT(& DESC(n)))

'true' if an option has been specified in any way

Definition at line 101 of file rsstats-opts.h.

◆ ISSEL_OPT

#define ISSEL_OPT (   n)    (SELECTED_OPT(&DESC(n)))

mask of OPTST_SET and OPTST_DEFINED.

Definition at line 112 of file rsstats-opts.h.

◆ ISUNUSED_OPT

#define ISUNUSED_OPT (   n)    (UNUSED_OPT(& DESC(n)))

'true' if HAVE_OPT would yield 'false'.

Definition at line 114 of file rsstats-opts.h.

◆ NOT_REACHED

#define NOT_REACHED

Definition at line 70 of file rsstats-opts.h.

◆ OPT_ARG

#define OPT_ARG (   n)    (DESC(n).optArg.argString)

The string argument to an option.

The argument type must be "string".

Definition at line 103 of file rsstats-opts.h.

◆ OPT_MEMLST_REPORTS

#define OPT_MEMLST_REPORTS   optionMemberList(&DESC(REPORTS))

Definition at line 153 of file rsstats-opts.h.

◆ OPT_NO_XLAT_CFG_NAMES

#define OPT_NO_XLAT_CFG_NAMES

Definition at line 222 of file rsstats-opts.h.

◆ OPT_NO_XLAT_OPT_NAMES

#define OPT_NO_XLAT_OPT_NAMES

Definition at line 223 of file rsstats-opts.h.

◆ OPT_VALUE_REPORTS

#define OPT_VALUE_REPORTS   ((uintptr_t)DESC(REPORTS).optCookie)

Definition at line 152 of file rsstats-opts.h.

◆ OPT_XLAT_CFG_NAMES

#define OPT_XLAT_CFG_NAMES

Definition at line 225 of file rsstats-opts.h.

◆ OPT_XLAT_OPT_NAMES

#define OPT_XLAT_OPT_NAMES

Definition at line 226 of file rsstats-opts.h.

◆ OPTION_CT

#define OPTION_CT   9

count of all options for rsstats

Definition at line 88 of file rsstats-opts.h.

◆ REPORTS_BDBS

#define REPORTS_BDBS   0x1UL

Definition at line 149 of file rsstats-opts.h.

◆ REPORTS_CLUSTER

#define REPORTS_CLUSTER   0x2UL

Definition at line 150 of file rsstats-opts.h.

◆ REPORTS_MEMBERSHIP_MASK

#define REPORTS_MEMBERSHIP_MASK   0x3UL

Definition at line 151 of file rsstats-opts.h.

◆ RESTART_OPT

#define RESTART_OPT (   n)
Value:
STMTS( \
rsstatsOptions.curOptIdx = (n); \
rsstatsOptions.pzCurOpt = NULL )
tOptions rsstatsOptions
The option definitions for rsstats.
Definition: rsstats-opts.c:508

Definition at line 173 of file rsstats-opts.h.

◆ RSSTATS_FULL_VERSION

#define RSSTATS_FULL_VERSION   "rsstats 0.0.1"

Full rsstats version text.

Definition at line 92 of file rsstats-opts.h.

◆ RSSTATS_VERSION

#define RSSTATS_VERSION   "0.0.1"

rsstats version

Definition at line 90 of file rsstats-opts.h.

◆ SET_OPT_SAVE_OPTS

#define SET_OPT_SAVE_OPTS (   a)
Value:
STMTS( \
DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
DESC(SAVE_OPTS).optArg.argString = (char const*)(a))

Definition at line 164 of file rsstats-opts.h.

◆ STACKCT_OPT

#define STACKCT_OPT (   n)    (((tArgList*)(DESC(n).optCookie))->useCt)

number of stacked option arguments.

Valid only for stacked option arguments.

Definition at line 119 of file rsstats-opts.h.

◆ STACKLST_OPT

#define STACKLST_OPT (   n)    (((tArgList*)(DESC(n).optCookie))->apzArgs)

stacked argument vector.

Valid only for stacked option arguments.

Definition at line 122 of file rsstats-opts.h.

◆ START_OPT

#define START_OPT   RESTART_OPT(1)

Definition at line 176 of file rsstats-opts.h.

◆ STATE_OPT

#define STATE_OPT (   n)    (DESC(n).fOptState & OPTST_SET_MASK)

Mask the option state revealing how an option was specified.

It will be one and only one of OPTST_SET, OPTST_PRESET, OPTST_DEFINED, OPTST_RESET or zero.

Definition at line 108 of file rsstats-opts.h.

◆ USAGE

#define USAGE (   c)    (*rsstatsOptions.pUsageProc)(&rsstatsOptions, c)

Definition at line 177 of file rsstats-opts.h.

◆ VALUE_OPT_CLUSTERS

#define VALUE_OPT_CLUSTERS   'c'

Definition at line 146 of file rsstats-opts.h.

◆ VALUE_OPT_HELP

#define VALUE_OPT_HELP   'h'

option flag (value) for help-value option

Definition at line 155 of file rsstats-opts.h.

◆ VALUE_OPT_INPUT

#define VALUE_OPT_INPUT   'i'

Interface defines for specific options.

Definition at line 144 of file rsstats-opts.h.

◆ VALUE_OPT_LOAD_OPTS

#define VALUE_OPT_LOAD_OPTS   '<'

option flag (value) for load-opts-value option

Definition at line 163 of file rsstats-opts.h.

◆ VALUE_OPT_MORE_HELP

#define VALUE_OPT_MORE_HELP   'H'

option flag (value) for more-help-value option

Definition at line 157 of file rsstats-opts.h.

◆ VALUE_OPT_OUTPUT

#define VALUE_OPT_OUTPUT   'o'

Definition at line 145 of file rsstats-opts.h.

◆ VALUE_OPT_REPORTS

#define VALUE_OPT_REPORTS   'r'

Definition at line 147 of file rsstats-opts.h.

◆ VALUE_OPT_SAVE_OPTS

#define VALUE_OPT_SAVE_OPTS   '>'

option flag (value) for save-opts-value option

Definition at line 161 of file rsstats-opts.h.

◆ VALUE_OPT_VERSION

#define VALUE_OPT_VERSION   'v'

option flag (value) for version-value option

Definition at line 159 of file rsstats-opts.h.

Enumeration Type Documentation

◆ rsstats_exit_code_t

Enumeration of rsstats exit codes.

Enumerator
RSSTATS_EXIT_SUCCESS 
RSSTATS_EXIT_FAILURE 
RSSTATS_EXIT_USAGE_ERROR 
RSSTATS_EXIT_NO_CONFIG_INPUT 
RSSTATS_EXIT_LIBOPTS_FAILURE 

Definition at line 133 of file rsstats-opts.h.

◆ teOptIndex

enum teOptIndex

Enumeration of each option type for rsstats.

Enumerator
INDEX_OPT_INPUT 
INDEX_OPT_OUTPUT 
INDEX_OPT_CLUSTERS 
INDEX_OPT_REPORTS 
INDEX_OPT_VERSION 
INDEX_OPT_HELP 
INDEX_OPT_MORE_HELP 
INDEX_OPT_SAVE_OPTS 
INDEX_OPT_LOAD_OPTS 

Definition at line 76 of file rsstats-opts.h.

Variable Documentation

◆ rsstatsOptions

tOptions rsstatsOptions
extern

The option definitions for rsstats.

The one structure that binds them all.

Definition at line 508 of file rsstats-opts.c.