[GLUE] Rsync SAMBA_3_0 SVN r25598 in order to create the v3-0-test branch.
[Samba.git] / source / lib / replace / system / dir.h
blob64e413c90795aeebc2cee996bdb3b40a5bd65874
1 #ifndef _system_dir_h
2 #define _system_dir_h
3 /*
4 Unix SMB/CIFS implementation.
6 directory system include wrappers
8 Copyright (C) Andrew Tridgell 2004
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #if HAVE_DIRENT_H
26 # include <dirent.h>
27 # define NAMLEN(dirent) strlen((dirent)->d_name)
28 #else
29 # define dirent direct
30 # define NAMLEN(dirent) (dirent)->d_namlen
31 # if HAVE_SYS_NDIR_H
32 # include <sys/ndir.h>
33 # endif
34 # if HAVE_SYS_DIR_H
35 # include <sys/dir.h>
36 # endif
37 # if HAVE_NDIR_H
38 # include <ndir.h>
39 # endif
40 #endif
42 #ifndef HAVE_MKDIR_MODE
43 #define mkdir(dir, mode) mkdir(dir)
44 #endif
46 /* Test whether a file name is the "." or ".." directory entries.
47 * These really should be inline functions.
49 #ifndef ISDOT
50 #define ISDOT(path) ( \
51 *((const char *)(path)) == '.' && \
52 *(((const char *)(path)) + 1) == '\0' \
54 #endif
56 #ifndef ISDOTDOT
57 #define ISDOTDOT(path) ( \
58 *((const char *)(path)) == '.' && \
59 *(((const char *)(path)) + 1) == '.' && \
60 *(((const char *)(path)) + 2) == '\0' \
62 #endif
64 #endif