Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-adapter / sa_util.h
1 /*
2  * oma-ds-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 /**
19  *   @SA_Util.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file of interface for utility function in SA
22  */
23
24 #ifndef SA_UTIL_H_
25 #define SA_UTIL_H_
26
27 #include "service-adapter/sa_define.h"
28
29 /**
30  * @par Description: API to put command into GList
31  * This API can be used to put structure into GList
32  *
33  * @par Purpose:
34  * @par Typical use case:
35  * @par Method of function operation:
36  * @par Important notes:
37  * @param[in]           GList type, first index of list
38  * @param[in]           GList type, last index of list
39  * @param[in]           void pointer type, structure to put in the list
40  *
41  * @return
42  *
43  * @par Errors:
44  *
45  * @pre None.
46  * @post
47  * @see
48  * @remarks None.
49  *
50  * @par Sample Code:
51  * @code
52  * @endcode
53  */
54 void put_into_list(GList ** commands, GList ** commands_last, void *command);
55
56 /**
57  * @par Description: API to create credential string
58  * This API can be used to create credential string
59  *
60  * @par Purpose:
61  * @par Typical use case:
62  * @par Method of function operation:
63  * @par Important notes:
64  * @param[in]           enum type, type of authentication(AUTH_TYPE_BASIC , AUTH_TYPE_MD5...)
65  * @param[in]           string type, id
66  * @param[in]           string type, password
67  * @param[in]           string type, nonce
68  * @param[in]           unsigned int type, size of nonce
69  * @param[out]          string type, credential
70  *
71  * @return                              ERROR_INTERNAL_OK on success
72  *                                                      ERROR_INTERNAL_NO_MEMORY on error
73  *
74  * @par Errors:
75  *
76  * @pre None.
77  * @post
78  * @see
79  * @remarks None.
80  *
81  * @par Sample Code:
82  * @code
83  * @endcode
84  */
85 sa_error_type_e create_cred_string(auth_type_e type, const char *user_name, const char *password, const char *nonce, unsigned int nonce_size, char **cred);
86
87 /**
88  *  @brief                              write xml to file(for debugging)
89  *  @param[in]          string to write
90  *  @param[in]          path
91  */
92 void set_xml_to_file(char *xml, const char *path);
93
94 #endif                          /* SA_UTIL_H_ */