#undef DEBUG
-- -----------------------------------------------------------------------------
--- $Id: PrelHandle.hsc,v 1.14 2001/07/13 11:48:52 rrt Exp $
+-- $Id: PrelHandle.hsc,v 1.16 2001/08/23 10:36:50 sewardj Exp $
--
-- (c) The University of Glasgow, 1994-2001
--
then flushWriteBuffer fd (buf{ bufRPtr = r + res' })
else return buf{ bufRPtr=0, bufWPtr=0 }
-foreign import "write_wrap" unsafe
+foreign import "write_PrelHandle_wrap" unsafe
write_off :: CInt -> RawBuffer -> Int -> CInt -> IO CInt
#def inline \
-int write_wrap(int fd, void *ptr, HsInt off, int size) \
+int write_PrelHandle_wrap(int fd, void *ptr, HsInt off, int size) \
{ return write(fd, ptr + off, size); }
then fillReadBufferLoop fd is_line buf b (w+res') size
else return buf{ bufRPtr=0, bufWPtr=w+res' }
-foreign import "read_wrap" unsafe
+foreign import "read_PrelHandle_wrap" unsafe
read_off :: FD -> RawBuffer -> Int -> CInt -> IO CInt
#def inline \
-int read_wrap(int fd, void *ptr, HsInt off, int size) \
+int read_PrelHandle_wrap(int fd, void *ptr, HsInt off, int size) \
{ return read(fd, ptr + off, size); }
-- ---------------------------------------------------------------------------
-- hSetBinaryMode
#ifdef _WIN32
-hSetBinaryMode handle bin =
+hSetBinaryMode handle bin =
withAllHandles__ "hSetBinaryMode" handle $ \ handle_ ->
do let flg | bin = (#const O_BINARY)
| otherwise = (#const O_TEXT)
foreign import "setmode" setmode :: CInt -> CInt -> IO CInt
#else
-hSetBinaryMode handle bin = do
+hSetBinaryMode handle bin =
withAllHandles__ "hSetBinaryMode" handle $ \ handle_ ->
return handle_{haIsBin=bin}
- return ()
#endif
-- -----------------------------------------------------------------------------