Skip to content

Sort header includes in a constent order #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions contrib/pg_tde/src/access/pg_tde_tdemap.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#include "postgres.h"
#include "access/pg_tde_tdemap.h"
#include "common/file_perm.h"
#include "storage/fd.h"
#include "utils/wait_event.h"
#include "utils/memutils.h"

#include <openssl/err.h>
#include <openssl/rand.h>
#include <unistd.h>

#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xloginsert.h"
#include "utils/builtins.h"
#include "common/file_perm.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/wait_event.h"

#include "access/pg_tde_tdemap.h"
#include "access/pg_tde_xlog.h"
Expand All @@ -18,12 +22,6 @@
#include "encryption/enc_tde.h"
#include "keyring/keyring_api.h"

#include <openssl/rand.h>
#include <openssl/err.h>
#include <unistd.h>

#include "pg_tde_defines.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
#endif
Expand Down
6 changes: 3 additions & 3 deletions contrib/pg_tde/src/access/pg_tde_xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@

#include "postgres.h"

#include "pg_tde.h"
#include "pg_tde_defines.h"
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xloginsert.h"
#include "catalog/tde_keyring.h"
#include "storage/bufmgr.h"
#include "storage/shmem.h"
#include "utils/guc.h"
#include "utils/memutils.h"

#include "access/pg_tde_xlog.h"
#include "catalog/tde_keyring.h"
#include "encryption/enc_tde.h"
#include "pg_tde.h"
#include "pg_tde_defines.h"
#include "smgr/pg_tde_smgr.h"

static void tdeheap_rmgr_redo(XLogReaderState *record);
Expand Down
6 changes: 3 additions & 3 deletions contrib/pg_tde/src/access/pg_tde_xlog_smgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

#include "postgres.h"

#include "pg_tde.h"
#include "pg_tde_defines.h"
#include "pg_tde_guc.h"
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlog_smgr.h"
Expand All @@ -28,6 +25,9 @@
#include "access/pg_tde_xlog_smgr.h"
#include "catalog/tde_global_space.h"
#include "encryption/enc_tde.h"
#include "pg_tde.h"
#include "pg_tde_defines.h"
#include "pg_tde_guc.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
Expand Down
28 changes: 16 additions & 12 deletions contrib/pg_tde/src/catalog/tde_keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@
*
*-------------------------------------------------------------------------
*/

#include "postgres.h"

#include <unistd.h>

#include "access/skey.h"
#include "access/xlog.h"
#include "access/xloginsert.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"

#include "access/pg_tde_xlog.h"
#include "catalog/tde_global_space.h"
#include "catalog/tde_keyring.h"
#include "catalog/tde_principal_key.h"
#include "access/skey.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"
#include "utils/fmgroids.h"
#include "common/pg_tde_utils.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "unistd.h"
#include "utils/builtins.h"
#include "pg_tde.h"

#ifndef FRONTEND
#include "access/heapam.h"
#include "common/pg_tde_shmem.h"
#include "funcapi.h"
#include "access/relscan.h"
#include "access/relation.h"
#include "access/relscan.h"
#include "catalog/namespace.h"
#include "executor/spi.h"
#include "funcapi.h"
#include "common/pg_tde_shmem.h"
#else
#include "fe_utils/simple_list.h"
#include "pg_tde_fe.h"
Expand Down
1 change: 1 addition & 0 deletions contrib/pg_tde/src/catalog/tde_keyring_parse_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

#include "postgres.h"

#include "common/jsonapi.h"
#include "mb/pg_wchar.h"
#include "utils/jsonfuncs.h"
Expand Down
34 changes: 18 additions & 16 deletions contrib/pg_tde/src/catalog/tde_principal_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,45 @@
*
*-------------------------------------------------------------------------
*/

#include "postgres.h"

#include <sys/mman.h>
#include <sys/time.h>

#include "access/xlog.h"
#include "access/xloginsert.h"
#include "catalog/tde_principal_key.h"
#include "storage/fd.h"
#include "utils/palloc.h"
#include "utils/memutils.h"
#include "utils/wait_event.h"
#include "utils/timestamp.h"
#include "catalog/pg_database.h"
#include "common/relpath.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/builtins.h"
#include "pg_tde.h"
#include "access/pg_tde_xlog.h"
#include <sys/mman.h>
#include <sys/time.h>
#include "utils/fmgroids.h"
#include "utils/guc.h"
#include "catalog/pg_database.h"
#include "keyring/keyring_api.h"
#include "utils/memutils.h"
#include "utils/palloc.h"
#include "utils/timestamp.h"
#include "utils/wait_event.h"

#include "access/pg_tde_tdemap.h"
#include "access/pg_tde_xlog.h"
#include "catalog/tde_global_space.h"
#include "catalog/tde_principal_key.h"
#include "keyring/keyring_api.h"
#include "pg_tde.h"
#include "pg_tde_guc.h"

