summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file/ecore_file_download.c
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2016-10-04 21:08:17 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-10-04 21:08:17 +0900
commit3b4293ffa334303ccd2de0422d56a21873afcba0 (patch)
tree51ac1118cb56068bc74f2985120dcee688543ba9 /src/lib/ecore_file/ecore_file_download.c
parent72125bd8c3e5e3d2d28d847c1a0ab4e02e3dccc8 (diff)
ecore_file/ipc: clean up documentation
Summary: move comment from c source to header and adjust ingroup relationship Reviewers: cedric, jpeg, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D4328
Diffstat (limited to 'src/lib/ecore_file/ecore_file_download.c')
-rw-r--r--src/lib/ecore_file/ecore_file_download.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c
index 83c5884315..e9c047f7c1 100644
--- a/src/lib/ecore_file/ecore_file_download.c
+++ b/src/lib/ecore_file/ecore_file_download.c
@@ -147,41 +147,6 @@ _ecore_file_download(const char *url,
147 } 147 }
148} 148}
149 149
150/**
151 * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions
152 *
153 * @{
154 */
155
156/**
157 * @brief Download the given url to the given destination.
158 *
159 * @param url The complete url to download.
160 * @param dst The local file to save the downloaded to.
161 * @param completion_cb A callback called on download complete.
162 * @param progress_cb A callback called during the download operation.
163 * @param data User data passed to both callbacks.
164 * @param job_ret Job used to abort the download.
165 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure.
166 *
167 * This function starts the download of the URL @p url and saves it to
168 * @p dst. @p url must provide the protocol, including 'http://',
169 * 'ftp://' or 'file://'. Ecore_File must be compiled with CURL to
170 * download using http and ftp protocols. If @p dst is ill-formed, or
171 * if it already exists, the function returns @c EINA_FALSE. When the
172 * download is complete, the callback @p completion_cb is called and
173 * @p data is passed to it. The @p status parameter of @p completion_cb
174 * will be filled with the status of the download (200, 404,...). The
175 * @p progress_cb is called during the download operation, each time a
176 * packet is received or when CURL wants. It can be used to display the
177 * percentage of the downloaded file. Return 0 from this callback, if provided,
178 * to continue the operation or anything else to abort the download. The only
179 * operations that can be aborted are those with protocol 'http' or 'ftp'. In
180 * that case @p job_ret can be passed to ecore_file_download_abort() to abort
181 * that download job. Similarly ecore_file_download_abort_all() can be used to
182 * abort all download operations. This function returns @c EINA_TRUE if the
183 * download starts, @c EINA_FALSE otherwise.
184 */
185EAPI Eina_Bool 150EAPI Eina_Bool
186ecore_file_download(const char *url, 151ecore_file_download(const char *url,
187 const char *dst, 152 const char *dst,
@@ -193,18 +158,6 @@ ecore_file_download(const char *url,
193 return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, NULL); 158 return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, NULL);
194} 159}
195 160
196/**
197 * @brief Download the given url to the given destination with additional headers.
198 *
199 * @param url The complete url to download.
200 * @param dst The local file to save the downloaded to.
201 * @param completion_cb A callback called on download complete.
202 * @param progress_cb A callback called during the download operation.
203 * @param data User data passed to both callbacks.
204 * @param job_ret Job used to abort the download.
205 * @param headers pointer of header lists.
206 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure.
207 */
208EAPI Eina_Bool 161EAPI Eina_Bool
209ecore_file_download_full(const char *url, 162ecore_file_download_full(const char *url,
210 const char *dst, 163 const char *dst,
@@ -217,17 +170,6 @@ ecore_file_download_full(const char *url,
217 return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, headers); 170 return _ecore_file_download(url, dst, completion_cb, progress_cb, data, job_ret, headers);
218} 171}
219 172
220/**
221 * @brief Check if the given protocol is available.
222 *
223 * @param protocol The protocol to check.
224 * @return @c EINA_TRUE if protocol is handled, @c EINA_FALSE otherwise.
225 *
226 * This function returns @c EINA_TRUE if @p protocol is supported,
227 * @c EINA_FALSE otherwise. @p protocol can be 'http://', 'ftp://' or
228 * 'file://'. Ecore_FILE must be compiled with CURL to handle http and
229 * ftp protocols.
230 */
231EAPI Eina_Bool 173EAPI Eina_Bool
232ecore_file_download_protocol_available(const char *protocol) 174ecore_file_download_protocol_available(const char *protocol)
233{ 175{
@@ -348,18 +290,6 @@ _ecore_file_download_curl(const char *url, const char *dst,
348 return job; 290 return job;
349} 291}
350 292
351/**
352 * @brief Abort the given download job and call the completion_cb
353 * callbck with a status of 1 (error).
354 *
355 * @param job The download job to abort.
356 *
357 * This function aborts a download operation started by
358 * ecore_file_download(). @p job is the #Ecore_File_Download_Job
359 * structure filled by ecore_file_download(). If it is @c NULL, this
360 * function does nothing. To abort all the currently downloading
361 * operations, call ecore_file_download_abort_all().
362 */
363EAPI void 293EAPI void
364ecore_file_download_abort(Ecore_File_Download_Job *job) 294ecore_file_download_abort(Ecore_File_Download_Job *job)
365{ 295{
@@ -375,14 +305,6 @@ ecore_file_download_abort(Ecore_File_Download_Job *job)
375 free(job); 305 free(job);
376} 306}
377 307
378/**
379 * @brief Abort all downloads.
380 *
381 * This function aborts all the downloads that have been started by
382 * ecore_file_download(). It loops over the started downloads and call
383 * ecore_file_download_abort() for each of them. To abort only one
384 * specific download operation, call ecore_file_download_abort().
385 */
386EAPI void 308EAPI void
387ecore_file_download_abort_all(void) 309ecore_file_download_abort_all(void)
388{ 310{
@@ -391,7 +313,3 @@ ecore_file_download_abort_all(void)
391 EINA_LIST_FREE(_job_list, job) 313 EINA_LIST_FREE(_job_list, job)
392 ecore_file_download_abort(job); 314 ecore_file_download_abort(job);
393} 315}
394
395/**
396 * @}
397 */