summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file
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
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')
-rw-r--r--src/lib/ecore_file/Ecore_File.h509
-rw-r--r--src/lib/ecore_file/ecore_file.c341
-rw-r--r--src/lib/ecore_file/ecore_file_download.c82
-rw-r--r--src/lib/ecore_file/ecore_file_monitor.c49
-rw-r--r--src/lib/ecore_file/ecore_file_path.c43
5 files changed, 509 insertions, 515 deletions
diff --git a/src/lib/ecore_file/Ecore_File.h b/src/lib/ecore_file/Ecore_File.h
index c78b0b1929..70c4af7b36 100644
--- a/src/lib/ecore_file/Ecore_File.h
+++ b/src/lib/ecore_file/Ecore_File.h
@@ -114,59 +114,535 @@ typedef int (*Ecore_File_Download_Progress_Cb)(void *data,
114 114
115/* File operations */ 115/* File operations */
116 116
117/**
118 * @brief Initialize the Ecore_File library.
119 *
120 * @return 1 or greater on success, 0 on error.
121 *
122 * This function sets up Ecore_File and the services it will use
123 * (monitoring, downloading, PATH related feature). It returns 0 on
124 * failure, otherwise it returns the number of times it has already
125 * been called.
126 *
127 * When Ecore_File is not used anymore, call ecore_file_shutdown()
128 * to shut down the Ecore_File library.
129 */
117EAPI int ecore_file_init (void); 130EAPI int ecore_file_init (void);
131
132/**
133 * @brief Shut down the Ecore_File library.
134 *
135 * @return 0 when the library is completely shut down, 1 or
136 * greater otherwise.
137 *
138 * This function shuts down the Ecore_File library. It returns 0 when it has
139 * been called the same number of times than ecore_file_init(). In that case
140 * it shuts down all the services it uses.
141 */
118EAPI int ecore_file_shutdown (void); 142EAPI int ecore_file_shutdown (void);
143
144/**
145 * @brief Get the time of the last modification to the given file.
146 *
147 * @param file The name of the file.
148 * @return Return the time of the last data modification, or 0 on
149 * failure.
150 *
151 * This function returns the time of the last modification of
152 * @p file. On failure, it returns 0.
153 */
119EAPI long long ecore_file_mod_time (const char *file); 154EAPI long long ecore_file_mod_time (const char *file);
155
156/**
157 * @brief Get the size of the given file.
158 *
159 * @param file The name of the file.
160 * @return Return the size of the file in bytes, or 0 on failure.
161 *
162 * This function returns the size of @p file in bytes. On failure, it
163 * returns 0.
164 */
120EAPI long long ecore_file_size (const char *file); 165EAPI long long ecore_file_size (const char *file);
166
167/**
168 * @brief Check if the given file exists.
169 *
170 * @param file The name of the file.
171 * @return @c EINA_TRUE if the @p file exists, @c EINA_FALSE otherwise.
172 *
173 * This function returns @c EINA_TRUE if @p file exists on local filesystem,
174 * @c EINA_FALSE otherwise.
175 */
121EAPI Eina_Bool ecore_file_exists (const char *file); 176EAPI Eina_Bool ecore_file_exists (const char *file);
177
178/**
179 * @brief Check if the given file is a directory.
180 *
181 * @param file The name of the file.
182 * @return @c EINA_TRUE if the file exists and is a directory, @c EINA_FALSE
183 * otherwise.
184 *
185 * This function returns @c EINA_TRUE if @p file exists exists and is a
186 * directory on local filesystem, @c EINA_FALSE otherwise.
187 */
122EAPI Eina_Bool ecore_file_is_dir (const char *file); 188EAPI Eina_Bool ecore_file_is_dir (const char *file);
189
190/**
191 * @brief Create a new directory.
192 *
193 * @param dir The name of the directory to create
194 * @return @c EINA_TRUE on successful creation, @c EINA_FALSE otherwise.
195 *
196 * This function creates the directory @p dir, with the mode S_IRUSR |
197 * S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH on UNIX
198 * (mode is unsued on Windows). On success, it returns @c EINA_TRUE,
199 * @c EINA_FALSE otherwise.
200 */
123EAPI Eina_Bool ecore_file_mkdir (const char *dir); 201EAPI Eina_Bool ecore_file_mkdir (const char *dir);
202
203/**
204 * @brief Create complete directory in a batch.
205 *
206 * @param dirs The list of directories, null terminated.
207 * @return The number of successful directories created, -1 if dirs is
208 * @c NULL.
209 *
210 * This function creates all the directories that are in the null
211 * terminated array @p dirs. The function loops over the directories
212 * and call ecore_file_mkdir(). This function returns -1 if @p dirs is
213 * @c NULL, otherwise if returns the number of suceesfully created
214 * directories.
215 */
124EAPI int ecore_file_mkdirs (const char **dirs); 216EAPI int ecore_file_mkdirs (const char **dirs);
217
218/**
219 * @brief Create complete list of sub-directories in a batch (optimized).
220 *
221 * @param base The base directory to act on.
222 * @param subdirs The list of directories, null terminated.
223 * @return number of successful directories created, -1 on failure.
224 *
225 * This function creates all the directories that are in the null
226 * terminated array @p subdirs in the @p base directory. If @p base does
227 * not exist, it will be created. The function loops over the directories
228 * and call ecore_file_mkdir(). The whole path of the directories must
229 * exist. So if base/a/b/c wants to be created, @p subdirs must
230 * contain "a", "a/b" and "a/b/c", in that order. This function
231 * returns -1 if @p subdirs or @p base are @c NULL, or if @p base is
232 * empty ("\0"). It returns 0 is @p base is not a directory or
233 * invalid, or if it can't be created. Otherwise if returns the number
234 * of suceesfully created directories.
235 */
125EAPI int ecore_file_mksubdirs (const char *base, const char **subdirs); 236EAPI int ecore_file_mksubdirs (const char *base, const char **subdirs);
237
238/**
239 * @brief Delete the given directory.
240 *
241 * @param dir The name of the directory to delete.
242 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
243 *
244 * This function deletes @p dir. It returns @c EINA_TRUE on success,
245 * @c EINA_FALSE otherwise.
246 */
126EAPI Eina_Bool ecore_file_rmdir (const char *dir); 247EAPI Eina_Bool ecore_file_rmdir (const char *dir);
248
249/**
250 * @brief Delete the given directory and all its contents.
251 *
252 * @param dir The name of the directory to delete.
253 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
254 *
255 * This function delete @p dir and all its contents. If @p dir is a
256 * link only the link is removed. It returns @c EINA_TRUE on success,
257 * @c EINA_FALSE otherwise.
258 */
127EAPI Eina_Bool ecore_file_recursive_rm (const char *dir); 259EAPI Eina_Bool ecore_file_recursive_rm (const char *dir);
260
261/**
262 * @brief Create a complete path.
263 *
264 * @param path The path to create
265 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
266 *
267 * This function creates @p path and all the subdirectories it
268 * contains. The separator is '/' or '\'. If @p path exists, this
269 * function returns @c EINA_TRUE immediately. It returns @c EINA_TRUE on
270 * success, @c EINA_FALSE otherwise.
271 */
128EAPI Eina_Bool ecore_file_mkpath (const char *path); 272EAPI Eina_Bool ecore_file_mkpath (const char *path);
273
274/**
275 * @brief Create complete paths in a batch.
276 *
277 * @param paths list of paths, null terminated.
278 * @return number of successful paths created, -1 if paths is NULL.
279 *
280 * This function creates all the directories that are in the null
281 * terminated array @p paths. The function loops over the directories
282 * and call ecore_file_mkpath(), hence on Windows, '\' must be
283 * replaced by '/' before calling that function. This function
284 * returns -1 if @p paths is @c NULL. Otherwise if returns the number
285 * of suceesfully created directories.
286 */
129EAPI int ecore_file_mkpaths (const char **paths); 287EAPI int ecore_file_mkpaths (const char **paths);
288
289/**
290 * @brief Copy the given file to the given destination.
291 *
292 * @param src The name of the source file.
293 * @param dst The name of the destination file.
294 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
295 *
296 * This function copies @p src to @p dst. If the absolute path name of
297 * @p src and @p dst can not be computed, or if they are equal, or if
298 * the copy fails, the function returns @c EINA_FALSE, otherwise it
299 * returns @c EINA_TRUE.
300 */
130EAPI Eina_Bool ecore_file_cp (const char *src, const char *dst); 301EAPI Eina_Bool ecore_file_cp (const char *src, const char *dst);
302
303/**
304 * @brief Move the given file to the given destination.
305 *
306 * @param src The name of the source file.
307 * @param dst The name of the destination file.
308 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
309 *
310 * This function moves @p src to @p dst. It returns @c EINA_TRUE on
311 * success, @c EINA_FALSE otherwise.
312 */
131EAPI Eina_Bool ecore_file_mv (const char *src, const char *dst); 313EAPI Eina_Bool ecore_file_mv (const char *src, const char *dst);
314
315/**
316 * @brief Create a symbolic link.
317 *
318 * @param src The name of the file to link.
319 * @param dest The name of link.
320 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
321 *
322 * This function create the symbolic link @p dest of @p src. This
323 * function does not work on Windows. It returns @c EINA_TRUE on success,
324 * @c EINA_FALSE otherwise.
325 */
132EAPI Eina_Bool ecore_file_symlink (const char *src, const char *dest); 326EAPI Eina_Bool ecore_file_symlink (const char *src, const char *dest);
327
328/**
329 * @brief Get the canonicalized absolute path name.
330 *
331 * @param file The file path.
332 * @return The canonicalized absolute pathname or an empty string on
333 * failure.
334 *
335 * This function returns the absolute path name of @p file as a newly
336 * allocated string. If @p file is @c NULL, or on error, this function
337 * returns an empty string. Otherwise, it returns the absolute path
338 * name. When not needed anymore, the returned value must be freed.
339 */
133EAPI char *ecore_file_realpath (const char *file); 340EAPI char *ecore_file_realpath (const char *file);
341
342/**
343 * @brief Delete the given file.
344 *
345 * @param file The name of the file to delete.
346 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
347 *
348 * This function deletes @p file. It returns @c EINA_TRUE on success,
349 * @c EINA_FALSE otherwise.
350 */
134EAPI Eina_Bool ecore_file_unlink (const char *file); 351EAPI Eina_Bool ecore_file_unlink (const char *file);
352
353/**
354 * @brief Remove the given file or directory.
355 *
356 * @param file The name of the file or directory to delete.
357 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
358 *
359 * This function removes @p file. It returns @c EINA_TRUE on success,
360 * @c EINA_FALSE otherwise.
361 */
135EAPI Eina_Bool ecore_file_remove (const char *file); 362EAPI Eina_Bool ecore_file_remove (const char *file);
363
364/**
365 * Get the filename from a given path.
366 *
367 * @param path The complete path.
368 * @return The file name.
369 *
370 * This function returns the file name of @p path. If @p path is
371 * @c NULL, the functions returns @c NULL.
372 */
136EAPI const char *ecore_file_file_get (const char *path); 373EAPI const char *ecore_file_file_get (const char *path);
374
375/**
376 * @brief Get the directory where the given file resides.
377 *
378 * @param file The name of the file.
379 * @return The directory name.
380 *
381 * This function returns the directory where @p file resides as anewly
382 * allocated string. If @p file is @c NULL or on error, this function
383 * returns @c NULL. When not needed anymore, the returned value must
384 * be freed.
385 */
137EAPI char *ecore_file_dir_get (const char *path); 386EAPI char *ecore_file_dir_get (const char *path);
387
388/**
389 * @brief Check if the given file can be read.
390 *
391 * @param file The name of the file.
392 * @return @c EINA_TRUE if the @p file is readable, @c EINA_FALSE otherwise.
393 *
394 * This function returns @c EINA_TRUE if @p file can be read, @c EINA_FALSE
395 * otherwise.
396 */
138EAPI Eina_Bool ecore_file_can_read (const char *file); 397EAPI Eina_Bool ecore_file_can_read (const char *file);
398
399/**
400 * @brief Check if the given file can be written.
401 *
402 * @param file The name of the file.
403 * @return @c EINA_TRUE if the @p file is writable, @c EINA_FALSE otherwise.
404 *
405 * This function returns @c EINA_TRUE if @p file can be written, @c EINA_FALSE
406 * otherwise.
407 */
139EAPI Eina_Bool ecore_file_can_write (const char *file); 408EAPI Eina_Bool ecore_file_can_write (const char *file);
409
410/**
411 * @brief Check if the given file can be executed.
412 *
413 * @param file The name of the file.
414 * @return @c EINA_TRUE if the @p file can be executed, @c EINA_FALSE
415 * otherwise.
416 *
417 * This function returns @c EINA_TRUE if @p file can be executed, @c EINA_FALSE
418 * otherwise.
419 */
140EAPI Eina_Bool ecore_file_can_exec (const char *file); 420EAPI Eina_Bool ecore_file_can_exec (const char *file);
421
422/**
423 * @brief Get the path pointed by the given link.
424 *
425 * @param lnk The name of the link.
426 * @return The path pointed by link or NULL.
427 *
428 * This function returns the path pointed by @p link as a newly
429 * allocated string. This function does not work on Windows. On
430 * failure, the function returns @c NULL. When not needed anymore, the
431 * returned value must be freed.
432 */
141EAPI char *ecore_file_readlink (const char *link); 433EAPI char *ecore_file_readlink (const char *link);
434
435/**
436 * @brief Get the list of the files and directories in the given
437 * directory.
438 *
439 * @param dir The name of the directory to list
440 * @return Return an Eina_List containing all the files in the directory;
441 * on failure it returns NULL.
442 *
443 * This function returns a list of allocated strings of all the files
444 * and directories contained in @p dir. The list will be sorted with
445 * strcoll as compare function. That means that you may want to set
446 * the current locale for the category LC_COLLATE with
447 * setlocale(). For more information see the manual pages of strcoll
448 * and setlocale. The list will not contain the directory entries for
449 * '.' and '..'. On failure, @c NULL is returned. When not needed
450 * anymore, the list elements must be freed.
451 */
142EAPI Eina_List *ecore_file_ls (const char *dir); 452EAPI Eina_List *ecore_file_ls (const char *dir);
453
454/**
455 * @brief Return the executable from the given command.
456 *
457 * @param app The application command, with parameters.
458 * @return The executable from @p app as a newly allocated string. Arguments
459 * are removed and escape characters are handled. If @p app is @c NULL, or
460 * on failure, the function returns @c NULL. When not needed anymore, the
461 * returned value must be freed.
462 */
143EAPI char *ecore_file_app_exe_get (const char *app); 463EAPI char *ecore_file_app_exe_get (const char *app);
464
465/**
466 * @brief Add the escape sequence ('\\') to the given file name.
467 *
468 * @param filename The file name.
469 * @return The file name with special characters escaped.
470 *
471 * This function adds the escape sequence ('\\') to the given file
472 * name and returns the result as a newly allocated string. If the
473 * length of the returned string is longer than PATH_MAX, or on
474 * failure, @c NULL is returned. When not needed anymore, the returned
475 * value must be freed.
476 */
144EAPI char *ecore_file_escape_name (const char *filename); 477EAPI char *ecore_file_escape_name (const char *filename);
478
479/**
480 * @brief Remove the extension from the given file name.
481 *
482 * @param path The name of the file.
483 * @return A newly allocated string with the extension stripped out or
484 * @c NULL on errors.
485 *
486 * This function removes the extension from @p path and returns the
487 * result as a newly allocated string. If @p path is @c NULL, or on
488 * failure, the function returns @c NULL. When not needed anymore, the
489 * returned value must be freed.
490 */
145EAPI char *ecore_file_strip_ext (const char *file); 491EAPI char *ecore_file_strip_ext (const char *file);
492
493/**
494 * @brief Check if the given directory is empty.
495 *
496 * @param dir The name of the directory to check.
497 * @return @c 1 if directory is empty, @c 0 if it has at least one file or
498 * @c -1 in case of errors.
499 *
500 * This functions checks if @p dir is empty. The '.' and '..' files
501 * will be ignored. If @p dir is empty, 1 is returned, if it contains
502 * at least one file, @c 0 is returned. On failure, @c -1 is returned.
503 */
146EAPI int ecore_file_dir_is_empty (const char *dir); 504EAPI int ecore_file_dir_is_empty (const char *dir);
147 505
148/* Monitoring */ 506/* Monitoring */
149 507
508/**
509 * @brief Monitor the given path using inotify, Windows notification, or polling.
510 *
511 * @param path The path to monitor.
512 * @param func The function to call on changes.
513 * @param data The data passed to func.
514 * @return An Ecore_File_Monitor pointer or NULL on failure.
515 *
516 * This function monitors @p path. If @p path is @c NULL, or is an
517 * empty string, or none of the notify methods (Inotify, Windows
518 * notification or polling) is available, or if @p path does not exist
519 * the function returns @c NULL. Otherwise, it returns a newly
520 * allocated Ecore_File_Monitor object and the monitoring begins.
521 * When one of the Ecore_File_Event event is notified, @p func is called
522 * and @p data is passed to @p func.Call ecore_file_monitor_del() to
523 * stop the monitoring.
524 */
150EAPI Ecore_File_Monitor *ecore_file_monitor_add(const char *path, 525EAPI Ecore_File_Monitor *ecore_file_monitor_add(const char *path,
151 Ecore_File_Monitor_Cb func, 526 Ecore_File_Monitor_Cb func,
152 void *data); 527 void *data);
528
529/**
530 * @brief Stop the monitoring of the given path.
531 *
532 * @param em The Ecore_File_Monitor to stop.
533 *
534 * This function stops the the monitoring of the path that has been
535 * monitored by ecore_file_monitor_add(). @p em must be the value
536 * returned by ecore_file_monitor_add(). If @p em is @c NULL, or none
537 * of the notify methods (Inotify, Windows notification or polling) is
538 * availablethis function does nothing.
539 */
153EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor); 540EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor);
541
542/**
543 * @brief Get the monitored path.
544 *
545 * @param em The Ecore_File_Monitor to query.
546 * @return The path that is monitored by @p em.
547 *
548 * This function returns the monitored path that has been
549 * monitored by ecore_file_monitor_add(). @p em must be the value
550 * returned by ecore_file_monitor_add(). If @p em is @c NULL, the
551 * function returns @c NULL.
552 */
154EAPI const char *ecore_file_monitor_path_get(Ecore_File_Monitor *ecore_file_monitor); 553EAPI const char *ecore_file_monitor_path_get(Ecore_File_Monitor *ecore_file_monitor);
155 554
156/* Path */ 555/* Path */
157 556
557/**
558 * @brief Check if the given directory is in PATH.
559 *
560 * @param in_dir The name of the directory to search in PATH.
561 * @return @c EINA_TRUE if the directory exist in PATH, @c EINA_FALSE otherwise.
562 *
563 * This function checks if @p in_dir is in the environment variable
564 * PATH. If @p in_dir is @c NULL, or if PATH is empty, or @p in_dir is
565 * not in PATH, the function returns @c EINA_FALSE, otherwise it returns
566 * @c EINA_TRUE.
567 */
158EAPI Eina_Bool ecore_file_path_dir_exists(const char *in_dir); 568EAPI Eina_Bool ecore_file_path_dir_exists(const char *in_dir);
569
570/**
571 * @brief Check if the given application is installed.
572 *
573 * @param exe The name of the application
574 * @return @c EINA_TRUE if the @p exe is in PATH and is executable,
575 * @c EINA_FALSE otherwise.
576 *
577 * This function checks if @p exe exists in PATH and is executable. If
578 * @p exe is @c NULL or is not executable, the function returns
579 * @c EINA_FALSE, otherwise it returns @c EINA_TRUE.
580 */
159EAPI Eina_Bool ecore_file_app_installed(const char *exe); 581EAPI Eina_Bool ecore_file_app_installed(const char *exe);
582
583/**
584 * @brief Get a list of all the applications installed on the system.
585 *
586 * @return An Eina_List containing all the executable files in the
587 * system.
588 *
589 * This function returns a list of allocated strings of all the
590 * executable files. If no files are found, the function returns
591 * @c NULL. When not needed anymore, the element of the list must be
592 * freed.
593 */
160EAPI Eina_List *ecore_file_app_list(void); 594EAPI Eina_List *ecore_file_app_list(void);
161 595
162/* Download */ 596/* Download */
163 597
598/**
599 * @brief Download the given url to the given destination.
600 *
601 * @param url The complete url to download.
602 * @param dst The local file to save the downloaded to.
603 * @param completion_cb A callback called on download complete.
604 * @param progress_cb A callback called during the download operation.
605 * @param data User data passed to both callbacks.
606 * @param job_ret Job used to abort the download.
607 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure.
608 *
609 * This function starts the download of the URL @p url and saves it to
610 * @p dst. @p url must provide the protocol, including 'http://',
611 * 'ftp://' or 'file://'. Ecore_File must be compiled with CURL to
612 * download using http and ftp protocols. If @p dst is ill-formed, or
613 * if it already exists, the function returns @c EINA_FALSE. When the
614 * download is complete, the callback @p completion_cb is called and
615 * @p data is passed to it. The @p status parameter of @p completion_cb
616 * will be filled with the status of the download (200, 404,...). The
617 * @p progress_cb is called during the download operation, each time a
618 * packet is received or when CURL wants. It can be used to display the
619 * percentage of the downloaded file. Return 0 from this callback, if provided,
620 * to continue the operation or anything else to abort the download. The only
621 * operations that can be aborted are those with protocol 'http' or 'ftp'. In
622 * that case @p job_ret can be passed to ecore_file_download_abort() to abort
623 * that download job. Similarly ecore_file_download_abort_all() can be used to
624 * abort all download operations. This function returns @c EINA_TRUE if the
625 * download starts, @c EINA_FALSE otherwise.
626 */
164EAPI Eina_Bool ecore_file_download(const char *url, 627EAPI Eina_Bool ecore_file_download(const char *url,
165 const char *dst, 628 const char *dst,
166 Ecore_File_Download_Completion_Cb completion_cb, 629 Ecore_File_Download_Completion_Cb completion_cb,
167 Ecore_File_Download_Progress_Cb progress_cb, 630 Ecore_File_Download_Progress_Cb progress_cb,
168 void *data, 631 void *data,
169 Ecore_File_Download_Job **job_ret); 632 Ecore_File_Download_Job **job_ret);
633
634/**
635 * @brief Download the given url to the given destination with additional headers.
636 *
637 * @param url The complete url to download.
638 * @param dst The local file to save the downloaded to.
639 * @param completion_cb A callback called on download complete.
640 * @param progress_cb A callback called during the download operation.
641 * @param data User data passed to both callbacks.
642 * @param job_ret Job used to abort the download.
643 * @param headers pointer of header lists.
644 * @return @c EINA_TRUE if the download start or @c EINA_FALSE on failure.
645 */
170EAPI Eina_Bool ecore_file_download_full(const char *url, 646EAPI Eina_Bool ecore_file_download_full(const char *url,
171 const char *dst, 647 const char *dst,
172 Ecore_File_Download_Completion_Cb completion_cb, 648 Ecore_File_Download_Completion_Cb completion_cb,
@@ -175,8 +651,41 @@ EAPI Eina_Bool ecore_file_download_full(const char *url,
175 Ecore_File_Download_Job **job_ret, 651 Ecore_File_Download_Job **job_ret,
176 Eina_Hash *headers); 652 Eina_Hash *headers);
177 653
654/**
655 * @brief Abort all downloads.
656 *
657 * This function aborts all the downloads that have been started by
658 * ecore_file_download(). It loops over the started downloads and call
659 * ecore_file_download_abort() for each of them. To abort only one
660 * specific download operation, call ecore_file_download_abort().
661 */
178EAPI void ecore_file_download_abort_all(void); 662EAPI void ecore_file_download_abort_all(void);
663
664/**
665 * @brief Abort the given download job and call the completion_cb
666 * callbck with a status of 1 (error).
667 *
668 * @param job The download job to abort.
669 *
670 * This function aborts a download operation started by
671 * ecore_file_download(). @p job is the #Ecore_File_Download_Job
672 * structure filled by ecore_file_download(). If it is @c NULL, this
673 * function does nothing. To abort all the currently downloading
674 * operations, call ecore_file_download_abort_all().
675 */
179EAPI void ecore_file_download_abort(Ecore_File_Download_Job *job); 676EAPI void ecore_file_download_abort(Ecore_File_Download_Job *job);
677
678/**
679 * @brief Check if the given protocol is available.
680 *
681 * @param protocol The protocol to check.
682 * @return @c EINA_TRUE if protocol is handled, @c EINA_FALSE otherwise.
683 *
684 * This function returns @c EINA_TRUE if @p protocol is supported,
685 * @c EINA_FALSE otherwise. @p protocol can be 'http://', 'ftp://' or
686 * 'file://'. Ecore_FILE must be compiled with CURL to handle http and
687 * ftp protocols.
688 */
180EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol); 689EAPI Eina_Bool ecore_file_download_protocol_available(const char *protocol);
181 690
182/** 691/**
diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 7a44680ba9..11c03c46d1 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -81,27 +81,6 @@ _ecore_file_stat(const char *file,
81 return EINA_TRUE; 81 return EINA_TRUE;
82} 82}
83 83
84/* externally accessible functions */
85
86/**
87 * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions
88 *
89 * @{
90 */
91
92/**
93 * @brief Initialize the Ecore_File library.
94 *
95 * @return 1 or greater on success, 0 on error.
96 *
97 * This function sets up Ecore_File and the services it will use
98 * (monitoring, downloading, PATH related feature). It returns 0 on
99 * failure, otherwise it returns the number of times it has already
100 * been called.
101 *
102 * When Ecore_File is not used anymore, call ecore_file_shutdown()
103 * to shut down the Ecore_File library.
104 */
105EAPI int 84EAPI int
106ecore_file_init() 85ecore_file_init()
107{ 86{
@@ -144,16 +123,6 @@ ecore_file_init()
144 */ 123 */
145} 124}
146 125
147/**
148 * @brief Shut down the Ecore_File library.
149 *
150 * @return 0 when the library is completely shut down, 1 or
151 * greater otherwise.
152 *
153 * This function shuts down the Ecore_File library. It returns 0 when it has
154 * been called the same number of times than ecore_file_init(). In that case
155 * it shuts down all the services it uses.
156 */
157EAPI int 126EAPI int
158ecore_file_shutdown() 127ecore_file_shutdown()
159{ 128{
@@ -172,16 +141,6 @@ ecore_file_shutdown()
172 return _ecore_file_init_count; 141 return _ecore_file_init_count;
173} 142}
174 143
175/**
176 * @brief Get the time of the last modification to the given file.
177 *
178 * @param file The name of the file.
179 * @return Return the time of the last data modification, or 0 on
180 * failure.
181 *
182 * This function returns the time of the last modification of
183 * @p file. On failure, it returns 0.
184 */
185EAPI long long 144EAPI long long
186ecore_file_mod_time(const char *file) 145ecore_file_mod_time(const char *file)
187{ 146{
@@ -193,15 +152,6 @@ ecore_file_mod_time(const char *file)
193 return time; 152 return time;
194} 153}
195 154
196/**
197 * @brief Get the size of the given file.
198 *
199 * @param file The name of the file.
200 * @return Return the size of the file in bytes, or 0 on failure.
201 *
202 * This function returns the size of @p file in bytes. On failure, it
203 * returns 0.
204 */
205EAPI long long 155EAPI long long
206ecore_file_size(const char *file) 156ecore_file_size(const char *file)
207{ 157{
@@ -213,15 +163,6 @@ ecore_file_size(const char *file)
213 return size; 163 return size;
214} 164}
215 165
216/**
217 * @brief Check if the given file exists.
218 *
219 * @param file The name of the file.
220 * @return @c EINA_TRUE if the @p file exists, @c EINA_FALSE otherwise.
221 *
222 * This function returns @c EINA_TRUE if @p file exists on local filesystem,
223 * @c EINA_FALSE otherwise.
224 */
225EAPI Eina_Bool 166EAPI Eina_Bool
226ecore_file_exists(const char *file) 167ecore_file_exists(const char *file)
227{ 168{
@@ -238,16 +179,6 @@ ecore_file_exists(const char *file)
238#endif 179#endif
239} 180}
240 181
241/**
242 * @brief Check if the given file is a directory.
243 *
244 * @param file The name of the file.
245 * @return @c EINA_TRUE if the file exists and is a directory, @c EINA_FALSE
246 * otherwise.
247 *
248 * This function returns @c EINA_TRUE if @p file exists exists and is a
249 * directory on local filesystem, @c EINA_FALSE otherwise.
250 */
251EAPI Eina_Bool 182EAPI Eina_Bool
252ecore_file_is_dir(const char *file) 183ecore_file_is_dir(const char *file)
253{ 184{
@@ -261,36 +192,12 @@ ecore_file_is_dir(const char *file)
261 192
262static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; 193static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
263 194
264/**
265 * @brief Create a new directory.
266 *
267 * @param dir The name of the directory to create
268 * @return @c EINA_TRUE on successful creation, @c EINA_FALSE otherwise.
269 *
270 * This function creates the directory @p dir, with the mode S_IRUSR |
271 * S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH on UNIX
272 * (mode is unsued on Windows). On success, it returns @c EINA_TRUE,
273 * @c EINA_FALSE otherwise.
274 */
275EAPI Eina_Bool 195EAPI Eina_Bool
276ecore_file_mkdir(const char *dir) 196ecore_file_mkdir(const char *dir)
277{ 197{
278 return (mkdir(dir, default_mode) == 0); 198 return (mkdir(dir, default_mode) == 0);
279} 199}
280 200
281/**
282 * @brief Create complete directory in a batch.
283 *
284 * @param dirs The list of directories, null terminated.
285 * @return The number of successful directories created, -1 if dirs is
286 * @c NULL.
287 *
288 * This function creates all the directories that are in the null
289 * terminated array @p dirs. The function loops over the directories
290 * and call ecore_file_mkdir(). This function returns -1 if @p dirs is
291 * @c NULL, otherwise if returns the number of suceesfully created
292 * directories.
293 */
294EAPI int 201EAPI int
295ecore_file_mkdirs(const char **dirs) 202ecore_file_mkdirs(const char **dirs)
296{ 203{
@@ -304,24 +211,6 @@ ecore_file_mkdirs(const char **dirs)
304 return i; 211 return i;
305} 212}
306 213
307/**
308 * @brief Create complete list of sub-directories in a batch (optimized).
309 *
310 * @param base The base directory to act on.
311 * @param subdirs The list of directories, null terminated.
312 * @return number of successful directories created, -1 on failure.
313 *
314 * This function creates all the directories that are in the null
315 * terminated array @p subdirs in the @p base directory. If @p base does
316 * not exist, it will be created. The function loops over the directories
317 * and call ecore_file_mkdir(). The whole path of the directories must
318 * exist. So if base/a/b/c wants to be created, @p subdirs must
319 * contain "a", "a/b" and "a/b/c", in that order. This function
320 * returns -1 if @p subdirs or @p base are @c NULL, or if @p base is
321 * empty ("\0"). It returns 0 is @p base is not a directory or
322 * invalid, or if it can't be created. Otherwise if returns the number
323 * of suceesfully created directories.
324 */
325EAPI int 214EAPI int
326ecore_file_mksubdirs(const char *base, const char **subdirs) 215ecore_file_mksubdirs(const char *base, const char **subdirs)
327{ 216{
@@ -404,15 +293,6 @@ ecore_file_mksubdirs(const char *base, const char **subdirs)
404 return i; 293 return i;
405} 294}
406 295
407/**
408 * @brief Delete the given directory.
409 *
410 * @param dir The name of the directory to delete.
411 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
412 *
413 * This function deletes @p dir. It returns @c EINA_TRUE on success,
414 * @c EINA_FALSE otherwise.
415 */
416EAPI Eina_Bool 296EAPI Eina_Bool
417ecore_file_rmdir(const char *dir) 297ecore_file_rmdir(const char *dir)
418{ 298{
@@ -420,15 +300,6 @@ ecore_file_rmdir(const char *dir)
420 return EINA_TRUE; 300 return EINA_TRUE;
421} 301}
422 302
423/**
424 * @brief Delete the given file.
425 *
426 * @param file The name of the file to delete.
427 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
428 *
429 * This function deletes @p file. It returns @c EINA_TRUE on success,
430 * @c EINA_FALSE otherwise.
431 */
432EAPI Eina_Bool 303EAPI Eina_Bool
433ecore_file_unlink(const char *file) 304ecore_file_unlink(const char *file)
434{ 305{
@@ -436,15 +307,6 @@ ecore_file_unlink(const char *file)
436 return EINA_TRUE; 307 return EINA_TRUE;
437} 308}
438 309
439/**
440 * @brief Remove the given file or directory.
441 *
442 * @param file The name of the file or directory to delete.
443 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
444 *
445 * This function removes @p file. It returns @c EINA_TRUE on success,
446 * @c EINA_FALSE otherwise.
447 */
448EAPI Eina_Bool 310EAPI Eina_Bool
449ecore_file_remove(const char *file) 311ecore_file_remove(const char *file)
450{ 312{
@@ -452,16 +314,6 @@ ecore_file_remove(const char *file)
452 return EINA_TRUE; 314 return EINA_TRUE;
453} 315}
454 316
455/**
456 * @brief Delete the given directory and all its contents.
457 *
458 * @param dir The name of the directory to delete.
459 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
460 *
461 * This function delete @p dir and all its contents. If @p dir is a
462 * link only the link is removed. It returns @c EINA_TRUE on success,
463 * @c EINA_FALSE otherwise.
464 */
465EAPI Eina_Bool 317EAPI Eina_Bool
466ecore_file_recursive_rm(const char *dir) 318ecore_file_recursive_rm(const char *dir)
467{ 319{
@@ -532,17 +384,6 @@ _ecore_file_mkpath_if_not_exists(const char *path)
532 return EINA_TRUE; 384 return EINA_TRUE;
533} 385}
534 386
535/**
536 * @brief Create a complete path.
537 *
538 * @param path The path to create
539 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
540 *
541 * This function creates @p path and all the subdirectories it
542 * contains. The separator is '/' or '\'. If @p path exists, this
543 * function returns @c EINA_TRUE immediately. It returns @c EINA_TRUE on
544 * success, @c EINA_FALSE otherwise.
545 */
546EAPI Eina_Bool 387EAPI Eina_Bool
547ecore_file_mkpath(const char *path) 388ecore_file_mkpath(const char *path)
548{ 389{
@@ -568,19 +409,6 @@ ecore_file_mkpath(const char *path)
568 return _ecore_file_mkpath_if_not_exists(ss); 409 return _ecore_file_mkpath_if_not_exists(ss);
569} 410}
570 411
571/**
572 * @brief Create complete paths in a batch.
573 *
574 * @param paths list of paths, null terminated.
575 * @return number of successful paths created, -1 if paths is NULL.
576 *
577 * This function creates all the directories that are in the null
578 * terminated array @p paths. The function loops over the directories
579 * and call ecore_file_mkpath(), hence on Windows, '\' must be
580 * replaced by '/' before calling that function. This function
581 * returns -1 if @p paths is @c NULL. Otherwise if returns the number
582 * of suceesfully created directories.
583 */
584EAPI int 412EAPI int
585ecore_file_mkpaths(const char **paths) 413ecore_file_mkpaths(const char **paths)
586{ 414{
@@ -594,18 +422,6 @@ ecore_file_mkpaths(const char **paths)
594 return i; 422 return i;
595} 423}
596 424
597/**
598 * @brief Copy the given file to the given destination.
599 *
600 * @param src The name of the source file.
601 * @param dst The name of the destination file.
602 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
603 *
604 * This function copies @p src to @p dst. If the absolute path name of
605 * @p src and @p dst can not be computed, or if they are equal, or if
606 * the copy fails, the function returns @c EINA_FALSE, otherwise it
607 * returns @c EINA_TRUE.
608 */
609EAPI Eina_Bool 425EAPI Eina_Bool
610ecore_file_cp(const char *src, const char *dst) 426ecore_file_cp(const char *src, const char *dst)
611{ 427{
@@ -635,16 +451,6 @@ ecore_file_cp(const char *src, const char *dst)
635 return ret; 451 return ret;
636} 452}
637 453
638/**
639 * @brief Move the given file to the given destination.
640 *
641 * @param src The name of the source file.
642 * @param dst The name of the destination file.
643 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
644 *
645 * This function moves @p src to @p dst. It returns @c EINA_TRUE on
646 * success, @c EINA_FALSE otherwise.
647 */
648EAPI Eina_Bool 454EAPI Eina_Bool
649ecore_file_mv(const char *src, const char *dst) 455ecore_file_mv(const char *src, const char *dst)
650{ 456{
@@ -711,17 +517,6 @@ FAIL:
711 return EINA_FALSE; 517 return EINA_FALSE;
712} 518}
713 519
714/**
715 * @brief Create a symbolic link.
716 *
717 * @param src The name of the file to link.
718 * @param dest The name of link.
719 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
720 *
721 * This function create the symbolic link @p dest of @p src. This
722 * function does not work on Windows. It returns @c EINA_TRUE on success,
723 * @c EINA_FALSE otherwise.
724 */
725EAPI Eina_Bool 520EAPI Eina_Bool
726ecore_file_symlink(const char *src, const char *dest) 521ecore_file_symlink(const char *src, const char *dest)
727{ 522{
@@ -730,18 +525,6 @@ ecore_file_symlink(const char *src, const char *dest)
730 return EINA_FALSE; 525 return EINA_FALSE;
731} 526}
732 527
733/**
734 * @brief Get the canonicalized absolute path name.
735 *
736 * @param file The file path.
737 * @return The canonicalized absolute pathname or an empty string on
738 * failure.
739 *
740 * This function returns the absolute path name of @p file as a newly
741 * allocated string. If @p file is @c NULL, or on error, this function
742 * returns an empty string. Otherwise, it returns the absolute path
743 * name. When not needed anymore, the returned value must be freed.
744 */
745EAPI char * 528EAPI char *
746ecore_file_realpath(const char *file) 529ecore_file_realpath(const char *file)
747{ 530{
@@ -757,15 +540,6 @@ ecore_file_realpath(const char *file)
757 return strdup(buf); 540 return strdup(buf);
758} 541}
759 542
760/**
761 * Get the filename from a given path.
762 *
763 * @param path The complete path.
764 * @return The file name.
765 *
766 * This function returns the file name of @p path. If @p path is
767 * @c NULL, the functions returns @c NULL.
768 */
769EAPI const char * 543EAPI const char *
770ecore_file_file_get(const char *path) 544ecore_file_file_get(const char *path)
771{ 545{
@@ -791,17 +565,6 @@ ecore_file_file_get(const char *path)
791 return result; 565 return result;
792} 566}
793 567
794/**
795 * @brief Get the directory where the given file resides.
796 *
797 * @param file The name of the file.
798 * @return The directory name.
799 *
800 * This function returns the directory where @p file resides as anewly
801 * allocated string. If @p file is @c NULL or on error, this function
802 * returns @c NULL. When not needed anymore, the returned value must
803 * be freed.
804 */
805EAPI char * 568EAPI char *
806ecore_file_dir_get(const char *file) 569ecore_file_dir_get(const char *file)
807{ 570{
@@ -815,15 +578,6 @@ ecore_file_dir_get(const char *file)
815 return strdup(p); 578 return strdup(p);
816} 579}
817 580
818/**
819 * @brief Check if the given file can be read.
820 *
821 * @param file The name of the file.
822 * @return @c EINA_TRUE if the @p file is readable, @c EINA_FALSE otherwise.
823 *
824 * This function returns @c EINA_TRUE if @p file can be read, @c EINA_FALSE
825 * otherwise.
826 */
827EAPI Eina_Bool 581EAPI Eina_Bool
828ecore_file_can_read(const char *file) 582ecore_file_can_read(const char *file)
829{ 583{
@@ -832,15 +586,6 @@ ecore_file_can_read(const char *file)
832 return EINA_FALSE; 586 return EINA_FALSE;
833} 587}
834 588
835/**
836 * @brief Check if the given file can be written.
837 *
838 * @param file The name of the file.
839 * @return @c EINA_TRUE if the @p file is writable, @c EINA_FALSE otherwise.
840 *
841 * This function returns @c EINA_TRUE if @p file can be written, @c EINA_FALSE
842 * otherwise.
843 */
844EAPI Eina_Bool 589EAPI Eina_Bool
845ecore_file_can_write(const char *file) 590ecore_file_can_write(const char *file)
846{ 591{
@@ -849,16 +594,6 @@ ecore_file_can_write(const char *file)
849 return EINA_FALSE; 594 return EINA_FALSE;
850} 595}
851 596
852/**
853 * @brief Check if the given file can be executed.
854 *
855 * @param file The name of the file.
856 * @return @c EINA_TRUE if the @p file can be executed, @c EINA_FALSE
857 * otherwise.
858 *
859 * This function returns @c EINA_TRUE if @p file can be executed, @c EINA_FALSE
860 * otherwise.
861 */
862EAPI Eina_Bool 597EAPI Eina_Bool
863ecore_file_can_exec(const char *file) 598ecore_file_can_exec(const char *file)
864{ 599{
@@ -867,17 +602,6 @@ ecore_file_can_exec(const char *file)
867 return EINA_FALSE; 602 return EINA_FALSE;
868} 603}
869 604
870/**
871 * @brief Get the path pointed by the given link.
872 *
873 * @param lnk The name of the link.
874 * @return The path pointed by link or NULL.
875 *
876 * This function returns the path pointed by @p link as a newly
877 * allocated string. This function does not work on Windows. On
878 * failure, the function returns @c NULL. When not needed anymore, the
879 * returned value must be freed.
880 */
881EAPI char * 605EAPI char *
882ecore_file_readlink(const char *lnk) 606ecore_file_readlink(const char *lnk)
883{ 607{
@@ -889,23 +613,6 @@ ecore_file_readlink(const char *lnk)
889 return strdup(buf); 613 return strdup(buf);
890} 614}
891 615
892/**
893 * @brief Get the list of the files and directories in the given
894 * directory.
895 *
896 * @param dir The name of the directory to list
897 * @return Return an Eina_List containing all the files in the directory;
898 * on failure it returns NULL.
899 *
900 * This function returns a list of allocated strings of all the files
901 * and directories contained in @p dir. The list will be sorted with
902 * strcoll as compare function. That means that you may want to set
903 * the current locale for the category LC_COLLATE with
904 * setlocale(). For more information see the manual pages of strcoll
905 * and setlocale. The list will not contain the directory entries for
906 * '.' and '..'. On failure, @c NULL is returned. When not needed
907 * anymore, the list elements must be freed.
908 */
909EAPI Eina_List * 616EAPI Eina_List *
910ecore_file_ls(const char *dir) 617ecore_file_ls(const char *dir)
911{ 618{
@@ -930,15 +637,6 @@ ecore_file_ls(const char *dir)
930 return list; 637 return list;
931} 638}
932 639
933/**
934 * @brief Return the executable from the given command.
935 *
936 * @param app The application command, with parameters.
937 * @return The executable from @p app as a newly allocated string. Arguments
938 * are removed and escape characters are handled. If @p app is @c NULL, or
939 * on failure, the function returns @c NULL. When not needed anymore, the
940 * returned value must be freed.
941 */
942EAPI char * 640EAPI char *
943ecore_file_app_exe_get(const char *app) 641ecore_file_app_exe_get(const char *app)
944{ 642{
@@ -1001,18 +699,6 @@ ecore_file_app_exe_get(const char *app)
1001 return exe; 699 return exe;
1002} 700}
1003 701
1004/**
1005 * @brief Add the escape sequence ('\\') to the given file name.
1006 *
1007 * @param filename The file name.
1008 * @return The file name with special characters escaped.
1009 *
1010 * This function adds the escape sequence ('\\') to the given file
1011 * name and returns the result as a newly allocated string. If the
1012 * length of the returned string is longer than PATH_MAX, or on
1013 * failure, @c NULL is returned. When not needed anymore, the returned
1014 * value must be freed.
1015 */
1016EAPI char * 702EAPI char *
1017ecore_file_escape_name(const char *filename) 703ecore_file_escape_name(const char *filename)
1018{ 704{
@@ -1071,18 +757,6 @@ ecore_file_escape_name(const char *filename)
1071 return strdup(buf); 757 return strdup(buf);
1072} 758}
1073 759
1074/**
1075 * @brief Remove the extension from the given file name.
1076 *
1077 * @param path The name of the file.
1078 * @return A newly allocated string with the extension stripped out or
1079 * @c NULL on errors.
1080 *
1081 * This function removes the extension from @p path and returns the
1082 * result as a newly allocated string. If @p path is @c NULL, or on
1083 * failure, the function returns @c NULL. When not needed anymore, the
1084 * returned value must be freed.
1085 */
1086EAPI char * 760EAPI char *
1087ecore_file_strip_ext(const char *path) 761ecore_file_strip_ext(const char *path)
1088{ 762{
@@ -1107,17 +781,6 @@ ecore_file_strip_ext(const char *path)
1107 return file; 781 return file;
1108} 782}
1109 783
1110/**
1111 * @brief Check if the given directory is empty.
1112 *
1113 * @param dir The name of the directory to check.
1114 * @return @c 1 if directory is empty, @c 0 if it has at least one file or
1115 * @c -1 in case of errors.
1116 *
1117 * This functions checks if @p dir is empty. The '.' and '..' files
1118 * will be ignored. If @p dir is empty, 1 is returned, if it contains
1119 * at least one file, @c 0 is returned. On failure, @c -1 is returned.
1120 */
1121EAPI int 784EAPI int
1122ecore_file_dir_is_empty(const char *dir) 785ecore_file_dir_is_empty(const char *dir)
1123{ 786{
@@ -1136,7 +799,3 @@ ecore_file_dir_is_empty(const char *dir)
1136 eina_iterator_free(it); 799 eina_iterator_free(it);
1137 return 1; 800 return 1;
1138} 801}
1139
1140/**
1141 * @}
1142 */
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 */
diff --git a/src/lib/ecore_file/ecore_file_monitor.c b/src/lib/ecore_file/ecore_file_monitor.c
index 7b4f625534..3fb839b2eb 100644
--- a/src/lib/ecore_file/ecore_file_monitor.c
+++ b/src/lib/ecore_file/ecore_file_monitor.c
@@ -18,29 +18,6 @@ ecore_file_monitor_shutdown(void)
18 ecore_file_monitor_backend_shutdown(); 18 ecore_file_monitor_backend_shutdown();
19} 19}
20 20
21/**
22 * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions
23 *
24 * @{
25 */
26
27/**
28 * @brief Monitor the given path using inotify, Windows notification, or polling.
29 *
30 * @param path The path to monitor.
31 * @param func The function to call on changes.
32 * @param data The data passed to func.
33 * @return An Ecore_File_Monitor pointer or NULL on failure.
34 *
35 * This function monitors @p path. If @p path is @c NULL, or is an
36 * empty string, or none of the notify methods (Inotify, Windows
37 * notification or polling) is available, or if @p path does not exist
38 * the function returns @c NULL. Otherwise, it returns a newly
39 * allocated Ecore_File_Monitor object and the monitoring begins.
40 * When one of the Ecore_File_Event event is notified, @p func is called
41 * and @p data is passed to @p func.Call ecore_file_monitor_del() to
42 * stop the monitoring.
43 */
44EAPI Ecore_File_Monitor * 21EAPI Ecore_File_Monitor *
45ecore_file_monitor_add(const char *path, 22ecore_file_monitor_add(const char *path,
46 Ecore_File_Monitor_Cb func, 23 Ecore_File_Monitor_Cb func,
@@ -53,17 +30,6 @@ ecore_file_monitor_add(const char *path,
53 return ecore_file_monitor_backend_add(path, func, data); 30 return ecore_file_monitor_backend_add(path, func, data);
54} 31}
55 32
56/**
57 * @brief Stop the monitoring of the given path.
58 *
59 * @param em The Ecore_File_Monitor to stop.
60 *
61 * This function stops the the monitoring of the path that has been
62 * monitored by ecore_file_monitor_add(). @p em must be the value
63 * returned by ecore_file_monitor_add(). If @p em is @c NULL, or none
64 * of the notify methods (Inotify, Windows notification or polling) is
65 * availablethis function does nothing.
66 */
67EAPI void 33EAPI void
68ecore_file_monitor_del(Ecore_File_Monitor *em) 34ecore_file_monitor_del(Ecore_File_Monitor *em)
69{ 35{
@@ -72,24 +38,9 @@ ecore_file_monitor_del(Ecore_File_Monitor *em)
72 ecore_file_monitor_backend_del(em); 38 ecore_file_monitor_backend_del(em);
73} 39}
74 40
75/**
76 * @brief Get the monitored path.
77 *
78 * @param em The Ecore_File_Monitor to query.
79 * @return The path that is monitored by @p em.
80 *
81 * This function returns the monitored path that has been
82 * monitored by ecore_file_monitor_add(). @p em must be the value
83 * returned by ecore_file_monitor_add(). If @p em is @c NULL, the
84 * function returns @c NULL.
85 */
86EAPI const char * 41EAPI const char *
87ecore_file_monitor_path_get(Ecore_File_Monitor *em) 42ecore_file_monitor_path_get(Ecore_File_Monitor *em)
88{ 43{
89 EINA_SAFETY_ON_NULL_RETURN_VAL(em, NULL); 44 EINA_SAFETY_ON_NULL_RETURN_VAL(em, NULL);
90 return em->path; 45 return em->path;
91} 46}
92
93/**
94 * @}
95 */
diff --git a/src/lib/ecore_file/ecore_file_path.c b/src/lib/ecore_file/ecore_file_path.c
index 71fdb680ec..0c4e466ce5 100644
--- a/src/lib/ecore_file/ecore_file_path.c
+++ b/src/lib/ecore_file/ecore_file_path.c
@@ -68,23 +68,6 @@ _ecore_file_path_from_env(const char *env)
68 return path; 68 return path;
69} 69}
70 70
71/**
72 * @addtogroup Ecore_File_Group Ecore_File - Files and directories convenience functions
73 *
74 * @{
75 */
76
77/**
78 * @brief Check if the given directory is in PATH.
79 *
80 * @param in_dir The name of the directory to search in PATH.
81 * @return @c EINA_TRUE if the directory exist in PATH, @c EINA_FALSE otherwise.
82 *
83 * This function checks if @p in_dir is in the environment variable
84 * PATH. If @p in_dir is @c NULL, or if PATH is empty, or @p in_dir is
85 * not in PATH, the function returns @c EINA_FALSE, otherwise it returns
86 * @c EINA_TRUE.
87 */
88EAPI Eina_Bool 71EAPI Eina_Bool
89ecore_file_path_dir_exists(const char *in_dir) 72ecore_file_path_dir_exists(const char *in_dir)
90{ 73{
@@ -104,17 +87,6 @@ ecore_file_path_dir_exists(const char *in_dir)
104 return EINA_FALSE; 87 return EINA_FALSE;
105} 88}
106 89
107/**
108 * @brief Check if the given application is installed.
109 *
110 * @param exe The name of the application
111 * @return @c EINA_TRUE if the @p exe is in PATH and is executable,
112 * @c EINA_FALSE otherwise.
113 *
114 * This function checks if @p exe exists in PATH and is executable. If
115 * @p exe is @c NULL or is not executable, the function returns
116 * @c EINA_FALSE, otherwise it returns @c EINA_TRUE.
117 */
118EAPI Eina_Bool 90EAPI Eina_Bool
119ecore_file_app_installed(const char *exe) 91ecore_file_app_installed(const char *exe)
120{ 92{
@@ -135,17 +107,6 @@ ecore_file_app_installed(const char *exe)
135 return EINA_FALSE; 107 return EINA_FALSE;
136} 108}
137 109
138/**
139 * @brief Get a list of all the applications installed on the system.
140 *
141 * @return An Eina_List containing all the executable files in the
142 * system.
143 *
144 * This function returns a list of allocated strings of all the
145 * executable files. If no files are found, the function returns
146 * @c NULL. When not needed anymore, the element of the list must be
147 * freed.
148 */
149EAPI Eina_List * 110EAPI Eina_List *
150ecore_file_app_list(void) 111ecore_file_app_list(void)
151{ 112{
@@ -169,7 +130,3 @@ ecore_file_app_list(void)
169 130
170 return list; 131 return list;
171} 132}
172
173/**
174 * @}
175 */