From b831315e41173e27a4e402c65d318b43558c4fca Mon Sep 17 00:00:00 2001 From: jbj Date: Sat, 9 Oct 2004 17:29:22 +0000 Subject: [PATCH] Splint fiddles. CVS patchset: 7435 CVS date: 2004/10/09 17:29:22 --- rpmio/.cvsignore | 1 + rpmio/.splintrc | 1 - rpmio/Makefile.am | 21 ++++---- rpmio/macro.c | 7 ++- rpmio/rpmhook.c | 7 +-- rpmio/rpmhook.h | 3 +- rpmio/rpmio.c | 6 +-- rpmio/rpmlua.c | 13 +++-- rpmio/rpmpgp.c | 24 +++++---- rpmio/sexp/.splintrc | 2 +- rpmio/sexp/sexp-basic.c | 15 +++--- rpmio/sexp/sexp-input.c | 4 +- rpmio/sexp/sexp-output.c | 78 +++++++++++++++------------- rpmio/sexp/sexp.h | 2 +- rpmio/tax.c | 108 +++++++++++++++++++++++++++++++++++++++ rpmio/ugid.c | 4 ++ system.h | 16 +++--- 17 files changed, 225 insertions(+), 87 deletions(-) create mode 100644 rpmio/tax.c diff --git a/rpmio/.cvsignore b/rpmio/.cvsignore index 1c294cb5e..ea302cec3 100644 --- a/rpmio/.cvsignore +++ b/rpmio/.cvsignore @@ -7,6 +7,7 @@ Makefile.in *.la *.lcd *.lo +tax tdigest tdir tficl diff --git a/rpmio/.splintrc b/rpmio/.splintrc index 1f26e45d7..2c1027e6e 100644 --- a/rpmio/.splintrc +++ b/rpmio/.splintrc @@ -15,7 +15,6 @@ +bounds -bufferoverflowhigh - # --- +partial artifacts -declundef -exportheadervar diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am index 2cfb04f67..4a340e16a 100644 --- a/rpmio/Makefile.am +++ b/rpmio/Makefile.am @@ -4,24 +4,23 @@ AUTOMAKE_OPTIONS = 1.4 foreign LINT = splint -EXTRA_DIST = tdigest.c tdir.c tficl.c tfts.c tglob.c tinv.c tkey.c trpmio.c +EXTRA_DIST = tax.c tdigest.c tdir.c tficl.c tfts.c tglob.c tinv.c tkey.c trpmio.c -EXTRA_PROGRAMS = tdigest tdir tfts tglob tinv tkey tring trpmio tsw dumpasn1 +EXTRA_PROGRAMS = tax tdigest tdir tfts tglob tinv tkey tring trpmio tsw dumpasn1 INCLUDES = -I. \ -I$(top_srcdir) \ @WITH_BEECRYPT_INCLUDE@ \ + @WITH_LUA_INCLUDE@ \ -I$(top_srcdir)/popt \ - -I$(top_srcdir)/lua/include \ - -I$(top_srcdir)/lua/local \ @INCPATH@ pkgincdir = $(pkgincludedir) pkginc_HEADERS = \ argv.h fts.h \ rpmio.h rpmurl.h rpmmacro.h rpmlog.h rpmmessages.h rpmerr.h rpmpgp.h \ - rpmsq.h rpmsw.h ugid.h rpmlua.h rpmhook.h -noinst_HEADERS = rpmio_internal.h + rpmsq.h rpmsw.h ugid.h +noinst_HEADERS = rpmio_internal.h rpmlua.h rpmhook.h BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs) @@ -31,13 +30,12 @@ usrlibdir = $(libdir)@MARK64@ usrlib_LTLIBRARIES = librpmio.la librpmio_la_SOURCES = \ argv.c digest.c fts.c macro.c \ - rpmio.c rpmlog.c rpmmalloc.c \ - rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c stubs.c url.c ugid.c \ - rpmlua.c rpmhook.c + rpmhook.c rpmio.c rpmlog.c rpmlua.c rpmmalloc.c \ + rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c stubs.c url.c ugid.c librpmio_la_LDFLAGS = -release 4.3 $(LDFLAGS) \ @WITH_BEECRYPT_LIB@ \ + @WITH_LUA_LIB@ \ $(top_builddir)/file/src/libfmagic.la \ - $(top_builddir)/lua/liblua.la \ @WITH_ZLIB_LIB@ \ -lrt -lpthread librpmio_la_LIBADD = # $(BEECRYPTLOBJS) @@ -68,6 +66,9 @@ sources: lint: $(LINT) $(DEFS) $(INCLUDES) $(librpmio_la_SOURCES) +tax_SOURCES = tax.c +tax_LDADD = librpmio.la + tdigest_SOURCES = tdigest.c tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la -lgcrypt diff --git a/rpmio/macro.c b/rpmio/macro.c index 94970b081..1c72a39d0 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -43,7 +43,10 @@ typedef FILE * FD_t; #include #include #include + +#ifdef WITH_LUA #include +#endif #endif @@ -1404,6 +1407,7 @@ expandMacro(MacroBuf mb) continue; } +#ifdef WITH_LUA if (STREQ("lua", f, fn)) { rpmlua lua = NULL; /* Global state. */ const char *ls = s+sizeof("{lua:")-1; @@ -1429,6 +1433,7 @@ expandMacro(MacroBuf mb) s = se; continue; } +#endif /* XXX necessary but clunky */ if (STREQ("basename", f, fn) || @@ -1793,7 +1798,7 @@ exit: } /*@=branchstate@*/ #endif - av = _free(av); + av = _free(av); /*@-branchstate@*/ if (rc || argvPtr == NULL) { /*@-dependenttrans -unqualifiedtrans@*/ diff --git a/rpmio/rpmhook.c b/rpmio/rpmhook.c index ae78a8e47..87e251e31 100644 --- a/rpmio/rpmhook.c +++ b/rpmio/rpmhook.c @@ -41,7 +41,8 @@ rpmhookArgs rpmhookArgsNew(int argc) rpmhookArgs rpmhookArgsFree(rpmhookArgs args) { - free(args); + if (args != NULL) + free(args); return NULL; } @@ -156,8 +157,8 @@ static void rpmhookTableAddItem(rpmhookTable *table, const char *name, } static void rpmhookTableDelItem(rpmhookTable *table, const char *name, - rpmhookFunc func, void *data, - int matchfunc, int matchdata) + /*@null@*/ rpmhookFunc func, /*@null@*/ void *data, + int matchfunc, int matchdata) /*@modifies *table @*/ { int n = rpmhookTableFindBucket(table, name); diff --git a/rpmio/rpmhook.h b/rpmio/rpmhook.h index d7dc26e57..925067603 100644 --- a/rpmio/rpmhook.h +++ b/rpmio/rpmhook.h @@ -21,7 +21,8 @@ typedef int (*rpmhookFunc) (rpmhookArgs args, void *data); /*@only@*/ rpmhookArgs rpmhookArgsNew(int argc) /*@*/; -rpmhookArgs rpmhookArgsFree(/*@only@*/ rpmhookArgs args) +/*@null@*/ +rpmhookArgs rpmhookArgsFree(/*@only@*/ /*@null@*/ rpmhookArgs args) /*@modifies args @*/; void rpmhookRegister(const char *name, rpmhookFunc func, void *data) diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 51064555b..27b5a7d2b 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -508,9 +508,9 @@ int fdWritable(FD_t fd, int secs) tvp->tv_usec = 0; } FD_SET(fdno, &wrfds); - /*@-compdef -nullpass@*/ +/*@-compdef -nullpass@*/ rc = select(fdno + 1, NULL, &wrfds, NULL, tvp); - /*@=compdef =nullpass@*/ +/*@=compdef =nullpass@*/ #endif if (_rpmio_debug && !(rc == 1 && errno == 0)) @@ -2213,7 +2213,7 @@ static int gzdFlush(FD_t fd) /* =============================================================== */ static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count) /*@globals fileSystem, internalState @*/ - /*@modifies *buf, fileSystem, internalState @*/ + /*@modifies buf, fileSystem, internalState @*/ { FD_t fd = c2f(cookie); gzFile gzfile; diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c index a36d317d8..363216ef0 100644 --- a/rpmio/rpmlua.c +++ b/rpmio/rpmlua.c @@ -1,16 +1,18 @@ /*@-bounds -realcompare -sizeoftype -protoparammatch @*/ #include "system.h" + +#ifdef WITH_LUA #include #include #include #include #include -#include "../lua/include/lua.h" -#include "../lua/include/lualib.h" -#include "../lua/include/lauxlib.h" -#include "../lua/local/lposix.h" -#include "../lua/local/lrexlib.h" +#include +#include +#include +#include +#include #include #include @@ -838,5 +840,6 @@ static int luaopen_rpm(lua_State *L) luaL_openlib(L, "rpm", rpmlib, 0); return 0; } +#endif /* WITH_LUA */ /*@=bounds =realcompare =sizeoftype =protoparammatch @*/ diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index 7beb14b49..d97c01cb0 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -326,7 +326,7 @@ const char * pgpMpiHex(const byte *p) static int pgpHexSet(const char * pre, int lbits, /*@out@*/ mpnumber * mpn, const byte * p, const byte * pend) /*@globals fileSystem @*/ - /*@modifies *mpn, fileSystem @*/ + /*@modifies mpn, fileSystem @*/ { unsigned int mbits = pgpMpiBits(p); unsigned int nbits; @@ -348,7 +348,7 @@ fprintf(stderr, "*** mbits %u nbits %u nbytes %u t %p[%d] ix %u\n", mbits, nbits strcpy(t+ix, pgpMpiHex(p)); if (_debug) fprintf(stderr, "*** %s %s\n", pre, t); - mpnsethex(mpn, t); + (void) mpnsethex(mpn, t); t = _free(t); if (_debug && _print) fprintf(stderr, "\t %s ", pre), mpfprintln(stderr, mpn->size, mpn->data); @@ -481,7 +481,7 @@ static int pgpPrtSigParams(/*@unused@*/ pgpTag tag, byte pubkey_algo, byte sigty { switch (i) { case 0: /* m**d */ - mpnsethex(&_dig->c, pgpMpiHex(p)); + (void) mpnsethex(&_dig->c, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t m**d = "), mpfprintln(stderr, _dig->c.size, _dig->c.data); /*@switchbreak@*/ break; @@ -689,7 +689,7 @@ static const byte * pgpPrtPubkeyParams(byte pubkey_algo, if (_dig) { switch (i) { case 0: /* n */ - mpbsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); + (void) mpbsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); /* Get the keyid */ if (_digp) { uint32_t* np = _dig->rsa_pk.n.modl; @@ -708,7 +708,7 @@ if (_debug && _print) fprintf(stderr, "\t n = "), mpfprintln(stderr, _dig->rsa_pk.n.size, _dig->rsa_pk.n.modl); /*@switchbreak@*/ break; case 1: /* e */ - mpnsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); + (void) mpnsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t e = "), mpfprintln(stderr, _dig->rsa_pk.e.size, _dig->rsa_pk.e.data); /*@switchbreak@*/ break; @@ -722,22 +722,22 @@ fprintf(stderr, "\t e = "), mpfprintln(stderr, _dig->rsa_pk.e.size, _dig->r if (_dig) { switch (i) { case 0: /* p */ - mpbsethex(&_dig->p, pgpMpiHex(p)); + (void) mpbsethex(&_dig->p, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t p = "), mpfprintln(stderr, _dig->p.size, _dig->p.modl); /*@switchbreak@*/ break; case 1: /* q */ - mpbsethex(&_dig->q, pgpMpiHex(p)); + (void) mpbsethex(&_dig->q, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t q = "), mpfprintln(stderr, _dig->q.size, _dig->q.modl); /*@switchbreak@*/ break; case 2: /* g */ - mpnsethex(&_dig->g, pgpMpiHex(p)); + (void) mpnsethex(&_dig->g, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t g = "), mpfprintln(stderr, _dig->g.size, _dig->g.data); /*@switchbreak@*/ break; case 3: /* y */ - mpnsethex(&_dig->y, pgpMpiHex(p)); + (void) mpnsethex(&_dig->y, pgpMpiHex(p)); if (_debug && _print) fprintf(stderr, "\t y = "), mpfprintln(stderr, _dig->y.size, _dig->y.data); /*@switchbreak@*/ break; @@ -1229,10 +1229,14 @@ pgpArmor pgpReadPkts(const char * fn, const byte ** pkt, size_t * pktlen) if (!TOKEQ(t, "-----\n")) goto exit; + crcdec = NULL; + crclen = 0; if (b64decode(crcenc, (void **)&crcdec, &crclen) != 0) continue; crcpkt = pgpGrab(crcdec, crclen); crcdec = _free(crcdec); + dec = NULL; + declen = 0; if (b64decode(enc, (void **)&dec, &declen) != 0) goto exit; crc = pgpCRC(dec, declen); @@ -1305,7 +1309,9 @@ char * pgpArmorWrap(int atype, const unsigned char * s, size_t ns) t = stpcpy(t, "-----\n"); /*@=boundswrite@*/ +/*@-globstate@*/ /* XXX b64encode_eolstr */ return val; +/*@=globstate@*/ } /*@=boundsread@*/ diff --git a/rpmio/sexp/.splintrc b/rpmio/sexp/.splintrc index bf303eb36..59f3e7d18 100644 --- a/rpmio/sexp/.splintrc +++ b/rpmio/sexp/.splintrc @@ -52,4 +52,4 @@ +boolint # +charint # +ignorequals # -+matchanyintegral # +#+matchanyintegral # diff --git a/rpmio/sexp/sexp-basic.c b/rpmio/sexp/sexp-basic.c index 8f7422ad0..8342d9565 100644 --- a/rpmio/sexp/sexp-basic.c +++ b/rpmio/sexp/sexp-basic.c @@ -11,12 +11,12 @@ #include #include "sexp.h" -/*@access sexpIter @*/ /*@access sexpSimpleString @*/ - -/*@access sexpList @*/ /*@access sexpString @*/ -/*@access sexpObject @*/ +/*@access sexpList @*/ + +/*@access sexpObject @*/ /* XXX for casts only */ +/*@access sexpIter @*/ /* XXX for casts only */ /******************/ /* ERROR MESSAGES */ @@ -76,7 +76,8 @@ void * sexpAlloc(size_t n) */ sexpSimpleString newSimpleString(void) { - sexpSimpleString ss = (sexpSimpleString) sexpAlloc(sizeof(*ss)); + sexpSimpleString ss = sexpAlloc(sizeof(*ss)); + ss->length = 0; ss->allocatedLength = 16; ss->string = sexpAlloc(16); @@ -86,7 +87,7 @@ sexpSimpleString newSimpleString(void) /* simpleStringLength(ss) * returns length of simple string */ -long int simpleStringLength(sexpSimpleString ss) +size_t simpleStringLength(sexpSimpleString ss) { return ss->length; } @@ -110,7 +111,7 @@ sexpSimpleString reallocateSimpleString(sexpSimpleString ss) if (ss == NULL) return NULL; } if (ss->string == NULL) - ss->string = (octet *)sexpAlloc(16); + ss->string = sexpAlloc(16); else { size_t newsize = 16 + 3*(ss->length)/2; octet * newstring = sexpAlloc(newsize); diff --git a/rpmio/sexp/sexp-input.c b/rpmio/sexp/sexp-input.c index 8b9c13d54..14ee37e05 100644 --- a/rpmio/sexp/sexp-input.c +++ b/rpmio/sexp/sexp-input.c @@ -367,9 +367,9 @@ void scanQuotedString(sexpInputStream is, sexpSimpleString ss, long int length) { int c; skipChar(is,'"'); - while (length == -1 || simpleStringLength(ss) <= length) { + while (length == -1L || simpleStringLength(ss) <= length) { if (is->nextChar == '\"') { - if (length == -1 || (simpleStringLength(ss) == length)) { + if (length == -1L || simpleStringLength(ss) == length) { skipChar(is,'\"'); return; } diff --git a/rpmio/sexp/sexp-output.c b/rpmio/sexp/sexp-output.c index 65e1496e6..cf2b23522 100644 --- a/rpmio/sexp/sexp-output.c +++ b/rpmio/sexp/sexp-output.c @@ -208,13 +208,13 @@ void printDecimal(sexpOutputStream os, long int n) void canonicalPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss) { octet * c = simpleStringString(ss); - long int len = simpleStringLength(ss); - long int i; + size_t len = simpleStringLength(ss); + size_t i; if (c == NULL) ErrorMessage(ERROR, "Can't print NULL string verbatim"); /* print out len: */ - printDecimal(os, len); + printDecimal(os, (long int)len); varPutChar(os, ':'); /* print characters in fragment */ for (i=0; imaxcolumn > 0 && os->column + len >= os->maxcolumn) return FALSE; @@ -318,9 +320,9 @@ int canPrintAsToken(sexpOutputStream os, sexpSimpleString ss) */ void advancedPrintTokenSimpleString(sexpOutputStream os, sexpSimpleString ss) { - long int len = simpleStringLength(ss); octet * c = simpleStringString(ss); - int i; + size_t len = simpleStringLength(ss); + size_t i; if (os->maxcolumn>0 && os->column > (os->maxcolumn - len)) os->newLine(os, ADVANCED); @@ -331,7 +333,7 @@ void advancedPrintTokenSimpleString(sexpOutputStream os, sexpSimpleString ss) /* advancedLengthSimpleStringToken(ss) * Returns length for printing simple string ss as a token */ -int advancedLengthSimpleStringToken(sexpSimpleString ss) +size_t advancedLengthSimpleStringToken(sexpSimpleString ss) { return simpleStringLength(ss); } @@ -345,26 +347,26 @@ int advancedLengthSimpleStringToken(sexpSimpleString ss) */ void advancedPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss) { - long int len = simpleStringLength(ss); octet * c = simpleStringString(ss); - long int i; + size_t len = simpleStringLength(ss); + size_t i; if (c == NULL) ErrorMessage(ERROR, "Can't print NULL string verbatim"); if (os->maxcolumn>0 && os->column > (os->maxcolumn - len)) os->newLine(os, ADVANCED); - printDecimal(os,len); - os->putChar(os,':'); + printDecimal(os, (long int)len); + os->putChar(os, ':'); for (i=0; iputChar(os, (int)*c++); } /* advancedLengthSimpleStringVerbatim(ss) * Returns length for printing simple string ss in verbatim mode */ -int advancedLengthSimpleStringVerbatim(sexpSimpleString ss) +size_t advancedLengthSimpleStringVerbatim(sexpSimpleString ss) { - long int len = simpleStringLength(ss); - int i = 1; + size_t len = simpleStringLength(ss); + size_t i = 1; while (len > 9L) { i++; len = len / 10; } return (i+1+len); } @@ -376,9 +378,9 @@ int advancedLengthSimpleStringVerbatim(sexpSimpleString ss) */ void advancedPrintBase64SimpleString(sexpOutputStream os, sexpSimpleString ss) { - long int len = simpleStringLength(ss); - octet *c = simpleStringString(ss); - long int i; + octet * c = simpleStringString(ss); + size_t len = simpleStringLength(ss); + size_t i; if (c == NULL) ErrorMessage(ERROR, "Can't print NULL string base 64"); @@ -398,9 +400,9 @@ void advancedPrintBase64SimpleString(sexpOutputStream os, sexpSimpleString ss) */ void advancedPrintHexSimpleString(sexpOutputStream os, sexpSimpleString ss) { - long int len = simpleStringLength(ss); - octet *c = simpleStringString(ss); - long int i; + octet * c = simpleStringString(ss); + size_t len = simpleStringLength(ss); + size_t i; if (c == NULL) ErrorMessage(ERROR, "Can't print NULL string hexadecimal"); @@ -418,7 +420,7 @@ void advancedPrintHexSimpleString(sexpOutputStream os, sexpSimpleString ss) */ int advancedLengthSimpleStringHexadecimal(sexpSimpleString ss) { - long int len = simpleStringLength(ss); + size_t len = simpleStringLength(ss); return (1+2*len+1); } @@ -431,12 +433,14 @@ int advancedLengthSimpleStringHexadecimal(sexpSimpleString ss) */ int canPrintAsQuotedString(sexpSimpleString ss) { - long int len = simpleStringLength(ss); - octet *c = simpleStringString(ss); - long int i; + octet * c = simpleStringString(ss); + size_t len = simpleStringLength(ss); + size_t i; if (c == NULL) return FALSE ; +/*@-unsignedcompare@*/ /* XXX len now unsigned size_t. */ if (len < 0) return FALSE; +/*@=unsignedcompare@*/ for (i=0; iputChar(os, '\"'); for (i=0; i 0) { + unsigned int i; + i = *s++; + *t++ = hex[ (i >> 4) & 0xf ]; + *t++ = hex[ (i ) & 0xf ]; + } + *t = '\0'; +/*@=boundswrite@*/ + return t; +} + +/** + * Return hex formatted representation of bytes. + * @todo Remove static buffer. + * @param p bytes + * @param plen no. of bytes + * @return hex formatted string + */ +/*@unused@*/ static inline /*@observer@*/ +char * pgpHexStr(const byte *p, unsigned int plen) + /*@*/ +{ + static char prbuf[2048]; + char *t = prbuf; + t = pgpHexCvt(t, p, plen); + return prbuf; +} + +static int doit(const char * msg, const char * sig) +{ + unsigned char * dec; + size_t declen; + int rc; + + if ((rc = b64decode(sig, (void **)&dec, &declen)) != 0) { + fprintf(stderr, "*** b64decode returns %d\n", rc); + return rc; + } + + fprintf(stderr, "*** %p[%d] %s\n", dec, declen, msg); + if (declen == 256) { + fprintf(stderr, "%s\n", pgpHexStr(dec, declen/2)); + fprintf(stderr, "%s\n", pgpHexStr(dec+declen/2, declen/2)); + } else { + fprintf(stderr, "%s\n", pgpHexStr(dec, declen)); + } + + return 0; + +} + +int +main (int argc, char *argv[]) +{ + + doit("applechallenge", applechallenge); + doit("rsaaeskey", rsaaeskey); + doit("aesiv", aesiv); + doit("appleresponse", appleresponse); +} diff --git a/rpmio/ugid.c b/rpmio/ugid.c index 65d31bcbd..b9a0898c2 100644 --- a/rpmio/ugid.c +++ b/rpmio/ugid.c @@ -103,11 +103,15 @@ int gnameToGid(const char * thisGname, gid_t * gid) if (grent == NULL) { /* XXX The filesystem package needs group/lock w/o getgrnam. */ if (strcmp(thisGname, "lock") == 0) { +/*@-boundswrite@*/ *gid = lastGid = 54; +/*@=boundswrite@*/ return 0; } else if (strcmp(thisGname, "mail") == 0) { +/*@-boundswrite@*/ *gid = lastGid = 12; +/*@=boundswrite@*/ return 0; } else return -1; diff --git a/system.h b/system.h index 7f55fb6eb..a751fdc68 100644 --- a/system.h +++ b/system.h @@ -561,16 +561,18 @@ typedef /*@concrete@*/ struct /*@=constuse@*/ #endif -extern int glob (const char *pattern, int flags, - int (*errfunc) (const char *, int), - /*@out@*/ glob_t *pglob) +/*@-type@*/ /* XXX glob64_t */ +extern int glob (const char *__pattern, int __flags, + int (*__errfunc) (const char *, int), + /*@out@*/ glob_t *__pglob) /*@globals errno, fileSystem @*/ - /*@modifies *pglob, errno, fileSystem @*/; + /*@modifies *__pglob, errno, fileSystem @*/; /* XXX only annotation is a white lie */ -extern void globfree (/*@only@*/ glob_t *pglob) - /*@modifies *pglob @*/; +extern void globfree (/*@only@*/ glob_t *__pglob) + /*@modifies *__pglob @*/; +/*@=type@*/ #ifdef _GNU_SOURCE -extern int glob_pattern_p (const char *pattern, int quote) +extern int glob_pattern_p (const char *__pattern, int __quote) /*@*/; #endif