mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
pg_dump: Tiny header cleanup
In commits9c02e3a986
and8ec0aaeae0
, Nathan added a duplicate TocEntry typedef forward declaration (plus assorted #ifdef hackery to avoid C99 preprocessor issues) to deal with some very old untidyness regarding DefnDumperPtr function prototype being located in pg_backup.h. But there's no reason to have the DefnDumperPtr typedef (and the accompanying DataDumperPtr typedef) in that file at all; they are better placed in pg_backup_archiver.h, the internal header, because they are only used internally. That also requires zero #ifdef hackery, so move them there. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/202504042140.qo66ggw6wzsz@alvherre.pgsql
This commit is contained in:
@ -284,16 +284,6 @@ typedef int DumpId;
|
|||||||
/*
|
/*
|
||||||
* Function pointer prototypes for assorted callback methods.
|
* Function pointer prototypes for assorted callback methods.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* forward declaration to avoid including pg_backup_archiver.h here */
|
|
||||||
#ifndef HAVE_TOCENTRY_TYPEDEF
|
|
||||||
typedef struct _tocEntry TocEntry;
|
|
||||||
#define HAVE_TOCENTRY_TYPEDEF 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef char *(*DefnDumperPtr) (Archive *AH, const void *userArg, const TocEntry *te);
|
|
||||||
typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
|
|
||||||
|
|
||||||
typedef void (*SetupWorkerPtrType) (Archive *AH);
|
typedef void (*SetupWorkerPtrType) (Archive *AH);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -97,10 +97,7 @@
|
|||||||
#define WORKER_IGNORED_ERRORS 12
|
#define WORKER_IGNORED_ERRORS 12
|
||||||
|
|
||||||
typedef struct _archiveHandle ArchiveHandle;
|
typedef struct _archiveHandle ArchiveHandle;
|
||||||
#ifndef HAVE_TOCENTRY_TYPEDEF
|
|
||||||
typedef struct _tocEntry TocEntry;
|
typedef struct _tocEntry TocEntry;
|
||||||
#define HAVE_TOCENTRY_TYPEDEF 1
|
|
||||||
#endif
|
|
||||||
struct ParallelState;
|
struct ParallelState;
|
||||||
|
|
||||||
#define READ_ERROR_EXIT(fd) \
|
#define READ_ERROR_EXIT(fd) \
|
||||||
@ -344,6 +341,10 @@ struct _archiveHandle
|
|||||||
struct _tocEntry *lastErrorTE;
|
struct _tocEntry *lastErrorTE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef char *(*DefnDumperPtr) (Archive *AH, const void *userArg, const TocEntry *te);
|
||||||
|
typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
|
||||||
|
|
||||||
struct _tocEntry
|
struct _tocEntry
|
||||||
{
|
{
|
||||||
struct _tocEntry *prev;
|
struct _tocEntry *prev;
|
||||||
|
Reference in New Issue
Block a user