1 /* -----------------------------------------------------------------------------
3 * (c) The University of Glasgow 2001-2004
5 * Definitions for package `directory' which are visible in Haskell land.
7 * ---------------------------------------------------------------------------*/
9 #ifndef __HSDIRECTORY_H__
10 #define __HSDIRECTORY_H__
13 #include "Nhc98BaseConfig.h"
15 #include "HsDirectoryConfig.h"
17 // Otherwise these clash with similar definitions from other packages:
18 #undef PACKAGE_BUGREPORT
21 #undef PACKAGE_TARNAME
22 #undef PACKAGE_VERSION
25 #include <sys/types.h>
36 #if defined(__MINGW32__)
40 #if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
41 extern int __hscore_getFolderPath(HWND hwndOwner,
48 /* -----------------------------------------------------------------------------
51 These functions are given as inlines here for when compiling via C,
52 but we also generate static versions into the cbits library for
53 when compiling to native code.
54 -------------------------------------------------------------------------- */
57 # if defined(_MSC_VER)
58 # define INLINE extern __inline
60 # define INLINE static inline
64 /* A size that will contain many path names, but not necessarily all
65 * (PATH_MAX is not defined on systems with unlimited path length,
68 INLINE HsInt __hscore_long_path_size() {
76 INLINE int __hscore_R_OK() { return R_OK; }
77 INLINE int __hscore_W_OK() { return W_OK; }
78 INLINE int __hscore_X_OK() { return X_OK; }
80 INLINE mode_t __hscore_S_IRUSR() { return S_IRUSR; }
81 INLINE mode_t __hscore_S_IWUSR() { return S_IWUSR; }
82 INLINE mode_t __hscore_S_IXUSR() { return S_IXUSR; }
83 INLINE mode_t __hscore_S_IFDIR() { return S_IFDIR; }
85 #if defined(__MINGW32__)
87 /* Make sure we've got the reqd CSIDL_ constants in scope;
88 * w32api header files are lagging a bit in defining the full set.
90 #if !defined(CSIDL_APPDATA)
91 #define CSIDL_APPDATA 0x001a
93 #if !defined(CSIDL_PERSONAL)
94 #define CSIDL_PERSONAL 0x0005
96 #if !defined(CSIDL_PROFILE)
97 #define CSIDL_PROFILE 0x0028
99 #if !defined(CSIDL_WINDOWS)
100 #define CSIDL_WINDOWS 0x0024
103 INLINE int __hscore_CSIDL_PROFILE() { return CSIDL_PROFILE; }
104 INLINE int __hscore_CSIDL_APPDATA() { return CSIDL_APPDATA; }
105 INLINE int __hscore_CSIDL_WINDOWS() { return CSIDL_WINDOWS; }
106 INLINE int __hscore_CSIDL_PERSONAL() { return CSIDL_PERSONAL; }
109 #endif /* __HSDIRECTORY_H__ */