RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: popt Date: 26-Jul-2009 19:09:27 Branch: HEAD Handle: 2009072617092700 Modified files: popt CHANGES libpopt.vers popt.c popt.h Log: - add poptBitsArgs() method to generate args bit set. Summary: Revision Changes Path 1.115 +1 -0 popt/CHANGES 1.9 +1 -0 popt/libpopt.vers 1.136 +21 -0 popt/popt.c 1.77 +2 -0 popt/popt.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: popt/CHANGES ============================================================================ $ cvs diff -u -r1.114 -r1.115 CHANGES --- popt/CHANGES 26 Jul 2009 16:25:23 -0000 1.114 +++ popt/CHANGES 26 Jul 2009 17:09:27 -0000 1.115 @@ -1,4 +1,5 @@ 1.15 -> 1.16: + - add poptBitsArgs() method to generate args bit set. - add methods for bit set union and intersection. - permit comma separated attribute lists, handle negated attributes. - better test for POPT_ARG_BITSET. @@ . patch -p0 <<'@@ .' Index: popt/libpopt.vers ============================================================================ $ cvs diff -u -r1.8 -r1.9 libpopt.vers --- popt/libpopt.vers 26 Jul 2009 16:25:23 -0000 1.8 +++ popt/libpopt.vers 26 Jul 2009 17:09:27 -0000 1.9 @@ -13,6 +13,7 @@ _poptBitsM; _poptBitsK; poptBitsAdd; + poptBitsArgs; poptBitsChk; poptBitsClr; poptBitsDel; @@ . patch -p0 <<'@@ .' Index: popt/popt.c ============================================================================ $ cvs diff -u -r1.135 -r1.136 popt.c --- popt/popt.c 26 Jul 2009 16:38:25 -0000 1.135 +++ popt/popt.c 26 Jul 2009 17:09:27 -0000 1.136 @@ -894,6 +894,27 @@ return (rc ? 1 : 0); } +int poptBitsArgs(poptContext con, poptBits *ap) +{ + const char ** av; + int rc = 0; + + if (con == NULL || ap == NULL || _poptBitsNew(ap) || + con->leftovers == NULL || con->numLeftovers == con->nextLeftover) + return POPT_ERROR_NULLARG; + + /* some apps like [like RPM ;-) ] need this NULL terminated */ + con->leftovers[con->numLeftovers] = NULL; + + for (av = con->leftovers + con->nextLeftover; *av != NULL; av++) { + if ((rc = poptBitsAdd(*ap, *av)) != 0) + break; + } +/*...@-nullstate@*/ + return rc; +/*...@=nullstate@*/ +} + int poptSaveBits(poptBits * bitsp, /*...@unused@*/ UNUSED(unsigned int argInfo), const char * s) { @@ . patch -p0 <<'@@ .' Index: popt/popt.h ============================================================================ $ cvs diff -u -r1.76 -r1.77 popt.h --- popt/popt.h 26 Jul 2009 16:38:25 -0000 1.76 +++ popt/popt.h 26 Jul 2009 17:09:27 -0000 1.77 @@ -715,6 +715,8 @@ /*...@modifies *ap @*/; int poptBitsUnion(/*...@null@*/ poptBits * ap, /*...@null@*/ const poptBits b) /*...@modifies *ap @*/; +int poptBitsArgs(/*...@null@*/ poptContext con, /*...@null@*/ poptBits * ap) + /*...@modifies con, *ap @*/; /*...@=fcnuse@*/ /*...@=exportlocal@*/ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
