r5657: Fix uninitialized variable warning
[Samba.git] / source / popt / poptint.h
blob1847ffafe674770f7d62b800977661f228ad3936
1 /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING
2 file accompanying popt source distributions, available from
3 ftp://ftp.redhat.com/pub/code/popt */
5 #ifndef H_POPTINT
6 #define H_POPTINT
8 /* Bit mask macros. */
9 typedef unsigned int __pbm_bits;
10 #define __PBM_NBITS (8 * sizeof (__pbm_bits))
11 #define __PBM_IX(d) ((d) / __PBM_NBITS)
12 #define __PBM_MASK(d) ((__pbm_bits) 1 << ((d) % __PBM_NBITS))
13 typedef struct {
14 __pbm_bits bits[1];
15 } pbm_set;
16 #define __PBM_BITS(set) ((set)->bits)
18 #define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))
19 #define PBM_FREE(s) free(s);
20 #define PBM_SET(d, s) (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d))
21 #define PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d))
22 #define PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0)
24 struct optionStackEntry {
25 int argc;
26 /*@only@*/ const char ** argv;
27 /*@only@*/ pbm_set * argb;
28 int next;
29 /*@only@*/ const char * nextArg;
30 /*@keep@*/ const char * nextCharArg;
31 /*@dependent@*/ struct poptAlias * currAlias;
32 int stuffed;
35 struct execEntry {
36 const char * longName;
37 char shortName;
38 const char * script;
41 struct poptContext_s {
42 struct optionStackEntry optionStack[POPT_OPTION_DEPTH];
43 /*@dependent@*/ struct optionStackEntry * os;
44 /*@owned@*/ const char ** leftovers;
45 int numLeftovers;
46 int nextLeftover;
47 /*@keep@*/ const struct poptOption * options;
48 int restLeftover;
49 /*@only@*/ const char * appName;
50 /*@only@*/ struct poptAlias * aliases;
51 int numAliases;
52 int flags;
53 struct execEntry * execs;
54 int numExecs;
55 /*@only@*/ const char ** finalArgv;
56 int finalArgvCount;
57 int finalArgvAlloced;
58 /*@dependent@*/ struct execEntry * doExec;
59 /*@only@*/ const char * execPath;
60 int execAbsolute;
61 /*@only@*/ const char * otherHelp;
62 pbm_set * arg_strip;
65 #define xfree(_a) free((void *)_a)
67 #define POPT_(foo) (foo)
68 #define D_(dom, str) (str)
69 #define N_(foo) (foo)
71 #endif