From 600053d7a92182656a42297d2250302f4d7193fa Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 21 Oct 2010 05:03:23 +0000 Subject: [PATCH] [eio] improve documentation layout and add a tutorial for eio_dir_copy() SVN revision: 53704 --- legacy/eio/doc/Doxyfile | 6 +-- legacy/eio/doc/head.html | 4 +- legacy/eio/src/lib/Eio.h | 2 +- legacy/eio/src/lib/eio_dir.c | 83 ++++++++++++++++++++++++++++++++- legacy/eio/src/lib/eio_file.c | 2 +- legacy/eio/src/lib/eio_main.c | 2 +- legacy/eio/src/lib/eio_single.c | 2 +- 7 files changed, 90 insertions(+), 11 deletions(-) diff --git a/legacy/eio/doc/Doxyfile b/legacy/eio/doc/Doxyfile index 7dcf94cb38..cca8ae6aff 100644 --- a/legacy/eio/doc/Doxyfile +++ b/legacy/eio/doc/Doxyfile @@ -658,7 +658,7 @@ EXAMPLE_RECURSIVE = NO # directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = doc/img +IMAGE_PATH = img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -1009,7 +1009,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. @@ -1066,7 +1066,7 @@ FORMULA_TRANSPARENT = YES # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. -SEARCHENGINE = YES +SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client diff --git a/legacy/eio/doc/head.html b/legacy/eio/doc/head.html index 44a5551dbe..9d79cd26e4 100644 --- a/legacy/eio/doc/head.html +++ b/legacy/eio/doc/head.html @@ -47,9 +47,7 @@ diff --git a/legacy/eio/src/lib/Eio.h b/legacy/eio/src/lib/Eio.h index fdea98a53c..dcd23c8fd9 100644 --- a/legacy/eio/src/lib/Eio.h +++ b/legacy/eio/src/lib/Eio.h @@ -64,7 +64,7 @@ extern "C" { #endif /** - * @defgroup Eio_Group Asynchronous Inout/Output library + * @defgroup Eio_Group Eio Reference API * * @brief A brief description * diff --git a/legacy/eio/src/lib/eio_dir.c b/legacy/eio/src/lib/eio_dir.c index 37c5e99624..eca6acaeaa 100644 --- a/legacy/eio/src/lib/eio_dir.c +++ b/legacy/eio/src/lib/eio_dir.c @@ -16,6 +16,87 @@ * License along with this library; * if not, see . */ + +/** + * @page tutorial_dir_copy eio_dir_copy() tutorial + * + * To use eio_dir_copy(), you basically need the source and + * destination files (or directories), and set three callbacks: + * + * @li The notification callback, which allows you to know if a file or + * a directory is copied, and the progress of the copy. + * @li The end callback, which is called when the copy is finished. + * @li The error callback, which is called if an error occured. You + * can then retrieve the error type as an errno error. + * + * @warning It is the user's duty to provide the "right target". It + * means that copying to '.' will copy the content directly inside '.' + * and not in a subdirectory. + * + * Here is a simple example: + * + * @code + * #include + * #include + * + * static void + * _test_notify_cb(void *data, const Eio_Progress *info) + * { + * switch (info->op) + * { + * case EIO_FILE_COPY: + * printf("[%s] %f%%\n", info->dest, info->percent); + * break; + * case EIO_DIR_COPY: + * printf("global [%li/%li] %f%%\n", info->current, info->max, info->percent); + * break; + * } + * } + * + * static void + * _test_done_cb(void *data) + * { + * printf("copy done\n"); + * ecore_main_loop_quit(); + * } + * + * static void + * _test_error_cb(int error, void *data) + * { + * fprintf(stderr, "error: [%s]\n", strerror(error)); + * ecore_main_loop_quit(); + * } + * + * int + * main(int argc, char **argv) + * { + * Eio_File *cp; + * + * if (argc != 3) + * { + * fprintf(stderr, "eio_cp source_file destination_file\n"); + * return -1; + * } + * + * ecore_init(); + * eio_init(); + * + * cp = eio_dir_copy(argv[1], argv[2], + * _test_notify_cb, + * _test_done_cb, + * _test_error_cb, + * NULL); + * + * ecore_main_loop_begin(); + * + * eio_shutdown(); + * ecore_shutdown(); + * + * return 0; + * } + * @endcode + */ + #include "eio_private.h" #include "Eio.h" @@ -560,7 +641,7 @@ _eio_dir_rmrf_heavy(Ecore_Thread *thread, void *data) /** - * @addtogroup Eio_Group Asynchronous Inout/Output library + * @addtogroup Eio_Group Eio Reference API * * @{ */ diff --git a/legacy/eio/src/lib/eio_file.c b/legacy/eio/src/lib/eio_file.c index 87153c6dbc..14e60e0a32 100644 --- a/legacy/eio/src/lib/eio_file.c +++ b/legacy/eio/src/lib/eio_file.c @@ -513,7 +513,7 @@ eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy) *============================================================================*/ /** - * @addtogroup Eio_Group Asynchronous Inout/Output library + * @addtogroup Eio_Group Eio Reference API * * @{ */ diff --git a/legacy/eio/src/lib/eio_main.c b/legacy/eio/src/lib/eio_main.c index 088944e3da..62a287c55a 100644 --- a/legacy/eio/src/lib/eio_main.c +++ b/legacy/eio/src/lib/eio_main.c @@ -146,7 +146,7 @@ eio_direct_info_free(Eina_File_Direct_Info *data) *============================================================================*/ /** - * @addtogroup Eio_Group Asynchronous Inout/Output library + * @addtogroup Eio_Group Eio Reference API * * @{ */ diff --git a/legacy/eio/src/lib/eio_single.c b/legacy/eio/src/lib/eio_single.c index 9ce5fb4e77..a6a416d67d 100644 --- a/legacy/eio/src/lib/eio_single.c +++ b/legacy/eio/src/lib/eio_single.c @@ -325,7 +325,7 @@ eio_file_set(Eio_File *common, *============================================================================*/ /** - * @addtogroup Eio_Group Asynchronous Inout/Output library + * @addtogroup Eio_Group Eio Reference API * * @{ */