--- previous/src/includes/file.h 2018/04/24 19:26:02 1.1.1.2 +++ previous/src/includes/file.h 2018/04/24 19:34:18 1.1.1.4 @@ -5,31 +5,43 @@ your option any later version. Read the file gpl.txt for details. */ +#pragma once + #ifndef HATARI_FILE_H #define HATARI_FILE_H -extern void File_CleanFileName(char *pszFileName); -extern void File_AddSlashToEndFileName(char *pszFileName); -extern bool File_DoesFileExtensionMatch(const char *pszFileName, const char *pszExtension); -extern const char *File_RemoveFileNameDrive(const char *pszFileName); -extern bool File_DoesFileNameEndWithSlash(char *pszFileName); -extern Uint8 *File_Read(const char *pszFileName, long *pFileSize, const char * const ppszExts[]); -extern bool File_Save(const char *pszFileName, const Uint8 *pAddress, size_t Size, bool bQueryOverwrite); -extern off_t File_Length(const char *pszFileName); -extern bool File_Exists(const char *pszFileName); -extern bool File_DirExists(const char *psDirName); -extern bool File_QueryOverwrite(const char *pszFileName); -extern char* File_FindPossibleExtFileName(const char *pszFileName,const char * const ppszExts[]); -extern void File_SplitPath(const char *pSrcFileName, char *pDir, char *pName, char *Ext); -extern char* File_MakePath(const char *pDir, const char *pName, const char *pExt); -extern void File_ShrinkName(char *pDestFileName, const char *pSrcFileName, int maxlen); -extern FILE *File_Open(const char *path, const char *mode); -extern FILE *File_Close(FILE *fp); -extern bool File_InputAvailable(FILE *fp); -extern void File_MakeAbsoluteSpecialName(char *pszFileName); -extern void File_MakeAbsoluteName(char *pszFileName); -extern void File_MakeValidPathName(char *pPathName); -extern void File_PathShorten(char *path, int dirs); -extern void File_HandleDotDirs(char *path); +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +void File_CleanFileName(char *pszFileName); +void File_AddSlashToEndFileName(char *pszFileName); +bool File_DoesFileExtensionMatch(const char *pszFileName, const char *pszExtension); +const char *File_RemoveFileNameDrive(const char *pszFileName); +bool File_DoesFileNameEndWithSlash(char *pszFileName); +Uint8 *File_Load(const char *pszFileName, long *pFileSize, const char * const ppszExts[]); +bool File_Save(const char *pszFileName, const Uint8 *pAddress, size_t Size, bool bQueryOverwrite); +off_t File_Length(const char *pszFileName); +bool File_Exists(const char *pszFileName); +bool File_DirExists(const char *psDirName); +bool File_QueryOverwrite(const char *pszFileName); +char* File_FindPossibleExtFileName(const char *pszFileName,const char * const ppszExts[]); +void File_SplitPath(const char *pSrcFileName, char *pDir, char *pName, char *Ext); +char* File_MakePath(const char *pDir, const char *pName, const char *pExt); +void File_ShrinkName(char *pDestFileName, const char *pSrcFileName, int maxlen); +FILE *File_Open(const char *path, const char *mode); +FILE *File_Close(FILE *fp); +bool File_Read(Uint8 *data, Uint32 size, Uint64 offset, FILE *fp); +bool File_Write(Uint8 *data, Uint32 size, Uint64 offset, FILE *fp); +bool File_InputAvailable(FILE *fp); +void File_MakeAbsoluteSpecialName(char *pszFileName); +void File_MakeAbsoluteName(char *pszFileName); +void File_MakeValidPathName(char *pPathName); +void File_PathShorten(char *path, int dirs); +void File_HandleDotDirs(char *path); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* HATARI_FILE_H */