1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Split VR_EXTERN/FN_EXTERN macros from FV_EXTERN.

This should make it a little clearer what the variable (VR) macros are doing since the declaration/definition cannot both be set to extern (but functions can).

Splitting the variable macros out also allows them to be changed in the future with little churn, while changing the function macro creates a large amount of churn.
This commit is contained in:
David Steele 2023-01-02 15:24:51 +07:00
parent 9e29c01891
commit f018912908
361 changed files with 1893 additions and 1889 deletions

View File

@ -100,7 +100,7 @@ jobs:
${GITHUB_WORKSPACE?}/pgbackrest/test/test.pl --vm=none --min-gen --no-valgrind --no-coverage --no-optimize --build-max=2 --module=command --test=backup
${GITHUB_WORKSPACE?}/pgbackrest/test/test.pl --vm=none --min-gen --no-valgrind --no-coverage --no-optimize --build-max=2 --module=postgres --test=interface
# Run meson unity build to check for errors, unused functions, and extern'd functions
# Run meson unity build to check for errors, unused functions, and externed functions
unity:
runs-on: ubuntu-22.04

View File

@ -90,6 +90,7 @@
<commit subject="Move storageHelperFree() to storageHelper test harness."/>
<commit subject="Use memcpy() instead of strncpy when source size is known."/>
<commit subject="Put logging functions unused by release builds into DEBUG blocks."/>
<commit subject="Split VR_EXTERN/FN_EXTERN macros from FV_EXTERN."/>
<release-item-contributor-list>
<release-item-contributor id="david.steele"/>

View File

@ -32,6 +32,7 @@ Build Flags Generated by Configure
// Indicate that a function should always be inlined
#define FN_INLINE_ALWAYS __attribute__((always_inline)) static inline
// Leave extern'd functions/variables alone. Changing these to static is a meson-only feature.
#define FV_EXTERN extern
#define VR_EXTERN
// Extern function/variable required by other compilation units. Changing these to static is a meson-only feature.
#define FN_EXTERN extern
#define VR_EXTERN_DECLARE extern
#define VR_EXTERN_DEFINE

View File

