Mercurial > hg > xemacs-beta
comparison src/mule-mcpath.h @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | |
children | 41ff10fd062f |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
1 /* Support for Non-ASCII Path Name | |
2 Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc. | |
3 Copyright (C) 1995 Sun Microsystems, Inc. | |
4 | |
5 This file is part of XEmacs. | |
6 | |
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 | |
10 later version. | |
11 | |
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 | |
15 for more details. | |
16 | |
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. */ | |
21 | |
22 /* Synched up with: Mule 2.3. Not in FSF. */ | |
23 | |
24 /* This part cannot be surround with #ifdef emacs, because it is needed */ | |
25 /* during generate xmakefile. */ | |
26 #ifndef MCPATH | |
27 # define MCPATH | |
28 #endif /* !MCPATH */ | |
29 | |
30 /* not to confuse while compiling etc/*.c */ | |
31 #ifdef emacs | |
32 #ifdef MCPATH | |
33 # ifndef _MCPATH_H /* enable to include twice */ | |
34 | |
35 #if 1 | |
36 | |
37 /* !!! This page is copied from dired.c except that DIRENTRY is | |
38 changed to SYSTEM_DIRENTRY. Don't modify this page. */ | |
39 | |
40 #include <stdio.h> | |
41 #include <sys/types.h> | |
42 #include <sys/stat.h> | |
43 | |
44 #ifdef VMS | |
45 #include <string.h> | |
46 #include <rms.h> | |
47 #include <rmsdef.h> | |
48 #endif | |
49 | |
50 /* The d_nameln member of a struct dirent includes the '\0' character | |
51 on some systems, but not on others. What's worse, you can't tell | |
52 at compile-time which one it will be, since it really depends on | |
53 the sort of system providing the filesystem you're reading from, | |
54 not the system you are running on. Paul Eggert | |
55 <eggert@bi.twinsun.com> says this occurs when Emacs is running on a | |
56 SunOS 4.1.2 host, reading a directory that is remote-mounted from a | |
57 Solaris 2.1 host and is in a native Solaris 2.1 filesystem. | |
58 | |
59 Since applying strlen to the name always works, we'll just do that. */ | |
60 #define NAMLEN(p) strlen (p->d_name) | |
61 | |
62 #ifdef SYSV_SYSTEM_DIR | |
63 | |
64 #include <dirent.h> | |
65 #define SYSTEM_DIRENTRY struct dirent | |
66 | |
67 #else /* not SYSV_SYSTEM_DIR */ | |
68 | |
69 #ifdef NONSYSTEM_DIR_LIBRARY | |
70 #include "ndir.h" | |
71 #else /* not NONSYSTEM_DIR_LIBRARY */ | |
72 #ifdef MSDOS | |
73 #include <dirent.h> | |
74 #else | |
75 #include <sys/dir.h> | |
76 #endif | |
77 #endif /* not NONSYSTEM_DIR_LIBRARY */ | |
78 | |
79 #ifndef MSDOS | |
80 #define SYSTEM_DIRENTRY struct direct | |
81 | |
82 extern DIR *opendir (); | |
83 extern struct direct *readdir (); | |
84 | |
85 #endif /* not MSDOS */ | |
86 #endif /* not SYSV_SYSTEM_DIR */ | |
87 #endif | |
88 | |
89 /* maximum buffer size to do conversion. */ | |
90 #define MCPATH_BUFSIZ(s) (((s) * 3) + 256) | |
91 #define MC_MAXPATHLEN MCPATH_BUFSIZ (MAXPATHLEN) | |
92 | |
93 #define DIRENTRY struct mcpath_direntry | |
94 struct mcpath_direntry | |
95 { | |
96 /* emacs 19.28 uses d_ino and d_name. */ | |
97 #ifndef MSDOS | |
98 int d_ino; | |
99 #endif /* not MSDOS */ | |
100 unsigned char d_name [MCPATH_BUFSIZ (MAXNAMLEN) + 1]; | |
101 }; |