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.
18 #ifndef FW_COMPRESS_H_
19 #define FW_COMPRESS_H_
23 #endif /* __cplusplus */
27 * @brief Provides folder de/compress operations
30 /** @addtogroup utility
35 * Enumerations of compress result
38 SYNC_AGENT_UTIL_COMPRESS_SUCCESS = 1,
39 /**< operation success */
40 SYNC_AGENT_UTIL_COMPRESS_FAIL
41 /**< operation failed */
42 } sync_agent_util_compress_result_e;
45 * Enumerations of compress type
48 SYNC_AGENT_UTIL_COMPRESS_TYPE_TAR = 1,
49 /**< compress type : tar */
50 SYNC_AGENT_UTIL_COMPRESS_TYPE_ZIP
51 /**< compress type : zip */
52 } sync_agent_util_compress_type_e;
55 * API to compress folder into desired format
59 sync_agent_util_compress_result_e result = SYNC_AGENT_UTIL_COMPRESS_SUCCESS;
60 sync_agent_util_compress_type_e type = SYNC_AGENT_UTIL_COMPRESS_TYPE_TAR;
61 char *input_path = NULL;
62 char *output_path = NULL;
64 result = sync_agent_compress(type, input_path, output_path);
65 if (result != SYNC_AGENT_UTIL_COMPRESS_SUCCESS) {
72 * @param[in] type type of compress in sync_agent_util_compress_type_e type of value
73 * @param[in] input_directory_path folder path to compress
74 * @param[in] output_file_path path to put compressed file
76 * @return SYNC_AGENT_UTIL_COMPRESS_SUCCESS on success, SYNC_AGENT_UTIL_COMPRESS_FAIL on error
81 * @see sync_agent_compress(sync_agent_util_compress_type_e, const char *, const char *)
84 sync_agent_util_compress_result_e sync_agent_compress(sync_agent_util_compress_type_e type, const char *input_directory_path, const char *output_file_path);
87 * API to decompress compressed file in specific format
91 sync_agent_util_compress_type_e type = SYNC_AGENT_UTIL_COMPRESS_TYPE_TAR;
92 char *input_path = NULL;
93 char *output_path = NULL;
95 result = sync_agent_uncompress(type, input_path, output_path);
96 if (result != SYNC_AGENT_UTIL_COMPRESS_SUCCESS) {
103 * @param[in] type type of compress in sync_agent_util_compress_type_e type of value
104 * @param[in] input_file_path compressed file path to decompress
105 * @param[in] output_direcory_path path to put decompressed folder
107 * @return SYNC_AGENT_UTIL_COMPRESS_SUCCESS on success, SYNC_AGENT_UTIL_COMPRESS_FAIL on error
112 * @see sync_agent_uncompress(sync_agent_util_compress_type_e, const char *, const char *)
115 sync_agent_util_compress_result_e sync_agent_uncompress(sync_agent_util_compress_type_e type, const char *input_file_path, const char *output_direcory_path);
118 * API to decompress compressed file in specific format
122 sync_agent_util_compress_type_e type = SYNC_AGENT_UTIL_COMPRESS_TYPE_TAR;
123 char *input_path = NULL;
124 char *output_path = NULL;
126 result = sync_agent_ua_uncompress(type, input_path, output_path);
127 if (result != SYNC_AGENT_UTIL_COMPRESS_SUCCESS) {
134 * @param[in] type type of compress in sync_agent_util_compress_type_e type of value
135 * @param[in] input_file_path compressed file path to decompress
136 * @param[in] output_direcory_path path to Update-Agent put decompressed folder
138 * @return SYNC_AGENT_UTIL_COMPRESS_SUCCESS on success, SYNC_AGENT_UTIL_COMPRESS_FAIL on error
143 * @see sync_agent_ua_uncompress(sync_agent_util_compress_type_e, const char *, const char *)
146 sync_agent_util_compress_result_e sync_agent_ua_uncompress(sync_agent_util_compress_type_e type, const char *input_file_path, const char *output_direcory_path);
154 #endif /* __cplusplus */
155 #endif /* FW_COMPRESS_H_ */