diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-11-04 21:56:02 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-11-04 21:56:02 +0000 |
commit | a45195a191eec367a4f305bb71ab541d17a3b9f9 (patch) | |
tree | 99b815a93f6175b0db76c2da0da39e95a0ee6b8d /src/bin/psql/variables.h | |
parent | 2ea3b6d63addeaf07267e2390597645cbf013c36 (diff) | |
download | postgresql-a45195a191eec367a4f305bb71ab541d17a3b9f9.tar.gz postgresql-a45195a191eec367a4f305bb71ab541d17a3b9f9.zip |
Major psql overhaul by Peter Eisentraut.
Diffstat (limited to 'src/bin/psql/variables.h')
-rw-r--r-- | src/bin/psql/variables.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bin/psql/variables.h b/src/bin/psql/variables.h new file mode 100644 index 00000000000..9e2dd2e3a7b --- /dev/null +++ b/src/bin/psql/variables.h @@ -0,0 +1,33 @@ +/* This implements a sort of variable repository. One could also think of it + * as cheap version of an associative array. In each one of these + * datastructures you can store name/value pairs. + * + * All functions (should) follow the Shit-In-Shit-Out (SISO) principle, i.e., + * you can pass them NULL pointers and the like and they will return something + * appropriate. + */ + +#ifndef VARIABLES_H +#define VARIABLES_H +#include <c.h> + +#define VALID_VARIABLE_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_" + +struct _variable { + char * name; + char * value; + struct _variable * next; +}; + +typedef struct _variable * VariableSpace; + + +VariableSpace CreateVariableSpace(void); +const char * GetVariable(VariableSpace space, const char * name); +bool GetVariableBool(VariableSpace space, const char * name); +bool SetVariable(VariableSpace space, const char * name, const char * value); +bool DeleteVariable(VariableSpace space, const char * name); +void DestroyVariableSpace(VariableSpace space); + + +#endif /* VARIABLES_H */ |