comparison src/sysdir.h @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children b39c14581166
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
27 #include <unistd.h> 27 #include <unistd.h>
28 #endif 28 #endif
29 29
30 #ifdef SYSV_SYSTEM_DIR 30 #ifdef SYSV_SYSTEM_DIR
31 # include <dirent.h> 31 # include <dirent.h>
32 #elif defined (WIN32_NATIVE)
33 # include <direct.h>
34 # include "ndir.h"
32 #elif defined (NONSYSTEM_DIR_LIBRARY) 35 #elif defined (NONSYSTEM_DIR_LIBRARY)
33 # include "ndir.h" 36 # include "ndir.h"
34 #elif defined (MSDOS)
35 # include <dirent.h>
36 #else 37 #else
37 # include <sys/dir.h> 38 # include <sys/dir.h>
38 #endif /* not NONSYSTEM_DIR_LIBRARY */ 39 #endif /* not NONSYSTEM_DIR_LIBRARY */
39 40
40 #ifdef SYSV_SYSTEM_DIR 41 #ifdef SYSV_SYSTEM_DIR
56 doesn't specify it -- mrb) 57 doesn't specify it -- mrb)
57 58
58 Since applying strlen to the name always works, we'll just do that. */ 59 Since applying strlen to the name always works, we'll just do that. */
59 #define NAMLEN(p) strlen (p->d_name) 60 #define NAMLEN(p) strlen (p->d_name)
60 61
61 #ifdef MSDOS
62 #define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0)
63 #else
64 #define DIRENTRY_NONEMPTY(p) ((p)->d_ino) 62 #define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
65 #endif
66 63
67 /* encapsulation: directory calls */ 64 /* encapsulation: directory calls */
68 65
69 #ifdef ENCAPSULATE_CHDIR 66 #ifdef ENCAPSULATE_CHDIR
70 int sys_chdir (CONST char *path); 67 int sys_chdir (const char *path);
71 #endif 68 #endif
72 #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE) 69 #if defined (ENCAPSULATE_CHDIR) && !defined (DONT_ENCAPSULATE)
73 # undef chdir 70 # undef chdir
74 # define chdir sys_chdir 71 # define chdir sys_chdir
75 #endif 72 #endif
76 #if !defined (ENCAPSULATE_CHDIR) && defined (DONT_ENCAPSULATE) 73 #if !defined (ENCAPSULATE_CHDIR) && defined (DONT_ENCAPSULATE)
77 # define sys_chdir chdir 74 # define sys_chdir chdir
78 #endif 75 #endif
79 76
80 #ifdef ENCAPSULATE_MKDIR 77 #ifdef ENCAPSULATE_MKDIR
81 int sys_mkdir (CONST char *path, mode_t mode); 78 int sys_mkdir (const char *path, mode_t mode);
82 #endif 79 #endif
83 #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE) 80 #if defined (ENCAPSULATE_MKDIR) && !defined (DONT_ENCAPSULATE)
84 # undef mkdir 81 # undef mkdir
85 # define mkdir sys_mkdir 82 # define mkdir sys_mkdir
86 #endif 83 #endif
87 #if !defined (ENCAPSULATE_MKDIR) && defined (DONT_ENCAPSULATE) 84 #if !defined (ENCAPSULATE_MKDIR) && defined (DONT_ENCAPSULATE)
88 # define sys_mkdir mkdir 85 # define sys_mkdir mkdir
89 #endif 86 #endif
90 87
91 #ifdef ENCAPSULATE_OPENDIR 88 #ifdef ENCAPSULATE_OPENDIR
92 DIR *sys_opendir (CONST char *filename); 89 DIR *sys_opendir (const char *filename);
93 #endif 90 #endif
94 #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE) 91 #if defined (ENCAPSULATE_OPENDIR) && !defined (DONT_ENCAPSULATE)
95 # undef opendir 92 # undef opendir
96 # define opendir sys_opendir 93 # define opendir sys_opendir
97 #endif 94 #endif
120 #if !defined (ENCAPSULATE_CLOSEDIR) && defined (DONT_ENCAPSULATE) 117 #if !defined (ENCAPSULATE_CLOSEDIR) && defined (DONT_ENCAPSULATE)
121 # define sys_closedir closedir 118 # define sys_closedir closedir
122 #endif 119 #endif
123 120
124 #ifdef ENCAPSULATE_RMDIR 121 #ifdef ENCAPSULATE_RMDIR
125 int sys_rmdir (CONST char *path); 122 int sys_rmdir (const char *path);
126 #endif 123 #endif
127 #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE) 124 #if defined (ENCAPSULATE_RMDIR) && !defined (DONT_ENCAPSULATE)
128 # undef rmdir 125 # undef rmdir
129 # define rmdir sys_rmdir 126 # define rmdir sys_rmdir
130 #endif 127 #endif