Mixe for Privacy and Anonymity in the Internet
popt
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
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
;
33
};
34
35
struct
execEntry
{
36
const
char
*
longName
;
37
char
shortName
;
38
const
char
*
script
;
39
};
40
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
;
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
POPT_OPTION_DEPTH
#define POPT_OPTION_DEPTH
Definition:
popt.h:14
__pbm_bits
unsigned int __pbm_bits
Definition:
poptint.h:9
execEntry
Definition:
poptint.h:35
execEntry::script
const char * script
Definition:
poptint.h:38
execEntry::longName
const char * longName
Definition:
poptint.h:36
execEntry::shortName
char shortName
Definition:
poptint.h:37
optionStackEntry
Definition:
poptint.h:24
optionStackEntry::stuffed
int stuffed
Definition:
poptint.h:32
optionStackEntry::nextArg
const char * nextArg
Definition:
poptint.h:29
optionStackEntry::nextCharArg
const char * nextCharArg
Definition:
poptint.h:30
optionStackEntry::currAlias
struct poptAlias * currAlias
Definition:
poptint.h:31
optionStackEntry::argc
int argc
Definition:
poptint.h:25
optionStackEntry::next
int next
Definition:
poptint.h:28
optionStackEntry::argb
pbm_set * argb
Definition:
poptint.h:27
optionStackEntry::argv
const char ** argv
Definition:
poptint.h:26
pbm_set
Definition:
poptint.h:13
poptAlias
Definition:
popt.h:58
poptContext_s
Definition:
poptint.h:41
poptContext_s::finalArgvCount
int finalArgvCount
Definition:
poptint.h:56
poptContext_s::leftovers
const char ** leftovers
Definition:
poptint.h:44
poptContext_s::execAbsolute
int execAbsolute
Definition:
poptint.h:60
poptContext_s::nextLeftover
int nextLeftover
Definition:
poptint.h:46
poptContext_s::finalArgvAlloced
int finalArgvAlloced
Definition:
poptint.h:57
poptContext_s::execPath
const char * execPath
Definition:
poptint.h:59
poptContext_s::options
const struct poptOption * options
Definition:
poptint.h:47
poptContext_s::numExecs
int numExecs
Definition:
poptint.h:54
poptContext_s::os
struct optionStackEntry * os
Definition:
poptint.h:43
poptContext_s::flags
int flags
Definition:
poptint.h:52
poptContext_s::arg_strip
pbm_set * arg_strip
Definition:
poptint.h:62
poptContext_s::otherHelp
const char * otherHelp
Definition:
poptint.h:61
poptContext_s::numLeftovers
int numLeftovers
Definition:
poptint.h:45
poptContext_s::appName
const char * appName
Definition:
poptint.h:49
poptContext_s::restLeftover
int restLeftover
Definition:
poptint.h:48
poptContext_s::execs
struct execEntry * execs
Definition:
poptint.h:53
poptContext_s::finalArgv
const char ** finalArgv
Definition:
poptint.h:55
poptContext_s::aliases
struct poptAlias * aliases
Definition:
poptint.h:50
poptContext_s::numAliases
int numAliases
Definition:
poptint.h:51
poptContext_s::optionStack
struct optionStackEntry optionStack[POPT_OPTION_DEPTH]
Definition:
poptint.h:42
poptContext_s::doExec
struct execEntry * doExec
Definition:
poptint.h:58
poptOption
Definition:
popt.h:48
Generated on Sat Jul 22 2023 00:20:12 for Mixe for Privacy and Anonymity in the Internet by
1.9.1