1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-05 04:30:41 +03:00

Apply String constant macros where appropriate.

This may not be all the places where the macros can be useful but it's a good start.
This commit is contained in:
David Steele
2018-11-10 18:32:49 -05:00
parent 8f857a975e
commit 5e3b7cbe6e
27 changed files with 119 additions and 60 deletions

View File

@@ -16,6 +16,12 @@ Archive Push Command
#include "storage/helper.h"
#include "storage/helper.h"
/***********************************************************************************************************************************
WAL segment constants
***********************************************************************************************************************************/
STRING_EXTERN(WAL_SEGMENT_REGEXP_STR, WAL_SEGMENT_REGEXP);
STRING_EXTERN(WAL_SEGMENT_PARTIAL_REGEXP_STR, WAL_SEGMENT_PARTIAL_REGEXP);
/***********************************************************************************************************************************
Check for ok/error status files in the spool in/out directory
***********************************************************************************************************************************/
@@ -32,7 +38,7 @@ archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool confe
MEM_CONTEXT_TEMP_BEGIN()
{
String *spoolQueue = strNew(archiveMode == archiveModeGet ? STORAGE_SPOOL_ARCHIVE_IN : STORAGE_SPOOL_ARCHIVE_OUT);
const String *spoolQueue = (archiveMode == archiveModeGet ? STORAGE_SPOOL_ARCHIVE_IN_STR : STORAGE_SPOOL_ARCHIVE_OUT_STR);
String *okFile = strNewFmt("%s.ok", strPtr(walSegment));
String *errorFile = strNewFmt("%s.error", strPtr(walSegment));
@@ -148,7 +154,7 @@ walIsSegment(const String *walSegment)
{
MEM_CONTEXT_BEGIN(memContextTop())
{
regExpSegment = regExpNew(strNew(WAL_SEGMENT_PARTIAL_REGEXP));
regExpSegment = regExpNew(WAL_SEGMENT_PARTIAL_REGEXP_STR);
}
MEM_CONTEXT_END();
}