module Database.SednaDB.Internal.SednaCBindings where
import Foreign
import Foreign.C.Types
import Foreign.C.String
import Database.SednaDB.Internal.SpDefs
c'QUERY_EXECUTION_TIME = 1024
c'QUERY_EXECUTION_TIME :: (Num a) => a
c'BULK_LOAD_PORTION = 10235
c'BULK_LOAD_PORTION :: (Num a) => a
data C'conn_bulk_load = C'conn_bulk_load{
c'conn_bulk_load'bulk_load_started :: CChar,
c'conn_bulk_load'doc_name :: [CChar],
c'conn_bulk_load'col_name :: [CChar]
} deriving (Eq,Show)
p'conn_bulk_load'bulk_load_started p = plusPtr p 0
p'conn_bulk_load'bulk_load_started :: Ptr (C'conn_bulk_load) -> Ptr (CChar)
p'conn_bulk_load'doc_name p = plusPtr p 1
p'conn_bulk_load'doc_name :: Ptr (C'conn_bulk_load) -> Ptr (CChar)
p'conn_bulk_load'col_name p = plusPtr p 513
p'conn_bulk_load'col_name :: Ptr (C'conn_bulk_load) -> Ptr (CChar)
instance Storable C'conn_bulk_load where
sizeOf _ = 1025
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekArray 512 (plusPtr p 1)
v2 <- peekArray 512 (plusPtr p 513)
return $ C'conn_bulk_load v0 v1 v2
poke p (C'conn_bulk_load v0 v1 v2) = do
pokeByteOff p 0 v0
pokeArray (plusPtr p 1) (take 512 v1)
pokeArray (plusPtr p 513) (take 512 v2)
return ()
type C'debug_handler_t = FunPtr (FunPtr (C'se_debug_info_type -> CString -> IO ()))
foreign import ccall "wrapper" mk'debug_handler_t
:: (FunPtr (C'se_debug_info_type -> CString -> IO ())) -> IO C'debug_handler_t
foreign import ccall "dynamic" mK'debug_handler_t
:: C'debug_handler_t -> (FunPtr (C'se_debug_info_type -> CString -> IO ()))
data C'SednaConnection = C'SednaConnection{
c'SednaConnection'url :: [CChar],
c'SednaConnection'db_name :: [CChar],
c'SednaConnection'login :: [CChar],
c'SednaConnection'password :: [CChar],
c'SednaConnection'session_directory :: [CChar],
c'SednaConnection'socket :: CInt,
c'SednaConnection'last_error :: CInt,
c'SednaConnection'last_error_msg :: [CChar],
c'SednaConnection'query_time :: [CChar],
c'SednaConnection'socket_keeps_data :: CChar,
c'SednaConnection'first_next :: CChar,
c'SednaConnection'result_end :: CChar,
c'SednaConnection'in_query :: CChar,
c'SednaConnection'cbl :: C'conn_bulk_load,
c'SednaConnection'isInTransaction :: CInt,
c'SednaConnection'isConnectionOk :: CInt,
c'SednaConnection'autocommit :: CInt,
c'SednaConnection'local_data_length :: CInt,
c'SednaConnection'local_data_offset :: CInt,
c'SednaConnection'local_data_buf :: [CChar],
c'SednaConnection'msg :: C'msg_struct,
c'SednaConnection'debug_handler :: C'debug_handler_t,
c'SednaConnection'boundary_space_preserve :: CChar,
c'SednaConnection'query_timeout :: CInt,
c'SednaConnection'max_result_size :: CInt
} deriving (Eq,Show)
p'SednaConnection'url p = plusPtr p 0
p'SednaConnection'url :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'db_name p = plusPtr p 256
p'SednaConnection'db_name :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'login p = plusPtr p 768
p'SednaConnection'login :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'password p = plusPtr p 1280
p'SednaConnection'password :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'session_directory p = plusPtr p 1792
p'SednaConnection'session_directory :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'socket p = plusPtr p 2048
p'SednaConnection'socket :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'last_error p = plusPtr p 2052
p'SednaConnection'last_error :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'last_error_msg p = plusPtr p 2056
p'SednaConnection'last_error_msg :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'query_time p = plusPtr p 12296
p'SednaConnection'query_time :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'socket_keeps_data p = plusPtr p 13320
p'SednaConnection'socket_keeps_data :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'first_next p = plusPtr p 13321
p'SednaConnection'first_next :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'result_end p = plusPtr p 13322
p'SednaConnection'result_end :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'in_query p = plusPtr p 13323
p'SednaConnection'in_query :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'cbl p = plusPtr p 13324
p'SednaConnection'cbl :: Ptr (C'SednaConnection) -> Ptr (C'conn_bulk_load)
p'SednaConnection'isInTransaction p = plusPtr p 14352
p'SednaConnection'isInTransaction :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'isConnectionOk p = plusPtr p 14356
p'SednaConnection'isConnectionOk :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'autocommit p = plusPtr p 14360
p'SednaConnection'autocommit :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'local_data_length p = plusPtr p 14364
p'SednaConnection'local_data_length :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'local_data_offset p = plusPtr p 14368
p'SednaConnection'local_data_offset :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'local_data_buf p = plusPtr p 14372
p'SednaConnection'local_data_buf :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'msg p = plusPtr p 24612
p'SednaConnection'msg :: Ptr (C'SednaConnection) -> Ptr (C'msg_struct)
p'SednaConnection'debug_handler p = plusPtr p 34860
p'SednaConnection'debug_handler :: Ptr (C'SednaConnection) -> Ptr (C'debug_handler_t)
p'SednaConnection'boundary_space_preserve p = plusPtr p 34864
p'SednaConnection'boundary_space_preserve :: Ptr (C'SednaConnection) -> Ptr (CChar)
p'SednaConnection'query_timeout p = plusPtr p 34868
p'SednaConnection'query_timeout :: Ptr (C'SednaConnection) -> Ptr (CInt)
p'SednaConnection'max_result_size p = plusPtr p 34872
p'SednaConnection'max_result_size :: Ptr (C'SednaConnection) -> Ptr (CInt)
instance Storable C'SednaConnection where
sizeOf _ = 34876
alignment = sizeOf
peek p = do
v0 <- peekArray 256 (plusPtr p 0)
v1 <- peekArray 512 (plusPtr p 256)
v2 <- peekArray 512 (plusPtr p 768)
v3 <- peekArray 512 (plusPtr p 1280)
v4 <- peekArray 256 (plusPtr p 1792)
v5 <- peekByteOff p 2048
v6 <- peekByteOff p 2052
v7 <- peekArray 10240 (plusPtr p 2056)
v8 <- peekArray 1024 (plusPtr p 12296)
v9 <- peekByteOff p 13320
v10 <- peekByteOff p 13321
v11 <- peekByteOff p 13322
v12 <- peekByteOff p 13323
v13 <- peekByteOff p 13324
v14 <- peekByteOff p 14352
v15 <- peekByteOff p 14356
v16 <- peekByteOff p 14360
v17 <- peekByteOff p 14364
v18 <- peekByteOff p 14368
v19 <- peekArray 10240 (plusPtr p 14372)
v20 <- peekByteOff p 24612
v21 <- peekByteOff p 34860
v22 <- peekByteOff p 34864
v23 <- peekByteOff p 34868
v24 <- peekByteOff p 34872
return $ C'SednaConnection v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24
poke p (C'SednaConnection v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24) = do
pokeArray (plusPtr p 0) (take 256 v0)
pokeArray (plusPtr p 256) (take 512 v1)
pokeArray (plusPtr p 768) (take 512 v2)
pokeArray (plusPtr p 1280) (take 512 v3)
pokeArray (plusPtr p 1792) (take 256 v4)
pokeByteOff p 2048 v5
pokeByteOff p 2052 v6
pokeArray (plusPtr p 2056) (take 10240 v7)
pokeArray (plusPtr p 12296) (take 1024 v8)
pokeByteOff p 13320 v9
pokeByteOff p 13321 v10
pokeByteOff p 13322 v11
pokeByteOff p 13323 v12
pokeByteOff p 13324 v13
pokeByteOff p 14352 v14
pokeByteOff p 14356 v15
pokeByteOff p 14360 v16
pokeByteOff p 14364 v17
pokeByteOff p 14368 v18
pokeArray (plusPtr p 14372) (take 10240 v19)
pokeByteOff p 24612 v20
pokeByteOff p 34860 v21
pokeByteOff p 34864 v22
pokeByteOff p 34868 v23
pokeByteOff p 34872 v24
return ()
foreign import ccall "SEconnect" c'SEconnect
:: Ptr C'SednaConnection -> CString -> CString -> CString -> CString -> IO CInt
foreign import ccall "&SEconnect" p'SEconnect
:: FunPtr (Ptr C'SednaConnection -> CString -> CString -> CString -> CString -> IO CInt)
foreign import ccall "SEclose" c'SEclose
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEclose" p'SEclose
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEbegin" c'SEbegin
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEbegin" p'SEbegin
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SErollback" c'SErollback
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SErollback" p'SErollback
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEcommit" c'SEcommit
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEcommit" p'SEcommit
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEexecuteLong" c'SEexecuteLong
:: Ptr C'SednaConnection -> CString -> IO CInt
foreign import ccall "&SEexecuteLong" p'SEexecuteLong
:: FunPtr (Ptr C'SednaConnection -> CString -> IO CInt)
foreign import ccall "SEexecute" c'SEexecute
:: Ptr C'SednaConnection -> CString -> IO CInt
foreign import ccall "&SEexecute" p'SEexecute
:: FunPtr (Ptr C'SednaConnection -> CString -> IO CInt)
foreign import ccall "SEgetData" c'SEgetData
:: Ptr C'SednaConnection -> CString -> CInt -> IO CInt
foreign import ccall "&SEgetData" p'SEgetData
:: FunPtr (Ptr C'SednaConnection -> CString -> CInt -> IO CInt)
foreign import ccall "SEloadData" c'SEloadData
:: Ptr C'SednaConnection -> CString -> CInt -> CString -> CString -> IO CInt
foreign import ccall "&SEloadData" p'SEloadData
:: FunPtr (Ptr C'SednaConnection -> CString -> CInt -> CString -> CString -> IO CInt)
foreign import ccall "SEendLoadData" c'SEendLoadData
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEendLoadData" p'SEendLoadData
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEnext" c'SEnext
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEnext" p'SEnext
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEgetLastErrorCode" c'SEgetLastErrorCode
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEgetLastErrorCode" p'SEgetLastErrorCode
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEgetLastErrorMsg" c'SEgetLastErrorMsg
:: Ptr C'SednaConnection -> IO CString
foreign import ccall "&SEgetLastErrorMsg" p'SEgetLastErrorMsg
:: FunPtr (Ptr C'SednaConnection -> IO CString)
foreign import ccall "SEconnectionStatus" c'SEconnectionStatus
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEconnectionStatus" p'SEconnectionStatus
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEtransactionStatus" c'SEtransactionStatus
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEtransactionStatus" p'SEtransactionStatus
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEshowTime" c'SEshowTime
:: Ptr C'SednaConnection -> IO CString
foreign import ccall "&SEshowTime" p'SEshowTime
:: FunPtr (Ptr C'SednaConnection -> IO CString)
foreign import ccall "SEsetConnectionAttr" c'SEsetConnectionAttr
:: Ptr C'SednaConnection -> CUInt -> Ptr () -> CInt -> IO CInt
foreign import ccall "&SEsetConnectionAttr" p'SEsetConnectionAttr
:: FunPtr (Ptr C'SednaConnection -> CUInt -> Ptr () -> CInt -> IO CInt)
foreign import ccall "SEgetConnectionAttr" c'SEgetConnectionAttr
:: Ptr C'SednaConnection -> CUInt -> Ptr () -> Ptr CInt -> IO CInt
foreign import ccall "&SEgetConnectionAttr" p'SEgetConnectionAttr
:: FunPtr (Ptr C'SednaConnection -> CUInt -> Ptr () -> Ptr CInt -> IO CInt)
foreign import ccall "SEresetAllConnectionAttr" c'SEresetAllConnectionAttr
:: Ptr C'SednaConnection -> IO CInt
foreign import ccall "&SEresetAllConnectionAttr" p'SEresetAllConnectionAttr
:: FunPtr (Ptr C'SednaConnection -> IO CInt)
foreign import ccall "SEsetDebugHandler" c'SEsetDebugHandler
:: Ptr C'SednaConnection -> C'debug_handler_t -> Ptr ()
foreign import ccall "&SEsetDebugHandler" p'SEsetDebugHandler
:: FunPtr (Ptr C'SednaConnection -> C'debug_handler_t -> Ptr ())