Commit 64990081 authored by Peter Eisentraut's avatar Peter Eisentraut

pg_dump: Add const decorations

Add const decorations to the *info arguments of the dump* functions,
to clarify that they don't modify that argument.  Many other nearby
functions modify their arguments, so this can help clarify these
different APIs a bit.

Discussion: https://www.postgresql.org/message-id/flat/012d3030-9a2c-99a1-ed2d-988978b5632f%40enterprisedb.com
parent 4ad56110
...@@ -248,7 +248,7 @@ typedef int DumpId; ...@@ -248,7 +248,7 @@ typedef int DumpId;
* Function pointer prototypes for assorted callback methods. * Function pointer prototypes for assorted callback methods.
*/ */
typedef int (*DataDumperPtr) (Archive *AH, void *userArg); typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
typedef void (*SetupWorkerPtrType) (Archive *AH); typedef void (*SetupWorkerPtrType) (Archive *AH);
......
...@@ -382,7 +382,7 @@ struct _tocEntry ...@@ -382,7 +382,7 @@ struct _tocEntry
int nDeps; /* number of dependencies */ int nDeps; /* number of dependencies */
DataDumperPtr dataDumper; /* Routine to dump data for object */ DataDumperPtr dataDumper; /* Routine to dump data for object */
void *dataDumperArg; /* Arg for above routine */ const void *dataDumperArg; /* Arg for above routine */
void *formatData; /* TOC Entry data specific to file format */ void *formatData; /* TOC Entry data specific to file format */
/* working state while dumping/restoring */ /* working state while dumping/restoring */
...@@ -421,7 +421,7 @@ typedef struct _archiveOpts ...@@ -421,7 +421,7 @@ typedef struct _archiveOpts
const DumpId *deps; const DumpId *deps;
int nDeps; int nDeps;
DataDumperPtr dumpFn; DataDumperPtr dumpFn;
void *dumpArg; const void *dumpArg;
} ArchiveOpts; } ArchiveOpts;
#define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__} #define ARCHIVE_OPTS(...) &(ArchiveOpts){__VA_ARGS__}
/* Called to add a TOC entry */ /* Called to add a TOC entry */
......
This diff is collapsed.
...@@ -712,7 +712,7 @@ extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs); ...@@ -712,7 +712,7 @@ extern ProcLangInfo *getProcLangs(Archive *fout, int *numProcLangs);
extern CastInfo *getCasts(Archive *fout, int *numCasts); extern CastInfo *getCasts(Archive *fout, int *numCasts);
extern TransformInfo *getTransforms(Archive *fout, int *numTransforms); extern TransformInfo *getTransforms(Archive *fout, int *numTransforms);
extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables); extern void getTableAttrs(Archive *fout, TableInfo *tbinfo, int numTables);
extern bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno); extern bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno);
extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers); extern TSParserInfo *getTSParsers(Archive *fout, int *numTSParsers);
extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts); extern TSDictInfo *getTSDictionaries(Archive *fout, int *numTSDicts);
extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates); extern TSTemplateInfo *getTSTemplates(Archive *fout, int *numTSTemplates);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment