X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FPosix%2FInternals.hs;h=931aec2081605da0d1cd9eb7e03e54e3c38f9fd8;hb=471837cacf74589b7dcf6f94bd37a5a6db703463;hp=575ec66add595d4bae87fc3da835a1d111023aac;hpb=0c5850d96fccf621aa3bcbc15135020bd54533c5;p=haskell-directory.git diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs index 575ec66..931aec2 100644 --- a/System/Posix/Internals.hs +++ b/System/Posix/Internals.hs @@ -44,7 +44,7 @@ import System.IO #ifdef __HUGS__ import Hugs.Prelude (IOException(..), IOErrorType(..)) -{-# CBITS PrelIOUtils.c #-} +{-# CBITS PrelIOUtils.c dirUtils.c #-} #endif -- --------------------------------------------------------------------------- @@ -438,6 +438,19 @@ foreign import ccall unsafe "HsBase.h _setmode" -- 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