refactoring

This commit is contained in:
Joey Hess 2013-05-11 23:11:56 -04:00
parent 1e2ddcb68a
commit 5e1458152f
3 changed files with 23 additions and 31 deletions

View file

@ -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