10 #include "uniconfroot.h"
11 #include "wvstringtable.h"
14 #define WvConf WvConfEmu
15 #define WvConfigSection WvConfigSectionEmu
16 #define WvConfigSectionList WvConfigSectionListEmu
17 #define WvConfigEntry WvConfigEntryEmu
18 #define WvConfigEntryList WvConfigEntryListEmu
25 class WvAuthDaemonSvc;
37 name(_name), value(_value)
49 WvConfigEntryEmuDict entries;
55 uniconf(_uniconf), entries(42), values(*_values), name(_name)
58 const char *get(WvStringParm entry,
const char *def_val = NULL);
59 void set(WvStringParm entry, WvStringParm value);
60 void quick_set(WvStringParm entry, WvStringParm value);
83 sect(_sect), iter(_sect.uniconf), link(NULL,
false), entry(NULL)
98 typedef wv::function<void(
void*, WvStringParm, WvStringParm, WvStringParm, WvStringParm)> WvConfCallback;
106 WvConfCallback callback;
111 CallbackInfo(WvConfCallback _callback,
void* _userdata,
112 WvStringParm _section, WvStringParm _key,
114 callback(_callback), userdata(_userdata), section(_section),
115 key(_key), cookie(_cookie)
119 WvConfigSectionEmuDict sections;
132 bool isclean()
const;
134 void load_file(WvStringParm filename);
135 void save(WvStringParm filename,
int _create_mode = 0666);
141 void add_callback(WvConfCallback callback,
void *userdata,
142 WvStringParm section, WvStringParm key,
void *cookie);
143 void del_callback(WvStringParm section, WvStringParm key,
void *cookie);
145 void add_setbool(
bool *b, WvStringParm _section, WvStringParm _key);
146 void del_setbool(
bool *b, WvStringParm _section, WvStringParm _key);
151 void add_addname(
WvStringList *list, WvStringParm sect, WvStringParm ent);
152 void del_addname(
WvStringList *list, WvStringParm sect, WvStringParm ent);
155 int getint(WvStringParm section, WvStringParm entry,
int def_val);
156 const char *get(WvStringParm section, WvStringParm entry,
157 const char *def_val = NULL);
158 int fuzzy_getint(
WvStringList §, WvStringParm entry,
160 const char *fuzzy_get(
WvStringList §, WvStringParm entry,
161 const char *def_val = NULL);
163 void setraw(
WvString wvconfstr,
const char *&value,
int &parse_error);
164 void setint(WvStringParm section, WvStringParm entry,
int value);
165 void set(WvStringParm section, WvStringParm entry,
168 void maybesetint(WvStringParm section, WvStringParm entry,
170 void maybeset(WvStringParm section, WvStringParm entry,
173 void delete_section(WvStringParm section);
176 WvString get_passwd(WvStringParm sect, WvStringParm user);
177 WvString get_passwd(WvStringParm user)
178 {
return get_passwd(
"Users", user); }
187 bool check_passwd(WvStringParm sect, WvStringParm user,
189 bool check_passwd(WvStringParm user, WvStringParm passwd,
WvStream *s)
191 return check_passwd(
"Users", user, passwd, s);
195 bool user_exists(WvStringParm sect, WvStringParm user);
196 bool user_exists(WvStringParm user)
198 return user_exists(
"Users", user);
202 void set_passwd(WvStringParm sect, WvStringParm user, WvStringParm passwd);
203 void set_passwd(WvStringParm user, WvStringParm passwd)
204 { set_passwd(
"Users", user, passwd); }
205 WvString set_passwd2(WvStringParm passwd);
208 void convert_to_old_pw();
210 static int check_for_bool_string(
const char *s);
225 WvAuthDaemon *wvauthd;
227 friend class WvAuthDaemonSvc;
238 conf(_conf), iter(conf.uniconf), link(NULL,
false)
246 #endif // __WVCONFEMU_H