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
This commit is contained in:
Robert Haas 2023-12-05 12:17:49 -05:00
parent 4d0cf0b05d
commit d463aa06a9
4 changed files with 17 additions and 17 deletions

View File

@ -112,7 +112,7 @@ static bool parse_xlogrecptr(XLogRecPtr *result, char *input);
* *
* Caller should set up the parsing context and then invoke this function. * Caller should set up the parsing context and then invoke this function.
* For each file whose information is extracted from the manifest, * 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. * invoked and is expected not to return.
*/ */
void void
@ -545,8 +545,8 @@ json_manifest_finalize_file(JsonManifestParseState *parse)
} }
/* Invoke the callback with the details we've gathered. */ /* Invoke the callback with the details we've gathered. */
context->perfile_cb(context, parse->pathname, size, context->per_file_cb(context, parse->pathname, size,
checksum_type, checksum_length, checksum_payload); checksum_type, checksum_length, checksum_payload);
/* Free memory we no longer need. */ /* Free memory we no longer need. */
if (parse->size != NULL) if (parse->size != NULL)
@ -602,7 +602,7 @@ json_manifest_finalize_wal_range(JsonManifestParseState *parse)
"could not parse end LSN"); "could not parse end LSN");
/* Invoke the callback with the details we've gathered. */ /* 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. */ /* Free memory we no longer need. */
if (parse->timeline != NULL) if (parse->timeline != NULL)

View File

@ -21,13 +21,13 @@
struct JsonManifestParseContext; struct JsonManifestParseContext;
typedef struct JsonManifestParseContext JsonManifestParseContext; typedef struct JsonManifestParseContext JsonManifestParseContext;
typedef void (*json_manifest_perfile_callback) (JsonManifestParseContext *, typedef void (*json_manifest_per_file_callback) (JsonManifestParseContext *,
char *pathname, char *pathname,
size_t size, pg_checksum_type checksum_type, size_t size, pg_checksum_type checksum_type,
int checksum_length, uint8 *checksum_payload); int checksum_length, uint8 *checksum_payload);
typedef void (*json_manifest_perwalrange_callback) (JsonManifestParseContext *, typedef void (*json_manifest_per_wal_range_callback) (JsonManifestParseContext *,
TimeLineID tli, TimeLineID tli,
XLogRecPtr start_lsn, XLogRecPtr end_lsn); XLogRecPtr start_lsn, XLogRecPtr end_lsn);
typedef void (*json_manifest_error_callback) (JsonManifestParseContext *, typedef void (*json_manifest_error_callback) (JsonManifestParseContext *,
const char *fmt,...) pg_attribute_printf(2, 3) const char *fmt,...) pg_attribute_printf(2, 3)
pg_attribute_noreturn(); pg_attribute_noreturn();
@ -35,8 +35,8 @@ typedef void (*json_manifest_error_callback) (JsonManifestParseContext *,
struct JsonManifestParseContext struct JsonManifestParseContext
{ {
void *private_data; void *private_data;
json_manifest_perfile_callback perfile_cb; json_manifest_per_file_callback per_file_cb;
json_manifest_perwalrange_callback perwalrange_cb; json_manifest_per_wal_range_callback per_wal_range_cb;
json_manifest_error_callback error_cb; json_manifest_error_callback error_cb;
}; };

View File

@ -440,8 +440,8 @@ parse_manifest_file(char *manifest_path, manifest_files_hash **ht_p,
private_context.first_wal_range = NULL; private_context.first_wal_range = NULL;
private_context.last_wal_range = NULL; private_context.last_wal_range = NULL;
context.private_data = &private_context; context.private_data = &private_context;
context.perfile_cb = record_manifest_details_for_file; context.per_file_cb = record_manifest_details_for_file;
context.perwalrange_cb = record_manifest_details_for_wal_range; context.per_wal_range_cb = record_manifest_details_for_wal_range;
context.error_cb = report_manifest_error; context.error_cb = report_manifest_error;
json_parse_manifest(&context, buffer, statbuf.st_size); json_parse_manifest(&context, buffer, statbuf.st_size);

View File

@ -3445,8 +3445,8 @@ jmp_buf
join_search_hook_type join_search_hook_type
json_aelem_action json_aelem_action
json_manifest_error_callback json_manifest_error_callback
json_manifest_perfile_callback json_manifest_per_file_callback
json_manifest_perwalrange_callback json_manifest_per_wal_range_callback
json_ofield_action json_ofield_action
json_scalar_action json_scalar_action
json_struct_action json_struct_action