bcfe344c53
replaced by timespec fields. Via macros the structure is still source compatible with the old one. * Introduced header <compat/sys/stat.h> that defines the old stat structure (as stat_beos) and conversion functions * Introduced versions for [l,f]stat(). * Added symbol versions for BDirectory::GetStatFor() for sake of binary compatibility. * BStatable::GetStat(): Renamed the old method, changed its parameter to stat_beos*, and and made it private. Added a new version (using up a reserved vtable slot). It remains source and binary compatible. * BRefFilter::Filter(): Changed the struct stat* parameter to struct stat_beos* for sake of binary compatibility. This breaks source compatibility, though, which we can't help, since the class doesn't have reserved vtable slots. * Fixed several issues with the stat structure change, mostly adjusted uses of BRefFilter. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30830 a95241bf-73f2-0310-859d-f6bbb57e9c96
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
/*
|
|
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _COMPAT_SYS_STAT_H_
|
|
#define _COMPAT_SYS_STAT_H_
|
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
/* helper struct allowing us to avoid problems with the st_*time macros */
|
|
typedef struct {
|
|
time_t tv_sec;
|
|
} stat_beos_time;
|
|
|
|
|
|
struct stat_beos {
|
|
dev_t st_dev; /* device ID that this file resides on */
|
|
ino_t st_ino; /* this file's serial inode ID */
|
|
mode_t st_mode; /* file mode (rwx for user, group, etc) */
|
|
nlink_t st_nlink; /* number of hard links to this file */
|
|
uid_t st_uid; /* user ID of the owner of this file */
|
|
gid_t st_gid; /* group ID of the owner of this file */
|
|
off_t st_size; /* size in bytes of this file */
|
|
dev_t st_rdev; /* device type (not used) */
|
|
blksize_t st_blksize; /* preferred block size for I/O */
|
|
stat_beos_time st_atim; /* last access time */
|
|
stat_beos_time st_mtim; /* last modification time */
|
|
stat_beos_time st_ctim; /* last change time, not creation time */
|
|
stat_beos_time st_crtim; /* creation time */
|
|
};
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern void convert_to_stat_beos(const struct stat* stat,
|
|
struct stat_beos* beosStat);
|
|
extern void convert_from_stat_beos(const struct stat_beos* beosStat,
|
|
struct stat* stat);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _COMPAT_SYS_STAT_H_ */
|