packages feed

HGamer3D-Enet-Binding 0.2.0 → 0.3.0

raw patch · 25 files changed

+523/−1003 lines, 25 filesdep ~HGamer3D-Datasetup-changed

Dependency ranges changed: HGamer3D-Data

Files

HGamer3D-Enet-Binding.cabal view
@@ -1,13 +1,14 @@ Name:                HGamer3D-Enet-Binding
-Version:             0.2.0
-Synopsis:            Windows Game Engine for the Haskell Programmer - Enet Bindings
+Version:             0.3.0
+Synopsis:            Enet Binding for HGamer3D
 Description:         
-   HGamer3D is a game engine for developing 3D games in the programming 
-   language Haskell. The game engine uses available libraries for 3D graphics, 
-   sound, input device handling, gui programming and other areas and make
-   those functions available for the Haskell programmer by providing  
-   a Haskell API on top of that. HGamer3D is available on Windows only.
-   
+   HGamer3D is a game engine for developing 3D games in the programming +   language Haskell. This package provides the Enet binding. +   HGamer3D-Enet-Binding is available on Windows and Linux. +   This binding does not claim to have full coverage of Enet +   functionality, but only to support what is needed for the+   HGamer3D-Network package.+    
 	
 License:             OtherLicense
@@ -18,12 +19,12 @@ Cabal-Version:       >=1.4
 Homepage:            http://www.hgamer3d.org
 Category:            Game Engine, Network
-Extra-source-files:  Setup.hs, include/ClassEnet.h, include/ClassEnetClient.h, include/ClassEnetPacket.h, include/ClassEnetServer.h, include/ClassPtr.h, include/EnetDllDefines.h, include/StructHG3DClass.h
+Extra-source-files:  Setup.hs, include/hg3dstruct.h
 
 Library
-  Build-Depends:     base >= 3 && < 5, HGamer3D-Data >= 0.2.0
+  Build-Depends:     base >= 3 && < 5, HGamer3D-Data >= 0.3.0
 
-  Exposed-modules:   HGamer3D.Bindings.Enet.Utils, HGamer3D.Bindings.Enet.ClassPtr, HGamer3D.Bindings.Enet.StructHG3DClass, HGamer3D.Bindings.Enet.ClassEnet, HGamer3D.Bindings.Enet.ClassEnetClient, HGamer3D.Bindings.Enet.ClassEnetPacket, HGamer3D.Bindings.Enet.ClassEnetServer
+  Exposed-modules:   HGamer3D.Bindings.Enet.Utils, HGamer3D.Bindings.Enet.StructHG3DClass, HGamer3D.Bindings.Enet.ClassPtr, HGamer3D.Bindings.Enet.ClassEnetServer, HGamer3D.Bindings.Enet.ClassEnetClient, HGamer3D.Bindings.Enet.ClassEnetPacket, HGamer3D.Bindings.Enet.ClassEnet
   Other-modules:     
 
   ghc-options:       
@@ -32,4 +33,7 @@   Include-dirs:      include
   Build-tools:       
   build-depends:     
