You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
Remove redundant documentation from PostgreSQL interface files and clarify ambiguous function names.
Move the documentation to postgres/interface.c so it can be updated without having to update N source files. The "is" function was not very specific so rename to "controlIs".
This commit is contained in:
@ -1,20 +1,17 @@
|
||||
/***********************************************************************************************************************************
|
||||
PostgreSQL 9.5 Interface
|
||||
|
||||
See postgres/interface.c for documentation.
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "postgres/interface/v095.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Include PostgreSQL Types
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/v095.auto.c"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Is the control file for this version of PostgreSQL?
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
bool
|
||||
pgInterfaceIs095(const Buffer *controlFile)
|
||||
pgInterfaceControlIs095(const Buffer *controlFile)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(BUFFER, controlFile);
|
||||
@ -28,9 +25,7 @@ pgInterfaceIs095(const Buffer *controlFile)
|
||||
controlData->pg_control_version == PG_CONTROL_VERSION && controlData->catalog_version_no == CATALOG_VERSION_NO);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get information from pg_control in a common format
|
||||
***********************************************************************************************************************************/
|
||||
/**********************************************************************************************************************************/
|
||||
PgControl
|
||||
pgInterfaceControl095(const Buffer *controlFile)
|
||||
{
|
||||
@ -39,7 +34,7 @@ pgInterfaceControl095(const Buffer *controlFile)
|
||||
FUNCTION_LOG_END();
|
||||
|
||||
ASSERT(controlFile != NULL);
|
||||
ASSERT(pgInterfaceIs095(controlFile));
|
||||
ASSERT(pgInterfaceControlIs095(controlFile));
|
||||
|
||||
PgControl result = {0};
|
||||
ControlFileData *controlData = (ControlFileData *)bufPtr(controlFile);
|
||||
@ -56,11 +51,9 @@ pgInterfaceControl095(const Buffer *controlFile)
|
||||
FUNCTION_LOG_RETURN(PG_CONTROL, result);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Create pg_control for testing
|
||||
***********************************************************************************************************************************/
|
||||
#ifdef DEBUG
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
pgInterfaceControlTest095(PgControl pgControl, Buffer *buffer)
|
||||
{
|
||||
|
Reference in New Issue
Block a user