summaryrefslogtreecommitdiff
path: root/poptint.h
diff options
context:
space:
mode:
authorjbj <jbj>2008-02-12 21:32:33 +0000
committerjbj <jbj>2008-02-12 21:32:33 +0000
commitda94ec5a99e8ed7418db402319c75bc2ab9bfc1a (patch)
treed5940cf089f3c18f7ad5a3b0aea57321a23bdc83 /poptint.h
parent43bb2b77c603037aaaac896efaaad10409d29ebc (diff)
downloadlibpopt-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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/poptint.h b/poptint.h
index 414dd60..2b2d6b6 100644
--- a/poptint.h
+++ b/poptint.h
@@ -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@*/