Skip to content

Commit 80e8450

Browse files
committed
Move private declarations shared between guc.c and guc-file.l to new header
Further preparatory refactoring for compiling guc-file.c standalone. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com
1 parent 1b188ea commit 80e8450

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

src/backend/utils/misc/guc-file.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#include <unistd.h>
1616

1717
#include "common/file_utils.h"
18+
#include "guc_internal.h"
1819
#include "mb/pg_wchar.h"
1920
#include "miscadmin.h"
2021
#include "storage/fd.h"
21-
#include "utils/guc.h"
2222

2323

2424
/*

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "commands/variable.h"
5858
#include "common/string.h"
5959
#include "funcapi.h"
60+
#include "guc_internal.h"
6061
#include "jit/jit.h"
6162
#include "libpq/auth.h"
6263
#include "libpq/libpq.h"

src/backend/utils/misc/guc_internal.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*--------------------------------------------------------------------
2+
* guc_internals.h
3+
*
4+
* Declarations shared between backend/utils/misc/guc.c and
5+
* backend/utils/misc/guc-file.l
6+
*
7+
* Copyright (c) 2000-2022, PostgreSQL Global Development Group
8+
*
9+
* src/include/utils/guc_internals.h
10+
*--------------------------------------------------------------------
11+
*/
12+
#ifndef GUC_INTERNALS_H
13+
#define GUC_INTERNALS_H
14+
15+
#include "utils/guc.h"
16+
17+
extern int guc_name_compare(const char *namea, const char *nameb);
18+
extern ConfigVariable *ProcessConfigFileInternal(GucContext context,
19+
bool applySettings, int elevel);
20+
extern void record_config_file_error(const char *errmsg,
21+
const char *config_file,
22+
int lineno,
23+
ConfigVariable **head_p,
24+
ConfigVariable **tail_p);
25+
26+
#endif /* GUC_INTERNALS_H */

src/include/utils/guc.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,6 @@ extern void GUC_check_errcode(int sqlerrcode);
442442
pre_format_elog_string(errno, TEXTDOMAIN), \
443443
GUC_check_errhint_string = format_elog_string
444444

445-
/* functions shared between guc.c and guc-file.l */
446-
extern int guc_name_compare(const char *namea, const char *nameb);
447-
extern ConfigVariable *ProcessConfigFileInternal(GucContext context,
448-
bool applySettings, int elevel);
449-
extern void record_config_file_error(const char *errmsg,
450-
const char *config_file,
451-
int lineno,
452-
ConfigVariable **head_p,
453-
ConfigVariable **tail_p);
454-
455445
/*
456446
* The following functions are not in guc.c, but are declared here to avoid
457447
* having to include guc.h in some widely used headers that it really doesn't

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy