From: Robert Haas Date: Tue, 5 Dec 2023 17:17:49 +0000 (-0500) Subject: Rename JsonManifestParseContext callbacks. X-Git-Tag: REL_17_BETA1~1333 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=d463aa06a9a8c078c1a80ac14b65765b9e5b9ecd;p=postgresql.git Rename JsonManifestParseContext callbacks. There is no real reason to just run multiple words together when we can instead punctuate them with marks intended for that purpose. Per suggestion from Álvaro Herrera. Discussion: http://postgr.es/m/202311161021.nisg7imt7kyf@alvherre.pgsql --- diff --git a/src/bin/pg_verifybackup/parse_manifest.c b/src/bin/pg_verifybackup/parse_manifest.c index bf0227c6689..850adf90a8d 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 7387a917a21..001b9a6a110 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 059836f0e64..8526eb9bbf7 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 d659adbfd6c..38a86575e1c 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -3445,8 +3445,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