Sync to HEAD
[bpt/emacs.git] / mac / inc / sys / stat.h
CommitLineData
1a578e9b
AC
1/* Replacement sys/stat.h file for building GNU Emacs on the Macintosh.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
e0f712ba 21/* Contributed by Andrew Choi (akochoi@mac.com). */
1a578e9b
AC
22
23#ifndef _SYS_STAT_H
24#define _SYS_STAT_H
25
26#ifdef __MWERKS__
27#include <stat.mac.h>
28
e0f712ba 29#if __MSL__ >= 0x6000
1a578e9b
AC
30#define fstat _fstat
31#endif
32
33#undef S_IFMT
34#undef S_IFBLK
35#undef S_IFCHR
36#undef S_IFIFO
37#undef S_IFREG
38#undef S_IFDIR
39#undef S_IFLNK
40
41#undef S_IRUSR
42#undef S_IWUSR
43#undef S_IXUSR
44
45#endif /* __MWERKS__ */
46
47/* Need to redefine these for CW, filemode.c assumes Unix definitions which are
48 inconsistent with CW definitions because CW uses bits 8-12 for S_IFMT info.
49 Bit 8 is used by S_IRUSR on Unix! */
50#define S_IFMT 0170000 /* type of file */
51#define S_IFBLK 0060000 /* block special */
52#define S_IFCHR 0020000 /* character special */
53#define S_IFIFO 0010000 /* FIFO special */
54#define S_IFREG 0100000 /* regular */
55#define S_IFDIR 0040000 /* directory */
56#define S_IFLNK 0030000 /* symbolic link */
57
58#define S_IREAD 00400
59#define S_IWRITE 00200
60#define S_IEXEC 00100
61
62/* Need to redefine these for because mode_string in filemode.c assumes Unix
63 values in the lower 9 bits which are different from CW values. */
64#define S_IRUSR S_IREAD
65#define S_IWUSR S_IWRITE
66#define S_IXUSR S_IEXEC
67
68#ifdef __MRC__
69typedef unsigned long dev_t;
70
71struct stat {
72 dev_t st_dev; /* ID of device containing file */
73 int st_ino; /* file serial number */
74 unsigned short st_mode; /* mode of file */
75 int st_nlink; /* number of links to the file */
76 int st_uid; /* user ID of file */
77 int st_gid; /* group ID of file */
78 int st_rdev; /* device ID (if file is character or block special) */
79 int st_size; /* file size in bytes (if file is a regular file) */
80 int st_atime; /* time of last access */
81 int st_mtime; /* time of last data modification */
82 int st_ctime; /* time of last status change */
83};
84#endif /* __MRC__ */
85
86#endif /* _SYS_STAT_H */
6b61353c
KH
87
88/* arch-tag: b7da83f5-3d3f-4b19-9cd2-790dd87145e4
89 (do not change this comment) */