source: trunk/include/win/msvcrt/sys/stat.h

Last change on this file was 10004, checked in by sandervl, 22 years ago

PF: Header updates

File size: 2.7 KB
Line 
1/*
2 * _stat() definitions
3 *
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8#ifndef __WINE_SYS_STAT_H
9#define __WINE_SYS_STAT_H
10#define __WINE_USE_MSVCRT
11
12#include "sys/types.h"
13
14#ifndef MSVCRT
15# ifdef USE_MSVCRT_PREFIX
16# define MSVCRT(x) MSVCRT_##x
17# else
18# define MSVCRT(x) x
19# endif
20#endif
21
22#ifndef MSVCRT_WCHAR_T_DEFINED
23#define MSVCRT_WCHAR_T_DEFINED
24#ifndef __cplusplus
25typedef unsigned short MSVCRT(wchar_t);
26#endif
27#endif
28
29#ifndef _MSC_VER
30# ifndef __int64
31# define __int64 long long
32# endif
33#endif
34
35#ifndef MSVCRT_DEV_T_DEFINED
36typedef unsigned int _dev_t;
37#define MSVCRT_DEV_T_DEFINED
38#endif
39
40#ifndef MSVCRT_INO_T_DEFINED
41typedef unsigned short _ino_t;
42#define MSVCRT_INO_T_DEFINED
43#endif
44
45#ifndef MSVCRT_TIME_T_DEFINED
46typedef long MSVCRT(time_t);
47#define MSVCRT_TIME_T_DEFINED
48#endif
49
50#ifndef MSVCRT_OFF_T_DEFINED
51typedef int MSVCRT(_off_t);
52#define MSVCRT_OFF_T_DEFINED
53#endif
54
55#define _S_IEXEC 0x0040
56#define _S_IWRITE 0x0080
57#define _S_IREAD 0x0100
58#define _S_IFIFO 0x1000
59#define _S_IFCHR 0x2000
60#define _S_IFDIR 0x4000
61#define _S_IFREG 0x8000
62#define _S_IFMT 0xF000
63
64/* for FreeBSD */
65#undef st_atime
66#undef st_ctime
67#undef st_mtime
68
69#ifndef MSVCRT_STAT_DEFINED
70#define MSVCRT_STAT_DEFINED
71
72struct _stat {
73 _dev_t st_dev;
74 _ino_t st_ino;
75 unsigned short st_mode;
76 short st_nlink;
77 short st_uid;
78 short st_gid;
79 _dev_t st_rdev;
80 MSVCRT(_off_t) st_size;
81 MSVCRT(time_t) st_atime;
82 MSVCRT(time_t) st_mtime;
83 MSVCRT(time_t) st_ctime;
84};
85
86struct _stati64 {
87 unsigned int st_dev;
88 unsigned short st_ino;
89 unsigned short st_mode;
90 short st_nlink; short dummy1;
91 short st_uid; short dummy2;
92 short st_gid; short dummy3;
93 unsigned int st_rdev;
94 long long st_size;
95 long st_atime;
96 long st_mtime;
97 long st_ctime;
98};
99
100#endif /* MSVCRT_STAT_DEFINED */
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
106int MSVCRT(_fstat)(int,struct _stat*);
107int MSVCRT(_stat)(const char*,struct _stat*);
108int _fstati64(int,struct _stati64*);
109int _stati64(const char*,struct _stati64*);
110
111#ifndef MSVCRT_WSTAT_DEFINED
112#define MSVCRT_WSTAT_DEFINED
113int _wstat(const MSVCRT(wchar_t)*,struct _stat*);
114int _wstati64(const MSVCRT(wchar_t)*,struct _stati64*);
115#endif /* MSVCRT_WSTAT_DEFINED */
116
117#ifdef __cplusplus
118}
119#endif
120
121
122#ifndef USE_MSVCRT_PREFIX
123#define S_IFMT _S_IFMT
124#define S_IFDIR _S_IFDIR
125#define S_IFCHR _S_IFCHR
126#define S_IFREG _S_IFREG
127#define S_IREAD _S_IREAD
128#define S_IWRITE _S_IWRITE
129#define S_IEXEC _S_IEXEC
130
131#define fstat _fstat
132#define stat _stat
133#endif /* USE_MSVCRT_PREFIX */
134
135#endif /* __WINE_SYS_STAT_H */
Note: See TracBrowser for help on using the repository browser.