Browse code

cfg_get_handle() is introduced, the function can be used to get the handle of a module config group. Modules can read each other's configuration if neccessary this way.

Miklos Tirpak authored on 20/02/2008 12:37:42
Showing 2 changed files
... ...
@@ -200,3 +200,14 @@ int cfg_declare_str(char *group_name, char *var_name, char *val, char *descr)
200 200
 
201 201
 	return 0;
202 202
 }
203
+
204
+/* returns the handle of a cfg group */
205
+void **cfg_get_handle(char *gname)
206
+{
207
+	cfg_group_t	*group;
208
+
209
+	group = cfg_lookup_group(gname, strlen(gname));
210
+	if (!group || group->dynamic) return NULL;
211
+
212
+	return group->handle;
213
+}
... ...
@@ -82,4 +82,7 @@ int cfg_declare_int(char *group_name, char *var_name,
82 82
 /* declares a single variable with str type */
83 83
 int cfg_declare_str(char *group_name, char *var_name, char *val, char *descr);
84 84
 
85
+/* returns the handle of a cfg group */
86
+void **cfg_get_handle(char *gname);
87
+
85 88
 #endif /* _CFG_H */