Skip to content

Commit

Permalink
Remove C++ guards from internal headers
Browse files Browse the repository at this point in the history
While these were necessary to get things going, they are only
counterproductive now: we want to be able to freely use C++ features
inside rpm.
  • Loading branch information
pmatilai committed May 6, 2024
1 parent 96467dc commit 18f7e53
Show file tree
Hide file tree
Showing 33 changed files with 8 additions and 250 deletions.
8 changes: 0 additions & 8 deletions build/rpmbuild_internal.h
Expand Up @@ -282,10 +282,6 @@ typedef enum rpmParseState_e {

#define ALLOW_EMPTY (1 << 16)

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmbuild
* Create and initialize rpmSpec structure.
* @return spec spec file control structure
Expand Down Expand Up @@ -672,8 +668,4 @@ void doPatchMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
RPM_GNUC_INTERNAL
const struct sectname_s *getSection(const char *name, int part);

#ifdef __cplusplus
}
#endif

#endif /* _RPMBUILD_INTERNAL_H */
8 changes: 0 additions & 8 deletions build/rpmbuild_misc.h
Expand Up @@ -5,10 +5,6 @@
#include <rpm/rpmtypes.h>
#include <rpm/rpmds.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmbuild
* Truncate comment lines.
* @param s skip white space, truncate line at '#'
Expand Down Expand Up @@ -66,8 +62,4 @@ void appendStringBufAux(StringBuf sb, const char * s, int nl);
RPM_GNUC_INTERNAL
int parseUnsignedNum(const char * line, uint32_t * res);

#ifdef __cplusplus
}
#endif

#endif /* _RPMBUILD_MISC_H */
8 changes: 0 additions & 8 deletions lib/backend/dbi.h
Expand Up @@ -121,10 +121,6 @@ union _dbswap {
typedef rpmRC (*idxfunc)(dbiIndex dbi, dbiCursor dbc,
const char *keyp, size_t keylen, dbiIndexItem rec);

#ifdef __cplusplus
extern "C" {
#endif

RPM_GNUC_INTERNAL
rpmRC tag2index(dbiIndex dbi, rpmTagVal rpmtag, unsigned int hdrNum, Header h,
idxfunc idxupdate);
Expand Down Expand Up @@ -284,8 +280,4 @@ extern struct rpmdbOps_s sqlite_dbops;
RPM_GNUC_INTERNAL
extern struct rpmdbOps_s dummydb_dbops;

#ifdef __cplusplus
}
#endif

#endif /* _DBI_H */
7 changes: 0 additions & 7 deletions lib/backend/dbiset.h
Expand Up @@ -16,10 +16,6 @@ typedef struct dbiIndexSet_s {
size_t alloced; /*!< alloced size */
} * dbiIndexSet;

#ifdef __cplusplus
extern "C" {
#endif

/* Create an empty index set, optionally with sizehint reservation for recs */
RPM_GNUC_INTERNAL
dbiIndexSet dbiIndexSetNew(unsigned int sizehint);
Expand Down Expand Up @@ -124,7 +120,4 @@ unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, unsigned int recno);
RPM_GNUC_INTERNAL
dbiIndexSet dbiIndexSetFree(dbiIndexSet set);

#ifdef __cplusplus
}
#endif
#endif
8 changes: 0 additions & 8 deletions lib/cpio.h
Expand Up @@ -14,10 +14,6 @@

typedef struct rpmcpio_s * rpmcpio_t;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Create CPIO file object
* @param fd file
Expand Down Expand Up @@ -72,8 +68,4 @@ void rpmcpioSetExpectedFileSize(rpmcpio_t cpio, off_t fsize);

ssize_t rpmcpioRead(rpmcpio_t cpio, void * buf, size_t size);

#ifdef __cplusplus
}
#endif

#endif /* H_CPIO */
8 changes: 0 additions & 8 deletions lib/fprint.h
Expand Up @@ -22,10 +22,6 @@ struct rpmffi_s {
int fileno;
};

