From: Axel S. <as...@us...> - 2004-11-28 21:20:00
|
Update of /cvsroot/gtk2hs/gtk2hs/tools/c2hs/base/sysdep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29541 Added Files: SysDep.hs SysDepPosix.hs Removed Files: SysDepGHC3.hs SysDepGHC4.hs SysDepGHC5.hs SysDepGHC6.hs SysDepNHC1.hs SysDepPosixAVAIL.hs SysDepPosixUNAVAIL.hs Log Message: Remove the compatability stuff of c2hs. --- NEW FILE: SysDepPosix.hs --- -- Compiler Toolkit: posix dependent stuff - EMPTY STUB -- -- Author : Manuel M. T. Chakravarty -- Created: 18 August 2000 -- -- Version $Revision: 1.1 $ from $Date: 2004/11/28 21:19:52 $ -- -- Copyright (c) 2000 Manuel M. T. Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- --- DESCRIPTION --------------------------------------------------------------- -- -- This module provides stub routines for building on a system configuration -- where the `posix' package from HSLibs is not available. -- --- DOCU ---------------------------------------------------------------------- -- -- language: Haskell 98 -- -- * may only import `Config' -- -- Provides the same symbols as `SysDepPosixAVAIL', but without an -- implementation. -- --- TODO ---------------------------------------------------------------------- -- module SysDepPosix ( ProcessID, -- re-exported runPiped ) where import IO (Handle) -- definition doesn't matter as it isn't used anyway -- type ProcessID = () -- Process management -- ------------------ runPiped :: FilePath -- command -> [String] -- arguments -> Maybe [(String, String)] -- environment -> Maybe FilePath -- working directory -> IO (ProcessID,Handle,Handle) -- (child pid, fromChild, toChild) runPiped _ _ _ _ = error "SysDepPosix.runPiped: not supported on this system" --- SysDepGHC3.hs DELETED --- --- SysDepGHC6.hs DELETED --- --- SysDepPosixUNAVAIL.hs DELETED --- --- SysDepNHC1.hs DELETED --- --- SysDepGHC4.hs DELETED --- --- SysDepPosixAVAIL.hs DELETED --- --- NEW FILE: SysDep.hs --- -- Compiler Toolkit: system dependent stuff (GHC 4.x version; x >= 02) -- -- Author : Manuel M. T. Chakravarty -- Derived: 11 March 1999 (from SysDepGHC3.hs) -- -- Version $Revision: 1.1 $ from $Date: 2004/11/28 21:19:52 $ -- -- Copyright (c) [1996..2000] Manuel M. T. Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This file is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- --- DESCRIPTION --------------------------------------------------------------- -- -- This module provides the system dependent routines for building with the -- Glasgow Haskell Compiler (GHC) version 4.x, from x >= 02. -- -- The original definition of `runPiped' is courtesy of Sven Panne -- <Sve...@in...> as distributed on the -- gla...@dc... mailing list as -- <362...@in...>. -- --- DOCU ---------------------------------------------------------------------- -- -- language: Haskell 98 (tested with the low-level interfaces of -- GHC 4.0[2..8] and 5.00) -- -- * may only import `Config' -- -- * has to be compiled with `-syslib exts' -- -- Provided Services -- ----------------- -- -- * IO monad: -- - fixpoint combinator -- -- * Mutable variables and arrays: -- - creation, read & write -- -- * Process management (if provided by `SysDepPosix'): -- - creation of child process connected with pipes -- -- * Tracing primitive -- -- * Unsafe integer cells -- -- Currently, the functionality of `SysDepPosix' is always available when -- compiling with GHC, *except* on cygwin. -- --- TODO ---------------------------------------------------------------------- -- module SysDep ( -- -- for Haskell 1.4/98 compatibility -- ioError, -- -- extra IO functions -- fixIO, -- -- mutable variables and arrays (in IO) -- IORef, newIORef, readIORef, writeIORef, IOArray, newIOArray, boundsIOArray, readIOArray, writeIOArray, -- -- fork -- module SysDepPosix, -- -- tracing -- trace, -- -- UNSAFE stuff -- *Real* Haskell Hackers only!!! -- unsafeNewIntRef, unsafeReadAndIncIntRef ) where import Ix (Ix) import Monad (when) import IOExts (fixIO, unsafePerformIO, IORef, newIORef, readIORef, writeIORef, IOArray, newIOArray, boundsIOArray, readIOArray, writeIOArray, trace) -- other system-dependent components -- import SysDepPosix -- UNSAFE mutable variables -- ------------------------ -- WARNING: The following does not exist, or at least, it belongs to another -- world. And if you believe into the lambda calculus, you don't -- want to know about this other world. -- -- *** DON'T TOUCH NOR USE THIS STUFF *** -- (unless you really know what you are doing!) -- UNSAFELY create a mutable integer (EXPORTED) -- unsafeNewIntRef :: Int -> IORef Int unsafeNewIntRef i = unsafePerformIO (newIORef i) -- UNSAFELY increment a mutable integer and yield its value before the -- increment (EXPORTED) -- unsafeReadAndIncIntRef :: IORef Int -> Int unsafeReadAndIncIntRef mv = unsafePerformIO $ do v <- readIORef mv writeIORef mv (v + 1) return v --- SysDepGHC5.hs DELETED --- |