X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/cc248aae9bff569a771210e9b63f6f4dfe83e3a6..14ebc5b618ec6d4668e120acc7a75ae8efd677e7:/popt/poptint.h diff --git a/popt/poptint.h b/popt/poptint.h index 30172fea..bec7c976 100644 --- a/popt/poptint.h +++ b/popt/poptint.h @@ -22,14 +22,24 @@ _free(/*@only@*/ /*@null@*/ const void * p) return NULL; } +static inline int +isSpace(const char *ptr) +{ + return isspace(*(unsigned char *)ptr); +} + /* Bit mask macros. */ +/*@-exporttype -redef @*/ typedef unsigned int __pbm_bits; +/*@=exporttype =redef @*/ #define __PBM_NBITS (8 * sizeof (__pbm_bits)) #define __PBM_IX(d) ((d) / __PBM_NBITS) #define __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) +/*@-exporttype -redef @*/ typedef struct { __pbm_bits bits[1]; } pbm_set; +/*@=exporttype =redef @*/ #define __PBM_BITS(set) ((set)->bits) #define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) @@ -40,37 +50,53 @@ typedef struct { struct optionStackEntry { int argc; -/*@only@*/ /*@null@*/ const char ** argv; -/*@only@*/ /*@null@*/ pbm_set * argb; +/*@only@*/ /*@null@*/ + const char ** argv; +/*@only@*/ /*@null@*/ + pbm_set * argb; int next; -/*@only@*/ /*@null@*/ const char * nextArg; -/*@keep@*/ /*@null@*/ const char * nextCharArg; -/*@dependent@*/ /*@null@*/ poptItem currAlias; +/*@only@*/ /*@null@*/ + const char * nextArg; +/*@observer@*/ /*@null@*/ + const char * nextCharArg; +/*@dependent@*/ /*@null@*/ + poptItem currAlias; int stuffed; }; struct poptContext_s { struct optionStackEntry optionStack[POPT_OPTION_DEPTH]; -/*@dependent@*/ struct optionStackEntry * os; -/*@owned@*/ /*@null@*/ const char ** leftovers; +/*@dependent@*/ + struct optionStackEntry * os; +/*@owned@*/ /*@null@*/ + const char ** leftovers; int numLeftovers; int nextLeftover; -/*@keep@*/ const struct poptOption * options; +/*@keep@*/ + const struct poptOption * options; int restLeftover; -/*@only@*/ /*@null@*/ const char * appName; -/*@only@*/ /*@null@*/ poptItem aliases; +/*@only@*/ /*@null@*/ + const char * appName; +/*@only@*/ /*@null@*/ + poptItem aliases; int numAliases; int flags; -/*@owned@*/ /*@null@*/ poptItem execs; +/*@owned@*/ /*@null@*/ + poptItem execs; int numExecs; -/*@only@*/ /*@null@*/ const char ** finalArgv; +/*@only@*/ /*@null@*/ + const char ** finalArgv; int finalArgvCount; int finalArgvAlloced; -/*@dependent@*/ /*@null@*/ poptItem doExec; -/*@only@*/ const char * execPath; +/*@dependent@*/ /*@null@*/ + poptItem doExec; +/*@only@*/ + const char * execPath; int execAbsolute; -/*@only@*/ const char * otherHelp; -/*@null@*/ pbm_set * arg_strip; +/*@only@*/ /*@relnull@*/ + const char * otherHelp; +/*@null@*/ + pbm_set * arg_strip; }; #ifdef HAVE_LIBINTL_H @@ -83,7 +109,7 @@ struct poptContext_s { #define _(foo) foo #endif -#if defined(HAVE_DGETTEXT) && !defined(__LCLINT__) +#if defined(HAVE_DCGETTEXT) && !defined(__LCLINT__) #define D_(dom, str) dgettext(dom, str) #define POPT_(foo) D_("popt", foo) #else