33#define fprintf(file, fmt, msg) GUC_flex_fatal(msg)
static sigjmp_buf * GUC_flex_fatal_jmp
static unsigned int ConfigFileLineno
static int GUC_flex_fatal(const char *msg)
static void FreeConfigVariable(ConfigVariable *item)
static const char * GUC_flex_fatal_errmsg
62%option never-interactive
68%option prefix="GUC_yy"
77INTEGER {SIGN}?({DIGIT}+|0x{HEXDIGIT}+){UNIT_LETTER}*
79EXPONENT [Ee]{SIGN}?{DIGIT}+
80REAL {SIGN}?{DIGIT}*"."{DIGIT}*{EXPONENT}?
82LETTER [A-Za-z_\200-\377]
83LETTER_OR_DIGIT [A-Za-z_0-9\200-\377]
85ID {LETTER}{LETTER_OR_DIGIT}*
86QUALIFIED_ID {ID}"."{ID}
88UNQUOTED_STRING {LETTER}({LETTER_OR_DIGIT}|[-._:/])*
89STRING \'([^'\\\n]|\\.|\'\')*\'
146 "config file processing",
176 const char *calling_file,
int calling_lineno,
177 int depth,
int elevel,
192 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
193 errmsg(
"empty configuration file name: \"%s\"",
196 calling_file, calling_lineno,
209 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
210 errmsg(
"could not open configuration file \"%s\": maximum nesting depth exceeded",
213 calling_file, calling_lineno,
226 if (calling_file && strcmp(abs_path, calling_file) == 0)
229 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
230 errmsg(
"configuration file recursion in \"%s\"",
233 calling_file, calling_lineno,
246 errmsg(
"could not open configuration file \"%s\": %m",
250 calling_file, calling_lineno,
257 (
errmsg(
"skipping missing configuration file \"%s\"",
263 OK =
ParseConfigFp(fp, abs_path, depth, elevel, head_p, tail_p);
286 item =
palloc(
sizeof *item);
298 (*tail_p)->
next = item;
353 volatile bool OK =
true;
356 sigjmp_buf flex_fatal_jmp;
363 if (sigsetjmp(flex_fatal_jmp, 1) == 0)
372 elog(elevel,
"%s at file \"%s\" line %u",
387 if (yylex_init(&scanner) != 0)
388 elog(elevel,
"yylex_init() failed: %m");
391 lex_buffer = yy_create_buffer(fp, YY_BUF_SIZE, scanner);
392 yy_switch_to_buffer(lex_buffer, scanner);
397 char *opt_name = NULL;
398 char *opt_value = NULL;
448 yy_switch_to_buffer(lex_buffer, scanner);
463 yy_switch_to_buffer(lex_buffer, scanner);
478 yy_switch_to_buffer(lex_buffer, scanner);
485 item =
palloc(
sizeof *item);
486 item->
name = opt_name;
487 item->
value = opt_value;
497 (*tail_p)->
next = item;
517 (
errcode(ERRCODE_SYNTAX_ERROR),
518 errmsg(
"syntax error in file \"%s\" line %u, near end of line",
527 (
errcode(ERRCODE_SYNTAX_ERROR),
528 errmsg(
"syntax error in file \"%s\" line %u, near token \"%s\"",
544 if (errorcount >= 100 || elevel <=
DEBUG1)
547 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
548 errmsg(
"too many syntax errors found, abandoning file \"%s\"",
562 yy_delete_buffer(lex_buffer, scanner);
563 yylex_destroy(scanner);
582 const char *calling_file,
int calling_lineno,
583 int depth,
int elevel,
592 &num_filenames, &err_msg);
601 for (
int i = 0;
i < num_filenames;
i++)
604 calling_file, calling_lineno,
669 Assert(s != NULL && s[0] ==
'\'');
680 for (
i = 0,
j = 0;
i <
len;
i++)
715 s[
i + k] >=
'0' && s[
i + k] <=
'7' && k < 3;
717 octVal = (octVal << 3) + (s[
i + k] -
'0');
719 newStr[
j] = ((char) octVal);
727 else if (s[
i] ==
'\'' && s[
i + 1] ==
'\'')
static void cleanup(void)
#define Assert(condition)
char * AbsoluteConfigLocation(const char *location, const char *calling_file)
char ** GetConfFilesInDir(const char *includedir, const char *calling_file, int elevel, int *num_filenames, char **err_msg)
#define CONF_FILE_MAX_DEPTH
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
FILE * AllocateFile(const char *name, const char *mode)
void FreeConfigVariables(ConfigVariable *list)
int yylex(yyscan_t yyscanner)
void record_config_file_error(const char *errmsg, const char *config_file, int lineno, ConfigVariable **head_p, ConfigVariable **tail_p)
bool ParseConfigFp(FILE *fp, const char *config_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p)
char * DeescapeQuotedString(const char *s)
bool ParseConfigFile(const char *config_file, bool strict, const char *calling_file, int calling_lineno, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p)
bool ParseConfigDirectory(const char *includedir, const char *calling_file, int calling_lineno, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p)
void ProcessConfigFile(GucContext context)
ConfigVariable * ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel)
int guc_name_compare(const char *namea, const char *nameb)
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static char * config_file
char * psprintf(const char *fmt,...)
struct yy_buffer_state * YY_BUFFER_STATE
struct ConfigVariable * next