diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/include/eina_module.h | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/libraries/eina/src/include/eina_module.h b/libraries/eina/src/include/eina_module.h index 58e38f9..178fa9a 100644 --- a/libraries/eina/src/include/eina_module.h +++ b/libraries/eina/src/include/eina_module.h | |||
@@ -67,6 +67,10 @@ | |||
67 | */ | 67 | */ |
68 | typedef struct _Eina_Module Eina_Module; | 68 | typedef struct _Eina_Module Eina_Module; |
69 | 69 | ||
70 | /** | ||
71 | * @typedef Eina_Module_Cb | ||
72 | * Dynamic module loader callback. | ||
73 | */ | ||
70 | typedef Eina_Bool (*Eina_Module_Cb)(Eina_Module *m, void *data); | 74 | typedef Eina_Bool (*Eina_Module_Cb)(Eina_Module *m, void *data); |
71 | 75 | ||
72 | /** | 76 | /** |
@@ -135,21 +139,21 @@ EAPI Eina_Module * | |||
135 | /** | 139 | /** |
136 | * @brief Delete a module. | 140 | * @brief Delete a module. |
137 | * | 141 | * |
138 | * @param m The module to delete. | 142 | * @param module The module to delete. |
139 | * @return EINA_TRUE on success, EINA_FALSE otherwise. | 143 | * @return EINA_TRUE on success, EINA_FALSE otherwise. |
140 | * | 144 | * |
141 | * This function calls eina_module_unload() if @p m has been previously | 145 | * This function calls eina_module_unload() if @p module has been previously |
142 | * loaded and frees the allocated memory. On success this function | 146 | * loaded and frees the allocated memory. On success this function |
143 | * returns EINA_TRUE and EINA_FALSE otherwise. If @p m is @c NULL, the | 147 | * returns EINA_TRUE and EINA_FALSE otherwise. If @p module is @c NULL, the |
144 | * function returns immediately. | 148 | * function returns immediately. |
145 | */ | 149 | */ |
146 | EAPI Eina_Bool | 150 | EAPI Eina_Bool |
147 | eina_module_free(Eina_Module *m) EINA_ARG_NONNULL(1); | 151 | eina_module_free(Eina_Module *module) EINA_ARG_NONNULL(1); |
148 | 152 | ||
149 | /** | 153 | /** |
150 | * @brief Load a module. | 154 | * @brief Load a module. |
151 | * | 155 | * |
152 | * @param m The module to load. | 156 | * @param module The module to load. |
153 | * @return EINA_TRUE on success, EINA_FALSE otherwise. | 157 | * @return EINA_TRUE on success, EINA_FALSE otherwise. |
154 | * | 158 | * |
155 | * This function load the shared file object passed in | 159 | * This function load the shared file object passed in |
@@ -160,7 +164,7 @@ EAPI Eina_Bool | |||
160 | * module can not be initialized, the error | 164 | * module can not be initialized, the error |
161 | * #EINA_ERROR_MODULE_INIT_FAILED is set and #EINA_FALSE is | 165 | * #EINA_ERROR_MODULE_INIT_FAILED is set and #EINA_FALSE is |
162 | * returned. If the module has already been loaded, it's refeence | 166 | * returned. If the module has already been loaded, it's refeence |
163 | * counter is increased by one and #EINA_TRUE is returned. If @p m is | 167 | * counter is increased by one and #EINA_TRUE is returned. If @p module is |
164 | * @c NULL, the function returns immediately #EINA_FALSE. | 168 | * @c NULL, the function returns immediately #EINA_FALSE. |
165 | * | 169 | * |
166 | * When the symbols of the shared file objetcts are not needed | 170 | * When the symbols of the shared file objetcts are not needed |
@@ -172,29 +176,29 @@ EAPI Eina_Bool | |||
172 | /** | 176 | /** |
173 | * @brief Unload a module. | 177 | * @brief Unload a module. |
174 | * | 178 | * |
175 | * @param m The module to load. | 179 | * @param module The module to load. |
176 | * @return EINA_TRUE on success, EINA_FALSE otherwise. | 180 | * @return EINA_TRUE on success, EINA_FALSE otherwise. |
177 | * | 181 | * |
178 | * This function unload the module @p m that has been previously | 182 | * This function unload the module @p module that has been previously |
179 | * loaded by eina_module_load(). If the reference counter of @p m is | 183 | * loaded by eina_module_load(). If the reference counter of @p module is |
180 | * strictly greater than @c 1, #EINA_FALSE is returned. Otherwise, the | 184 | * strictly greater than @c 1, #EINA_FALSE is returned. Otherwise, the |
181 | * shared object file is closed and if it is a internal Eina module, it | 185 | * shared object file is closed and if it is a internal Eina module, it |
182 | * is shutted down just before. In that case, #EINA_TRUE is | 186 | * is shutted down just before. In that case, #EINA_TRUE is |
183 | * returned. In all case, the reference counter is decreased. If @p m | 187 | * returned. In all case, the reference counter is decreased. If @p module |
184 | * is @c NULL, the function returns immediately #EINA_FALSE. | 188 | * is @c NULL, the function returns immediately #EINA_FALSE. |
185 | */ | 189 | */ |
186 | EAPI Eina_Bool | 190 | EAPI Eina_Bool |
187 | eina_module_unload(Eina_Module *m) EINA_ARG_NONNULL(1); | 191 | eina_module_unload(Eina_Module *module) EINA_ARG_NONNULL(1); |
188 | 192 | ||
189 | /** | 193 | /** |
190 | * @brief Retrive the data associated to a symbol. | 194 | * @brief Retrive the data associated to a symbol. |
191 | * | 195 | * |
192 | * @param m The module. | 196 | * @param module The module. |
193 | * @param symbol The symbol. | 197 | * @param symbol The symbol. |
194 | * @return The data associated to the symbol, or @c NULL on failure. | 198 | * @return The data associated to the symbol, or @c NULL on failure. |
195 | * | 199 | * |
196 | * This function returns the data associated to @p symbol of @p m. @p | 200 | * This function returns the data associated to @p symbol of @p module. @p |
197 | * m must have been loaded before with eina_module_load(). If @p m | 201 | * module must have been loaded before with eina_module_load(). If @p module |
198 | * is @c NULL, or if it has not been correctly loaded before, the | 202 | * is @c NULL, or if it has not been correctly loaded before, the |
199 | * function returns immediately @c NULL. | 203 | * function returns immediately @c NULL. |
200 | */ | 204 | */ |
@@ -204,15 +208,15 @@ EAPI void * | |||
204 | /** | 208 | /** |
205 | * @brief Return the file name associated to the module. | 209 | * @brief Return the file name associated to the module. |
206 | * | 210 | * |
207 | * @param m The module. | 211 | * @param module The module. |
208 | * @return The file name. | 212 | * @return The file name. |
209 | * | 213 | * |
210 | * This function returns the file name passed in eina_module_new(). If | 214 | * This function returns the file name passed in eina_module_new(). If |
211 | * @p m is @c NULL, the function returns immediately @c NULL. The | 215 | * @p module is @c NULL, the function returns immediately @c NULL. The |
212 | * returned value must no be freed. | 216 | * returned value must no be freed. |
213 | */ | 217 | */ |
214 | EAPI const char * | 218 | EAPI const char * |
215 | eina_module_file_get(const Eina_Module *m) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); | 219 | eina_module_file_get(const Eina_Module *module) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); |
216 | 220 | ||
217 | 221 | ||
218 | /** | 222 | /** |
@@ -256,6 +260,7 @@ EAPI char * | |||
256 | * @param array The array that stores the list of the modules. | 260 | * @param array The array that stores the list of the modules. |
257 | * @param path The directory's path to search for modules. | 261 | * @param path The directory's path to search for modules. |
258 | * @param arch The architecture string. | 262 | * @param arch The architecture string. |
263 | * @return The array of modules found in @p path matching @p arch. | ||
259 | * | 264 | * |
260 | * This function adds to @p array the module names found in @p path | 265 | * This function adds to @p array the module names found in @p path |
261 | * which match the cpu architecture @p arch. If @p path or @p arch is | 266 | * which match the cpu architecture @p arch. If @p path or @p arch is |
@@ -273,6 +278,7 @@ EAPI Eina_Array * | |||
273 | * @param recursive Iterate recursively on the path. | 278 | * @param recursive Iterate recursively on the path. |
274 | * @param cb Callback function to call on each module. | 279 | * @param cb Callback function to call on each module. |
275 | * @param data Data passed to the callback function. | 280 | * @param data Data passed to the callback function. |
281 | * @return The array of modules found in @p path. | ||
276 | * | 282 | * |
277 | * This function adds to @p array the list of modules found in | 283 | * This function adds to @p array the list of modules found in |
278 | * @p path. If @p recursive is #EINA_TRUE, then recursive search is | 284 | * @p path. If @p recursive is #EINA_TRUE, then recursive search is |
@@ -295,7 +301,7 @@ EAPI Eina_Array * | |||
295 | * @p array. If @p array is @c NULL, this function does nothing. | 301 | * @p array. If @p array is @c NULL, this function does nothing. |
296 | */ | 302 | */ |
297 | EAPI void | 303 | EAPI void |
298 | eina_module_list_load(Eina_Array *list) EINA_ARG_NONNULL(1); | 304 | eina_module_list_load(Eina_Array *array) EINA_ARG_NONNULL(1); |
299 | 305 | ||
300 | /** | 306 | /** |
301 | * @brief Unload every module on the list of modules. | 307 | * @brief Unload every module on the list of modules. |
@@ -306,7 +312,7 @@ EAPI void | |||
306 | * @p array. If @p array is @c NULL, this function does nothing. | 312 | * @p array. If @p array is @c NULL, this function does nothing. |
307 | */ | 313 | */ |
308 | EAPI void | 314 | EAPI void |
309 | eina_module_list_unload(Eina_Array *list) EINA_ARG_NONNULL(1); | 315 | eina_module_list_unload(Eina_Array *array) EINA_ARG_NONNULL(1); |
310 | 316 | ||
311 | /** | 317 | /** |
312 | * @p Free every module on the list of modules. | 318 | * @p Free every module on the list of modules. |
@@ -317,13 +323,14 @@ EAPI void | |||
317 | * @p array. If @p array is @c NULL, this function does nothing. | 323 | * @p array. If @p array is @c NULL, this function does nothing. |
318 | */ | 324 | */ |
319 | EAPI void | 325 | EAPI void |
320 | eina_module_list_free(Eina_Array *list) EINA_ARG_NONNULL(1); | 326 | eina_module_list_free(Eina_Array *array) EINA_ARG_NONNULL(1); |
321 | 327 | ||
322 | /** | 328 | /** |
323 | * @brief Find an module in array. | 329 | * @brief Find an module in array. |
324 | * | 330 | * |
325 | * @param array The array to find the module. | 331 | * @param array The array to find the module. |
326 | * @param module The name of module to be searched. | 332 | * @param module The name of module to be searched. |
333 | * @return The module to find on success, @c NULL otherwise. | ||
327 | * | 334 | * |
328 | * This function finds an @p module in @p array. | 335 | * This function finds an @p module in @p array. |
329 | * If the element is found the function returns the module, else | 336 | * If the element is found the function returns the module, else |