summaryrefslogtreecommitdiff
path: root/Utility/CoProcess.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-11 23:11:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-11 23:11:56 -0400
commitc46bbe9b5095dc58ab11c106e07179db85a0f1df (patch)
treec5c49c51841509f0da98715297252dfba11ec8af /Utility/CoProcess.hs
parentcbc98eee9d583f56d52a70fbff7abe171a1ecebe (diff)
refactoring
Diffstat (limited to 'Utility/CoProcess.hs')
-rw-r--r--Utility/CoProcess.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Utility/CoProcess.hs b/Utility/CoProcess.hs
index 7a2a5fe8e..f72850fc5 100644
--- a/Utility/CoProcess.hs
+++ b/Utility/CoProcess.hs
@@ -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