26 const unsigned char *ptr = (
const unsigned char *)
name;
35 strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"
36 "_0123456789", *ptr) != NULL)
80 for (current = space->
next; current; current = current->
next)
87 return current->
value;
141 pg_log_error(
"unrecognized value \"%s\" for \"%s\": Boolean expected",
168 numval = strtol(
value, &end, 0);
169 if (errno == 0 && *end ==
'\0' && end !=
value && numval == (
int) numval)
171 *result = (int) numval;
178 pg_log_error(
"invalid value \"%s\" for \"%s\": integer expected",
212 dblval = strtod(
value, &end);
213 if (errno == 0 && *end ==
'\0' && end !=
value)
218 pg_log_error(
"invalid value \"%s\" for \"%s\": must be greater than %.2f",
222 else if (dblval > max)
225 pg_log_error(
"invalid value \"%s\" for \"%s\": must be less than %.2f",
237 else if ((errno == ERANGE) &&
238 (dblval == 0.0 || dblval >= HUGE_VAL || dblval <= -HUGE_VAL))
263 for (ptr = space->
next; ptr; ptr = ptr->
next)
298 for (previous = space, current = space->
next;
300 previous = current, current = current->
next)
329 current->
value = new_value;
335 if (new_value == NULL &&
362 previous->
next = current;
397 for (previous = space, current = space->
next;
399 previous = current, current = current->
next)
411 (void) (*ahook) (current->
value);
421 current->
value = NULL;
425 previous->
next = current;
429 (void) (*ahook) (current->
value);
444 for (current = space->
next; current; current = current->
next)
489 "Available values are: %s.",
#define IS_HIGHBIT_SET(ch)
void * pg_malloc(size_t size)
char * pg_strdup(const char *in)
volatile sig_atomic_t cancel_pressed
Assert(PointerIsAligned(start, uint64))
#define pg_log_error(...)
int pg_strcasecmp(const char *s1, const char *s2)
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
static int cmp(const chr *x, const chr *y, size_t len)
VariableSubstituteHook substitute_hook
VariableAssignHook assign_hook
void PrintVariables(VariableSpace space)
bool DeleteVariable(VariableSpace space, const char *name)
void SetVariableHooks(VariableSpace space, const char *name, VariableSubstituteHook shook, VariableAssignHook ahook)
void PsqlVarEnumError(const char *name, const char *value, const char *suggestions)
bool ParseVariableBool(const char *value, const char *name, bool *result)
bool ParseVariableDouble(const char *value, const char *name, double *result, double min, double max)
bool SetVariableBool(VariableSpace space, const char *name)
bool ParseVariableNum(const char *value, const char *name, int *result)
bool VariableHasHook(VariableSpace space, const char *name)
bool SetVariable(VariableSpace space, const char *name, const char *value)
static bool valid_variable_name(const char *name)
const char * GetVariable(VariableSpace space, const char *name)
VariableSpace CreateVariableSpace(void)
char *(* VariableSubstituteHook)(char *newval)
bool(* VariableAssignHook)(const char *newval)