-  extra-libraries:   
+  if os(windows)
+     extra-libraries:   hg3denet030
+  else
+     extra-libraries:   hg3denet030,:libenet.so.2
+ HGamer3D/Bindings/Enet/ClassEnet.chs view
@@ -0,0 +1,60 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- ClassEnet.chs
+
+-- +
+module HGamer3D.Bindings.Enet.ClassEnet where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+{# import HGamer3D.Bindings.Enet.Utils #}+{# import HGamer3D.Bindings.Enet.ClassPtr #}+{# import HGamer3D.Bindings.Enet.StructHG3DClass #}+
+#include "ClassEnet.h"
+{- function HG3DEnet -}+{#fun enet_enet_construct as new +{ alloca- `HG3DClass' peek*} -> `()'  #}++{- function ~HG3DEnet -}+{#fun enet_enet_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()'  #}++{- function createServer -}+{#fun enet_enet_createServer as createServer +{ fromIntegral `Int' ,+ alloca- `HG3DClass' peek*} -> `()'  #}++{- function createClient -}+{#fun enet_enet_createClient as createClient +{ alloca- `HG3DClass' peek*} -> `()'  #}+
− HGamer3D/Bindings/Enet/ClassEnet.hs
@@ -1,98 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- ClassEnet.chs
-
--- 
-
-module HGamer3D.Bindings.Enet.ClassEnet where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-import HGamer3D.Bindings.Enet.Utils
-{-# LINE 40 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-import HGamer3D.Bindings.Enet.ClassPtr
-{-# LINE 41 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-import HGamer3D.Bindings.Enet.StructHG3DClass
-{-# LINE 42 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-
-{- function HG3DEnet -}
-new :: IO (HG3DClass)
-new =
-  alloca $ \a1' -> 
-  new'_ a1' >>= \res ->
-  peek  a1'>>= \a1'' -> 
-  return (a1'')
-{-# LINE 47 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-
-{- function ~HG3DEnet -}
-delete :: HG3DClass -> IO ()
-delete a1 =
-  withHG3DClass a1 $ \a1' -> 
-  delete'_ a1' >>= \res ->
-  return ()
-{-# LINE 51 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-
-{- function createServer -}
-createServer :: Int -> IO (HG3DClass)
-createServer a1 =
-  let {a1' = fromIntegral a1} in 
-  alloca $ \a2' -> 
-  createServer'_ a1' a2' >>= \res ->
-  peek  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 56 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-
-{- function createClient -}
-createClient :: IO (HG3DClass)
-createClient =
-  alloca $ \a1' -> 
-  createClient'_ a1' >>= \res ->
-  peek  a1'>>= \a1'' -> 
-  return (a1'')
-{-# LINE 60 ".\\HGamer3D\\Bindings\\Enet\\ClassEnet.chs" #-}
-
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnet.chs.h enet_enet_construct"
-  new'_ :: ((HG3DClassPtr) -> (IO ()))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnet.chs.h enet_enet_destruct"
-  delete'_ :: ((HG3DClassPtr) -> (IO ()))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnet.chs.h enet_enet_createServer"
-  createServer'_ :: (CInt -> ((HG3DClassPtr) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnet.chs.h enet_enet_createClient"
-  createClient'_ :: ((HG3DClassPtr) -> (IO ()))
+ HGamer3D/Bindings/Enet/ClassEnetClient.chs view
@@ -0,0 +1,76 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- ClassEnetClient.chs
+
+-- +
+module HGamer3D.Bindings.Enet.ClassEnetClient where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+{# import HGamer3D.Bindings.Enet.Utils #}+{# import HGamer3D.Bindings.Enet.ClassPtr #}+{# import HGamer3D.Bindings.Enet.StructHG3DClass #}+
+#include "ClassEnetClient.h"
+{- function ~EnetClient -}+{#fun enet_clnt_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()'  #}++{- function connect -}+{#fun enet_clnt_connect as connect +{ withHG3DClass* `HG3DClass' ,+ withCString* `String' ,+ fromIntegral `Int' ,+ alloca- `Bool' peekBoolUtil*} -> `()'  #}++{- function disconnect -}+{#fun enet_clnt_disconnect as disconnect +{ withHG3DClass* `HG3DClass' ,+ alloca- `Bool' peekBoolUtil*} -> `()'  #}++{- function serve -}+{#fun enet_clnt_serve as serve +{ withHG3DClass* `HG3DClass' ,+ fromIntegral `Int' ,+ alloca- `Bool' peekBoolUtil*} -> `()'  #}++{- function getPacket -}+{#fun enet_clnt_getPacket as getPacket +{ withHG3DClass* `HG3DClass' ,+ alloca- `HG3DClass' peek*} -> `()'  #}++{- function send -}+{#fun enet_clnt_send as send +{ withHG3DClass* `HG3DClass' ,+ withCString* `String' ,+ fromIntegral `Int' } -> `()'  #}+
− HGamer3D/Bindings/Enet/ClassEnetClient.hs
@@ -1,129 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- ClassEnetClient.chs
-
--- 
-
-module HGamer3D.Bindings.Enet.ClassEnetClient where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-import HGamer3D.Bindings.Enet.Utils
-{-# LINE 40 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-import HGamer3D.Bindings.Enet.ClassPtr
-{-# LINE 41 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-import HGamer3D.Bindings.Enet.StructHG3DClass
-{-# LINE 42 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function ~EnetClient -}
-delete :: HG3DClass -> IO ()
-delete a1 =
-  withHG3DClass a1 $ \a1' -> 
-  delete'_ a1' >>= \res ->
-  return ()
-{-# LINE 47 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function connect -}
-connect :: HG3DClass -> String -> Int -> IO (Bool)
-connect a1 a2 a3 =
-  withHG3DClass a1 $ \a1' -> 
-  withCString a2 $ \a2' -> 
-  let {a3' = fromIntegral a3} in 
-  alloca $ \a4' -> 
-  connect'_ a1' a2' a3' a4' >>= \res ->
-  peekBoolUtil  a4'>>= \a4'' -> 
-  return (a4'')
-{-# LINE 54 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function disconnect -}
-disconnect :: HG3DClass -> IO (Bool)
-disconnect a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloca $ \a2' -> 
-  disconnect'_ a1' a2' >>= \res ->
-  peekBoolUtil  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 59 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function serve -}
-serve :: HG3DClass -> Int -> IO (Bool)
-serve a1 a2 =
-  withHG3DClass a1 $ \a1' -> 
-  let {a2' = fromIntegral a2} in 
-  alloca $ \a3' -> 
-  serve'_ a1' a2' a3' >>= \res ->
-  peekBoolUtil  a3'>>= \a3'' -> 
-  return (a3'')
-{-# LINE 65 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function getPacket -}
-getPacket :: HG3DClass -> IO (HG3DClass)
-getPacket a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloca $ \a2' -> 
-  getPacket'_ a1' a2' >>= \res ->
-  peek  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 70 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-{- function send -}
-send :: HG3DClass -> String -> Int -> IO ()
-send a1 a2 a3 =
-  withHG3DClass a1 $ \a1' -> 
-  withCString a2 $ \a2' -> 
-  let {a3' = fromIntegral a3} in 
-  send'_ a1' a2' a3' >>= \res ->
-  return ()
-{-# LINE 76 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs" #-}
-
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_destruct"
-  delete'_ :: ((HG3DClassPtr) -> (IO ()))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_connect"
-  connect'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (CInt -> ((Ptr CInt) -> (IO ())))))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_disconnect"
-  disconnect'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_serve"
-  serve'_ :: ((HG3DClassPtr) -> (CInt -> ((Ptr CInt) -> (IO ()))))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_getPacket"
-  getPacket'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetClient.chs.h enet_clnt_send"
-  send'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (CInt -> (IO ()))))
+ HGamer3D/Bindings/Enet/ClassEnetPacket.chs view
@@ -0,0 +1,62 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- ClassEnetPacket.chs
+
+-- +
+module HGamer3D.Bindings.Enet.ClassEnetPacket where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+{# import HGamer3D.Bindings.Enet.Utils #}+{# import HGamer3D.Bindings.Enet.ClassPtr #}+{# import HGamer3D.Bindings.Enet.StructHG3DClass #}+
+#include "ClassEnetPacket.h"
+{- function getData -}+{#fun enet_pck_getData as getData +{ withHG3DClass* `HG3DClass' ,+ alloc64k- `String' peekCString*} -> `()'  #}++{- function getPeer -}+{#fun enet_pck_getPeer as getPeer +{ withHG3DClass* `HG3DClass' ,+ alloc64k- `String' peekCString*} -> `()'  #}++{- function getChannel -}+{#fun enet_pck_getChannel as getChannel +{ withHG3DClass* `HG3DClass' ,+ alloca- `Int' peekIntConv*} -> `()'  #}++{- function ~EnetPacket -}+{#fun enet_pck_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()'  #}+
− HGamer3D/Bindings/Enet/ClassEnetPacket.hs
@@ -1,100 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- ClassEnetPacket.chs
-
--- 
-
-module HGamer3D.Bindings.Enet.ClassEnetPacket where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-import HGamer3D.Bindings.Enet.Utils
-{-# LINE 40 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-import HGamer3D.Bindings.Enet.ClassPtr
-{-# LINE 41 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-import HGamer3D.Bindings.Enet.StructHG3DClass
-{-# LINE 42 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-
-{- function getData -}
-getData :: HG3DClass -> IO (String)
-getData a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloc64k $ \a2' -> 
-  getData'_ a1' a2' >>= \res ->
-  peekCString  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 48 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-
-{- function getPeer -}
-getPeer :: HG3DClass -> IO (String)
-getPeer a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloc64k $ \a2' -> 
-  getPeer'_ a1' a2' >>= \res ->
-  peekCString  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 53 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-
-{- function getChannel -}
-getChannel :: HG3DClass -> IO (Int)
-getChannel a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloca $ \a2' -> 
-  getChannel'_ a1' a2' >>= \res ->
-  peekIntConv  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 58 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-
-{- function ~EnetPacket -}
-delete :: HG3DClass -> IO ()
-delete a1 =
-  withHG3DClass a1 $ \a1' -> 
-  delete'_ a1' >>= \res ->
-  return ()
-{-# LINE 62 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs" #-}
-
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs.h enet_pck_getData"
-  getData'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs.h enet_pck_getPeer"
-  getPeer'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs.h enet_pck_getChannel"
-  getChannel'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetPacket.chs.h enet_pck_destruct"
-  delete'_ :: ((HG3DClassPtr) -> (IO ()))
+ HGamer3D/Bindings/Enet/ClassEnetServer.chs view
@@ -0,0 +1,65 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- ClassEnetServer.chs
+
+-- +
+module HGamer3D.Bindings.Enet.ClassEnetServer where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+{# import HGamer3D.Bindings.Enet.Utils #}+{# import HGamer3D.Bindings.Enet.ClassPtr #}+{# import HGamer3D.Bindings.Enet.StructHG3DClass #}+
+#include "ClassEnetServer.h"
+{- function ~EnetServer -}+{#fun enet_srv_destruct as delete +{ withHG3DClass* `HG3DClass' } -> `()'  #}++{- function serve -}+{#fun enet_srv_serve as serve +{ withHG3DClass* `HG3DClass' ,+ fromIntegral `Int' ,+ alloca- `Bool' peekBoolUtil*} -> `()'  #}++{- function getPacket -}+{#fun enet_srv_getPacket as getPacket +{ withHG3DClass* `HG3DClass' ,+ alloca- `HG3DClass' peek*} -> `()'  #}++{- function send -}+{#fun enet_srv_send as send +{ withHG3DClass* `HG3DClass' ,+ withCString* `String' ,+ withCString* `String' ,+ fromIntegral `Int' } -> `()'  #}+
− HGamer3D/Bindings/Enet/ClassEnetServer.hs
@@ -1,102 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- ClassEnetServer.chs
-
--- 
-
-module HGamer3D.Bindings.Enet.ClassEnetServer where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-import HGamer3D.Bindings.Enet.Utils
-{-# LINE 40 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-import HGamer3D.Bindings.Enet.ClassPtr
-{-# LINE 41 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-import HGamer3D.Bindings.Enet.StructHG3DClass
-{-# LINE 42 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-
-{- function ~EnetServer -}
-delete :: HG3DClass -> IO ()
-delete a1 =
-  withHG3DClass a1 $ \a1' -> 
-  delete'_ a1' >>= \res ->
-  return ()
-{-# LINE 47 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-
-{- function serve -}
-serve :: HG3DClass -> Int -> IO (Bool)
-serve a1 a2 =
-  withHG3DClass a1 $ \a1' -> 
-  let {a2' = fromIntegral a2} in 
-  alloca $ \a3' -> 
-  serve'_ a1' a2' a3' >>= \res ->
-  peekBoolUtil  a3'>>= \a3'' -> 
-  return (a3'')
-{-# LINE 53 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-
-{- function getPacket -}
-getPacket :: HG3DClass -> IO (HG3DClass)
-getPacket a1 =
-  withHG3DClass a1 $ \a1' -> 
-  alloca $ \a2' -> 
-  getPacket'_ a1' a2' >>= \res ->
-  peek  a2'>>= \a2'' -> 
-  return (a2'')
-{-# LINE 58 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-
-{- function send -}
-send :: HG3DClass -> String -> String -> Int -> IO ()
-send a1 a2 a3 a4 =
-  withHG3DClass a1 $ \a1' -> 
-  withCString a2 $ \a2' -> 
-  withCString a3 $ \a3' -> 
-  let {a4' = fromIntegral a4} in 
-  send'_ a1' a2' a3' a4' >>= \res ->
-  return ()
-{-# LINE 65 ".\\HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs" #-}
-
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs.h enet_srv_destruct"
-  delete'_ :: ((HG3DClassPtr) -> (IO ()))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs.h enet_srv_serve"
-  serve'_ :: ((HG3DClassPtr) -> (CInt -> ((Ptr CInt) -> (IO ()))))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs.h enet_srv_getPacket"
-  getPacket'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ())))
-
-foreign import ccall safe "HGamer3D\\Bindings\\Enet\\ClassEnetServer.chs.h enet_srv_send"
-  send'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> ((Ptr CChar) -> (CInt -> (IO ())))))
+ HGamer3D/Bindings/Enet/ClassPtr.chs view
@@ -0,0 +1,50 @@+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- ClassPtr.chs
+
+-- Class Ptr Utilities+
+module HGamer3D.Bindings.Enet.ClassPtr where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+{# import HGamer3D.Bindings.Enet.Utils #}+
+#include "ClassPtr.h"
+{- class ClassEnetClient -}+{#pointer *ClassEnetClient as ClassEnetClient#}+{- class ClassEnetPacket -}+{#pointer *ClassEnetPacket as ClassEnetPacket#}+{- class ClassEnetServer -}+{#pointer *ClassEnetServer as ClassEnetServer#}+{- class ClassEnet -}+{#pointer *ClassHG3DEnet as ClassEnet#}
− HGamer3D/Bindings/Enet/ClassPtr.hs
@@ -1,58 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- ClassPtr.chs
-
--- Class Ptr Utilities
-
-module HGamer3D.Bindings.Enet.ClassPtr where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-import HGamer3D.Bindings.Enet.Utils
-{-# LINE 40 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}
-
-{- class ClassEnetClient -}
-type ClassEnetClient = Ptr (())
-{-# LINE 44 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}
-{- class ClassEnetPacket -}
-type ClassEnetPacket = Ptr (())
-{-# LINE 46 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}
-{- class ClassEnetServer -}
-type ClassEnetServer = Ptr (())
-{-# LINE 48 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}
-{- class ClassEnet -}
-type ClassEnet = Ptr (())
-{-# LINE 50 ".\\HGamer3D\\Bindings\\Enet\\ClassPtr.chs" #-}
+ HGamer3D/Bindings/Enet/StructHG3DClass.chs view
@@ -0,0 +1,52 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- StructHG3DClass.chs
+
+-- +
+module HGamer3D.Bindings.Enet.StructHG3DClass where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+
+#include "StructHG3DClass.h"
++import Data.Bits+import HGamer3D.Data.HG3DClass++{#pointer *hg3dclass_struct as HG3DClassPtr -> HG3DClass #}++withHG3DClass :: HG3DClass -> (HG3DClassPtr -> IO b) -> IO b+withHG3DClass = with++peekHG3DClass :: HG3DClassPtr -> IO HG3DClass+peekHG3DClass = peek+
− HGamer3D/Bindings/Enet/StructHG3DClass.hs
@@ -1,57 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\StructHG3DClass.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- StructHG3DClass.chs
-
--- 
-
-module HGamer3D.Bindings.Enet.StructHG3DClass where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-
-
-import Data.Bits
-import HGamer3D.Data.HG3DClass
-
-type HG3DClassPtr = Ptr (HG3DClass)
-{-# LINE 46 ".\\HGamer3D\\Bindings\\Enet\\StructHG3DClass.chs" #-}
-
-withHG3DClass :: HG3DClass -> (HG3DClassPtr -> IO b) -> IO b
-withHG3DClass = with
-
-peekHG3DClass :: HG3DClassPtr -> IO HG3DClass
-peekHG3DClass = peek
-
+ HGamer3D/Bindings/Enet/Utils.chs view
@@ -0,0 +1,132 @@+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +
+-- (c) 2011-2014 Peter Althainz
+-- 
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+-- 
+--     http://www.apache.org/licenses/LICENSE-2.0
+-- 
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+-- +
+
+-- Utils.hs
+
+-- Marshalling Utilities+
+module HGamer3D.Bindings.Enet.Utils where
+
+import Foreign
+import Foreign.Ptr
+import Foreign.C
+
+import HGamer3D.Data.HG3DClass
+import HGamer3D.Data.Vector
+import HGamer3D.Data.Colour
+import HGamer3D.Data.Angle
+
+
+#include "StructHG3DClass.h"
++import Control.Monad (liftM)++-- Strings with explicit length+--+withCStringLenIntConv :: Num n => String -> ((CString, n) -> IO a) -> IO a+withCStringLenIntConv s f    = withCStringLen s $ \(p, n) -> f (p, fromIntegral n)++peekCStringLenIntConv :: Integral n => (CString, n) -> IO String+peekCStringLenIntConv (s, n) = peekCStringLen (s, fromIntegral n)++-- Marshalling of numerals+--++withIntConv   :: (Storable b, Integral a, Integral b) +              => a -> (Ptr b -> IO c) -> IO c+withIntConv    = with . fromIntegral++withFloatConv :: (Storable b, RealFloat a, RealFloat b) +              => a -> (Ptr b -> IO c) -> IO c+withFloatConv  = with . realToFrac++peekIntConv   :: (Storable a, Integral a, Integral b) +              => Ptr a -> IO b+peekIntConv    = liftM fromIntegral . peek++peekFloatConv :: (Storable a, RealFloat a, RealFloat b) +              => Ptr a -> IO b+peekFloatConv  = liftM realToFrac . peek+++-- String Conversion functions+--++withCUString b f = withCWString b (f . castPtr)+peekCUString = peekCWString . castPtr+alloc64k = allocaBytes (1024 * 64)++-- c2hs replacements of utility functions, to get rid of annoying c2hs+-- deprecated messages++-- Passing Enums++cIntFromEnum :: Enum a => a -> CInt+cIntFromEnum = cIntConv . fromEnum++cIntToEnum :: Enum a => CInt -> a+cIntToEnum = toEnum . cIntConv+++-- Passing Booleans by reference+--++withBoolUtil :: (Integral a, Storable a) => Bool -> (Ptr a -> IO b) -> IO b+withBoolUtil  = with . fromBool++peekBoolUtil :: (Integral a, Storable a) => Ptr a -> IO Bool+peekBoolUtil  = liftM toBool . peek+++-- Passing enums by reference+--++withEnumUtil :: (Enum a, Integral b, Storable b) => a -> (Ptr b -> IO c) -> IO c+withEnumUtil  = with . cFromEnum++peekEnumUtil :: (Enum a, Integral b, Storable b) => Ptr b -> IO a+peekEnumUtil  = liftM cToEnum . peek++-- Conversion routines+-- -------------------++-- |Integral conversion+--+cIntConv :: (Integral a, Integral b) => a -> b+cIntConv  = fromIntegral++-- |Floating conversion+--+cFloatConv :: (RealFloat a, RealFloat b) => a -> b+cFloatConv  = realToFrac++-- |Convert a C enumeration to Haskell.+--+cToEnum :: (Integral i, Enum e) => i -> e+cToEnum  = toEnum . fromIntegral++-- |Convert a Haskell enumeration to C.+--+cFromEnum :: (Enum e, Integral i) => e -> i+cFromEnum  = fromIntegral . fromEnum+
− HGamer3D/Bindings/Enet/Utils.hs
@@ -1,136 +0,0 @@--- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell)
--- Edit the ORIGNAL .chs file instead!
-
-
-{-# LINE 1 ".\\HGamer3D\\Bindings\\Enet\\Utils.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
-
--- (c) 2011, 2012 Peter Althainz
--- 
--- Licensed under the Apache License, Version 2.0 (the "License");
--- you may not use this file except in compliance with the License.
--- You may obtain a copy of the License at
--- 
---     http://www.apache.org/licenses/LICENSE-2.0
--- 
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- 
-
-
--- Utils.hs
-
--- Marshalling Utilities
-
-module HGamer3D.Bindings.Enet.Utils where
-
-import Foreign
-import Foreign.Ptr
-import Foreign.C
-
-import HGamer3D.Data.HG3DClass
-import HGamer3D.Data.Vector
-import HGamer3D.Data.Colour
-import HGamer3D.Data.Angle
-
-
-
-import Control.Monad (liftM)
-
--- Strings with explicit length
---
-withCStringLenIntConv :: Num n => String -> ((CString, n) -> IO a) -> IO a
-withCStringLenIntConv s f    = withCStringLen s $ \(p, n) -> f (p, fromIntegral n)
-
-peekCStringLenIntConv :: Integral n => (CString, n) -> IO String
-peekCStringLenIntConv (s, n) = peekCStringLen (s, fromIntegral n)
-
--- Marshalling of numerals
---
-
-withIntConv   :: (Storable b, Integral a, Integral b) 
-              => a -> (Ptr b -> IO c) -> IO c
-withIntConv    = with . fromIntegral
-
-withFloatConv :: (Storable b, RealFloat a, RealFloat b) 
-              => a -> (Ptr b -> IO c) -> IO c
-withFloatConv  = with . realToFrac
-
-peekIntConv   :: (Storable a, Integral a, Integral b) 
-              => Ptr a -> IO b
-peekIntConv    = liftM fromIntegral . peek
-
-peekFloatConv :: (Storable a, RealFloat a, RealFloat b) 
-              => Ptr a -> IO b
-peekFloatConv  = liftM realToFrac . peek
-
-
--- String Conversion functions
---
-
-withCUString b f = withCWString b (f . castPtr)
-peekCUString = peekCWString . castPtr
-alloc64k = allocaBytes (1024 * 64)
-
--- c2hs replacements of utility functions, to get rid of annoying c2hs
--- deprecated messages
-
--- Passing Enums
-
-cIntFromEnum :: Enum a => a -> CInt
-cIntFromEnum = cIntConv . fromEnum
-
-cIntToEnum :: Enum a => CInt -> a
-cIntToEnum = toEnum . cIntConv
-
-
--- Passing Booleans by reference
---
-
-withBoolUtil :: (Integral a, Storable a) => Bool -> (Ptr a -> IO b) -> IO b
-withBoolUtil  = with . fromBool
-
-peekBoolUtil :: (Integral a, Storable a) => Ptr a -> IO Bool
-peekBoolUtil  = liftM toBool . peek
-
-
--- Passing enums by reference
---
-
-withEnumUtil :: (Enum a, Integral b, Storable b) => a -> (Ptr b -> IO c) -> IO c
-withEnumUtil  = with . cFromEnum
-
-peekEnumUtil :: (Enum a, Integral b, Storable b) => Ptr b -> IO a
-peekEnumUtil  = liftM cToEnum . peek
-
--- Conversion routines
--- -------------------
-
--- |Integral conversion
---
-cIntConv :: (Integral a, Integral b) => a -> b
-cIntConv  = fromIntegral
-
--- |Floating conversion
---
-cFloatConv :: (RealFloat a, RealFloat b) => a -> b
-cFloatConv  = realToFrac
-
--- |Convert a C enumeration to Haskell.
---
-cToEnum :: (Integral i, Enum e) => i -> e
-cToEnum  = toEnum . fromIntegral
-
--- |Convert a Haskell enumeration to C.
---
-cFromEnum :: (Enum e, Integral i) => e -> i
-cFromEnum  = fromIntegral . fromEnum
-
LICENSE view
@@ -1,4 +1,4 @@-(c) 2011, 2012 Peter Althainz
+(c) 2011-2014 Peter Althainz
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
Setup.hs view
@@ -1,8 +1,7 @@--- This source file is part of HGamer3D
--- (A project to enable 3D game development in Haskell)
--- For the latest info, see http://www.althainz.de/HGamer3D.html
--- 
--- (c) 2011, 2012 Peter Althainz
+-- This source file is part of HGamer3D, a project to enable 3D game development 
+-- in Haskell. For the latest info, see http://www.hgamer3d.org .
+-- +-- (c) 2011-2014 Peter Althainz
 -- 
 -- Licensed under the Apache License, Version 2.0 (the "License");
 -- you may not use this file except in compliance with the License.
@@ -15,7 +14,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
--- 
+--  -- Setup.hs
 
 import Distribution.Simple
− include/ClassEnet.h
@@ -1,45 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// ClassEnet.h
-
-// 
-
-#include "wchar.h"
-#ifndef _DEFINED_HG3D_ClassEnet
-#define _DEFINED_HG3D_ClassEnet
-
-#include "ClassPtr.h"
-#include "ClassEnetServer.h"
-#include "ClassEnetClient.h"
-
-
-// 
-void enet_enet_construct(struct hg3dclass_struct * result_c);
-
-// 
-void enet_enet_destruct(struct hg3dclass_struct * thisclass_c);
-
-// 
-void enet_enet_createServer(int port_c, struct hg3dclass_struct * result_c);
-
-// 
-void enet_enet_createClient(struct hg3dclass_struct * result_c);
-
-#endif 
− include/ClassEnetClient.h
@@ -1,50 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// ClassEnetClient.h
-
-// 
-
-#include "wchar.h"
-#ifndef _DEFINED_HG3D_ClassEnetClient
-#define _DEFINED_HG3D_ClassEnetClient
-
-#include "ClassPtr.h"
-#include "ClassEnetPacket.h"
-
-
-// 
-void enet_clnt_destruct(struct hg3dclass_struct * thisclass_c);
-
-// 
-void enet_clnt_connect(struct hg3dclass_struct * thisclass_c, char * server_c, int port_c, int * result_c);
-
-// 
-void enet_clnt_disconnect(struct hg3dclass_struct * thisclass_c, int * result_c);
-
-// 
-void enet_clnt_serve(struct hg3dclass_struct * thisclass_c, int msWait_c, int * result_c);
-
-// 
-void enet_clnt_getPacket(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c);
-
-// 
-void enet_clnt_send(struct hg3dclass_struct * thisclass_c, char * message_c, int channel_c);
-
-#endif 
− include/ClassEnetPacket.h
@@ -1,43 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// ClassEnetPacket.h
-
-// 
-
-#include "wchar.h"
-#ifndef _DEFINED_HG3D_ClassEnetPacket
-#define _DEFINED_HG3D_ClassEnetPacket
-
-#include "ClassPtr.h"
-
-
-// 
-void enet_pck_getData(struct hg3dclass_struct * thisclass_c, char * result_c);
-
-// 
-void enet_pck_getPeer(struct hg3dclass_struct * thisclass_c, char * result_c);
-
-// 
-void enet_pck_getChannel(struct hg3dclass_struct * thisclass_c, int * result_c);
-
-// 
-void enet_pck_destruct(struct hg3dclass_struct * thisclass_c);
-
-#endif 
− include/ClassEnetServer.h
@@ -1,44 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// ClassEnetServer.h
-
-// 
-
-#include "wchar.h"
-#ifndef _DEFINED_HG3D_ClassEnetServer
-#define _DEFINED_HG3D_ClassEnetServer
-
-#include "ClassPtr.h"
-#include "ClassEnetPacket.h"
-
-
-// 
-void enet_srv_destruct(struct hg3dclass_struct * thisclass_c);
-
-// 
-void enet_srv_serve(struct hg3dclass_struct * thisclass_c, int msWait_c, int * result_c);
-
-// 
-void enet_srv_getPacket(struct hg3dclass_struct * thisclass_c, struct hg3dclass_struct * result_c);
-
-// 
-void enet_srv_send(struct hg3dclass_struct * thisclass_c, char * peer_c, char * message_c, int channel_c);
-
-#endif 
− include/ClassPtr.h
@@ -1,51 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// ClassPtr.h
-
-// Here are the methods defined, which do the class pointer
-// marshalling and the casting of subclasses to higher classes
-
-#include "wchar.h"
-
-
-#ifndef CLASSPTR_INCLUDE_H
-#define CLASSPTR_INCLUDE_H
-
-typedef struct hg3dclass_struct {
-	void *ptr;
-	void *fptr;
-} hg3dclass_struct;
-
-void *getHG3DClassPtr(hg3dclass_struct inSt, const char* className);
-
-
-typedef void ClassEnetClient; 
-hg3dclass_struct getHG3DClass_EnetClient(void *ptrIn);
-
-typedef void ClassEnetPacket; 
-hg3dclass_struct getHG3DClass_EnetPacket(void *ptrIn);
-
-typedef void ClassEnetServer; 
-hg3dclass_struct getHG3DClass_EnetServer(void *ptrIn);
-
-typedef void ClassHG3DEnet; 
-hg3dclass_struct getHG3DClass_HG3DEnet(void *ptrIn);
-
-#endif
− include/EnetDllDefines.h
@@ -1,41 +0,0 @@-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-
-// EnetDllDefines.h
-
-#ifndef _HGamer3DEnet020_DLLDEFINES_H_
-#define _HGamer3DEnet020_DLLDEFINES_H_
-
-/* Cmake will define HGamer3DEnet020_EXPORTS on Windows when it
-configures to build a shared library. If you are going to use
-another build system on windows or create the visual studio
-projects by hand you need to define MyLibrary_EXPORTS when
-building a DLL on windows.
-*/
-
-// We are using the Visual Studio Compiler and building Shared libraries
-
-#if (defined (_WIN32)) && !(defined (__GNUC__)) 
-  #if defined(HGamer3DEnet020_EXPORTS)
-    #define  Enet_LIB_EXPORT __declspec(dllexport)
-  #else
-    #define  Enet_LIB_EXPORT __declspec(dllimport)
-  #endif /* HGamer3DEnet020_EXPORTS */
-#else /* defined (_WIN32) */
- #define Enet_LIB_EXPORT
-#endif
-
-#endif /* _HGamer3DEnet020_DLLDEFINES_H_ */
− include/StructHG3DClass.h
@@ -1,30 +0,0 @@-// This source file is part of HGamer3D
-// (A project to enable 3D game development in Haskell)
-// For the latest info, see http://www.althainz.de/HGamer3D.html
-// 
-// (c) 2011, 2012 Peter Althainz
-// 
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// 
-//     http://www.apache.org/licenses/LICENSE-2.0
-// 
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// 
-
-// StructHG3DClass.h
-
-// 
-
-#include "wchar.h"
-
-
-typedef struct hg3dclass_struct {
-	void *ptr;
-	void *fptr;
-} hg3dclass_struct;
+ include/hg3dstruct.h view
@@ -0,0 +1,4 @@+typedef struct hg3dclass_struct {+	void *ptr;+	void *fptr;+} hg3dclass_struct;