summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0c5850d)
jiggle to make System.Posix.Directory work for Hugs
foreign import ccall unsafe "__hscore_path_max"
path_max :: Int
foreign import ccall unsafe "__hscore_path_max"
path_max :: Int
-foreign import ccall unsafe "__hscore_readdir"
- readdir :: Ptr CDir -> Ptr (Ptr CDirent) -> IO CInt
-
-foreign import ccall unsafe "__hscore_free_dirent"
- freeDirEnt :: Ptr CDirent -> IO ()
-
-foreign import ccall unsafe "__hscore_end_of_dir"
- end_of_dir :: CInt
-
-foreign import ccall unsafe "__hscore_d_name"
- d_name :: Ptr CDirent -> IO CString
-
foreign import ccall unsafe "__hscore_R_OK" r_OK :: CMode
foreign import ccall unsafe "__hscore_W_OK" w_OK :: CMode
foreign import ccall unsafe "__hscore_X_OK" x_OK :: CMode
foreign import ccall unsafe "__hscore_R_OK" r_OK :: CMode
foreign import ccall unsafe "__hscore_W_OK" w_OK :: CMode
foreign import ccall unsafe "__hscore_X_OK" x_OK :: CMode
#ifdef __HUGS__
import Hugs.Prelude (IOException(..), IOErrorType(..))
#ifdef __HUGS__
import Hugs.Prelude (IOException(..), IOErrorType(..))
-{-# CBITS PrelIOUtils.c #-}
+{-# CBITS PrelIOUtils.c dirUtils.c #-}
#endif
-- ---------------------------------------------------------------------------
#endif
-- ---------------------------------------------------------------------------
-- printf( "'stdin' successfully changed to binary mode\n" );
#endif
-- printf( "'stdin' successfully changed to binary mode\n" );
#endif
+-- traversing directories
+foreign import ccall unsafe "dirUtils.h __hscore_readdir"
+ readdir :: Ptr CDir -> Ptr (Ptr CDirent) -> IO CInt
+
+foreign import ccall unsafe "HsBase.h __hscore_free_dirent"
+ freeDirEnt :: Ptr CDirent -> IO ()
+
+foreign import ccall unsafe "HsBase.h __hscore_end_of_dir"
+ end_of_dir :: CInt
+
+foreign import ccall unsafe "HsBase.h __hscore_d_name"
+ d_name :: Ptr CDirent -> IO CString
+
-- POSIX flags only:
foreign import ccall unsafe "HsBase.h __hscore_o_rdonly" o_RDONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt
-- POSIX flags only:
foreign import ccall unsafe "HsBase.h __hscore_o_rdonly" o_RDONLY :: CInt
foreign import ccall unsafe "HsBase.h __hscore_o_wronly" o_WRONLY :: CInt