aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2024-08-05 11:40:29 -0400
committerRobert Haas <rhaas@postgresql.org>2024-08-05 11:41:57 -0400
commitf80b09bac87d6b49f5dbb6131da5fbd9b9773c5c (patch)
tree353896ae8f4a860c269ec705c4f1becddf4f90f1 /src
parent53b2c921a0f9b56465ab65165c1909f9616ffa98 (diff)
downloadpostgresql-f80b09bac87d6b49f5dbb6131da5fbd9b9773c5c.tar.gz
postgresql-f80b09bac87d6b49f5dbb6131da5fbd9b9773c5c.zip
Move astreamer (except astreamer_inject) to fe_utils.
This allows the code to be used by other frontend applications. Amul Sul, reviewed by Sravan Kumar, Andres Freund (whose input I specifically solicited regarding the meson.build changes), and me. Discussion: http://postgr.es/m/CAAJ_b94StvLWrc_p4q-f7n3OPfr6GhL8_XuAg2aAaYZp1tF-nw@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/Makefile7
-rw-r--r--src/bin/pg_basebackup/astreamer_inject.h2
-rw-r--r--src/bin/pg_basebackup/meson.build5
-rw-r--r--src/fe_utils/Makefile5
-rw-r--r--src/fe_utils/astreamer_file.c (renamed from src/bin/pg_basebackup/astreamer_file.c)2
-rw-r--r--src/fe_utils/astreamer_gzip.c (renamed from src/bin/pg_basebackup/astreamer_gzip.c)2
-rw-r--r--src/fe_utils/astreamer_lz4.c (renamed from src/bin/pg_basebackup/astreamer_lz4.c)2
-rw-r--r--src/fe_utils/astreamer_tar.c (renamed from src/bin/pg_basebackup/astreamer_tar.c)2
-rw-r--r--src/fe_utils/astreamer_zstd.c (renamed from src/bin/pg_basebackup/astreamer_zstd.c)2
-rw-r--r--src/fe_utils/meson.build5
-rw-r--r--src/include/fe_utils/astreamer.h (renamed from src/bin/pg_basebackup/astreamer.h)0
11 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/pg_basebackup/Makefile b/src/bin/pg_basebackup/Makefile
index a71af2d48a7..f1e73058b23 100644
--- a/src/bin/pg_basebackup/Makefile
+++ b/src/bin/pg_basebackup/Makefile
@@ -37,12 +37,7 @@ OBJS = \
BBOBJS = \
pg_basebackup.o \
- astreamer_file.o \
- astreamer_gzip.o \
- astreamer_inject.o \
- astreamer_lz4.o \
- astreamer_tar.o \
- astreamer_zstd.o
+ astreamer_inject.o
all: pg_basebackup pg_createsubscriber pg_receivewal pg_recvlogical
diff --git a/src/bin/pg_basebackup/astreamer_inject.h b/src/bin/pg_basebackup/astreamer_inject.h
index 8504b3f5e0d..aeed533862b 100644
--- a/src/bin/pg_basebackup/astreamer_inject.h
+++ b/src/bin/pg_basebackup/astreamer_inject.h
@@ -12,7 +12,7 @@
#ifndef ASTREAMER_INJECT_H
#define ASTREAMER_INJECT_H
-#include "astreamer.h"
+#include "fe_utils/astreamer.h"
#include "pqexpbuffer.h"
extern astreamer *astreamer_recovery_injector_new(astreamer *next,
diff --git a/src/bin/pg_basebackup/meson.build b/src/bin/pg_basebackup/meson.build
index a68dbd7837d..9101fc18438 100644
--- a/src/bin/pg_basebackup/meson.build
+++ b/src/bin/pg_basebackup/meson.build
@@ -1,12 +1,7 @@
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
common_sources = files(
- 'astreamer_file.c',
- 'astreamer_gzip.c',
'astreamer_inject.c',
- 'astreamer_lz4.c',
- 'astreamer_tar.c',
- 'astreamer_zstd.c',
'receivelog.c',
'streamutil.c',
'walmethods.c',
diff --git a/src/fe_utils/Makefile b/src/fe_utils/Makefile
index 946c05258f0..2694be4b859 100644
--- a/src/fe_utils/Makefile
+++ b/src/fe_utils/Makefile
@@ -21,6 +21,11 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
OBJS = \
archive.o \
+ astreamer_file.o \
+ astreamer_gzip.o \
+ astreamer_lz4.o \
+ astreamer_tar.o \
+ astreamer_zstd.o \
cancel.o \
conditional.o \
connect_utils.o \
diff --git a/src/bin/pg_basebackup/astreamer_file.c b/src/fe_utils/astreamer_file.c
index 2742385e103..13d1192c6e6 100644
--- a/src/bin/pg_basebackup/astreamer_file.c
+++ b/src/fe_utils/astreamer_file.c
@@ -13,10 +13,10 @@
#include <unistd.h>
-#include "astreamer.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "common/string.h"
+#include "fe_utils/astreamer.h"
typedef struct astreamer_plain_writer
{
diff --git a/src/bin/pg_basebackup/astreamer_gzip.c b/src/fe_utils/astreamer_gzip.c
index 6f7c27afbbc..dd28defac7b 100644
--- a/src/bin/pg_basebackup/astreamer_gzip.c
+++ b/src/fe_utils/astreamer_gzip.c
@@ -17,10 +17,10 @@
#include <zlib.h>
#endif
-#include "astreamer.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "common/string.h"
+#include "fe_utils/astreamer.h"
#ifdef HAVE_LIBZ
typedef struct astreamer_gzip_writer
diff --git a/src/bin/pg_basebackup/astreamer_lz4.c b/src/fe_utils/astreamer_lz4.c
index 1c40d7d8ad5..d8b2a367e47 100644
--- a/src/bin/pg_basebackup/astreamer_lz4.c
+++ b/src/fe_utils/astreamer_lz4.c
@@ -17,10 +17,10 @@
#include <lz4frame.h>
#endif
-#include "astreamer.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "common/string.h"
+#include "fe_utils/astreamer.h"
#ifdef USE_LZ4
typedef struct astreamer_lz4_frame
diff --git a/src/bin/pg_basebackup/astreamer_tar.c b/src/fe_utils/astreamer_tar.c
index 673690cd18f..f5d3562d280 100644
--- a/src/bin/pg_basebackup/astreamer_tar.c
+++ b/src/fe_utils/astreamer_tar.c
@@ -23,8 +23,8 @@
#include <time.h>
-#include "astreamer.h"
#include "common/logging.h"
+#include "fe_utils/astreamer.h"
#include "pgtar.h"
typedef struct astreamer_tar_parser
diff --git a/src/bin/pg_basebackup/astreamer_zstd.c b/src/fe_utils/astreamer_zstd.c
index 58dc679ef99..45f6cb67363 100644
--- a/src/bin/pg_basebackup/astreamer_zstd.c
+++ b/src/fe_utils/astreamer_zstd.c
@@ -17,8 +17,8 @@
#include <zstd.h>
#endif
-#include "astreamer.h"
#include "common/logging.h"
+#include "fe_utils/astreamer.h"
#ifdef USE_ZSTD
diff --git a/src/fe_utils/meson.build b/src/fe_utils/meson.build
index 14d0482a2cc..043021d826d 100644
--- a/src/fe_utils/meson.build
+++ b/src/fe_utils/meson.build
@@ -2,6 +2,11 @@
fe_utils_sources = files(
'archive.c',
+ 'astreamer_file.c',
+ 'astreamer_gzip.c',
+ 'astreamer_lz4.c',
+ 'astreamer_tar.c',
+ 'astreamer_zstd.c',
'cancel.c',
'conditional.c',
'connect_utils.c',
diff --git a/src/bin/pg_basebackup/astreamer.h b/src/include/fe_utils/astreamer.h
index 2c014dbddbe..2c014dbddbe 100644
--- a/src/bin/pg_basebackup/astreamer.h
+++ b/src/include/fe_utils/astreamer.h