packages feed

bindings-monetdb-mapi (empty) → 0.1.0.0

raw patch · 5 files changed

+105/−0 lines, 5 filesdep +basesetup-changed

Dependencies added: base

Files

+ ChangeLog.md view
@@ -0,0 +1,5 @@+# Revision history for bindings-monetdb-mapi++## 0.1.0.0  -- YYYY-mm-dd++* First version. Released on an unsuspecting world.
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2016, Moritz Bruder++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.++    * Neither the name of Moritz Bruder nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++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.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ bindings-monetdb-mapi.cabal view
@@ -0,0 +1,26 @@+name:                bindings-monetdb-mapi+version:             0.1.0.0+synopsis:            Low-level bindings for the MonetDB API (mapi)+-- description:         +license:             BSD3+license-file:        LICENSE+author:              Moritz Bruder+maintainer:          muesli4@gmail.com+-- copyright:           +category:            Database+build-type:          Simple+extra-source-files:  ChangeLog.md+cabal-version:       >=1.10++source-repository head+  type:              git+  location:          git://github.com/muesli4/bindings-monetdb-mapi.git++library+  exposed-modules:     Bindings.MonetDB.Mapi+  -- other-modules:       +  -- other-extensions:    +  pkgconfig-depends:   monetdb-mapi == 11.*+  build-depends:       base >=4.8 && <4.10+  hs-source-dirs:      src+  default-language:    Haskell2010
+ src/Bindings/MonetDB/Mapi.hs view
@@ -0,0 +1,42 @@+{-# LANGUAGE ForeignFunctionInterface #-}+module Bindings.MonetDB.Mapi where++import Foreign+import Foreign.C.Types+import Foreign.C.String++type MapiMsg = CInt++cMOK, cMERROR, cMTIMEOUT, cMMORE, cMSERVER :: MapiMsg+cMOK      = 0+cMERROR   = (-1)+cMTIMEOUT = (-2)+cMMORE    = (-3)+cMSERVER  = (-4)++type Mapi = Ptr ()++type MapiHdl = Ptr ()++foreign import ccall "mapi.h mapi_connect" mapi_connect+    :: Ptr CChar+    -> CInt+    -> Ptr CChar+    -> Ptr CChar+    -> Ptr CChar+    -> Ptr CChar+    -> IO Mapi++foreign import ccall "mapi.h mapi_disconnect" mapi_disconnect :: Mapi -> IO ()+foreign import ccall "mapi.h mapi_query" mapi_query :: Mapi -> Ptr CChar -> IO MapiHdl+foreign import ccall "mapi.h mapi_close_handle" mapi_close_handle :: MapiHdl -> IO ()+foreign import ccall "mapi.h mapi_execute" mapi_execute :: MapiHdl -> IO MapiMsg+foreign import ccall "mapi.h mapi_fetch_row" mapi_fetch_row :: MapiHdl -> IO CInt+foreign import ccall "mapi.h mapi_get_field_count" mapi_get_field_count :: MapiHdl -> IO CInt+foreign import ccall "mapi.h mapi_fetch_field" mapi_fetch_field :: MapiHdl -> CInt -> IO (Ptr CChar)+foreign import ccall "mapi.h mapi_fetch_field_len" mapi_fetch_field_len :: MapiHdl -> CInt -> IO CSize+foreign import ccall "mapi.h mapi_error" mapi_error :: Mapi -> IO CInt+foreign import ccall "mapi.h mapi_error_str" mapi_error_str :: Mapi -> IO (Ptr CChar)+foreign import ccall "mapi.h mapi_result_error" mapi_result_error :: MapiHdl -> IO (Ptr CChar)+foreign import ccall "mapi.h mapi_get_name" mapi_get_name :: MapiHdl -> CInt -> IO (Ptr CChar)+