1995-12-28 03:50:38 +08:00
|
|
|
#ifndef _H_RPMLEAD
|
|
|
|
#define _H_RPMLEAD
|
|
|
|
|
2000-08-28 09:08:57 +08:00
|
|
|
/** \ingroup lead
|
|
|
|
* \file lib/rpmlead.h
|
2001-04-10 20:36:45 +08:00
|
|
|
* Routines to read and write an rpm lead structure for a a package.
|
2000-08-28 03:27:03 +08:00
|
|
|
*/
|
1999-07-14 05:37:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-09-26 16:29:53 +08:00
|
|
|
#define RPMLEAD_BINARY 0
|
|
|
|
#define RPMLEAD_SOURCE 1
|
|
|
|
|
|
|
|
#define RPMLEAD_MAGIC0 0xed
|
|
|
|
#define RPMLEAD_MAGIC1 0xab
|
|
|
|
#define RPMLEAD_MAGIC2 0xee
|
|
|
|
#define RPMLEAD_MAGIC3 0xdb
|
|
|
|
|
|
|
|
#define RPMLEAD_SIZE 96 /*!< Don't rely on sizeof(struct) */
|
|
|
|
|
2007-12-02 00:31:09 +08:00
|
|
|
typedef struct rpmlead_s * rpmlead;
|
|
|
|
|
|
|
|
/** \ingroup lead
|
|
|
|
* Initialize a lead structure from header
|
|
|
|
* param h Header
|
|
|
|
* @return Pointer to populated lead structure (malloced)
|
|
|
|
*/
|
|
|
|
rpmlead rpmLeadFromHeader(Header h);
|
|
|
|
|
|
|
|
/** \ingroup lead
|
|
|
|
* Free a lead structure
|
|
|
|
* @param lead Pointer to lead structure
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
|
|
|
rpmlead rpmLeadFree(rpmlead lead);
|
2007-09-26 16:29:53 +08:00
|
|
|
|
2000-08-28 09:08:57 +08:00
|
|
|
/** \ingroup lead
|
|
|
|
* Write lead to file handle.
|
|
|
|
* @param fd file handle
|
2003-04-17 01:48:04 +08:00
|
|
|
* @param lead package lead
|
|
|
|
* @return RPMRC_OK on success, RPMRC_FAIL on error
|
2000-08-28 09:08:57 +08:00
|
|
|
*/
|
2007-12-02 00:31:09 +08:00
|
|
|
rpmRC rpmLeadWrite(FD_t fd, rpmlead lead);
|
2000-08-28 09:08:57 +08:00
|
|
|
|
|
|
|
/** \ingroup lead
|
|
|
|
* Read lead from file handle.
|
|
|
|
* @param fd file handle
|
2011-07-06 17:42:56 +08:00
|
|
|
* @retval lead pointer to package lead (malloced)
|
2011-07-07 16:55:28 +08:00
|
|
|
* @retval type RPMLEAD_BINARY or RPMLEAD_SOURCE on success
|
|
|
|
* @retval emsg failure message on error (malloced)
|
2003-04-17 01:48:04 +08:00
|
|
|
* @return RPMRC_OK on success, RPMRC_FAIL/RPMRC_NOTFOUND on error
|
2000-08-28 09:08:57 +08:00
|
|
|
*/
|
2011-07-07 16:55:28 +08:00
|
|
|
rpmRC rpmLeadRead(FD_t fd, rpmlead *lead, int *type, char **emsg);
|
2008-12-09 01:50:07 +08:00
|
|
|
|
1999-07-14 05:37:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-07-25 23:10:58 +08:00
|
|
|
#endif /* _H_RPMLEAD */
|