summaryrefslogtreecommitdiff
path: root/legacy/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-10-29 12:58:04 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-10-29 12:58:04 +0000
commit09d09fe0ce3386d7481f96f865f11542f619fb42 (patch)
tree003b9dae045aac717abb75476813527893f6b635 /legacy/eio
parente0e60209028b5dbbd8a6367b580f49f1e9d83147 (diff)
* eio: inline accessor.
SVN revision: 53988
Diffstat (limited to 'legacy/eio')
-rw-r--r--legacy/eio/src/lib/Eio.h12
-rw-r--r--legacy/eio/src/lib/Makefile.am2
-rw-r--r--legacy/eio/src/lib/eio_single.c79
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);
229 * @{ 229 * @{
230 */ 230 */
231 231
232EAPI double eio_file_atime(const struct stat *stat); 232static inline double eio_file_atime(const struct stat *stat);
233EAPI double eio_file_mtime(const struct stat *stat); 233static inline double eio_file_mtime(const struct stat *stat);
234EAPI long long eio_file_size(const struct stat *stat); 234static inline long long eio_file_size(const struct stat *stat);
235EAPI Eina_Bool eio_file_is_dir(const struct stat *stat); 235static inline Eina_Bool eio_file_is_dir(const struct stat *stat);
236EAPI Eina_Bool eio_file_is_lnk(const struct stat *stat); 236static inline Eina_Bool eio_file_is_lnk(const struct stat *stat);
237 237
238/** 238/**
239 * @} 239 * @}
240 */ 240 */
241 241
242#include "eio_inline_helper.x"
243
242#ifdef __cplusplus 244#ifdef __cplusplus
243} 245}
244#endif 246#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@
6 6
7lib_LTLIBRARIES = libeio.la 7lib_LTLIBRARIES = libeio.la
8 8
9includes_HEADERS = Eio.h 9includes_HEADERS = Eio.h eio_inline_helper.x
10includesdir = $(includedir)/eio-@VMAJ@ 10includesdir = $(includedir)/eio-@VMAJ@
11 11
12libeio_la_SOURCES = \ 12libeio_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,
537 * @} 537 * @}
538 */ 538 */
539 539
540/**
541 * @addtogroup Eio_Helper
542 *
543 * @{
544 */
545
546/**
547 * @brief Return last acces time to a file
548 * @param stat The stat buffer as given by eio_file_stat callback.
549 * @return last access time.
550 *
551 * This function return the st_atime field, last acces time, as double like all EFL time call.
552 */
553EAPI double
554eio_file_atime(const struct stat *stat)
555{
556 if (!stat) return 0.0;
557 return (double) stat->st_atime;
558}
559
560/**
561 * @brief Return last modification time of a file
562 * @param stat The stat buffer as given by eio_file_stat callback.
563 * @return last modification time.
564 *
565 * This function return the st_mtime field, last modification time, as double like all EFL time call.
566 */
567EAPI double
568eio_file_mtime(const struct stat *stat)
569{
570 if (!stat) return 0.0;
571 return (double) stat->st_mtime;
572}
573
574/**
575 * @brief Return file length.
576 * @param stat The stat buffer as given by eio_file_stat callback.
577 * @return the length of a file.
578 *
579 * This function is just an accessor to st_size and return the file length.
580 */
581EAPI long long
582eio_file_size(const struct stat *stat)
583{
584 if (!stat) return 0;
585 return stat->st_size;
586}
587
588/**
589 * @brief Return if path is a directory.
590 * @param stat The stat buffer as given by eio_file_stat callback.
591 * @return EINA_TRUE if the path is a directory.
592 *
593 * This function tell you if the stated path is a directory or not.
594 */
595EAPI Eina_Bool
596eio_file_is_dir(const struct stat *stat)
597{
598 if (!stat) return EINA_FALSE;
599 return (S_ISDIR(stat->st_mode)) ? EINA_TRUE : EINA_FALSE;
600}
601
602/**
603 * @brief Return if path is a length.
604 * @param stat The stat buffer as given by eio_file_stat callback.
605 * @return EINA_TRUE if the path is a length.
606 *
607 * This function tell you if the stated path is a length or not.
608 */
609EAPI Eina_Bool
610eio_file_is_lnk(const struct stat *stat)
611{
612 if (!stat) return EINA_FALSE;
613 return (S_ISLNK(stat->st_mode)) ? EINA_TRUE : EINA_FALSE;
614}
615
616/**
617 * @}
618 */