24 const unsigned char *ptr = (
const unsigned char *) name;
33 strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"
34 "_0123456789", *ptr) !=
NULL)
69 for (current = space->
next; current; current = current->
next)
71 if (strcmp(current->
name, name) == 0)
74 return current->
value;
121 psql_error(
"unrecognized value \"%s\" for \"%s\"; assuming \"%s\"\n",
149 result = strtol(val, &end, 0);
150 if (!allowtrail && *end)
178 for (ptr = space->
next; ptr; ptr = ptr->
next)
181 printf(
"%s = '%s'\n", ptr->
name, ptr->
value);
202 for (previous = space, current = space->
next;
204 previous = current, current = current->
next)
206 if (strcmp(current->
name, name) == 0)
224 previous->
next = current;
243 for (previous = space, current = space->
next;
245 previous = current, current = current->
next)
247 if (strcmp(current->
name, name) == 0)
251 (*hook) (current->
value);
262 previous->
next = current;
282 for (previous = space, current = space->
next;
284 previous = current, current = current->
next)
286 if (strcmp(current->
name, name) == 0)
void * pg_malloc(size_t size)
void(* VariableAssignHook)(const char *newval)
int GetVariableNum(VariableSpace space, const char *name, int defaultval, int faultval, bool allowtrail)
bool SetVariableBool(VariableSpace space, const char *name)
int pg_strcasecmp(const char *s1, const char *s2)
void PrintVariables(VariableSpace space)
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 SetVariableAssignHook(VariableSpace space, const char *name, VariableAssignHook hook)
bool DeleteVariable(VariableSpace space, const char *name)
VariableAssignHook assign_hook
static bool valid_variable_name(const char *name)
char * pg_strdup(const char *in)
bool ParseVariableBool(const char *value, const char *name)
const char * GetVariable(VariableSpace space, const char *name)
void psql_error(const char *fmt,...)
bool SetVariable(VariableSpace space, const char *name, const char *value)
int ParseVariableNum(const char *val, int defaultval, int faultval, bool allowtrail)