Browse code

cfg.h - config framework - doxygenify documentation

Olle E. Johansson authored on 30/03/2013 18:01:52
Showing 1 changed files
... ...
@@ -36,10 +36,10 @@
36 36
 #define CFG_VAR_STR		3U
37 37
 #define CFG_VAR_POINTER		4U
38 38
 
39
-/* number of bits required for the variable type */
39
+/*! \brief number of bits required for the variable type */
40 40
 #define CFG_INPUT_SHIFT		3
41 41
 
42
-/* input type */
42
+/*! \brief input types */
43 43
 #define CFG_INPUT_INT		(CFG_VAR_INT << CFG_INPUT_SHIFT)
44 44
 #define CFG_INPUT_STRING	(CFG_VAR_STRING << CFG_INPUT_SHIFT)
45 45
 #define CFG_INPUT_STR		(CFG_VAR_STR << CFG_INPUT_SHIFT)
... ...
@@ -47,28 +47,25 @@
47 47
 #define CFG_VAR_MASK(x)		((x)&((1U<<CFG_INPUT_SHIFT)-1))
48 48
 #define CFG_INPUT_MASK(x)	((x)&((1U<<(2*CFG_INPUT_SHIFT))-(1U<<CFG_INPUT_SHIFT)))
49 49
 
50
-/* atomic change is allowed */
51
-#define CFG_ATOMIC		(1U<<(2*CFG_INPUT_SHIFT))
52
-/* variable is read-only */
53
-#define CFG_READONLY		(1U<<(2*CFG_INPUT_SHIFT+1))
54
-/* per-child process callback needs to be called only once */
55
-#define CFG_CB_ONLY_ONCE	(1U<<(2*CFG_INPUT_SHIFT+2))
50
+#define CFG_ATOMIC		(1U<<(2*CFG_INPUT_SHIFT))	/*!< atomic change is allowed */
51
+#define CFG_READONLY		(1U<<(2*CFG_INPUT_SHIFT+1))	/*!< variable is read-only */
52
+#define CFG_CB_ONLY_ONCE	(1U<<(2*CFG_INPUT_SHIFT+2))	/*!< per-child process callback needs to be called only once */
56 53
 
57 54
 typedef int (*cfg_on_change)(void *, str *, str *, void **);
58 55
 typedef void (*cfg_on_set_child)(str *, str *);
59 56
 
60
-/* strutrure to be used by the module interface */
57
+/*! \brief structrure to be used by the module interface */
61 58
 typedef struct _cfg_def {
62 59
 	char	*name;
63 60
 	unsigned int	type;
64 61
 	int	min;
65 62
 	int	max;
66
-	cfg_on_change	on_change_cb;
63
+	cfg_on_change		on_change_cb;
67 64
 	cfg_on_set_child	on_set_child_cb;
68 65
 	char	*descr;
69 66
 } cfg_def_t;
70 67
 
71
-/* declares a new cfg group
68
+/*! \brief declares a new cfg group
72 69
  * handler is set to the memory area where the variables are stored
73 70
  * return value is -1 on error
74 71
  */
... ...
@@ -81,33 +78,33 @@ int cfg_declare(char *group_name, cfg_def_t *def, void *values, int def_size,
81 81
 #define cfg_get(gname, handle, var) \
82 82
 	((struct cfg_group_##gname *)handle)->var
83 83
 
84
-/* declares a single variable with integer type */
84
+/*! \brief declares a single variable with integer type */
85 85
 int cfg_declare_int(char *group_name, char *var_name,
86 86
 		int val, int min, int max, char *descr);
87 87
 
88
-/* declares a single variable with str type */
88
+/*! \brief declares a single variable with str type */
89 89
 int cfg_declare_str(char *group_name, char *var_name, char *val, char *descr);
90 90
 
91
-/* Add a varibale to a group instance with integer type.
91
+/*! \brief Add a variable to a group instance with integer type.
92 92
  * The group instance is created if it does not exist.
93 93
  * wrapper function for new_add_var()
94 94
  */
95 95
 int cfg_ginst_var_int(char *group_name, unsigned int group_id, char *var_name,
96 96
 			int val);
97 97
 
98
-/* Add a varibale to a group instance with string type.
98
+/*! \brief Add a variable to a group instance with string type.
99 99
  * The group instance is created if it does not exist.
100 100
  * wrapper function for new_add_var()
101 101
  */
102 102
 int cfg_ginst_var_string(char *group_name, unsigned int group_id, char *var_name,
103 103
 			char *val);
104 104
 
105
-/* Create a new group instance.
105
+/*! \brief Create a new group instance.
106 106
  * wrapper function for new_add_var()
107 107
  */
108 108
 int cfg_new_ginst(char *group_name, unsigned int group_id);
109 109
 
110
-/* returns the handle of a cfg group */
110
+/*! \brief returns the handle of a cfg group */
111 111
 void **cfg_get_handle(char *gname);
112 112
 
113 113
 #endif /* _CFG_H */