PK vFZ+�]�� � rpmutil.hnu �[��� #ifndef _RPMUTIL_H
#define _RPMUTIL_H
#include <unistd.h>
/** \file rpmio/rpmutil.h
*
* Miscellaneous utility macros:
* - portability wrappers for various gcc extensions like __attribute__()
* - ...
*
* Copied from glib, names replaced to avoid clashing with glib.
*
*/
/* Here we provide RPM_GNUC_EXTENSION as an alias for __extension__,
* where this is valid. This allows for warningless compilation of
* "long long" types even in the presence of '-ansi -pedantic'.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
# define RPM_GNUC_EXTENSION __extension__
#else
# define RPM_GNUC_EXTENSION
#endif
/* Provide macros to feature the GCC function attribute.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#define RPM_GNUC_PURE \
__attribute__((__pure__))
#define RPM_GNUC_MALLOC \
__attribute__((__malloc__))
#else
#define RPM_GNUC_PURE
#define RPM_GNUC_MALLOC
#endif
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#define RPM_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#define RPM_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
#else
#define RPM_GNUC_ALLOC_SIZE(x)
#define RPM_GNUC_ALLOC_SIZE2(x,y)
#endif
#if __GNUC__ >= 4
#define RPM_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
#else
#define RPM_GNUC_NULL_TERMINATED
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define RPM_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define RPM_GNUC_SCANF( format_idx, arg_idx ) \
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
#define RPM_GNUC_FORMAT( arg_idx ) \
__attribute__((__format_arg__ (arg_idx)))
#define RPM_GNUC_NORETURN \
__attribute__((__noreturn__))
#define RPM_GNUC_CONST \
__attribute__((__const__))
#define RPM_GNUC_UNUSED \
__attribute__((__unused__))
#define RPM_GNUC_NO_INSTRUMENT \
__attribute__((__no_instrument_function__))
#else /* !__GNUC__ */
#define RPM_GNUC_PRINTF( format_idx, arg_idx )
#define RPM_GNUC_SCANF( format_idx, arg_idx )
#define RPM_GNUC_FORMAT( arg_idx )
#define RPM_GNUC_NORETURN
#define RPM_GNUC_CONST
#define RPM_GNUC_UNUSED
#define RPM_GNUC_NO_INSTRUMENT
#endif /* !__GNUC__ */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define RPM_GNUC_DEPRECATED \
__attribute__((__deprecated__))
#else
#define RPM_GNUC_DEPRECATED
#endif /* __GNUC__ */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
#define RPM_GNUC_MAY_ALIAS __attribute__((may_alias))
#define RPM_GNUC_NONNULL( ... ) \
__attribute__((__nonnull__ (__VA_ARGS__)))
#else
#define RPM_GNUC_MAY_ALIAS
#define RPM_GNUC_NONNULL( ... )
#endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#define RPM_GNUC_WARN_UNUSED_RESULT \
__attribute__((warn_unused_result))
#else
#define RPM_GNUC_WARN_UNUSED_RESULT
#endif /* __GNUC__ */
#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define RPM_GNUC_INTERNAL __attribute__((visibility("hidden")))
#else
# define RPM_GNUC_INTERNAL
#endif
/* Guard C code in headers, while including them from C++ */
#ifdef __cplusplus
# define RPM_BEGIN_DECLS extern "C" {
# define RPM_END_DECLS }
#else
# define RPM_BEGIN_DECLS
# define RPM_END_DECLS
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Rpm specific allocators which never return NULL but terminate on failure */
RPM_GNUC_MALLOC RPM_GNUC_ALLOC_SIZE(1)
void * rmalloc(size_t size);
RPM_GNUC_MALLOC RPM_GNUC_ALLOC_SIZE2(1,2)
void * rcalloc(size_t nmemb, size_t size);
RPM_GNUC_ALLOC_SIZE(2)
void * rrealloc(void *ptr, size_t size);
char * rstrdup(const char *str);
/* Rpm specific free() which returns NULL */
void * rfree(void *ptr);
/** \ingroup rpmutil
* Memory allocation failure callback prototype. When registered through
* rpmSetMemFail(), this gets called if memory allocation through rmalloc()
* and friends fails. If the application can somehow recover memory here,
* it can return a newly allocated memory block of requested size, otherwise
* it must return NULL after performing it's own shutdown deeds or
* terminate itself.
* @param size Size of allocation request in bytes
* @param data User data (or NULL)
* @return Allocated memory block of requested size or NULL
*/
typedef void * (*rpmMemFailFunc) (size_t size, void *data);
/** \ingroup rpmutil
* Set memory allocation failure callback.
* @param func Allocation failure callback function
* @param data User data (or NULL)
* @return Previous callback function
*/
rpmMemFailFunc rpmSetMemFail(rpmMemFailFunc func, void *data);
#ifdef __cplusplus
}
#endif
#endif /* _RPMUTIL_H */
PK vFZk� � � rpmpol.hnu �[��� #ifndef H_RPMPOL
#define H_RPMPOL
/** \ingroup rpmpol
* \file lib/rpmpol.h
* Structure(s) used for policy sets.
*/
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
enum rpmpolFlags_e {
RPMPOL_FLAG_NONE = 0,
RPMPOL_FLAG_BASE = (1 << 0)
};
typedef rpmFlags rpmpolFlags;
#define RPMPOL_TYPE_DEFAULT "default"
#ifdef __cplusplus
}
#endif
#endif /* H_rpmpol */
PK vFZ���� �
rpmcallback.hnu �[��� #ifndef _RPMCALLBACK_H
#define _RPMCALLBACK_H
/** \ingroup rpmcallback
* \file lib/rpmcallback.h
*
* (un)install callbacks
*/
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Bit(s) to identify progress callbacks.
*/
typedef enum rpmCallbackType_e {
RPMCALLBACK_UNKNOWN = 0,
RPMCALLBACK_INST_PROGRESS = (1 << 0),
RPMCALLBACK_INST_START = (1 << 1),
RPMCALLBACK_INST_OPEN_FILE = (1 << 2),
RPMCALLBACK_INST_CLOSE_FILE = (1 << 3),
RPMCALLBACK_TRANS_PROGRESS = (1 << 4),
RPMCALLBACK_TRANS_START = (1 << 5),
RPMCALLBACK_TRANS_STOP = (1 << 6),
RPMCALLBACK_UNINST_PROGRESS = (1 << 7),
RPMCALLBACK_UNINST_START = (1 << 8),
RPMCALLBACK_UNINST_STOP = (1 << 9),
RPMCALLBACK_REPACKAGE_PROGRESS = (1 << 10), /* obsolete, unused */
RPMCALLBACK_REPACKAGE_START = (1 << 11), /* obsolete, unused */
RPMCALLBACK_REPACKAGE_STOP = (1 << 12), /* obsolete, unused */
RPMCALLBACK_UNPACK_ERROR = (1 << 13),
RPMCALLBACK_CPIO_ERROR = (1 << 14),
RPMCALLBACK_SCRIPT_ERROR = (1 << 15),
RPMCALLBACK_SCRIPT_START = (1 << 16),
RPMCALLBACK_SCRIPT_STOP = (1 << 17),
RPMCALLBACK_INST_STOP = (1 << 18),
RPMCALLBACK_ELEM_PROGRESS = (1 << 19),
RPMCALLBACK_VERIFY_PROGRESS = (1 << 20),
RPMCALLBACK_VERIFY_START = (1 << 21),
RPMCALLBACK_VERIFY_STOP = (1 << 22),
} rpmCallbackType;
/** \ingroup rpmts
* Function pointer type for rpmtsSetNotifyCallback() triggered by
* rpmtsNotify()
*
* @param h related header or NULL
* @param what kind of notification (See RPMCALLBACK_ constants above)
* @param amount number of bytes/packages already processed or
* tag of the scriptlet involved
* or 0 or some other number
* @param total total number of bytes/packages to be processed or
* return code of the scriptlet or 0
* @param key result of rpmteKey() of related rpmte or 0
* @param data user data as passed to rpmtsSetNotifyCallback()
*/
typedef void * (*rpmCallbackFunction)
(const void * h,
const rpmCallbackType what,
const rpm_loff_t amount,
const rpm_loff_t total,
fnpyKey key,
rpmCallbackData data);
#ifdef __cplusplus
}
#endif
#endif /* _RPMCALLBACK_H */
PK vFZ<� �� � rpmlog.hnu �[��� #ifndef H_RPMLOG
#define H_RPMLOG 1
/** \ingroup rpmio
* \file rpmio/rpmlog.h
* Yet Another syslog(3) API clone.
* Used to unify rpmError() and rpmMessage() interfaces in rpm.
*/
#include <stdarg.h>
#include <stdio.h>
#include <rpm/rpmutil.h>
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmlog
* RPM Log levels.
* priorities/facilities are encoded into a single 32-bit quantity, where the
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
* (0-big number). Both the priorities and the facilities map roughly
* one-to-one to strings in the syslogd(8) source code. This mapping is
* included in this file.
*
* priorities (these are ordered)
*/
typedef enum rpmlogLvl_e {
RPMLOG_EMERG = 0, /*!< system is unusable */
RPMLOG_ALERT = 1, /*!< action must be taken immediately */
RPMLOG_CRIT = 2, /*!< critical conditions */
RPMLOG_ERR = 3, /*!< error conditions */
RPMLOG_WARNING = 4, /*!< warning conditions */
RPMLOG_NOTICE = 5, /*!< normal but significant condition */
RPMLOG_INFO = 6, /*!< informational */
RPMLOG_DEBUG = 7 /*!< debug-level messages */
} rpmlogLvl;
#define RPMLOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
/* extract priority */
#define RPMLOG_PRI(p) ((p) & RPMLOG_PRIMASK)
#define RPMLOG_MAKEPRI(fac, pri) ((((unsigned)(fac)) << 3) | (pri))
/** \ingroup rpmlog
* facility codes
*/
typedef enum rpmlogFac_e {
RPMLOG_KERN = (0<<3), /*!< kernel messages */
RPMLOG_USER = (1<<3), /*!< random user-level messages */
RPMLOG_MAIL = (2<<3), /*!< mail system */
RPMLOG_DAEMON = (3<<3), /*!< system daemons */
RPMLOG_AUTH = (4<<3), /*!< security/authorization messages */
RPMLOG_SYSLOG = (5<<3), /*!< messages generated internally by syslogd */
RPMLOG_LPR = (6<<3), /*!< line printer subsystem */
RPMLOG_NEWS = (7<<3), /*!< network news subsystem */
RPMLOG_UUCP = (8<<3), /*!< UUCP subsystem */
RPMLOG_CRON = (9<<3), /*!< clock daemon */
RPMLOG_AUTHPRIV = (10<<3), /*!< security/authorization messages (private) */
RPMLOG_FTP = (11<<3), /*!< ftp daemon */
/* other codes through 15 reserved for system use */
RPMLOG_LOCAL0 = (16<<3), /*!< reserved for local use */
RPMLOG_LOCAL1 = (17<<3), /*!< reserved for local use */
RPMLOG_LOCAL2 = (18<<3), /*!< reserved for local use */
RPMLOG_LOCAL3 = (19<<3), /*!< reserved for local use */
RPMLOG_LOCAL4 = (20<<3), /*!< reserved for local use */
RPMLOG_LOCAL5 = (21<<3), /*!< reserved for local use */
RPMLOG_LOCAL6 = (22<<3), /*!< reserved for local use */
RPMLOG_LOCAL7 = (23<<3), /*!< reserved for local use */
#define RPMLOG_NFACILITIES 24 /*!< current number of facilities */
RPMLOG_ERRMSG = (((unsigned)(RPMLOG_NFACILITIES+0))<<3)
} rpmlogFac;
#define RPMLOG_FACMASK 0x03f8 /*!< mask to extract facility part */
#define RPMLOG_FAC(p) (((p) & RPMLOG_FACMASK) >> 3)
/*
* arguments to setlogmask.
*/
#define RPMLOG_MASK(pri) (1 << ((unsigned)(pri))) /*!< mask for one priority */
#define RPMLOG_UPTO(pri) ((1 << (((unsigned)(pri))+1)) - 1) /*!< all priorities through pri */
/*
* Option flags for openlog.
*
* RPMLOG_ODELAY no longer does anything.
* RPMLOG_NDELAY is the inverse of what it used to be.
*/
#define RPMLOG_PID 0x01 /*!< log the pid with each message */
#define RPMLOG_CONS 0x02 /*!< log on the console if errors in sending */
#define RPMLOG_ODELAY 0x04 /*!< delay open until first syslog() (default) */
#define RPMLOG_NDELAY 0x08 /*!< don't delay open */
#define RPMLOG_NOWAIT 0x10 /*!< don't wait for console forks: DEPRECATED */
#define RPMLOG_PERROR 0x20 /*!< log to stderr as well */
/* \ingroup rpmlog
* Option flags for callback return value.
*/
#define RPMLOG_DEFAULT 0x01 /*!< perform default logging */
#define RPMLOG_EXIT 0x02 /*!< exit after logging */
/** \ingroup rpmlog
*/
typedef struct rpmlogRec_s * rpmlogRec;
/** \ingroup rpmlog
* Retrieve log message string from rpmlog record
* @param rec rpmlog record
* @return log message
*/
const char * rpmlogRecMessage(rpmlogRec rec);
/** \ingroup rpmlog
* Retrieve log priority from rpmlog record
* @param rec rpmlog record
* @return log priority
*/
rpmlogLvl rpmlogRecPriority(rpmlogRec rec);
typedef void * rpmlogCallbackData;
/** \ingroup rpmlog
* @param rec rpmlog record
* @param data private callback data
* @return flags to define further behavior:
* RPMLOG_DEFAULT to perform default logging,
* RPMLOG_EXIT to exit after processing,
* 0 to return after callback
*/
typedef int (*rpmlogCallback) (rpmlogRec rec, rpmlogCallbackData data);
/** \ingroup rpmlog
* Return number of rpmError() ressages.
* @return number of messages
*/
int rpmlogGetNrecs(void) ;
/** \ingroup rpmlog
* Print all rpmError() messages.
* @param f file handle (NULL uses stderr)
*/
void rpmlogPrint(FILE *f);
/** \ingroup rpmlog
* Close desriptor used to write to system logger.
* @todo Implement.
*/
void rpmlogClose (void);
/** \ingroup rpmlog
* Open connection to system logger.
* @todo Implement.
*/
void rpmlogOpen (const char * ident, int option, int facility);
/** \ingroup rpmlog
* Set the log mask level.
* @param mask log mask (0 is no operation)
* @return previous log mask
*/
int rpmlogSetMask (int mask);
/** \ingroup rpmlog
* Generate a log message using FMT string and option arguments.
*/
void rpmlog (int code, const char *fmt, ...) RPM_GNUC_PRINTF(2, 3);
/** \ingroup rpmlog
* Return text of last rpmError() message.
* @return text of last message
*/
const char * rpmlogMessage(void);
/** \ingroup rpmlog
* Return error code from last rpmError() message.
* @deprecated Perl-RPM needs, what's really needed is predictable, non-i18n
* encumbered, error text that can be retrieved through rpmlogMessage()
* and parsed IMHO.
* @return code from last message
*/
int rpmlogCode(void);
/** \ingroup rpmlog
* Return translated prefix string (if any) given log level.
* @param pri log priority
* @return message prefix (or "" for none)
*/
const char * rpmlogLevelPrefix(rpmlogLvl pri);
/** \ingroup rpmlog
* Set rpmlog callback function.
* @param cb rpmlog callback function
* @param data callback private (user) data
* @return previous rpmlog callback function
*/
rpmlogCallback rpmlogSetCallback(rpmlogCallback cb, rpmlogCallbackData data);
/** \ingroup rpmlog
* Set rpmlog file handle.
* @param fp rpmlog file handle (NULL uses stdout/stderr)
* @return previous rpmlog file handle
*/
FILE * rpmlogSetFile(FILE * fp);
#define rpmSetVerbosity(_lvl) \
((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
#define rpmIncreaseVerbosity() \
((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
#define rpmDecreaseVerbosity() \
((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
#define rpmIsNormal() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE ))
#define rpmIsVerbose() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO ))
#define rpmIsDebug() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG ))
#ifdef __cplusplus
}
#endif
#endif /* H_RPMLOG */
PK vFZ�l#�� � argv.hnu �[��� #ifndef _H_ARGV_
#define _H_ARGV_
/** \ingroup rpmargv
* \file rpmio/argv.h
*
* Argument Manipulation API.
*/
#include <stdio.h>
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef char ** ARGV_t;
typedef char * const *ARGV_const_t;
typedef int * ARGint_t;
struct ARGI_s {
unsigned nvals;
ARGint_t vals;
};
typedef struct ARGI_s * ARGI_t;
typedef struct ARGI_s const * const ARGI_const_t;
/** \ingroup rpmargv
* Print argv array elements.
* @param msg output message prefix (or NULL)
* @param argv argv array
* @param fp output file handle (NULL uses stderr)
*/
void argvPrint(const char * msg, ARGV_const_t argv, FILE * fp);
/** \ingroup rpmargv
* Destroy an argi array.
* @param argi argi array
* @return NULL always
*/
ARGI_t argiFree(ARGI_t argi);
/** \ingroup rpmargv
* Create an empty argv array.
* @return pointer to empty argv
*/
ARGV_t argvNew(void);
/** \ingroup rpmargv
* Destroy an argv array.
* @param argv argv array
* @return NULL always
*/
ARGV_t argvFree(ARGV_t argv);
/** \ingroup rpmargv
* Return no. of elements in argi array.
* @param argi argi array
* @return no. of elements
*/
int argiCount(ARGI_const_t argi);
/** \ingroup rpmargv
* Return data from argi array.
* @param argi argi array
* @return argi array data address
*/
ARGint_t argiData(ARGI_const_t argi);
/** \ingroup rpmargv
* Return no. of elements in argv array.
* @param argv argv array
* @return no. of elements
*/
int argvCount(ARGV_const_t argv);
/** \ingroup rpmargv
* Return data from argv array.
* @param argv argv array
* @return argv array data address
*/
ARGV_t argvData(ARGV_t argv);
/** \ingroup rpmargv
* Compare argv arrays (qsort/bsearch).
* @param a 1st instance address
* @param b 2nd instance address
* @return result of comparison
*/
int argvCmp(const void * a, const void * b);
/** \ingroup rpmargv
* Sort an argv array.
* @param argv argv array
* @param compar strcmp-like comparison function, or NULL for argvCmp()
* @return 0 always
*/
int argvSort(ARGV_t argv, int (*compar)(const void *, const void *));
/** \ingroup rpmargv
* Find an element in an argv array.
* @param argv argv array
* @param val string to find
* @param compar strcmp-like comparison function, or NULL for argvCmp()
* @return found string (NULL on failure)
*/
ARGV_t argvSearch(ARGV_const_t argv, const char *val,
int (*compar)(const void *, const void *));
/** \ingroup rpmargv
* Add an int to an argi array.
* @retval *argip argi array
* @param ix argi array index (or -1 to append)
* @param val int arg to add
* @return 0 always
*/
int argiAdd(ARGI_t * argip, int ix, int val);
/** \ingroup rpmargv
* Add a string to an argv array.
* @retval *argvp argv array
* @param val string arg to append
* @return 0 always
*/
int argvAdd(ARGV_t * argvp, const char *val);
/** \ingroup rpmargv
* Add a number to an argv array (converting to a string).
* @retval *argvp argv array
* @param val numeric arg to append
* @return 0 always
*/
int argvAddNum(ARGV_t * argvp, int val);
/** \ingroup rpmargv
* Append one argv array to another.
* @retval *argvp argv array
* @param av argv array to append
* @return 0 always
*/
int argvAppend(ARGV_t * argvp, ARGV_const_t av);
enum argvFlags_e {
ARGV_NONE = 0,
ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
};
typedef rpmFlags argvFlags;
/** \ingroup rpmargv
* Split a string into an argv array.
* @param str string arg to split
* @param seps separator characters
* @param flags flags to control behavior
* @return argv array
*/
ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags);
/** \ingroup rpmargv
* Split a string into an argv array.
* @retval *argvp argv array
* @param str string arg to split
* @param seps separator characters
* @return 0 always
*/
int argvSplit(ARGV_t * argvp, const char * str, const char * seps);
/** \ingroup rpmargv
* Join an argv array into a string.
* @param *argv argv array to join
* @param sep separator string to use
* @return malloc'ed string
*/
char *argvJoin(ARGV_const_t argv, const char *sep);
#ifdef __cplusplus
}
#endif
#endif /* _H_ARGV_ */
PK vFZ#d}�\ \ rpmio.hnu �[��� #ifndef H_RPMIO
#define H_RPMIO
/** \ingroup rpmio
* \file rpmio/rpmio.h
*
* RPM I/O API (Fd_t is RPM equivalent to libc's FILE)
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmsw.h>
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmio
*/
typedef const struct FDIO_s * FDIO_t;
/** \ingroup rpmio
* \name RPMIO Interface.
*/
/** \ingroup rpmio
* strerror(3) clone.
*/
const char * Fstrerror(FD_t fd);
/** \ingroup rpmio
* Like fread(3) but with read(3)-style return values.
*/
ssize_t Fread(void * buf, size_t size, size_t nmemb, FD_t fd);
/** \ingroup rpmio
* Like fwrite(3) but with write(3)-style return values.
*/
ssize_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd);
/** \ingroup rpmio
* fseek(3) clone.
*/
int Fseek(FD_t fd, off_t offset, int whence);
/** \ingroup rpmio
* ftell(3) clone.
*/
off_t Ftell(FD_t fd);
/** \ingroup rpmio
* fclose(3) clone.
*/
int Fclose( FD_t fd);
/** \ingroup rpmio
*/
FD_t Fdopen(FD_t ofd, const char * fmode);
/** \ingroup rpmio
* fopen(3) clone.
*/
FD_t Fopen(const char * path,
const char * fmode);
/** \ingroup rpmio
* fflush(3) clone.
*/
int Fflush(FD_t fd);
/** \ingroup rpmio
* ferror(3) clone.
*/
int Ferror(FD_t fd);
/** \ingroup rpmio
* fileno(3) clone.
*/
int Fileno(FD_t fd);
/** \ingroup rpmio
* fcntl(2) clone.
*/
int Fcntl(FD_t fd, int op, void *lip);
/** \ingroup rpmio
* Get informative description (eg file name) from fd for diagnostic output.
*/
const char * Fdescr(FD_t fd);
/** \ingroup rpmio
* \name RPMIO Utilities.
*/
/** \ingroup rpmio
*/
off_t fdSize(FD_t fd);
/** \ingroup rpmio
*/
FD_t fdDup(int fdno);
/** \ingroup rpmio
*/
FD_t fdLink(FD_t fd);
/** \ingroup rpmio
*/
FD_t fdFree(FD_t fd);
/**
*/
off_t ufdCopy(FD_t sfd, FD_t tfd);
/** \ingroup rpmio
* Identify per-desciptor I/O operation statistics.
*/
typedef enum fdOpX_e {
FDSTAT_READ = 0, /*!< Read statistics index. */
FDSTAT_WRITE = 1, /*!< Write statistics index. */
FDSTAT_SEEK = 2, /*!< Seek statistics index. */
FDSTAT_CLOSE = 3, /*!< Close statistics index */
FDSTAT_DIGEST = 4, /*!< Digest statistics index. */
FDSTAT_MAX = 5
} fdOpX;
/** \ingroup rpmio
*
*/
rpmop fdOp(FD_t fd, fdOpX opx);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMIO */
PK vFZ`։�0 0 rpmsign.hnu �[��� #ifndef _RPMSIGN_H
#define _RPMSIGN_H
/** \file sign/rpmsign.h
*
* Signature API
*/
#include <rpm/argv.h>
#include <rpm/rpmpgp.h>
#ifdef __cplusplus
extern "C" {
#endif
struct rpmSignArgs {
char *keyid;
pgpHashAlgo hashalgo;
int signfiles;
/* ... what else? */
};
/** \ingroup rpmsign
* Sign a package
* @param path path to package
* @param args signing parameters (or NULL for defaults)
* @return 0 on success
*/
int rpmPkgSign(const char *path, const struct rpmSignArgs * args);
/** \ingroup rpmsign
* Delete signature(s) from a package
* @param path path to package
* @param args signing parameters (or NULL for defaults)
* @return 0 on success
*/
int rpmPkgDelSign(const char *path, const struct rpmSignArgs * args);
#ifdef __cplusplus
}
#endif
#endif /* _RPMSIGN_H */
PK vFZ�뭘p p rpmsw.hnu �[��� #ifndef H_RPMSW
#define H_RPMSW
/** \ingroup rpmio
* \file rpmio/rpmsw.h
*
* Statistics API
*/
#include <unistd.h>
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmsw
*/
typedef unsigned long int rpmtime_t;
/** \ingroup rpmsw
*/
typedef struct rpmsw_s * rpmsw;
/** \ingroup rpmsw
*/
typedef struct rpmop_s * rpmop;
/** \ingroup rpmsw
*/
struct rpmsw_s {
union {
struct timeval tv;
unsigned long long int ticks;
unsigned long int tocks[2];
} u;
};
/** \ingroup rpmsw
* Cumulative statistics for an operation.
*/
struct rpmop_s {
struct rpmsw_s begin; /*!< Starting time stamp. */
int count; /*!< Number of operations. */
size_t bytes; /*!< Number of bytes transferred. */
rpmtime_t usecs; /*!< Number of ticks. */
};
/** \ingroup rpmsw
* Return benchmark time stamp.
* @param *sw time stamp
* @return 0 on success
*/
rpmsw rpmswNow(rpmsw sw);
/** \ingroup rpmsw
* Return benchmark time stamp difference.
* @param *end end time stamp
* @param *begin begin time stamp
* @return difference in micro-seconds
*/
rpmtime_t rpmswDiff(rpmsw end, rpmsw begin);
/** \ingroup rpmsw
* Return benchmark time stamp overhead.
* @return overhead in micro-seconds
*/
rpmtime_t rpmswInit(void);
/** \ingroup rpmsw
* Enter timed operation.
* @param op operation statistics
* @param rc -1 clears usec counter
* @return 0 always
*/
int rpmswEnter(rpmop op, ssize_t rc);
/** \ingroup rpmsw
* Exit timed operation.
* @param op operation statistics
* @param rc per-operation data (e.g. bytes transferred)
* @return cumulative usecs for operation
*/
rpmtime_t rpmswExit(rpmop op, ssize_t rc);
/** \ingroup rpmsw
* Sum statistic counters.
* @param to result statistics
* @param from operation statistics
* @return cumulative usecs for operation
*/
rpmtime_t rpmswAdd(rpmop to, rpmop from);
/** \ingroup rpmsw
* Subtract statistic counters.
* @param to result statistics
* @param from operation statistics
* @return cumulative usecs for operation
*/
rpmtime_t rpmswSub(rpmop to, rpmop from);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMSW */
PK vFZR�;� � rpmarchive.hnu �[��� #ifndef H_ARCHIVE
#define H_ARCHIVE
/** \ingroup payload
* \file lib/rpmarchive.h
* File archive (aka payload) API.
*/
#define RPMERR_CHECK_ERRNO -32768
/** \ingroup payload
* Error codes for archive and file handling
*/
enum rpmfilesErrorCodes {
RPMERR_ITER_END = -1,
RPMERR_BAD_MAGIC = -2,
RPMERR_BAD_HEADER = -3,
RPMERR_HDR_SIZE = -4,
RPMERR_UNKNOWN_FILETYPE= -5,
RPMERR_MISSING_FILE = -6,
RPMERR_DIGEST_MISMATCH = -7,
RPMERR_INTERNAL = -8,
RPMERR_UNMAPPED_FILE = -9,
RPMERR_ENOENT = -10,
RPMERR_ENOTEMPTY = -11,
RPMERR_FILE_SIZE = -12,
RPMERR_ITER_SKIP = -13,
RPMERR_EXIST_AS_DIR = -14,
RPMERR_INVALID_SYMLINK = -15,
RPMERR_ENOTDIR = -16,
RPMERR_OPEN_FAILED = -32768,
RPMERR_CHMOD_FAILED = -32769,
RPMERR_CHOWN_FAILED = -32770,
RPMERR_WRITE_FAILED = -32771,
RPMERR_UTIME_FAILED = -32772,
RPMERR_UNLINK_FAILED = -32773,
RPMERR_RENAME_FAILED = -32774,
RPMERR_SYMLINK_FAILED = -32775,
RPMERR_STAT_FAILED = -32776,
RPMERR_LSTAT_FAILED = -32777,
RPMERR_MKDIR_FAILED = -32778,
RPMERR_RMDIR_FAILED = -32779,
RPMERR_MKNOD_FAILED = -32780,
RPMERR_MKFIFO_FAILED = -32781,
RPMERR_LINK_FAILED = -32782,
RPMERR_READLINK_FAILED = -32783,
RPMERR_READ_FAILED = -32784,
RPMERR_COPY_FAILED = -32785,
RPMERR_LSETFCON_FAILED = -32786,
RPMERR_SETCAP_FAILED = -32787,
RPMERR_CLOSE_FAILED = -32788,
};
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup payload
* Return formatted error message on payload handling failure.
* @param rc error code
* @return formatted error string (malloced)
*/
char * rpmfileStrerror(int rc);
/** \ingroup payload
* Get new file iterator for writing the archive content.
* The returned rpmfi will only visit the files needing some content.
* You need to provide the content using rpmfiArchiveWrite() or
* rpmfiArchiveWriteFile(). Make sure to close the rpmfi with
* rpmfiArchiveClose() to get the trailer written.
* rpmfiSetFX() is not supported for this type of iterator.
* @param fd file
* @param files file info
* @return new rpmfi
*/
rpmfi rpmfiNewArchiveWriter(FD_t fd, rpmfiles files);
/** \ingroup payload
* Get new file iterator for looping over the archive content.
* Returned rpmfi visites files in the order they are read from the payload.
* Content of the regular files can be retrieved with rpmfiArchiveRead() or
* rpmfiArchiveReadToFile() when they are visited with rpmfiNext().
* rpmfiSetFX() is not supported for this type of iterator.
* @param fd file
* @param files file info
* @param itype how to handle hard links. See rpmFileIter.
* @return new rpmfi
*/
rpmfi rpmfiNewArchiveReader(FD_t fd, rpmfiles files, int itype);
/** \ingroup payload
* Close payload archive
* @param fi file info
* @return > 0 on error
*/
int rpmfiArchiveClose(rpmfi fi);
/** \ingroup payload
* Return current position in payload archive
* @param fi file info
* @return position
*/
rpm_loff_t rpmfiArchiveTell(rpmfi fi);
/** \ingroup payload
* Write content into current file in archive
* @param fi file info
* @param buf pointer to content
* @param size number of bytes to write
* @return bytes actually written
*/
size_t rpmfiArchiveWrite(rpmfi fi, const void * buf, size_t size);
/** \ingroup payload
* Write content from given file into current file in archive
* @param fi file info
* @param fd file descriptor of file to read
* @return > 0 on error
*/
int rpmfiArchiveWriteFile(rpmfi fi, FD_t fd);
/** \ingroup payload
* Read content from current file in archive
* @param fi file info
* @param buf pointer to buffer
* @param size number of bytes to read
* @return bytes actually read
*/
size_t rpmfiArchiveRead(rpmfi fi, void * buf, size_t size);
/** \ingroup payload
* Has current file content stored in the archive
* @param fi file info
* @ return 1 for regular files but 0 for hardlinks without content
*/
int rpmfiArchiveHasContent(rpmfi fi);
/** \ingroup payload
* Write content from current file in archive to a file
* @param fi file info
* @param fd file descriptor of file to write to
* @param nodigest omit checksum check if 1
* @return > 0 on error
*/
int rpmfiArchiveReadToFile(rpmfi fi, FD_t fd, int nodigest);
#ifdef __cplusplus
}
#endif
#endif /* H_ARCHIVE */
PK vFZ�2��� � rpmspec.hnu �[��� #ifndef _H_SPEC_
#define _H_SPEC_
/** \ingroup rpmbuild
* \file build/rpmspec.h
* The rpmSpec and Package data structures used during build.
*/
#include <rpm/rpmstring.h> /* StringBuf */
#include <rpm/rpmcli.h> /* for QVA_t */
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmbuild
*/
typedef struct Package_s * rpmSpecPkg;
typedef struct Source * rpmSpecSrc;
typedef struct rpmSpecIter_s * rpmSpecPkgIter;
typedef struct rpmSpecIter_s * rpmSpecSrcIter;
enum rpmSourceFlags_e {
RPMBUILD_ISSOURCE = (1 << 0),
RPMBUILD_ISPATCH = (1 << 1),
RPMBUILD_ISICON = (1 << 2),
RPMBUILD_ISNO = (1 << 3),
};
typedef rpmFlags rpmSourceFlags;
#define RPMBUILD_DEFAULT_LANG "C"
enum rpmSpecFlags_e {
RPMSPEC_NONE = 0,
RPMSPEC_ANYARCH = (1 << 0),
RPMSPEC_FORCE = (1 << 1),
RPMSPEC_NOLANG = (1 << 2),
RPMSPEC_NOUTF8 = (1 << 3),
};
typedef rpmFlags rpmSpecFlags;
/** \ingroup rpmbuild
* Destroy Spec structure.
* @param spec spec file control structure
* @return NULL always
*/
rpmSpec rpmSpecFree(rpmSpec spec);
/* Iterator for spec packages */
rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec);
rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter);
rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter);
/* Getters for spec package attributes */
Header rpmSpecPkgHeader(rpmSpecPkg pkg);
/*
* Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST,
* RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string.
*/
char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section);
/* Iterator for spec sources */
rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec);
rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter);
rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter);
/* Getters for spec source attributes */
rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src);
int rpmSpecSrcNum(rpmSpecSrc src);
const char * rpmSpecSrcFilename(rpmSpecSrc src, int full);
/*
* Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc).
* As a special case, RPMBUILD_NONE as section returns the entire spec in
* preprocessed (macros expanded etc) format.
*/
const char * rpmSpecGetSection(rpmSpec spec, int section);
/** \ingroup rpmbuild
* Function to query spec file(s).
* @param ts transaction set
* @param qva parsed query/verify options
* @param arg query argument
* @return 0 on success, else no. of failures
*/
int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
#ifdef __cplusplus
}
#endif
#endif /* _H_SPEC_ */
PK vFZj���h h rpmdb.hnu �[��� #ifndef H_RPMDB
#define H_RPMDB
/** \ingroup rpmdb dbi
* \file lib/rpmdb.h
* RPM database API.
*/
#include <rpm/rpmtypes.h>
#include <rpm/rpmsw.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Tag value pattern match mode.
*/
typedef enum rpmMireMode_e {
RPMMIRE_DEFAULT = 0, /*!< regex with \., .* and ^...$ added */
RPMMIRE_STRCMP = 1, /*!< strings using strcmp(3) */
RPMMIRE_REGEX = 2, /*!< regex(7) patterns through regcomp(3) */
RPMMIRE_GLOB = 3 /*!< glob(7) patterns through fnmatch(3) */
} rpmMireMode;
typedef enum rpmdbOpX_e {
RPMDB_OP_DBGET = 1,
RPMDB_OP_DBPUT = 2,
RPMDB_OP_DBDEL = 3,
RPMDB_OP_MAX = 4
} rpmdbOpX;
typedef enum rpmdbCtrlOp_e {
RPMDB_CTRL_LOCK_RO = 1,
RPMDB_CTRL_UNLOCK_RO = 2,
RPMDB_CTRL_LOCK_RW = 3,
RPMDB_CTRL_UNLOCK_RW = 4,
RPMDB_CTRL_INDEXSYNC = 5
} rpmdbCtrlOp;
/** \ingroup rpmdb
* Retrieve operation timestamp from rpm database.
* @param db rpm database
* @param opx operation timestamp index
* @return pointer to operation timestamp.
*/
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
/** \ingroup rpmdb
* Open all database indices.
* @param db rpm database
* @return 0 on success
*/
int rpmdbOpenAll (rpmdb db);
/** \ingroup rpmdb
* Return number of instances of package in rpm database.
* @param db rpm database
* @param name rpm package name
* @return number of instances
*/
int rpmdbCountPackages(rpmdb db, const char * name);
/** \ingroup rpmdb
* Return header join key for current position of rpm database iterator.
* @param mi rpm database iterator
* @return current header join key
*/
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi);
/** \ingroup rpmdb
* Return number of elements in rpm database iterator.
* @param mi rpm database iterator
* @return number of elements
*/
int rpmdbGetIteratorCount(rpmdbMatchIterator mi);
/** \ingroup rpmdb
*/
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
/** \ingroup rpmdb
* Append items to set of package instances to iterate.
* @param mi rpm database iterator
* @param hdrNums array of package instances
* @param nHdrNums number of elements in array
* @return 0 on success, 1 on failure (bad args)
*/
int rpmdbAppendIterator(rpmdbMatchIterator mi,
const unsigned int * hdrNums, unsigned int nHdrNums);
/** \ingroup rpmdb
* Add pattern to iterator selector.
* @param mi rpm database iterator
* @param tag rpm tag
* @param mode type of pattern match
* @param pattern pattern to match
* @return 0 on success
*/
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag,
rpmMireMode mode, const char * pattern);
/** \ingroup rpmdb
* Prepare iterator for lazy writes.
* @note Must be called before rpmdbNextIterator() with CDB model database.
* @param mi rpm database iterator
* @param rewrite new value of rewrite
* @return previous value
*/
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite);
/** \ingroup rpmdb
* Modify iterator to mark header for lazy write on release.
* @param mi rpm database iterator
* @param modified new value of modified
* @return previous value
*/
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
/** \ingroup rpmdb
* Modify iterator to verify retrieved header blobs.
* @param mi rpm database iterator
* @param ts transaction set
* @param (*hdrchk) headerCheck() vector
* @return 0 always
*/
int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts,
rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
/** \ingroup rpmdb
* Return database iterator.
* @param db rpm database
* @param rpmtag database index tag
* @param keyp key data (NULL for sequential access)
* @param keylen key data length (0 will use strlen(keyp))
* @return NULL on failure
*/
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen);
/** \ingroup rpmdb
* Return next package header from iteration.
* @param mi rpm database iterator
* @return NULL on end of iteration.
*/
Header rpmdbNextIterator(rpmdbMatchIterator mi);
/** \ingroup rpmdb
* Destroy rpm database iterator.
* @param mi rpm database iterator
* @return NULL always
*/
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
/** \ingroup rpmdb
* Get an iterator for an index
* @param db rpm database
* @param rpmtag the index to iterate over
* @return the index iterator
*/
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
/** \ingroup rpmdb
* Get the next key - Warning! Keys are not zero terminated!
* Binary tags may even contain zero bytes
* @param ii index iterator
* @param key address to save the pointer to the key
* @param keylen address to save the length of the key to
* @return 0 on success; != 0 on error or end of index
*/
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
/** \ingroup rpmdb
* Get the next key into a tag data container.
* Caller is responsible for calling rpmtdFreeData() to freeing the
* data returned in keytd once done with it.
* @param ii index iterator
* @param keytd tag container to store the key in
* @return 0 on success; != 0 on error or end of index
*/
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd);
/** \ingroup rpmdb
* Get number of entries for current key
* @param ii index iterator
* @return number of entries. 0 on error.
*/
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii);
/** \ingroup rpmdb
* Get package offset of entry
* @param ii index iterator
* @param nr number of the entry
* @return db offset of pkg
*/
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
/** \ingroup rpmdb
* Get tag number of entry
* @param ii index iterator
* @param nr number of the entry
* @return number of tag within the package
*/
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
/** \ingroup rpmdb
* Free index iterator
* @param ii index iterator
* return NULL
*/
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
/** \ingroup rpmdb
* manipulate the rpm database
* @param db rpm database
* @param ctrl operation
* @return 0 on success; != 0 on error
*/
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMDB */
PK vFZ�o@[� � rpmurl.hnu �[��� #ifndef H_RPMURL
#define H_RPMURL
/** \ingroup rpmio
* \file rpmio/rpmurl.h
*
* A couple utils for URL Manipulation
*/
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmurl
* Supported URL types.
*/
typedef enum urltype_e {
URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */
URL_IS_DASH = 1, /*!< stdin/stdout */
URL_IS_PATH = 2, /*!< file://... */
URL_IS_FTP = 3, /*!< ftp://... */
URL_IS_HTTP = 4, /*!< http://... */
URL_IS_HTTPS = 5, /*!< https://... */
URL_IS_HKP = 6 /*!< hkp://... */
} urltype;
/** \ingroup rpmurl
* Return type of URL.
* @param url url string
* @return type of url
*/
urltype urlIsURL(const char * url);
/** \ingroup rpmurl
* Return path component of URL.
* @param url url string
* @retval pathp pointer to path component of url
* @return type of url
*/
urltype urlPath(const char * url, const char ** pathp);
/** \ingroup rpmurl
* Copy data from URL to local file.
* @param url url string of source
* @param dest file name of destination
* @return 0 on success, -1 on error
*/
int urlGetFile(const char * url, const char * dest);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMURL */
PK vFZd/,W� � rpmfc.hnu �[��� #ifndef _H_RPMFC_
#define _H_RPMFC_
/** \ingroup rpmfc rpmbuild
* \file build/rpmfc.h
* Structures and methods for build-time file classification.
*/
#include <rpm/rpmtypes.h>
#include <rpm/argv.h> /* for ARGV_t */
#include <rpm/rpmspec.h> /* for Package */
#ifdef __cplusplus
extern "C" {
#endif
extern int _rpmfc_debug;
/** \ingroup rpmfc
*/
typedef struct rpmfc_s * rpmfc;
/** \ingroup rpmfc
*/
enum FCOLOR_e {
RPMFC_BLACK = 0,
RPMFC_ELF32 = (1 << 0),
RPMFC_ELF64 = (1 << 1),
RPMFC_ELFMIPSN32 = (1 << 2),
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
/* (1 << 3) leaks into package headers, reserved */
RPMFC_WHITE = (1 << 29),
RPMFC_INCLUDE = (1 << 30),
RPMFC_ERROR = (1 << 31)
};
/** \ingroup rpmfc
*/
typedef rpmFlags FCOLOR_t;
/** \ingroup rpmfc
*/
typedef const struct rpmfcTokens_s * rpmfcToken;
/** \ingroup rpmfc
* Print results of file classification.
* @param msg message prefix (NULL for none)
* @param fc file classifier
* @param fp output file handle (NULL for stderr)
*/
void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp);
/** \ingroup rpmfc
* Destroy a file classifier.
* @param fc file classifier
* @return NULL always
*/
rpmfc rpmfcFree(rpmfc fc);
/** \ingroup rpmfc
* Create a file classifier.
* @param rootDir (build) root directory
* @param flags (unused)
* @return new file classifier
*/
rpmfc rpmfcCreate(const char *rootDir, rpmFlags flags);
/** \ingroup rpmfc
* @deprecated
* Create a file classifier.
* @return new file classifier
*/
RPM_GNUC_DEPRECATED
rpmfc rpmfcNew(void);
/** \ingroup rpmfc
* Build file class dictionary and mappings.
* @param fc file classifier
* @param argv files to classify
* @param fmode files mode_t array (or NULL)
* @return RPMRC_OK on success
*/
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode);
/** \ingroup rpmfc
* Build file/package dependency dictionary and mappings.
* @param fc file classifier
* @return RPMRC_OK on success
*/
rpmRC rpmfcApply(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification provides
* @param fc file classifier
* @return rpmds dependency set of fc provides
*/
rpmds rpmfcProvides(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification requires
* @param fc file classifier
* @return rpmds dependency set of fc requires
*/
rpmds rpmfcRequires(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification recommends
* @param fc file classifier
* @return rpmds dependency set of fc recommends
*/
rpmds rpmfcRecommends(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification suggests
* @param fc file classifier
* @return rpmds dependency set of fc suggests
*/
rpmds rpmfcSuggests(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification supplements
* @param fc file classifier
* @return rpmds dependency set of fc supplements
*/
rpmds rpmfcSupplements(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification enhances
* @param fc file classifier
* @return rpmds dependency set of fc enhances
*/
rpmds rpmfcEnhances(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification conflicts
* @param fc file classifier
* @return rpmds dependency set of fc conflicts
*/
rpmds rpmfcConflicts(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification obsoletes
* @param fc file classifier
* @return rpmds dependency set of fc obsoletes
*/
rpmds rpmfcObsoletes(rpmfc fc);
/** \ingroup rpmfc
* Retrieve file classification dependencies
* @param fc file classifier
* @param tagN name tag of the wanted dependency
* @return rpmds dependency set of fc requires
*/
rpmds rpmfcDependencies(rpmfc fc, rpmTagVal tagN);
#ifdef __cplusplus
}
#endif
#endif /* _H_RPMFC_ */
PK vFZw~'�GZ GZ rpmtag.hnu �[��� #ifndef _RPMTAG_H
#define _RPMTAG_H
/** \ingroup rpmtag
* \file lib/rpmtag.h
*
* Accessing RPM tags: values, types, ...
*/
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Header private tags.
* @note General use tags should start at 1000 (RPM's tag space starts there).
*/
#define HEADER_IMAGE 61
#define HEADER_SIGNATURES 62
#define HEADER_IMMUTABLE 63
#define HEADER_REGIONS 64
#define HEADER_I18NTABLE 100
#define HEADER_SIGBASE 256
#define HEADER_TAGBASE 1000
/** \ingroup rpmtag
* Tags identify data in package headers.
* @note tags should not have value 0!
* @note all new tags should be added above 5000
*/
/** @todo: Somehow supply type **/
typedef enum rpmTag_e {
RPMTAG_NOT_FOUND = -1, /*!< Unknown tag */
RPMTAG_HEADERIMAGE = HEADER_IMAGE, /*!< Current image. */
RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES, /*!< Signatures. */
RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE, /*!< Original image. */
RPMTAG_HEADERREGIONS = HEADER_REGIONS, /*!< Regions. */
RPMTAG_HEADERI18NTABLE = HEADER_I18NTABLE, /* s[] !< I18N string locales. */
/* Retrofit (and uniqify) signature tags for use by rpmTagGetName() and rpmQuery. */
/* the md5 sum was broken *twice* on big endian machines */
/* XXX 2nd underscore prevents tagTable generation */
RPMTAG_SIG_BASE = HEADER_SIGBASE,
RPMTAG_SIGSIZE = RPMTAG_SIG_BASE+1, /* i */
RPMTAG_SIGLEMD5_1 = RPMTAG_SIG_BASE+2, /* internal - obsolete */
RPMTAG_SIGPGP = RPMTAG_SIG_BASE+3, /* x */
RPMTAG_SIGLEMD5_2 = RPMTAG_SIG_BASE+4, /* x internal - obsolete */
RPMTAG_SIGMD5 = RPMTAG_SIG_BASE+5, /* x */
#define RPMTAG_PKGID RPMTAG_SIGMD5 /* x */
RPMTAG_SIGGPG = RPMTAG_SIG_BASE+6, /* x */
RPMTAG_SIGPGP5 = RPMTAG_SIG_BASE+7, /* internal - obsolete */
RPMTAG_BADSHA1_1 = RPMTAG_SIG_BASE+8, /* internal - obsolete */
RPMTAG_BADSHA1_2 = RPMTAG_SIG_BASE+9, /* internal - obsolete */
RPMTAG_PUBKEYS = RPMTAG_SIG_BASE+10, /* s[] */
RPMTAG_DSAHEADER = RPMTAG_SIG_BASE+11, /* x */
RPMTAG_RSAHEADER = RPMTAG_SIG_BASE+12, /* x */
RPMTAG_SHA1HEADER = RPMTAG_SIG_BASE+13, /* s */
#define RPMTAG_HDRID RPMTAG_SHA1HEADER /* s */
RPMTAG_LONGSIGSIZE = RPMTAG_SIG_BASE+14, /* l */
RPMTAG_LONGARCHIVESIZE = RPMTAG_SIG_BASE+15, /* l */
/* RPMTAG_SIG_BASE+16 reserved */
RPMTAG_SHA256HEADER = RPMTAG_SIG_BASE+17, /* s */
RPMTAG_NAME = 1000, /* s */
#define RPMTAG_N RPMTAG_NAME /* s */
RPMTAG_VERSION = 1001, /* s */
#define RPMTAG_V RPMTAG_VERSION /* s */
RPMTAG_RELEASE = 1002, /* s */
#define RPMTAG_R RPMTAG_RELEASE /* s */
RPMTAG_EPOCH = 1003, /* i */
#define RPMTAG_E RPMTAG_EPOCH /* i */
RPMTAG_SUMMARY = 1004, /* s{} */
RPMTAG_DESCRIPTION = 1005, /* s{} */
RPMTAG_BUILDTIME = 1006, /* i */
RPMTAG_BUILDHOST = 1007, /* s */
RPMTAG_INSTALLTIME = 1008, /* i */
RPMTAG_SIZE = 1009, /* i */
RPMTAG_DISTRIBUTION = 1010, /* s */
RPMTAG_VENDOR = 1011, /* s */
RPMTAG_GIF = 1012, /* x */
RPMTAG_XPM = 1013, /* x */
RPMTAG_LICENSE = 1014, /* s */
RPMTAG_PACKAGER = 1015, /* s */
RPMTAG_GROUP = 1016, /* s{} */
RPMTAG_CHANGELOG = 1017, /* s[] internal */
RPMTAG_SOURCE = 1018, /* s[] */
RPMTAG_PATCH = 1019, /* s[] */
RPMTAG_URL = 1020, /* s */
RPMTAG_OS = 1021, /* s legacy used int */
RPMTAG_ARCH = 1022, /* s legacy used int */
RPMTAG_PREIN = 1023, /* s */
RPMTAG_POSTIN = 1024, /* s */
RPMTAG_PREUN = 1025, /* s */
RPMTAG_POSTUN = 1026, /* s */
RPMTAG_OLDFILENAMES = 1027, /* s[] obsolete */
RPMTAG_FILESIZES = 1028, /* i[] */
RPMTAG_FILESTATES = 1029, /* c[] */
RPMTAG_FILEMODES = 1030, /* h[] */
RPMTAG_FILEUIDS = 1031, /* i[] internal - obsolete */
RPMTAG_FILEGIDS = 1032, /* i[] internal - obsolete */
RPMTAG_FILERDEVS = 1033, /* h[] */
RPMTAG_FILEMTIMES = 1034, /* i[] */
RPMTAG_FILEDIGESTS = 1035, /* s[] */
#define RPMTAG_FILEMD5S RPMTAG_FILEDIGESTS /* s[] */
RPMTAG_FILELINKTOS = 1036, /* s[] */
RPMTAG_FILEFLAGS = 1037, /* i[] */
RPMTAG_ROOT = 1038, /* internal - obsolete */
RPMTAG_FILEUSERNAME = 1039, /* s[] */
RPMTAG_FILEGROUPNAME = 1040, /* s[] */
RPMTAG_EXCLUDE = 1041, /* internal - obsolete */
RPMTAG_EXCLUSIVE = 1042, /* internal - obsolete */
RPMTAG_ICON = 1043, /* x */
RPMTAG_SOURCERPM = 1044, /* s */
RPMTAG_FILEVERIFYFLAGS = 1045, /* i[] */
RPMTAG_ARCHIVESIZE = 1046, /* i */
RPMTAG_PROVIDENAME = 1047, /* s[] */
#define RPMTAG_PROVIDES RPMTAG_PROVIDENAME /* s[] */
#define RPMTAG_P RPMTAG_PROVIDENAME /* s[] */
RPMTAG_REQUIREFLAGS = 1048, /* i[] */
RPMTAG_REQUIRENAME = 1049, /* s[] */
#define RPMTAG_REQUIRES RPMTAG_REQUIRENAME /* s[] */
RPMTAG_REQUIREVERSION = 1050, /* s[] */
RPMTAG_NOSOURCE = 1051, /* i[] */
RPMTAG_NOPATCH = 1052, /* i[] */
RPMTAG_CONFLICTFLAGS = 1053, /* i[] */
RPMTAG_CONFLICTNAME = 1054, /* s[] */
#define RPMTAG_CONFLICTS RPMTAG_CONFLICTNAME /* s[] */
#define RPMTAG_C RPMTAG_CONFLICTNAME /* s[] */
RPMTAG_CONFLICTVERSION = 1055, /* s[] */
RPMTAG_DEFAULTPREFIX = 1056, /* s internal - deprecated */
RPMTAG_BUILDROOT = 1057, /* s internal - obsolete */
RPMTAG_INSTALLPREFIX = 1058, /* s internal - deprecated */
RPMTAG_EXCLUDEARCH = 1059, /* s[] */
RPMTAG_EXCLUDEOS = 1060, /* s[] */
RPMTAG_EXCLUSIVEARCH = 1061, /* s[] */
RPMTAG_EXCLUSIVEOS = 1062, /* s[] */
RPMTAG_AUTOREQPROV = 1063, /* s internal */
RPMTAG_RPMVERSION = 1064, /* s */
RPMTAG_TRIGGERSCRIPTS = 1065, /* s[] */
RPMTAG_TRIGGERNAME = 1066, /* s[] */
RPMTAG_TRIGGERVERSION = 1067, /* s[] */
RPMTAG_TRIGGERFLAGS = 1068, /* i[] */
RPMTAG_TRIGGERINDEX = 1069, /* i[] */
RPMTAG_VERIFYSCRIPT = 1079, /* s */
RPMTAG_CHANGELOGTIME = 1080, /* i[] */
RPMTAG_CHANGELOGNAME = 1081, /* s[] */
RPMTAG_CHANGELOGTEXT = 1082, /* s[] */
RPMTAG_BROKENMD5 = 1083, /* internal - obsolete */
RPMTAG_PREREQ = 1084, /* internal */
RPMTAG_PREINPROG = 1085, /* s[] */
RPMTAG_POSTINPROG = 1086, /* s[] */
RPMTAG_PREUNPROG = 1087, /* s[] */
RPMTAG_POSTUNPROG = 1088, /* s[] */
RPMTAG_BUILDARCHS = 1089, /* s[] */
RPMTAG_OBSOLETENAME = 1090, /* s[] */
#define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME /* s[] */
#define RPMTAG_O RPMTAG_OBSOLETENAME /* s[] */
RPMTAG_VERIFYSCRIPTPROG = 1091, /* s[] */
RPMTAG_TRIGGERSCRIPTPROG = 1092, /* s[] */
RPMTAG_DOCDIR = 1093, /* internal */
RPMTAG_COOKIE = 1094, /* s */
RPMTAG_FILEDEVICES = 1095, /* i[] */
RPMTAG_FILEINODES = 1096, /* i[] */
RPMTAG_FILELANGS = 1097, /* s[] */
RPMTAG_PREFIXES = 1098, /* s[] */
RPMTAG_INSTPREFIXES = 1099, /* s[] */
RPMTAG_TRIGGERIN = 1100, /* internal */
RPMTAG_TRIGGERUN = 1101, /* internal */
RPMTAG_TRIGGERPOSTUN = 1102, /* internal */
RPMTAG_AUTOREQ = 1103, /* internal */
RPMTAG_AUTOPROV = 1104, /* internal */
RPMTAG_CAPABILITY = 1105, /* i internal - obsolete */
RPMTAG_SOURCEPACKAGE = 1106, /* i */
RPMTAG_OLDORIGFILENAMES = 1107, /* internal - obsolete */
RPMTAG_BUILDPREREQ = 1108, /* internal */
RPMTAG_BUILDREQUIRES = 1109, /* internal */
RPMTAG_BUILDCONFLICTS = 1110, /* internal */
RPMTAG_BUILDMACROS = 1111, /* internal - unused */
RPMTAG_PROVIDEFLAGS = 1112, /* i[] */
RPMTAG_PROVIDEVERSION = 1113, /* s[] */
RPMTAG_OBSOLETEFLAGS = 1114, /* i[] */
RPMTAG_OBSOLETEVERSION = 1115, /* s[] */
RPMTAG_DIRINDEXES = 1116, /* i[] */
RPMTAG_BASENAMES = 1117, /* s[] */
RPMTAG_DIRNAMES = 1118, /* s[] */
RPMTAG_ORIGDIRINDEXES = 1119, /* i[] relocation */
RPMTAG_ORIGBASENAMES = 1120, /* s[] relocation */
RPMTAG_ORIGDIRNAMES = 1121, /* s[] relocation */
RPMTAG_OPTFLAGS = 1122, /* s */
RPMTAG_DISTURL = 1123, /* s */
RPMTAG_PAYLOADFORMAT = 1124, /* s */
RPMTAG_PAYLOADCOMPRESSOR = 1125, /* s */
RPMTAG_PAYLOADFLAGS = 1126, /* s */
RPMTAG_INSTALLCOLOR = 1127, /* i transaction color when installed */
RPMTAG_INSTALLTID = 1128, /* i */
RPMTAG_REMOVETID = 1129, /* i */
RPMTAG_SHA1RHN = 1130, /* internal - obsolete */
RPMTAG_RHNPLATFORM = 1131, /* s internal - obsolete */
RPMTAG_PLATFORM = 1132, /* s */
RPMTAG_PATCHESNAME = 1133, /* s[] deprecated placeholder (SuSE) */
RPMTAG_PATCHESFLAGS = 1134, /* i[] deprecated placeholder (SuSE) */
RPMTAG_PATCHESVERSION = 1135, /* s[] deprecated placeholder (SuSE) */
RPMTAG_CACHECTIME = 1136, /* i internal - obsolete */
RPMTAG_CACHEPKGPATH = 1137, /* s internal - obsolete */
RPMTAG_CACHEPKGSIZE = 1138, /* i internal - obsolete */
RPMTAG_CACHEPKGMTIME = 1139, /* i internal - obsolete */
RPMTAG_FILECOLORS = 1140, /* i[] */
RPMTAG_FILECLASS = 1141, /* i[] */
RPMTAG_CLASSDICT = 1142, /* s[] */
RPMTAG_FILEDEPENDSX = 1143, /* i[] */
RPMTAG_FILEDEPENDSN = 1144, /* i[] */
RPMTAG_DEPENDSDICT = 1145, /* i[] */
RPMTAG_SOURCEPKGID = 1146, /* x */
RPMTAG_FILECONTEXTS = 1147, /* s[] - obsolete */
RPMTAG_FSCONTEXTS = 1148, /* s[] extension */
RPMTAG_RECONTEXTS = 1149, /* s[] extension */
RPMTAG_POLICIES = 1150, /* s[] selinux *.te policy file. */
RPMTAG_PRETRANS = 1151, /* s */
RPMTAG_POSTTRANS = 1152, /* s */
RPMTAG_PRETRANSPROG = 1153, /* s[] */
RPMTAG_POSTTRANSPROG = 1154, /* s[] */
RPMTAG_DISTTAG = 1155, /* s */
RPMTAG_OLDSUGGESTSNAME = 1156, /* s[] - obsolete */
#define RPMTAG_OLDSUGGESTS RPMTAG_OLDSUGGESTSNAME /* s[] - obsolete */
RPMTAG_OLDSUGGESTSVERSION = 1157, /* s[] - obsolete */
RPMTAG_OLDSUGGESTSFLAGS = 1158, /* i[] - obsolete */
RPMTAG_OLDENHANCESNAME = 1159, /* s[] - obsolete */
#define RPMTAG_OLDENHANCES RPMTAG_OLDENHANCESNAME /* s[] - obsolete */
RPMTAG_OLDENHANCESVERSION = 1160, /* s[] - obsolete */
RPMTAG_OLDENHANCESFLAGS = 1161, /* i[] - obsolete */
RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */
RPMTAG_CVSID = 1163, /* s (unimplemented) */
#define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */
RPMTAG_BLINKPKGID = 1164, /* s[] (unimplemented) */
RPMTAG_BLINKHDRID = 1165, /* s[] (unimplemented) */
RPMTAG_BLINKNEVRA = 1166, /* s[] (unimplemented) */
RPMTAG_FLINKPKGID = 1167, /* s[] (unimplemented) */
RPMTAG_FLINKHDRID = 1168, /* s[] (unimplemented) */
RPMTAG_FLINKNEVRA = 1169, /* s[] (unimplemented) */
RPMTAG_PACKAGEORIGIN = 1170, /* s (unimplemented) */
RPMTAG_TRIGGERPREIN = 1171, /* internal */
RPMTAG_BUILDSUGGESTS = 1172, /* internal (unimplemented) */
RPMTAG_BUILDENHANCES = 1173, /* internal (unimplemented) */
RPMTAG_SCRIPTSTATES = 1174, /* i[] scriptlet exit codes (unimplemented) */
RPMTAG_SCRIPTMETRICS = 1175, /* i[] scriptlet execution times (unimplemented) */
RPMTAG_BUILDCPUCLOCK = 1176, /* i (unimplemented) */
RPMTAG_FILEDIGESTALGOS = 1177, /* i[] (unimplemented) */
RPMTAG_VARIANTS = 1178, /* s[] (unimplemented) */
RPMTAG_XMAJOR = 1179, /* i (unimplemented) */
RPMTAG_XMINOR = 1180, /* i (unimplemented) */
RPMTAG_REPOTAG = 1181, /* s (unimplemented) */
RPMTAG_KEYWORDS = 1182, /* s[] (unimplemented) */
RPMTAG_BUILDPLATFORMS = 1183, /* s[] (unimplemented) */
RPMTAG_PACKAGECOLOR = 1184, /* i (unimplemented) */
RPMTAG_PACKAGEPREFCOLOR = 1185, /* i (unimplemented) */
RPMTAG_XATTRSDICT = 1186, /* s[] (unimplemented) */
RPMTAG_FILEXATTRSX = 1187, /* i[] (unimplemented) */
RPMTAG_DEPATTRSDICT = 1188, /* s[] (unimplemented) */
RPMTAG_CONFLICTATTRSX = 1189, /* i[] (unimplemented) */
RPMTAG_OBSOLETEATTRSX = 1190, /* i[] (unimplemented) */
RPMTAG_PROVIDEATTRSX = 1191, /* i[] (unimplemented) */
RPMTAG_REQUIREATTRSX = 1192, /* i[] (unimplemented) */
RPMTAG_BUILDPROVIDES = 1193, /* internal (unimplemented) */
RPMTAG_BUILDOBSOLETES = 1194, /* internal (unimplemented) */
RPMTAG_DBINSTANCE = 1195, /* i extension */
RPMTAG_NVRA = 1196, /* s extension */
/* tags 1997-4999 reserved */
RPMTAG_FILENAMES = 5000, /* s[] extension */
RPMTAG_FILEPROVIDE = 5001, /* s[] extension */
RPMTAG_FILEREQUIRE = 5002, /* s[] extension */
RPMTAG_FSNAMES = 5003, /* s[] (unimplemented) */
RPMTAG_FSSIZES = 5004, /* l[] (unimplemented) */
RPMTAG_TRIGGERCONDS = 5005, /* s[] extension */
RPMTAG_TRIGGERTYPE = 5006, /* s[] extension */
RPMTAG_ORIGFILENAMES = 5007, /* s[] extension */
RPMTAG_LONGFILESIZES = 5008, /* l[] */
RPMTAG_LONGSIZE = 5009, /* l */
RPMTAG_FILECAPS = 5010, /* s[] */
RPMTAG_FILEDIGESTALGO = 5011, /* i file digest algorithm */
RPMTAG_BUGURL = 5012, /* s */
RPMTAG_EVR = 5013, /* s extension */
RPMTAG_NVR = 5014, /* s extension */
RPMTAG_NEVR = 5015, /* s extension */
RPMTAG_NEVRA = 5016, /* s extension */
RPMTAG_HEADERCOLOR = 5017, /* i extension */
RPMTAG_VERBOSE = 5018, /* i extension */
RPMTAG_EPOCHNUM = 5019, /* i extension */
RPMTAG_PREINFLAGS = 5020, /* i */
RPMTAG_POSTINFLAGS = 5021, /* i */
RPMTAG_PREUNFLAGS = 5022, /* i */
RPMTAG_POSTUNFLAGS = 5023, /* i */
RPMTAG_PRETRANSFLAGS = 5024, /* i */
RPMTAG_POSTTRANSFLAGS = 5025, /* i */
RPMTAG_VERIFYSCRIPTFLAGS = 5026, /* i */
RPMTAG_TRIGGERSCRIPTFLAGS = 5027, /* i[] */
RPMTAG_COLLECTIONS = 5029, /* s[] list of collections (unimplemented) */
RPMTAG_POLICYNAMES = 5030, /* s[] */
RPMTAG_POLICYTYPES = 5031, /* s[] */
RPMTAG_POLICYTYPESINDEXES = 5032, /* i[] */
RPMTAG_POLICYFLAGS = 5033, /* i[] */
RPMTAG_VCS = 5034, /* s */
RPMTAG_ORDERNAME = 5035, /* s[] */
RPMTAG_ORDERVERSION = 5036, /* s[] */
RPMTAG_ORDERFLAGS = 5037, /* i[] */
RPMTAG_MSSFMANIFEST = 5038, /* s[] reservation (unimplemented) */
RPMTAG_MSSFDOMAIN = 5039, /* s[] reservation (unimplemented) */
RPMTAG_INSTFILENAMES = 5040, /* s[] extension */
RPMTAG_REQUIRENEVRS = 5041, /* s[] extension */
RPMTAG_PROVIDENEVRS = 5042, /* s[] extension */
RPMTAG_OBSOLETENEVRS = 5043, /* s[] extension */
RPMTAG_CONFLICTNEVRS = 5044, /* s[] extension */
RPMTAG_FILENLINKS = 5045, /* i[] extension */
RPMTAG_RECOMMENDNAME = 5046, /* s[] */
#define RPMTAG_RECOMMENDS RPMTAG_RECOMMENDNAME /* s[] */
RPMTAG_RECOMMENDVERSION = 5047, /* s[] */
RPMTAG_RECOMMENDFLAGS = 5048, /* i[] */
RPMTAG_SUGGESTNAME = 5049, /* s[] */
#define RPMTAG_SUGGESTS RPMTAG_SUGGESTNAME /* s[] */
RPMTAG_SUGGESTVERSION = 5050, /* s[] extension */
RPMTAG_SUGGESTFLAGS = 5051, /* i[] extension */
RPMTAG_SUPPLEMENTNAME = 5052, /* s[] */
#define RPMTAG_SUPPLEMENTS RPMTAG_SUPPLEMENTNAME /* s[] */
RPMTAG_SUPPLEMENTVERSION = 5053, /* s[] */
RPMTAG_SUPPLEMENTFLAGS = 5054, /* i[] */
RPMTAG_ENHANCENAME = 5055, /* s[] */
#define RPMTAG_ENHANCES RPMTAG_ENHANCENAME /* s[] */
RPMTAG_ENHANCEVERSION = 5056, /* s[] */
RPMTAG_ENHANCEFLAGS = 5057, /* i[] */
RPMTAG_RECOMMENDNEVRS = 5058, /* s[] extension */
RPMTAG_SUGGESTNEVRS = 5059, /* s[] extension */
RPMTAG_SUPPLEMENTNEVRS = 5060, /* s[] extension */
RPMTAG_ENHANCENEVRS = 5061, /* s[] extension */
RPMTAG_ENCODING = 5062, /* s */
RPMTAG_FILETRIGGERIN = 5063, /* internal */
RPMTAG_FILETRIGGERUN = 5064, /* internal */
RPMTAG_FILETRIGGERPOSTUN = 5065, /* internal */
RPMTAG_FILETRIGGERSCRIPTS = 5066, /* s[] */
RPMTAG_FILETRIGGERSCRIPTPROG = 5067, /* s[] */
RPMTAG_FILETRIGGERSCRIPTFLAGS = 5068, /* i[] */
RPMTAG_FILETRIGGERNAME = 5069, /* s[] */
RPMTAG_FILETRIGGERINDEX = 5070, /* i[] */
RPMTAG_FILETRIGGERVERSION = 5071, /* s[] */
RPMTAG_FILETRIGGERFLAGS = 5072, /* i[] */
RPMTAG_TRANSFILETRIGGERIN = 5073, /* internal */
RPMTAG_TRANSFILETRIGGERUN = 5074, /* internal */
RPMTAG_TRANSFILETRIGGERPOSTUN = 5075, /* internal */
RPMTAG_TRANSFILETRIGGERSCRIPTS = 5076, /* s[] */
RPMTAG_TRANSFILETRIGGERSCRIPTPROG = 5077, /* s[] */
RPMTAG_TRANSFILETRIGGERSCRIPTFLAGS = 5078, /* i[] */
RPMTAG_TRANSFILETRIGGERNAME = 5079, /* s[] */
RPMTAG_TRANSFILETRIGGERINDEX = 5080, /* i[] */
RPMTAG_TRANSFILETRIGGERVERSION = 5081, /* s[] */
RPMTAG_TRANSFILETRIGGERFLAGS = 5082, /* i[] */
RPMTAG_REMOVEPATHPOSTFIXES = 5083, /* s internal */
RPMTAG_FILETRIGGERPRIORITIES = 5084, /* i[] */
RPMTAG_TRANSFILETRIGGERPRIORITIES = 5085, /* i[] */
RPMTAG_FILETRIGGERCONDS = 5086, /* s[] extension */
RPMTAG_FILETRIGGERTYPE = 5087, /* s[] extension */
RPMTAG_TRANSFILETRIGGERCONDS = 5088, /* s[] extension */
RPMTAG_TRANSFILETRIGGERTYPE = 5089, /* s[] extension */
RPMTAG_FILESIGNATURES = 5090, /* s[] */
RPMTAG_FILESIGNATURELENGTH = 5091, /* i */
RPMTAG_PAYLOADDIGEST = 5092, /* s[] */
RPMTAG_PAYLOADDIGESTALGO = 5093, /* i */
RPMTAG_MODULARITYLABEL = 5096, /* s */
RPMTAG_FIRSTFREE_TAG /*!< internal */
} rpmTag;
#define RPMTAG_EXTERNAL_TAG 1000000
/** \ingroup rpmtag
* Rpm database index tags.
*/
typedef enum rpmDbiTag_e {
RPMDBI_PACKAGES = 0, /* Installed package headers. */
RPMDBI_LABEL = 2, /* NEVRA label pseudo index */
RPMDBI_NAME = RPMTAG_NAME,
RPMDBI_BASENAMES = RPMTAG_BASENAMES,
RPMDBI_GROUP = RPMTAG_GROUP,
RPMDBI_REQUIRENAME = RPMTAG_REQUIRENAME,
RPMDBI_PROVIDENAME = RPMTAG_PROVIDENAME,
RPMDBI_CONFLICTNAME = RPMTAG_CONFLICTNAME,
RPMDBI_OBSOLETENAME = RPMTAG_OBSOLETENAME,
RPMDBI_TRIGGERNAME = RPMTAG_TRIGGERNAME,
RPMDBI_DIRNAMES = RPMTAG_DIRNAMES,
RPMDBI_INSTALLTID = RPMTAG_INSTALLTID,
RPMDBI_SIGMD5 = RPMTAG_SIGMD5,
RPMDBI_SHA1HEADER = RPMTAG_SHA1HEADER,
RPMDBI_INSTFILENAMES = RPMTAG_INSTFILENAMES,
RPMDBI_FILETRIGGERNAME = RPMTAG_FILETRIGGERNAME,
RPMDBI_TRANSFILETRIGGERNAME = RPMTAG_TRANSFILETRIGGERNAME,
RPMDBI_RECOMMENDNAME = RPMTAG_RECOMMENDNAME,
RPMDBI_SUGGESTNAME = RPMTAG_SUGGESTNAME,
RPMDBI_SUPPLEMENTNAME = RPMTAG_SUPPLEMENTNAME,
RPMDBI_ENHANCENAME = RPMTAG_ENHANCENAME,
} rpmDbiTag;
/** \ingroup signature
* Tags found in signature header from package.
*/
typedef enum rpmSigTag_e {
RPMSIGTAG_SIZE = 1000, /*!< internal Header+Payload size (32bit) in bytes. */
RPMSIGTAG_LEMD5_1 = 1001, /*!< internal Broken MD5, take 1 @deprecated legacy. */
RPMSIGTAG_PGP = 1002, /*!< internal PGP 2.6.3 signature. */
RPMSIGTAG_LEMD5_2 = 1003, /*!< internal Broken MD5, take 2 @deprecated legacy. */
RPMSIGTAG_MD5 = 1004, /*!< internal MD5 signature. */
RPMSIGTAG_GPG = 1005, /*!< internal GnuPG signature. */
RPMSIGTAG_PGP5 = 1006, /*!< internal PGP5 signature @deprecated legacy. */
RPMSIGTAG_PAYLOADSIZE = 1007,/*!< internal uncompressed payload size (32bit) in bytes. */
RPMSIGTAG_RESERVEDSPACE = 1008,/*!< internal space reserved for signatures */
RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1, /*!< internal Broken SHA1, take 1. */
RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2, /*!< internal Broken SHA1, take 2. */
RPMSIGTAG_DSA = RPMTAG_DSAHEADER, /*!< internal DSA header signature. */
RPMSIGTAG_RSA = RPMTAG_RSAHEADER, /*!< internal RSA header signature. */
RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER, /*!< internal sha1 header digest. */
RPMSIGTAG_LONGSIZE = RPMTAG_LONGSIGSIZE, /*!< internal Header+Payload size (64bit) in bytes. */
RPMSIGTAG_LONGARCHIVESIZE = RPMTAG_LONGARCHIVESIZE, /*!< internal uncompressed payload size (64bit) in bytes. */
RPMSIGTAG_SHA256 = RPMTAG_SHA256HEADER,
} rpmSigTag;
/** \ingroup header
* The basic types of data in tags from headers.
*/
typedef enum rpmTagType_e {
#define RPM_MIN_TYPE 0
RPM_NULL_TYPE = 0,
RPM_CHAR_TYPE = 1,
RPM_INT8_TYPE = 2,
RPM_INT16_TYPE = 3,
RPM_INT32_TYPE = 4,
RPM_INT64_TYPE = 5,
RPM_STRING_TYPE = 6,
RPM_BIN_TYPE = 7,
RPM_STRING_ARRAY_TYPE = 8,
RPM_I18NSTRING_TYPE = 9,
#define RPM_MAX_TYPE 9
#define RPM_FORCEFREE_TYPE 0xff
#define RPM_MASK_TYPE 0x0000ffff
} rpmTagType;
/** \ingroup rpmtag
* The classes of data in tags from headers.
*/
typedef enum rpmTagClass_e {
RPM_NULL_CLASS = 0,
RPM_NUMERIC_CLASS = 1,
RPM_STRING_CLASS = 2,
RPM_BINARY_CLASS = 3,
} rpmTagClass;
/** \ingroup header
* New rpm data types under consideration/development.
* These data types may (or may not) be added to rpm at some point. In order
* to avoid incompatibility with legacy versions of rpm, these data (sub-)types
* are introduced into the header by overloading RPM_BIN_TYPE, with the binary
* value of the tag a 16 byte image of what should/will be in the header index,
* followed by per-tag private data.
*/
typedef enum rpmSubTagType_e {
RPM_REGION_TYPE = -10,
RPM_BIN_ARRAY_TYPE = -11,
/*!<@todo Implement, kinda like RPM_STRING_ARRAY_TYPE for known (but variable)
length binary data. */
RPM_XREF_TYPE = -12
/*!<@todo Implement, intent is to to carry a (???,tagNum,valNum) cross
reference to retrieve data from other tags. */
} rpmSubTagType;
/** \ingroup header
* * Identify how to return the header data type.
* */
enum rpmTagReturnType_e {
RPM_ANY_RETURN_TYPE = 0,
RPM_SCALAR_RETURN_TYPE = 0x00010000,
RPM_ARRAY_RETURN_TYPE = 0x00020000,
RPM_MAPPING_RETURN_TYPE = 0x00040000,
RPM_MASK_RETURN_TYPE = 0xffff0000
};
typedef rpmFlags rpmTagReturnType;
/** \ingroup rpmtag
* Return tag name from value.
* @param tag tag value
* @return tag name, "(unknown)" on not found
*/
const char * rpmTagGetName(rpmTagVal tag);
/** \ingroup rpmtag
* Return tag data type from value.
* @param tag tag value
* @return tag data type + return type, RPM_NULL_TYPE on not found.
*/
rpmTagType rpmTagGetType(rpmTagVal tag);
/** \ingroup rpmtag
* Return tag data type from value.
* @param tag tag value
* @return tag data type, RPM_NULL_TYPE on not found.
*/
rpmTagType rpmTagGetTagType(rpmTagVal tag);
/** \ingroup rpmtag
* Return tag data type from value.
* @param tag tag value
* @return tag data return type, RPM_NULL_TYPE on not found.
*/
rpmTagReturnType rpmTagGetReturnType(rpmTagVal tag);
/** \ingroup rpmtag
* Return tag data class from value.
* @param tag tag value
* @return tag data class, RPM_NULL_CLASS on not found.
*/
rpmTagClass rpmTagGetClass(rpmTagVal tag);
/** \ingroup rpmtag
* Return tag value from name.
* @param tagstr name of tag
* @return tag value, -1 on not found
*/
rpmTagVal rpmTagGetValue(const char * tagstr);
/** \ingroup rpmtag
* Return data class of type
* @param type tag type
* @return data class, RPM_NULL_CLASS on unknown.
*/
rpmTagClass rpmTagTypeGetClass(rpmTagType type);
/** \ingroup rpmtag
* Return known rpm tag names, sorted by name.
* @retval tagnames tag container of string array type
* @param fullname return short or full name
* @return number of tag names, 0 on error
*/
int rpmTagGetNames(rpmtd tagnames, int fullname);
#ifdef __cplusplus
}
#endif
#endif /* _RPMTAG_H */
PK vFZ#p��>