* eio: inline accessor.

SVN revision: 53988
This commit is contained in:
Cedric BAIL 2010-10-29 12:58:04 +00:00
parent e0e6020902
commit 09d09fe0ce
3 changed files with 8 additions and 85 deletions

View File

@ -229,16 +229,18 @@ EAPI Eina_Bool eio_file_cancel(Eio_File *ls);
* @{
*/
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);
static inline double eio_file_atime(const struct stat *stat);
static inline double eio_file_mtime(const struct stat *stat);
static inline long long eio_file_size(const struct stat *stat);
static inline Eina_Bool eio_file_is_dir(const struct stat *stat);
static inline Eina_Bool eio_file_is_lnk(const struct stat *stat);
/**
* @}
*/
#include "eio_inline_helper.x"
#ifdef __cplusplus
}
#endif

View File

@ -6,7 +6,7 @@ AM_CFLAGS = @EIO_CFLAGS@
lib_LTLIBRARIES = libeio.la
includes_HEADERS = Eio.h
includes_HEADERS = Eio.h eio_inline_helper.x
includesdir = $(includedir)/eio-@VMAJ@
libeio_la_SOURCES = \

View File

@ -537,82 +537,3 @@ EAPI Eio_File *eio_file_chown(const char *path,
* @}
*/
/**
* @addtogroup 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;
}
/**
* @}
*/