1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-05-31 22:49:46 +02:00
pgbackrest/src/postgres/pageChecksum.h
David Steele ceafd8e19d Migrate page checksum filter to C.
This filter exactly mimics the behavior of the Perl filter so is a drop-in replacement.

The filter is not integrated yet since it requires the Perl-to-C storage layer interface coming in a future commit.
2019-06-17 07:52:03 -04:00

21 lines
1.1 KiB
C

/***********************************************************************************************************************************
Checksum Implementation for Data Pages
***********************************************************************************************************************************/
#ifndef POSTGRES_PAGECHECKSUM_H
#define POSTGRES_PAGECHECKSUM_H
#include <stdint.h>
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
uint16_t pageChecksum(const unsigned char *page, unsigned int blockNo, unsigned int pageSize);
uint64_t pageLsn(const unsigned char *page);
bool pageChecksumTest(
const unsigned char *page, unsigned int blockNo, unsigned int pageSize, uint32_t ignoreWalId, uint32_t ignoreWalOffset);
bool pageChecksumBufferTest(
const unsigned char *pageBuffer, unsigned int pageBufferSize, unsigned int blockNoBegin, unsigned int pageSize,
uint32_t ignoreWalId, uint32_t ignoreWalOffset);
#endif