From 09d09fe0ce3386d7481f96f865f11542f619fb42 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 29 Oct 2010 12:58:04 +0000 Subject: [PATCH] * eio: inline accessor. SVN revision: 53988 --- legacy/eio/src/lib/Eio.h | 12 ++--- legacy/eio/src/lib/Makefile.am | 2 +- legacy/eio/src/lib/eio_single.c | 79 --------------------------------- 3 files changed, 8 insertions(+), 85 deletions(-) diff --git a/legacy/eio/src/lib/Eio.h b/legacy/eio/src/lib/Eio.h index 9645a75ba3..bb89f43ab6 100644 --- a/legacy/eio/src/lib/Eio.h +++ b/legacy/eio/src/lib/Eio.h @@ -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 diff --git a/legacy/eio/src/lib/Makefile.am b/legacy/eio/src/lib/Makefile.am index 2f1347a998..394abaaef8 100644 --- a/legacy/eio/src/lib/Makefile.am +++ b/legacy/eio/src/lib/Makefile.am @@ -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 = \ diff --git a/legacy/eio/src/lib/eio_single.c b/legacy/eio/src/lib/eio_single.c index 045ad7075d..3404361782 100644 --- a/legacy/eio/src/lib/eio_single.c +++ b/legacy/eio/src/lib/eio_single.c @@ -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; -} - -/** - * @} - */