diff options
author | jbj <jbj> | 2008-02-12 21:32:33 +0000 |
---|---|---|
committer | jbj <jbj> | 2008-02-12 21:32:33 +0000 |
commit | da94ec5a99e8ed7418db402319c75bc2ab9bfc1a (patch) | |
tree | d5940cf089f3c18f7ad5a3b0aea57321a23bdc83 /poptint.h | |
parent | 43bb2b77c603037aaaac896efaaad10409d29ebc (diff) | |
download | libpopt-da94ec5a99e8ed7418db402319c75bc2ab9bfc1a.tar.gz |
- jbj: start using poptArg and poptArgType() where useful.
- jbj: poptint.h: add a poptArgType define for bitfield type abstraction.
- jbj: poptint.h: add a poptArg union for opt->arg access without casts.
Diffstat (limited to 'poptint.h')
-rw-r--r-- | poptint.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -42,6 +42,20 @@ typedef struct { #define PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d)) #define PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0) +/** \ingroup popt + * A union to simplify opt->arg access without casting. + */ +typedef union poptArg_u { + void * ptr; + int * intp; + long * longp; + const char ** argv; + poptCallbackType cb; + poptOption opt; +} poptArg; + +#define poptArgType(opt) ((opt)->argInfo & POPT_ARG_MASK) + struct optionStackEntry { int argc; /*@only@*/ /*@null@*/ |