1/*-------------------------------------------------------------------------
2 *
3 * generic_xlog.h
4 * Generic xlog API definition.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/access/generic_xlog.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef GENERIC_XLOG_H
15#define GENERIC_XLOG_H
16
17#include "access/xlog.h"
18#include "access/xlog_internal.h"
19#include "access/xloginsert.h"
20#include "storage/bufpage.h"
21#include "utils/rel.h"
22
23#define MAX_GENERIC_XLOG_PAGES XLR_NORMAL_MAX_BLOCK_ID
24
25/* Flag bits for GenericXLogRegisterBuffer */
26#define GENERIC_XLOG_FULL_IMAGE 0x0001 /* write full-page image */
27
28/* state of generic xlog record construction */
29struct GenericXLogState;
30typedef struct GenericXLogState GenericXLogState;
31
32/* API for construction of generic xlog records */
33extern GenericXLogState *GenericXLogStart(Relation relation);
34extern Page GenericXLogRegisterBuffer(GenericXLogState *state, Buffer buffer,
35 int flags);
36extern XLogRecPtr GenericXLogFinish(GenericXLogState *state);
37extern void GenericXLogAbort(GenericXLogState *state);
38
39/* functions defined for rmgr */
40extern void generic_redo(XLogReaderState *record);
41extern const char *generic_identify(uint8 info);
42extern void generic_desc(StringInfo buf, XLogReaderState *record);
43extern void generic_mask(char *pagedata, BlockNumber blkno);
44
45#endif /* GENERIC_XLOG_H */
46