/* * 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. */ /** * @SA_Elements.h * @version 0.1 * @brief This file is the header file of interface of elements structure */ #ifndef SA_ELEMENTS_H_ #define SA_ELEMENTS_H_ #include "service-adapter/sa_define.h" /** * @par Description: API to create anchor_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, last anchor * @param[in] string type, next anchor * @param[out] anchor_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NOT_DEFINED, ERROR_INTERNAL_NO_MEMORY on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e create_anchor(char *last, char *next, anchor_s ** anchor); /** * @par Description: API to set anchor in item_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] item_s structure * @param[in] anchor_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NOT_DEFINED, ERROR_INTERNAL_NO_MEMORY on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e set_item_anchor(item_s * item, anchor_s * anchor); /** * @par Description: API to set last anchor in anchor_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] anchor_s structure * @param[in] string type, last anchor * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NOT_DEFINED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e set_last_anchor(anchor_s * anchor, char *lastAnchor); /** * @par Description: API to set next anchor in anchor_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] anchor_s structure * @param[in] string type, next anchor * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NOT_DEFINED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e set_next_anchor(anchor_s * anchor, char *nextAnchor); /** * @par Description: API to free anchor_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] anchor_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NOT_DEFINED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_anchor(anchor_s * anchor); /** * @par Description: API to create location_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, location uri * @param[in] string type, location name * @param[out] location_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NO_MEMORY, ERROR_INTERNAL_NOT_DEFINED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e create_location(char *loc_uri, char *loc_name, location_s ** location); /** * @par Description: API to duplicate location_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] location_s structure * * @return location_s structure on success * NULL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ location_s *dup_location(location_s * location); /** * @par Description: API to get location name from location_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] location_s structure * * @return location name on success * NULL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ char *get_location_loc_name(location_s * location); /** * @par Description: API to get location uri from location_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] location_s structure * * @return location uri on success * NULL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ char *get_location_loc_uri(location_s * location); /** * @par Description: API to free location_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] location_s structure * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_location(location_s * location); /** * @par Description: API to create cred_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, ID * @param[in] string type, password * @param[in] enum type, authentication type(basic, md5..) * @param[in] enum type, format type(base64..) * @param[in] string type, credential * @param[out] cred_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NO_MEMORY, ERROR_INTERNAL_NOT_DEFINED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e create_cred(char *user_name, char *pwd, auth_type_e auth_type, format_type_e format_type, char *data, cred_s ** cred); /** * @par Description: API to create cred_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] enum type, authentication type(basic, md5..) * @param[in] credential * * @return cred_s structure on success * NULL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ cred_s *create_cred_with_data(auth_type_e auth_type, char *data); /** * @par Description: API to duplicate cred_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] cred_s structure * * @return cred_s structure on success * NULL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ cred_s *dup_cred(cred_s * cred); /** * @par Description: API to set format type in cred_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] cred_s structure * @param[in] format type(base64..) * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_cred_format_type(cred_s * cred, format_type_e format_type); /** * @par Description: API to free cred_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] cred_s structure * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_cred(cred_s * cred); /** * @par Description: API to create syncml_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] sync_hdr_s structure * @param[in] GList type, list of status_s structure * @param[in] GList type, list of command_s structure * @param[in] int type, final flag * @param[out] syncml_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NO_MEMORY, ERROR_INTERNAL_NOT_DEFINED on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e create_syncml(sync_hdr_s * sync_hdr, GList * status, GList * commands, int is_final, syncml_s ** syncml); /** * @par Description: API to free syncml_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] syncml_s structure * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_syncml(syncml_s * syncml); /** * @par Description: API to create sync_hdr_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] session_s structure * @param[out] sync_hdr_s structure * * @return ERROR_INTERNAL_OK on success * ERROR_INTERNAL_NO_MEMORY, ERROR_INTERNAL_NOT_DEFINED on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e create_sync_hdr(session_s * session, sync_hdr_s ** sync_hdr); /** * @par Description: API to free SyncHdr structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] SyncHdr structure * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_sync_hdr(sync_hdr_s * sync_hdr); /** * @par Description: API to create item_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return item_s structure on success * NULL on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ item_s *create_item(); /** * @par Description: API to create item_s structure using data * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] data * @param[in] size of data * @param[out] * * @return item_s structure on success * NULL on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ item_s *create_item_for_data(const char *data, unsigned int size); /** * @par Description: API to create item_s structure using DevInf * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] devinf_s structure * @param[out] * * @return item_s structure on success * NULL on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ item_s *create_item_for_devinf(devinf_s * devinf); /** * @par Description: API to set location_s(target) structure in item_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] item_s structure * @param[in] location_s structure * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_item_target(item_s * item, location_s * target); /** * @par Description: API to set location_s(source) structure in item_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] item_s structure * @param[in] location_s structure * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_item_source(item_s * item, location_s * source); /** * @par Description: API to free item_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] item_s structure * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_item(item_s * item); /** * @par Description: API to duplicate chal_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] chal_s structure * @param[out] * * @return chal_s structure on success * NULL on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ chal_s *dup_chal(chal_s * chal); /** * @par Description: API to free chal_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] chal_s structure * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void free_chal(chal_s * chal); /** * @par Description: API to compare server credential with local credential * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] cred_s structure * @param[in] cred_s structure * @param[out] * * @return ERROR_INTERNAL_OK on success * ERROR_AUTH_REJECTED, ERROR_INTERNAL_NOT_DEFINED on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sa_error_type_e compare_cred(cred_s * hdr_cred, cred_s * session_cred); /** * @par Description: API to convert auth_type_e * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, auth type * @param[out] * * @return AUTH_TYPE_MD5, AUTH_TYPE_BASIC on success * AUTH_TYPE_UNKNOWN on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ auth_type_e convert_auth_type(char *auth_type); /** * @par Description: API to convert format_type_e * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] string type, format type * @param[out] * * @return FORMAT_TYPE_BASE64 on success * FORMAT_TYPE_UNKNOWN on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ format_type_e convert_format_type(char *format_type); /** * @par Description: API to create mem_s structure * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return mem_s structure on success * NULL on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ mem_s *create_mem(); /** * @par Description: API to set shared_mem * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] mem * @param[in] shared_mem * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_mem_shared_mem(mem_s * mem, int shared_mem); /** * @par Description: API to set free_mem * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] mem * @param[in] free_mem * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_mem_free_mem(mem_s * mem, unsigned int free_mem); /** * @par Description: API to set free_id * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] mem * @param[in] free_id * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void set_mem_free_id(mem_s * mem, unsigned int free_id); #endif /* SA_ELEMENTS_H_ */