csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone
2ff057
#ifndef	_RPMTE_INTERNAL_H
2ff057
#define _RPMTE_INTERNAL_H
2ff057
2ff057
#include <rpm/rpmte.h>
2ff057
#include <rpm/rpmds.h>
2ff057
#include "lib/rpmfs.h"
2ff057
2ff057
typedef enum pkgGoal_e {
2ff057
    PKG_NONE		= 0,
2ff057
    /* permit using rpmteType() for install + erase goals */
2ff057
    PKG_INSTALL		= TR_ADDED,
2ff057
    PKG_ERASE		= TR_REMOVED,
2ff057
    /* permit using scriptname for these for now... */
2ff057
    PKG_VERIFY		= RPMTAG_VERIFYSCRIPT,
2ff057
    PKG_PRETRANS	= RPMTAG_PRETRANS,
2ff057
    PKG_POSTTRANS	= RPMTAG_POSTTRANS,
2ff057
    PKG_TRANSFILETRIGGERIN	= RPMTAG_TRANSFILETRIGGERIN,
2ff057
    PKG_TRANSFILETRIGGERUN	= RPMTAG_TRANSFILETRIGGERUN,
2ff057
} pkgGoal;
2ff057
2ff057
/** \ingroup rpmte
2ff057
 * Transaction element ordering chain linkage.
2ff057
 */
2ff057
typedef struct tsortInfo_s *		tsortInfo;
2ff057
2ff057
#ifdef __cplusplus
2ff057
extern "C" {
2ff057
#endif
2ff057
2ff057
/** \ingroup rpmte
2ff057
 * Create a transaction element.
2ff057
 * @param ts		transaction set
2ff057
 * @param h		header
2ff057
 * @param type		TR_ADDED/TR_REMOVED
2ff057
 * @param key		(TR_ADDED) package retrieval key (e.g. file name)
2ff057
 * @param relocs	(TR_ADDED) package file relocations
2ff057
 * @return		new transaction element
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmte rpmteNew(rpmts ts, Header h, rpmElementType type, fnpyKey key,
2ff057
	       rpmRelocation * relocs);
2ff057
2ff057
/** \ingroup rpmte
2ff057
 * Destroy a transaction element.
2ff057
 * @param te		transaction element
2ff057
 * @return		NULL always
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmte rpmteFree(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmteCleanFiles(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
FD_t rpmteSetFd(rpmte te, FD_t fd);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
FD_t rpmtePayload(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
int rpmteProcess(rpmte te, pkgGoal goal, int num);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmteAddProblem(rpmte te, rpmProblemType type,
2ff057
                     const char *altNEVR, const char *str, uint64_t number);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmteAddDepProblem(rpmte te, const char * pkgNEVR, rpmds ds,
2ff057
		        fnpyKey * suggestedKeys);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmteAddRelocProblems(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
const char * rpmteTypeString(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
tsortInfo rpmteTSI(rpmte te);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmteSetTSI(rpmte te, tsortInfo tsi);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
int rpmteHaveTransScript(rpmte te, rpmTagVal tag);
2ff057
2ff057
/* XXX should be internal too but build code needs for now... */
2ff057
rpmfs rpmteGetFileStates(rpmte te);
2ff057
Panu Matilainen d6b3d4
RPM_GNUC_INTERNAL
Panu Matilainen d6b3d4
void rpmteSetVerified(rpmte te, int verified);
Panu Matilainen d6b3d4
Panu Matilainen d6b3d4
RPM_GNUC_INTERNAL
Panu Matilainen d6b3d4
int rpmteGetVerified(rpmte te);
Panu Matilainen d6b3d4
2ff057
/** \ingroup rpmte
2ff057
 * Retrieve size in bytes of package header.
2ff057
 * @param te		transaction element
2ff057
 * @return		size in bytes of package file.
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
unsigned int rpmteHeaderSize(rpmte te);
2ff057
2ff057
/**
2ff057
 * Package state machine driver.
2ff057
 * @param ts		transaction set
2ff057
 * @param te		transaction element
2ff057
 * @param goal		state machine goal
2ff057
 * @return		0 on success
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmRC rpmpsmRun(rpmts ts, rpmte te, pkgGoal goal);
2ff057
2ff057
#ifdef __cplusplus
2ff057
}
2ff057
#endif
2ff057
2ff057
#endif	/* _RPMTE_INTERNAL_H */
2ff057