popt  1.13
poptint.h
Go to the documentation of this file.
1 
5 /* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING
6  file accompanying popt source distributions, available from
7  ftp://ftp.rpm.org/pub/rpm/dist. */
8 
9 #ifndef H_POPTINT
10 #define H_POPTINT
11 
17 /*@unused@*/ static inline /*@null@*/ void *
18 _free(/*@only@*/ /*@null@*/ const void * p)
19  /*@modifies p @*/
20 {
21  if (p != NULL) free((void *)p);
22  return NULL;
23 }
24 
25 /* Bit mask macros. */
26 /*@-exporttype -redef @*/
27 typedef unsigned int __pbm_bits;
28 /*@=exporttype =redef @*/
29 #define __PBM_NBITS (8 * sizeof (__pbm_bits))
30 #define __PBM_IX(d) ((d) / __PBM_NBITS)
31 #define __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS))
32 /*@-exporttype -redef @*/
33 typedef struct {
34  __pbm_bits bits[1];
35 } pbm_set;
36 /*@=exporttype =redef @*/
37 #define __PBM_BITS(set) ((set)->bits)
38 
39 #define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))
40 #define PBM_FREE(s) _free(s);
41 #define PBM_SET(d, s) (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d))
42 #define PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d))
43 #define PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0)
44 
46  int argc;
47 /*@only@*/ /*@null@*/
48  const char ** argv;
49 /*@only@*/ /*@null@*/
51  int next;
52 /*@only@*/ /*@null@*/
53  char * nextArg;
54 /*@observer@*/ /*@null@*/
55  const char * nextCharArg;
56 /*@dependent@*/ /*@null@*/
58  int stuffed;
59 };
60 
61 struct poptContext_s {
63 /*@dependent@*/
64  struct optionStackEntry * os;
65 /*@owned@*/ /*@null@*/
66  const char ** leftovers;
69 /*@keep@*/
70  const struct poptOption * options;
72 /*@only@*/ /*@null@*/
73  const char * appName;
74 /*@only@*/ /*@null@*/
77  unsigned int flags;
78 /*@owned@*/ /*@null@*/
80  int numExecs;
81  char * execFail;
82 /*@only@*/ /*@null@*/
83  const char ** finalArgv;
86  int (*maincall) (int argc, const char **argv);
87 /*@dependent@*/ /*@null@*/
89 /*@only@*/
90  const char * execPath;
92 /*@only@*/ /*@relnull@*/
93  const char * otherHelp;
94 /*@null@*/
96 };
97 
98 #ifdef HAVE_LIBINTL_H
99 #include <libintl.h>
100 #endif
101 
102 #if defined(HAVE_GETTEXT) && !defined(__LCLINT__)
103 #define _(foo) gettext(foo)
104 #else
105 #define _(foo) foo
106 #endif
107 
108 #if defined(HAVE_DCGETTEXT) && !defined(__LCLINT__)
109 #define D_(dom, str) dgettext(dom, str)
110 #define POPT_(foo) D_("popt", foo)
111 #else
112 #define D_(dom, str) str
113 #define POPT_(foo) foo
114 #endif
115 
116 #define N_(foo) foo
117 
118 #ifdef HAVE_ICONV
119 #include <iconv.h>
120 #if defined(__LCLINT__)
121 /*@-declundef -incondefs @*/
122 extern /*@only@*/ iconv_t iconv_open(const char *__tocode, const char *__fromcode)
123  /*@*/;
124 
125 extern size_t iconv(iconv_t __cd, /*@null@*/ char ** __inbuf,
126  /*@out@*/ size_t * __inbytesleft,
127  /*@out@*/ char ** __outbuf,
128  /*@out@*/ size_t * __outbytesleft)
129  /*@modifies __cd,
130  *__inbuf, *__inbytesleft, *__outbuf, *__outbytesleft @*/;
131 
132 extern int iconv_close(/*@only@*/ iconv_t __cd)
133  /*@modifies __cd @*/;
134 /*@=declundef =incondefs @*/
135 #endif
136 #endif
137 
138 #ifdef HAVE_LANGINFO_H
139 #include <langinfo.h>
140 #if defined(__LCLINT__)
141 /*@-declundef -incondefs @*/
142 extern char *nl_langinfo (nl_item __item)
143  /*@*/;
144 /*@=declundef =incondefs @*/
145 #endif
146 #endif
147 
148 char *POPT_prev_char (/*@returned@*/ const char *str)
149  /*@*/;
150 
151 char *POPT_next_char (/*@returned@*/ const char *str)
152  /*@*/;
153 
154 int POPT_fprintf (FILE* stream, const char *format, ...)
155  /*@globals fileSystem @*/
156  /*@modifies stream, fileSystem @*/;
157 
158 #endif

Generated for popt by  doxygen 1.8.1.2