#ifndef DK4STATT_H_INCLUDED #define DK4STATT_H_INCLUDED 1 /** @file dk4statt.h Default type definitions for dev_t and ino_t. Note: The stat() and lstat() functions are sufficient for non-Windows systems. On Windows systems the st_dev and st_ino components may contain dummy contents, the stat structure does not contain information about symbolic links. For a portable (both Windows and non-Windows) check whether a file is a symbolic link, reparse point... use the dk4_file_info_t data type from dk4fileit.h. */ #ifndef DK4CONF_H_INCLUDED #include "dk4conf.h" #endif #ifndef DK4TYES_H_INCLUDED #include "dk4types.h" #endif #if DK4_HAVE_SYS_TYPES_H #ifndef SYS_TYPES_H_INCLUDED #include #define SYS_TYPES_H_INCLUDED 1 #endif #endif #if DK4_HAVE_SYS_STAT_H #ifndef SYS_STAT_H_INCLUDED #include #define SYS_STAT_H_INCLUDED 1 #endif #endif #if DK4_HAVE_DEV_T /** Device number. */ typedef dev_t dk4_dev_t; #else #if DK4_HAVE__DEV_T /** Device number. */ typedef _dev_t dk4_dev_t; #else /** Device number. */ typdef dk4_um_t dk4_dev_t; #endif #endif #if DK4_ON_WINDOWS /* +++ Windows +++ */ #if DK4_HAVE_INO_T /** Inode number. */ typedef ino_t dk4_ino_t; #else #if DK4_HAVE__INO_T /** Inode number. */ typedef _ino_t dk4_ino_t; #else /** Inode number. */ typedef dk4_um_t dk4_ino_t; #endif #endif /* --- Windows --- */ #else #if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_STAT64 /* +++ Unix, stat64 +++ */ #if DK4_HAVE_INO64_T /** Inode number. */ typedef ino64_t dk4_ino_t; #else #if DK4_HAVE__INO64_T /** Inode number. */ typedef _ino64_t dk4_ino_t; #else #if DK4_HAVE_INO_T /** Inode number. */ typedef ino_t dk4_ino_t; #else #if DK4_HAVE__INO_T typedef _ino_t dk4_ino_t; #else /** Inode number. */ typedef dk4_um_t dk4_ino_t; #endif #endif #endif #endif /* --- Unix, stat64 --- */ #else /* +++ Unix, stat +++ */ #if DK4_HAVE_INO_T /** Inode number. */ typedef ino_t dk4_ino_t; #else #if DK4_HAVE__INO_T /** Inode number. */ typedef _ino_t dk4_ino_t; #else /** Inode number. */ typedef dk4_um_t dk4_ino_t; #endif #endif /* --- Unix, stat --- */ #endif #endif #if DK4_HAVE_MODE_T /** File mode (type and permissions). */ typedef mode_t dk4_mode_t; #else /** File mode (type and permissions). */ typedef unsigned short dk4_mode_t; #endif #if DK4_HAVE_NLINK_T /** Number of links to inode. */ typedef nlink_t dk4_nlink_t; #else #if DK4_ON_WINDOWS /** Number of links to inode. */ typedef short dk4_nlink_t; #else /** Number of links to inode. */ typedef unsigned short dk4_nlink_t; #endif #endif #if DK4_HAVE_UID_T /** User id. */ typedef uid_t dk4_uid_t; #else #if DK4_ON_WINDOWS /** User id. */ typedef short dk4_uid_t; #else /** User id. */ typedef dk4_um_t dk4_uid_t; #endif #endif #if DK4_HAVE_GID_T /** Group ID. */ typedef gid_t dk4_gid_t; #else #if DK4_ON_WINDOWS /** Group ID. */ typedef short dk4_gid_t; #else /** Group ID. */ typedef dk4_um_t dk4_gid_t; #endif #endif #if DK4_ON_WINDOWS /* +++ Windows +++ */ #if DK4_HAVE_OFF_T /** File size or position. */ typedef off_t dk4_off_t; #else #if DK4_HAVE__OFF_T /** File size or position. */ typedef _off_t dk4_off_t; #else /** File size or position. */ typedef dk4_um_t dk4_off_t; #endif #endif /* --- Windows --- */ #else #if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_STAT64 /* +++ Unix, stat64 +++ */ #if DK4_HAVE_OFF64_T /** File size or position. */ typedef off64_t dk4_off_t; #else #if DK4_HAVE__OFF64_T /** File size or position. */ typedef _off64_t dk4_off_t; #else #if DK4_HAVE_OFF_T /** File size or position. */ typedef off_t dk4_off_t; #else #if DK4_HAVE__OFF_T /** File size or position. */ typedef _off_t dk4_off_t; #else /** File size or position. */ typedef dk4_um_t dk4_off_t; #endif #endif #endif #endif /* --- Unix, stat64 --- */ #else /* +++ Unix, stat +++ */ #if DK4_HAVE_OFF_T /** File size or position. */ typedef off_t dk4_off_t; #else #if DK4_HAVE__OFF_T /** File size or position. */ typedef _off_t dk4_off_t; #else /** File size or position. */ typedef dk4_um_t dk4_off_t; #endif #endif /* --- Unix, stat --- */ #endif #endif #if DK4_HAVE_BLKSIZE_T /** Filesystem block size. */ typedef blksize_t dk4_blksize_t; #else /** Filesystem block size. */ typedef dk4_um_t dk4_blksize_t; #endif #if DK4_HAVE_BLKCNT_T /** Filesystem block count for file. */ typedef blkcnt_t dk4_blkcnt_t; #else /** Filesystem block count for file. */ typedef dk4_um_t dk4_blkcnt_t; #endif #if DK4_ON_WINDOWS /** File statistics. */ typedef struct __stat64 dk4_stat_t; #else #if DK4_HAVE_LARGEFILE64_SOURCE && DK4_HAVE_STAT64 /** File statistics. */ typedef struct stat64 dk4_stat_t; #else /** File statistics. */ typedef struct stat dk4_stat_t; #endif #endif #endif