/* * This file is subject to the terms of the GFX License. If a copy of * the license was not distributed with this file, you can obtain one at: * * http://ugfx.org/license.html */ /** * @file src/gfile/sys_defs.h * @brief GFILE - File IO Routines header file. * * @addtogroup GFILE * * @brief Module which contains Operating system independent FILEIO * * @{ */ #ifndef _GFILE_H #define _GFILE_H #include "gfx.h" #if GFX_USE_GFILE || defined(__DOXYGEN__) /*===========================================================================*/ /* Type definitions */ /*===========================================================================*/ /** * @brief A file pointer */ typedef struct GFILE GFILE; typedef struct gfileList gfileList; extern GFILE *gfileStdIn; extern GFILE *gfileStdErr; extern GFILE *gfileStdOut; /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ #ifdef __cplusplus extern "C" { #endif /** * @brief Check if file exists * * @param[in] fname The file name * * @return TRUE if file exists, FALSE otherwise * * @api */ bool_t gfileExists(const char *fname); /** * @brief Delete file * * @param[in] fname The file name * * @return TRUE on success, FALSE otherwise * * @api */ bool_t gfileDelete(const char *fname); /** * @brief Get the size of a file * @note Please use @p gfileGetSize() if the file is opened * * @param[in] fname The file name * * @return File size on success, -1 on error * * @api */ long int gfileGetFilesize(const char *fname); /** * @brief Rename file * * @param[in] oldname The current file name * @param[in] newname The new name of the file * * @return TRUE on success, FALSE otherwise * * @api */ bool_t gfileRename(const char *oldname, const char *newname); /** * @brief Open file * @details A file must be opened before it can be accessed * @details The resulting GFILE will be used for all functions that access the file. * * @param[in] fname The file name * @param[in] mode The mode. * * @return Valid GFILE on success, 0 otherwise * * @note The modes follow the c library fopen() standard. * The valid modes are:
*
* THe following flags can also be added to the above modes:
*