Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial import

Added a build system and bindings for two functions.
  • Loading branch information...
commit 1f2d3411a6de988b99eaecfb388ba264a45b0905 0 parents
@tibbe tibbe authored
9 .gitignore
@@ -0,0 +1,9 @@
+*~
+dist/*
+.hpc/*
+*.hi
+*.o
+Setup.exe*
+Setup
+TAGS
+config.mk
27 LICENSE
@@ -0,0 +1,27 @@
+Copyright Johan Tibell 2007
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
3  Setup.hs
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
28 event.cabal
@@ -0,0 +1,28 @@
+name: event
+version: 0.1
+synopsis: Scalable event notification
+description:
+ Scalable event notification for file handles, sockets, timers, etc.
+license: BSD3
+license-file: LICENSE
+author: Bryan O'Sullivan <bos@serpentine.com>
+ Johan Tibell <johan.tibell@gmail.com>
+maintainer: Johan Tibell <johan.tibell@gmail.com>
+category: System
+build-type: Simple
+cabal-version: >= 1.6
+
+library
+ exposed-modules:
+ System.Event.Internal
+
+ build-depends:
+ base < 4.1
+
+ extensions: CPP, ForeignFunctionInterface
+ ghc-options: -Wall
+ if impl(ghc >= 6.8)
+ ghc-options: -fwarn-tabs
+
+ hs-source-dirs: src
+ extra-libraries: ev
16 src/System/Event/Internal.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+
+module System.Event.Internal where
+
+import Foreign.C.Types (CInt)
+import Foreign.Ptr (Ptr)
+
+newtype EvLoop = EvLoop ()
+
+newtype EvIO = EvIO ()
+
+foreign import ccall unsafe "ev.h ev_default_loop"
+ c_ev_default_loop :: CInt -> IO (Ptr EvLoop)
+
+foreign import ccall unsafe "ev.h ev_io_init"
+ c_ev_io_init :: Ptr EvIO -> Ptr () -> CInt -> CInt -> IO ()
Please sign in to comment.
Something went wrong with that request. Please try again.