/ [cpio] / cpio / src / filetypes.h
To checkout: cvs -d:pserver:anonymous@cvs.gnu.org.ua:/cvsmirror/cpio co cpio/src/filetypes.h
Puszcza

Contents of /cpio/src/filetypes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Wed Jun 27 13:59:59 2007 UTC (14 years, 5 months ago) by gray
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
File MIME type: text/plain
Relicense under GPLv3

1 /* filetypes.h - deal with POSIX annoyances
2 Copyright (C) 1991, 2007 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this program; if not, write to the Free
16 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301 USA. */
18
19 /* Include sys/types.h and sys/stat.h before this file. */
20
21 #ifndef S_ISREG /* Doesn't have POSIX.1 stat stuff. */
22 #define mode_t unsigned short
23 #endif
24
25 /* Define the POSIX macros for systems that lack them. */
26 #if !defined(S_ISBLK) && defined(S_IFBLK)
27 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
28 #endif
29 #if !defined(S_ISCHR) && defined(S_IFCHR)
30 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
31 #endif
32 #if !defined(S_ISDIR) && defined(S_IFDIR)
33 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
34 #endif
35 #if !defined(S_ISREG) && defined(S_IFREG)
36 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
37 #endif
38 #if !defined(S_ISFIFO) && defined(S_IFIFO)
39 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
40 #endif
41 #if !defined(S_ISLNK) && defined(S_IFLNK)
42 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
43 #endif
44 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
45 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
46 #endif
47 #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX network special */
48 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
49 #endif
50
51 /* Define the file type bits used in cpio archives.
52 They have the same values as the S_IF bits in traditional Unix. */
53
54 #define CP_IFMT 0170000 /* Mask for all file type bits. */
55
56 #if defined(S_ISBLK)
57 #define CP_IFBLK 0060000
58 #endif
59 #if defined(S_ISCHR)
60 #define CP_IFCHR 0020000
61 #endif
62 #if defined(S_ISDIR)
63 #define CP_IFDIR 0040000
64 #endif
65 #if defined(S_ISREG)
66 #define CP_IFREG 0100000
67 #endif
68 #if defined(S_ISFIFO)
69 #define CP_IFIFO 0010000
70 #endif
71 #if defined(S_ISLNK)
72 #define CP_IFLNK 0120000
73 #endif
74 #if defined(S_ISSOCK)
75 #define CP_IFSOCK 0140000
76 #endif
77 #if defined(S_ISNWK)
78 #define CP_IFNWK 0110000
79 #endif
80
81 #ifndef S_ISLNK
82 #define lstat stat
83 #endif
84 int lstat ();
85 int stat ();

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20