Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / src / agent / dm-engine / dl-manager / na_fw_dl_binder.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 /*lib*/
19 #include <stdlib.h>
20 #include <string.h>
21
22 /*sync-agent*/
23 #include <sync_agent.h>
24
25 /*dm-agent*/
26 #include "dm-engine/dl-manager/na_fw_dl_binder.h"
27
28 #ifndef OMADM_AGENT_LOG
29 #undef LOG_TAG
30 #define LOG_TAG "OMA_DM_DL"
31 #endif
32
33 void add_header_info(GList ** header_info_list, char *key, char *value)
34 {
35         _EXTERN_FUNC_ENTER;
36
37         retm_if((key) == NULL, "key is NULL!!");
38         retm_if((value) == NULL, "value is NULL!!");
39
40         if (value != NULL) {
41                 sync_agent_na_common_header_info_s *header_info = (sync_agent_na_common_header_info_s *) calloc(1, sizeof(sync_agent_na_common_header_info_s));
42                 if (header_info == NULL) {
43                         _DEBUG_INFO("alloc error");
44                         return;
45                 }
46                 header_info->key = key;
47                 header_info->value = value;
48                 *header_info_list = g_list_append(*header_info_list, header_info);
49         }
50
51         _EXTERN_FUNC_EXIT;
52 }