#ifdef __cplusplus
extern "C" {
#endif

/**
* Create finger print cache.
* @param sizeHint number of elements expected
Expand Down Expand Up @@ -117,8 +113,4 @@ fingerPrint * fpLookupList(fingerPrintCache cache, rpmstrPool pool,
rpmsid * dirNames, rpmsid * baseNames,
const uint32_t * dirIndexes, int fileCount);

#ifdef __cplusplus
}
#endif

#endif
7 changes: 0 additions & 7 deletions lib/fsm.h
Expand Up @@ -9,10 +9,6 @@
#include <rpm/rpmfi.h>
#include <rpm/rpmcallback.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct rpmpsm_s * rpmpsm;

/**
Expand All @@ -36,8 +32,5 @@ int rpmfiArchiveReadToFilePsm(rpmfi fi, FD_t fd, int nodigest, rpmpsm psm);

RPM_GNUC_INTERNAL
void rpmpsmNotify(rpmpsm psm, rpmCallbackType what, rpm_loff_t amount);
#ifdef __cplusplus
}
#endif

#endif /* H_FSM */
7 changes: 0 additions & 7 deletions lib/header_internal.h
Expand Up @@ -24,10 +24,6 @@ struct hdrblob_s {
uint32_t rdl;
};

#ifdef __cplusplus
extern "C" {
#endif

RPM_GNUC_INTERNAL
hdrblob hdrblobCreate(void);

Expand Down Expand Up @@ -65,8 +61,5 @@ ssize_t Freadall(FD_t fd, void * buf, ssize_t size);

RPM_GNUC_INTERNAL
int headerIsSourceHeuristic(Header h);
#ifdef __cplusplus
}
#endif

#endif /* H_HEADER_INTERNAL */
8 changes: 0 additions & 8 deletions lib/manifest.h
Expand Up @@ -6,10 +6,6 @@
* Routines to expand a manifest containing glob expressions into an argv list.
*/

#ifdef __cplusplus
extern "C" {
#endif

/**
* Return ls(1)-like formatted mode string.
* @param mode file mode
Expand All @@ -27,8 +23,4 @@ char * rpmPermsString(int mode)
*/
rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, char *** argvPtr);

#ifdef __cplusplus
}
#endif

#endif /* H_MANIFEST */
8 changes: 0 additions & 8 deletions lib/misc.h
Expand Up @@ -13,10 +13,6 @@

typedef const struct headerFmt_s * headerFmt;

#ifdef __cplusplus
extern "C" {
#endif

/* known arch? */
RPM_GNUC_INTERNAL
int rpmIsKnownArch(const char *name);
Expand Down Expand Up @@ -62,8 +58,4 @@ RPM_GNUC_INTERNAL
void rpmRelocationBuild(Header h, rpmRelocation *rawrelocs,
int *rnrelocs, rpmRelocation **rrelocs, uint8_t **rbadrelocs);

#ifdef __cplusplus
}
#endif

#endif /* H_MISC */
8 changes: 0 additions & 8 deletions lib/rpmal.h
Expand Up @@ -9,10 +9,6 @@
#include <rpm/rpmtypes.h>
#include <rpm/rpmts.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct rpmal_s * rpmal;

/**
Expand Down Expand Up @@ -85,8 +81,4 @@ rpmte rpmalSatisfiesDepend(const rpmal al, const rpmte te, const rpmds ds);
RPM_GNUC_INTERNAL
unsigned int rpmalLookupTE(const rpmal al, const rpmte te);

#ifdef __cplusplus
}
#endif

#endif /* H_RPMAL */
9 changes: 0 additions & 9 deletions lib/rpmchroot.h
Expand Up @@ -3,10 +3,6 @@

#include <rpm/rpmutil.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmchroot
* Set or clear process-wide chroot directory.
* Calling this while chrooted is an error.
Expand Down Expand Up @@ -37,9 +33,4 @@ int rpmChrootOut(void);
/* RPM_GNUC_INTERNAL */
int rpmChrootDone(void);

#ifdef __cplusplus
}
#endif


#endif /* _RPMCHROOT_H */
8 changes: 0 additions & 8 deletions lib/rpmdb_internal.h
Expand Up @@ -8,10 +8,6 @@
#include <rpm/rpmutil.h>
#include "backend/dbi.h"

#ifdef __cplusplus
extern "C" {
#endif

#define HASHTYPE packageHash
#define HTKEYTYPE unsigned int
#define HTDATATYPE struct rpmte_s *
Expand Down Expand Up @@ -214,8 +210,4 @@ unsigned int rpmdbGetIteratorOffsetFor(rpmdbMatchIterator mi, unsigned int ix);
RPM_GNUC_INTERNAL
Header rpmdbGetHeaderAt(rpmdb db, unsigned int offset);

#ifdef __cplusplus
}
#endif

