postgresql/src/bin/psql/variables.h

41 lines
1.1 KiB
C
Raw Normal View History

2000-01-19 00:30:24 +01:00
/*
* psql - the PostgreSQL interactive terminal
*
* Copyright 2000 by PostgreSQL Global Development Group
2000-01-19 00:30:24 +01:00
*
2000-02-16 14:15:26 +01:00
* $Header: /cvsroot/pgsql/src/bin/psql/variables.h,v 1.7 2000/02/16 13:15:26 momjian Exp $
2000-01-19 00:30:24 +01:00
*/
/*
* 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.
*/
#ifndef VARIABLES_H
#define VARIABLES_H
#define VALID_VARIABLE_CHARS "abcdefghijklmnopqrstuvwxyz"\
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789_"
1999-11-05 00:14:30 +01:00
struct _variable
{
char *name;
char *value;
struct _variable *next;
};
1999-11-05 00:14:30 +01:00
typedef struct _variable *VariableSpace;
VariableSpace CreateVariableSpace(void);
1999-11-05 00:14:30 +01:00
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 SetVariableBool(VariableSpace space, const char *name);
1999-11-05 00:14:30 +01:00
bool DeleteVariable(VariableSpace space, const char *name);
void DestroyVariableSpace(VariableSpace space);
1999-11-05 00:14:30 +01:00
#endif /* VARIABLES_H */