annotate src/sysdir.h @ 581:5c09e1d634a3

[xemacs-hg @ 2001-05-26 12:27:47 by ben] rewrite warning output so that it doesn't happen by default -- you should only get warnings when something is actively wrong, not just because a feature is not present.
author ben
date Sat, 26 May 2001 12:27:47 +0000
parents abe6d1db359e
children b39c14581166
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: Not really in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
23 #ifndef INCLUDED_sysdir_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
24 #define INCLUDED_sysdir_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
25
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #ifdef HAVE_UNISTD_H
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <unistd.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #ifdef SYSV_SYSTEM_DIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 # include <dirent.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
32 #elif defined (WIN32_NATIVE)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
33 # include <direct.h>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
34 # include "ndir.h"
432
3a7e78e1142d Import from CVS: tag r21-2-24
cvs
parents: 428
diff changeset
35 #elif defined (NONSYSTEM_DIR_LIBRARY)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 # include "ndir.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 # include <sys/dir.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 #endif /* not NONSYSTEM_DIR_LIBRARY */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #ifdef SYSV_SYSTEM_DIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 # define DIRENTRY struct dirent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 #else /* not SYSV_SYSTEM_DIR */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 # define DIRENTRY struct direct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 /* The d_nameln member of a struct dirent includes the '\0' character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 on some systems, but not on others. What's worse, you can't tell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 at compile-time which one it will be, since it really depends on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 the sort of system providing the filesystem you're reading from,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 not the system you are running on. Paul Eggert
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 <eggert@bi.twinsun.com> says this occurs when Emacs is running on a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 SunOS 4.1.2 host, reading a directory that is remote-mounted from a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (and Solaris 2 doesn't have a d_nameln member at all! Posix.1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 doesn't specify it -- mrb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Since applying strlen to the name always works, we'll just do that. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 #define NAMLEN(p) strlen (p->d_name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 #define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 /* encapsulation: directory calls */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 #ifdef ENCAPSULATE_CHDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
67 int sys_chdir (const char *path);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 # undef chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 # define chdir sys_chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 #if !defined (ENCAPSULATE_CHDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 # define sys_chdir chdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 #ifdef ENCAPSULATE_MKDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78 int sys_mkdir (const char *path, mode_t mode);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 # undef mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 # define mkdir sys_mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 #if !defined (ENCAPSULATE_MKDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 # define sys_mkdir mkdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 #ifdef ENCAPSULATE_OPENDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 DIR *sys_opendir (const char *filename);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 # undef opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 # define opendir sys_opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 #if !defined (ENCAPSULATE_OPENDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 # define sys_opendir opendir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 #ifdef ENCAPSULATE_READDIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 DIRENTRY *sys_readdir (DIR *dirp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 #if defined (ENCAPSULATE_READDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 # undef readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 # define readdir sys_readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 #if !defined (ENCAPSULATE_READDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 # define sys_readdir readdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 #ifdef ENCAPSULATE_CLOSEDIR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 int sys_closedir (DIR *dirp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 #if defined (ENCAPSULATE_CLOSEDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 # undef closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 # define closedir sys_closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 #if !defined (ENCAPSULATE_CLOSEDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 # define sys_closedir closedir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 #ifdef ENCAPSULATE_RMDIR
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
122 int sys_rmdir (const char *path);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 # undef rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 # define rmdir sys_rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 #if !defined (ENCAPSULATE_RMDIR) && defined (DONT_ENCAPSULATE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 # define sys_rmdir rmdir
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 432
diff changeset
132 #endif /* INCLUDED_sysdir_h_ */