#endif
7 changes: 0 additions & 7 deletions lib/rpmds_internal.h
Expand Up @@ -3,10 +3,6 @@

#include <rpm/rpmds.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmds
* Swiss army knife dependency matching function.
* @param pool string pool (or NULL for private pool)
Expand Down Expand Up @@ -86,8 +82,5 @@ int rpmdsCompareIndex(rpmds A, int aix, rpmds B, int bix);
*/
RPM_GNUC_INTERNAL
rpmds rpmdsFilterTi(rpmds ds, int ti);
#ifdef __cplusplus
}
#endif

#endif /* _RPMDS_INTERNAL_H */
7 changes: 0 additions & 7 deletions lib/rpmfi_internal.h
Expand Up @@ -9,10 +9,6 @@

#define RPMFIMAGIC 0x09697923

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmfi
* Callback on file iterator directory changes
* @param fi file info
Expand Down Expand Up @@ -124,9 +120,6 @@ rpmfiles rpmfiFiles(rpmfi fi);
*/
RPM_GNUC_INTERNAL
rpmfi rpmfilesFindPrefix(rpmfiles fi, const char *pfx);
#ifdef __cplusplus
}
#endif

#endif /* _RPMFI_INTERNAL_H */

8 changes: 0 additions & 8 deletions lib/rpmfs.h
Expand Up @@ -18,10 +18,6 @@ struct sharedFileInfo_s {
char rstate;
};

#ifdef __cplusplus
extern "C" {
#endif

RPM_GNUC_INTERNAL
rpmfs rpmfsNew(rpm_count_t fc, int initState);

Expand Down Expand Up @@ -57,8 +53,4 @@ void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
RPM_GNUC_INTERNAL
void rpmfsResetActions(rpmfs fs);

#ifdef __cplusplus
}
#endif

#endif /* _RPMFS_H */
8 changes: 0 additions & 8 deletions lib/rpmgi.h
Expand Up @@ -8,10 +8,6 @@
#include <rpm/rpmtypes.h>
#include <rpm/argv.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmgi
*/
enum rpmgiFlags_e {
Expand Down Expand Up @@ -58,8 +54,4 @@ Header rpmgiNext(rpmgi gi);
RPM_GNUC_INTERNAL
int rpmgiNumErrors(rpmgi gi);

#ifdef __cplusplus
}
#endif

#endif /* H_RPMGI */
8 changes: 0 additions & 8 deletions lib/rpmlead.h
Expand Up @@ -5,10 +5,6 @@
* \file rpmlead.h
* Routines to read and write an rpm lead structure for a a package.
*/
#ifdef __cplusplus
extern "C" {
#endif

#define RPMLEAD_BINARY 0
#define RPMLEAD_SOURCE 1

Expand All @@ -35,8 +31,4 @@ rpmRC rpmLeadWrite(FD_t fd, Header h);
*/
rpmRC rpmLeadRead(FD_t fd, char **emsg);

#ifdef __cplusplus
}
#endif

#endif /* _H_RPMLEAD */
8 changes: 0 additions & 8 deletions lib/rpmlock.h
Expand Up @@ -11,10 +11,6 @@ enum {
RPMLOCK_WAIT = 1 << 2,
};

#ifdef __cplusplus
extern "C" {
#endif

RPM_GNUC_INTERNAL
rpmlock rpmlockNew(const char *lock_path, const char *descr);

Expand All @@ -30,8 +26,4 @@ void rpmlockRelease(rpmlock lock);
RPM_GNUC_INTERNAL
rpmlock rpmlockFree(rpmlock lock);

#ifdef __cplusplus
}
#endif

#endif
7 changes: 0 additions & 7 deletions lib/rpmplugins.h
Expand Up @@ -5,10 +5,6 @@
#include <rpm/rpmfi.h>
#include <rpm/rpmplugin.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \ingroup rpmplugins
* Create a new plugins structure
* @param ts transaction set
Expand Down Expand Up @@ -168,7 +164,4 @@ rpmRC rpmpluginsCallFsmFilePrepare(rpmPlugins plugins, rpmfi fi,
int fd, const char *path, const char *dest,
mode_t mode, rpmFsmOp op);

#ifdef __cplusplus
}
#endif
#endif /* _PLUGINS_H */

0 comments on commit 18f7e53

Please sign in to comment.