refactoring
This commit is contained in:
parent
1e2ddcb68a
commit
5e1458152f
3 changed files with 23 additions and 31 deletions
|
@ -6,11 +6,14 @@
|
|||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.CoProcess (
|
||||
CoProcessHandle,
|
||||
start,
|
||||
stop,
|
||||
query
|
||||
query,
|
||||
rawMode
|
||||
) where
|
||||
|
||||
import Common
|
||||
|
@ -33,3 +36,15 @@ query (_, from, to, _) send receive = do
|
|||
_ <- send to
|
||||
hFlush to
|
||||
receive from
|
||||
|
||||
rawMode :: CoProcessHandle -> IO CoProcessHandle
|
||||
rawMode ch@(_, from, to, _) = do
|
||||
raw from
|
||||
raw to
|
||||
return ch
|
||||
where
|
||||
raw h = do
|
||||
fileEncoding h
|
||||
#ifdef __WINDOWS__
|
||||
hSetNewlineMode h noNewlineTranslation
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue