From 86f6c4eed443815b519ff32b1de36036a50980f4 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Tue, 17 Aug 2021 23:20:47 +0530 Subject: [PATCH] Move FileSystem.IOVec to System.IOVec/Type --- src/Streamly/Internal/Data/Array/Stream/Foreign.hs | 2 +- src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs | 2 +- src/Streamly/Internal/FileSystem/FD.hs | 1 + src/Streamly/Internal/FileSystem/FDIO.hs | 5 +---- .../Internal/{FileSystem/IOVec.hsc => System/IOVec/Type.hsc} | 4 ++-- streamly.cabal | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) rename src/Streamly/Internal/{FileSystem/IOVec.hsc => System/IOVec/Type.hsc} (95%) diff --git a/src/Streamly/Internal/Data/Array/Stream/Foreign.hs b/src/Streamly/Internal/Data/Array/Stream/Foreign.hs index 41a3c3fa2..35077ab5a 100644 --- a/src/Streamly/Internal/Data/Array/Stream/Foreign.hs +++ b/src/Streamly/Internal/Data/Array/Stream/Foreign.hs @@ -71,7 +71,7 @@ import GHC.Types (SPEC(..)) import Prelude hiding (null, last, (!!), read, concat, unlines) #if !defined(mingw32_HOST_OS) -import Streamly.Internal.FileSystem.FDIO (IOVec(..)) +import Streamly.Internal.System.IOVec.Type (IOVec(..)) #endif import Streamly.Internal.BaseCompat diff --git a/src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs b/src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs index 73e6797cc..b93a3ba77 100644 --- a/src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs +++ b/src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs @@ -36,7 +36,7 @@ import Foreign.Storable (Storable(..)) #if !defined(mingw32_HOST_OS) import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr) import Foreign.Ptr (castPtr) -import Streamly.Internal.FileSystem.FDIO (IOVec(..)) +import Streamly.Internal.System.IOVec.Type (IOVec(..)) import Streamly.Internal.Data.Array.Foreign.Mut.Type (length) import Streamly.Internal.Data.SVar (adaptState) #endif diff --git a/src/Streamly/Internal/FileSystem/FD.hs b/src/Streamly/Internal/FileSystem/FD.hs index 7104df705..6e5cab440 100644 --- a/src/Streamly/Internal/FileSystem/FD.hs +++ b/src/Streamly/Internal/FileSystem/FD.hs @@ -142,6 +142,7 @@ import Streamly.Internal.Data.Array.Stream.Foreign (groupIOVecsOf) import Streamly.Internal.Data.Stream.StreamD (toStreamD) import Streamly.Internal.Data.Stream.StreamD.Type (fromStreamD) import qualified Streamly.Internal.FileSystem.FDIO as RawIO hiding (write) +import qualified Streamly.Internal.System.IOVec.Type as RawIO #endif -- import Streamly.Data.Fold (Fold) -- import Streamly.String (encodeUtf8, decodeUtf8, foldLines) diff --git a/src/Streamly/Internal/FileSystem/FDIO.hs b/src/Streamly/Internal/FileSystem/FDIO.hs index 7d6e344ce..3bde1695e 100644 --- a/src/Streamly/Internal/FileSystem/FDIO.hs +++ b/src/Streamly/Internal/FileSystem/FDIO.hs @@ -16,7 +16,6 @@ module Streamly.Internal.FileSystem.FDIO ( write , writeAll - , IOVec (..) , writev , writevAll ) @@ -31,7 +30,7 @@ import Foreign.C.Error (throwErrnoIfMinus1RetryMayBlock) import Foreign.C.Types (CBool(..)) #endif import System.Posix.Internals (c_write, c_safe_write) -import Streamly.Internal.FileSystem.IOVec (c_writev, c_safe_writev) +import Streamly.Internal.System.IOVec.Type (IOVec, c_writev, c_safe_writev) #endif import Foreign.C.Types (CSize(..), CInt(..)) @@ -40,8 +39,6 @@ import Foreign.Ptr (plusPtr, Ptr) import GHC.IO.FD (FD(..)) -import Streamly.Internal.FileSystem.IOVec (IOVec(..)) - ------------------------------------------------------------------------------- -- IO Routines ------------------------------------------------------------------------------- diff --git a/src/Streamly/Internal/FileSystem/IOVec.hsc b/src/Streamly/Internal/System/IOVec/Type.hsc similarity index 95% rename from src/Streamly/Internal/FileSystem/IOVec.hsc rename to src/Streamly/Internal/System/IOVec/Type.hsc index 9ad4a989e..6955c5b55 100644 --- a/src/Streamly/Internal/FileSystem/IOVec.hsc +++ b/src/Streamly/Internal/System/IOVec/Type.hsc @@ -1,7 +1,7 @@ #include "MachDeps.h" -- | --- Module : Streamly.Internal.FileSystem.IOVec +-- Module : Streamly.Internal.System.IOVec.Type -- Copyright : (c) 2019 Composewell Technologies -- -- License : BSD3 @@ -12,7 +12,7 @@ -- Low level IO routines interfacing the operating system. -- -module Streamly.Internal.FileSystem.IOVec +module Streamly.Internal.System.IOVec.Type ( IOVec(..) , c_writev , c_safe_writev diff --git a/streamly.cabal b/streamly.cabal index 74db7a350..336a9c466 100644 --- a/streamly.cabal +++ b/streamly.cabal @@ -367,6 +367,7 @@ library , Streamly.Internal.Data.Time.Clock.Type , Streamly.Internal.Data.Time.Clock , Streamly.Internal.System.IO + , Streamly.Internal.System.IOVec.Type -- streamly-core-stream , Streamly.Internal.Data.SVar @@ -471,7 +472,6 @@ library , Streamly.Internal.FileSystem.Handle , Streamly.Internal.FileSystem.Dir , Streamly.Internal.FileSystem.File - , Streamly.Internal.FileSystem.IOVec , Streamly.Internal.FileSystem.FDIO , Streamly.Internal.FileSystem.FD