RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 12-Jun-2009 21:04:34 Branch: HEAD Handle: 2009061219043301 Added files: rpm/rpmio rpmaug.c rpmaug.h Modified files: rpm CHANGES rpm/rpmio Makefile.am poptIO.c rpmio.c Log: - augeas: stub-in rpmaug object with ctors/dtors. Summary: Revision Changes Path 1.3019 +1 -0 rpm/CHANGES 1.231 +2 -2 rpm/rpmio/Makefile.am 1.52 +3 -0 rpm/rpmio/poptIO.c 1.1 +63 -0 rpm/rpmio/rpmaug.c 1.1 +86 -0 rpm/rpmio/rpmaug.h 1.196 +2 -0 rpm/rpmio/rpmio.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3018 -r1.3019 CHANGES --- rpm/CHANGES 12 Jun 2009 18:34:57 -0000 1.3018 +++ rpm/CHANGES 12 Jun 2009 19:04:33 -0000 1.3019 @@ -1,5 +1,6 @@ 5.2b1 -> 5.3a1 + - jbj: augeas: stub-in rpmaug object with ctors/dtors. - jbj: augeas: add AutoFu to find augeas libraries. - jbj: js: stub-in requires/loadModule global methods. - jbj: js: save the rpmjs interpreter pointer in rt private data. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/Makefile.am ============================================================================ $ cvs diff -u -r1.230 -r1.231 Makefile.am --- rpm/rpmio/Makefile.am 2 Jun 2009 20:53:07 -0000 1.230 +++ rpm/rpmio/Makefile.am 12 Jun 2009 19:04:34 -0000 1.231 @@ -66,7 +66,7 @@ argv.h ar.h cpio.h crc.h envvar.h fnmatch.h fts.h glob.h iosm.h \ md2.h md4.h rmd128.h rmd160.h rmd256.h rmd320.h sha224.h \ salsa10.h salsa20.h tiger.h \ - poptIO.h rpmbc.h rpmbz.h rpmdav.h rpmficl.h rpmgc.h rpmhash.h \ + poptIO.h rpmaug.h rpmbc.h rpmbz.h rpmdav.h rpmficl.h rpmgc.h rpmhash.h \ rpmhook.h rpmio_internal.h rpmjs.h rpmjsio.h rpmkeyring.h rpmku.h \ rpmlua.h rpmmg.h rpmnss.h rpmperl.h rpmpython.h rpmruby.h rpmsq.h \ rpmsquirrel.h rpmssl.h rpmsyck.h rpmtcl.h rpmurl.h rpmuuid.h rpmxar.h \ @@ -80,7 +80,7 @@ macro.c mire.c mount.c poptIO.c \ md2.c md4.c rmd128.c rmd160.c rmd256.c rmd320.c sha224.c \ salsa10.c salsa20.c tiger.c \ - rpmbc.c rpmdav.c rpmficl.c rpmgc.c rpmhash.c rpmhook.c \ + rpmaug.c rpmbc.c rpmdav.c rpmficl.c rpmgc.c rpmhash.c rpmhook.c \ rpmio.c rpmiob.c rpmio-stub.c rpmjs.c rpmjsio.c rpmkeyring.c \ rpmku.c rpmlog.c rpmlua.c rpmmalloc.c rpmmg.c rpmnss.c \ rpmperl.c rpmpgp.c rpmpython.c rpmrpc.c rpmruby.c rpmsq.c \ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/poptIO.c ============================================================================ $ cvs diff -u -r1.51 -r1.52 poptIO.c --- rpm/rpmio/poptIO.c 2 Jun 2009 20:53:07 -0000 1.51 +++ rpm/rpmio/poptIO.c 12 Jun 2009 19:04:34 -0000 1.52 @@ -25,6 +25,7 @@ #include <rpmssl.h> #endif +#include <rpmaug.h> #include <rpmficl.h> #include <rpmjs.h> #include <rpmperl.h> @@ -419,6 +420,8 @@ N_("Debug rpmio I/O"), NULL}, { "rpmiobdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmiob_debug, -1, N_("Debug rpmio I/O buffers"), NULL}, + { "rpmaugdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmaug_debug, -1, + N_("Debug embedded Augeas interpreter"), NULL}, { "rpmficldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmficl_debug, -1, N_("Debug embedded FICL interpreter"), NULL}, { "rpmjsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmjs_debug, -1, @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmaug.c ============================================================================ $ cvs diff -u -r0 -r1.1 rpmaug.c --- /dev/null 2009-06-12 21:03:00 +0200 +++ rpmaug.c 2009-06-12 21:04:34 +0200 @@ -0,0 +1,63 @@ +/** \ingroup rpmio + * \file rpmio/rpmaug.c + */ + +#include "system.h" + +#if defined(HAVE_AUGEAS_H) +#include "augeas.h" +#endif + +#include <rpmiotypes.h> +#include <rpmio.h> /* for *Pool methods */ +#include <rpmlog.h> +#define _RPMAUG_INTERNAL +#include <rpmaug.h> + +#include "debug.h" + +/*...@unchecked@*/ +int _rpmaug_debug = 0; + +/*...@-mustmod@*/ /* XXX splint on crack */ +static void rpmaugFini(void * _aug) + /*...@globals fileSystem @*/ + /*...@modifies *_aug, fileSystem @*/ +{ + rpmaug aug = _aug; + +#if defined(WITH_AUGEAS) +#endif + aug->fn = _free(aug->fn); +} +/*...@=mustmod@*/ + +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/ +rpmioPool _rpmaugPool = NULL; + +static rpmaug rpmaugGetPool(/*...@null@*/ rpmioPool pool) + /*...@globals _rpmaugPool, fileSystem @*/ + /*...@modifies pool, _rpmaugPool, fileSystem @*/ +{ + rpmaug aug; + + if (_rpmaugPool == NULL) { + _rpmaugPool = rpmioNewPool("aug", sizeof(*aug), -1, _rpmaug_debug, + NULL, NULL, rpmaugFini); + pool = _rpmaugPool; + } + return (rpmaug) rpmioGetPool(pool, sizeof(*aug)); +} + +rpmaug rpmaugNew(const char * fn, int flags) +{ + rpmaug aug = rpmaugGetPool(_rpmaugPool); + int xx; + + if (fn) + aug->fn = xstrdup(fn); +#if defined(WITH_AUGEAS) +#endif + + return rpmaugLink(aug); +} @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmaug.h ============================================================================ $ cvs diff -u -r0 -r1.1 rpmaug.h --- /dev/null 2009-06-12 21:03:00 +0200 +++ rpmaug.h 2009-06-12 21:04:34 +0200 @@ -0,0 +1,86 @@ +#ifndef H_RPMAUG +#define H_RPMAUG + +/** \ingroup rpmio + * \file rpmio/rpmaug.h + */ + +/** \ingroup rpmio + */ +/*...@unchecked@*/ +extern int _rpmaug_debug; + +/** \ingroup rpmio + */ +typedef /*...@refcounted@*/ struct rpmaug_s * rpmaug; + +#if defined(_RPMAUG_INTERNAL) +/** \ingroup rpmio + */ +struct rpmaug_s { + struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ + const char * fn; + int flags; +/*...@relnull@*/ + void * I; +#if defined(__LCLINT__) +/*...@refs@*/ + int nrefs; /*!< (unused) keep splint happy */ +#endif +}; +#endif /* _RPMAUG_INTERNAL */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Unreference a augeas wrapper instance. + * @param aug augeas wrapper + * @return NULL on last dereference + */ +/*...@unused@*/ /*...@null@*/ +rpmaug rpmaugUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmaug aug) + /*...@modifies aug @*/; +#define rpmaugUnlink(_ds) \ + ((rpmaug)rpmioUnlinkPoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Reference a augeas wrapper instance. + * @param aug augeas wrapper + * @return new augeas wrapper reference + */ +/*...@unused@*/ /*...@newref@*/ /*...@null@*/ +rpmaug rpmaugLink (/*...@null@*/ rpmaug aug) + /*...@modifies aug @*/; +#define rpmaugLink(_aug) \ + ((rpmaug)rpmioLinkPoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Destroy a augeas wrapper. + * @param aug augeas wrapper + * @return NULL on last dereference + */ +/*...@null@*/ +rpmaug rpmaugFree(/*...@killref@*/ /*...@null@*/rpmaug aug) + /*...@globals fileSystem @*/ + /*...@modifies aug, fileSystem @*/; +#define rpmaugFree(_aug) \ + ((rpmaug)rpmioFreePoolItem((rpmioItem)(_aug), __FUNCTION__, __FILE__, __LINE__)) + +/** + * Create and load a augeas wrapper. + * @param fn augeas file + * @param flags augeas flags + * @return new augeas wrapper + */ +/*...@newref@*/ /*...@null@*/ +rpmaug rpmaugNew(const char * fn, int flags) + /*...@globals fileSystem, internalState @*/ + /*...@modifies fileSystem, internalState @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_RPMAUG */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmio.c ============================================================================ $ cvs diff -u -r1.195 -r1.196 rpmio.c --- rpm/rpmio/rpmio.c 2 Jun 2009 20:53:07 -0000 1.195 +++ rpm/rpmio/rpmio.c 12 Jun 2009 19:04:34 -0000 1.196 @@ -3136,6 +3136,7 @@ extern rpmioPool _ctxPool; extern rpmioPool _rpmsyckPool; /*...@=shadow@*/ + extern rpmioPool _rpmaugPool; extern rpmioPool _rpmmgPool; extern rpmioPool _rpmluavPool; extern rpmioPool _rpmluaPool; @@ -3180,6 +3181,7 @@ _rpmluaPool = rpmioFreePool(_rpmluaPool); _mirePool = rpmioFreePool(_mirePool); + _rpmaugPool = rpmioFreePool(_rpmaugPool); _rpmmgPool = rpmioFreePool(_rpmmgPool); _htPool = rpmioFreePool(_htPool); _ctxPool = rpmioFreePool(_ctxPool); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org