minishared.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _MINISHARED_H
  2. #define _MINISHARED_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifdef _WIN32
  7. # define MKDIR(d) _mkdir(d)
  8. # define CHDIR(d) _chdir(d)
  9. #else
  10. # define MKDIR(d) mkdir(d, 0775)
  11. # define CHDIR(d) chdir(d)
  12. #endif
  13. /***************************************************************************/
  14. /* Get a file's date and time in dos format */
  15. uint32_t get_file_date(const char *path, uint32_t *dos_date);
  16. /* Sets a file's date and time in dos format */
  17. void change_file_date(const char *path, uint32_t dos_date);
  18. /* Convert dos date/time format to struct tm */
  19. int dosdate_to_tm(uint64_t dos_date, struct tm *ptm);
  20. /* Convert dos date/time format to time_t */
  21. time_t dosdate_to_time_t(uint64_t dos_date);
  22. /* Convert struct tm to dos date/time format */
  23. uint32_t tm_to_dosdate(const struct tm *ptm);
  24. /* Create a directory and all subdirectories */
  25. int makedir(const char *newdir);
  26. /* Check to see if a file exists */
  27. int check_file_exists(const char *path);
  28. /* Check to see if a file is over 4GB and needs ZIP64 extension */
  29. int is_large_file(const char *path);
  30. /* Print a 64-bit number for compatibility */
  31. void display_zpos64(uint64_t n, int size_char);
  32. /***************************************************************************/
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif /* _MINISHARED_H */