3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * @brief This file is the header file of interface for utility function in SA
27 #include "service-adapter/sa_define.h"
30 * @par Description: API to put command into GList
31 * This API can be used to put structure into GList
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
54 void put_into_list(GList ** commands, GList ** commands_last, void *command);
57 * @par Description: API to create credential string
58 * This API can be used to create credential string
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
71 * @return ERROR_INTERNAL_OK on success
72 * ERROR_INTERNAL_NO_MEMORY on error
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);
88 * @brief write xml to file(for debugging)
89 * @param[in] string to write
92 void set_xml_to_file(char *xml, const char *path);
94 #endif /* SA_UTIL_H_ */