/* * oma-ds-agent * Copyright (c) 2012 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @Common_Util.h * @version 0.1 * @brief This file is the header file of interface for utility function */ #ifndef COMMON_UTIL_H_ #define COMMON_UTIL_H_ #include /** * @par Description: API to create sync_agent_da_config_s structure * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] int type, account id * @param[in] string type, key * @param[in] string type, value(char *) * @param[in] string type, type of value(string, int) * @param[in] string type, name of access(SE, SA...) * @param[out] sync_agent_da_config_s * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool create_config_str(int account_id, char *key, char *value, char *type, char *access_name, sync_agent_da_config_s ** config); /** * @par Description: API to set value into config_tbl(key, value) * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] int type, account id * @param[in] string type, key * @param[in] string type, value(char *) * @param[in] string type, type of value(string, int) * @param[in] string type, name of access(SE, SA...) * @param[out] * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool set_config_str(int account_id, char *key, char *value, char *type, char *access_name); /** * @par Description: API to set value into config_tbl(key, value) * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] int type, account id * @param[in] string type, key * @param[in] int type, value(int) * @param[in] string type, type of value(string, int) * @param[in] string type, name of access(SE, SA...) * @param[out] * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool set_config_int(int account_id, char *key, int value, char *type, char *access_name); /** * @par Description: API to get value from config_tbl(key, value) * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] int type, account id * @param[in] string type, key * @param[out] string type, value * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_config(int account_id, char *key, char **value); /** * @par Description: API to get account ID from profileDirName(Sync1...) * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, profileDirName(Sync1, Sync2...) * @param[in] boolean type, already open agent db or not * @param[out] * * @return account ID (more than 1) on success * -1 on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ int get_account_id(char *profile, bool open); /** * @brief convert sync type(UI-> Engine) * @param[in] sync type(Full, Update both, Update to server, Update to phone, Refresh from server, Refresh from phone) * @return char * * @retval value of sync type Success * NULL Error */ /*int convert_synctype_value(char *syncType_str);*/ /*char *convert_synctype_str(char *syncType_value);*/ #endif /* COMMON_UTIL_H_ */