00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00080 #if !defined(__CONFIGURATOR_H__)
00081 #define __CONFIGURATOR_H__
00082
00083 #define CFG_MAX_CHILDREN 25
00084 #define CFG_MAX_VALUES 50
00085
00086 typedef enum
00087 {
00088 c_none,
00089
00090
00091 c_tsunami,
00092
00093
00094 c_ev68cb,
00095 c_serial,
00096
00097
00098 c_ali,
00099 c_ali_ide,
00100 c_ali_usb,
00101 c_s3,
00102 c_cirrus,
00103 c_radeon,
00104 c_dec21143,
00105 c_sym53c895,
00106 c_sym53c810,
00107
00108
00109 c_file,
00110 c_device,
00111 c_ramdisk,
00112
00113
00114 c_sdl,
00115 c_win32,
00116 c_x11
00117 } classid;
00118
00119 class CConfigurator
00120 {
00121 public:
00122 CConfigurator(class CConfigurator* parent, char* name, char* value,
00123 char* text, size_t textlen);
00124 ~ CConfigurator(void);
00125
00126 char* strip_string(char* c);
00127 void add_value(char* n, char* v);
00128
00129 char* get_text_value(const char* n) { return get_text_value(n, (char*) 0); };
00130 char* get_text_value(const char* n, const char* def);
00131
00132 bool get_bool_value(const char* n) { return get_bool_value(n, false); };
00133 bool get_bool_value(const char* n, bool def);
00134
00135 u64 get_num_value(const char* n, bool decimal_suffixes)
00136 {
00137 return get_num_value(n, decimal_suffixes, 0);
00138 };
00139 u64 get_num_value(const char* n, bool decimal_suffixes, u64 def);
00140
00141 classid get_class_id() { return myClassId; };
00142 void* get_device() { return myDevice; };
00143 int get_flags() { return myFlags; };
00144
00145 char* get_myName() { return myName; };
00146 char* get_myValue() { return myValue; };
00147 CConfigurator* get_myParent() { return pParent; };
00148
00149 void initialize();
00150 private:
00151 class CConfigurator* pParent;
00152 class CConfigurator* pChildren[CFG_MAX_CHILDREN];
00153 int iNumChildren;
00154 char* myName;
00155 char* myValue;
00156 void* myDevice;
00157 classid myClassId;
00158 int myFlags;
00159 int iNumValues;
00160 struct SCfg_Value
00161 {
00162 char* name;
00163 char* value;
00164 } pValues[CFG_MAX_VALUES];
00165 };
00166 #endif