Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

popt/poptint.h

Go to the documentation of this file.
00001 
00005 /* (C) 1998-2000 Red Hat, Inc. -- Licensing details are in the COPYING
00006    file accompanying popt source distributions, available from 
00007    ftp://ftp.rpm.org/pub/rpm/dist. */
00008 
00009 #ifndef H_POPTINT
00010 #define H_POPTINT
00011 
00012 /* Bit mask macros. */
00013 typedef unsigned int __pbm_bits;
00014 #define __PBM_NBITS             (8 * sizeof (__pbm_bits))
00015 #define __PBM_IX(d)             ((d) / __PBM_NBITS)
00016 #define __PBM_MASK(d)           ((__pbm_bits) 1 << ((d) % __PBM_NBITS))
00017 typedef struct {
00018     __pbm_bits bits[1];
00019 } pbm_set;
00020 #define __PBM_BITS(set) ((set)->bits)
00021 
00022 #define PBM_ALLOC(d)    calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits))
00023 #define PBM_FREE(s)     free(s);
00024 #define PBM_SET(d, s)   (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d))
00025 #define PBM_CLR(d, s)   (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d))
00026 #define PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0)
00027 
00028 struct optionStackEntry {
00029     int argc;
00030 /*@only@*/ const char ** argv;
00031 /*@only@*/ pbm_set * argb;
00032     int next;
00033 /*@only@*/ const char * nextArg;
00034 /*@keep@*/ const char * nextCharArg;
00035 /*@dependent@*/ struct poptAlias * currAlias;
00036     int stuffed;
00037 };
00038 
00039 struct execEntry {
00040     const char * longName;
00041     char shortName;
00042     const char * script;
00043 };
00044 
00045 struct poptContext_s {
00046     struct optionStackEntry optionStack[POPT_OPTION_DEPTH];
00047 /*@dependent@*/ struct optionStackEntry * os;
00048 /*@owned@*/ const char ** leftovers;
00049     int numLeftovers;
00050     int nextLeftover;
00051 /*@keep@*/ const struct poptOption * options;
00052     int restLeftover;
00053 /*@only@*/ const char * appName;
00054 /*@only@*/ struct poptAlias * aliases;
00055     int numAliases;
00056     int flags;
00057     struct execEntry * execs;
00058     int numExecs;
00059 /*@only@*/ const char ** finalArgv;
00060     int finalArgvCount;
00061     int finalArgvAlloced;
00062 /*@dependent@*/ struct execEntry * doExec;
00063 /*@only@*/ const char * execPath;
00064     int execAbsolute;
00065 /*@only@*/ const char * otherHelp;
00066     pbm_set * arg_strip;
00067 };
00068 
00069 #ifdef HAVE_LIBINTL_H
00070 #include <libintl.h>
00071 #endif
00072 
00073 #if defined(HAVE_GETTEXT) && !defined(__LCLINT__)
00074 #define _(foo) gettext(foo)
00075 #else
00076 #define _(foo) (foo)
00077 #endif
00078 
00079 #if defined(HAVE_DGETTEXT) && !defined(__LCLINT__)
00080 #define D_(dom, str) dgettext(dom, str)
00081 #define POPT_(foo) D_("popt", foo)
00082 #else
00083 #define D_(dom, str) (str)
00084 #define POPT_(foo) (foo)
00085 #endif
00086 
00087 #define N_(foo) (foo)
00088 
00089 #endif

Generated at Mon May 21 08:53:40 2001 for rpm by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001