On Thu, 28 Oct 2010, Enlightenment SVN wrote:
> Log: > * eio: add small helper. > > Author: cedric > Date: 2010-10-28 07:50:24 -0700 (Thu, 28 Oct 2010) > New Revision: 53962 > > Modified: > trunk/eio/src/lib/Eio.h trunk/eio/src/lib/eio_single.c > > Modified: trunk/eio/src/lib/Eio.h > =================================================================== > --- trunk/eio/src/lib/Eio.h 2010-10-28 14:48:25 UTC (rev 53961) > +++ trunk/eio/src/lib/Eio.h 2010-10-28 14:50:24 UTC (rev 53962) > @@ -66,9 +66,11 @@ > /** > * @defgroup Eio_Group Eio Reference API > * > - * @brief A brief description > + * @brief This are the core asynchronous input/output operation > * > - * A long description > + * All the function in this group do perform input/output operation > + * in a separated thread and use the infrastructure provided by > + * Ecore_Thread and Eina to work. > * > * @{ > */ > @@ -96,7 +98,7 @@ > > /** > * @typedef Eio_File > - *Generic asynchronous IO reference. > + * Generic asynchronous IO reference. > */ > typedef struct _Eio_File Eio_File; > > @@ -216,6 +218,27 @@ > * @} > */ > > +/** > + * @defgroup Eio_Helper Eio Reference helper API do not add the defgroup as it hides the functions Vincent > + * > + * @brief This are helper provided around core Eio API. > + * > + * This set of functions do provide helper to work around data > + * provided by Eio without the need to look at system header. > + * > + * @{ > + */ > + > +EAPI double eio_file_atime(const struct stat *stat); > +EAPI double eio_file_mtime(const struct stat *stat); > +EAPI long long eio_file_size(const struct stat *stat); > +EAPI Eina_Bool eio_file_is_dir(const struct stat *stat); > +EAPI Eina_Bool eio_file_is_lnk(const struct stat *stat); > + > +/** > + * @} > + */ > + > #ifdef __cplusplus > } > #endif > > Modified: trunk/eio/src/lib/eio_single.c > =================================================================== > --- trunk/eio/src/lib/eio_single.c 2010-10-28 14:48:25 UTC (rev 53961) > +++ trunk/eio/src/lib/eio_single.c 2010-10-28 14:50:24 UTC (rev 53962) > @@ -533,7 +533,86 @@ > return &c->common; > } > > +/** > + * @} > + */ > > /** > + * @defgroup Eio_Helper > + * > + * @{ > + */ > + > +/** > + * @brief Return last acces time to a file > + * @param stat The stat buffer as given by eio_file_stat callback. > + * @return last access time. > + * > + * This function return the st_atime field, last acces time, as double like > all EFL time call. > + */ > +EAPI double > +eio_file_atime(const struct stat *stat) > +{ > + if (!stat) return 0.0; > + return (double) stat->st_atime; > +} > + > +/** > + * @brief Return last modification time of a file > + * @param stat The stat buffer as given by eio_file_stat callback. > + * @return last modification time. > + * > + * This function return the st_mtime field, last modification time, as > double like all EFL time call. > + */ > +EAPI double > +eio_file_mtime(const struct stat *stat) > +{ > + if (!stat) return 0.0; > + return (double) stat->st_mtime; > +} > + > +/** > + * @brief Return file length. > + * @param stat The stat buffer as given by eio_file_stat callback. > + * @return the length of a file. > + * > + * This function is just an accessor to st_size and return the file length. > + */ > +EAPI long long > +eio_file_size(const struct stat *stat) > +{ > + if (!stat) return 0; > + return stat->st_size; > +} > + > +/** > + * @brief Return if path is a directory. > + * @param stat The stat buffer as given by eio_file_stat callback. > + * @return EINA_TRUE if the path is a directory. > + * > + * This function tell you if the stated path is a directory or not. > + */ > +EAPI Eina_Bool > +eio_file_is_dir(const struct stat *stat) > +{ > + if (!stat) return EINA_FALSE; > + return (S_ISDIR(stat->st_mode)) ? EINA_TRUE : EINA_FALSE; > +} > + > +/** > + * @brief Return if path is a length. > + * @param stat The stat buffer as given by eio_file_stat callback. > + * @return EINA_TRUE if the path is a length. > + * > + * This function tell you if the stated path is a length or not. > + */ > +EAPI Eina_Bool > +eio_file_is_lnk(const struct stat *stat) > +{ > + if (!stat) return EINA_FALSE; > + return (S_ISLNK(stat->st_mode)) ? EINA_TRUE : EINA_FALSE; > +} > + > +/** > * @} > */ > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel