1354
|
1 // sysdir.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_sysdir_h) |
|
25 #define octave_sysdir_h 1 |
|
26 |
|
27 // This mess suggested by the autoconf manual. |
|
28 |
|
29 // unistd.h defines _POSIX_VERSION on POSIX.1 systems. |
|
30 |
|
31 #ifdef HAVE_UNISTD_H |
|
32 #include <sys/types.h> |
|
33 #include <unistd.h> |
|
34 #endif |
|
35 |
|
36 #if defined (HAVE_DIRENT_H) || defined (_POSIX_VERSION) |
|
37 #include <dirent.h> |
|
38 #define NLENGTH(dirent) (strlen((dirent)->d_name)) |
|
39 #else |
|
40 #define dirent direct |
|
41 #define NLENGTH(dirent) ((dirent)->d_namlen) |
|
42 #if defined (HAVE_SYS_NDIR_H) |
|
43 #include <sys/ndir.h> |
|
44 #endif |
|
45 #if defined (HAVE_SYS_DIR_H) |
|
46 #include <sys/dir.h> |
|
47 #endif |
|
48 #if defined (HAVE_NDIR_H) |
|
49 #include <ndir.h> |
|
50 #endif |
|
51 #endif |
|
52 |
|
53 #endif |
|
54 |
|
55 /* |
|
56 ;;; Local Variables: *** |
|
57 ;;; mode: C++ *** |
|
58 ;;; page-delimiter: "^/\\*" *** |
|
59 ;;; End: *** |
|
60 */ |