Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef VARIABLES_H
00009 #define VARIABLES_H
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 typedef void (*VariableAssignHook) (const char *newval);
00024
00025 struct _variable
00026 {
00027 char *name;
00028 char *value;
00029 VariableAssignHook assign_hook;
00030 struct _variable *next;
00031 };
00032
00033 typedef struct _variable *VariableSpace;
00034
00035 VariableSpace CreateVariableSpace(void);
00036 const char *GetVariable(VariableSpace space, const char *name);
00037
00038 bool ParseVariableBool(const char *val);
00039 int ParseVariableNum(const char *val,
00040 int defaultval,
00041 int faultval,
00042 bool allowtrail);
00043 int GetVariableNum(VariableSpace space,
00044 const char *name,
00045 int defaultval,
00046 int faultval,
00047 bool allowtrail);
00048
00049 void PrintVariables(VariableSpace space);
00050
00051 bool SetVariable(VariableSpace space, const char *name, const char *value);
00052 bool SetVariableAssignHook(VariableSpace space, const char *name, VariableAssignHook hook);
00053 bool SetVariableBool(VariableSpace space, const char *name);
00054 bool DeleteVariable(VariableSpace space, const char *name);
00055
00056 #endif