#include "system.h"
+/** \ingroup rpmdep
+ * \file lib/depends.c
+ */
+
#include <rpmlib.h>
#include "depends.h"
#ifndef H_DEPENDS
#define H_DEPENDS
+/** \file lib/depends.h
+ *
+ */
+
#include <header.h>
/**
#include "system.h"
+/** \ingroup rpmio db1
+ * \file lib/falloc.c
+ *
+ * The entire file space is thus divided into blocks with a "struct fablock"
+ * at the header of each. The size fields doubly link this block list.
+ *
+ * There is an additional free list weaved through the block list, which
+ * keeps new allocations fast.
+ *
+ * Much of this was inspired by Knuth vol 1.
+ *
+ */
+
#include <rpmio_internal.h>
#include "falloc.h"
-#define FA_MAGIC 0x02050920
-
-/*
- The entire file space is thus divided into blocks with a "struct fablock"
- at the header of each. The size fields doubly link this block list.
-
- There is an additional free list weaved through the block list, which
- keeps new allocations fast.
-
- Much of this was inspired by Knuth vol 1.
+/** \ingroup db1
*/
+#define FA_MAGIC 0x02050920
-struct faFileHeader{
+struct faFileHeader {
unsigned int magic;
unsigned int firstFree;
};
#ifndef H_FALLOC
#define H_FALLOC
-/*@access FD_t@*/
+/** \ingroup db1
+ * \file lib/falloc.h
+ * File space allocation routines.
+ *
+ * Best fit allocation is used, free blocks are compacted. Minimal
+ * fragmentation is more important then speed. This uses 32 bit
+ * offsets on all platforms and should be byte order independent.
+ */
-/* File space allocation routines. Best fit allocation is used, free blocks
- are compacted. Minimal fragmentation is more important then speed. This
- uses 32 bit offsets on all platforms and should be byte order independent */
+/*@access FD_t@*/
#ifdef __cplusplus
extern "C" {
fd->firstFree = firstFree;
}
+/** \ingroup db1
+ */
/*@null@*/ FD_t fadOpen (const char * path, int flags, mode_t perms);
+
+/** \ingroup db1
+ * @param fd file handle
+ */
unsigned int fadAlloc (FD_t fd, unsigned int size); /* 0 on failure */
+
+/** \ingroup db1
+ * @param fd file handle
+ */
void fadFree (FD_t fd, unsigned int offset);
+/** \ingroup db1
+ * @param fd file handle
+ */
int fadFirstOffset (FD_t fd);
+
+/** \ingroup db1
+ * @param fd file handle
+ */
int fadNextOffset (FD_t fd, unsigned int lastoff); /* 0 at end */
#ifdef __cplusplus
#include "system.h"
+/**
+ * \file lib/fileutil.c
+ */
+
#include <rpmlib.h>
#include "misc.h"
#include "system.h"
+/** \ingroup header
+ * \file lib/formats.c
+ */
+
#include <rpmlib.h>
#include <rpmmacro.h> /* XXX for %_i18ndomains */
#include "misc.h"
#include "system.h"
+/**
+ * \file lib/fprint.c
+ */
+
#include <rpmlib.h>
#include <rpmmacro.h> /* XXX for rpmCleanPath */
#include "system.h"
+/**
+ * \file lib/fs.c
+ */
+
#include <rpmlib.h>
#include <rpmmacro.h>
#define H_HASH
/** \file lib/hash.h
- * Hash table implemenation
+ * Hash table implemenation.
*/
typedef struct hashTable_s * hashTable;
-/* RPM - Copyright (C) 1995 Red Hat Software
- *
- * header.c - routines for managing rpm headers
+/** \ingroup header
+ * \file lib/header.c
*/
+/* RPM - Copyright (C) 1995 Red Hat Software */
+
/* Data written to file descriptors is in network byte order. */
/* Data read from file descriptors is expected to be in */
/* network byte order and is converted on the fly to host order. */
/* RPM_STRING_TYPE */ -1,
/* RPM_BIN_TYPE */ 1,
/* RPM_STRING_ARRAY_TYPE */ -1,
- /* RPM_I18NSTRING_TYPE */ -1 };
+ /* RPM_I18NSTRING_TYPE */ -1
+};
struct headerToken {
struct indexEntry *index;
int indexAlloced;
int sorted;
- /*@refs@*/ int usageCount;
+/*@refs@*/ int usageCount;
};
struct entryInfo {
struct indexEntry {
struct entryInfo info;
- /*@owned@*/ void * data;
+/*@owned@*/ void * data;
int length; /* Computable, but why bother? */
};
int_32 tag;
int justOne;
int arrayCount;
- char * format;
- char * type;
+/*@kept@*/ char * format;
+/*@kept@*/ char * type;
int pad;
};
int_32 count;
int avail;
int freeit;
- const void * data;
+/*@owned@*/ const void * data;
};
struct sprintfToken {
#define HEADERPROBE(_h, _msg)
#endif /* HAVE_MCHECK_H */
-static void copyEntry(struct indexEntry * entry, /*@out@*/ int_32 * type,
+static void copyEntry(const struct indexEntry * entry, /*@out@*/ int_32 * type,
/*@out@*/ void ** p, /*@out@*/ int_32 * c, int minimizeMemory)
+ /*@modifies *type, *p, *c @*/
{
int i, tableSize;
char ** ptrEntry;
}
static int dataLength(int_32 type, const void * p, int_32 count, int onDisk)
+ /*@*/
{
int thisLen, length, i;
char ** src, * chptr;
return 1;
}
-static int indexCmp(const void *ap, const void *bp)
+static int indexCmp(const void *ap, const void *bp) /*@*/
{
int_32 a = ((const struct indexEntry *)ap)->info.tag;
int_32 b = ((const struct indexEntry *)bp)->info.tag;
}
static void *doHeaderUnload(Header h, /*@out@*/int * lengthPtr)
+ /*@modifies h, *lengthPtr @*/
{
int i;
int type, diff;
/********************************************************************/
static struct indexEntry *findEntry(Header h, int_32 tag, int_32 type)
+ /*@modifies h @*/
{
struct indexEntry * entry, * entry2, * last;
struct indexEntry key;
}
static int headerMatchLocale(const char *td, const char *l, const char *le)
+ /*@*/
{
const char *fe;
static int intGetEntry(Header h, int_32 tag, /*@out@*/ int_32 *type,
/*@out@*/ void **p, /*@out@*/ int_32 *c, int minMem)
+ /*@modifies h, *type, *p, *c @*/
{
struct indexEntry * entry;
char * chptr;
if (type) *type = RPM_STRING_TYPE;
if (c) *c = 1;
- *p = chptr;
+ /*@-dependenttrans@*/ *p = chptr; /*@=dependenttrans@*/
} else {
copyEntry(entry, type, p, c, minMem);
}
{
HEADERPROBE(h, "headerLink");
h->usageCount++;
- return h;
+ /*@-refcounttrans@*/ return h; /*@=refcounttrans@*/
}
int headerUsageCount(Header h)
return size;
}
-static void copyData(int_32 type, /*@out@*/void * dstPtr, const void * srcPtr, int_32 c,
- int dataLength)
+static void copyData(int_32 type, /*@out@*/ void * dstPtr, const void * srcPtr,
+ int_32 c, int dataLength)
+ /*@modifies *dstPtr @*/
{
const char ** src;
char * dst;
}
}
-static void * grabData(int_32 type, const void * p, int_32 c, int * lengthPtr)
+static void * grabData(int_32 type, const void * p, int_32 c,
+ /*@out@*/ int * lengthPtr)
+ /*@modifies *lengthPtr @*/
{
int length;
void * data;
return 0; /* this shouldn't ever happen!! */
if (!table && !entry) {
- const char * charArray[2];
+ errmsg_t charArray[2];
int count = 0;
if (!lang || (lang[0] == 'C' && lang[1] == '\0')) {
charArray[count++] = "C";
entry->info.count += c;
- return 0;
+ return 1;
}
int headerRemoveEntry(Header h, int_32 tag)
return 0;
}
-static char escapedChar(const char ch)
+static char escapedChar(const char ch) /*@*/
{
switch (ch) {
case 'a': return '\a';
const struct headerSprintfExtension * extensions,
/*@out@*/const struct headerTagTableEntry ** tagMatch,
/*@out@*/const struct headerSprintfExtension ** extMatch)
+ /*@modifies *tagMatch, *extMatch @*/
{
const struct headerTagTableEntry * entry;
const struct headerSprintfExtension * ext;
static int parseExpression(struct sprintfToken * token, char * str,
const struct headerTagTableEntry * tags,
const struct headerSprintfExtension * extensions,
- /*@out@*/char ** endPtr, /*@out@*/const char ** error);
+ /*@out@*/char ** endPtr, /*@out@*/ errmsg_t * errmsg)
+ /*@modifies str, *str, *token, *endPtr, *errmsg @*/;
static int parseFormat(char * str, const struct headerTagTableEntry * tags,
const struct headerSprintfExtension * extensions,
/*@out@*/struct sprintfToken ** formatPtr, /*@out@*/int * numTokensPtr,
- /*@out@*/char ** endPtr, int state, /*@out@*/const char ** error)
+ /*@out@*/char ** endPtr, int state, /*@out@*/ errmsg_t * errmsg)
+ /*@modifies str, *str, *formatPtr, *numTokensPtr, *endPtr, *errmsg @*/
{
char * chptr, * start, * next, * dst;
struct sprintfToken * format;
dst = start = str;
currToken = -1;
- while (*start && !done) {
+ while (*start) {
switch (*start) {
case '%':
/* handle %% */
start++;
if (parseExpression(format + currToken, start, tags,
- extensions, &newEnd, error)) {
+ extensions, &newEnd, errmsg)) {
freeFormat(format, numTokens);
return 1;
}
chptr = start;
while (*chptr && *chptr != '{' && *chptr != '%') chptr++;
if (!*chptr || *chptr == '%') {
- *error = _("missing { after %");
+ *errmsg = _("missing { after %");
freeFormat(format, numTokens);
return 1;
}
next = start;
while (*next && *next != '}') next++;
if (!*next) {
- *error = _("missing } after %{");
+ *errmsg = _("missing } after %{");
freeFormat(format, numTokens);
return 1;
}
if (*chptr) {
*chptr++ = '\0';
if (!*chptr) {
- *error = _("empty tag format");
+ *errmsg = _("empty tag format");
freeFormat(format, numTokens);
return 1;
}
}
if (!*start) {
- *error = _("empty tag name");
+ *errmsg = _("empty tag name");
freeFormat(format, numTokens);
return 1;
}
format[currToken].u.tag.ext = ext->u.tagFunction;
format[currToken].u.tag.extNum = ext - extensions;
} else {
- *error = _("unknown tag");
+ *errmsg = _("unknown tag");
freeFormat(format, numTokens);
return 1;
}
if (parseFormat(start, tags, extensions,
&format[currToken].u.array.format,
&format[currToken].u.array.numTokens,
- &start, PARSER_IN_ARRAY, error)) {
+ &start, PARSER_IN_ARRAY, errmsg)) {
freeFormat(format, numTokens);
return 1;
}
if (!start) {
- *error = _("] expected at end of array");
+ *errmsg = _("] expected at end of array");
freeFormat(format, numTokens);
return 1;
}
if ((*start == ']' && state != PARSER_IN_ARRAY) ||
(*start == '}' && state != PARSER_IN_EXPR)) {
if (*start == ']')
- *error = _("unexpected ]");
+ *errmsg = _("unexpected ]");
else
- *error = _("unexpected }");
+ *errmsg = _("unexpected }");
freeFormat(format, numTokens);
return 1;
}
}
break;
}
+ if (done)
+ break;
}
*dst = '\0';
static int parseExpression(struct sprintfToken * token, char * str,
const struct headerTagTableEntry * tags,
const struct headerSprintfExtension * extensions,
- /*@out@*/ char ** endPtr, /*@out@*/ const char ** error)
+ /*@out@*/ char ** endPtr, /*@out@*/ errmsg_t * errmsg)
+ /*@modifies str, *str, *token, *endPtr, *errmsg @*/
{
const struct headerTagTableEntry * tag;
const struct headerSprintfExtension * ext;
char * chptr;
char * end;
- *error = NULL;
+ *errmsg = NULL;
chptr = str;
while (*chptr && *chptr != '?') chptr++;
if (*chptr != '?') {
- *error = _("? expected in expression");
+ *errmsg = _("? expected in expression");
return 1;
}
*chptr++ = '\0';;
if (*chptr != '{') {
- *error = _("{ expected after ? in expression");
+ *errmsg = _("{ expected after ? in expression");
return 1;
}
chptr++;
if (parseFormat(chptr, tags, extensions, &token->u.cond.ifFormat,
- &token->u.cond.numIfTokens, &end, PARSER_IN_EXPR, error))
+ &token->u.cond.numIfTokens, &end, PARSER_IN_EXPR, errmsg))
return 1;
if (!*end) {
- *error = _("} expected in expression");
+ *errmsg = _("} expected in expression");
freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens);
token->u.cond.ifFormat = NULL;
return 1;
chptr = end;
if (*chptr != ':' && *chptr != '|') {
- *error = _(": expected following ? subexpression");
+ *errmsg = _(": expected following ? subexpression");
freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens);
token->u.cond.ifFormat = NULL;
return 1;
if (*chptr == '|') {
parseFormat(xstrdup(""), tags, extensions, &token->u.cond.elseFormat,
&token->u.cond.numElseTokens, &end, PARSER_IN_EXPR,
- error);
+ errmsg);
} else {
chptr++;
if (*chptr != '{') {
- *error = _("{ expected after : in expression");
+ *errmsg = _("{ expected after : in expression");
freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens);
token->u.cond.ifFormat = NULL;
return 1;
if (parseFormat(chptr, tags, extensions, &token->u.cond.elseFormat,
&token->u.cond.numElseTokens, &end, PARSER_IN_EXPR,
- error))
+ errmsg))
return 1;
if (!*end) {
- *error = _("} expected in expression");
+ *errmsg = _("} expected in expression");
freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens);
token->u.cond.ifFormat = NULL;
return 1;
chptr = end;
if (*chptr != '|') {
- *error = _("| expected at end of expression");
+ *errmsg = _("| expected at end of expression");
freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens);
token->u.cond.ifFormat = NULL;
freeFormat(token->u.cond.elseFormat, token->u.cond.numElseTokens);
static int getExtension(Header h, headerTagTagFunction fn,
/*@out@*/ int_32 * typeptr, /*@out@*/ const void ** data,
/*@out@*/ int_32 * countptr, struct extensionCache * ext)
+ /*@modifies *typeptr, *data, *countptr, ext->avail @*/
{
if (!ext->avail) {
if (fn(h, &ext->type, &ext->data, &ext->count, &ext->freeit))
static char * formatValue(struct sprintfTag * tag, Header h,
const struct headerSprintfExtension * extensions,
struct extensionCache * extCache, int element)
+ /*@modifies h, extCache->avail @*/
{
int len;
char buf[20];
static const char * singleSprintf(Header h, struct sprintfToken * token,
const struct headerSprintfExtension * extensions,
struct extensionCache * extCache, int element)
+ /*@modifies h, extCache->avail @*/
{
char * val;
const char * thisItem;
static struct extensionCache * allocateExtensionCache(
const struct headerSprintfExtension * extensions)
+ /*@*/
{
const struct headerSprintfExtension * ext = extensions;
int i = 0;
char * headerSprintf(Header h, const char * origFmt,
const struct headerTagTableEntry * tags,
const struct headerSprintfExtension * extensions,
- const char ** error)
+ errmsg_t * errmsg)
{
char * fmtString;
struct sprintfToken * format;
fmtString = xstrdup(origFmt);
if (parseFormat(fmtString, tags, extensions, &format, &numTokens,
- NULL, PARSER_BEGIN, error)) {
+ NULL, PARSER_BEGIN, errmsg)) {
free(fmtString);
return NULL;
}
static char * octalFormat(int_32 type, const void * data,
char * formatPrefix, int padding, /*@unused@*/int element)
+ /*@modifies formatPrefix @*/
{
char * val;
static char * hexFormat(int_32 type, const void * data,
char * formatPrefix, int padding, /*@unused@*/int element)
+ /*@modifies formatPrefix @*/
{
char * val;
static char * realDateFormat(int_32 type, const void * data,
char * formatPrefix, int padding, /*@unused@*/int element,
char * strftimeFormat)
+ /*@modifies formatPrefix @*/
{
char * val;
struct tm * tstruct;
static char * dateFormat(int_32 type, const void * data,
char * formatPrefix, int padding, int element)
+ /*@modifies formatPrefix @*/
{
return realDateFormat(type, data, formatPrefix, padding, element, "%c");
}
static char * dayFormat(int_32 type, const void * data,
char * formatPrefix, int padding, int element)
+ /*@modifies formatPrefix @*/
{
return realDateFormat(type, data, formatPrefix, padding, element,
"%a %b %d %Y");
static char * shescapeFormat(int_32 type, const void * data,
char * formatPrefix, int padding, /*@unused@*/int element)
+ /*@modifies formatPrefix @*/
{
char * result, * dst, * src, * buf;
-/* RPM - Copyright (C) 1995 Red Hat Software
+#ifndef H_HEADER
+#define H_HEADER
+
+/** \file lib/header.h
*
- * header.h - routines for managing rpm tagged structures
*/
+/* RPM - Copyright (C) 1995 Red Hat Software */
+
/* WARNING: 1 means success, 0 means failure (yes, this is backwards) */
-#ifndef H_HEADER
-#define H_HEADER
#include <stdio.h>
#include <zlib.h>
typedef /*@abstract@*/ /*@refcounted@*/ struct headerToken *Header;
typedef /*@abstract@*/ struct headerIteratorS *HeaderIterator;
+/** \ingroup header
+ * Associate tag names with numeric values.
+ */
struct headerTagTableEntry {
- const char * name;
- int val;
+ const char * name; /*!< Tag name. */
+ int val; /*!< Tag numeric value. */
};
-enum headerSprintfExtenstionType { HEADER_EXT_LAST = 0, HEADER_EXT_FORMAT,
- HEADER_EXT_MORE, HEADER_EXT_TAG };
+/** \ingroup header
+ */
+enum headerSprintfExtenstionType {
+ HEADER_EXT_LAST = 0, /*!< End of extension chain. */
+ HEADER_EXT_FORMAT, /*!< headerTagFormatFunction() extension */
+ HEADER_EXT_MORE, /*!< Chain to next table. */
+ HEADER_EXT_TAG /*!< headerTagTagFunction() extension */
+};
-/* This will only ever be passed RPM_TYPE_INT32 or RPM_TYPE_STRING to
- help keep things simple */
-typedef char * (*headerTagFormatFunction)(int_32 type, const void * data,
- char * formatPrefix,
- int padding, int element);
-/* This is allowed to fail, which indicates the tag doesn't exist */
+/** \ingroup header
+ * HEADER_EXT_TAG format function prototype.
+ * This will only ever be passed RPM_TYPE_INT32 or RPM_TYPE_STRING to
+ * help keep things simple
+ *
+ * @param type tag type
+ * @param data tag value
+ * @param formatPrefix
+ * @param padding
+ * @param element
+ * @return formatted string
+ */
+typedef /*only@*/ char * (*headerTagFormatFunction)(int_32 type,
+ const void * data, char * formatPrefix,
+ int padding, int element);
+/** \ingroup header
+ * HEADER_EXT_FORMAT format function prototype.
+ * This is allowed to fail, which indicates the tag doesn't exist.
+ *
+ * @param h header
+ * @retval type address of tag type
+ * @retval data address of tag value pointer
+ * @retval count address of no. of data items
+ * @retval freedata address of data-was-malloc'ed indicator
+ * @return 0 on success
+ */
typedef int (*headerTagTagFunction)(Header h, int_32 * type, const void ** data,
int_32 * count, int * freeData);
+/** \ingroup header
+ * Define header tag output formats.
+ */
struct headerSprintfExtension {
- enum headerSprintfExtenstionType type;
- char * name;
+ enum headerSprintfExtenstionType type; /*!< Type of extension. */
+ char * name; /*!< Name of extension. */
union {
- void * generic;
- headerTagFormatFunction formatFunction;
- headerTagTagFunction tagFunction;
- struct headerSprintfExtension * more;
+ void * generic; /*!< Private extension. */
+ headerTagFormatFunction formatFunction; /*!< HEADER_EXT_TAG extension. */
+ headerTagTagFunction tagFunction; /*!< HEADER_EXT_FORMAT extension. */
+ struct headerSprintfExtension * more; /*!< Chained table extension. */
} u;
};
-/* This defines some basic conversions all header users would probably like
- to have */
+/** \ingroup header
+ * Supported default header tag output formats.
+ */
extern const struct headerSprintfExtension headerDefaultFormats[];
-/* read and write a header from a file */
-Header headerRead(FD_t fd, int magicp);
-int headerWrite(FD_t fd, Header h, int magicp);
-Header headerGzRead(FD_t fd, int magicp);
-int headerGzWrite(FD_t fd, Header h, int magicp);
-unsigned int headerSizeof(Header h, int magicp);
+/** \ingroup header
+ * Read (and load) header from file handle.
+ * @param fd file handle
+ * @param magicp
+ * @return header
+ */
+Header headerRead(FD_t fd, int magicp) /*@modifies fd @*/;
+
+/** \ingroup header
+ * Write (with unload) header to file handle.
+ * @param fd file handle
+ * @param h header
+ * @param magicp
+ * @return
+ */
+int headerWrite(FD_t fd, Header h, int magicp) /*@modifies fd, h @*/;
+
+/** \ingroup header
+ * Return size of on-disk header representation in bytes.
+ */
+unsigned int headerSizeof(Header h, int magicp)
+ /*@modifies h @*/;
#define HEADER_MAGIC_NO 0
#define HEADER_MAGIC_YES 1
-/* load and unload a header from a chunk of memory */
-Header headerLoad(void *p);
-void *headerUnload(Header h);
+/** \ingroup header
+ * Convert header to in-memory representation.
+ * @param p on-disk header (with offsets)
+ * @return header (with pointers)
+ */
+Header headerLoad(void *p) /*@*/;
+
+/** \ingroup header
+ * Convert header to on-disk representation.
+ * @param h header (with pointers)
+ * @return on-disk header (with offsets)
+ */
+void *headerUnload(Header h)
+ /*@modifes h @*/;
+
+/** \ingroup header
+ * Create new (empty) header instance.
+ * @return header
+ */
+Header headerNew(void) /*@*/;
+
+/** \ingroup header
+ * Reference a header instance.
+ * @param h header
+ * @return referenced header instance
+ */
+Header headerLink(Header h) /*@modifies h @*/;
-Header headerNew(void);
+/** \ingroup header
+ * Dereference a header instance.
+ * @param h header
+ */
void headerFree( /*@killref@*/ Header h);
-/* dump a header to a file, in human readable format */
+/** \ingroup header
+ * Return header reference count.
+ * @param h header
+ * @return no. of references
+ */
+int headerUsageCount(Header h) /*@*/;
+
+/** \ingroup header
+ * Dump a header in human readable format (for debugging).
+ * @param h header
+ * @param flags 0 or HEADER_DUMP_LINLINE
+ * @param tags array of tag name/value pairs
+ */
void headerDump(Header h, FILE *f, int flags,
const struct headerTagTableEntry * tags);
+#define HEADER_DUMP_INLINE 1
-/* the returned string must be free()d */
-char * headerSprintf(Header h, const char * fmt,
+typedef /*@observer@*/ const char * errmsg_t;
+
+/** \ingroup header
+ * Return formatted output string from header tags.
+ * The returned string must be free()d.
+ *
+ * @param h header
+ * @param fmt format to use
+ * @param tags array of tag name/value pairs
+ * @param extentions chained table of formatting extensions.
+ * @retval errmsg error message (if any)
+ * @return formatted output string (malloc'ed)
+ */
+/*@only@*/ char * headerSprintf(Header h, const char * fmt,
const struct headerTagTableEntry * tags,
const struct headerSprintfExtension * extentions,
- /*@out@*/ const char ** error);
+ /*@out@*/ errmsg_t * errmsg)
+ /*@modifies h, *errmsg @*/;
+
+/** \ingroup header
+ * Add tag to header.
+ * Duplicate tags are okay, but only defined for iteration (with the
+ * exceptions noted below). While you are allowed to add i18n string
+ * arrays through this function, you probably don't mean to. See
+ * headerAddI18NString() instead.
+ *
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
+int headerAddEntry(Header h, int_32 tag, int_32 type, const void *p, int_32 c)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Modify tag in header.
+ * If there are multiple entries with this tag, the first one gets replaced.
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
+int headerModifyEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c)
+ /*@modifies h @*/;
-#define HEADER_DUMP_INLINE 1
+/** \ingroup header
+ * Return array of locales found in header.
+ * @param h header
+ * @return array of locales
+ */
+char ** headerGetLangs(Header h)
+ /*@modifies h @*/;
-/* Duplicate tags are okay, but only defined for iteration (with the
- exceptions noted below). While you are allowed to add i18n string
- arrays through this function, you probably don't mean to. See
- headerAddI18NString() instead */
-int headerAddEntry(Header h, int_32 tag, int_32 type, const void *p, int_32 c);
-/* if there are multiple entries with this tag, the first one gets replaced */
-int headerModifyEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c);
-
-/* Return array of lang names */
-char **headerGetLangs(Header h);
-
-/* A NULL lang is interpreted as the C locale. Here are the rules:
-
- 1) If the tag isn't in the Header, it's added with the passed string
- as a version.
- 2) If the tag occurs multiple times in entry, which tag is affected
- by the operation is undefined.
- 2) If the tag is in the header w/ this language, the entry is
- *replaced* (like headerModifyEntry()).
-
- This function is intended to just "do the right thing". If you need
- more fine grained control use headerAddEntry() and headerModifyEntry()
- but be careful!
-*/
+/** \ingroup header
+ * Add locale specific tag to header.
+ * A NULL lang is interpreted as the C locale. Here are the rules:
+ *
+ * 1) If the tag isn't in the Header, it's added with the passed string
+ * as a version.
+ * 2) If the tag occurs multiple times in entry, which tag is affected
+ * by the operation is undefined.
+ * 2) If the tag is in the header w/ this language, the entry is
+ * *replaced* (like headerModifyEntry()).
+ *
+ * This function is intended to just "do the right thing". If you need
+ * more fine grained control use headerAddEntry() and headerModifyEntry().
+ *
+ * @param h header
+ * @param tag tag
+ * @param string tag value
+ * @param lang locale
+ * @return 1 on success, 0 on failure
+ */
int headerAddI18NString(Header h, int_32 tag, const char * string,
- const char * lang);
-
-/* Appends item p to entry w/ tag and type as passed. Won't work on
- RPM_STRING_TYPE. Any pointers from headerGetEntry() for this entry
- are invalid after this call has been made! */
-int headerAppendEntry(Header h, int_32 tag, int_32 type, void * p, int_32 c);
+ const char * lang)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Append element to tag array in header.
+ * Appends item p to entry w/ tag and type as passed. Won't work on
+ * RPM_STRING_TYPE. Any pointers from headerGetEntry() for this entry
+ * are invalid after this call has been made!
+ *
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
+int headerAppendEntry(Header h, int_32 tag, int_32 type, void * p, int_32 c)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Add or append element to tag array in header.
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
- void * p, int_32 c);
-
-/* Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements w/
- RPM_I18NSTRING_TYPE equivalent enreies are translated (if HEADER_I18NTABLE
- entry is present). */
+ void * p, int_32 c)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Retrieve tag value.
+ * Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with
+ * RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE
+ * entry is present).
+ *
+ * @param h header
+ * @param tag tag
+ * @retval type address of tag value data type
+ * @retval p address of pointer to tag value(s)
+ * @retval c address of number of values
+ * @return 1 on success, 0 on failure
+ */
int headerGetEntry(Header h, int_32 tag, /*@out@*/ int_32 *type,
- /*@out@*/ void **p, /*@out@*/int_32 *c);
+ /*@out@*/ void **p, /*@out@*/int_32 *c)
+ /*@modifies h, *type, *p, *c @*/;
-/* This gets an entry, and uses as little extra RAM as possible to represent
- it (this is only an issue for RPM_STRING_ARRAY_TYPE. */
+/** \ingroup header
+ * Retrieve tag value using header internal array.
+ * Get an entry using as little extra RAM as possible to return the tag value.
+ * This is only an issue for RPM_STRING_ARRAY_TYPE.
+ *
+ * @param h header
+ * @param tag tag
+ * @retval type address of tag value data type
+ * @retval p address of pointer to tag value(s)
+ * @retval c address of number of values
+ * @return 1 on success, 0 on failure
+ */
int headerGetEntryMinMemory(Header h, int_32 tag, int_32 *type,
- /*@out@*/ void **p, /*@out@*/ int_32 *c);
+ /*@out@*/ void **p, /*@out@*/ int_32 *c)
+ /*@modifies h, *type, *p, *c @*/;
-/* If *type is RPM_NULL_TYPE any type will match, otherwise only *type will
- match. */
+/** \ingroup header
+ * Retrieve tag value with type match.
+ * If *type is RPM_NULL_TYPE any type will match, otherwise only *type will
+ * match.
+ *
+ * @param h header
+ * @param tag tag
+ * @retval type address of tag value data type
+ * @retval p address of pointer to tag value(s)
+ * @retval c address of number of values
+ * @return 1 on success, 0 on failure
+ */
int headerGetRawEntry(Header h, int_32 tag, /*@out@*/ int_32 *type,
- /*@out@*/ void **p, /*@out@*/ int_32 *c);
+ /*@out@*/ void **p, /*@out@*/ int_32 *c)
+ /*@modifies h, *type, *p, *c @*/;
+
+/** \ingroup header
+ * Check if tag is in header.
+ * @param h header
+ * @return 1 on success, 0 on failure
+ */
+int headerIsEntry(Header h, int_32 tag)
+ /*@modifies h @*/;
-int headerIsEntry(Header h, int_32 tag);
-/* removes all entries of type tag from the header, returns 1 if none were
- found */
-int headerRemoveEntry(Header h, int_32 tag);
+/** \ingroup header
+ * Delete tag in header.
+ * Removes all entries of type tag from the header, returns 1 if none were
+ * found.
+ *
+ * @param h header
+ * @return 0 on success, 1 on failure (INCONSISTENT)
+ */
+int headerRemoveEntry(Header h, int_32 tag)
+ /*@modifies h @*/;
-HeaderIterator headerInitIterator(Header h);
+/** \ingroup header
+ * Create header tag iterator.
+ * @param h header
+ * @return header tag iterator
+ */
+HeaderIterator headerInitIterator(Header h)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Return next tag from header.
+ * @param iter header tag iterator
+ * @retval tag address of tag
+ * @retval type address of tag value data type
+ * @retval p address of pointer to tag value(s)
+ * @retval c address of number of values
+ * @return 1 on success, 0 on failure
+ */
int headerNextIterator(HeaderIterator iter,
/*@out@*/ int_32 *tag, /*@out@*/ int_32 *type, /*@out@*/ void **p,
- /*@out@*/ int_32 *c);
+ /*@out@*/ int_32 *c)
+ /*@modifies iter, *tag, *type, *p, *c @*/;
+
+/** \ingroup header
+ * Destroy header tag iterator.
+ * @param iter header tag iterator
+ */
void headerFreeIterator( /*@only@*/ HeaderIterator iter);
-Header headerCopy(Header h);
-void headerSort(Header h);
-Header headerLink(Header h);
-int headerUsageCount(Header h);
+/** \ingroup header
+ * Duplicate a header.
+ * @param h header
+ * @return new header instance
+ */
+Header headerCopy(Header h)
+ /*@modifies h @*/;
-void headerCopyTags(Header headerFrom, Header headerTo, int_32 *tagstocopy);
+/** \ingroup header
+ * Sort tags in header.
+ * @param h header
+ */
+void headerSort(Header h)
+ /*@modifies h @*/;
+
+/** \ingroup header
+ * Duplicate tag values from one header into another.
+ * @param headerFrom source header
+ * @param headerTo destination header
+ * @param tagstocopy array of tags that are copied
+ */
+void headerCopyTags(Header headerFrom, Header headerTo, int_32 *tagstocopy)
+ /*@modifies headerFrom, headerTo @*/;
/* Entry Types */
+/** \ingroup rpmtrans payload
+ * \file lib/install.c
+ */
+
#include "system.h"
#include <rpmlib.h>
#ifndef H_INSTALL
#define H_INSTALL
+/** \file lib/install.h
+ *
+ */
+
#include <rpmlib.h>
/**
-/*
+/** \ingroup signature
+ * \file lib/md5.c
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
#ifndef MD5_H
#define MD5_H
+/** \file lib/md5.h
+ *
+ */
+
#include <sys/types.h>
typedef unsigned int uint32;
-/*
- * md5sum.c - Generate/check MD5 Message Digests
- *
+/** \ingroup signature.c
+ * \file lib/md5sum.c
+ * Generate/check MD5 Message Digests.
* Compile and link with md5.c. If you don't have getopt() in your library
* also include getopt.c. For MSDOS you can also link with the wildcard
* initialization function (wildargs.obj for Turbo C and setargv.obj for MSC)
+/**
+ * \file lib/misc.c
+ */
+
#include "system.h"
static int _debug = 0;
#ifndef H_MISC
#define H_MISC
+/** \file lib/misc.h
+ *
+ */
+
#include <unistd.h>
#include <sys/types.h>
#ifndef _H_OLDRPMDB
#define _H_OLDRPMDB
+/** \file lib/oldrpmdb.h
+ *
+ */
+
#include <gdbm.h>
#include <oldheader.h>
+/** \ingroup header
+ * \file lib/package.c
+ */
+
#include "system.h"
#ifdef __LCLINT__
-/** \file poptBT.c
+/**
+ * \file lib/poptBT.c
* Popt tables for build modes.
*/
+/**
+ * \file lib/poptQV.c
+ * Popt tables for query/verify modes.
+ */
#include "system.h"
#include "rpmbuild.h"
+/**
+ * \file lib/problems.c
+ */
+
#include "system.h"
#include <rpmlib.h>
+/** \ingroup rpmcli
+ * \file lib/query.c
+ */
+
#include "system.h"
#ifndef PATH_MAX
-/* checksig.c: verify the signature of an RPM */
+/** \ingroup rpmcli
+ * \file lib/rpmchecksig.c
+ * Verify the signature of a package.
+ */
#include "system.h"
+/** \ingroup rpmdb dbi
+ * \file lib/rpmdb.c
+ */
+
#include "system.h"
static int _debug = 0;
#ifndef H_RPMDB
#define H_RPMDB
-/** \file lib/rpmdb.h
+/** \ingroup rpmdb dbi db1 db3
+ * \file lib/rpmdb.h
* Access RPM indices using Berkeley db[123] interface.
*/
typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
/* this will break if sizeof(int) != 4 */
-/**
+/** \ingroup dbi
* A single item from an index database (i.e. the "data returned").
* Note: In rpm-3.0.4 and earlier, this structure was passed by value,
* and was identical to the "data saved" structure below.
unsigned int dbNum; /*!< database index */
};
-/**
+/** \ingroup dbi
* A single item in an index database (i.e. the "data saved").
*/
struct _dbiIR {
};
typedef struct _dbiIR * DBIR_t;
-/**
+/** \ingroup dbi
* Items retrieved from the index database.
*/
struct _dbiIndexSet {
#define DB_LSN void
#endif
-/**
+/** \ingroup dbi
* Private methods for accessing an index database.
*/
struct _dbiVec {
int dbv_minor; /*!< Berkeley db version minor */
int dbv_patch; /*!< Berkeley db version patch */
-/**
+/** \ingroup dbi
* Return handle for an index database.
* @param rpmdb rpm database
* @param rpmtag rpm tag
*/
int (*open) (rpmdb rpmdb, int rpmtag, /*@out@*/ dbiIndex * dbip);
-/**
+/** \ingroup dbi
* Close index database.
* @param dbi index database handle
* @param flags (unused)
*/
int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags);
-/**
+/** \ingroup dbi
* Flush pending operations to disk.
* @param dbi index database handle
* @param flags (unused)
*/
int (*sync) (dbiIndex dbi, unsigned int flags);
-/**
+/** \ingroup dbi
* Open database cursor.
* @param dbi index database handle
* @param dbcp address of database cursor
*/
int (*copen) (dbiIndex dbi, /*@out@*/ DBC ** dbcp, unsigned int flags);
-/**
+/** \ingroup dbi
* Close database cursor.
* @param dbi index database handle
* @param dbcursor database cursor
*/
int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags);
-/**
+/** \ingroup dbi
* Delete (key,data) pair(s) using db->del or dbcursor->c_del.
* @param dbi index database handle
* @param dbcursor database cursor
*/
int (*cdel) (dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen, unsigned int flags);
-/**
+/** \ingroup dbi
* Retrieve (key,data) pair using db->get or dbcursor->c_get.
* @param dbi index database handle
* @param dbcursor database cursor
/*@out@*/ void ** datapp, /*@out@*/ size_t * datalenp,
unsigned int flags);
-/**
+/** \ingroup dbi
* Store (key,data) pair using db->put or dbcursor->c_put.
* @param dbi index database handle
* @param dbcursor database cursor
const void * datap, size_t datalen,
unsigned int flags);
-/**
+/** \ingroup dbi
* Is database byte swapped?
* @param dbi index database handle
* @return 0 no
};
-/**
+/** \ingroup dbi
* Describes an index database (implemented on Berkeley db[123] API).
*/
struct _dbiIndex {
};
-/**
+/** \ingroup rpmdb
* Describes the collection of index databases used by rpm.
*/
struct rpmdb_s {
extern "C" {
#endif
-/**
+/** \ingroup db3
* Return new configured index database handle instance.
* @param rpmdb rpm database
*/
/*@only@*/ /*@null@*/ dbiIndex db3New(/*@keep@*/ rpmdb rpmdb, int rpmtag);
-/**
+/** \ingroup db3
* Destroy index database handle instance.
* @param dbi index database handle
*/
void db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi);
-/**
+/** \ingroup dbi
* Return handle for an index database.
* @param rpmdb rpm database
* @param rpmtag rpm tag
/*@only@*/ /*@null@*/ dbiIndex dbiOpen(rpmdb rpmdb, int rpmtag,
unsigned int flags);
-/**
+/** \ingroup dbi
* @param dbi index database handle
* @param flags (unused)
*/
#define dbiCopen(_a,_b,_c) \
XdbiCopen(_a, _b, _c, __FILE__, __LINE__)
-/**
+/** \ingroup dbi
* @param dbi index database handle
* @param flags (unused)
*/
#define dbiCclose(_a,_b,_c) \
XdbiCclose(_a, _b, _c, __FILE__, __LINE__)
-/**
+/** \ingroup dbi
* Delete (key,data) pair(s) from index database.
* @param dbi index database handle
* @param keyp key data
int dbiDel(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
unsigned int flags);
-/**
+/** \ingroup dbi
* Retrieve (key,data) pair from index database.
* @param dbi index database handle
* @param keypp address of key data
int dbiGet(dbiIndex dbi, DBC * dbcursor, void ** keypp, size_t * keylenp,
void ** datapp, size_t * datalenp, unsigned int flags);
-/**
+/** \ingroup dbi
* Store (key,data) pair in index database.
* @param dbi index database handle
* @param keyp key data
int dbiPut(dbiIndex dbi, DBC * dbcursor, const void * keyp, size_t keylen,
const void * datap, size_t datalen, unsigned int flags);
-/**
+/** \ingroup dbi
* Close index database.
* @param dbi index database handle
* @param flags (unused)
*/
int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags);
-/**
+/** \ingroup dbi
* Flush pending operations to disk.
* @param dbi index database handle
* @param flags (unused)
*/
int dbiSync (dbiIndex dbi, unsigned int flags);
-/**
+/** \ingroup dbi
* Is database byte swapped?
* @param dbi index database handle
* @return 0 no
*/
int dbiByteSwapped(dbiIndex dbi);
-/**
- * Return base file name for index database (legacy).
+/** \ingroup db1
+ * Return base file name for db1 database (legacy).
* @param rpmtag rpm tag
- * @return base file name
+ * @return base file name of db1 database
*/
char * db1basename(int rpmtag);
-/**
+/** \ingroup rpmdb
*/
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
-/**
+/** \ingroup rpmdb
* @param rpmdb rpm database
*/
int rpmdbFindFpList(rpmdb rpmdb, fingerPrint * fpList, /*@out@*/dbiIndexSet * matchList,
int numItems);
-/**
+/** \ingroup dbi
* Destroy set of index database items.
* @param set set of index database items
*/
void dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set);
-/**
+/** \ingroup dbi
* Count items in index database set.
* @param set set of index database items
* @return number of items
*/
unsigned int dbiIndexSetCount(dbiIndexSet set);
-/**
+/** \ingroup dbi
* Return record offset of header from element in index database set.
* @param set set of index database items
* @param recno index of item in set
*/
unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno);
-/**
+/** \ingroup dbi
* Return file index from element in index database set.
* @param set set of index database items
* @param recno index of item in set
+/** \ingroup rpmcli
+ * \file lib/rpminstall.c
+ */
+
#include "system.h"
#include <rpmlib.h>
+/** \ingroup lead
+ * \file lib/rpmlead.c
+ */
+
#include "system.h"
#if HAVE_MACHINE_TYPES_H
#ifndef _H_RPMLEAD
#define _H_RPMLEAD
+/** \file lib/rpmlead.h
+ *
+ */
+
#include <rpmlib.h>
/* Other definitions went to rpmlib.h */
#ifndef H_RPMLIB
#define H_RPMLIB
+/** \file lib/rpmlib.h
+ * \ingroup rpmcli rpmrc rpmdep rpmtrans rpmdb lead signature header payload dbi
+ *
+ */
+
/* This is the *only* module users of rpmlib should need to include */
/* and it shouldn't need these :-( */
#include "header.h"
#include "popt.h"
-typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
-
#ifdef __cplusplus
extern "C" {
#endif
/*@out@*/ const char **rp) /*@modifies *np, *vp, *rp @*/;
/**
+ * Retrieve file names from header.
+ * The representation of file names in package headers changed in rpm-4.0.
+ * Originally, file names were stored as an array of paths. In rpm-4.0,
+ * file names are stored as separate arrays of dirname's and basename's,
+ * with a dirname index to associate the correct dirname with each basname.
+ * This function is used to retrieve file names independent of how the
+ * file names are represented in the package header.
+ *
* @param h header
+ * @retval fileListPtr address of array of file names
+ * @retval fileCountPtr address of number of files
*/
-void rpmBuildFileList(Header h,/*@out@*/ const char *** fileListPtr,
+void rpmBuildFileList(Header h, /*@out@*/ const char *** fileListPtr,
/*@out@*/ int * fileCountPtr)
/*@modifies *fileListPtr, *fileCountPtr @*/;
/**
* Retrieve tag info from header.
- * XXX This is a "dressed" entry to headerGetEntry to do:
+ * This is a "dressed" entry to headerGetEntry to do:
* 1) DIRNAME/BASENAME/DIRINDICES -> FILENAMES tag conversions.
* 2) i18n lookaside (if enabled).
*
* @param h header
* @param tag tag
* @retval type address of tag value data type
- * @retval p address of pointer to tag value
+ * @retval p address of pointer to tag value(s)
* @retval c address of number of values
* @return 0 on success, 1 on bad magic, 2 on error
*/
/**
* Retrieve tag info from header.
- * XXX Yet Another dressed entry to unify signature/header tag retrieval.
+ * Yet Another "dressed" entry to headerGetEntry in order to unify
+ * signature/header tag retrieval.
* @param leadp rpm lead
* @param h header
* @param sigs signatures
* @param tag tag
* @retval type address of tag value data type
- * @retval p address of pointer to tag value
+ * @retval p address of pointer to tag value(s)
* @retval c address of number of values
* @return 0 on success, 1 on bad magic, 2 on error
*/
int_32 tag, int_32 *type, void **p, int_32 *c)
/*@modifies *type, *p, *c @*/;
-/** */
+/**
+ * Automatically generated table of tag name/value pairs.
+ */
extern const struct headerTagTableEntry rpmTagTable[];
-/** */
+
+/**
+ * Number of entries in rpmTagTable.
+ */
extern const int rpmTagTableSize;
-/* this chains to headerDefaultFormats[] */
-/** */
+/**
+ * Table of query format extensions.
+ * @note Chains to headerDefaultFormats[].
+ */
extern const struct headerSprintfExtension rpmHeaderFormats[];
/* these pseudo-tags are used by the dbi iterator interface */
#define isDependsMULTILIB(_dflags) ((_dflags) & RPMSENSE_MULTILIB)
+#define xfree(_p) free((void *)_p)
+
+/* ==================================================================== */
+/** \name RPMRC */
+/*@{*/
/* Stuff for maintaining "variables" like SOURCEDIR, BUILDDIR, etc */
/* #define RPMVAR_SOURCEDIR 0 -- No longer used */
#define RPMVAR_NUM 55 /* number of RPMVAR entries */
-#define xfree(_p) free((void *)_p)
-
-/** rpmrc.c **/
-
-/**
+/** \ingroup rpmrc
+ * Return value of rpmrc variable.
+ * @deprecated Use rpmExpand() with appropriate macro expression.
*/
const char * rpmGetVar(int var);
-/**
+/** \ingroup rpmrc
+ * Set value of rpmrc variable.
+ * @deprecated Use rpmDefineMacro() to change appropriate macro instead.
*/
void rpmSetVar(int var, const char *val);
+/** \ingroup rpmrc
+ * Build and install arch/os table identifiers.
+ */
#define RPM_MACHTABLE_INSTARCH 0
#define RPM_MACHTABLE_INSTOS 1
#define RPM_MACHTABLE_BUILDARCH 2
#define RPM_MACHTABLE_BUILDOS 3
#define RPM_MACHTABLE_COUNT 4 /* number of arch/os tables */
-/**
+/** \ingroup rpmrc
+ * Read rpmrc (and macro) configuration file(s) for a target.
+ * @param file colon separated files to read (NULL uses default)
+ * @param target target platform (NULL uses default)
+ * @return 0 on success, -1 on error
*/
int rpmReadConfigFiles(const char * file, const char * target);
-/**
+/** \ingroup rpmrc
+ * Read rpmrc (and macro) configuration file(s).
+ * @param file colon separated files to read (NULL uses default)
+ * @return 0 on succes
*/
int rpmReadRC(const char * file);
-/**
+/** \ingroup rpmrc
+ * Return current arch name and/or number.
+ * @retval name address of arch name (or NULL)
+ * @retval num address of arch number (or NULL)
*/
void rpmGetArchInfo( /*@out@*/ const char ** name, /*@out@*/ int * num);
-/**
+/** \ingroup rpmrc
+ * Return current os name and/or number.
+ * @retval name address of os name (or NULL)
+ * @retval num address of os number (or NULL)
*/
void rpmGetOsInfo( /*@out@*/ const char ** name, /*@out@*/ int * num);
-/**
+/** \ingroup rpmrc
+ * Return arch/os score of a name.
+ * An arch score measures the nearness of an arch name to the currently
+ * running (or defined) platform arch. For example, the score of "i586"
+ * on an i686 platform is (usually) 1. The arch score is used to select
+ * one of several otherwise identical packages based on the arch/os hints
+ * in the header of the intended platform.
+ *
+ * @param type any of the RPM_MACHTABLE_* constants
+ * @param name name
+ * @return arch score
*/
int rpmMachineScore(int type, const char * name);
-/**
+/** \ingroup rpmrc
+ * Display current rpmrc (and macro) configuration.
+ * @param f output file handle
+ * @return 0 always
*/
int rpmShowRC(FILE *f);
-/**
+/** \ingroup rpmrc
+ * @param archTable
+ * @param osTable
*/
void rpmSetTables(int archTable, int osTable); /* only used by build code */
-/* if either are NULL, they are set to the default value (munged uname())
- pushed through a translation table (if appropriate) */
-/**
+/** \ingroup rpmrc
+ * Set current arch/os names.
+ * NULL as argument is set to the default value (munged uname())
+ * pushed through a translation table (if appropriate).
+ *
+ * @param arch arch name (or NULL)
+ * @param os os name (or NULL)
*/
void rpmSetMachine(const char * arch, const char * os);
-/**
+/** \ingroup rpmrc
+ * Return current arch/os names.
+ * @retval arch address of arch name (or NULL)
+ * @retval os address of os name (or NULL)
*/
void rpmGetMachine( /*@out@*/ const char **arch, /*@out@*/ const char **os);
-/**
+/** \ingroup rpmrc
+ * Destroy rpmrc arch/os compatibility tables.
*/
void rpmFreeRpmrc(void);
+/*@}*/
/* ==================================================================== */
-/** **/
+/** \name RPMDB */
+/*@{*/
typedef /*@abstract@*/ struct rpmdb_s * rpmdb;
+typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
-/**
+/** \ingroup rpmdb
+ * Open rpm database.
* @param root path to top of install tree
* @retval dbp address of rpm database
- * @return
+ * @param mode open(2) flags: O_RDWR or O_RDONLY (O_CREAT also)
+ * @param perms database permissions
+ * @return 0 on success
*/
int rpmdbOpen (const char * root, /*@out@*/ rpmdb * dbp, int mode, int perms);
- /* 0 on error */
-/**
+/** \ingroup rpmdb
* Initialize database.
* @param root path to top of install tree
* @param perms database permissions
- * @return
+ * @return 0 on success
*/
int rpmdbInit(const char * root, int perms);
- /* nonzero on error */
-/**
+/** \ingroup rpmdb
* Close all database indices and free rpmdb.
* @param rpmdb rpm database
* @return 0 always
*/
int rpmdbClose ( /*@only@*/ rpmdb rpmdb);
-/**
+/** \ingroup rpmdb
* Sync all database indices.
* @param rpmdb rpm database
* @return 0 always
*/
int rpmdbSync (rpmdb rpmdb);
-/**
+/** \ingroup rpmdb
* Open all database indices.
* @param rpmdb rpm database
* @return 0 always
*/
int rpmdbOpenAll (rpmdb rpmdb);
-/**
+/** \ingroup rpmdb
* Return number of instances of package in rpm database.
* @param db rpm database
* @param name rpm package name
*/
int rpmdbCountPackages(rpmdb db, const char *name);
-/**
+/** \ingroup rpmdb
*/
typedef /*@abstract@*/ struct _rpmdbMatchIterator * rpmdbMatchIterator;
-/**
+/** \ingroup rpmdb
* Destroy rpm database iterator.
* @param mi rpm database iterator
*/
void rpmdbFreeIterator( /*@only@*/ rpmdbMatchIterator mi);
-/**
+/** \ingroup rpmdb
* Return rpm database used by iterator.
* @param mi rpm database iterator
* @return rpm database handle
*/
rpmdb rpmdbGetIteratorRpmDB(rpmdbMatchIterator mi);
-/**
+/** \ingroup rpmdb
* Return join key for current position of rpm database iterator.
* @param mi rpm database iterator
* @return current 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
* Append items to set of package instances to iterate.
* @param mi rpm database iterator
* @param hdrNums array of package instances
*/
int rpmdbAppendIterator(rpmdbMatchIterator mi, int * hdrNums, int nHdrNums);
-/**
+/** \ingroup rpmdb
* Remove items from set of package instances to iterate.
* @param mi rpm database iterator
* @param hdrNums array of package instances
int rpmdbPruneIterator(rpmdbMatchIterator mi, int * hdrNums,
int nHdrNums, int sorted);
-/**
+/** \ingroup rpmdb
* Modify iterator to filter out headers that do not match version.
- * TODO: replace with a more general mechanism.
+ * @todo replace with a more general mechanism using RE's on tag content.
* @param mi rpm database iterator
* @param version version to check for
*/
void rpmdbSetIteratorVersion(rpmdbMatchIterator mi, /*@kept@*/ const char * version);
-/**
+/** \ingroup rpmdb
* Modify iterator to filter out headers that do not match release.
- * TODO: replace with a more general mechanism.
+ * @todo replace with a more general mechanism using RE's on tag content.
* @param mi rpm database iterator
* @param release release to check for
*/
void rpmdbSetIteratorRelease(rpmdbMatchIterator mi, /*@kept@*/ const char * release);
-/**
+/** \ingroup rpmdb
* Modify iterator to mark header for lazy write.
- * TODO: replace with a more general mechanism.
* @param mi rpm database iterator
* @param modified new value of modified
* @return previous value
*/
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
-/**
+/** \ingroup rpmdb
* Return next package header from iteration.
* @param mi rpm database iterator
* @return NULL on end of iteration.
*/
Header rpmdbNextIterator(rpmdbMatchIterator mi);
-Header XrpmdbNextIterator(rpmdbMatchIterator mi, const char * f, unsigned int l);
#define rpmdbNextIterator(_a) \
XrpmdbNextIterator(_a, __FILE__, __LINE__)
+Header XrpmdbNextIterator(rpmdbMatchIterator mi, const char * f, unsigned int l);
-/**
+/** \ingroup rpmdb
* Return database iterator.
* @param rpmdb rpm database
* @param rpmtag rpm tag
/*@kept@*/ rpmdb rpmdb, int rpmtag,
const void * key, size_t keylen);
-/**
+/** \ingroup rpmdb
* Remove package header from rpm database and indices.
* @param rpmdb rpm database
* @param offset location in Packages dbi
*/
int rpmdbRemove(rpmdb db, unsigned int offset);
-/**
+/** \ingroup rpmdb
* Add package header to rpm database and indices.
* @param rpmdb rpm database
* @param rpmtag rpm tag
*/
int rpmdbAdd(rpmdb rpmdb, Header dbentry);
-/**
+/** \ingroup rpmdb
+ * Rebuild database indices from package headers.
* @param root path to top of install tree
*/
int rpmdbRebuild(const char * root);
+/*@}*/
+/* ==================================================================== */
+/** \name RPMPROBS */
+/*@{*/
+
+/** */
+typedef enum rpmProblemType_e { RPMPROB_BADARCH,
+ RPMPROB_BADOS,
+ RPMPROB_PKG_INSTALLED,
+ RPMPROB_BADRELOCATE,
+ RPMPROB_REQUIRES,
+ RPMPROB_CONFLICT,
+ RPMPROB_NEW_FILE_CONFLICT,
+ RPMPROB_FILE_CONFLICT,
+ RPMPROB_OLDPACKAGE,
+ RPMPROB_DISKSPACE,
+ RPMPROB_BADPRETRANS
+ } rpmProblemType;
+
+/** */
+typedef /*@abstract@*/ struct rpmProblem_s {
+ Header h, altH;
+/*@dependent@*/ const void * key;
+ rpmProblemType type;
+ int ignoreProblem;
+/*@only@*/ const char * str1;
+ unsigned long ulong1;
+} rpmProblem;
+
+/** */
+typedef /*@abstract@*/ struct rpmProblemSet_s {
+ int numProblems;
+ int numProblemsAlloced;
+ rpmProblem * probs;
+} * rpmProblemSet;
+
+/**
+ */
+void printDepFlags(FILE *fp, const char *version, int flags)
+ /*@modifies *fp @*/;
+
+/**
+ */
+struct rpmDependencyConflict {
+ char * byName, * byVersion, * byRelease;
+ Header byHeader;
+ /* these needs fields are misnamed -- they are used for the package
+ which isn't needed as well */
+ char * needsName, * needsVersion;
+ int needsFlags;
+ /*@observer@*/ /*@null@*/ const void * suggestedPackage; /* NULL if none */
+ enum { RPMDEP_SENSE_REQUIRES, RPMDEP_SENSE_CONFLICTS } sense;
+} ;
+
+/**
+ */
+void printDepProblems(FILE *fp, struct rpmDependencyConflict *conflicts,
+ int numConflicts) /*@modifies *fp @*/;
+
+/**
+ */
+/*@only@*/ const char * rpmProblemString(rpmProblem prob) /*@*/;
+
+/**
+ */
+void rpmProblemPrint(FILE *fp, rpmProblem prob) /*@modifies *fp @*/;
+
+/**
+ */
+void rpmProblemSetPrint(FILE *fp, rpmProblemSet probs) /*@modifies *fp @*/;
+
+/**
+ */
+void rpmProblemSetFree( /*@only@*/ rpmProblemSet probs);
+
+/*@}*/
/* ==================================================================== */
+/** \name RPMTS */
+/*@{*/
/* we pass these around as an array with a sentinel */
typedef struct rpmRelocation_s {
- const char * oldPath; /* NULL here evals to RPMTAG_DEFAULTPREFIX, */
/* XXX for backwards compatibility */
- const char * newPath; /* NULL means to omit the file completely! */
+ const char * oldPath; /*!< NULL here evals to RPMTAG_DEFAULTPREFIX, */
+ const char * newPath; /*!< NULL means to omit the file completely! */
} rpmRelocation;
*/
int rpmVersionCompare(Header first, Header second);
-
-/**
- * @param root path to top of install tree
- * @param h header
- */
-int rpmVerifyFile(const char * root, Header h, int filenum,
- /*@out@*/ int * result, int omitMask);
-
-/**
- * @param root path to top of install tree
- * @param h header
- * @param err file handle
- */
-int rpmVerifyScript(const char * root, Header h, FD_t err);
-
/* Transaction sets are inherently unordered! RPM may reorder transaction
sets to reduce errors. In general, installs/upgrades are done before
strict removals, and prerequisite ordering is done on installs/upgrades. */
typedef /*@abstract@*/ struct rpmTransactionSet_s * rpmTransactionSet;
-struct rpmDependencyConflict {
- char * byName, * byVersion, * byRelease;
- Header byHeader;
- /* these needs fields are misnamed -- they are used for the package
- which isn't needed as well */
- char * needsName, * needsVersion;
- int needsFlags;
- /*@observer@*/ /*@null@*/ const void * suggestedPackage; /* NULL if none */
- enum { RPMDEP_SENSE_REQUIRES, RPMDEP_SENSE_CONFLICTS } sense;
-} ;
-
-/**
+/** \ingroup rpmtrans
* Create an empty transaction set.
* @param rpmdb rpm database (may be NULL if database is not accessed)
* @param rootdir path to top of install tree
/*@only@*/ rpmTransactionSet rpmtransCreateSet( /*@only@*/ rpmdb rpmdb,
const char * rootdir);
-/**
+/** \ingroup rpmtrans
* Add package to be installed to unordered transaction set.
*
* If fd is NULL, the callback specified in rpmtransCreateSet() is used to
/*@owned@*/ const void * key, int update,
rpmRelocation * relocs);
-/**
+/** \ingroup rpmtrans
* Add package to universe of possible packages to install in transaction set.
* @param rpmdep rpm transaction set
* @param h header
void rpmtransAvailablePackage(rpmTransactionSet rpmdep, Header h,
/*@owned@*/ const void * key);
-/**
+/** \ingroup rpmtrans
* Add package to be removed to unordered transaction set.
* @param rpmdep rpm transaction set
* @param dboffset rpm database instance
*/
void rpmtransRemovePackage(rpmTransactionSet rpmdep, int dboffset);
-/**
+/** \ingroup rpmtrans
* Destroy transaction set.
* @param rpmdep rpm transaction set
*/
void rpmtransFree( /*@only@*/ rpmTransactionSet rpmdep);
-/**
+/** \ingroup rpmtrans
* @param ts rpm transaction set
* @param fd file handle
*/
void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd);
/* this checks for dependency satisfaction, but *not* ordering */
-/**
+/** \ingroup rpmtrans
* @param rpmdep rpm transaction set
*/
int rpmdepCheck(rpmTransactionSet rpmdep,
check is done, use rpmdepCheck() for that. If dependencies are not
satisfied a "best-try" ordering is returned. */
-/**
+/** \ingroup rpmtrans
* @param order rpm transaction set
*/
int rpmdepOrder(rpmTransactionSet order);
-/**
+/** \ingroup rpmtrans
* Destroy dependency conflicts.
* @param conflicts dependency conflicts
* @param numConflicts no. of dependency conflicts
#define RPMTRANS_FLAG_KEEPOBSOLETE (1 << 7)
#define RPMTRANS_FLAG_MULTILIB (1 << 8)
-/**
+/** \ingroup rpmdep
* Compare two versioned dependency ranges, looking for overlap.
* @param AName 1st dependncy name string
* @param AEVR 1st dependency [epoch:]version[-release] string
int rpmRangesOverlap(const char *AName, const char *AEVR, int AFlags,
const char *BName, const char *BEVR, int BFlags) /*@*/;
-/**
+/** \ingroup rpmdep
* Check dependency against internal rpmlib feature provides.
* @param keyName dependency name string
* @param keyEVR dependency [epoch:]version[-release] string
int rpmCheckRpmlibProvides(const char * keyName, const char * keyEVR,
int keyFlags) /*@*/;
-/**
+/** \ingroup rpmcli
+ * Display current rpmlib feature provides.
+ * @param fp output file handle
*/
void rpmShowRpmlibProvides(FILE * fp) /*@modifies *fp @*/;
-/** */
-typedef enum rpmProblemType_e { RPMPROB_BADARCH,
- RPMPROB_BADOS,
- RPMPROB_PKG_INSTALLED,
- RPMPROB_BADRELOCATE,
- RPMPROB_REQUIRES,
- RPMPROB_CONFLICT,
- RPMPROB_NEW_FILE_CONFLICT,
- RPMPROB_FILE_CONFLICT,
- RPMPROB_OLDPACKAGE,
- RPMPROB_DISKSPACE,
- RPMPROB_BADPRETRANS
- } rpmProblemType;
-
-/** */
-typedef /*@abstract@*/ struct rpmProblem_s {
- Header h, altH;
-/*@dependent@*/ const void * key;
- rpmProblemType type;
- int ignoreProblem;
-/*@only@*/ const char * str1;
- unsigned long ulong1;
-} rpmProblem;
-
-/** */
-typedef /*@abstract@*/ struct rpmProblemSet_s {
- int numProblems;
- int numProblemsAlloced;
- rpmProblem * probs;
-} * rpmProblemSet;
-
-/**
- */
-void printDepFlags(FILE *fp, const char *version, int flags)
- /*@modifies *fp @*/;
-
-/**
- */
-void printDepProblems(FILE *fp, struct rpmDependencyConflict *conflicts,
- int numConflicts) /*@modifies *fp @*/;
-
-/**
- */
-/*@only@*/ const char * rpmProblemString(rpmProblem prob) /*@*/;
-
-/**
- */
-void rpmProblemPrint(FILE *fp, rpmProblem prob) /*@modifies *fp @*/;
-
-/**
- */
-void rpmProblemSetPrint(FILE *fp, rpmProblemSet probs) /*@modifies *fp @*/;
-
-/**
- */
-void rpmProblemSetFree( /*@only@*/ rpmProblemSet probs);
-
-/**
+/** \ingroup rpmtrans
* @param ts rpm transaction set
*/
int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
#define RPMPROB_FILTER_OLDPACKAGE (1 << 6)
#define RPMPROB_FILTER_DISKSPACE (1 << 7)
+/*@}*/
+
/** rpmlead.c **/
#define RPMLEAD_BINARY 0
#define RPMLEAD_SIZE 96
+/** \ingroup lead
+ */
struct rpmlead {
unsigned char magic[4];
unsigned char major, minor;
char reserved[16]; /* pads to 96 bytes -- 8 byte aligned! */
} ;
+/** \ingroup lead
+ */
struct oldrpmlead { /* for version 1 packages */
unsigned char magic[4];
unsigned char major, minor;
unsigned int archiveOffset;
} ;
-/** signature.c **/
-
-/**************************************************/
-/* */
-/* Signature Tags */
-/* */
-/* These go in the sig Header to specify */
-/* individual signature types. */
-/* */
-/**************************************************/
-
-#define RPMSIGTAG_SIZE 1000
-/* the md5 sum was broken *twice* on big endian machines */
-#define RPMSIGTAG_LEMD5_1 1001
-#define RPMSIGTAG_PGP 1002
-#define RPMSIGTAG_LEMD5_2 1003
-#define RPMSIGTAG_MD5 1004
-#define RPMSIGTAG_GPG 1005
-#define RPMSIGTAG_PGP5 1006 /* XXX legacy use only */
-
-/* Signature tags by Public Key Algorithm (RFC 2440) */
-/* N.B.: These tags are tenative, the values may change */
-#define RPMTAG_PK_BASE 2048
-#define RPMTAG_PK_RSA_ES RPMTAG_PK_BASE+1
-#define RPMTAG_PK_RSA_E RPMTAG_PK_BASE+2
-#define RPMTAG_PK_RSA_S RPMTAG_PK_BASE+3
-#define RPMTAG_PK_ELGAMAL_E RPMTAG_PK_BASE+16
-#define RPMTAG_PK_DSA RPMTAG_PK_BASE+17
-#define RPMTAG_PK_ELLIPTIC RPMTAG_PK_BASE+18
-#define RPMTAG_PK_ECDSA RPMTAG_PK_BASE+19
-#define RPMTAG_PK_ELGAMAL_ES RPMTAG_PK_BASE+20
-#define RPMTAG_PK_DH RPMTAG_PK_BASE+21
-
-#define RPMTAG_HASH_BASE 2048+64
-#define RPMTAG_HASH_MD5 RPMTAG_HASH_BASE+1
-#define RPMTAG_HASH_SHA1 RPMTAG_HASH_BASE+2
-#define RPMTAG_HASH_RIPEMD160 RPMTAG_HASH_BASE+3
-#define RPMTAG_HASH_MD2 RPMTAG_HASH_BASE+5
-#define RPMTAG_HASH_TIGER192 RPMTAG_HASH_BASE+6
-#define RPMTAG_HASH_HAVAL_5_160 RPMTAG_HASH_BASE+7
-
-/**************************************************/
-/* */
-/* verifySignature() results */
-/* */
-/**************************************************/
-
-/* verifySignature() results */
-#define RPMSIG_OK 0
-#define RPMSIG_UNKNOWN 1
-#define RPMSIG_BAD 2
-#define RPMSIG_NOKEY 3 /* Do not have the key to check this signature */
-#define RPMSIG_NOTTRUSTED 4 /* We have the key but it is not trusted */
-
-/**
- */
-void rpmFreeSignature(Header h);
-
-/**
- */
-int rpmVerifySignature(const char *file, int_32 sigTag, void *sig, int count,
- char *result);
-
/**
*/
void freeFilesystems(void);
int numFiles, /*@out@*/ uint_32 ** usagesPtr, int flags);
/* ==================================================================== */
+/** \name RPMBT */
+/*@{*/
/* --- build mode options */
+/** \ingroup rpmcli
+ */
struct rpmBuildArguments {
int buildAmount;
const char *buildRootOverride;
int shortCircuit;
char buildMode;
char buildChar;
- /*@dependent@*/ const char *rootdir;
+/*@dependent@*/ const char *rootdir;
};
+/** \ingroup rpmcli
+ */
typedef struct rpmBuildArguments BTA_t;
+/** \ingroup rpmcli
+ */
extern struct rpmBuildArguments rpmBTArgs;
+/** \ingroup rpmcli
+ */
extern struct poptOption rpmBuildPoptTable[];
+/*@}*/
/* ==================================================================== */
+/** \name RPMQV */
+/*@{*/
+
+/** \ingroup rpmcli
+ * @param root path to top of install tree
+ * @param h header
+ */
+int rpmVerifyFile(const char * root, Header h, int filenum,
+ /*@out@*/ int * result, int omitMask);
+
+/** \ingroup rpmcli
+ * @param root path to top of install tree
+ * @param h header
+ * @param err file handle
+ */
+int rpmVerifyScript(const char * root, Header h, FD_t err);
+
/* --- query/verify mode options */
/* XXX SPECFILE is not verify sources */
+/** \ingroup rpmcli
+ */
enum rpmQVSources { RPMQV_PACKAGE = 0, RPMQV_PATH, RPMQV_ALL, RPMQV_RPM,
RPMQV_GROUP, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES,
RPMQV_TRIGGEREDBY, RPMQV_DBOFFSET, RPMQV_SPECFILE };
+/** \ingroup rpmcli
+ */
struct rpmQVArguments {
enum rpmQVSources qva_source;
int qva_sourceCount; /* > 1 is an error */
char qva_mode;
char qva_char;
};
+/** \ingroup rpmcli
+ */
typedef struct rpmQVArguments QVA_t;
+/** \ingroup rpmcli
+ */
extern struct rpmQVArguments rpmQVArgs;
+/** \ingroup rpmcli
+ */
extern struct poptOption rpmQVSourcePoptTable[];
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param db rpm database
* @param h header to use for query/verify
*/
typedef int (*QVF_t) (QVA_t *qva, rpmdb db, Header h);
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param mi rpm database iterator
* @param showPackage query/verify routine
*/
int tagValue(const char *tagstr) /*@*/;
+/** \ingroup rpmcli
+ */
extern int specedit;
+
+/** \ingroup rpmcli
+ */
extern struct poptOption rpmQueryPoptTable[];
-/**
+/** \ingroup rpmcli
* @param f file handle to use for display
*/
void rpmDisplayQueryTags(FILE * f);
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param source type of source to query/verify
* @param arg name of source to query/verify
int rpmQueryVerify(QVA_t *qva, enum rpmQVSources source, const char * arg,
rpmdb db, QVF_t showPackage);
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param db rpm database (unused for queries)
* @param h header to use for query
*/
int showQueryPackage(QVA_t *qva, rpmdb db, Header h);
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param source type of source to query
* @param arg name of source to query
#define VERIFY_SCRIPT (1 << 11)
#define VERIFY_MD5 (1 << 12)
+/** \ingroup rpmcli
+ */
extern struct poptOption rpmVerifyPoptTable[];
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param db rpm database
* @param h header to use for verify
*/
int showVerifyPackage(QVA_t *qva, /*@only@*/ rpmdb db, Header h);
-/**
+/** \ingroup rpmcli
* @param qva parsed query/verify options
* @param source type of source to verify
* @param arg name of source to verify
*/
int rpmVerify(QVA_t *qva, enum rpmQVSources source, const char *arg);
+/*@}*/
/* ==================================================================== */
+/** \name RPMEIU */
+/*@{*/
/* --- install/upgrade/erase modes */
#define INSTALL_PERCENT (1 << 0)
#define UNINSTALL_ALLMATCHES (1 << 1)
-/**
+/** \ingroup rpmcli
* @param rootdir path to top of install tree
* @param argv array of package file names (NULL terminated)
*/
int rpmInstall(const char * rootdir, const char ** argv, int installFlags,
int interfaceFlags, int probFilter, rpmRelocation * relocations);
-/**
+/** \ingroup rpmcli
*/
int rpmInstallSource(const char * prefix, const char * arg, const char ** specFile,
char ** cookie);
-/**
+/** \ingroup rpmcli
* @param rootdir path to top of install tree
* @param argv array of package file names (NULL terminated)
*/
int rpmErase(const char * rootdir, const char ** argv, int uninstallFlags,
int interfaceFlags);
+/*@}*/
/* ==================================================================== */
+/** \name RPMK */
+/*@{*/
+
+/** signature.c **/
+
+/**************************************************/
+/* */
+/* Signature Tags */
+/* */
+/* These go in the sig Header to specify */
+/* individual signature types. */
+/* */
+/**************************************************/
+
+#define RPMSIGTAG_SIZE 1000
+/* the md5 sum was broken *twice* on big endian machines */
+#define RPMSIGTAG_LEMD5_1 1001
+#define RPMSIGTAG_PGP 1002
+#define RPMSIGTAG_LEMD5_2 1003
+#define RPMSIGTAG_MD5 1004
+#define RPMSIGTAG_GPG 1005
+#define RPMSIGTAG_PGP5 1006 /* XXX legacy use only */
+
+/* Signature tags by Public Key Algorithm (RFC 2440) */
+/* N.B.: These tags are tenative, the values may change */
+#define RPMTAG_PK_BASE 2048
+#define RPMTAG_PK_RSA_ES RPMTAG_PK_BASE+1
+#define RPMTAG_PK_RSA_E RPMTAG_PK_BASE+2
+#define RPMTAG_PK_RSA_S RPMTAG_PK_BASE+3
+#define RPMTAG_PK_ELGAMAL_E RPMTAG_PK_BASE+16
+#define RPMTAG_PK_DSA RPMTAG_PK_BASE+17
+#define RPMTAG_PK_ELLIPTIC RPMTAG_PK_BASE+18
+#define RPMTAG_PK_ECDSA RPMTAG_PK_BASE+19
+#define RPMTAG_PK_ELGAMAL_ES RPMTAG_PK_BASE+20
+#define RPMTAG_PK_DH RPMTAG_PK_BASE+21
+
+#define RPMTAG_HASH_BASE 2048+64
+#define RPMTAG_HASH_MD5 RPMTAG_HASH_BASE+1
+#define RPMTAG_HASH_SHA1 RPMTAG_HASH_BASE+2
+#define RPMTAG_HASH_RIPEMD160 RPMTAG_HASH_BASE+3
+#define RPMTAG_HASH_MD2 RPMTAG_HASH_BASE+5
+#define RPMTAG_HASH_TIGER192 RPMTAG_HASH_BASE+6
+#define RPMTAG_HASH_HAVAL_5_160 RPMTAG_HASH_BASE+7
+
+/**************************************************/
+/* */
+/* verifySignature() results */
+/* */
+/**************************************************/
+
+/* verifySignature() results */
+#define RPMSIG_OK 0
+#define RPMSIG_UNKNOWN 1
+#define RPMSIG_BAD 2
+#define RPMSIG_NOKEY 3 /* Do not have the key to check this signature */
+#define RPMSIG_NOTTRUSTED 4 /* We have the key but it is not trusted */
+
+/** \ingroup signature
+ */
+void rpmFreeSignature(Header h);
+
+/** \ingroup signature
+ */
+int rpmVerifySignature(const char *file, int_32 sigTag, void *sig, int count,
+ char *result);
+
/* --- checksig/resign */
#define CHECKSIG_PGP (1 << 0)
#define CHECKSIG_MD5 (1 << 1)
#define CHECKSIG_GPG (1 << 2)
-/**
+/** \ingroup rpmcli
* @param argv array of package file names (NULL terminated)
*/
int rpmCheckSig(int flags, const char ** argv);
-/**
+/** \ingroup rpmcli
* @param argv array of package file names (NULL terminated)
*/
int rpmReSign(int add, char *passPhrase, const char ** argv);
#define ADD_SIGNATURE 1
#define NEW_SIGNATURE 0
+/*@}*/
+
#ifdef __cplusplus
}
#endif
+/** \ingroup rpmdep
+ * \file lib/rpmlibprov.c
+ */
+
#include "system.h"
#include <rpmlib.h>
+/** \ingroup signature
+ * \file lib/signature.c
+ */
+
/* signature.c - RPM signature functions */
/* NOTES
#ifndef H_SIGNATURE
#define H_SIGNATURE
-/* signature.h - generate and verify signatures */
+/** \file lib/signature.h
+ * Generate and verify signatures.
+ */
#include <header.h>
+/**
+ * \file lib/stringbuf.c
+ */
+
#include "system.h"
#include "stringbuf.h"
#ifndef _STRINGBUF_H_
#define _STRINGBUF_H_
+/** \file lib/stringbuf.h
+ *
+ */
+
typedef /*@abstract@*/ struct StringBufRec *StringBuf;
#ifdef __cplusplus
+/**
+ * \file lib/stubs.c
+ */
+
/* XXX Portable shared libraries require rpmlib to contain these functions. */
#include "system.h"
+/**
+ * \file lib/tagName.c
+ */
+
#include "system.h"
#include <rpmlib.h>
+/** \ingroup rpmio
+ * \file lib/tufdio.c
+ */
+
#include "system.h"
#include <rpmlib.h>
+/** \ingroup rpmtrans payload
+ * \file lib/uninstall.c
+ */
+
#include "system.h"
#include <rpmlib.h>
if (fnlen > fnmaxlen)
fnmaxlen = fnlen;
}
- fnmaxlen += rootdir + sizeof("/"); /* XXX one byte too many */
+ fnmaxlen += rdlen + sizeof("/"); /* XXX one byte too many */
fileName = alloca(fnmaxlen);
+/** \ingroup rpmcli
+ * \file lib/verify.c
+ */
+
#include "system.h"
#include <rpmlib.h>