Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / src / agent / common / dm-status / oma_dm_status_db_handler.c
1 /*
2  * oma-dm-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /*sync-agent*/
19 #include <sync_agent.h>
20
21 /*dm-agent*/
22 #include "common/dm-status/oma_dm_status_db_handler.h"
23 #include "common/dm-status/oma_dm_status_db.h"
24
25 #ifndef OMADM_AGENT_LOG
26 #undef LOG_TAG
27 #define LOG_TAG "OMA_DM_DB"
28 #endif
29
30 static db_handler_mgr *pDBHandlerMgr = 0;
31
32 /* static function define */
33 static DM_ERROR _add_agent_handler(unsigned int key, DB_HANDLER * pHandler);
34 static DM_ERROR _remove_agent_handler(unsigned int key);
35 static DB_HANDLER *_get_agent_handler(unsigned int key);
36 static DM_ERROR __alloc_agent_dc_handlerTable();
37 static DM_ERROR __alloc_agent_dc_handlerTable_mutex();
38 static DM_ERROR _free_agent_dc_handlerTable();
39 static DM_ERROR _free_agent_dc_handlerTable_mutex();
40 static DM_ERROR _create_agentDBHandlerMgrInfo();
41 static void ___destroy_agentDBHashTableValue(void *pHandler);
42 static void ___destory_agentDBHashTableKey(void *key);
43
44 /* test function define*/
45 /*static void                                   __print_agentDBHashTableLog();*/
46
47 /* general function implementation */
48 /*
49  * ==================================
50  * external API (1. about db handler mgr)
51  * ==================================
52  */
53 DM_ERROR Alloc_DB_Handler_Mgr()
54 {
55         _EXTERN_FUNC_ENTER;
56
57         DM_ERROR ret = DM_OK;
58
59         /* alloc the agentDBHandlerMgr */
60         pDBHandlerMgr = (db_handler_mgr *) calloc(1, sizeof(db_handler_mgr));
61         if (pDBHandlerMgr == NULL) {
62                 _DEBUG_INFO("alloc fail");
63                 _EXTERN_FUNC_EXIT;
64                 return COMMON_ERR_ALLOC;
65         }
66         _DEBUG_INFO("[%s] pMoDBHandlerMgr alloc success !\n", __func__);
67
68         /* alloc the agentDBHandlerMgr information */
69         ret = _create_agentDBHandlerMgrInfo();
70         if (ret != DM_OK)
71                 _DEBUG_INFO("[%s] __create_agentDBHandlerMgrInfo alloc fail !\n", __func__);
72         else
73                 _DEBUG_INFO("[%s] __create_agentDBHandlerMgrInfo alloc success !\n", __func__);
74
75         _EXTERN_FUNC_EXIT;
76         return ret;
77 }
78
79 DM_ERROR Free_DB_Handler_Mgr()
80 {
81         _EXTERN_FUNC_ENTER;
82         DM_ERROR ret = DM_OK;
83
84         if (pDBHandlerMgr != NULL) {
85
86                 ret = _free_agent_dc_handlerTable_mutex();
87                 if (ret != DM_OK) {
88                         _EXTERN_FUNC_EXIT;
89                         return DM_ERR_UNKNOWN;
90                 }
91
92                 ret = _free_agent_dc_handlerTable();
93                 if (ret != DM_OK) {
94                         _EXTERN_FUNC_EXIT;
95                         return DM_ERR_UNKNOWN;
96                 }
97         }
98
99         _EXTERN_FUNC_EXIT;
100         return ret;
101 }
102
103 void Free_Memory_Engine_Status(engine_status ** status, int count)
104 {
105         _EXTERN_FUNC_ENTER;
106         engine_status *temp_status = *status;
107
108         int i;
109         for (i = 0; i < count; i++) {
110                 MEMORY_FREE(temp_status[i].server_id);
111                 MEMORY_FREE(temp_status[i].server_url);
112                 MEMORY_FREE(temp_status[i].correlator);
113                 MEMORY_FREE(temp_status[i].ui_mode);
114                 MEMORY_FREE(temp_status[i].mo_path);
115         }
116
117         MEMORY_FREE(temp_status);
118         *status = 0;
119         _EXTERN_FUNC_EXIT;
120 }
121
122 /*
123  * ==================================
124  * external API (2. about agent db )
125  * ==================================
126  */
127 DM_ERROR DB_Open()
128 {
129         _EXTERN_FUNC_ENTER;
130         int ret = 0;
131
132         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
133         if (db_handler == NULL) {
134
135                 _DEBUG_INFO("db_handler is 0");
136                 _DEBUG_INFO("should register db_handler to db_handler_hash_table");
137                 ret = dm_open_agent(&db_handler);
138                 if (ret != DM_OK) {
139                         _EXTERN_FUNC_EXIT;
140                         return ret;
141                 }
142
143                 if (db_handler != NULL) {
144                         /* add agentDB handler to agentDBHandleMgr */
145                         ret = _add_agent_handler(GET_THREAD_ID, db_handler);
146                         if (ret != DM_OK) {
147                                 _EXTERN_FUNC_EXIT;
148                                 return ret;
149                         }
150                 }
151         } else {
152                 _DEBUG_INFO("db_handler is not null");
153                 _DEBUG_INFO("should not register db_handler to db_handler_hash_table");
154         }
155
156         _DEBUG_INFO("agent_db_agent_open_success");
157         _EXTERN_FUNC_EXIT;
158         return DM_OK;
159 }
160
161 void DB_Close()
162 {
163         _EXTERN_FUNC_ENTER;
164
165         DM_ERROR ret = DM_OK;
166
167         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
168         if (db_handler != NULL) {
169
170                 /* remove agentDB handler to agentDBHandleMgr */
171                 ret = _remove_agent_handler(GET_THREAD_ID);
172                 if (ret != DM_OK) {
173                         _DEBUG_INFO("agent_db_agent_close_fail");
174                         _EXTERN_FUNC_EXIT;
175                         return;
176                 }
177                 _DEBUG_INFO("agent_db_agent_close_success");
178         }
179         _EXTERN_FUNC_EXIT;
180 }
181
182 DM_ERROR DB_Create_Table()
183 {
184         _EXTERN_FUNC_ENTER;
185
186         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
187         if (db_handler == NULL) {
188                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
189                 _EXTERN_FUNC_EXIT;
190                 return DM_ERR_UNKNOWN;
191         }
192         _EXTERN_FUNC_EXIT;
193         return dm_create_table(db_handler);
194 }
195
196 DM_ERROR DB_Delete_Table()
197 {
198         _EXTERN_FUNC_ENTER;
199
200         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
201         if (db_handler == NULL) {
202                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
203                 _EXTERN_FUNC_EXIT;
204                 return DM_ERR_UNKNOWN;
205         }
206         _EXTERN_FUNC_EXIT;
207         return dm_delete_table(db_handler);
208 }
209
210 DM_ERROR DB_Reset_Table()
211 {
212         _EXTERN_FUNC_ENTER;
213
214         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
215         if (db_handler == NULL) {
216                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
217                 _EXTERN_FUNC_EXIT;
218                 return DM_ERR_UNKNOWN;
219         }
220         _EXTERN_FUNC_EXIT;
221         return dm_reset_table(db_handler);
222 }
223
224 DM_ERROR DB_Begin_Transaction()
225 {
226         _EXTERN_FUNC_ENTER;
227
228         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
229         if (db_handler == NULL) {
230                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
231                 _EXTERN_FUNC_EXIT;
232                 return DM_ERR_UNKNOWN;
233         }
234         _EXTERN_FUNC_EXIT;
235         return dm_begin_transaction(db_handler);
236 }
237
238 DM_ERROR DB_End_Transaction(DB_TRANSACTION transaction)
239 {
240         _EXTERN_FUNC_ENTER;
241
242         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
243         if (db_handler == NULL) {
244                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
245                 _EXTERN_FUNC_EXIT;
246                 return DM_ERR_UNKNOWN;
247         }
248         _EXTERN_FUNC_EXIT;
249         return dm_end_transaction(db_handler, transaction);
250 }
251
252 DM_ERROR Init_Engine_Status()
253 {
254         _EXTERN_FUNC_ENTER;
255
256         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
257         if (db_handler == NULL) {
258                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
259                 _EXTERN_FUNC_EXIT;
260                 return DM_ERR_UNKNOWN;
261         }
262         _EXTERN_FUNC_EXIT;
263         return dm_init_engine_status(db_handler);
264 }
265
266 DM_ERROR Add_Engine_Status(engine_status * status)
267 {
268         _EXTERN_FUNC_ENTER;
269
270         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
271         if (db_handler == NULL) {
272                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
273                 _EXTERN_FUNC_EXIT;
274                 return DM_ERR_UNKNOWN;
275         }
276         _EXTERN_FUNC_EXIT;
277         return dm_add_engine_status(db_handler, status);
278 }
279
280 DM_ERROR Delete_Engine_Status(int engine_id)
281 {
282         _EXTERN_FUNC_ENTER;
283
284         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
285         if (db_handler == NULL) {
286                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
287                 _EXTERN_FUNC_EXIT;
288                 return DM_ERR_UNKNOWN;
289         }
290
291         _EXTERN_FUNC_EXIT;
292         return dm_delete_engine_status(db_handler, engine_id);
293 }
294
295 DM_ERROR Update_Engine_Status(engine_status * status)
296 {
297         _EXTERN_FUNC_ENTER;
298
299         retvm_if(status == NULL, DM_ERR_UNKNOWN, "engine status is NULL !!");
300
301         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
302         if (db_handler == NULL) {
303                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
304                 _EXTERN_FUNC_EXIT;
305                 return DM_ERR_UNKNOWN;
306         }
307
308         int ret = dm_isExist_engine_id(db_handler, status->engine_id);
309         if (ret == 0) {
310                 _EXTERN_FUNC_EXIT;
311                 return dm_add_engine_status(db_handler, status);
312         } else {
313                 _EXTERN_FUNC_EXIT;
314                 return dm_update_engine_status(db_handler, status);
315         }
316 }
317
318 DM_ERROR Update_Engine_Status_Column(int engine_id, ENGINE_STATUS_VALUE engine_status_value, void *value)
319 {
320         _EXTERN_FUNC_ENTER;
321
322         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
323         if (db_handler == NULL) {
324                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
325                 _EXTERN_FUNC_EXIT;
326                 return DM_ERR_UNKNOWN;
327         }
328         _EXTERN_FUNC_EXIT;
329         return dm_update_engine_status_column(db_handler, engine_id, engine_status_value, value);
330 }
331
332 DM_ERROR Get_Engine_Status(int engine_id, engine_status ** status)
333 {
334         _EXTERN_FUNC_ENTER;
335
336         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
337         if (db_handler == NULL) {
338                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
339                 _EXTERN_FUNC_EXIT;
340                 return DM_ERR_UNKNOWN;
341         }
342         _EXTERN_FUNC_EXIT;
343         return dm_get_engine_status(db_handler, engine_id, status);
344 }
345
346 DM_ERROR Get_AII_Engine_Status(engine_status ** status_list, int *count)
347 {
348         _EXTERN_FUNC_ENTER;
349
350         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
351         if (db_handler == NULL) {
352                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
353                 _EXTERN_FUNC_EXIT;
354                 return DM_ERR_UNKNOWN;
355         }
356
357         _EXTERN_FUNC_EXIT;
358         return dm_get_aII_engine_status(db_handler, status_list, count);
359 }
360
361 int IsExist_Engine_id(int engine_id)
362 {
363         _EXTERN_FUNC_ENTER;
364
365         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
366         if (db_handler == NULL) {
367                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
368                 _EXTERN_FUNC_EXIT;
369                 return DM_ERR_UNKNOWN;
370         }
371
372         _EXTERN_FUNC_EXIT;
373
374         return dm_isExist_engine_id(db_handler, engine_id);
375 }
376
377 /*
378  * ==================================
379  *  DB module internal API
380  * ==================================
381  */
382 DM_ERROR _add_agent_handler(unsigned int key, DB_HANDLER * pHandler)
383 {
384         _INNER_FUNC_ENTER;
385
386         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL) {
387                 return DM_ERR_UNKNOWN;
388         }
389
390         DM_ERROR ret = DM_OK;
391
392         unsigned int *pKey_copy = (unsigned int *)calloc(1, sizeof(unsigned int));
393         if (pKey_copy == NULL) {
394                 _INNER_FUNC_EXIT;
395                 return COMMON_ERR_ALLOC;
396         }
397
398         *pKey_copy = key;
399
400         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
401         if (pDBHandlerMgr->db_handlerTable == NULL) {
402                 ret = __alloc_agent_dc_handlerTable();
403                 if (ret != DM_OK)
404                         goto addagentHandler;
405         }
406
407         /* insert to handler */
408         _DEBUG_TRACE("[%s] Key  =  %d, Handler  =  %p  !\n", __func__, key, pHandler);
409         g_hash_table_insert(pDBHandlerMgr->db_handlerTable, pKey_copy, pHandler);
410
411 #ifdef DC_PRINT
412         /* For test log */
413         __print_agentDBHashTableLog();
414 #endif
415         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
416         if(pKey_copy != NULL) {
417                 free(pKey_copy);
418         }
419         _INNER_FUNC_EXIT;
420         return ret;
421
422  addagentHandler:
423         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
424         if(pKey_copy != NULL) {
425                 free(pKey_copy);
426         }
427         _INNER_FUNC_EXIT;
428         return ret;
429 }
430
431 DM_ERROR _remove_agent_handler(unsigned int key)
432 {
433         _INNER_FUNC_ENTER;
434
435         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL || pDBHandlerMgr->db_handlerTable == NULL) {
436                 _INNER_FUNC_EXIT;
437                 return DM_ERR_UNKNOWN;
438         }
439
440         /* remove the handler to hash table */
441         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
442         int isSuccess = g_hash_table_remove(pDBHandlerMgr->db_handlerTable, &key);
443         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
444
445 #ifdef DC_PRINT
446         /* for test log */
447         __print_agentDBHashTableLog();
448 #endif
449
450         _DEBUG_TRACE("[%s] end !\n", __func__);
451         if (isSuccess == 1) {
452                 _EXTERN_FUNC_EXIT;
453                 return DM_OK;
454         }
455
456         _INNER_FUNC_EXIT;
457
458         return DM_ERR_UNKNOWN;
459 }
460
461 DB_HANDLER *_get_agent_handler(unsigned int key)
462 {
463         _INNER_FUNC_ENTER;
464
465         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL || pDBHandlerMgr->db_handlerTable == NULL) {
466                 _DEBUG_TRACE("[%s] DM_ERR_UNKNOWN !\n", __func__);
467                 _INNER_FUNC_EXIT;
468
469                 return 0;
470         }
471
472         /* get the handler to hash table */
473         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
474         DB_HANDLER *pHandler = g_hash_table_lookup(pDBHandlerMgr->db_handlerTable, &key);
475         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
476
477 #ifdef DC_PRINT
478         if (pHandler != NULL) {
479                 _DEBUG_TRACE("[%s] ######### > Value Search Success(key = %d, handler = %p)\n", __func__, key, pHandler);
480         } else {
481                 _DEBUG_TRACE("[%s] ######### > Value Search Fail(key = %d, handler = %p)\n", __func__, key, pHandler);
482         }
483 #endif
484         _INNER_FUNC_EXIT;
485
486         return pHandler;
487 }
488
489 /* static function implementation */
490 static DM_ERROR __alloc_agent_dc_handlerTable()
491 {
492         _INNER_FUNC_ENTER;
493
494         if (pDBHandlerMgr != NULL) {
495                 pDBHandlerMgr->db_handlerTable = g_hash_table_new_full(g_int_hash, g_int_equal, ___destory_agentDBHashTableKey, ___destroy_agentDBHashTableValue);
496                 if (pDBHandlerMgr->db_handlerTable == NULL) {
497                         _DEBUG_TRACE("[%s] Not Create agent dc handler hash table \n", __func__);
498                         _INNER_FUNC_EXIT;
499                         return DM_ERR_UNKNOWN;
500                 } else {
501                         _DEBUG_TRACE("[%s] create agent dc handler hash table \n", __func__);
502                 }
503         }
504
505         _INNER_FUNC_EXIT;
506
507         return DM_OK;
508 }
509
510 static DM_ERROR __alloc_agent_dc_handlerTable_mutex()
511 {
512         _INNER_FUNC_ENTER;
513
514         if (pDBHandlerMgr != NULL) {
515
516                 pDBHandlerMgr->db_handlerTable_mutex = (pthread_mutex_t *) calloc(1, sizeof(pthread_mutex_t));
517                 if (pDBHandlerMgr->db_handlerTable_mutex == NULL) {
518                         _DEBUG_TRACE("[%s] Not Create agent dc handler hash table mutex \n", __func__);
519                         _INNER_FUNC_EXIT;
520                         return COMMON_ERR_ALLOC;
521                 } else {
522
523                         if (pthread_mutex_init(pDBHandlerMgr->db_handlerTable_mutex, 0) != 0) {
524                                 _DEBUG_TRACE("[%s] Not init agent dc handler hash table mutex\n", __func__);
525                                 _INNER_FUNC_EXIT;
526                                 return DM_ERR_UNKNOWN;
527                         }
528                         _DEBUG_TRACE("[%s] Init agent dc handler hash table mutex\n", __func__);
529                 }
530         }
531
532         _INNER_FUNC_EXIT;
533
534         return DM_OK;
535 }
536
537 static DM_ERROR _free_agent_dc_handlerTable()
538 {
539         _INNER_FUNC_ENTER;
540
541         if (pDBHandlerMgr != NULL && pDBHandlerMgr->db_handlerTable != NULL) {
542                 g_hash_table_destroy(pDBHandlerMgr->db_handlerTable);
543                 _DEBUG_TRACE("[%s] db_handlerTable free success !\n", __func__);
544                 pDBHandlerMgr->db_handlerTable = 0;;
545         }
546         _INNER_FUNC_EXIT;
547
548         return DM_OK;
549 }
550
551 static DM_ERROR _free_agent_dc_handlerTable_mutex()
552 {
553         _INNER_FUNC_ENTER;
554
555         if (pDBHandlerMgr != NULL && pDBHandlerMgr->db_handlerTable_mutex != NULL) {
556
557                 int ret = pthread_mutex_destroy(pDBHandlerMgr->db_handlerTable_mutex);
558                 if (ret != 0) {
559                         _DEBUG_TRACE("[%s] db_handlerTable_mutex free error !\n", __func__);
560                         return DM_ERR_UNKNOWN;
561                 } else {
562                         free(pDBHandlerMgr->db_handlerTable_mutex);
563                         pDBHandlerMgr->db_handlerTable_mutex = 0;
564                         _DEBUG_TRACE("[%s] db_handlerTable_mutex free success !\n", __func__);
565                 }
566         }
567         _INNER_FUNC_EXIT;
568
569         return DM_OK;
570 }
571
572 static DM_ERROR _create_agentDBHandlerMgrInfo()
573 {
574         _INNER_FUNC_ENTER;
575
576         DM_ERROR ret = DM_OK;
577
578         if (pDBHandlerMgr != NULL) {
579
580                 /* alloc agent db hander hash table */
581                 ret = __alloc_agent_dc_handlerTable();
582                 if (ret != DM_OK)
583                         goto allocAgentDBHandlerMgrInfoErr;
584
585                 /* alloc agent db hander hash table mutex */
586                 ret = __alloc_agent_dc_handlerTable_mutex();
587                 if (ret != DM_OK)
588                         goto allocAgentDBHandlerMgrInfoErr;
589         }
590         _INNER_FUNC_EXIT;
591
592         return DM_OK;
593
594  allocAgentDBHandlerMgrInfoErr:
595         Free_DB_Handler_Mgr();
596
597         _INNER_FUNC_EXIT;
598         return DM_ERR_UNKNOWN;
599 }
600
601 static void ___destroy_agentDBHashTableValue(void *pHandler)
602 {
603         _INNER_FUNC_ENTER;
604
605         _DEBUG_VERBOSE("[%s] start \n", __func__);
606         if ((DB_HANDLER *) pHandler != 0) {
607                 dm_close_agent((DB_HANDLER *) pHandler);
608         }
609
610         _INNER_FUNC_EXIT;
611 }
612
613 static void ___destory_agentDBHashTableKey(void *key)
614 {
615         _INNER_FUNC_ENTER;
616
617         _DEBUG_VERBOSE("[%s] start \n", __func__);
618         if ((unsigned int *)key != 0) {
619                 free((unsigned int *)key);
620         }
621         _INNER_FUNC_EXIT;
622
623 }
624
625 /*
626 static void __print_agentDBHashTableLog()
627 {
628         _DEBUG_VERBOSE("[%s] ---------HashKeyList --------\n", __func__);
629         int size = g_hash_table_size(pDBHandlerMgr->db_handlerTable);
630         _DEBUG_VERBOSE("[%s] pDBHandlerMgr->db_handlerTable Size is %d\n", __func__, size);
631         _DEBUG_VERBOSE("[%s] ----------------------------------------\n", __func__);
632         GList *iter = 0;
633         GList *keyList = g_hash_table_get_keys(pDBHandlerMgr->db_handlerTable);
634         for (iter = keyList; iter != 0; iter = g_list_next(iter))
635                 _DEBUG_VERBOSE("[%s] Handler Key  %d\n", __func__, *((unsigned int *)(iter->data)));
636         _DEBUG_VERBOSE("[%s] ----------------------------------------\n", __func__);
637 }
638 */