From 8894a309dcc7dd43dccda0f4de5051c032b458b8 Mon Sep 17 00:00:00 2001
From: Robert Haas <rhaas@postgresql.org>
Date: Thu, 16 Nov 2023 13:10:01 -0500
Subject: [PATCH v11 1/7] Rename JsonManifestParseContext callbacks.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There is currently a worldwide oversupply of underscores, so use
some of them here as word separators. In the event of a later
underscore shortage, these can be removed again, and another of
PostgreSQL's innumerable methods of marking word bounadries can
be substituted.

Per suggestion from Álvaro Herrera.
---
 src/bin/pg_verifybackup/parse_manifest.c  |  8 ++++----
 src/bin/pg_verifybackup/parse_manifest.h  | 18 +++++++++---------
 src/bin/pg_verifybackup/pg_verifybackup.c |  4 ++--
 src/tools/pgindent/typedefs.list          |  4 ++--
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/bin/pg_verifybackup/parse_manifest.c b/src/bin/pg_verifybackup/parse_manifest.c
index bf0227c668..850adf90a8 100644
--- a/src/bin/pg_verifybackup/parse_manifest.c
+++ b/src/bin/pg_verifybackup/parse_manifest.c
@@ -112,7 +112,7 @@ static bool parse_xlogrecptr(XLogRecPtr *result, char *input);
  *
  * Caller should set up the parsing context and then invoke this function.
  * For each file whose information is extracted from the manifest,
- * context->perfile_cb is invoked.  In case of trouble, context->error_cb is
+ * context->per_file_cb is invoked.  In case of trouble, context->error_cb is
  * invoked and is expected not to return.
  */
 void
@@ -545,8 +545,8 @@ json_manifest_finalize_file(JsonManifestParseState *parse)
 	}
 
 	/* Invoke the callback with the details we've gathered. */
-	context->perfile_cb(context, parse->pathname, size,
-						checksum_type, checksum_length, checksum_payload);
+	context->per_file_cb(context, parse->pathname, size,
+						 checksum_type, checksum_length, checksum_payload);
 
 	/* Free memory we no longer need. */
 	if (parse->size != NULL)
@@ -602,7 +602,7 @@ json_manifest_finalize_wal_range(JsonManifestParseState *parse)
 									"could not parse end LSN");
 
 	/* Invoke the callback with the details we've gathered. */
-	context->perwalrange_cb(context, tli, start_lsn, end_lsn);
+	context->per_wal_range_cb(context, tli, start_lsn, end_lsn);
 
 	/* Free memory we no longer need. */
 	if (parse->timeline != NULL)
diff --git a/src/bin/pg_verifybackup/parse_manifest.h b/src/bin/pg_verifybackup/parse_manifest.h
index 7387a917a2..001b9a6a11 100644
--- a/src/bin/pg_verifybackup/parse_manifest.h
+++ b/src/bin/pg_verifybackup/parse_manifest.h
@@ -21,13 +21,13 @@
 struct JsonManifestParseContext;
 typedef struct JsonManifestParseContext JsonManifestParseContext;
 
-typedef void (*json_manifest_perfile_callback) (JsonManifestParseContext *,
-												char *pathname,
-												size_t size, pg_checksum_type checksum_type,
-												int checksum_length, uint8 *checksum_payload);
-typedef void (*json_manifest_perwalrange_callback) (JsonManifestParseContext *,
-													TimeLineID tli,
-													XLogRecPtr start_lsn, XLogRecPtr end_lsn);
+typedef void (*json_manifest_per_file_callback) (JsonManifestParseContext *,
+												 char *pathname,
+												 size_t size, pg_checksum_type checksum_type,
+												 int checksum_length, uint8 *checksum_payload);
+typedef void (*json_manifest_per_wal_range_callback) (JsonManifestParseContext *,
+													  TimeLineID tli,
+													  XLogRecPtr start_lsn, XLogRecPtr end_lsn);
 typedef void (*json_manifest_error_callback) (JsonManifestParseContext *,
 											  const char *fmt,...) pg_attribute_printf(2, 3)
 			pg_attribute_noreturn();
@@ -35,8 +35,8 @@ typedef void (*json_manifest_error_callback) (JsonManifestParseContext *,
 struct JsonManifestParseContext
 {
 	void	   *private_data;
-	json_manifest_perfile_callback perfile_cb;
-	json_manifest_perwalrange_callback perwalrange_cb;
+	json_manifest_per_file_callback per_file_cb;
+	json_manifest_per_wal_range_callback per_wal_range_cb;
 	json_manifest_error_callback error_cb;
 };
 
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index 059836f0e6..8526eb9bbf 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -440,8 +440,8 @@ parse_manifest_file(char *manifest_path, manifest_files_hash **ht_p,
 	private_context.first_wal_range = NULL;
 	private_context.last_wal_range = NULL;
 	context.private_data = &private_context;
-	context.perfile_cb = record_manifest_details_for_file;
-	context.perwalrange_cb = record_manifest_details_for_wal_range;
+	context.per_file_cb = record_manifest_details_for_file;
+	context.per_wal_range_cb = record_manifest_details_for_wal_range;
 	context.error_cb = report_manifest_error;
 	json_parse_manifest(&context, buffer, statbuf.st_size);
 
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index dba3498a13..3cea73e220 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -3441,8 +3441,8 @@ jmp_buf
 join_search_hook_type
 json_aelem_action
 json_manifest_error_callback
-json_manifest_perfile_callback
-json_manifest_perwalrange_callback
+json_manifest_per_file_callback
+json_manifest_per_wal_range_callback
 json_ofield_action
 json_scalar_action
 json_struct_action
-- 
2.37.1 (Apple Git-137.1)

