rpm/lib/rpmte.h

263 lines
6.4 KiB
C
Raw Normal View History

#ifndef H_RPMTE
#define H_RPMTE
/** \ingroup rpmts rpmte
* \file lib/rpmte.h
* Structures used for an "rpmte" transaction element.
*/
#include <rpm/rpmtypes.h>
#include <rpm/argv.h>
2007-10-08 16:05:06 +08:00
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmte
* Transaction element type.
*/
typedef enum rpmElementType_e {
TR_ADDED = (1 << 0), /*!< Package will be installed. */
TR_REMOVED = (1 << 1) /*!< Package will be removed. */
} rpmElementType;
typedef rpmFlags rpmElementTypes;
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve header from transaction element.
* @param te transaction element
* @return header (new reference)
*/
Header rpmteHeader(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Save header into transaction element.
* @param te transaction element
* @param h header
* @return NULL always
*/
Header rpmteSetHeader(rpmte te, Header h);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve type of transaction element.
* @param te transaction element
* @return type
*/
2007-09-12 01:07:39 +08:00
rpmElementType rpmteType(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve name string of transaction element.
* @param te transaction element
* @return name string
*/
const char * rpmteN(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve epoch string of transaction element.
* @param te transaction element
* @return epoch string
*/
const char * rpmteE(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve version string of transaction element.
* @param te transaction element
* @return version string
*/
const char * rpmteV(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve release string of transaction element.
* @param te transaction element
* @return release string
*/
const char * rpmteR(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve arch string of transaction element.
* @param te transaction element
* @return arch string
*/
const char * rpmteA(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve os string of transaction element.
* @param te transaction element
* @return os string
*/
const char * rpmteO(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve isSource attribute of transaction element.
* @param te transaction element
* @return isSource attribute
*/
int rpmteIsSource(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve color bits of transaction element.
* @param te transaction element
* @return color bits
*/
rpm_color_t rpmteColor(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Set color bits of transaction element.
* @param te transaction element
* @param color new color bits
* @return previous color bits
*/
rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* 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);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* 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);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* 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.
*/
rpm_loff_t rpmtePkgFileSize(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve parent transaction element.
* @param te transaction element
* @return parent transaction element
*/
2007-09-12 01:07:39 +08:00
rpmte rpmteParent(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* 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);
/** \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
* Destroy dependency set info of transaction element.
* @param te transaction element
*/
2007-09-12 01:07:39 +08:00
void rpmteCleanDS(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Set dependent element of TR_REMOVED transaction element.
* @param te transaction element
* @param depends dependent transaction element
*/
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);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* 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);
/** \ingroup rpmte
* Retrieve [epoch:]version-release string from transaction element.
* @param te transaction element
* @return [epoch:]version-release string
*/
const char * rpmteEVR(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve name-[epoch:]version-release string from transaction element.
* @param te transaction element
* @return name-[epoch:]version-release string
*/
const char * rpmteNEVR(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve name-[epoch:]version-release.arch string from transaction element.
* @param te transaction element
* @return name-[epoch:]version-release.arch string
*/
const char * rpmteNEVRA(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve key from transaction element.
* @param te transaction element
* @return key
*/
2007-09-12 01:07:39 +08:00
fnpyKey rpmteKey(rpmte te);
/** \ingroup rpmte
* Return failure status of transaction element.
* If the element itself failed, this is 1, larger count means one of
* it's parents failed.
* @param te transaction element
* @return number of failures for this transaction element
*/
int rpmteFailed(rpmte te);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve dependency tag set from transaction element.
* @param te transaction element
* @param tag dependency tag
* @return dependency tag set
*/
rpmds rpmteDS(rpmte te, rpmTagVal tag);
2007-11-23 20:12:43 +08:00
/** \ingroup rpmte
* Retrieve file info tag set from transaction element.
* @param te transaction element
* @return file info tag set
*/
rpmfi rpmteFI(rpmte te);
/** \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);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMTE */