diff options
author | jbj <devnull@localhost> | 2004-10-18 22:47:20 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-10-18 22:47:20 +0000 |
commit | ddfad5f8782002bc2679aa82b9e58b58efb1430b (patch) | |
tree | b4832b16bd3dd2c6e85e63f262c26ea0523e0164 /lib/rpmgi.h | |
parent | e93a77c9b792b68c63ce7d3d360ab7f43d37feb6 (diff) | |
download | librpm-tizen-ddfad5f8782002bc2679aa82b9e58b58efb1430b.tar.gz librpm-tizen-ddfad5f8782002bc2679aa82b9e58b58efb1430b.tar.bz2 librpm-tizen-ddfad5f8782002bc2679aa82b9e58b58efb1430b.zip |
Isolate most state changes in rpmgiNext, with lazy open/close.
Refactor some of the mess into subroutines.
CVS patchset: 7483
CVS date: 2004/10/18 22:47:20
Diffstat (limited to 'lib/rpmgi.h')
-rw-r--r-- | lib/rpmgi.h | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/lib/rpmgi.h b/lib/rpmgi.h index 1d4f864c1..b20b53ca2 100644 --- a/lib/rpmgi.h +++ b/lib/rpmgi.h @@ -18,6 +18,7 @@ extern int _rpmgi_debug; /*@=exportlocal@*/ /** + * Iterator types. */ typedef enum rpmgiTag_e { RPMGI_RPMDB = RPMDBI_PACKAGES, @@ -31,10 +32,14 @@ typedef enum rpmgiTag_e { */ struct rpmgi_s { /*@refcounted@*/ - rpmts ts; - int tag; - int i; - const char * queryFormat; + rpmts ts; /*!< Iterator transaction set. */ + int tag; /*!< Iterator type. */ + int active; /*!< Iterator is initialized? */ + int i; /*!< Element index. */ + const char * queryFormat; /*!< Iterator query format. */ + const char * hdrPath; /*!< Path to header objects. */ +/*@refcounted@*/ /*@null@*/ + Header h; /*!< Current iterator header. */ /*@relnull@*/ rpmdbMatchIterator mi; @@ -46,11 +51,13 @@ struct rpmgi_s { int argc; int ftsOpts; +/*@null@*/ FTS * ftsp; +/*@null@*/ FTSENT * fts; /*@refs@*/ - int nrefs; + int nrefs; /*!< Reference count. */ }; #endif @@ -111,10 +118,11 @@ rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) */ /*@null@*/ rpmgi rpmgiNew(rpmts ts, int tag, void *const keyp, size_t keylen) - /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ - /*@modifies ts, rpmGlobalMacroContext, h_errno, internalState @*/; + /*@globals internalState @*/ + /*@modifies ts, internalState @*/; -/** Return next iteration element. +/** + * Return next iteration element. * @param gi generalized iterator * @returns next element */ @@ -123,9 +131,42 @@ const char * rpmgiNext(/*@null@*/ rpmgi gi) /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; +/** + * Return iterator query format. + * @param gi generalized iterator + * @returns query format + */ +/*@observer@*/ +const char * rpmgiQueryFormat(rpmgi gi) + /*@*/; + +/** + * Set iterator query format. + * @param gi generalized iterator + * @param queryFormat query format + * @returns 0 + */ int rpmgiSetQueryFormat(rpmgi gi, const char * queryFormat) /*@modifies gi @*/; +/** + * Return iterator header objects path. + * @param gi generalized iterator + * @returns header path + */ +/*@observer@*/ +const char * rpmgiHdrPath(rpmgi gi) + /*@*/; + +/** + * Set iterator header objects path. + * @param gi generalized iterator + * @param hdrPath header path + * @returns 0 + */ +int rpmgiSetHdrPath(rpmgi gi, const char * hdrPath) + /*@modifies gi @*/; + #ifdef __cplusplus } #endif |