PostgreSQL Source Code: src/include/common/parse_manifest.h Source File

PostgreSQL Source Code git master
parse_manifest.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * parse_manifest.h
4 * Parse a backup manifest in JSON format.
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/common/parse_manifest.h
10 *
11 *-------------------------------------------------------------------------
12 */
13
14#ifndef PARSE_MANIFEST_H
15#define PARSE_MANIFEST_H
16
17#include "access/xlogdefs.h"
18#include "common/checksum_helper.h"
19#include "mb/pg_wchar.h"
20
21struct JsonManifestParseContext;
22 typedef struct JsonManifestParseContext JsonManifestParseContext;
23 typedef struct JsonManifestParseIncrementalState JsonManifestParseIncrementalState;
24
25 typedef void (*json_manifest_version_callback) (JsonManifestParseContext *,
26 int manifest_version);
27 typedef void (*json_manifest_system_identifier_callback) (JsonManifestParseContext *,
28 uint64 manifest_system_identifier);
29 typedef void (*json_manifest_per_file_callback) (JsonManifestParseContext *,
30 const char *pathname,
31 uint64 size, pg_checksum_type checksum_type,
32 int checksum_length, uint8 *checksum_payload);
33 typedef void (*json_manifest_per_wal_range_callback) (JsonManifestParseContext *,
34 TimeLineID tli,
35 XLogRecPtr start_lsn, XLogRecPtr end_lsn);
36 typedef void (*json_manifest_error_callback) (JsonManifestParseContext *,
37 const char *fmt,...) pg_attribute_printf(2, 3);
38
39 struct JsonManifestParseContext
40{
41 void *private_data;
42 json_manifest_version_callback version_cb;
43 json_manifest_system_identifier_callback system_identifier_cb;
44 json_manifest_per_file_callback per_file_cb;
45 json_manifest_per_wal_range_callback per_wal_range_cb;
46 json_manifest_error_callback error_cb;
47};
48
49extern void json_parse_manifest(JsonManifestParseContext *context,
50 const char *buffer, size_t size);
51extern JsonManifestParseIncrementalState *json_parse_manifest_incremental_init(JsonManifestParseContext *context);
52extern void json_parse_manifest_incremental_chunk(JsonManifestParseIncrementalState *incstate,
53 const char *chunk, size_t size,
54 bool is_last);
55extern void json_parse_manifest_incremental_shutdown(JsonManifestParseIncrementalState *incstate);
56
57#endif
uint8_t uint8
Definition: c.h:536
#define pg_attribute_printf(f, a)
Definition: c.h:232
uint64_t uint64
Definition: c.h:539
pg_checksum_type
void(* json_manifest_per_wal_range_callback)(JsonManifestParseContext *, TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
Definition: parse_manifest.h:33
void json_parse_manifest(JsonManifestParseContext *context, const char *buffer, size_t size)
JsonManifestParseIncrementalState * json_parse_manifest_incremental_init(JsonManifestParseContext *context)
void(* json_manifest_per_file_callback)(JsonManifestParseContext *, const char *pathname, uint64 size, pg_checksum_type checksum_type, int checksum_length, uint8 *checksum_payload)
Definition: parse_manifest.h:29
void(* json_manifest_system_identifier_callback)(JsonManifestParseContext *, uint64 manifest_system_identifier)
Definition: parse_manifest.h:27
void(* json_manifest_version_callback)(JsonManifestParseContext *, int manifest_version)
Definition: parse_manifest.h:25
void(* json_manifest_error_callback)(JsonManifestParseContext *, const char *fmt,...) pg_attribute_printf(2
Definition: parse_manifest.h:36
void json_parse_manifest_incremental_shutdown(JsonManifestParseIncrementalState *incstate)
void json_parse_manifest_incremental_chunk(JsonManifestParseIncrementalState *incstate, const char *chunk, size_t size, bool is_last)
json_manifest_per_wal_range_callback per_wal_range_cb
Definition: parse_manifest.h:45
json_manifest_system_identifier_callback system_identifier_cb
Definition: parse_manifest.h:43
json_manifest_error_callback error_cb
Definition: parse_manifest.h:46
json_manifest_per_file_callback per_file_cb
Definition: parse_manifest.h:44
json_manifest_version_callback version_cb
Definition: parse_manifest.h:42
uint64 XLogRecPtr
Definition: xlogdefs.h:21
uint32 TimeLineID
Definition: xlogdefs.h:62

AltStyle によって変換されたページ (->オリジナル) /