Move recovery injector astreamer to a separate header file.
authorRobert Haas <[email protected]>
Mon, 5 Aug 2024 14:40:23 +0000 (10:40 -0400)
committerRobert Haas <[email protected]>
Mon, 5 Aug 2024 14:55:06 +0000 (10:55 -0400)
Unlike the rest of the astreamer (formerly bbstreamer) infrastructure
which is reusable by other tools, astreamer_inject.c seems extremely
specific to pg_basebackup. Hence, move the corresponding declarations
to a separate header file, so that we can move the rest of the code
without moving this.

Amul Sul, reviewed by Sravan Kumar and by me.

Discussion: http://postgr.es/m/CAAJ_b94StvLWrc_p4q-f7n3OPfr6GhL8_XuAg2aAaYZp1tF-nw@mail.gmail.com

src/bin/pg_basebackup/astreamer.h
src/bin/pg_basebackup/astreamer_inject.c
src/bin/pg_basebackup/astreamer_inject.h [new file with mode: 0644]
src/bin/pg_basebackup/pg_basebackup.c

index b5ed138f54efb7281ef4fca87408be7184228441..2c014dbddbee6a4642e89d87c0b540e084f2f4b5 100644 (file)
@@ -217,10 +217,4 @@ extern astreamer *astreamer_tar_parser_new(astreamer *next);
 extern astreamer *astreamer_tar_terminator_new(astreamer *next);
 extern astreamer *astreamer_tar_archiver_new(astreamer *next);
 
-extern astreamer *astreamer_recovery_injector_new(astreamer *next,
-                                                 bool is_recovery_guc_supported,
-                                                 PQExpBuffer recoveryconfcontents);
-extern void astreamer_inject_file(astreamer *streamer, char *pathname,
-                                 char *data, int len);
-
 #endif
index 7f1decded8d893d1592c803a42a2acf72f479ca8..4ad8381f1023d5abba837019b09e7f270548414c 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "postgres_fe.h"
 
-#include "astreamer.h"
+#include "astreamer_inject.h"
 #include "common/file_perm.h"
 #include "common/logging.h"
 
diff --git a/src/bin/pg_basebackup/astreamer_inject.h b/src/bin/pg_basebackup/astreamer_inject.h
new file mode 100644 (file)
index 0000000..8504b3f
--- /dev/null
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * astreamer_inject.h
+ *
+ * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ *       src/bin/pg_basebackup/astreamer_inject.h
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef ASTREAMER_INJECT_H
+#define ASTREAMER_INJECT_H
+
+#include "astreamer.h"
+#include "pqexpbuffer.h"
+
+extern astreamer *astreamer_recovery_injector_new(astreamer *next,
+                                                 bool is_recovery_guc_supported,
+                                                 PQExpBuffer recoveryconfcontents);
+extern void astreamer_inject_file(astreamer *streamer, char *pathname,
+                                 char *data, int len);
+
+#endif
index 1966ada69c9acb50885b88e561dda8eb54cb59d8..72ba32433529e27d37889676d9e4263f4a7d086b 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 #include "access/xlog_internal.h"
-#include "astreamer.h"
+#include "astreamer_inject.h"
 #include "backup/basebackup.h"
 #include "common/compression.h"
 #include "common/file_perm.h"