1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-15 01:04:37 +02:00

Add Pack pseudo-type.

Rather than working directly with Buffer types, define a new Pack pseudo-type that represents a Buffer containing a pack. This makes it clearer that a pack is being stored and allows stronger typing.
This commit is contained in:
David Steele
2021-09-23 08:31:32 -04:00
parent 131ac0ab5e
commit 15e7ff10d3
42 changed files with 304 additions and 264 deletions

View File

@ -123,7 +123,7 @@ Render help to a pack
static PackWrite *
bldHlpRenderHelpAutoCPack(const BldCfg bldCfg, const BldHlp bldHlp)
{
PackWrite *const pack = pckWriteNewBuf(bufNew(65 * 1024));
PackWrite *const pack = pckWriteNewP(.size = 65 * 1024);
// Command help
// -----------------------------------------------------------------------------------------------------------------------------
@ -257,7 +257,7 @@ static Buffer *
bldHlpRenderHelpAutoCCmp(const BldCfg bldCfg, const BldHlp bldHlp)
{
// Get pack buffer
const Buffer *const packBuf = pckWriteBuf(bldHlpRenderHelpAutoCPack(bldCfg, bldHlp));
const Buffer *const packBuf = pckToBuf(pckWriteResult(bldHlpRenderHelpAutoCPack(bldCfg, bldHlp)));
Buffer *const result = bufNew(bufSize(packBuf));
// Open source/destination