1 /* Support for Non-ASCII Path Name
2 Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc.
3 Copyright (C) 1995 Sun Microsystems, Inc.
5 This file is part of XEmacs.
7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with XEmacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Synched up with: Mule 2.3. Not in FSF. */
24 /* This part cannot be surround with #ifdef emacs, because it is needed */
25 /* during generate xmakefile. */
30 /* not to confuse while compiling etc/*.c */
33 # ifndef _MCPATH_H /* enable to include twice */
37 /* !!! This page is copied from dired.c except that DIRENTRY is
38 changed to SYSTEM_DIRENTRY. Don't modify this page. */
41 #include <sys/types.h>
44 /* The d_nameln member of a struct dirent includes the '\0' character
45 on some systems, but not on others. What's worse, you can't tell
46 at compile-time which one it will be, since it really depends on
47 the sort of system providing the filesystem you're reading from,
48 not the system you are running on. Paul Eggert
49 <eggert@bi.twinsun.com> says this occurs when Emacs is running on a
50 SunOS 4.1.2 host, reading a directory that is remote-mounted from a
51 Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
53 Since applying strlen to the name always works, we'll just do that. */
54 #define NAMLEN(p) strlen (p->d_name)
56 #ifdef SYSV_SYSTEM_DIR
59 #define SYSTEM_DIRENTRY struct dirent
61 #else /* not SYSV_SYSTEM_DIR */
63 #ifdef NONSYSTEM_DIR_LIBRARY
65 #else /* not NONSYSTEM_DIR_LIBRARY */
71 #endif /* not NONSYSTEM_DIR_LIBRARY */
74 #define SYSTEM_DIRENTRY struct direct
76 extern DIR *opendir ();
77 extern struct direct *readdir ();
79 #endif /* not MSDOS */
80 #endif /* not SYSV_SYSTEM_DIR */
83 /* maximum buffer size to do conversion. */
84 #define MCPATH_BUFSIZ(s) (((s) * 3) + 256)
85 #define MC_MAXPATHLEN MCPATH_BUFSIZ (MAXPATHLEN)
87 #define DIRENTRY struct mcpath_direntry
88 struct mcpath_direntry
90 /* emacs 19.28 uses d_ino and d_name. */
93 #endif /* not MSDOS */
94 unsigned char d_name [MCPATH_BUFSIZ (MAXNAMLEN) + 1];