2001-11-17 04:26:01 +08:00
|
|
|
#ifndef H_RPMTE
|
|
|
|
#define H_RPMTE
|
|
|
|
|
2002-05-20 07:37:24 +08:00
|
|
|
/** \ingroup rpmts rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* \file lib/rpmte.h
|
2002-05-20 02:42:25 +08:00
|
|
|
* Structures used for an "rpmte" transaction element.
|
2001-11-17 04:26:01 +08:00
|
|
|
*/
|
|
|
|
|
2009-03-17 00:02:16 +08:00
|
|
|
#include <rpm/rpmtypes.h>
|
2010-06-22 05:04:37 +08:00
|
|
|
#include <rpm/argv.h>
|
2007-09-21 20:17:08 +08:00
|
|
|
|
2007-10-08 16:05:06 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-05-20 07:37:24 +08:00
|
|
|
/** \ingroup rpmte
|
|
|
|
* Transaction element type.
|
|
|
|
*/
|
|
|
|
typedef enum rpmElementType_e {
|
2010-03-25 16:31:47 +08:00
|
|
|
TR_ADDED = (1 << 0), /*!< Package will be installed. */
|
|
|
|
TR_REMOVED = (1 << 1) /*!< Package will be removed. */
|
2002-05-20 07:37:24 +08:00
|
|
|
} rpmElementType;
|
|
|
|
|
2010-09-21 17:15:44 +08:00
|
|
|
typedef rpmFlags rpmElementTypes;
|
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2004-10-27 07:29:28 +08:00
|
|
|
* Retrieve header from transaction element.
|
|
|
|
* @param te transaction element
|
2010-03-22 20:44:14 +08:00
|
|
|
* @return header (new reference)
|
2004-10-27 07:29:28 +08:00
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
Header rpmteHeader(rpmte te);
|
2004-10-27 07:29:28 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2004-10-27 07:29:28 +08:00
|
|
|
* Save header into transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @param h header
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
Header rpmteSetHeader(rpmte te, Header h);
|
2004-10-27 07:29:28 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve type of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return type
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
rpmElementType rpmteType(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve name string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return name string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteN(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve epoch string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return epoch string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteE(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve version string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return version string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteV(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve release string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return release string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteR(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve arch string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return arch string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteA(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve os string of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return os string
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteO(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2004-10-27 07:29:28 +08:00
|
|
|
* Retrieve isSource attribute of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return isSource attribute
|
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
int rpmteIsSource(rpmte te);
|
2004-10-27 07:29:28 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2002-12-31 09:23:03 +08:00
|
|
|
* Retrieve color bits of transaction element.
|
2001-11-17 04:26:01 +08:00
|
|
|
* @param te transaction element
|
2002-12-31 09:23:03 +08:00
|
|
|
* @return color bits
|
2001-11-17 04:26:01 +08:00
|
|
|
*/
|
2008-02-05 18:12:31 +08:00
|
|
|
rpm_color_t rpmteColor(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2002-12-31 09:23:03 +08:00
|
|
|
* Set color bits of transaction element.
|
2001-11-17 16:02:17 +08:00
|
|
|
* @param te transaction element
|
2002-12-31 09:23:03 +08:00
|
|
|
* @param color new color bits
|
|
|
|
* @return previous color bits
|
2001-11-17 16:02:17 +08:00
|
|
|
*/
|
2008-02-05 18:12:31 +08:00
|
|
|
rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
|
2001-11-17 16:02:17 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2004-03-06 02:22:25 +08:00
|
|
|
* Retrieve last instance installed to the database.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return last install instance.
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
unsigned int rpmteDBInstance(rpmte te);
|
2004-03-06 02:22:25 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2004-03-06 02:22:25 +08:00
|
|
|
* Set last instance installed to the database.
|
|
|
|
* @param te transaction element
|
|
|
|
* @param instance Database instance of last install element.
|
|
|
|
* @return last install instance.
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
void rpmteSetDBInstance(rpmte te, unsigned int instance);
|
2004-03-06 02:22:25 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2003-01-26 04:59:52 +08:00
|
|
|
* Retrieve size in bytes of package file.
|
|
|
|
* @todo Signature header is estimated at 256b.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return size in bytes of package file.
|
|
|
|
*/
|
2008-06-09 17:48:34 +08:00
|
|
|
rpm_loff_t rpmtePkgFileSize(rpmte te);
|
2003-01-26 04:59:52 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2002-01-05 11:23:42 +08:00
|
|
|
* Retrieve parent transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return parent transaction element
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
rpmte rpmteParent(rpmte te);
|
2002-01-05 11:23:42 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2002-01-05 11:23:42 +08:00
|
|
|
* Set parent transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @param pte new parent transaction element
|
|
|
|
* @return previous parent transaction element
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
rpmte rpmteSetParent(rpmte te, rpmte pte);
|
2002-01-05 11:23:42 +08:00
|
|
|
|
2010-03-12 22:18:16 +08:00
|
|
|
/** \ingroup rpmte
|
|
|
|
* Return problem set info of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return problem set (or NULL if none)
|
|
|
|
*/
|
|
|
|
rpmps rpmteProblems(rpmte te);
|
|
|
|
|
|
|
|
/** \ingroup rpmte
|
|
|
|
* Destroy problem set info of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
*/
|
|
|
|
void rpmteCleanProblems(rpmte te);
|
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 16:02:17 +08:00
|
|
|
* Destroy dependency set info of transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
void rpmteCleanDS(rpmte te);
|
2001-11-17 16:02:17 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2009-03-25 23:29:09 +08:00
|
|
|
* Set dependent element of TR_REMOVED transaction element.
|
2001-11-17 04:26:01 +08:00
|
|
|
* @param te transaction element
|
2009-03-25 23:29:09 +08:00
|
|
|
* @param depends dependent transaction element
|
2001-11-17 04:26:01 +08:00
|
|
|
*/
|
2009-03-25 23:29:09 +08:00
|
|
|
void rpmteSetDependsOn(rpmte te, rpmte depends);
|
|
|
|
|
|
|
|
/** \ingroup rpmte
|
|
|
|
* Retrieve dependent element of TR_REMOVED transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return dependent transaction element
|
|
|
|
*/
|
|
|
|
rpmte rpmteDependsOn(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve rpmdb instance of TR_REMOVED transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return rpmdb instance
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
int rpmteDBOffset(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2008-04-24 19:56:27 +08:00
|
|
|
/** \ingroup rpmte
|
|
|
|
* Retrieve [epoch:]version-release string from transaction element.
|
|
|
|
* @param te transaction element
|
2008-04-24 20:16:03 +08:00
|
|
|
* @return [epoch:]version-release string
|
2008-04-24 19:56:27 +08:00
|
|
|
*/
|
|
|
|
const char * rpmteEVR(rpmte te);
|
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2008-04-24 20:16:03 +08:00
|
|
|
* Retrieve name-[epoch:]version-release string from transaction element.
|
2001-11-17 04:26:01 +08:00
|
|
|
* @param te transaction element
|
2008-04-24 20:16:03 +08:00
|
|
|
* @return name-[epoch:]version-release string
|
2001-11-17 04:26:01 +08:00
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteNEVR(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2008-04-24 20:16:03 +08:00
|
|
|
* Retrieve name-[epoch:]version-release.arch string from transaction element.
|
2003-01-18 01:43:04 +08:00
|
|
|
* @param te transaction element
|
2008-04-24 20:16:03 +08:00
|
|
|
* @return name-[epoch:]version-release.arch string
|
2003-01-18 01:43:04 +08:00
|
|
|
*/
|
2008-04-24 20:08:09 +08:00
|
|
|
const char * rpmteNEVRA(rpmte te);
|
2003-01-18 01:43:04 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 04:26:01 +08:00
|
|
|
* Retrieve key from transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return key
|
|
|
|
*/
|
2007-09-12 01:07:39 +08:00
|
|
|
fnpyKey rpmteKey(rpmte te);
|
2001-11-17 04:26:01 +08:00
|
|
|
|
2008-11-25 17:46:20 +08:00
|
|
|
/** \ingroup rpmte
|
2010-02-25 18:32:57 +08:00
|
|
|
* Return failure status of transaction element.
|
|
|
|
* If the element itself failed, this is 1, larger count means one of
|
|
|
|
* it's parents failed.
|
2008-11-25 17:46:20 +08:00
|
|
|
* @param te transaction element
|
2010-02-25 18:32:57 +08:00
|
|
|
* @return number of failures for this transaction element
|
2008-11-25 17:46:20 +08:00
|
|
|
*/
|
|
|
|
int rpmteFailed(rpmte te);
|
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 08:52:45 +08:00
|
|
|
* Retrieve dependency tag set from transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @param tag dependency tag
|
|
|
|
* @return dependency tag set
|
|
|
|
*/
|
2010-10-22 16:31:36 +08:00
|
|
|
rpmds rpmteDS(rpmte te, rpmTagVal tag);
|
2001-11-17 08:52:45 +08:00
|
|
|
|
2007-11-23 20:12:43 +08:00
|
|
|
/** \ingroup rpmte
|
2001-11-17 08:52:45 +08:00
|
|
|
* Retrieve file info tag set from transaction element.
|
|
|
|
* @param te transaction element
|
|
|
|
* @return file info tag set
|
|
|
|
*/
|
2008-11-27 16:02:00 +08:00
|
|
|
rpmfi rpmteFI(rpmte te);
|
2001-11-17 08:52:45 +08:00
|
|
|
|
2010-06-22 05:04:37 +08:00
|
|
|
/** \ingroup rpmte
|
|
|
|
* Retrieve list of collections
|
|
|
|
* @param te transaction element
|
|
|
|
* @return list of collections
|
|
|
|
*/
|
|
|
|
ARGV_const_t rpmteCollections(rpmte te);
|
|
|
|
|
|
|
|
/** \ingroup rpmte
|
|
|
|
* Determine a transaction element is part of a collection
|
|
|
|
* @param te transaction element
|
|
|
|
* @param collname collection name
|
|
|
|
* @return 1 if collname is part of a collection, 0 if not
|
|
|
|
*/
|
|
|
|
int rpmteHasCollection(rpmte te, const char * collname);
|
|
|
|
|
|
|
|
|
2001-11-17 04:26:01 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* H_RPMTE */
|