summaryrefslogtreecommitdiff
path: root/src/include/common
diff options
context:
space:
mode:
authorMichael Paquier2022-04-12 04:38:54 +0000
committerMichael Paquier2022-04-12 04:38:54 +0000
commita4b57543acfb52cc7c7e031501002563f536b929 (patch)
treea24d3a2c95880f547500a8bcdbe94d718d005eca /src/include/common
parentbd037dc928dd126e5623117b2fe7633ec3fa7c40 (diff)
Rename backup_compression.{c,h} to compression.{c,h}
Compression option handling (level, algorithm or even workers) can be used across several parts of the system and not only base backups. Structures, objects and routines are renamed in consequence, to remove the concept of base backups from this part of the code making this change straight-forward. pg_receivewal, that has gained support for LZ4 since babbbb5, will make use of this infrastructure for its set of compression options, bringing more consistency with pg_basebackup. This cleanup needs to be done before releasing a beta of 15. pg_dump is a potential future target, as well, and adding more compression options to it may happen in 16~. Author: Michael Paquier Reviewed-by: Robert Haas, Georgios Kokolatos Discussion: https://postgr.es/m/YlPQGNAAa04raObK@paquier.xyz
Diffstat (limited to 'src/include/common')
-rw-r--r--src/include/common/backup_compression.h46
-rw-r--r--src/include/common/compression.h46
2 files changed, 46 insertions, 46 deletions
diff --git a/src/include/common/backup_compression.h b/src/include/common/backup_compression.h
deleted file mode 100644
index 6a0ecaa99c9..00000000000
--- a/src/include/common/backup_compression.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * backup_compression.h
- *
- * Shared definitions for backup compression methods and specifications.
- *
- * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
- *
- * IDENTIFICATION
- * src/common/backup_compression.h
- *-------------------------------------------------------------------------
- */
-
-#ifndef BACKUP_COMPRESSION_H
-#define BACKUP_COMPRESSION_H
-
-typedef enum bc_algorithm
-{
- BACKUP_COMPRESSION_NONE,
- BACKUP_COMPRESSION_GZIP,
- BACKUP_COMPRESSION_LZ4,
- BACKUP_COMPRESSION_ZSTD
-} bc_algorithm;
-
-#define BACKUP_COMPRESSION_OPTION_LEVEL (1 << 0)
-#define BACKUP_COMPRESSION_OPTION_WORKERS (1 << 1)
-
-typedef struct bc_specification
-{
- bc_algorithm algorithm;
- unsigned options; /* OR of BACKUP_COMPRESSION_OPTION constants */
- int level;
- int workers;
- char *parse_error; /* NULL if parsing was OK, else message */
-} bc_specification;
-
-extern bool parse_bc_algorithm(char *name, bc_algorithm *algorithm);
-extern const char *get_bc_algorithm_name(bc_algorithm algorithm);
-
-extern void parse_bc_specification(bc_algorithm algorithm,
- char *specification,
- bc_specification *result);
-
-extern char *validate_bc_specification(bc_specification *);
-
-#endif
diff --git a/src/include/common/compression.h b/src/include/common/compression.h
new file mode 100644
index 00000000000..7aa4240a277
--- /dev/null
+++ b/src/include/common/compression.h
@@ -0,0 +1,46 @@
+/*-------------------------------------------------------------------------
+ *
+ * compression.h
+ *
+ * Shared definitions for compression methods and specifications.
+ *
+ * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * src/common/compression.h
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PG_COMPRESSION_H
+#define PG_COMPRESSION_H
+
+typedef enum pg_compress_algorithm
+{
+ PG_COMPRESSION_NONE,
+ PG_COMPRESSION_GZIP,
+ PG_COMPRESSION_LZ4,
+ PG_COMPRESSION_ZSTD
+} pg_compress_algorithm;
+
+#define PG_COMPRESSION_OPTION_LEVEL (1 << 0)
+#define PG_COMPRESSION_OPTION_WORKERS (1 << 1)
+
+typedef struct pg_compress_specification
+{
+ pg_compress_algorithm algorithm;
+ unsigned options; /* OR of PG_COMPRESSION_OPTION constants */
+ int level;
+ int workers;
+ char *parse_error; /* NULL if parsing was OK, else message */
+} pg_compress_specification;
+
+extern bool parse_compress_algorithm(char *name, pg_compress_algorithm *algorithm);
+extern const char *get_compress_algorithm_name(pg_compress_algorithm algorithm);
+
+extern void parse_compress_specification(pg_compress_algorithm algorithm,
+ char *specification,
+ pg_compress_specification *result);
+
+extern char *validate_compress_specification(pg_compress_specification *);
+
+#endif