From 8bd997f2e0d977ddde56ea4debad83197355a2c9 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 13 Jul 1999 21:37:57 +0000 Subject: [PATCH] Perl bindings need #include not #include "foo.h" CVS patchset: 3143 CVS date: 1999/07/13 21:37:57 --- build/parseReqs.c | 18 ++++++++++++------ lib/Makefile.am | 2 +- lib/cpio.h | 2 +- lib/dbindex.c | 2 +- lib/depends.c | 4 +++- lib/depends.h | 13 ++++++++++--- lib/falloc.c | 2 +- lib/falloc.h | 8 ++++++++ lib/formats.c | 4 +++- lib/fprint.c | 3 +-- lib/fprint.h | 22 +++++++++++++++------- lib/fs.c | 4 ++-- lib/ftp.c | 6 +++--- lib/hash.c | 3 +-- lib/hash.h | 8 ++++++++ lib/header.c | 4 ++-- lib/install.c | 4 ++-- lib/install.h | 11 +++++++++-- lib/lookup.c | 2 +- lib/lookup.h | 10 +++++++++- lib/macro.c | 4 ++-- lib/md5.h | 16 ++++++++++++---- lib/messages.c | 2 +- lib/misc.c | 4 ++-- lib/misc.h | 8 ++++++++ lib/oldheader.c | 2 +- lib/oldheader.h | 20 ++++++++++++++------ lib/oldrpmdb.h | 10 +++++++++- lib/package.c | 2 +- lib/problems.c | 4 +++- lib/query.c | 2 +- lib/rebuilddb.c | 4 ++-- lib/rpmbzio.c | 5 ++--- lib/rpmdb.c | 4 ++-- lib/rpmdb.h | 11 +++++------ lib/rpmerr.c | 2 +- lib/rpmlead.c | 2 +- lib/rpmlead.h | 10 +++++++++- lib/rpmlib.h | 8 ++++---- lib/rpmrc.c | 4 ++-- lib/signature.c | 4 ++-- lib/signature.h | 10 +++++++++- lib/stringbuf.h | 8 ++++++++ lib/tagName.c | 3 ++- lib/test.c | 2 +- lib/transaction.c | 4 ++-- lib/tread.c | 2 +- lib/tread.h | 14 -------------- lib/uninstall.c | 2 +- lib/url.c | 2 +- lib/verify.c | 4 ++-- po/rpm.pot | 38 +++++++++++++++++++------------------- rpmio/macro.c | 4 ++-- rpmio/messages.c | 2 +- rpmio/rpmerr.c | 2 +- rpmpopt | 4 +++- 56 files changed, 230 insertions(+), 131 deletions(-) delete mode 100644 lib/tread.h diff --git a/build/parseReqs.c b/build/parseReqs.c index 32fe6d8..f2a753e 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -7,21 +7,27 @@ static struct ReqComp { int sense; } ReqComparisons[] = { { "<=", RPMSENSE_LESS | RPMSENSE_EQUAL}, - { "<=S", RPMSENSE_LESS | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, { "=<", RPMSENSE_LESS | RPMSENSE_EQUAL}, - { "==", RPMSENSE_GREATER | RPMSENSE_EQUAL}, - { ">=S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, { "=>", RPMSENSE_GREATER | RPMSENSE_EQUAL}, - { "=>S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, { ">", RPMSENSE_GREATER}, + +#if defined(RPMSENSE_SERIAL) + { "<=S", RPMSENSE_LESS | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, + { "==S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, + { "=>S", RPMSENSE_GREATER | RPMSENSE_EQUAL | RPMSENSE_SERIAL}, { ">S", RPMSENSE_GREATER | RPMSENSE_SERIAL}, +#endif /* RPMSENSE_SERIAL */ + { NULL, 0 }, }; diff --git a/lib/Makefile.am b/lib/Makefile.am index 5d23649..35f9713 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,7 +14,7 @@ pkginc_HEADERS = \ noinst_HEADERS = \ cpio.h depends.h falloc.h fprint.h hash.h install.h \ lookup.h md5.h oldheader.h oldrpmdb.h rpm_malloc.h \ - rpmdb.h rpmlead.h signature.h tread.h + rpmdb.h rpmlead.h signature.h lib_LTLIBRARIES = librpm.la librpm_la_SOURCES = \ diff --git a/lib/cpio.h b/lib/cpio.h index 4386cc5..8099634 100644 --- a/lib/cpio.h +++ b/lib/cpio.h @@ -4,7 +4,7 @@ #include #include -#include "rpmio.h" +#include /* Note the CPIO_CHECK_ERRNO bit is set only if errno is valid. These have to be positive numbers or this setting the high bit stuff is a bad idea. */ diff --git a/lib/dbindex.c b/lib/dbindex.c index 0f590b6..f1c7ace 100644 --- a/lib/dbindex.c +++ b/lib/dbindex.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include int dbiIndexSetCount(dbiIndexSet set) { return set.count; diff --git a/lib/depends.c b/lib/depends.c index 2a1d0ca..98f8015 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include #include "depends.h" #include "misc.h" @@ -805,9 +805,11 @@ int headerMatchesDepFlags(Header h, const char * reqInfo, int reqFlags) { /* Get package information from header */ headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epochval, &count); if (epochval == NULL) { +#if defined(RPMSENSE_SERIAL) /* XXX old behavior looks fishy */ if (reqFlags & RPMSENSE_SERIAL) return 0; +#endif /* RPMSENSE_SERIAL */ epoch = "0"; } else { sprintf(buf, "%d", *epochval); diff --git a/lib/depends.h b/lib/depends.h index 1831cca..3543fd7 100644 --- a/lib/depends.h +++ b/lib/depends.h @@ -1,9 +1,7 @@ #ifndef H_DEPENDS #define H_DEPENDS -#include "header.h" - -int headerMatchesDepFlags(Header h, const char * reqInfo, int reqFlags); +#include struct availablePackage { Header h; @@ -63,5 +61,14 @@ struct problemsSet { int alloced; }; +#ifdef __cplusplus +extern "C" { +#endif + +int headerMatchesDepFlags(Header h, const char * reqInfo, int reqFlags); + +#ifdef __cplusplus +} +#endif #endif /* H_DEPENDS */ diff --git a/lib/falloc.c b/lib/falloc.c index 38b00fe..56b1689 100644 --- a/lib/falloc.c +++ b/lib/falloc.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmio.h" +#include #include "falloc.h" #define FA_MAGIC 0x02050920 diff --git a/lib/falloc.h b/lib/falloc.h index 99c8d17..46155ca 100644 --- a/lib/falloc.h +++ b/lib/falloc.h @@ -17,6 +17,10 @@ struct FaPlace_s; typedef struct FaPlace * faPlace; #endif +#ifdef __cplusplus +extern "C" { +#endif + /* flags here is the same as for open(2) - NULL returned on error */ faFile faOpen(char * path, int flags, int perms); unsigned int faAlloc(faFile fa, unsigned int size); /* returns 0 on failure */ @@ -30,4 +34,8 @@ int faFcntl(faFile fa, int op, void *lip); int faFirstOffset(faFile fa); int faNextOffset(faFile fa, unsigned int lastOffset); /* 0 at end */ +#ifdef __cplusplus +} +#endif + #endif /* H_FALLOC */ diff --git a/lib/formats.c b/lib/formats.c index 70789d2..fbf6b06 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include static char * permsFormat(int_32 type, const void * data, char * formatPrefix, int padding, int element); @@ -173,8 +173,10 @@ static char * depflagsFormat(int_32 type, const void * data, strcat(buf, ">"); if (anint & RPMSENSE_EQUAL) strcat(buf, "="); +#if defined(RPMSENSE_SERIAL) if (anint & RPMSENSE_SERIAL) strcat(buf, "S"); +#endif /* RPMSENSE_SERIAL */ val = malloc(5 + padding); strcat(formatPrefix, "s"); diff --git a/lib/fprint.c b/lib/fprint.c index feda47e..4bf9e2b 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -1,7 +1,6 @@ #include "system.h" -#include "rpmlib.h" - +#include #include "fprint.h" struct lookupCache { diff --git a/lib/fprint.h b/lib/fprint.h index d79a9ce..d1ba65f 100644 --- a/lib/fprint.h +++ b/lib/fprint.h @@ -7,6 +7,18 @@ typedef struct fingerprint_s { const char * basename; } fingerPrint; +/* only if !scarceMemory */ +#define fpFree(a) free((void *)(a).basename) + +#define FP_EQUAL(a, b) ((&(a) == &(b)) || \ + (((a).dev == (b).dev) && \ + ((a).ino == (b).ino) && \ + !strcmp((a).basename, (b).basename))) + +#ifdef __cplusplus +extern "C" { +#endif + /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */ fingerPrint fpLookup(const char * fullName, int scareMemory); unsigned int fpHashFunction(const void * string); @@ -15,12 +27,8 @@ int fpEqual(const void * key1, const void * key2); void fpLookupList(const char ** fullNames, fingerPrint * fpList, int numItems, int alreadySorted); -/* only if !scarceMemory */ -#define fpFree(a) free((void *)(a).basename) - -#define FP_EQUAL(a, b) ((&(a) == &(b)) || \ - (((a).dev == (b).dev) && \ - ((a).ino == (b).ino) && \ - !strcmp((a).basename, (b).basename))) +#ifdef __cplusplus +} +#endif #endif diff --git a/lib/fs.c b/lib/fs.c index 9555735..9e5c55b 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -1,7 +1,7 @@ #include "system.h" -#include "rpmlib.h" -#include "rpmmacro.h" +#include +#include struct fsinfo { char * mntPoint; diff --git a/lib/ftp.c b/lib/ftp.c index 6ddcb1b..e86c5e5 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -29,8 +29,8 @@ extern int h_errno; #include #include -#include "rpmlib.h" -#include "rpmio.h" +#include +#include #if !defined(HAVE_INET_ATON) int inet_aton(const char *cp, struct in_addr *inp); @@ -43,7 +43,7 @@ int inet_aton(const char *cp, struct in_addr *inp); #include "dns.h" #endif -#include "rpmurl.h" +#include #ifdef __MINT__ # ifndef EAGAIN diff --git a/lib/hash.c b/lib/hash.c index 26b2d83..34b61a8 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,7 +1,6 @@ #include "system.h" -#include "rpmlib.h" - +#include #include "hash.h" struct hashBucket { diff --git a/lib/hash.h b/lib/hash.h index 05e68fc..90166e2 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -3,6 +3,10 @@ typedef struct hashTable_s * hashTable; +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned int (*hashFunctionType)(const void * string); typedef int (*hashEqualityType)(const void * key1, const void * key2); @@ -21,4 +25,8 @@ int htGetEntry(hashTable ht, const void * key, void *** data, int * dataCount, /* returns 1 if the item is present, 0 otherwise */ int htHasEntry(hashTable ht, const void * key); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/header.c b/lib/header.c index 2d06caf..88d0440 100644 --- a/lib/header.c +++ b/lib/header.c @@ -11,8 +11,8 @@ #include -#include "rpmio.h" -#include "header.h" +#include +#include #define INDEX_MALLOC_SIZE 8 diff --git a/lib/install.c b/lib/install.c index a8e5fa0..0f1883a 100644 --- a/lib/install.c +++ b/lib/install.c @@ -1,12 +1,12 @@ #include "system.h" -#include "rpmlib.h" +#include #include "cpio.h" #include "install.h" #include "misc.h" #include "rpmdb.h" -#include "rpmmacro.h" +#include struct callbackInfo { unsigned long archiveSize; diff --git a/lib/install.h b/lib/install.h index b7c7606..564785a 100644 --- a/lib/install.h +++ b/lib/install.h @@ -1,8 +1,7 @@ #ifndef H_INSTALL #define H_INSTALL -#include "header.h" -#include "rpmlib.h" +#include struct sharedFile { int mainFileNumber; @@ -21,6 +20,10 @@ enum fileActions { FA_UNKNOWN = 0, FA_CREATE, FA_BACKUP, FA_SAVE, FA_SKIP, FA_ALTNAME, FA_REMOVE, FA_SKIPNSTATE }; enum fileTypes { XDIR, BDEV, CDEV, SOCK, PIPE, REG, LINK } ; +#ifdef __cplusplus +extern "C" { +#endif + int removeBinaryPackage(char * root, rpmdb db, unsigned int offset, int flags, enum fileActions * actions, FD_t scriptFd); int runInstScript(const char * prefix, Header h, int scriptTag, int progTag, @@ -39,4 +42,8 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, struct sharedFileInfo * sharedList, FD_t scriptFd); const char * fileActionString(enum fileActions a); +#ifdef __cplusplus +} +#endif + #endif /* H_INSTALL */ diff --git a/lib/lookup.c b/lib/lookup.c index 4d7bada..cab17bb 100644 --- a/lib/lookup.c +++ b/lib/lookup.c @@ -1,7 +1,7 @@ #include "system.h" +#include #include "lookup.h" -#include "rpmlib.h" /* 0 found matches */ /* 1 no matches */ diff --git a/lib/lookup.h b/lib/lookup.h index 7d4a749..010ad61 100644 --- a/lib/lookup.h +++ b/lib/lookup.h @@ -1,9 +1,17 @@ #ifndef H_LOOKUP #define H_LOOKUP -#include "rpmlib.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif int findMatches(rpmdb db, const char * name, const char * version, const char * release, dbiIndexSet * matches); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/macro.c b/lib/macro.c index 3776450..06944ac 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -26,10 +26,10 @@ typedef int FD_t; #define fdRead read #define fdClose close #else -#include "rpmlib.h" +#include #endif -#include "rpmmacro.h" +#include struct MacroContext globalMacroContext; diff --git a/lib/md5.h b/lib/md5.h index cebc073..b41be46 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -14,6 +14,15 @@ struct MD5Context { int doByteReverse; }; +/* + * This is needed to make RSAREF happy on some MS-DOS compilers. + */ +typedef /*@abstract@*/ struct MD5Context MD5_CTX; + +#ifdef __cplusplus +extern "C" { +#endif + void rpmMD5Init(struct MD5Context *context, int brokenEndian); void rpmMD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); @@ -28,9 +37,8 @@ int mdbinfile(const char *fn, unsigned char *bindigest); int mdfileBroken(const char *fn, unsigned char *digest); int mdbinfileBroken(const char *fn, unsigned char *bindigest); -/* - * This is needed to make RSAREF happy on some MS-DOS compilers. - */ -typedef /*@abstract@*/ struct MD5Context MD5_CTX; +#ifdef __cplusplus +} +#endif #endif /* MD5_H */ diff --git a/lib/messages.c b/lib/messages.c index c07853e..342ea2b 100644 --- a/lib/messages.c +++ b/lib/messages.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include static int minLevel = RPMMESS_NORMAL; diff --git a/lib/misc.c b/lib/misc.c index f0d019a..20a23e4 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -1,7 +1,7 @@ #include "system.h" -#include "rpmlib.h" -#include "rpmmacro.h" /* XXX for rpmGetPath */ +#include +#include /* XXX for rpmGetPath */ #include "misc.h" diff --git a/lib/misc.h b/lib/misc.h index d26a946..69e6d3b 100644 --- a/lib/misc.h +++ b/lib/misc.h @@ -4,6 +4,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + char ** splitString(const char * str, int length, char sep); void freeSplitString(char ** list); void stripTrailingSlashes(char * str); @@ -29,4 +33,8 @@ char * gidToGname(gid_t gid); int makeTempFile(const char * prefix, /*@out@*/const char ** fnptr, /*@out@*/FD_t * fdptr); char * currentDirectory(void); /* result needs to be freed */ +#ifdef __cplusplus +} +#endif + #endif /* H_MISC */ diff --git a/lib/oldheader.c b/lib/oldheader.c index cbd4d2d..3916246 100644 --- a/lib/oldheader.c +++ b/lib/oldheader.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include #include "misc.h" #include "oldheader.h" diff --git a/lib/oldheader.h b/lib/oldheader.h index e9484be..64c0bed 100644 --- a/lib/oldheader.h +++ b/lib/oldheader.h @@ -18,12 +18,6 @@ struct oldrpmFileInfo { int isdoc; } ; -void oldrpmfileFromSpecLine(char * str, struct oldrpmFileInfo * fi); -void oldrpmfileFromInfoLine(char * path, char * state, char * str, - struct oldrpmFileInfo * fi); -void oldrpmfileFree(struct oldrpmFileInfo * fi); -char * oldrpmfileToInfoStr(struct oldrpmFileInfo * fi); - struct oldrpmHeader { unsigned short type, cpu; unsigned int size; @@ -51,10 +45,24 @@ struct oldrpmHeaderSpec { struct oldrpmFileInfo * files; } ; +#ifdef __cplusplus +extern "C" { +#endif + +void oldrpmfileFromSpecLine(char * str, struct oldrpmFileInfo * fi); +void oldrpmfileFromInfoLine(char * path, char * state, char * str, + struct oldrpmFileInfo * fi); +void oldrpmfileFree(struct oldrpmFileInfo * fi); +char * oldrpmfileToInfoStr(struct oldrpmFileInfo * fi); + char * oldhdrReadFromStream(FD_t fd, struct oldrpmHeader * header); char * oldhdrReadFromFile(char * filename, struct oldrpmHeader * header); char * oldhdrParseSpec(struct oldrpmHeader * header, struct oldrpmHeaderSpec * spec); void oldhdrFree(struct oldrpmHeader * header); void oldhdrSpecFree(struct oldrpmHeaderSpec * spec); +#ifdef __cplusplus +} +#endif + #endif /* H_OLDHEADER */ diff --git a/lib/oldrpmdb.h b/lib/oldrpmdb.h index d0884d2..ea08209 100644 --- a/lib/oldrpmdb.h +++ b/lib/oldrpmdb.h @@ -3,7 +3,7 @@ #include -#include "oldheader.h" +#include typedef enum { @@ -54,6 +54,10 @@ struct oldrpmdbPackageInfo #define RPMDB_READER 1 +#ifdef __cplusplus +extern "C" { +#endif + int oldrpmdbOpen (struct oldrpmdb *oldrpmdb); void oldrpmdbClose (struct oldrpmdb *oldrpmdb); struct oldrpmdbLabel *oldrpmdbGetAllLabels (struct oldrpmdb *oldrpmdb); @@ -85,4 +89,8 @@ int oldrpmdbLabelCmp (struct oldrpmdbLabel *one, struct oldrpmdbLabel *two); void oldrpmdbSetPrefix (char *new); +#ifdef __cplusplus +} +#endif + #endif /* _H_OLDRPMDB */ diff --git a/lib/package.c b/lib/package.c index 811bec9..3c94289 100644 --- a/lib/package.c +++ b/lib/package.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include #include "misc.h" #include "oldheader.h" diff --git a/lib/problems.c b/lib/problems.c index 53482b6..38559a3 100644 --- a/lib/problems.c +++ b/lib/problems.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include #include "depends.h" #include "misc.h" @@ -16,8 +16,10 @@ void printDepFlags(FILE * fp, const char * version, int flags) { fprintf(fp, ">"); if (flags & RPMSENSE_EQUAL) fprintf(fp, "="); +#if defined(RPMSENSE_SERIAL) if (flags & RPMSENSE_SERIAL) fprintf(fp, "S"); +#endif /* RPMSENSE_SERIAL */ if (flags) fprintf(fp, " %s", version); diff --git a/lib/query.c b/lib/query.c index 8e4ecfd..17fe755 100644 --- a/lib/query.c +++ b/lib/query.c @@ -6,7 +6,7 @@ #include "build/rpmbuild.h" #include "popt/popt.h" -#include "rpmurl.h" +#include static void printFileInfo(char * name, unsigned int size, unsigned short mode, unsigned int mtime, unsigned short rdev, diff --git a/lib/rebuilddb.c b/lib/rebuilddb.c index 15b5e89..84a0cdb 100644 --- a/lib/rebuilddb.c +++ b/lib/rebuilddb.c @@ -1,7 +1,7 @@ #include "system.h" -#include "rpmlib.h" -#include "rpmmacro.h" /* XXX for rpmGetPath */ +#include +#include /* XXX for rpmGetPath */ #include "rpmdb.h" diff --git a/lib/rpmbzio.c b/lib/rpmbzio.c index 60c4d04..c66f38b 100644 --- a/lib/rpmbzio.c +++ b/lib/rpmbzio.c @@ -1,8 +1,7 @@ #include "system.h" -#include "rpmlib.h" - -#include "rpmio.h" +#include +#include /* =============================================================== */ /* Support for BZIP2 library. diff --git a/lib/rpmdb.c b/lib/rpmdb.c index d8eeed7..1556b40 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -4,12 +4,12 @@ #include #include -#include "rpmlib.h" +#include +#include /* XXX for rpmGetPath */ #include "falloc.h" #include "fprint.h" #include "misc.h" -#include "rpmmacro.h" /* XXX for rpmGetPath */ #include "rpmdb.h" /* XXX the signal handling in here is not thread safe */ diff --git a/lib/rpmdb.h b/lib/rpmdb.h index 1090f3c..e4fbf7d 100644 --- a/lib/rpmdb.h +++ b/lib/rpmdb.h @@ -1,12 +1,7 @@ #ifndef H_RPMDB #define H_RPMDB -#include "rpmlib.h" - -#ifdef __cplusplus -extern "C" { -#endif - +#include #include "fprint.h" /* for RPM's internal use only */ @@ -14,6 +9,10 @@ extern "C" { #define RPMDB_FLAG_JUSTCHECK (1 << 0) #define RPMDB_FLAG_MINIMAL (1 << 1) +#ifdef __cplusplus +extern "C" { +#endif + int openDatabase(const char * prefix, const char * dbpath, rpmdb *rpmdbp, int mode, int perms, int flags); int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant); diff --git a/lib/rpmerr.c b/lib/rpmerr.c index 10b4ba2..fc05e7e 100644 --- a/lib/rpmerr.c +++ b/lib/rpmerr.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include static struct err { int code; diff --git a/lib/rpmlead.c b/lib/rpmlead.c index a858ebf..dd0587f 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -6,7 +6,7 @@ #include -#include "rpmlib.h" +#include #include "rpmlead.h" diff --git a/lib/rpmlead.h b/lib/rpmlead.h index 8368c11..2de5941 100644 --- a/lib/rpmlead.h +++ b/lib/rpmlead.h @@ -1,11 +1,19 @@ #ifndef _H_RPMLEAD #define _H_RPMLEAD -#include "rpmlib.h" +#include /* Other definitions went to rpmlib.h */ +#ifdef __cplusplus +extern "C" { +#endif + int writeLead(FD_t fd, struct rpmlead *lead); int readLead(FD_t fd, struct rpmlead *lead); +#ifdef __cplusplus +} +#endif + #endif /* _H_RPMLEAD */ diff --git a/lib/rpmlib.h b/lib/rpmlib.h index a5d1c29..a4ac39d 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -5,10 +5,10 @@ /* and it shouldn't need these :-( */ -#include "rpmio.h" -#include "dbindex.h" -#include "header.h" -#include "popt.h" /* XXX you now need to install the popt package */ +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 0635458..105a58e 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -8,8 +8,8 @@ #define __power_pc() 0 #endif -#include "rpmlib.h" -#include "rpmmacro.h" +#include +#include #include "misc.h" diff --git a/lib/signature.c b/lib/signature.c index 1ea914e..eb2748a 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -13,8 +13,8 @@ #include #endif -#include "rpmlib.h" -#include "rpmmacro.h" /* XXX for rpmGetPath */ +#include +#include /* XXX for rpmGetPath */ #include "md5.h" #include "misc.h" diff --git a/lib/signature.h b/lib/signature.h index 9c87fb8..69a5f17 100644 --- a/lib/signature.h +++ b/lib/signature.h @@ -3,7 +3,11 @@ /* signature.h - generate and verify signatures */ -#include "header.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif /**************************************************/ /* */ @@ -57,4 +61,8 @@ char *rpmGetPassPhrase(const char *prompt, const int sigTag); /* Return path to pgp executable of given type, or NULL when not found */ const char *rpmDetectPGPVersion(int sigType); +#ifdef __cplusplus +} +#endif + #endif /* H_SIGNATURE */ diff --git a/lib/stringbuf.h b/lib/stringbuf.h index 2be4549..9580495 100644 --- a/lib/stringbuf.h +++ b/lib/stringbuf.h @@ -3,6 +3,10 @@ typedef /*@abstract@*/ struct StringBufRec *StringBuf; +#ifdef __cplusplus +extern "C" { +#endif + /*@only@*/ StringBuf newStringBuf(void); void freeStringBuf(/*@only@*/ StringBuf sb); void truncStringBuf(StringBuf sb); @@ -14,4 +18,8 @@ void stripTrailingBlanksStringBuf(StringBuf sb); void appendStringBufAux(StringBuf sb, const char *s, int nl); +#ifdef __cplusplus +} +#endif + #endif /* _STRINGBUF_H_ */ diff --git a/lib/tagName.c b/lib/tagName.c index f5424ac..b5f5a7c 100644 --- a/lib/tagName.c +++ b/lib/tagName.c @@ -1,5 +1,6 @@ #include "system.h" -#include "rpmlib.h" + +#include const char *tagName(int tag) { diff --git a/lib/test.c b/lib/test.c index e1e8fe2..1824d3c 100644 --- a/lib/test.c +++ b/lib/test.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include void main(int argc, char **argv) { diff --git a/lib/transaction.c b/lib/transaction.c index 1dcb5c7..bee30a1 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1,7 +1,7 @@ #include "system.h" -#include "rpmlib.h" -#include "rpmmacro.h" /* XXX for rpmGetPath */ +#include +#include /* XXX for rpmGetPath */ #include "depends.h" #include "fprint.h" diff --git a/lib/tread.c b/lib/tread.c index 81c76df..648b34a 100644 --- a/lib/tread.c +++ b/lib/tread.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmio.h" +#include int timedRead(FD_t fd, void * bufptr, int length) { int bytesRead; diff --git a/lib/tread.h b/lib/tread.h deleted file mode 100644 index 2ed531f..0000000 --- a/lib/tread.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef H_TREAD -#define H_TREAD - -#ifdef __cplusplus -extern "C" { -#endif - -int timedRead(FD_t fd, void * bufptr, int length); - -#ifdef __cplusplus -} -#endif - -#endif /* H_TREAD */ diff --git a/lib/uninstall.c b/lib/uninstall.c index 5f376c8..8b5a170 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include #include "depends.h" #include "install.h" diff --git a/lib/url.c b/lib/url.c index 67b829e..ca9da70 100644 --- a/lib/url.c +++ b/lib/url.c @@ -4,7 +4,7 @@ #include "build/rpmbuild.h" -#include "rpmurl.h" +#include static struct urlstring { const char *leadin; diff --git a/lib/verify.c b/lib/verify.c index e46d932..dde85b1 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -1,13 +1,13 @@ #include "system.h" -#include "rpmlib.h" +#include #include "md5.h" #include "misc.h" #include "install.h" #include "build/rpmbuild.h" -#include "rpmurl.h" +#include static int _ie = 0x44332211; static union _endian { int i; char b[4]; } *_endian = (union _endian *)&_ie; diff --git a/po/rpm.pot b/po/rpm.pot index 7fa631e..078d180 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-07-10 16:50-0400\n" +"POT-Creation-Date: 1999-07-13 17:29-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1992,28 +1992,28 @@ msgstr "" msgid "line %d: second %%prep" msgstr "" -#: ../build/parseReqs.c:96 +#: ../build/parseReqs.c:102 #, c-format msgid "" "line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s" msgstr "" -#: ../build/parseReqs.c:107 +#: ../build/parseReqs.c:113 #, c-format msgid "line %d: File name not permitted: %s" msgstr "" -#: ../build/parseReqs.c:139 +#: ../build/parseReqs.c:145 #, c-format msgid "line %d: Versioned file name not permitted: %s" msgstr "" -#: ../build/parseReqs.c:150 +#: ../build/parseReqs.c:156 #, c-format msgid "line %d: Version not permitted: %s" msgstr "" -#: ../build/parseReqs.c:170 +#: ../build/parseReqs.c:176 #, c-format msgid "line %d: Version required: %s" msgstr "" @@ -2187,11 +2187,11 @@ msgstr "" msgid "package %s conflicts: %s\n" msgstr "" -#: ../lib/depends.c:869 +#: ../lib/depends.c:871 msgid "dbrecMatchesDepFlags() failed to read header" msgstr "" -#: ../lib/depends.c:921 +#: ../lib/depends.c:923 #, c-format msgid "loop in prerequisite chain: %s" msgstr "" @@ -2593,58 +2593,58 @@ msgid "" "only packages with major numbers <= 3 are supported by this version of RPM" msgstr "" -#: ../lib/problems.c:39 +#: ../lib/problems.c:41 #, c-format msgid " is needed by %s-%s-%s\n" msgstr "" -#: ../lib/problems.c:42 +#: ../lib/problems.c:44 #, c-format msgid " conflicts with %s-%s-%s\n" msgstr "" -#: ../lib/problems.c:68 +#: ../lib/problems.c:70 #, c-format msgid "package %s-%s-%s is for a different architecture" msgstr "" -#: ../lib/problems.c:73 +#: ../lib/problems.c:75 #, c-format msgid "package %s-%s-%s is for a different operating system" msgstr "" -#: ../lib/problems.c:78 +#: ../lib/problems.c:80 #, c-format msgid "package %s-%s-%s is already installed" msgstr "" -#: ../lib/problems.c:83 +#: ../lib/problems.c:85 #, c-format msgid "path %s is not relocateable for package %s-%s-%s" msgstr "" -#: ../lib/problems.c:88 +#: ../lib/problems.c:90 #, c-format msgid "file %s conflicts between attemped installs of %s-%s-%s and %s-%s-%s" msgstr "" -#: ../lib/problems.c:94 +#: ../lib/problems.c:96 #, c-format msgid "" "file %s from install of %s-%s-%s conflicts with file from package %s-%s-%s" msgstr "" -#: ../lib/problems.c:100 +#: ../lib/problems.c:102 #, c-format msgid "package %s-%s-%s (which is newer then %s-%s-%s) is already installed" msgstr "" -#: ../lib/problems.c:106 +#: ../lib/problems.c:108 #, c-format msgid "installing package %s-%s-%s needs %ld%c on the %s filesystem" msgstr "" -#: ../lib/problems.c:118 +#: ../lib/problems.c:120 #, c-format msgid "unknown error %d encountered while manipulating package %s-%s-%s" msgstr "" diff --git a/rpmio/macro.c b/rpmio/macro.c index 3776450..06944ac 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -26,10 +26,10 @@ typedef int FD_t; #define fdRead read #define fdClose close #else -#include "rpmlib.h" +#include #endif -#include "rpmmacro.h" +#include struct MacroContext globalMacroContext; diff --git a/rpmio/messages.c b/rpmio/messages.c index c07853e..342ea2b 100644 --- a/rpmio/messages.c +++ b/rpmio/messages.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include static int minLevel = RPMMESS_NORMAL; diff --git a/rpmio/rpmerr.c b/rpmio/rpmerr.c index 10b4ba2..fc05e7e 100644 --- a/rpmio/rpmerr.c +++ b/rpmio/rpmerr.c @@ -2,7 +2,7 @@ #include -#include "rpmlib.h" +#include static struct err { int code; diff --git a/rpmpopt b/rpmpopt index b7afd10..a96be4e 100644 --- a/rpmpopt +++ b/rpmpopt @@ -35,9 +35,11 @@ rpm alias --conflicts --qf \ "[%{CONFLICTNAME} %{CONFLICTFLAGS:depflags} %{CONFLICTVERSION}\n]" rpm alias --obsoletes --qf '[%{OBSOLETES}\n]' -rpm alias --prereq --qf '[%{PREREQ}\n]' rpm alias --provides --qf '[%{PROVIDES}\n]' +# XXX prereq output is part of requires for query +#rpm alias --prereq --qf '[%{PREREQ}\n]' + rpm alias --requires --qf \ "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" rpm alias -R --requires -- 2.7.4