diff options
author | simonmar <unknown> | 2002-02-12 15:17:36 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-02-12 15:17:36 +0000 |
commit | 2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc (patch) | |
tree | 2fefe09bc63464ac3a28ea37b61eefc5e506685a /ghc/lib/std/cbits/inputReady.c | |
parent | 239e9471e104fd88ec93bf42623c3a68a496657a (diff) | |
download | haskell-2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc.tar.gz |
[project @ 2002-02-12 15:17:13 by simonmar]
Switch over to the new hierarchical libraries
---------------------------------------------
This commit reorganises our libraries to use the new hierarchical
module namespace extension.
The basic story is this:
- fptools/libraries contains the new hierarchical libraries.
Everything in here is "clean", i.e. most deprecated stuff has
been removed.
- fptools/libraries/base is the new base package
(replacing "std") and contains roughly what was previously
in std, lang, and concurrent, minus deprecated stuff.
Things that are *not allowed* in libraries/base include:
Addr, ForeignObj, ByteArray, MutableByteArray,
_casm_, _ccall_, ``'', PrimIO
For ByteArrays and MutableByteArrays we use UArray and
STUArray/IOUArray respectively now.
Modules previously called PrelFoo are now under
fptools/libraries/GHC. eg. PrelBase is now GHC.Base.
- fptools/libraries/haskell98 provides the Haskell 98 std.
libraries (Char, IO, Numeric etc.) as a package. This
package is enabled by default.
- fptools/libraries/network is a rearranged version of
the existing net package (the old package net is still
available; see below).
- Other packages will migrate to fptools/libraries in
due course.
NB. you need to checkout fptools/libraries as well as
fptools/hslibs now. The nightly build scripts will need to be
tweaked.
- fptools/hslibs still contains (almost) the same stuff as before.
Where libraries have moved into the new hierarchy, the hslibs
version contains a "stub" that just re-exports the new version.
The idea is that code will gradually migrate from fptools/hslibs
into fptools/libraries as it gets cleaned up, and in a version or
two we can remove the old packages altogether.
- I've taken the opportunity to make some changes to the build
system, ripping out the old hslibs Makefile stuff from
mk/target.mk; the new package building Makefile code is in
mk/package.mk (auto-included from mk/target.mk).
The main improvement is that packages now register themselves at
make boot time using ghc-pkg, and the monolithic package.conf
in ghc/driver is gone.
I've updated the standard packages but haven't tested win32,
graphics, xlib, object-io, or OpenGL yet. The Makefiles in
these packages may need some further tweaks, and they'll need
pkg.conf.in files added.
- Unfortunately all this rearrangement meant I had to bump the
interface-file version and create a bunch of .hi-boot-6 files :-(
Diffstat (limited to 'ghc/lib/std/cbits/inputReady.c')
-rw-r--r-- | ghc/lib/std/cbits/inputReady.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/ghc/lib/std/cbits/inputReady.c b/ghc/lib/std/cbits/inputReady.c deleted file mode 100644 index 0a1a0ee6e1..0000000000 --- a/ghc/lib/std/cbits/inputReady.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 - * - * hWaitForInput Runtime Support - */ - -/* select and supporting types is not Posix */ -/* #include "PosixSource.h" */ -#include "HsStd.h" - -/* - * inputReady(fd) checks to see whether input is available on the file - * descriptor 'fd'. Input meaning 'can I safely read at least a - * *character* from this file object without blocking?' - */ -int -inputReady(int fd, int msecs, int isSock) -{ - if -#ifndef mingw32_TARGET_OS - ( 1 ) { -#else - ( isSock ) { -#endif - int maxfd, ready; - fd_set rfd; - struct timeval tv; - - FD_ZERO(&rfd); - FD_SET(fd, &rfd); - - /* select() will consider the descriptor set in the range of 0 to - * (maxfd-1) - */ - maxfd = fd + 1; - tv.tv_sec = msecs / 1000; - tv.tv_usec = msecs % 1000; - - while ((ready = select(maxfd, &rfd, NULL, NULL, &tv)) < 0 ) { - if (errno != EINTR ) { - return -1; - } - } - - /* 1 => Input ready, 0 => not ready, -1 => error */ - return (ready); - } -#ifdef mingw32_TARGET_OS - else { - DWORD rc; - HANDLE hFile = (HANDLE)_get_osfhandle(fd); - - rc = MsgWaitForMultipleObjects( 1, - &hFile, - FALSE, /* wait all */ - msecs, /*millisecs*/ - QS_ALLEVENTS); - - /* 1 => Input ready, 0 => not ready, -1 => error */ - switch (rc) { - case WAIT_TIMEOUT: return 0; - case WAIT_OBJECT_0: return 1; - default: return -1; - } - } -#endif -} |