filelib.h 824 B

12345678910111213141516171819202122
  1. #ifndef FILELIB_H__
  2. #define FILELIB_H__
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif
  6. extern time_t getfiletime(const char* const filename);
  7. extern long getfilesize(const char* const filename);
  8. extern long getfiledata(const char* const filename, char* buffer, const int buffersize);
  9. extern bool q_exists(const char* const filename);
  10. extern int q_filelength(FILE* f);
  11. extern FILE* SafeOpenWrite(const char* const filename);
  12. extern FILE* SafeOpenRead(const char* const filename);
  13. extern void SafeRead(FILE* f, void* buffer, int count);
  14. extern void SafeWrite(FILE* f, const void* const buffer, int count);
  15. extern int LoadFile(const char* const filename, char** bufferptr);
  16. extern void SaveFile(const char* const filename, const void* const buffer, int count);
  17. #endif //**/ FILELIB_H__