summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2000-08-30 17:47:53 +0000
committerjbj <devnull@localhost>2000-08-30 17:47:53 +0000
commit679aca04c8ffd077d3cd8e2ab3279899ee239b9a (patch)
treef34e024137297bd43065d2df836fed392e2eca92
parentc7b24dad58de9de732247194935112066908ff4c (diff)
downloadlibrpm-tizen-679aca04c8ffd077d3cd8e2ab3279899ee239b9a.tar.gz
librpm-tizen-679aca04c8ffd077d3cd8e2ab3279899ee239b9a.tar.bz2
librpm-tizen-679aca04c8ffd077d3cd8e2ab3279899ee239b9a.zip
Doxygen annotations.
CVS patchset: 4147 CVS date: 2000/08/30 17:47:53
-rw-r--r--build/parseBuildInstallClean.c3
-rw-r--r--build/parseFiles.c1
-rw-r--r--build/parsePreamble.c1
-rw-r--r--build/parsePrep.c1
-rw-r--r--build/parseScript.c1
-rw-r--r--build/parseSpec.c40
-rw-r--r--build/rpmbuild.h121
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/poptBT.c2
-rw-r--r--lib/rpmlib.h337
-rw-r--r--po/rpm.pot100
-rw-r--r--rpmio/messages.c2
-rw-r--r--rpmio/rpmerr.c20
-rw-r--r--rpmio/rpmerr.h152
-rw-r--r--rpmio/rpmio.h27
-rw-r--r--rpmio/rpmmessages.h50
16 files changed, 477 insertions, 383 deletions
diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c
index c43e722f3..e8147cef1 100644
--- a/build/parseBuildInstallClean.c
+++ b/build/parseBuildInstallClean.c
@@ -6,8 +6,7 @@
#include "rpmbuild.h"
-/** */
-int parseBuildInstallClean(Spec spec, int parsePart)
+int parseBuildInstallClean(Spec spec, rpmParseState parsePart)
{
int nextPart, rc;
StringBuf *sbp = NULL;
diff --git a/build/parseFiles.c b/build/parseFiles.c
index fe6d1293d..a0fb91da8 100644
--- a/build/parseFiles.c
+++ b/build/parseFiles.c
@@ -16,7 +16,6 @@
{ 0, 0, 0, 0, 0, NULL, NULL}
};
-/** */
int parseFiles(Spec spec)
{
int nextPart;
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 8a36fe717..c35b32c08 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -661,7 +661,6 @@ static int findPreambleTag(Spec spec, /*@out@*/int *tag, /*@out@*/char **macro,
return 0;
}
-/** */
int parsePreamble(Spec spec, int initialPackage)
{
int nextPart;
diff --git a/build/parsePrep.c b/build/parsePrep.c
index d28e249c8..a453a3e40 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -448,7 +448,6 @@ static int doPatchMacro(Spec spec, char *line)
return 0;
}
-/** */
int parsePrep(Spec spec)
{
int nextPart, res, rc;
diff --git a/build/parseScript.c b/build/parseScript.c
index 3e8fdf64d..aede86100 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -56,7 +56,6 @@ static int addTriggerIndex(Package pkg, const char *file, const char *script, co
/* We then pass the remaining arguments to parseRCPOT, along with */
/* an index we just determined. */
-/** */
int parseScript(Spec spec, int parsePart)
{
/* There are a few options to scripts: */
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 2a9446387..f9791d006 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -10,28 +10,30 @@ static int _debug = 0;
#include <rpmio_internal.h>
#include <rpmbuild.h>
+/**
+ */
static struct PartRec {
int part;
int len;
char *token;
} partList[] = {
- {PART_PREAMBLE, 0, "%package"},
- {PART_PREP, 0, "%prep"},
- {PART_BUILD, 0, "%build"},
- {PART_INSTALL, 0, "%install"},
- {PART_CLEAN, 0, "%clean"},
- {PART_PREUN, 0, "%preun"},
- {PART_POSTUN, 0, "%postun"},
- {PART_PRE, 0, "%pre"},
- {PART_POST, 0, "%post"},
- {PART_FILES, 0, "%files"},
- {PART_CHANGELOG, 0, "%changelog"},
- {PART_DESCRIPTION, 0, "%description"},
- {PART_TRIGGERPOSTUN, 0, "%triggerpostun"},
- {PART_TRIGGERUN, 0, "%triggerun"},
- {PART_TRIGGERIN, 0, "%triggerin"},
- {PART_TRIGGERIN, 0, "%trigger"},
- {PART_VERIFYSCRIPT, 0, "%verifyscript"},
+ { PART_PREAMBLE, 0, "%package"},
+ { PART_PREP, 0, "%prep"},
+ { PART_BUILD, 0, "%build"},
+ { PART_INSTALL, 0, "%install"},
+ { PART_CLEAN, 0, "%clean"},
+ { PART_PREUN, 0, "%preun"},
+ { PART_POSTUN, 0, "%postun"},
+ { PART_PRE, 0, "%pre"},
+ { PART_POST, 0, "%post"},
+ { PART_FILES, 0, "%files"},
+ { PART_CHANGELOG, 0, "%changelog"},
+ { PART_DESCRIPTION, 0, "%description"},
+ { PART_TRIGGERPOSTUN, 0, "%triggerpostun"},
+ { PART_TRIGGERUN, 0, "%triggerun"},
+ { PART_TRIGGERIN, 0, "%triggerin"},
+ { PART_TRIGGERIN, 0, "%trigger"},
+ { PART_VERIFYSCRIPT, 0, "%verifyscript"},
{0, 0, 0}
};
@@ -41,7 +43,7 @@ static inline void initParts(struct PartRec *p)
p->len = strlen(p->token);
}
-int isPart(char *line)
+rpmParseState isPart(const char *line)
{
char c;
struct PartRec *p;
@@ -355,7 +357,7 @@ int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
const char *buildRootURL, int inBuildArch, const char *passPhrase,
char *cookie, int anyarch, int force)
{
- int parsePart = PART_PREAMBLE;
+ rpmParseState parsePart = PART_PREAMBLE;
int initialPackage = 1;
#ifdef DYING
const char *saveArch;
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index e838bff84..8ef2ea58a 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -15,19 +15,22 @@
/* but this will be needed */
#include "rpmspec.h"
-/* from build/build.h */
-
-#define RPMBUILD_PREP (1 << 0)
-#define RPMBUILD_BUILD (1 << 1)
-#define RPMBUILD_INSTALL (1 << 2)
-#define RPMBUILD_CLEAN (1 << 3)
-#define RPMBUILD_FILECHECK (1 << 4)
-#define RPMBUILD_PACKAGESOURCE (1 << 5)
-#define RPMBUILD_PACKAGEBINARY (1 << 6)
-#define RPMBUILD_RMSOURCE (1 << 7)
-#define RPMBUILD_RMBUILD (1 << 8)
-#define RPMBUILD_STRINGBUF (1 << 9) /* only for doScript() */
-#define RPMBUILD_RMSPEC (1 << 10)
+/**
+ * Bit(s) to control buildSpec() operation.
+ */
+typedef enum rpmBuildFlags_e {
+ RPMBUILD_PREP = (1 << 0), /*!< Execute %%prep. */
+ RPMBUILD_BUILD = (1 << 1), /*!< Execute %%build. */
+ RPMBUILD_INSTALL = (1 << 2), /*!< Execute %%install. */
+ RPMBUILD_CLEAN = (1 << 3), /*!< Execute %%clean. */
+ RPMBUILD_FILECHECK = (1 << 4), /*!< Check %%files manifest. */
+ RPMBUILD_PACKAGESOURCE = (1 << 5), /*!< Create source package. */
+ RPMBUILD_PACKAGEBINARY = (1 << 6), /*!< Create binary package(s). */
+ RPMBUILD_RMSOURCE = (1 << 7), /*!< Remove source(s) and patch(s). */
+ RPMBUILD_RMBUILD = (1 << 8), /*!< Remove build sub-tree. */
+ RPMBUILD_STRINGBUF = (1 << 9), /*!< only for doScript() */
+ RPMBUILD_RMSPEC = (1 << 10) /*!< Remove spec file. */
+} rpmBuildFlags;
/* from build/misc.h */
@@ -40,26 +43,29 @@
#define PART_SUBNAME 0
#define PART_NAME 1
-/* from build/part.h */
-
-#define PART_NONE 0
-#define PART_PREAMBLE 1
-#define PART_PREP 2
-#define PART_BUILD 3
-#define PART_INSTALL 4
-#define PART_CLEAN 5
-#define PART_FILES 6
-#define PART_PRE 7
-#define PART_POST 8
-#define PART_PREUN 9
-#define PART_POSTUN 10
-#define PART_DESCRIPTION 11
-#define PART_CHANGELOG 12
-#define PART_TRIGGERIN 13
-#define PART_TRIGGERUN 14
-#define PART_VERIFYSCRIPT 15
-#define PART_BUILDARCHITECTURES 16
-#define PART_TRIGGERPOSTUN 17
+/**
+ * Spec file parser states.
+ */
+typedef enum rpmParseState_e {
+ PART_NONE = 0, /*!< */
+ PART_PREAMBLE = 1, /*!< */
+ PART_PREP = 2, /*!< */
+ PART_BUILD = 3, /*!< */
+ PART_INSTALL = 4, /*!< */
+ PART_CLEAN = 5, /*!< */
+ PART_FILES = 6, /*!< */
+ PART_PRE = 7, /*!< */
+ PART_POST = 8, /*!< */
+ PART_PREUN = 9, /*!< */
+ PART_POSTUN = 10, /*!< */
+ PART_DESCRIPTION = 11, /*!< */
+ PART_CHANGELOG = 12, /*!< */
+ PART_TRIGGERIN = 13, /*!< */
+ PART_TRIGGERUN = 14, /*!< */
+ PART_VERIFYSCRIPT = 15, /*!< */
+ PART_BUILDARCHITECTURES= 16,/*!< */
+ PART_TRIGGERPOSTUN = 17 /*!< */
+} rpmParseState;
/* from build/read.h */
@@ -96,10 +102,9 @@ void freeNames(void);
/* from build/read.h */
-/* returns 0 - success */
-/* 1 - EOF */
-/* <0 - error */
-/** */
+/**
+ * @return 0 on success, 1 on EOF, <0 on error
+ */
int readLine(Spec spec, int strip);
/** */
@@ -110,8 +115,12 @@ void handleComments(char *s);
/* from build/part.h */
-/** */
-int isPart(char *line);
+/**
+ * Check line for section separator, return next parser state.
+ * @param line from spec file
+ * @return next parser state
+ */
+rpmParseState isPart(const char *line);
/* from build/misc.h */
@@ -123,33 +132,47 @@ int parseNum(const char *line, /*@out@*/int *res);
/** */
void addChangelogEntry(Header h, time_t time, const char *name, const char *text);
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
+int parseBuildInstallClean(Spec spec, rpmParseState parsePart);
+
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parseChangelog(Spec spec);
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parseDescription(Spec spec);
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parseFiles(Spec spec);
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parsePreamble(Spec spec, int initialPackage);
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parsePrep(Spec spec);
/** */
int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, int index,
int flags);
-/** */
-int parseTrigger(Spec spec, Package pkg, char *field, int tag);
-
-/** */
+/**
+ * @return >= 0 next rpmParseState, < 0 on error
+ */
int parseScript(Spec spec, int parsePart);
/** */
-int parseBuildInstallClean(Spec spec, int parsePart);
+int parseTrigger(Spec spec, Package pkg, char *field, int tag);
/* from build/expression.h */
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e96a54e2f..7257d23ac 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -44,7 +44,7 @@ tagtable.c: rpmlib.h
@echo '#include "rpmlib.h"' >> tagtable.c
@echo '' >> tagtable.c
@echo 'const struct headerTagTableEntry rpmTagTable[] = {' >> tagtable.c
- @awk '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ { printf("\t{ \"%s\", %s },\n", $$2, $$3); }' < $(srcdir)/rpmlib.h >> tagtable.c
+ awk '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ { printf("\t{ \"%s\", %s },\n", ($$2 == "=" ? $$1 : $$2), $$3); }' < $(srcdir)/rpmlib.h >> tagtable.c
@echo ' { NULL, 0 }' >> tagtable.c
@echo '};' >> tagtable.c
@echo '' >> tagtable.c
diff --git a/lib/poptBT.c b/lib/poptBT.c
index d77913b79..0421016c8 100644
--- a/lib/poptBT.c
+++ b/lib/poptBT.c
@@ -1,4 +1,4 @@
-/**
+/** \ingroup rpmcli
* \file lib/poptBT.c
* Popt tables for build modes.
*/
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index 3b82d4bfa..783865f93 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -129,147 +129,151 @@ extern const struct headerSprintfExtension rpmHeaderFormats[];
#define RPMDBI_REMOVED 4
#define RPMDBI_AVAILABLE 5
-/* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
-/* XXX underscore prevents tagTable generation */
-#define RPMTAG_SIG_BASE 256
-#define RPMTAG_SIGSIZE RPMTAG_SIG_BASE+1
+/**
+ * Tags identify data in package headers
+ * @note tags should not have value 0!
+ */
+typedef enum rpmTag_e {
+
+/* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
/* the md5 sum was broken *twice* on big endian machines */
-#define RPMTAG_SIGLEMD5_1 RPMTAG_SIG_BASE+2
-#define RPMTAG_SIGPGP RPMTAG_SIG_BASE+3
-#define RPMTAG_SIGLEMD5_2 RPMTAG_SIG_BASE+4
-#define RPMTAG_SIGMD5 RPMTAG_SIG_BASE+5
-#define RPMTAG_SIGGPG RPMTAG_SIG_BASE+6
-#define RPMTAG_SIGPGP5 RPMTAG_SIG_BASE+7 /* internal */
-
-/* these tags are found in package headers */
-/* none of these can be 0 !! */
-
-#define RPMTAG_NAME 1000
-#define RPMTAG_VERSION 1001
-#define RPMTAG_RELEASE 1002
-#define RPMTAG_EPOCH 1003
+/* XXX 2nd underscore prevents tagTable generation */
+ RPMTAG_SIG_BASE = 256,
+ RPMTAG_SIGSIZE = RPMTAG_SIG_BASE+1,
+ RPMTAG_SIGLEMD5_1 = RPMTAG_SIG_BASE+2,
+ RPMTAG_SIGPGP = RPMTAG_SIG_BASE+3,
+ RPMTAG_SIGLEMD5_2 = RPMTAG_SIG_BASE+4,
+ RPMTAG_SIGMD5 = RPMTAG_SIG_BASE+5,
+ RPMTAG_SIGGPG = RPMTAG_SIG_BASE+6,
+ RPMTAG_SIGPGP5 = RPMTAG_SIG_BASE+7, /* internal */
+
+ RPMTAG_NAME = 1000,
+ RPMTAG_VERSION = 1001,
+ RPMTAG_RELEASE = 1002,
+ RPMTAG_EPOCH = 1003,
#define RPMTAG_SERIAL RPMTAG_EPOCH /* backward comaptibility */
-#define RPMTAG_SUMMARY 1004
-#define RPMTAG_DESCRIPTION 1005
-#define RPMTAG_BUILDTIME 1006
-#define RPMTAG_BUILDHOST 1007
-#define RPMTAG_INSTALLTIME 1008
-#define RPMTAG_SIZE 1009
-#define RPMTAG_DISTRIBUTION 1010
-#define RPMTAG_VENDOR 1011
-#define RPMTAG_GIF 1012
-#define RPMTAG_XPM 1013
-#define RPMTAG_LICENSE 1014
-#define RPMTAG_COPYRIGHT RPMTAG_LICENSE /* backward comaptibility */
-#define RPMTAG_PACKAGER 1015
-#define RPMTAG_GROUP 1016
-#define RPMTAG_CHANGELOG 1017 /* internal */
-#define RPMTAG_SOURCE 1018
-#define RPMTAG_PATCH 1019
-#define RPMTAG_URL 1020
-#define RPMTAG_OS 1021
-#define RPMTAG_ARCH 1022
-#define RPMTAG_PREIN 1023
-#define RPMTAG_POSTIN 1024
-#define RPMTAG_PREUN 1025
-#define RPMTAG_POSTUN 1026
-#define RPMTAG_OLDFILENAMES 1027 /* obsolete */
-#define RPMTAG_FILESIZES 1028
-#define RPMTAG_FILESTATES 1029
-#define RPMTAG_FILEMODES 1030
-#define RPMTAG_FILEUIDS 1031 /* internal */
-#define RPMTAG_FILEGIDS 1032 /* internal */
-#define RPMTAG_FILERDEVS 1033
-#define RPMTAG_FILEMTIMES 1034
-#define RPMTAG_FILEMD5S 1035
-#define RPMTAG_FILELINKTOS 1036
-#define RPMTAG_FILEFLAGS 1037
-#define RPMTAG_ROOT 1038 /* obsolete */
-#define RPMTAG_FILEUSERNAME 1039
-#define RPMTAG_FILEGROUPNAME 1040
-#define RPMTAG_EXCLUDE 1041 /* internal - depricated */
-#define RPMTAG_EXCLUSIVE 1042 /* internal - depricated */
-#define RPMTAG_ICON 1043
-#define RPMTAG_SOURCERPM 1044
-#define RPMTAG_FILEVERIFYFLAGS 1045
-#define RPMTAG_ARCHIVESIZE 1046
-#define RPMTAG_PROVIDENAME 1047
+ RPMTAG_SUMMARY = 1004,
+ RPMTAG_DESCRIPTION = 1005,
+ RPMTAG_BUILDTIME = 1006,
+ RPMTAG_BUILDHOST = 1007,
+ RPMTAG_INSTALLTIME = 1008,
+ RPMTAG_SIZE = 1009,
+ RPMTAG_DISTRIBUTION = 1010,
+ RPMTAG_VENDOR = 1011,
+ RPMTAG_GIF = 1012,
+ RPMTAG_XPM = 1013,
+ RPMTAG_LICENSE = 1014,
+#define RPMTAG_COPYRIGHT RPMTAG_LICENSE /* backward comaptibility */
+ RPMTAG_PACKAGER = 1015,
+ RPMTAG_GROUP = 1016,
+ RPMTAG_CHANGELOG = 1017, /*!< internal */
+ RPMTAG_SOURCE = 1018,
+ RPMTAG_PATCH = 1019,
+ RPMTAG_URL = 1020,
+ RPMTAG_OS = 1021,
+ RPMTAG_ARCH = 1022,
+ RPMTAG_PREIN = 1023,
+ RPMTAG_POSTIN = 1024,
+ RPMTAG_PREUN = 1025,
+ RPMTAG_POSTUN = 1026,
+ RPMTAG_OLDFILENAMES = 1027, /* obsolete */
+ RPMTAG_FILESIZES = 1028,
+ RPMTAG_FILESTATES = 1029,
+ RPMTAG_FILEMODES = 1030,
+ RPMTAG_FILEUIDS = 1031, /*!< internal */
+ RPMTAG_FILEGIDS = 1032, /*!< internal */
+ RPMTAG_FILERDEVS = 1033,
+ RPMTAG_FILEMTIMES = 1034,
+ RPMTAG_FILEMD5S = 1035,
+ RPMTAG_FILELINKTOS = 1036,
+ RPMTAG_FILEFLAGS = 1037,
+ RPMTAG_ROOT = 1038, /*!< obsolete */
+ RPMTAG_FILEUSERNAME = 1039,
+ RPMTAG_FILEGROUPNAME = 1040,
+ RPMTAG_EXCLUDE = 1041, /*!< internal - deprecated */
+ RPMTAG_EXCLUSIVE = 1042, /*!< internal - deprecated */
+ RPMTAG_ICON = 1043,
+ RPMTAG_SOURCERPM = 1044,
+ RPMTAG_FILEVERIFYFLAGS = 1045,
+ RPMTAG_ARCHIVESIZE = 1046,
+ RPMTAG_PROVIDENAME = 1047,
#define RPMTAG_PROVIDES RPMTAG_PROVIDENAME /* backward comaptibility */
-#define RPMTAG_REQUIREFLAGS 1048
-#define RPMTAG_REQUIRENAME 1049
-#define RPMTAG_REQUIREVERSION 1050
-#define RPMTAG_NOSOURCE 1051 /* internal */
-#define RPMTAG_NOPATCH 1052 /* internal */
-#define RPMTAG_CONFLICTFLAGS 1053
-#define RPMTAG_CONFLICTNAME 1054
-#define RPMTAG_CONFLICTVERSION 1055
-#define RPMTAG_DEFAULTPREFIX 1056 /* internal - deprecated */
-#define RPMTAG_BUILDROOT 1057
-#define RPMTAG_INSTALLPREFIX 1058 /* internal - deprecated */
-#define RPMTAG_EXCLUDEARCH 1059
-#define RPMTAG_EXCLUDEOS 1060
-#define RPMTAG_EXCLUSIVEARCH 1061
-#define RPMTAG_EXCLUSIVEOS 1062
-#define RPMTAG_AUTOREQPROV 1063 /* internal */
-#define RPMTAG_RPMVERSION 1064
-#define RPMTAG_TRIGGERSCRIPTS 1065
-#define RPMTAG_TRIGGERNAME 1066
-#define RPMTAG_TRIGGERVERSION 1067
-#define RPMTAG_TRIGGERFLAGS 1068
-#define RPMTAG_TRIGGERINDEX 1069
-#define RPMTAG_VERIFYSCRIPT 1079
-#define RPMTAG_CHANGELOGTIME 1080
-#define RPMTAG_CHANGELOGNAME 1081
-#define RPMTAG_CHANGELOGTEXT 1082
-#define RPMTAG_BROKENMD5 1083 /* internal */
-#define RPMTAG_PREREQ 1084 /* internal */
-#define RPMTAG_PREINPROG 1085
-#define RPMTAG_POSTINPROG 1086
-#define RPMTAG_PREUNPROG 1087
-#define RPMTAG_POSTUNPROG 1088
-#define RPMTAG_BUILDARCHS 1089
-#define RPMTAG_OBSOLETENAME 1090
+ RPMTAG_REQUIREFLAGS = 1048,
+ RPMTAG_REQUIRENAME = 1049,
+ RPMTAG_REQUIREVERSION = 1050,
+ RPMTAG_NOSOURCE = 1051, /*!< internal */
+ RPMTAG_NOPATCH = 1052, /*!< internal */
+ RPMTAG_CONFLICTFLAGS = 1053,
+ RPMTAG_CONFLICTNAME = 1054,
+ RPMTAG_CONFLICTVERSION = 1055,
+ RPMTAG_DEFAULTPREFIX = 1056, /*!< internal - deprecated */
+ RPMTAG_BUILDROOT = 1057,
+ RPMTAG_INSTALLPREFIX = 1058, /*!< internal - deprecated */
+ RPMTAG_EXCLUDEARCH = 1059,
+ RPMTAG_EXCLUDEOS = 1060,
+ RPMTAG_EXCLUSIVEARCH = 1061,
+ RPMTAG_EXCLUSIVEOS = 1062,
+ RPMTAG_AUTOREQPROV = 1063, /*!< internal */
+ RPMTAG_RPMVERSION = 1064,
+ RPMTAG_TRIGGERSCRIPTS = 1065,
+ RPMTAG_TRIGGERNAME = 1066,
+ RPMTAG_TRIGGERVERSION = 1067,
+ RPMTAG_TRIGGERFLAGS = 1068,
+ RPMTAG_TRIGGERINDEX = 1069,
+ RPMTAG_VERIFYSCRIPT = 1079,
+ RPMTAG_CHANGELOGTIME = 1080,
+ RPMTAG_CHANGELOGNAME = 1081,
+ RPMTAG_CHANGELOGTEXT = 1082,
+ RPMTAG_BROKENMD5 = 1083, /*!< internal */
+ RPMTAG_PREREQ = 1084, /*!< internal */
+ RPMTAG_PREINPROG = 1085,
+ RPMTAG_POSTINPROG = 1086,
+ RPMTAG_PREUNPROG = 1087,
+ RPMTAG_POSTUNPROG = 1088,
+ RPMTAG_BUILDARCHS = 1089,
+ RPMTAG_OBSOLETENAME = 1090,
#define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME /* backward comaptibility */
-#define RPMTAG_VERIFYSCRIPTPROG 1091
-#define RPMTAG_TRIGGERSCRIPTPROG 1092
-#define RPMTAG_DOCDIR 1093 /* internal */
-#define RPMTAG_COOKIE 1094
-#define RPMTAG_FILEDEVICES 1095
-#define RPMTAG_FILEINODES 1096
-#define RPMTAG_FILELANGS 1097
-#define RPMTAG_PREFIXES 1098
-#define RPMTAG_INSTPREFIXES 1099
-#define RPMTAG_TRIGGERIN 1100 /* internal */
-#define RPMTAG_TRIGGERUN 1101 /* internal */
-#define RPMTAG_TRIGGERPOSTUN 1102 /* internal */
-#define RPMTAG_AUTOREQ 1103 /* internal */
-#define RPMTAG_AUTOPROV 1104 /* internal */
-#define RPMTAG_CAPABILITY 1105 /* unused internal */
-#define RPMTAG_SOURCEPACKAGE 1106 /* internal */
-#define RPMTAG_OLDORIGFILENAMES 1107 /* obsolete */
-#define RPMTAG_BUILDPREREQ 1108 /* internal */
-#define RPMTAG_BUILDREQUIRES 1109 /* internal */
-#define RPMTAG_BUILDCONFLICTS 1110 /* internal */
-#define RPMTAG_BUILDMACROS 1111
-#define RPMTAG_PROVIDEFLAGS 1112
-#define RPMTAG_PROVIDEVERSION 1113
-#define RPMTAG_OBSOLETEFLAGS 1114
-#define RPMTAG_OBSOLETEVERSION 1115
-#define RPMTAG_DIRINDEXES 1116
-#define RPMTAG_BASENAMES 1117
-#define RPMTAG_DIRNAMES 1118
-#define RPMTAG_ORIGDIRINDEXES 1119 /* internal */
-#define RPMTAG_ORIGBASENAMES 1120 /* internal */
-#define RPMTAG_ORIGDIRNAMES 1121 /* internal */
-#define RPMTAG_OPTFLAGS 1122
-#define RPMTAG_DISTURL 1123
-#define RPMTAG_PAYLOADFORMAT 1124
-#define RPMTAG_PAYLOADCOMPRESSOR 1125
-#define RPMTAG_PAYLOADFLAGS 1126
-#define RPMTAG_MULTILIBS 1127
-
-#define RPMTAG_FIRSTFREE_TAG 1128 /* internal */
+ RPMTAG_VERIFYSCRIPTPROG = 1091,
+ RPMTAG_TRIGGERSCRIPTPROG = 1092,
+ RPMTAG_DOCDIR = 1093, /*!< internal */
+ RPMTAG_COOKIE = 1094,
+ RPMTAG_FILEDEVICES = 1095,
+ RPMTAG_FILEINODES = 1096,
+ RPMTAG_FILELANGS = 1097,
+ RPMTAG_PREFIXES = 1098,
+ RPMTAG_INSTPREFIXES = 1099,
+ RPMTAG_TRIGGERIN = 1100, /*!< internal */
+ RPMTAG_TRIGGERUN = 1101, /*!< internal */
+ RPMTAG_TRIGGERPOSTUN = 1102, /*!< internal */
+ RPMTAG_AUTOREQ = 1103, /*!< internal */
+ RPMTAG_AUTOPROV = 1104, /*!< internal */
+ RPMTAG_CAPABILITY = 1105, /*!< internal obsolete */
+ RPMTAG_SOURCEPACKAGE = 1106, /*!< internal */
+ RPMTAG_OLDORIGFILENAMES = 1107, /*!< obsolete */
+ RPMTAG_BUILDPREREQ = 1108, /*!< internal */
+ RPMTAG_BUILDREQUIRES = 1109, /*!< internal */
+ RPMTAG_BUILDCONFLICTS = 1110, /*!< internal */
+ RPMTAG_BUILDMACROS = 1111,
+ RPMTAG_PROVIDEFLAGS = 1112,
+ RPMTAG_PROVIDEVERSION = 1113,
+ RPMTAG_OBSOLETEFLAGS = 1114,
+ RPMTAG_OBSOLETEVERSION = 1115,
+ RPMTAG_DIRINDEXES = 1116,
+ RPMTAG_BASENAMES = 1117,
+ RPMTAG_DIRNAMES = 1118,
+ RPMTAG_ORIGDIRINDEXES = 1119, /*!< internal */
+ RPMTAG_ORIGBASENAMES = 1120, /*!< internal */
+ RPMTAG_ORIGDIRNAMES = 1121, /*!< internal */
+ RPMTAG_OPTFLAGS = 1122,
+ RPMTAG_DISTURL = 1123,
+ RPMTAG_PAYLOADFORMAT = 1124,
+ RPMTAG_PAYLOADCOMPRESSOR = 1125,
+ RPMTAG_PAYLOADFLAGS = 1126,
+ RPMTAG_MULTILIBS = 1127,
+ RPMTAG_FIRSTFREE_TAG /*!< internal */
+} rpmTag;
+
#define RPMTAG_EXTERNAL_TAG 1000000
/**
@@ -643,7 +647,7 @@ int rpmdbRebuild(const char * root);
/*@{*/
/**
- * Enumerate transaction set problems.
+ * Enumerate transaction set problem types.
*/
typedef enum rpmProblemType_e {
RPMPROB_BADARCH, /*!< package ... is for a different architecture */
@@ -671,10 +675,11 @@ typedef /*@abstract@*/ struct rpmProblem_s {
unsigned long ulong1;
} * rpmProblem;
-/** */
+/**
+ */
typedef /*@abstract@*/ struct rpmProblemSet_s {
- int numProblems;
- int numProblemsAlloced;
+ int numProblems; /*!< Current probs array size. */
+ int numProblemsAlloced; /*!< Allocated probs array size. */
rpmProblem probs; /*!< Array of specific problems. */
} * rpmProblemSet;
@@ -686,13 +691,16 @@ void printDepFlags(FILE *fp, const char *version, int flags)
/**
*/
struct rpmDependencyConflict {
- char * byName, * byVersion, * byRelease;
+ char * byName;
+ char * byVersion;
+ char * byRelease;
Header byHeader;
/* these needs fields are misnamed -- they are used for the package
which isn't needed as well */
- char * needsName, * needsVersion;
+ char * needsName;
+ char * needsVersion;
int needsFlags;
- /*@observer@*/ /*@null@*/ const void * suggestedPackage; /* NULL if none */
+/*@observer@*/ /*@null@*/ const void * suggestedPackage; /* NULL if none */
enum {
RPMDEP_SENSE_REQUIRES,
RPMDEP_SENSE_CONFLICTS
@@ -765,9 +773,12 @@ int rpmInstallSourcePackage(const char * root, FD_t fd, const char ** specFile,
*/
int rpmVersionCompare(Header first, Header second);
-/* 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. */
+/** \ingroup rpmtrans
+ * The RPM Transaction Set.
+ * 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;
/** \ingroup rpmtrans
@@ -1008,20 +1019,20 @@ int rpmGetFilesystemUsage(const char ** filelist, int_32 * fssizes,
/* ==================================================================== */
/** \name RPMBT */
/*@{*/
-/* --- build mode options */
/** \ingroup rpmcli
+ * Describe build command line request.
*/
struct rpmBuildArguments {
- int buildAmount;
- const char *buildRootOverride;
- char *targets;
- int useCatalog;
- int noLang;
- int noBuild;
- int shortCircuit;
- char buildMode;
- char buildChar;
+ int buildAmount; /*!< Bit(s) to control operation. */
+ const char *buildRootOverride; /*!< from --buildroot */
+ char *targets; /*!< Target platform(s), comma separated. */
+ int useCatalog; /*!< from --usecatalog */
+ int noLang; /*!< from --nolang */
+ int noBuild; /*!< from --nobuild */
+ int shortCircuit; /*!< from --short-circuit */
+ char buildMode; /*!< Build mode (one of "btBC") */
+ char buildChar; /*!< Build stage (one of "abcilps ") */
/*@dependent@*/ const char *rootdir;
};
/** \ingroup rpmcli
@@ -1123,13 +1134,13 @@ typedef enum rpmVerifyFlags_e {
*/
typedef struct rpmQVArguments {
rpmQVSources qva_source; /*!< Identify CLI arg type. */
- int qva_sourceCount; /*!< Exclusive check (>1 is error). */
- int qva_flags; /*!< Bit(s) to control operation. */
- int qva_verbose; /*!< (unused) */
- const char *qva_queryFormat; /*!< Format for headerSprintf(). */
- const char *qva_prefix; /*!< Path to top of install tree. */
- char qva_mode; /*!< 'q' is query, 'v' is verify mode */
- char qva_char; /*!< (unused) always ' ' */
+ int qva_sourceCount;/*!< Exclusive check (>1 is error). */
+ int qva_flags; /*!< Bit(s) to control operation. */
+ int qva_verbose; /*!< (unused) */
+ const char *qva_queryFormat;/*!< Format for headerSprintf(). */
+ const char *qva_prefix; /*!< Path to top of install tree. */
+ char qva_mode; /*!< 'q' is query, 'v' is verify mode. */
+ char qva_char; /*!< (unused) always ' ' */
} QVA_t;
/** \ingroup rpmcli
diff --git a/po/rpm.pot b/po/rpm.pot
index a878fda92..c7f220c7f 100644
--- a/po/rpm.pot
+++ b/po/rpm.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-08-29 16:42-0400\n"
+"POT-Creation-Date: 2000-08-30 13:29-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
-#: build.c:25 lib/rpminstall.c:458
+#: build.c:25 lib/rpminstall.c:459
#, c-format
msgid "cannot open %s/packages.rpm\n"
msgstr ""
@@ -1789,7 +1789,7 @@ msgstr ""
msgid "cannot create %s: %s\n"
msgstr ""
-#: build/parseBuildInstallClean.c:32
+#: build/parseBuildInstallClean.c:31
#, c-format
msgid "line %d: second %s"
msgstr ""
@@ -1822,17 +1822,17 @@ msgstr ""
msgid "line %d: Error parsing %%description: %s"
msgstr ""
-#: build/parseDescription.c:52 build/parseFiles.c:47 build/parseScript.c:174
+#: build/parseDescription.c:52 build/parseFiles.c:46 build/parseScript.c:173
#, c-format
msgid "line %d: Bad option %s: %s"
msgstr ""
-#: build/parseDescription.c:65 build/parseFiles.c:59 build/parseScript.c:187
+#: build/parseDescription.c:65 build/parseFiles.c:58 build/parseScript.c:186
#, c-format
msgid "line %d: Too many names: %s"
msgstr ""
-#: build/parseDescription.c:75 build/parseFiles.c:68 build/parseScript.c:197
+#: build/parseDescription.c:75 build/parseFiles.c:67 build/parseScript.c:196
#, c-format
msgid "line %d: Package does not exist: %s"
msgstr ""
@@ -1842,11 +1842,11 @@ msgstr ""
msgid "line %d: Second description"
msgstr ""
-#: build/parseFiles.c:33
+#: build/parseFiles.c:32
msgid "line %d: Error parsing %%files: %s"
msgstr ""
-#: build/parseFiles.c:75
+#: build/parseFiles.c:74
msgid "line %d: Second %%files list"
msgstr ""
@@ -1911,7 +1911,7 @@ msgstr ""
msgid "line %d: Illegal char '-' in %s: %s"
msgstr ""
-#: build/parsePreamble.c:439 build/parseSpec.c:386
+#: build/parsePreamble.c:439 build/parseSpec.c:388
#, c-format
msgid "BuildRoot can not be \"/\": %s"
msgstr ""
@@ -1941,22 +1941,22 @@ msgstr ""
msgid "Internal error: Bogus tag %d"
msgstr ""
-#: build/parsePreamble.c:682
+#: build/parsePreamble.c:681
#, c-format
msgid "Bad package specification: %s"
msgstr ""
-#: build/parsePreamble.c:688
+#: build/parsePreamble.c:687
#, c-format
msgid "Package already exists: %s"
msgstr ""
-#: build/parsePreamble.c:715
+#: build/parsePreamble.c:714
#, c-format
msgid "line %d: Unknown tag: %s"
msgstr ""
-#: build/parsePreamble.c:740
+#: build/parsePreamble.c:739
msgid "Spec file can't use BuildRoot"
msgstr ""
@@ -2016,7 +2016,7 @@ msgstr ""
msgid "line %d: Bad arg to %%patch: %s"
msgstr ""
-#: build/parsePrep.c:459
+#: build/parsePrep.c:458
msgid "line %d: second %%prep"
msgstr ""
@@ -2041,65 +2041,65 @@ msgstr ""
msgid "line %d: Version required: %s"
msgstr ""
-#: build/parseScript.c:142
+#: build/parseScript.c:141
#, c-format
msgid "line %d: triggers must have --: %s"
msgstr ""
-#: build/parseScript.c:152 build/parseScript.c:215
+#: build/parseScript.c:151 build/parseScript.c:214
#, c-format
msgid "line %d: Error parsing %s: %s"
msgstr ""
-#: build/parseScript.c:162
+#: build/parseScript.c:161
#, c-format
msgid "line %d: script program must begin with '/': %s"
msgstr ""
-#: build/parseScript.c:206
+#: build/parseScript.c:205
#, c-format
msgid "line %d: Second %s"
msgstr ""
-#: build/parseSpec.c:136
+#: build/parseSpec.c:138
#, c-format
msgid "line %d: %s"
msgstr ""
#. XXX Fstrerror
-#: build/parseSpec.c:188
+#: build/parseSpec.c:190
#, c-format
msgid "Unable to open %s: %s\n"
msgstr ""
-#: build/parseSpec.c:200
+#: build/parseSpec.c:202
msgid "Unclosed %%if"
msgstr ""
-#: build/parseSpec.c:271
+#: build/parseSpec.c:273
#, c-format
msgid "%s:%d: parseExpressionBoolean returns %d"
msgstr ""
#. Got an else with no %if !
-#: build/parseSpec.c:279
+#: build/parseSpec.c:281
msgid "%s:%d: Got a %%else with no if"
msgstr ""
#. Got an end with no %if !
-#: build/parseSpec.c:290
+#: build/parseSpec.c:292
msgid "%s:%d: Got a %%endif with no if"
msgstr ""
-#: build/parseSpec.c:304 build/parseSpec.c:313
+#: build/parseSpec.c:306 build/parseSpec.c:315
msgid "malformed %%include statement"
msgstr ""
-#: build/parseSpec.c:489
+#: build/parseSpec.c:491
msgid "No buildable architectures"
msgstr ""
-#: build/parseSpec.c:544
+#: build/parseSpec.c:546
msgid "Package has no %%description: %s"
msgstr ""
@@ -2886,7 +2886,7 @@ msgstr ""
msgid "old format source packages cannot be queried\n"
msgstr ""
-#: lib/query.c:523 lib/rpminstall.c:240
+#: lib/query.c:523 lib/rpminstall.c:241
#, c-format
msgid "%s does not appear to be a RPM package\n"
msgstr ""
@@ -2950,7 +2950,7 @@ msgstr ""
msgid "record %d could not be read\n"
msgstr ""
-#: lib/query.c:701 lib/rpminstall.c:471
+#: lib/query.c:701 lib/rpminstall.c:472
#, c-format
msgid "package %s is not installed\n"
msgstr ""
@@ -3227,104 +3227,104 @@ msgstr ""
msgid "failed to remove directory %s: %s\n"
msgstr ""
-#: lib/rpminstall.c:134
+#: lib/rpminstall.c:135
msgid "counting packages to install\n"
msgstr ""
-#: lib/rpminstall.c:138
+#: lib/rpminstall.c:139
#, c-format
msgid "found %d packages\n"
msgstr ""
-#: lib/rpminstall.c:143
+#: lib/rpminstall.c:144
msgid "looking for packages to download\n"
msgstr ""
-#: lib/rpminstall.c:158
+#: lib/rpminstall.c:159
#, c-format
msgid "skipping %s - rpmGlob failed(%d)\n"
msgstr ""
-#: lib/rpminstall.c:173
+#: lib/rpminstall.c:174
#, c-format
msgid "Retrieving %s\n"
msgstr ""
#. XXX undefined %{name}/%{version}/%{release} here
#. XXX %{_tmpdir} does not exist
-#: lib/rpminstall.c:183
+#: lib/rpminstall.c:184
#, c-format
msgid " ... as %s\n"
msgstr ""
-#: lib/rpminstall.c:187
+#: lib/rpminstall.c:188
#, c-format
msgid "skipping %s - transfer failed - %s\n"
msgstr ""
-#: lib/rpminstall.c:214
+#: lib/rpminstall.c:215
#, c-format
msgid "retrieved %d packages\n"
msgstr ""
-#: lib/rpminstall.c:226 lib/rpminstall.c:395
+#: lib/rpminstall.c:227 lib/rpminstall.c:396
#, c-format
msgid "cannot open file %s: %s\n"
msgstr ""
-#: lib/rpminstall.c:244 lib/rpminstall.c:536
+#: lib/rpminstall.c:245 lib/rpminstall.c:537
#, c-format
msgid "%s cannot be installed\n"
msgstr ""
-#: lib/rpminstall.c:259
+#: lib/rpminstall.c:260
#, c-format
msgid "cannot open Packages database in %s\n"
msgstr ""
-#: lib/rpminstall.c:279
+#: lib/rpminstall.c:280
#, c-format
msgid "package %s is not relocateable\n"
msgstr ""
-#: lib/rpminstall.c:324
+#: lib/rpminstall.c:325
#, c-format
msgid "error reading from file %s\n"
msgstr ""
-#: lib/rpminstall.c:329
+#: lib/rpminstall.c:330
#, c-format
msgid "file %s requires a newer version of RPM\n"
msgstr ""
-#: lib/rpminstall.c:346
+#: lib/rpminstall.c:347
#, c-format
msgid "found %d source and %d binary packages\n"
msgstr ""
-#: lib/rpminstall.c:357
+#: lib/rpminstall.c:358
msgid "failed dependencies:\n"
msgstr ""
-#: lib/rpminstall.c:375
+#: lib/rpminstall.c:376
msgid "installing binary packages\n"
msgstr ""
-#: lib/rpminstall.c:474
+#: lib/rpminstall.c:475
#, c-format
msgid "\"%s\" specifies multiple packages\n"
msgstr ""
-#: lib/rpminstall.c:497
+#: lib/rpminstall.c:498
msgid "removing these packages would break dependencies:\n"
msgstr ""
-#: lib/rpminstall.c:525
+#: lib/rpminstall.c:526
#, c-format
msgid "cannot open %s: %s\n"
msgstr ""
-#: lib/rpminstall.c:531
+#: lib/rpminstall.c:532
#, c-format
msgid "Installing %s\n"
msgstr ""
diff --git a/rpmio/messages.c b/rpmio/messages.c
index a508eeeea..45c782f00 100644
--- a/rpmio/messages.c
+++ b/rpmio/messages.c
@@ -33,7 +33,7 @@ int rpmIsVerbose(void)
return (minLevel <= RPMMESS_VERBOSE);
}
-void rpmMessage(int level, const char * format, ...) {
+void rpmMessage(rpmmsgLevel level, const char * format, ...) {
va_list args;
va_start(args, format);
diff --git a/rpmio/rpmerr.c b/rpmio/rpmerr.c
index 8ddb3d8b3..d447e7ec1 100644
--- a/rpmio/rpmerr.c
+++ b/rpmio/rpmerr.c
@@ -7,27 +7,25 @@
#include <stdarg.h>
#include <rpmerr.h>
+/*@access rpmerrRec @*/
-static struct err {
- int code;
- char string[1024];
-} errorRec;
+static struct rpmerrRec_s _rpmerrRec;
static rpmErrorCallBackType errorCallback = NULL;
int rpmErrorCode(void)
{
- return errorRec.code;
+ return _rpmerrRec.code;
}
-char *rpmErrorCodeString(void)
+const char *rpmErrorCodeString(rpmerrCode code)
{
return NULL;
}
char *rpmErrorString(void)
{
- return errorRec.string;
+ return _rpmerrRec.string;
}
rpmErrorCallBackType rpmErrorSetCallback(rpmErrorCallBackType cb)
@@ -40,19 +38,19 @@ rpmErrorCallBackType rpmErrorSetCallback(rpmErrorCallBackType cb)
return ocb;
}
-void rpmError(int code, char *format, ...)
+void rpmError(rpmerrCode code, const char *format, ...)
{
va_list args;
va_start(args, format);
- errorRec.code = code;
- vsprintf(errorRec.string, format, args);
+ _rpmerrRec.code = code;
+ vsprintf(_rpmerrRec.string, format, args);
if (errorCallback) {
errorCallback();
} else {
- fputs(errorRec.string, stderr);
+ fputs(_rpmerrRec.string, stderr);
fputs("\n", stderr);
}
}
diff --git a/rpmio/rpmerr.h b/rpmio/rpmerr.h
index 453e1b38f..c3867e3e0 100644
--- a/rpmio/rpmerr.h
+++ b/rpmio/rpmerr.h
@@ -5,80 +5,112 @@
* \file rpmio/rpmerr.h
*/
-#define RPMERR_GDBMOPEN -2 /* gdbm open failed */
-#define RPMERR_GDBMREAD -3 /* gdbm read failed */
-#define RPMERR_GDBMWRITE -4 /* gdbm write failed */
-#define RPMERR_INTERNAL -5 /* internal RPM error */
-#define RPMERR_DBCORRUPT -6 /* rpm database is corrupt */
-#define RPMERR_OLDDBCORRUPT -7 /* old style rpm database is corrupt */
-#define RPMERR_OLDDBMISSING -8 /* old style rpm database is missing */
-#define RPMERR_NOCREATEDB -9 /* cannot create new database */
-#define RPMERR_DBOPEN -10 /* database open failed */
-#define RPMERR_DBGETINDEX -11 /* database get from index failed */
-#define RPMERR_DBPUTINDEX -12 /* database get from index failed */
-#define RPMERR_NEWPACKAGE -13 /* package is too new to handle */
-#define RPMERR_BADMAGIC -14 /* bad magic for an RPM */
-#define RPMERR_RENAME -15 /* rename(2) failed */
-#define RPMERR_UNLINK -16 /* unlink(2) failed */
-#define RPMERR_RMDIR -17 /* rmdir(2) failed */
-#define RPMERR_PKGINSTALLED -18 /* package already installed */
-#define RPMERR_CHOWN -19 /* chown() call failed */
-#define RPMERR_NOUSER -20 /* user does not exist */
-#define RPMERR_NOGROUP -21 /* group does not exist */
-#define RPMERR_MKDIR -22 /* mkdir() call failed */
-#define RPMERR_FILECONFLICT -23 /* file being installed exists */
-#define RPMERR_RPMRC -24 /* bad line in rpmrc */
-#define RPMERR_NOSPEC -25 /* .spec file is missing */
-#define RPMERR_NOTSRPM -26 /* a source rpm was expected */
-#define RPMERR_FLOCK -27 /* locking the database failed */
-#define RPMERR_OLDPACKAGE -28 /* trying upgrading to old version */
-/*#define RPMERR_BADARCH -29 bad architecture or arch mismatch */
-#define RPMERR_CREATE -30 /* failed to create a file */
-#define RPMERR_NOSPACE -31 /* out of disk space */
-#define RPMERR_NORELOCATE -32 /* tried to do improper relocatation */
-/*#define RPMERR_BADOS -33 bad architecture or arch mismatch */
-#define RPMMESS_BACKUP -34 /* backup made during [un]install */
-#define RPMERR_MTAB -35 /* failed to read mount table */
-#define RPMERR_STAT -36 /* failed to stat something */
-#define RPMERR_BADDEV -37 /* file on device not listed in mtab */
-#define RPMMESS_ALTNAME -38 /* file written as .rpmnew */
-#define RPMMESS_PREREQLOOP -39 /* loop in prerequisites */
-#define RPMERR_BADRELOCATE -40 /* bad relocation was specified */
-#define RPMERR_OLDDB -41 /* old format database */
+/**
+ * Tokens used by rpmError().
+ */
+typedef enum rpmerrCode_e {
+ RPMERR_GDBMOPEN = -2, /*!< gdbm open failed */
+ RPMERR_GDBMREAD = -3, /*!< gdbm read failed */
+ RPMERR_GDBMWRITE = -4, /*!< gdbm write failed */
+ RPMERR_INTERNAL = -5, /*!< internal RPM error */
+ RPMERR_DBCORRUPT = -6, /*!< rpm database is corrupt */
+ RPMERR_OLDDBCORRUPT = -7, /*!< old style rpm database is corrupt */
+ RPMERR_OLDDBMISSING = -8, /*!< old style rpm database is missing */
+ RPMERR_NOCREATEDB = -9, /*!< cannot create new database */
+ RPMERR_DBOPEN = -10, /*!< database open failed */
+ RPMERR_DBGETINDEX = -11, /*!< database get from index failed */
+ RPMERR_DBPUTINDEX = -12, /*!< database get from index failed */
+ RPMERR_NEWPACKAGE = -13, /*!< package is too new to handle */
+ RPMERR_BADMAGIC = -14, /*!< bad magic for an RPM */
+ RPMERR_RENAME = -15, /*!< rename(2) failed */
+ RPMERR_UNLINK = -16, /*!< unlink(2) failed */
+ RPMERR_RMDIR = -17, /*!< rmdir(2) failed */
+ RPMERR_PKGINSTALLED = -18, /*!< package already installed */
+ RPMERR_CHOWN = -19, /*!< chown() call failed */
+ RPMERR_NOUSER = -20, /*!< user does not exist */
+ RPMERR_NOGROUP = -21, /*!< group does not exist */
+ RPMERR_MKDIR = -22, /*!< mkdir() call failed */
+ RPMERR_FILECONFLICT = -23, /*!< file being installed exists */
+ RPMERR_RPMRC = -24, /*!< bad line in rpmrc */
+ RPMERR_NOSPEC = -25, /*!< .spec file is missing */
+ RPMERR_NOTSRPM = -26, /*!< a source rpm was expected */
+ RPMERR_FLOCK = -27, /*!< locking the database failed */
+ RPMERR_OLDPACKAGE = -28, /*!< trying upgrading to old version */
+/* RPMERR_BADARCH = -29, bad architecture or arch mismatch */
+ RPMERR_CREATE = -30, /*!< failed to create a file */
+ RPMERR_NOSPACE = -31, /*!< out of disk space */
+ RPMERR_NORELOCATE = -32, /*!< tried to do improper relocatation */
+/* RPMERR_BADOS = -33, bad architecture or arch mismatch */
+ RPMMESS_BACKUP = -34, /*!< backup made during [un]install */
+ RPMERR_MTAB = -35, /*!< failed to read mount table */
+ RPMERR_STAT = -36, /*!< failed to stat something */
+ RPMERR_BADDEV = -37, /*!< file on device not listed in mtab */
+ RPMMESS_ALTNAME = -38, /*!< file written as .rpmnew */
+ RPMMESS_PREREQLOOP = -39, /*!< loop in prerequisites */
+ RPMERR_BADRELOCATE = -40, /*!< bad relocation was specified */
+ RPMERR_OLDDB = -41, /*!< old format database */
/* spec.c build.c pack.c */
-#define RPMERR_UNMATCHEDIF -107 /* unclosed %ifarch or %ifos */
-#define RPMERR_BADARG -109
-#define RPMERR_SCRIPT -110 /* errors related to script exec */
-#define RPMERR_READERROR -111
-#define RPMERR_UNKNOWNOS -112
-#define RPMERR_UNKNOWNARCH -113
-#define RPMERR_EXEC -114
-#define RPMERR_FORK -115
-#define RPMERR_CPIO -116
-#define RPMERR_GZIP -117
-#define RPMERR_BADSPEC -118
-#define RPMERR_LDD -119 /* couldn't understand ldd output */
-#define RPMERR_BADFILENAME -120
+ RPMERR_UNMATCHEDIF = -107, /*!< unclosed %ifarch or %ifos */
+ RPMERR_BADARG = -109, /*!< @todo Document. */
+ RPMERR_SCRIPT = -110, /*!< errors related to script exec */
+ RPMERR_READERROR = -111, /*!< @todo Document. */
+ RPMERR_UNKNOWNOS = -112, /*!< @todo Document. */
+ RPMERR_UNKNOWNARCH = -113, /*!< @todo Document. */
+ RPMERR_EXEC = -114, /*!< @todo Document. */
+ RPMERR_FORK = -115, /*!< @todo Document. */
+ RPMERR_CPIO = -116, /*!< @todo Document. */
+ RPMERR_GZIP = -117, /*!< @todo Document. */
+ RPMERR_BADSPEC = -118, /*!< @todo Document. */
+ RPMERR_LDD = -119, /*!< couldn't understand ldd output */
+ RPMERR_BADFILENAME = -120, /*!< @todo Document. */
-#define RPMERR_BADSIGTYPE -200 /* Unknown signature type */
-#define RPMERR_SIGGEN -201 /* Error generating signature */
+ RPMERR_BADSIGTYPE = -200, /*!< Unknown signature type */
+ RPMERR_SIGGEN = -201 /*!< Error generating signature */
+} rpmerrCode;
#ifdef __cplusplus
extern "C" {
#endif
+/**
+ */
typedef void (*rpmErrorCallBackType)(void);
+/**
+ */
#if defined(__GNUC__)
-void rpmError(int code, char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+void rpmError(rpmerrCode code, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
#else
-void rpmError(int code, char * format, ...);
+void rpmError(rpmerrCode code, const char * format, ...);
#endif
-int rpmErrorCode(void);
-char *rpmErrorCodeString(void);
-char *rpmErrorString(void);
+/**
+ * @todo Implement or eliminate.
+ * @return NULL always
+ */
+/*@observer@*/ /*@null@*/ const char * rpmErrorCodeString( /*@unused@*/ rpmerrCode code);
+
+/**
+ * @todo Implement or eliminate.
+ */
+typedef /*@abstract@*/ struct rpmerrRec_s {
+ rpmerrCode code;
+ char string[1024];
+} * rpmerrRec;
+
+/**
+ * @return error record code
+ */
+rpmerrCode rpmErrorCode(void);
+
+/**
+ * @return error record string
+ */
+char * rpmErrorString(void);
+
+/**
+ */
rpmErrorCallBackType rpmErrorSetCallback(rpmErrorCallBackType);
#ifdef __cplusplus
diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h
index b60e23b2b..29b246d2d 100644
--- a/rpmio/rpmio.h
+++ b/rpmio/rpmio.h
@@ -355,19 +355,20 @@ int fdReadable(FD_t fd, int secs);
/*
* Support for FTP and HTTP I/O.
*/
-#define FTPERR_BAD_SERVER_RESPONSE -1
-#define FTPERR_SERVER_IO_ERROR -2
-#define FTPERR_SERVER_TIMEOUT -3
-#define FTPERR_BAD_HOST_ADDR -4
-#define FTPERR_BAD_HOSTNAME -5
-#define FTPERR_FAILED_CONNECT -6
-#define FTPERR_FILE_IO_ERROR -7
-#define FTPERR_PASSIVE_ERROR -8
-#define FTPERR_FAILED_DATA_CONNECT -9
-#define FTPERR_FILE_NOT_FOUND -10
-#define FTPERR_NIC_ABORT_IN_PROGRESS -11
-#define FTPERR_UNKNOWN -100
-
+typedef enum ftperrCode_e {
+ FTPERR_BAD_SERVER_RESPONSE = -1, /*!< */
+ FTPERR_SERVER_IO_ERROR = -2, /*!< */
+ FTPERR_SERVER_TIMEOUT = -3, /*!< */
+ FTPERR_BAD_HOST_ADDR = -4, /*!< */
+ FTPERR_BAD_HOSTNAME = -5, /*!< */
+ FTPERR_FAILED_CONNECT = -6, /*!< */
+ FTPERR_FILE_IO_ERROR = -7, /*!< */
+ FTPERR_PASSIVE_ERROR = -8, /*!< */
+ FTPERR_FAILED_DATA_CONNECT = -9, /*!< */
+ FTPERR_FILE_NOT_FOUND = -10, /*!< */
+ FTPERR_NIC_ABORT_IN_PROGRESS= -11, /*!< */
+ FTPERR_UNKNOWN = -100 /*!< */
+} ftperrCode;
/** \ingroup rpmio
*/
diff --git a/rpmio/rpmmessages.h b/rpmio/rpmmessages.h
index 4c337033f..d2eaeef89 100644
--- a/rpmio/rpmmessages.h
+++ b/rpmio/rpmmessages.h
@@ -5,13 +5,16 @@
* \file rpmio/rpmmessages.h
*/
-#define RPMMESS_DEBUG 1
-#define RPMMESS_VERBOSE 2
-#define RPMMESS_NORMAL 3
-#define RPMMESS_WARNING 4
-#define RPMMESS_ERROR 5
-#define RPMMESS_FATALERROR 6
-
+/**
+ */
+typedef enum rpmmsgLevel_e {
+ RPMMESS_DEBUG = 1, /*!< */
+ RPMMESS_VERBOSE = 2, /*!< */
+ RPMMESS_NORMAL = 3, /*!< */
+ RPMMESS_WARNING = 4, /*!< */
+ RPMMESS_ERROR = 5, /*!< */
+ RPMMESS_FATALERROR = 6 /*!< */
+} rpmmsgLevel;
#define RPMMESS_QUIET (RPMMESS_NORMAL + 1)
typedef enum rpmCallbackType_e {
@@ -31,7 +34,12 @@ typedef enum rpmCallbackType_e {
extern "C" {
#endif
+/**
+ */
typedef void * rpmCallbackData;
+
+/**
+ */
typedef void * (*rpmCallbackFunction)(const void * h,
const rpmCallbackType what,
const unsigned long amount,
@@ -39,15 +47,39 @@ typedef void * (*rpmCallbackFunction)(const void * h,
const void * pkgKey,
rpmCallbackData data);
-void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
+/**
+ */
+void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
int notifyCount);
+/**
+ */
void rpmIncreaseVerbosity(void);
+
+/**
+ */
void rpmSetVerbosity(int level);
+
+/**
+ */
int rpmGetVerbosity(void);
+
+/**
+ */
int rpmIsVerbose(void);
+
+/**
+ */
int rpmIsDebug(void);
-void rpmMessage(int level, const char * format, ...);
+
+/**
+ */
+#if defined(__GNUC__)
+void rpmMessage(rpmmsgLevel level, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+#else
+void rpmMessage(rpmmsgLevel level, const char * format, ...);
+#endif
+
#ifdef __cplusplus
}