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
This commit is contained in:
Robert Haas 2024-08-05 11:40:29 -04:00
parent 53b2c921a0
commit f80b09bac8
12 changed files with 18 additions and 18 deletions

View File

@ -3037,7 +3037,7 @@ frontend_common_code = declare_dependency(
compile_args: ['-DFRONTEND'],
include_directories: [postgres_inc],
sources: generated_headers,
dependencies: [os_deps, zlib, zstd],
dependencies: [os_deps, zlib, zstd, lz4],
)
backend_common_code = declare_dependency(

View File

@ -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

View File

@ -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,

View File

@ -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',

View File

@ -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 \

View File

@ -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
{

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -17,8 +17,8 @@
#include <zstd.h>
#endif
#include "astreamer.h"
#include "common/logging.h"
#include "fe_utils/astreamer.h"
#ifdef USE_ZSTD

View File

@ -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',