{-# LINE 1 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
{-# LANGUAGE CPP #-}

module Database.EJDB2.Bindings.Types.EJDBExec where


import           Prelude           hiding ( log )

import           Foreign
import           Foreign.C.String
import           Foreign.C.Types

import           Database.EJDB2.Bindings.Types.EJDB
import           Database.EJDB2.Bindings.JQL
import           Database.EJDB2.Bindings.Types.EJDBDoc
import           Database.EJDB2.Result



type EJDBExecVisitor = Ptr EJDBExec -> Ptr EJDBDoc -> Ptr CIntMax -> IO RC
type EJDB_EXEC_VISITOR = FunPtr EJDBExecVisitor

type IWXSTR = Ptr ()
type IWPOOL = Ptr ()

data EJDBExec = EJDBExec { EJDBExec -> EJDB
db :: !EJDB
                         , EJDBExec -> EJDB
q :: !JQL
                         , EJDBExec -> EJDB_EXEC_VISITOR
visitor :: !EJDB_EXEC_VISITOR
                         , EJDBExec -> EJDB
opaque :: !(Ptr ())
                         , EJDBExec -> CIntMax
skip :: !CIntMax
                         , EJDBExec -> CIntMax
limit :: !CIntMax
                         , EJDBExec -> CIntMax
cnt :: !CIntMax
                         , EJDBExec -> EJDB
log :: !IWXSTR
                         , EJDBExec -> EJDB
pool :: !IWPOOL }

minimal :: EJDB -> JQL -> EJDB_EXEC_VISITOR -> EJDBExec
minimal :: EJDB -> EJDB -> EJDB_EXEC_VISITOR -> EJDBExec
minimal db :: EJDB
db q :: EJDB
q visitor :: EJDB_EXEC_VISITOR
visitor = $WEJDBExec :: EJDB
-> EJDB
-> EJDB_EXEC_VISITOR
-> EJDB
-> CIntMax
-> CIntMax
-> CIntMax
-> EJDB
-> EJDB
-> EJDBExec
EJDBExec { db :: EJDB
db = EJDB
db
                                , q :: EJDB
q = EJDB
q
                                , visitor :: EJDB_EXEC_VISITOR
visitor = EJDB_EXEC_VISITOR
visitor
                                , opaque :: EJDB
opaque = EJDB
forall a. Ptr a
nullPtr
                                , skip :: CIntMax
skip = 0
                                , limit :: CIntMax
limit = 0
                                , cnt :: CIntMax
cnt = 0
                                , log :: EJDB
log = EJDB
forall a. Ptr a
nullPtr
                                , pool :: EJDB
pool = EJDB
forall a. Ptr a
nullPtr }

zero :: EJDBExec
zero :: EJDBExec
zero = $WEJDBExec :: EJDB
-> EJDB
-> EJDB_EXEC_VISITOR
-> EJDB
-> CIntMax
-> CIntMax
-> CIntMax
-> EJDB
-> EJDB
-> EJDBExec
EJDBExec { db :: EJDB
db = EJDB
forall a. Ptr a
nullPtr
                , q :: EJDB
q = EJDB
forall a. Ptr a
nullPtr
                , visitor :: EJDB_EXEC_VISITOR
visitor = EJDB_EXEC_VISITOR
forall a. FunPtr a
nullFunPtr
                , opaque :: EJDB
opaque = EJDB
forall a. Ptr a
nullPtr
                , skip :: CIntMax
skip = 0
                , limit :: CIntMax
limit = 0
                , cnt :: CIntMax
cnt = 0
                , log :: EJDB
log = EJDB
forall a. Ptr a
nullPtr
                , pool :: EJDB
pool = EJDB
forall a. Ptr a
nullPtr }

instance Storable EJDBExec where
        sizeOf :: EJDBExec -> Int
sizeOf _ = (72)
{-# LINE 59 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
        alignment :: EJDBExec -> Int
alignment _ = 8
{-# LINE 60 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
        peek :: Ptr EJDBExec -> IO EJDBExec
peek ptr :: Ptr EJDBExec
ptr = do
           EJDB
db <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 0) Ptr EJDBExec
ptr
{-# LINE 62 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDB
q <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 8) Ptr EJDBExec
ptr
{-# LINE 63 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDB_EXEC_VISITOR
visitor <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB_EXEC_VISITOR
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 16) Ptr EJDBExec
ptr
{-# LINE 64 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDB
opaque <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 24) Ptr EJDBExec
ptr
{-# LINE 65 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           CIntMax
skip <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO CIntMax
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 32) Ptr EJDBExec
ptr
{-# LINE 66 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           CIntMax
limit <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO CIntMax
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 40) Ptr EJDBExec
ptr
{-# LINE 67 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           CIntMax
cnt <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO CIntMax
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 48) Ptr EJDBExec
ptr
{-# LINE 68 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDB
log <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 56) Ptr EJDBExec
ptr
{-# LINE 69 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDB
pool <- (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> IO EJDB
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBExec
hsc_ptr 64) Ptr EJDBExec
ptr
{-# LINE 70 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           EJDBExec -> IO EJDBExec
forall (m :: * -> *) a. Monad m => a -> m a
return (EJDBExec -> IO EJDBExec) -> EJDBExec -> IO EJDBExec
forall a b. (a -> b) -> a -> b
$ EJDB
-> EJDB
-> EJDB_EXEC_VISITOR
-> EJDB
-> CIntMax
-> CIntMax
-> CIntMax
-> EJDB
-> EJDB
-> EJDBExec
EJDBExec EJDB
db EJDB
q EJDB_EXEC_VISITOR
visitor EJDB
opaque CIntMax
skip CIntMax
limit CIntMax
cnt EJDB
log EJDB
pool
        poke :: Ptr EJDBExec -> EJDBExec -> IO ()
poke ptr :: Ptr EJDBExec
ptr (EJDBExec db :: EJDB
db q :: EJDB
q visitor :: EJDB_EXEC_VISITOR
visitor opaque :: EJDB
opaque skip :: CIntMax
skip limit :: CIntMax
limit cnt :: CIntMax
cnt log :: EJDB
log pool :: EJDB
pool) = do
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 0) Ptr EJDBExec
ptr EJDB
db
{-# LINE 73 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 8) Ptr EJDBExec
ptr EJDB
q
{-# LINE 74 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB_EXEC_VISITOR -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 16) Ptr EJDBExec
ptr EJDB_EXEC_VISITOR
visitor
{-# LINE 75 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 24) Ptr EJDBExec
ptr EJDB
opaque
{-# LINE 76 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> CIntMax -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 32) Ptr EJDBExec
ptr CIntMax
skip
{-# LINE 77 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> CIntMax -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 40) Ptr EJDBExec
ptr CIntMax
limit
{-# LINE 78 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> CIntMax -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 48) Ptr EJDBExec
ptr CIntMax
cnt
{-# LINE 79 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 56) Ptr EJDBExec
ptr EJDB
log
{-# LINE 80 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}
           (\hsc_ptr :: Ptr EJDBExec
hsc_ptr -> Ptr EJDBExec -> Int -> EJDB -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBExec
hsc_ptr 64) Ptr EJDBExec
ptr EJDB
pool
{-# LINE 81 "src/Database/EJDB2/Bindings/Types/EJDBExec.hsc" #-}