packages feed

henet 1.3.8.1 → 1.3.8.1.1

raw patch · 2 files changed

+11/−11 lines, 2 files

Files

henet.cabal view
@@ -1,5 +1,5 @@ Name:                 henet-Version:              1.3.8.1+Version:              1.3.8.1.1 Synopsis:             Bindings and high level interface for to ENet v1.3.8 Description:   ENet is a networking library on top of UDP. In it's own words:@@ -15,14 +15,14 @@   .   This library contains both bindings and a slightly cleaned up interface on   top. The bindings are as close to the original as possible. Names are striped-  of the leading "enet_" and converted to CamelCase, and the occasional newtype+  of the leading 'enet_' and converted to CamelCase, and the occasional newtype   is used instead, but otherwise all functions signatures are exactly the-  same. The bindings are in "Network.ENet.Bindings".+  same. The bindings are in 'Network.ENet.Bindings'.   .   The higher level interface is all other exposed modules. Functions like-  "enet_host_*" are placed in "Network.ENet.Host". All functions are present-  except for the "enet_socket*" functions: they are just wrappers of the Posix-  Sockets Interface, which is already provided in Haskell by the "network"+  'enet_host_*' are placed in 'Network.ENet.Host'. All functions are present+  except for the 'enet_socket*' functions: they are just wrappers of the Posix+  Sockets Interface, which is already provided in Haskell by the 'network'   package. Changes are fairly minimal: "Out-Args" are now returned with a tuple,   conversions between C and Haskell types happen automatically (when Haskell   versions exists), and nullable pointer types have been replaced with
src/Network/ENet/Host.hs view
@@ -16,13 +16,13 @@ destroy :: Ptr B.Host -> IO () destroy = B.hostDestroy -connect :: Ptr B.Host -> SockAddr -> CSize -> Word32 -> IO (Maybe (Ptr B.Peer))+connect :: Ptr B.Host -> SockAddr -> CSize -> Word32 -> IO (Ptr B.Peer) connect host address channelCount datum = alloca $ \addr -> do   poke addr $ toENetAddress address-  peer <- B.hostConnect host addr channelCount datum-  return $ if peer == nullPtr-           then Nothing-           else Just $ peer+  throwErrnoIf+    (/=nullPtr)+    "could not connect to peer"+    $ B.hostConnect host addr channelCount datum  checkEvents :: Ptr B.Host -> IO (Maybe B.Event) checkEvents host = alloca $ \ptr -> do