Mixe for Privacy and Anonymity in the Internet
poptint.h
Go to the documentation of this file.
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 */
4 
5 #ifndef H_POPTINT
6 #define H_POPTINT
7 
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)
17 
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)
23 
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;
33 };
34 
35 struct execEntry {
36  const char * longName;
37  char shortName;
38  const char * script;
39 };
40 
41 struct poptContext_s {
43  /*@dependent@*/ struct optionStackEntry * os;
44  /*@owned@*/ const char ** leftovers;
47  /*@keep@*/ const struct poptOption * options;
49  /*@only@*/ const char * appName;
50  /*@only@*/ struct poptAlias * aliases;
52  int flags;
53  struct execEntry * execs;
54  int numExecs;
55  /*@only@*/ const char ** finalArgv;
58  /*@dependent@*/ struct execEntry * doExec;
59  /*@only@*/ const char * execPath;
61  /*@only@*/ const char * otherHelp;
63 };
64 
65 #define xfree(_a) free((void *)_a)
66 
67 #ifdef HAVE_LIBINTL_H
68 #include <libintl.h>
69 #endif
70 
71 #if defined(HAVE_GETTEXT) && !defined(__LCLINT__)
72 #define _(foo) gettext(foo)
73 #else
74 #define _(foo) (foo)
75 #endif
76 
77 // #if defined(HAVE_DGETTEXT) && !defined(__LCLINT__)
78 // #define D_(dom, str) dgettext(dom, str)
79 // #define POPT_(foo) D_("popt", foo)
80 // #else
81 #define POPT_(foo) (foo)
82 #define D_(dom, str) (str)
83 // #endif
84 
85 #define N_(foo) (foo)
86 
87 #endif
#define POPT_OPTION_DEPTH
Definition: popt.h:14
unsigned int __pbm_bits
Definition: poptint.h:9
Definition: poptint.h:35
const char * script
Definition: poptint.h:38
const char * longName
Definition: poptint.h:36
char shortName
Definition: poptint.h:37
Definition: poptint.h:24
int stuffed
Definition: poptint.h:32
const char * nextArg
Definition: poptint.h:29
const char * nextCharArg
Definition: poptint.h:30
struct poptAlias * currAlias
Definition: poptint.h:31
int argc
Definition: poptint.h:25
int next
Definition: poptint.h:28
pbm_set * argb
Definition: poptint.h:27
const char ** argv
Definition: poptint.h:26
Definition: popt.h:58
int finalArgvCount
Definition: poptint.h:56
const char ** leftovers
Definition: poptint.h:44
int execAbsolute
Definition: poptint.h:60
int nextLeftover
Definition: poptint.h:46
int finalArgvAlloced
Definition: poptint.h:57
const char * execPath
Definition: poptint.h:59
const struct poptOption * options
Definition: poptint.h:47
int numExecs
Definition: poptint.h:54
struct optionStackEntry * os
Definition: poptint.h:43
pbm_set * arg_strip
Definition: poptint.h:62
const char * otherHelp
Definition: poptint.h:61
int numLeftovers
Definition: poptint.h:45
const char * appName
Definition: poptint.h:49
int restLeftover
Definition: poptint.h:48
struct execEntry * execs
Definition: poptint.h:53
const char ** finalArgv
Definition: poptint.h:55
struct poptAlias * aliases
Definition: poptint.h:50
int numAliases
Definition: poptint.h:51
struct optionStackEntry optionStack[POPT_OPTION_DEPTH]
Definition: poptint.h:42
struct execEntry * doExec
Definition: poptint.h:58