csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone
2ff057
#ifndef _RPMCALLBACK_H
2ff057
#define _RPMCALLBACK_H
2ff057
2ff057
/** \ingroup rpmcallback
2ff057
 *  \file lib/rpmcallback.h
2ff057
 *
2ff057
 *  (un)install callbacks
2ff057
 */
2ff057
2ff057
#include <rpm/rpmtypes.h>
2ff057
2ff057
#ifdef __cplusplus
2ff057
extern "C" {
2ff057
#endif
2ff057
2ff057
/**
2ff057
 * Bit(s) to identify progress callbacks.
2ff057
 */
2ff057
typedef enum rpmCallbackType_e {
2ff057
    RPMCALLBACK_UNKNOWN		= 0,
2ff057
    RPMCALLBACK_INST_PROGRESS	= (1 <<  0),
2ff057
    RPMCALLBACK_INST_START	= (1 <<  1),
2ff057
    RPMCALLBACK_INST_OPEN_FILE	= (1 <<  2),
2ff057
    RPMCALLBACK_INST_CLOSE_FILE	= (1 <<  3),
2ff057
    RPMCALLBACK_TRANS_PROGRESS	= (1 <<  4),
2ff057
    RPMCALLBACK_TRANS_START	= (1 <<  5),
2ff057
    RPMCALLBACK_TRANS_STOP	= (1 <<  6),
2ff057
    RPMCALLBACK_UNINST_PROGRESS	= (1 <<  7),
2ff057
    RPMCALLBACK_UNINST_START	= (1 <<  8),
2ff057
    RPMCALLBACK_UNINST_STOP	= (1 <<  9),
2ff057
    RPMCALLBACK_REPACKAGE_PROGRESS = (1 << 10),	/* obsolete, unused */
2ff057
    RPMCALLBACK_REPACKAGE_START	= (1 << 11),	/* obsolete, unused */
2ff057
    RPMCALLBACK_REPACKAGE_STOP	= (1 << 12),	/* obsolete, unused */
2ff057
    RPMCALLBACK_UNPACK_ERROR	= (1 << 13),
2ff057
    RPMCALLBACK_CPIO_ERROR	= (1 << 14),
2ff057
    RPMCALLBACK_SCRIPT_ERROR	= (1 << 15),
2ff057
    RPMCALLBACK_SCRIPT_START	= (1 << 16),
2ff057
    RPMCALLBACK_SCRIPT_STOP	= (1 << 17),
2ff057
    RPMCALLBACK_INST_STOP	= (1 << 18),
2ff057
    RPMCALLBACK_ELEM_PROGRESS	= (1 << 19),
2ff057
    RPMCALLBACK_VERIFY_PROGRESS	= (1 << 20),
2ff057
    RPMCALLBACK_VERIFY_START	= (1 << 21),
2ff057
    RPMCALLBACK_VERIFY_STOP	= (1 << 22),
2ff057
} rpmCallbackType;
2ff057
2ff057
/** \ingroup rpmts
2ff057
 * Function pointer type for rpmtsSetNotifyCallback() triggered by
2ff057
 * rpmtsNotify()
2ff057
 *
2ff057
 * @param h		related header or NULL
2ff057
 * @param what  	kind of notification (See RPMCALLBACK_ constants above)
2ff057
 * @param amount	number of bytes/packages already processed or
2ff057
 *			tag of the scriptlet involved
2ff057
 *			or 0 or some other number
2ff057
 * @param total		total number of bytes/packages to be processed or
2ff057
 * 			return code of the scriptlet or 0
2ff057
 * @param key		result of rpmteKey() of related rpmte or 0
2ff057
 * @param data		user data as passed to rpmtsSetNotifyCallback()
2ff057
 */
2ff057
typedef void * (*rpmCallbackFunction)
2ff057
		(const void * h, 
2ff057
		const rpmCallbackType what, 
2ff057
		const rpm_loff_t amount, 
2ff057
		const rpm_loff_t total,
2ff057
		fnpyKey key,
2ff057
		rpmCallbackData data);
2ff057
2ff057
#ifdef __cplusplus
2ff057
}
2ff057
#endif
2ff057
2ff057
#endif /* _RPMCALLBACK_H */