24 const unsigned char *ptr = (
const unsigned char *) name;
33 strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" 34 "_0123456789", *ptr) != NULL)
78 for (current = space->
next; current; current = current->
next)
80 int cmp = strcmp(current->
name, name);
85 return current->
value;
139 pg_log_error(
"unrecognized value \"%s\" for \"%s\": Boolean expected",
166 numval = strtol(value, &end, 0);
167 if (errno == 0 && *end ==
'\0' && end != value && numval == (
int) numval)
169 *result = (int) numval;
176 pg_log_error(
"invalid value \"%s\" for \"%s\": integer expected",
193 for (ptr = space->
next; ptr; ptr = ptr->
next)
228 for (previous = space, current = space->
next;
230 previous = current, current = current->
next)
232 int cmp = strcmp(current->
name, name);
245 char *new_value = value ?
pg_strdup(value) : NULL;
260 current->
value = new_value;
266 if (new_value == NULL &&
293 previous->
next = current;
328 for (previous = space, current = space->
next;
330 previous = current, current = current->
next)
332 int cmp = strcmp(current->
name, name);
342 (void) (*ahook) (current->
value);
352 current->
value = NULL;
356 previous->
next = current;
360 (void) (*ahook) (current->
value);
394 "Available values are: %s.",
395 value, name, suggestions);
bool ParseVariableNum(const char *value, const char *name, int *result)
void * pg_malloc(size_t size)
#define pg_log_error(...)
char *(* VariableSubstituteHook)(char *newval)
void PsqlVarEnumError(const char *name, const char *value, const char *suggestions)
bool SetVariableBool(VariableSpace space, const char *name)
int pg_strcasecmp(const char *s1, const char *s2)
void PrintVariables(VariableSpace space)
bool(* VariableAssignHook)(const char *newval)
volatile bool cancel_pressed
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
VariableSpace CreateVariableSpace(void)
#define IS_HIGHBIT_SET(ch)
bool DeleteVariable(VariableSpace space, const char *name)
VariableAssignHook assign_hook
static bool valid_variable_name(const char *name)
char * pg_strdup(const char *in)
const char * GetVariable(VariableSpace space, const char *name)
void SetVariableHooks(VariableSpace space, const char *name, VariableSubstituteHook shook, VariableAssignHook ahook)
bool SetVariable(VariableSpace space, const char *name, const char *value)
VariableSubstituteHook substitute_hook
bool ParseVariableBool(const char *value, const char *name, bool *result)
static int cmp(const chr *x, const chr *y, size_t len)