2013-05-16 06:34:03 -07:00
|
|
|
/* EIO - Core asynchronous input/output operation library.
|
2010-07-22 09:08:17 -07:00
|
|
|
* Copyright (C) 2010 Enlightenment Developers:
|
|
|
|
* Cedric Bail <cedric.bail@free.fr>
|
2013-05-16 06:34:03 -07:00
|
|
|
* Gustavo Sverzut Barbieri <barbieri@gmail.com>
|
2010-07-22 09:08:17 -07:00
|
|
|
* Vincent "caro" Torri <vtorri at univ-evry dot fr>
|
2013-05-16 17:33:22 -07:00
|
|
|
* Stephen "okra" Houston <unixtitan@gmail.com>
|
|
|
|
* Guillaume "kuri" Friloux <guillaume.friloux@asp64.com>
|
2010-07-22 09:08:17 -07:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EIO_H__
|
|
|
|
# define EIO_H__
|
|
|
|
|
2010-08-31 09:24:58 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2010-07-22 09:08:17 -07:00
|
|
|
#include <Eina.h>
|
2012-02-21 13:01:22 -08:00
|
|
|
#include <Eet.h>
|
2013-11-04 01:31:48 -08:00
|
|
|
#include <Efl_Config.h>
|
2010-07-22 09:08:17 -07:00
|
|
|
|
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2010-07-23 04:00:44 -07:00
|
|
|
# ifdef EFL_EIO_BUILD
|
2010-07-22 09:08:17 -07:00
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif /* ! DLL_EXPORT */
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
2010-07-23 04:00:44 -07:00
|
|
|
# endif /* ! EFL_EIO_BUILD */
|
2010-07-22 09:08:17 -07:00
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif /* ! _WIN32 */
|
|
|
|
|
2010-10-12 07:59:30 -07:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-04-12 12:00:23 -07:00
|
|
|
#ifndef EFL_NOLEGACY_API_SUPPORT
|
|
|
|
#include "Eio_Legacy.h"
|
|
|
|
#endif
|
|
|
|
#ifdef EFL_EO_API_SUPPORT
|
|
|
|
#include "Eio_Eo.h"
|
|
|
|
#endif
|
2011-06-22 10:45:22 -07:00
|
|
|
|
2011-12-03 05:21:07 -08:00
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get access time from a Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the atime from
|
|
|
|
* @return the last accessed time
|
|
|
|
*
|
|
|
|
* This take care of doing type conversion to match rest of EFL time API.
|
|
|
|
* @note some filesystem don't update that information.
|
2011-12-03 05:21:07 -08:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline double eio_file_atime(const Eina_Stat *stat);
|
2011-12-03 05:21:07 -08:00
|
|
|
|
2010-10-28 07:50:24 -07:00
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get modification time from a Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the mtime from
|
|
|
|
* @return the last modification time
|
|
|
|
*
|
|
|
|
* This take care of doing type conversion to match rest of EFL time API.
|
2010-10-28 07:50:24 -07:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline double eio_file_mtime(const Eina_Stat *stat);
|
2010-10-28 07:50:24 -07:00
|
|
|
|
|
|
|
/**
|
2012-02-23 03:46:51 -08:00
|
|
|
* @brief get the size of the file described in Eina_Stat
|
2012-02-22 08:30:43 -08:00
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return the size of the file
|
2010-10-28 07:50:24 -07:00
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline long long eio_file_size(const Eina_Stat *stat);
|
2012-02-22 08:30:43 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief tell if the stated path was a directory or not.
|
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return EINA_TRUE, if it was.
|
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline Eina_Bool eio_file_is_dir(const Eina_Stat *stat);
|
2012-02-22 08:30:43 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief tell if the stated path was a link or not.
|
|
|
|
* @param stat the structure to get the size from
|
|
|
|
* @return EINA_TRUE, if it was.
|
|
|
|
*/
|
2012-02-23 03:46:51 -08:00
|
|
|
static inline Eina_Bool eio_file_is_lnk(const Eina_Stat *stat);
|
2010-10-28 07:50:24 -07:00
|
|
|
|
2010-10-29 05:58:04 -07:00
|
|
|
#include "eio_inline_helper.x"
|
|
|
|
|
2016-04-12 12:00:23 -07:00
|
|
|
#define EIO_VERSION_MAJOR EFL_VERSION_MAJOR
|
|
|
|
#define EIO_VERSION_MINOR EFL_VERSION_MINOR
|
|
|
|
|
2010-10-12 07:59:30 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-28 06:12:42 -07:00
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
2010-10-12 07:59:30 -07:00
|
|
|
|
2010-07-22 09:08:17 -07:00
|
|
|
#endif
|