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
This commit is contained in:
John Naylor 2022-08-16 12:01:41 +07:00
parent 1b188ea792
commit 80e8450a74
4 changed files with 28 additions and 11 deletions

View File

@ -15,10 +15,10 @@
#include <unistd.h>
#include "common/file_utils.h"
#include "guc_internal.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/guc.h"
/*

View File

@ -57,6 +57,7 @@
#include "commands/variable.h"
#include "common/string.h"
#include "funcapi.h"
#include "guc_internal.h"
#include "jit/jit.h"
#include "libpq/auth.h"
#include "libpq/libpq.h"

View File

@ -0,0 +1,26 @@
/*--------------------------------------------------------------------
* guc_internals.h
*
* Declarations shared between backend/utils/misc/guc.c and
* backend/utils/misc/guc-file.l
*
* Copyright (c) 2000-2022, PostgreSQL Global Development Group
*
* src/include/utils/guc_internals.h
*--------------------------------------------------------------------
*/
#ifndef GUC_INTERNALS_H
#define GUC_INTERNALS_H
#include "utils/guc.h"
extern int guc_name_compare(const char *namea, const char *nameb);
extern ConfigVariable *ProcessConfigFileInternal(GucContext context,
bool applySettings, int elevel);
extern void record_config_file_error(const char *errmsg,
const char *config_file,
int lineno,
ConfigVariable **head_p,
ConfigVariable **tail_p);
#endif /* GUC_INTERNALS_H */

View File

@ -442,16 +442,6 @@ extern void GUC_check_errcode(int sqlerrcode);
pre_format_elog_string(errno, TEXTDOMAIN), \
GUC_check_errhint_string = format_elog_string
/* functions shared between guc.c and guc-file.l */
extern int guc_name_compare(const char *namea, const char *nameb);
extern ConfigVariable *ProcessConfigFileInternal(GucContext context,
bool applySettings, int elevel);
extern void record_config_file_error(const char *errmsg,
const char *config_file,
int lineno,
ConfigVariable **head_p,
ConfigVariable **tail_p);
/*
* The following functions are not in guc.c, but are declared here to avoid
* having to include guc.h in some widely used headers that it really doesn't