Rename JsonManifestParseContext callbacks.
authorRobert Haas <rhaas@postgresql.org>
Thu, 16 Nov 2023 18:10:01 +0000 (13:10 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 30 Nov 2023 13:43:52 +0000 (08:43 -0500)
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
src/bin/pg_verifybackup/parse_manifest.h
src/bin/pg_verifybackup/pg_verifybackup.c
src/tools/pgindent/typedefs.list

index bf0227c6689f6a7961af68362eab2d9e74ae314c..850adf90a8dbc299e2d0c7362edd2286caa92347 100644 (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.
  * 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)
index 7387a917a21967063af2bb38d7a4531a272415b7..001b9a6a1101e2ca35c8eb2c8e4696c44c02840f 100644 (file)
 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;
 };
 
index 059836f0e647e12d1566128943b1cc379ef3cdc3..8526eb9bbf796ad9d3ac469f5293387399f363fb 100644 (file)
@@ -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);
 
index d659adbfd6c92204fef2499da16b1cb99d4b10c7..38a86575e1c0e1559b12e8c16be78ee83717f02d 100644 (file)
@@ -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