@ -20,7 +20,7 @@ Annotate Command
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdAnnotate(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Annotate Command
Functions
***********************************************************************************************************************************/
// Add or modify backup annotations
FV_EXTERN void cmdAnnotate(void);
FN_EXTERN void cmdAnnotate(void);
#endif

View File

@ -55,7 +55,7 @@ archiveAsyncSpoolQueue(ArchiveMode archiveMode)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archiveAsyncErrorClear(const ArchiveMode archiveMode, const String *const archiveFile)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -76,7 +76,7 @@ archiveAsyncErrorClear(const ArchiveMode archiveMode, const String *const archiv
}
/**********************************************************************************************************************************/
FV_EXTERN bool
FN_EXTERN bool
archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool throwOnError, bool warnOnOk)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -182,7 +182,7 @@ archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool throw
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archiveAsyncStatusErrorWrite(ArchiveMode archiveMode, const String *walSegment, int code, const String *message)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -211,7 +211,7 @@ archiveAsyncStatusErrorWrite(ArchiveMode archiveMode, const String *walSegment,
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archiveAsyncStatusOkWrite(ArchiveMode archiveMode, const String *walSegment, const String *warning)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -236,7 +236,7 @@ archiveAsyncStatusOkWrite(ArchiveMode archiveMode, const String *walSegment, con
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archiveAsyncExec(ArchiveMode archiveMode, const StringList *commandExec)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -293,7 +293,7 @@ archiveAsyncExec(ArchiveMode archiveMode, const StringList *commandExec)
}
/**********************************************************************************************************************************/
FV_EXTERN int
FN_EXTERN int
archiveIdComparator(const void *item1, const void *item2)
{
StringList *archiveSort1 = strLstNewSplitZ(*(String **)item1, "-");
@ -305,7 +305,7 @@ archiveIdComparator(const void *item1, const void *item2)
}
/**********************************************************************************************************************************/
FV_EXTERN bool
FN_EXTERN bool
walIsPartial(const String *walSegment)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -319,7 +319,7 @@ walIsPartial(const String *walSegment)
}
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
walPath(const String *walFile, const String *pgPath, const String *command)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -381,7 +381,7 @@ walPath(const String *walFile, const String *pgPath, const String *command)
}
/**********************************************************************************************************************************/
FV_EXTERN bool
FN_EXTERN bool
walIsSegment(const String *walSegment)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -406,7 +406,7 @@ walIsSegment(const String *walSegment)
}
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
walSegmentFind(const Storage *storage, const String *archiveId, const String *walSegment, TimeMSec timeout)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
@ -477,7 +477,7 @@ walSegmentFind(const Storage *storage, const String *archiveId, const String *wa
}
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
walSegmentNext(const String *walSegment, size_t walSegmentSize, unsigned int pgVersion)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -517,7 +517,7 @@ walSegmentNext(const String *walSegment, size_t walSegmentSize, unsigned int pgV
}
/**********************************************************************************************************************************/
FV_EXTERN StringList *
FN_EXTERN StringList *
walSegmentRange(const String *walSegmentBegin, size_t walSegmentSize, unsigned int pgVersion, unsigned int range)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -67,43 +67,43 @@ Functions
***********************************************************************************************************************************/
// Remove errors for an archive file. This should be done before forking the async process to prevent a race condition where an
// old error may be reported rather than waiting for the async process to succeed or fail.
FV_EXTERN void archiveAsyncErrorClear(ArchiveMode archiveMode, const String *archiveFile);
FN_EXTERN void archiveAsyncErrorClear(ArchiveMode archiveMode, const String *archiveFile);
// Check for ok/error status files in the spool in/out directory. throwOnError determines whether an error will be thrown when an
// error file is found. warnOnOk determines whether a warning will be output when found in an ok file.
FV_EXTERN bool archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool throwOnError, bool warnOnOk);
FN_EXTERN bool archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool throwOnError, bool warnOnOk);
// Write an ok status file
FV_EXTERN void archiveAsyncStatusOkWrite(ArchiveMode archiveMode, const String *walSegment, const String *warning);
FN_EXTERN void archiveAsyncStatusOkWrite(ArchiveMode archiveMode, const String *walSegment, const String *warning);
// Write an error status file
FV_EXTERN void archiveAsyncStatusErrorWrite(ArchiveMode archiveMode, const String *walSegment, int code, const String *message);
FN_EXTERN void archiveAsyncStatusErrorWrite(ArchiveMode archiveMode, const String *walSegment, int code, const String *message);
// Execute the async process. This function will only return in the calling process and the implementation is platform dependent.
FV_EXTERN void archiveAsyncExec(ArchiveMode archiveMode, const StringList *commandExec);
FN_EXTERN void archiveAsyncExec(ArchiveMode archiveMode, const StringList *commandExec);
// Comparator function for sorting archive ids by the database history id (the number after the dash) e.g. 9.4-1, 10-2
FV_EXTERN int archiveIdComparator(const void *item1, const void *item2);
FN_EXTERN int archiveIdComparator(const void *item1, const void *item2);
// Is the segment partial?
FV_EXTERN bool walIsPartial(const String *walSegment);
FN_EXTERN bool walIsPartial(const String *walSegment);
// Is the file a segment or some other file (e.g. .history, .backup, etc)
FV_EXTERN bool walIsSegment(const String *walSegment);
FN_EXTERN bool walIsSegment(const String *walSegment);
// Generates the location of the wal directory using a relative wal path and the supplied pg path
FV_EXTERN String *walPath(const String *walFile, const String *pgPath, const String *command);
FN_EXTERN String *walPath(const String *walFile, const String *pgPath, const String *command);
// Find a WAL segment in the repository. The file name can have several things appended such as a hash, compression extension, and
// partial extension so it is possible to have multiple files that match the segment, though more than one match is not a good
// thing.
FV_EXTERN String *walSegmentFind(const Storage *storage, const String *archiveId, const String *walSegment, TimeMSec timeout);
FN_EXTERN String *walSegmentFind(const Storage *storage, const String *archiveId, const String *walSegment, TimeMSec timeout);
// Get the next WAL segment given a WAL segment and WAL segment size
FV_EXTERN String *walSegmentNext(const String *walSegment, size_t walSegmentSize, unsigned int pgVersion);
FN_EXTERN String *walSegmentNext(const String *walSegment, size_t walSegmentSize, unsigned int pgVersion);
// Build a list of WAL segments based on a beginning WAL and number of WAL in the range (inclusive)
FV_EXTERN StringList *walSegmentRange(
FN_EXTERN StringList *walSegmentRange(
const String *walSegmentBegin, size_t walSegmentSize, unsigned int pgVersion, unsigned int range);
#endif

View File

@ -17,7 +17,7 @@ Archive Get File
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN ArchiveGetFileResult archiveGetFile(
FN_EXTERN ArchiveGetFileResult archiveGetFile(
const Storage *storage, const String *request, const List *actualList, const String *walDestination)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -27,7 +27,7 @@ typedef struct ArchiveGetFileResult
StringList *warnList; // Warnings from a successful operation
} ArchiveGetFileResult;
FV_EXTERN ArchiveGetFileResult archiveGetFile(
FN_EXTERN ArchiveGetFileResult archiveGetFile(
const Storage *storage, const String *request, const List *actualList, const String *walDestination);
#endif

View File

@ -597,7 +597,7 @@ queueNeed(const String *walSegment, bool found, uint64_t queueSize, size_t walSe
}
/**********************************************************************************************************************************/
FV_EXTERN int
FN_EXTERN int
cmdArchiveGet(void)
{
FUNCTION_LOG_VOID(logLevelDebug);
@ -895,7 +895,7 @@ archiveGetAsyncCallback(void *const data, const unsigned int clientIdx)
FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
}
FV_EXTERN void
FN_EXTERN void
cmdArchiveGetAsync(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,9 +8,9 @@ Archive Get Command
Functions
***********************************************************************************************************************************/
// Get an archive file from the repository (WAL segment, history file, etc.)
FV_EXTERN int cmdArchiveGet(void);
FN_EXTERN int cmdArchiveGet(void);
// Async version of archive get that runs in parallel for performance
FV_EXTERN void cmdArchiveGetAsync(void);
FN_EXTERN void cmdArchiveGetAsync(void);
#endif

View File

@ -14,7 +14,7 @@ Archive Get Protocol Handler
#include "storage/write.intern.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archiveGetFileProtocol(PackRead *const param, ProtocolServer *const server)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -11,7 +11,7 @@ Archive Get Protocol Handler
Functions
***********************************************************************************************************************************/
// Process protocol requests
FV_EXTERN void archiveGetFileProtocol(PackRead *param, ProtocolServer *server);
FN_EXTERN void archiveGetFileProtocol(PackRead *param, ProtocolServer *server);
/***********************************************************************************************************************************
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()

View File

@ -90,7 +90,7 @@ archivePushFileIo(ArchivePushFileIoType type, IoWrite *write, const Buffer *buff
}
/**********************************************************************************************************************************/
FV_EXTERN ArchivePushFileResult
FN_EXTERN ArchivePushFileResult
archivePushFile(
const String *const walSource, const bool headerCheck, const bool modeCheck, const unsigned int pgVersion,
const uint64_t pgSystemId, const String *const archiveFile, const CompressType compressType, const int compressLevel,

View File

@ -30,7 +30,7 @@ typedef struct ArchivePushFileResult
} ArchivePushFileResult;
// Copy a file from the source to the archive
FV_EXTERN ArchivePushFileResult archivePushFile(
FN_EXTERN ArchivePushFileResult archivePushFile(
const String *walSource, bool headerCheck, bool modeCheck, unsigned int pgVersion, uint64_t pgSystemId,
const String *archiveFile, CompressType compressType, int compressLevel, const List *repoList,
const StringList *priorErrorList);

View File

@ -13,7 +13,7 @@ Archive Push Protocol Handler
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
archivePushFileProtocol(PackRead *const param, ProtocolServer *const server)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -11,7 +11,7 @@ Archive Push Protocol Handler
Functions
***********************************************************************************************************************************/
// Process protocol requests
FV_EXTERN void archivePushFileProtocol(PackRead *param, ProtocolServer *server);
FN_EXTERN void archivePushFileProtocol(PackRead *param, ProtocolServer *server);
/***********************************************************************************************************************************
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()

View File

@ -304,7 +304,7 @@ archivePushCheck(bool pgPathSet)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdArchivePush(void)
{
FUNCTION_LOG_VOID(logLevelDebug);
@ -513,7 +513,7 @@ archivePushAsyncCallback(void *data, unsigned int clientIdx)
FUNCTION_TEST_RETURN(PROTOCOL_PARALLEL_JOB, result);
}
FV_EXTERN void
FN_EXTERN void
cmdArchivePushAsync(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,9 +8,9 @@ Archive Push Command
Functions
***********************************************************************************************************************************/
// Push a WAL segment to the repository
FV_EXTERN void cmdArchivePush(void);
FN_EXTERN void cmdArchivePush(void);
// Async version of archive push that runs in parallel for performance
FV_EXTERN void cmdArchivePushAsync(void);
FN_EXTERN void cmdArchivePushAsync(void);
#endif

View File

@ -2217,7 +2217,7 @@ backupComplete(InfoBackup *const infoBackup, Manifest *const manifest)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdBackup(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Backup Command
Functions
***********************************************************************************************************************************/
// Make a backup
FV_EXTERN void cmdBackup(void);
FN_EXTERN void cmdBackup(void);
#endif

View File

@ -17,7 +17,7 @@ Constants
#define BACKUP_LINK_LATEST "latest"
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
backupFileRepoPath(const String *const backupLabel, const BackupFileRepoPathParam param)
{
FUNCTION_TEST_BEGIN();
@ -41,7 +41,7 @@ backupFileRepoPath(const String *const backupLabel, const BackupFileRepoPathPara
}
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
backupLabelFormat(BackupType type, const String *backupLabelPrior, time_t timestamp)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -79,7 +79,7 @@ backupLabelFormat(BackupType type, const String *backupLabelPrior, time_t timest
}
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
backupRegExp(const BackupRegExpParam param)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -142,7 +142,7 @@ backupRegExp(const BackupRegExpParam param)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
backupLinkLatest(const String *backupLabel, unsigned int repoIdx)
{
FUNCTION_TEST_BEGIN();

View File

@ -30,10 +30,10 @@ typedef struct BackupFileRepoPathParam
#define backupFileRepoPathP(backupLabel, ...) \
backupFileRepoPath(backupLabel, (BackupFileRepoPathParam){__VA_ARGS__})
FV_EXTERN String *backupFileRepoPath(const String *backupLabel, BackupFileRepoPathParam param);
FN_EXTERN String *backupFileRepoPath(const String *backupLabel, BackupFileRepoPathParam param);
// Format a backup label from a type and timestamp with an optional prior label
FV_EXTERN String *backupLabelFormat(BackupType type, const String *backupLabelPrior, time_t timestamp);
FN_EXTERN String *backupLabelFormat(BackupType type, const String *backupLabelPrior, time_t timestamp);
// Returns an anchored regex string for filtering backups based on the type (at least one type is required to be true)
typedef struct BackupRegExpParam
@ -47,9 +47,9 @@ typedef struct BackupRegExpParam
#define backupRegExpP(...) \
backupRegExp((BackupRegExpParam){__VA_ARGS__})
FV_EXTERN String *backupRegExp(BackupRegExpParam param);
FN_EXTERN String *backupRegExp(BackupRegExpParam param);
// Create a symlink to the specified backup (if symlinks are supported)
FV_EXTERN void backupLinkLatest(const String *backupLabel, unsigned int repoIdx);
FN_EXTERN void backupLinkLatest(const String *backupLabel, unsigned int repoIdx);
#endif

View File

@ -36,7 +36,7 @@ segmentNumber(const String *pgFile)
}
/**********************************************************************************************************************************/
FV_EXTERN List *
FN_EXTERN List *
backupFile(
const String *const repoFile, const CompressType repoFileCompressType, const int repoFileCompressLevel,
const CipherType cipherType, const String *const cipherPass, const List *const fileList)

View File

@ -52,7 +52,7 @@ typedef struct BackupFileResult
Pack *pageChecksumResult;
} BackupFileResult;
FV_EXTERN List *backupFile(
FN_EXTERN List *backupFile(
const String *repoFile, CompressType repoFileCompressType, int repoFileCompressLevel, CipherType cipherType,
const String *cipherPass, const List *fileList);

View File

@ -35,7 +35,7 @@ typedef struct PageChecksum
/***********************************************************************************************************************************
Macros for function logging
***********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
pageChecksumToLog(const PageChecksum *this)
{
return strNewFmt("{valid: %s, align: %s}", cvtBoolToConstZ(this->valid), cvtBoolToConstZ(this->align));
@ -224,7 +224,7 @@ pageChecksumResult(THIS_VOID)
}
/**********************************************************************************************************************************/
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
pageChecksumNew(const unsigned int segmentNo, const unsigned int segmentPageTotal, const String *const fileName)
{
FUNCTION_LOG_BEGIN(logLevelTrace);
@ -273,7 +273,7 @@ pageChecksumNew(const unsigned int segmentNo, const unsigned int segmentPageTota
FUNCTION_LOG_RETURN(IO_FILTER, this);
}
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
pageChecksumNewPack(const Pack *const paramList)
{
IoFilter *result = NULL;

View File

@ -16,7 +16,7 @@ Filter type constant
/***********************************************************************************************************************************
Constructors
***********************************************************************************************************************************/
FV_EXTERN IoFilter *pageChecksumNew(unsigned int segmentNo, unsigned int segmentPageTotal, const String *fileName);
FV_EXTERN IoFilter *pageChecksumNewPack(const Pack *paramList);
FN_EXTERN IoFilter *pageChecksumNew(unsigned int segmentNo, unsigned int segmentPageTotal, const String *fileName);
FN_EXTERN IoFilter *pageChecksumNewPack(const Pack *paramList);
#endif

View File

@ -14,7 +14,7 @@ Backup Protocol Handler
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
backupFileProtocol(PackRead *const param, ProtocolServer *const server)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -11,7 +11,7 @@ Backup Protocol Handler
Functions
***********************************************************************************************************************************/
// Process protocol requests
FV_EXTERN void backupFileProtocol(PackRead *param, ProtocolServer *server);
FN_EXTERN void backupFileProtocol(PackRead *param, ProtocolServer *server);
/***********************************************************************************************************************************
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()

View File

@ -164,7 +164,7 @@ checkPrimary(const DbGetResult dbGroup)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdCheck(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Check Command
Functions
***********************************************************************************************************************************/
// Perform standard checks
FV_EXTERN void cmdCheck(void);
FN_EXTERN void cmdCheck(void);
#endif

View File

@ -41,7 +41,7 @@ checkArchiveCommand(const String *archiveCommand)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
checkDbConfig(const unsigned int pgVersion, const unsigned int pgIdx, const Db *dbObject, bool isStandby)
{
FUNCTION_TEST_BEGIN();
@ -94,7 +94,7 @@ checkDbConfig(const unsigned int pgVersion, const unsigned int pgIdx, const Db *
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
checkStanzaInfo(const InfoPgData *archiveInfo, const InfoPgData *backupInfo)
{
FUNCTION_TEST_BEGIN();
@ -122,7 +122,7 @@ checkStanzaInfo(const InfoPgData *archiveInfo, const InfoPgData *backupInfo)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
checkStanzaInfoPg(
const Storage *storage, const unsigned int pgVersion, const uint64_t pgSystemId, CipherType cipherType,
const String *cipherPass)

View File

@ -12,13 +12,13 @@ Check Command Common
Functions
***********************************************************************************************************************************/
// Check the database path and version are configured correctly
FV_EXTERN void checkDbConfig(const unsigned int pgVersion, const unsigned int pgIdx, const Db *dbObject, bool isStandby);
FN_EXTERN void checkDbConfig(const unsigned int pgVersion, const unsigned int pgIdx, const Db *dbObject, bool isStandby);
// Validate the archive and backup info files
FV_EXTERN void checkStanzaInfo(const InfoPgData *archiveInfo, const InfoPgData *backupInfo);
FN_EXTERN void checkStanzaInfo(const InfoPgData *archiveInfo, const InfoPgData *backupInfo);
// Load and validate the database data of the info files against each other and the current database
FV_EXTERN void checkStanzaInfoPg(
FN_EXTERN void checkStanzaInfoPg(
const Storage *storage, const unsigned int pgVersion, const uint64_t pgSystemId, CipherType cipherType,
const String *cipherPass);

View File

@ -23,7 +23,7 @@ static TimeMSec timeBegin;
static String *cmdOptionStr;
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdInit(void)
{
FUNCTION_LOG_VOID(logLevelTrace);
@ -34,7 +34,7 @@ cmdInit(void)
}
/**********************************************************************************************************************************/
FV_EXTERN const String *
FN_EXTERN const String *
cmdOption(void)
{
FUNCTION_TEST_VOID();
@ -157,7 +157,7 @@ cmdOption(void)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdBegin(void)
{
FUNCTION_LOG_VOID(logLevelTrace);
@ -189,7 +189,7 @@ cmdBegin(void)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdEnd(int code, const String *errorMessage)
{
FUNCTION_LOG_BEGIN(logLevelTrace);

View File

@ -10,16 +10,16 @@ Common Command Routines
Functions
***********************************************************************************************************************************/
// Capture time at the very start of main so total time is more accurate
FV_EXTERN void cmdInit(void);
FN_EXTERN void cmdInit(void);
// Begin the command
FV_EXTERN void cmdBegin(void);
FN_EXTERN void cmdBegin(void);
// Get the command options as a string. This is output in cmdBegin() if the log level is high enough but can also be used for
// debugging or error reporting later on.
FV_EXTERN const String *cmdOption(void);
FN_EXTERN const String *cmdOption(void);
// End the command
FV_EXTERN void cmdEnd(int code, const String *errorMessage);
FN_EXTERN void cmdEnd(int code, const String *errorMessage);
#endif

View File

@ -9,7 +9,7 @@ Common Handler for Control Commands
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
lockStopFileName(const String *stanza)
{
FUNCTION_TEST_BEGIN();
@ -22,7 +22,7 @@ lockStopFileName(const String *stanza)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
lockStopTest(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -15,9 +15,9 @@ Constants
Functions
***********************************************************************************************************************************/
// Create the stop filename
FV_EXTERN String *lockStopFileName(const String *stanza);
FN_EXTERN String *lockStopFileName(const String *stanza);
// Test for the existence of a stop file
FV_EXTERN void lockStopTest(void);
FN_EXTERN void lockStopTest(void);
#endif

View File

@ -10,7 +10,7 @@ Start Command
#include "storage/storage.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStart(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -7,6 +7,6 @@ Start Command
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
FV_EXTERN void cmdStart(void);
FN_EXTERN void cmdStart(void);
#endif

View File

@ -20,7 +20,7 @@ Stop Command
#include "storage/storage.intern.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStop(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -7,6 +7,6 @@ Stop Command
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
FV_EXTERN void cmdStop(void);
FN_EXTERN void cmdStop(void);
#endif

View File

@ -65,7 +65,7 @@ exitOnSignal(int signalType)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
exitInit(void)
{
FUNCTION_LOG_VOID(logLevelTrace);
@ -105,7 +105,7 @@ exitErrorDetail(void)
FUNCTION_TEST_RETURN(STRING, result);
}
FV_EXTERN int
FN_EXTERN int
exitSafe(int result, bool error, SignalType signalType)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -22,9 +22,9 @@ typedef enum
Functions
***********************************************************************************************************************************/
// Setup signal handlers
FV_EXTERN void exitInit(void);
FN_EXTERN void exitInit(void);
// Do cleanup and return result code
FV_EXTERN int exitSafe(int result, bool error, SignalType signalType);
FN_EXTERN int exitSafe(int result, bool error, SignalType signalType);
#endif

View File

@ -959,7 +959,7 @@ removeExpiredHistory(InfoBackup *infoBackup, unsigned int repoIdx)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdExpire(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Expire Command
Functions
***********************************************************************************************************************************/
// Expire backups and archives
FV_EXTERN void cmdExpire(void);
FN_EXTERN void cmdExpire(void);
#endif

View File

@ -559,7 +559,7 @@ helpRender(const Buffer *const helpData)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdHelp(const Buffer *const helpData)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -10,6 +10,6 @@ Help Command
Functions
***********************************************************************************************************************************/
// Render help and output to stdout
FV_EXTERN void cmdHelp(const Buffer *const helpData);
FN_EXTERN void cmdHelp(const Buffer *const helpData);
#endif

View File

@ -1614,7 +1614,7 @@ infoRender(void)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdInfo(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Info Command
Functions
***********************************************************************************************************************************/
// Render info and output to stdout
FV_EXTERN void cmdInfo(void);
FN_EXTERN void cmdInfo(void);
#endif

View File

@ -28,7 +28,7 @@ static const ProtocolServerHandler commandLocalHandlerList[] =
};
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdLocal(ProtocolServer *server)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -10,6 +10,6 @@ Local Command
Functions
***********************************************************************************************************************************/
// Local command
FV_EXTERN void cmdLocal(ProtocolServer *server);
FN_EXTERN void cmdLocal(ProtocolServer *server);
#endif

View File

@ -43,7 +43,7 @@ static const StorageRemoteFilterHandler storageRemoteFilterHandlerList[] =
};
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdRemote(ProtocolServer *const server)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -10,6 +10,6 @@ Remote Command
Functions
***********************************************************************************************************************************/
// Remote command
FV_EXTERN void cmdRemote(ProtocolServer *server);
FN_EXTERN void cmdRemote(ProtocolServer *server);
#endif

View File

@ -9,7 +9,7 @@ Common Functions and Definitions for Repo Commands
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
repoPathIsValid(const String *path)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -10,6 +10,6 @@ Repo Command Common
Functions and Definitions
***********************************************************************************************************************************/
// Path cannot contain //. Strip trailing /. Absolute path must fall under repo path. Throw error or return validated relative path.
FV_EXTERN String *repoPathIsValid(const String *path);
FN_EXTERN String *repoPathIsValid(const String *path);
#endif

View File

@ -14,7 +14,7 @@ Repository Create Command
#include "storage/s3/storage.intern.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdRepoCreate(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Repository Create Command
Functions
***********************************************************************************************************************************/
// Create the repository (create path, bucket, etc.)
FV_EXTERN void cmdRepoCreate(void);
FN_EXTERN void cmdRepoCreate(void);
#endif

View File

@ -162,7 +162,7 @@ storageGetProcess(IoWrite *destination)
}
/**********************************************************************************************************************************/
FV_EXTERN int
FN_EXTERN int
cmdStorageGet(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Repository Get Command
Functions
***********************************************************************************************************************************/
// Get a file from the repository
FV_EXTERN int cmdStorageGet(void);
FN_EXTERN int cmdStorageGet(void);
#endif

View File

@ -173,7 +173,7 @@ storageListRender(IoWrite *write)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStorageList(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Repository List Command
Functions
***********************************************************************************************************************************/
// List files in the repository
FV_EXTERN void cmdStorageList(void);
FN_EXTERN void cmdStorageList(void);
#endif

View File

@ -77,7 +77,7 @@ storagePutProcess(IoRead *source)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStoragePut(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Repository Put Command
Functions
***********************************************************************************************************************************/
// Put a file into the repository
FV_EXTERN void cmdStoragePut(void);
FN_EXTERN void cmdStoragePut(void);
#endif

View File

@ -11,7 +11,7 @@ Repository Remove Command
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStorageRemove(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Repository Remove Command
Functions
***********************************************************************************************************************************/
// Remove paths/files from the repository
FV_EXTERN void cmdStorageRemove(void);
FN_EXTERN void cmdStorageRemove(void);
#endif

View File

@ -20,7 +20,7 @@ Restore File
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN List *restoreFile(
FN_EXTERN List *restoreFile(
const String *const repoFile, const unsigned int repoIdx, const CompressType repoFileCompressType, const time_t copyTimeBegin,
const bool delta, const bool deltaForce, const String *const cipherPass, const List *const fileList)
{

View File

@ -42,7 +42,7 @@ typedef struct RestoreFileResult
RestoreResult result; // Restore result (e.g. preserve, copy)
} RestoreFileResult;
FV_EXTERN List *restoreFile(
FN_EXTERN List *restoreFile(
const String *repoFile, unsigned int repoIdx, CompressType repoFileCompressType, time_t copyTimeBegin, bool delta,
bool deltaForce, const String *cipherPass, const List *fileList);

View File

@ -13,7 +13,7 @@ Restore Protocol Handler
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
restoreFileProtocol(PackRead *const param, ProtocolServer *const server)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -11,7 +11,7 @@ Restore Protocol Handler
Functions
***********************************************************************************************************************************/
// Process protocol requests
FV_EXTERN void restoreFileProtocol(PackRead *param, ProtocolServer *server);
FN_EXTERN void restoreFileProtocol(PackRead *param, ProtocolServer *server);
/***********************************************************************************************************************************
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()

View File

@ -2381,7 +2381,7 @@ static ProtocolParallelJob *restoreJobCallback(void *data, unsigned int clientId
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdRestore(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Restore Command
Functions
***********************************************************************************************************************************/
// Restore a backup
FV_EXTERN void cmdRestore(void);
FN_EXTERN void cmdRestore(void);
#endif

View File

@ -11,7 +11,7 @@ Server Ping Command
#include "protocol/client.h"
#include "protocol/helper.h"
FV_EXTERN void
FN_EXTERN void
cmdServerPing(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -7,6 +7,6 @@ Server Ping Command
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
FV_EXTERN void cmdServerPing(void);
FN_EXTERN void cmdServerPing(void);
#endif

View File

@ -109,7 +109,7 @@ cmdServerSigChild(const int signalType, siginfo_t *signalInfo, void *context)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdServer(const unsigned int argListSize, const char *argList[])
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -9,6 +9,6 @@ Server Command
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
FV_EXTERN void cmdServer(unsigned int argListSize, const char *argList[]);
FN_EXTERN void cmdServer(unsigned int argListSize, const char *argList[]);
#endif

View File

@ -14,7 +14,7 @@ Stanza Commands Handler
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN String *
FN_EXTERN String *
cipherPassGen(CipherType cipherType)
{
FUNCTION_TEST_BEGIN();
@ -35,7 +35,7 @@ cipherPassGen(CipherType cipherType)
}
/**********************************************************************************************************************************/
FV_EXTERN PgControl
FN_EXTERN PgControl
pgValidate(void)
{
FUNCTION_TEST_VOID();

View File

@ -11,9 +11,9 @@ Stanza Commands Handler
Functions
***********************************************************************************************************************************/
// Generate a cipher
FV_EXTERN String *cipherPassGen(CipherType cipherType);
FN_EXTERN String *cipherPassGen(CipherType cipherType);
// Validate and return database information
FV_EXTERN PgControl pgValidate(void);
FN_EXTERN PgControl pgValidate(void);
#endif

View File

@ -24,7 +24,7 @@ Stanza Create Command
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStanzaCreate(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Stanza Create Command
Functions
***********************************************************************************************************************************/
// Process stanza-create
FV_EXTERN void cmdStanzaCreate(void);
FN_EXTERN void cmdStanzaCreate(void);
#endif

View File

@ -18,7 +18,7 @@ Stanza Delete Command
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStanzaDelete(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Stanza Delete Command
Functions
***********************************************************************************************************************************/
// Process stanza-delete
FV_EXTERN void cmdStanzaDelete(void);
FN_EXTERN void cmdStanzaDelete(void);
#endif

View File

@ -24,7 +24,7 @@ Stanza Update Command
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdStanzaUpgrade(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Stanza Upgrade Command
Functions
***********************************************************************************************************************************/
// Process stanza-upgrade
FV_EXTERN void cmdStanzaUpgrade(void);
FN_EXTERN void cmdStanzaUpgrade(void);
#endif

View File

@ -15,7 +15,7 @@ Verify File
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN VerifyResult
FN_EXTERN VerifyResult
verifyFile(
const String *const filePathName, const uint64_t offset, const Variant *const limit, const CompressType compressType,
const Buffer *const fileChecksum, const uint64_t fileSize, const String *const cipherPass)

View File

@ -23,7 +23,7 @@ typedef enum
Functions
***********************************************************************************************************************************/
// Verify a file in the pgBackRest repository
FV_EXTERN VerifyResult verifyFile(
FN_EXTERN VerifyResult verifyFile(
const String *filePathName, uint64_t offset, const Variant *limit, CompressType compressType, const Buffer *fileChecksum,
uint64_t fileSize, const String *cipherPass);

View File

@ -13,7 +13,7 @@ Verify Protocol Handler
#include "storage/helper.h"
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
verifyFileProtocol(PackRead *const param, ProtocolServer *const server)
{
FUNCTION_LOG_BEGIN(logLevelDebug);

View File

@ -11,7 +11,7 @@ Verify Protocol Handler
Functions
***********************************************************************************************************************************/
// Process protocol requests
FV_EXTERN void verifyFileProtocol(PackRead *param, ProtocolServer *server);
FN_EXTERN void verifyFileProtocol(PackRead *param, ProtocolServer *server);
/***********************************************************************************************************************************
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()

View File

@ -1711,7 +1711,7 @@ verifyProcess(const bool verboseText)
}
/**********************************************************************************************************************************/
FV_EXTERN void
FN_EXTERN void
cmdVerify(void)
{
FUNCTION_LOG_VOID(logLevelDebug);

View File

@ -8,6 +8,6 @@ Verify Command
Functions
***********************************************************************************************************************************/
// Verify the contents of the repository
FV_EXTERN void cmdVerify(void);
FN_EXTERN void cmdVerify(void);
#endif

View File

@ -10,7 +10,7 @@ BZ2 Common
#include "common/memContext.h"
/**********************************************************************************************************************************/
FV_EXTERN int
FN_EXTERN int
bz2Error(int error)
{
FUNCTION_TEST_BEGIN();

View File

@ -16,6 +16,6 @@ BZ2 extension
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
FV_EXTERN int bz2Error(int error);
FN_EXTERN int bz2Error(int error);
#endif

View File

@ -156,7 +156,7 @@ bz2CompressInputSame(const THIS_VOID)
}
/**********************************************************************************************************************************/
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
bz2CompressNew(int level)
{
FUNCTION_LOG_BEGIN(logLevelTrace);

View File

@ -23,6 +23,6 @@ Level constants
/***********************************************************************************************************************************
Constructors
***********************************************************************************************************************************/
FV_EXTERN IoFilter *bz2CompressNew(int level);
FN_EXTERN IoFilter *bz2CompressNew(int level);
#endif

View File

@ -143,7 +143,7 @@ bz2DecompressInputSame(const THIS_VOID)
}
/**********************************************************************************************************************************/
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
bz2DecompressNew(void)
{
FUNCTION_LOG_VOID(logLevelTrace);

View File

@ -16,6 +16,6 @@ Filter type constant
/***********************************************************************************************************************************
Constructors
***********************************************************************************************************************************/
FV_EXTERN IoFilter *bz2DecompressNew(void);
FN_EXTERN IoFilter *bz2DecompressNew(void);
#endif

View File

@ -10,7 +10,7 @@ Gz Common
#include "common/memContext.h"
/**********************************************************************************************************************************/
FV_EXTERN int
FN_EXTERN int
gzError(int error)
{
if (error != Z_OK && error != Z_STREAM_END)

View File

@ -19,6 +19,6 @@ Constants
Functions
***********************************************************************************************************************************/
// Process gz errors
FV_EXTERN int gzError(int error);
FN_EXTERN int gzError(int error);
#endif

View File

@ -161,7 +161,7 @@ gzCompressInputSame(const THIS_VOID)
}
/**********************************************************************************************************************************/
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
gzCompressNew(int level)
{
FUNCTION_LOG_BEGIN(logLevelTrace);

View File

@ -23,6 +23,6 @@ Level constants
/***********************************************************************************************************************************
Constructors
***********************************************************************************************************************************/
FV_EXTERN IoFilter *gzCompressNew(int level);
FN_EXTERN IoFilter *gzCompressNew(int level);
#endif

View File

@ -143,7 +143,7 @@ gzDecompressInputSame(const THIS_VOID)
}
/**********************************************************************************************************************************/
FV_EXTERN IoFilter *
FN_EXTERN IoFilter *
gzDecompressNew(void)
{
FUNCTION_LOG_VOID(logLevelTrace);

Some files were not shown because too many files have changed in this diff Show More