#ifndef FRONTEND
#include "access/genam.h"
#include "access/table.h"
#include "common/pg_tde_shmem.h"
#include "funcapi.h"
#include "lib/dshash.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"
#include "common/pg_tde_shmem.h"
#else
#include "pg_tde_fe.h"
#endif
#include "pg_tde_guc.h"

#include <sys/time.h>

#ifndef FRONTEND

Expand Down
6 changes: 4 additions & 2 deletions contrib/pg_tde/src/common/pg_tde_shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
*/

#include "postgres.h"
#include "storage/ipc.h"
#include "common/pg_tde_shmem.h"

#include "lib/dshash.h"
#include "nodes/pg_list.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"

#include "common/pg_tde_shmem.h"

static void tde_shmem_shutdown(int code, Datum arg);

List *registeredShmemRequests = NIL;
Expand Down
4 changes: 2 additions & 2 deletions contrib/pg_tde/src/common/pg_tde_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#include "pg_tde.h"

#ifndef FRONTEND
#include "fmgr.h"
#include "smgr/pg_tde_smgr.h"
#include "access/relation.h"
#include "fmgr.h"
#include "utils/rel.h"
#include "smgr/pg_tde_smgr.h"

PG_FUNCTION_INFO_V1(pg_tde_is_encrypted);
Datum
Expand Down
23 changes: 11 additions & 12 deletions contrib/pg_tde/src/encryption/enc_aes.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#include "postgres.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
#endif

#include "encryption/enc_aes.h"

#include <errno.h>
#include <fcntl.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>

#include <openssl/ssl.h>
#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include "encryption/enc_aes.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
#endif

/* Implementation notes
* =====================
Expand Down
12 changes: 6 additions & 6 deletions contrib/pg_tde/src/encryption/enc_tde.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#include "pg_tde_defines.h"

#include "postgres.h"

#include <openssl/err.h>
#include <openssl/rand.h>

#include "storage/bufmgr.h"

#include "access/pg_tde_tdemap.h"
#include "encryption/enc_tde.h"
#include "encryption/enc_aes.h"
#include "storage/bufmgr.h"
#include "pg_tde_defines.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
#endif

#include <openssl/rand.h>
#include <openssl/err.h>

#define AES_BLOCK_SIZE 16
#define NUM_AES_BLOCKS_IN_BATCH 200
#define DATA_BYTES_PER_AES_BATCH (NUM_AES_BLOCKS_IN_BATCH * AES_BLOCK_SIZE)
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_tde/src/include/pg_tde_fe.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#ifdef FRONTEND

#include "postgres_fe.h"
#include "utils/elog.h"
#include "common/logging.h"
#include "common/file_perm.h"
#include "utils/elog.h"

#pragma GCC diagnostic ignored "-Wunused-macros"
#pragma GCC diagnostic ignored "-Wunused-value"
Expand Down
14 changes: 8 additions & 6 deletions contrib/pg_tde/src/keyring/keyring_api.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#include "keyring/keyring_api.h"

#include "postgres.h"

#include <assert.h>
#include <openssl/err.h>
#include <openssl/rand.h>

#include "nodes/pg_list.h"
#include "utils/memutils.h"

#include "keyring/keyring_api.h"

#ifdef FRONTEND
#include "fe_utils/simple_list.h"
#include "pg_tde_fe.h"
#endif

#include <assert.h>
#include <openssl/rand.h>
#include <openssl/err.h>

typedef struct RegisteredKeyProviderType
{
TDEKeyringRoutine *routine;
Expand Down
13 changes: 7 additions & 6 deletions contrib/pg_tde/src/keyring/keyring_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@

#include "postgres.h"

#include "keyring/keyring_file.h"
#include "catalog/tde_keyring.h"
#include <stdio.h>
#include <unistd.h>

#include "common/file_perm.h"
#include "keyring/keyring_api.h"
#include "storage/fd.h"
#include "utils/wait_event.h"

#include "catalog/tde_keyring.h"
#include "keyring/keyring_api.h"
#include "keyring/keyring_file.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
#endif

#include <stdio.h>
#include <unistd.h>

static KeyInfo *get_key_by_name(GenericKeyring *keyring, const char *key_name, KeyringReturnCodes *return_code);
static void set_key_by_name(GenericKeyring *keyring, KeyInfo *key);
static void validate(GenericKeyring *keyring);
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_tde/src/keyring/keyring_kmip.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <openssl/err.h>
#include <openssl/ssl.h>

#include "keyring/keyring_api.h"
#include "keyring/keyring_kmip.h"
#include "keyring/keyring_kmip_impl.h"
#include "keyring/keyring_api.h"

#ifdef FRONTEND
#include "pg_tde_fe.h"
Expand Down
1 change: 1 addition & 0 deletions contrib/pg_tde/src/keyring/keyring_kmip_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* The libkmip specific code need to be in a separate library to avoid
* collissions with PostgreSQL's header files.
*/

#include <stdio.h>
#include <string.h>
#include <kmip.h>
Expand Down
Loading