{-# 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 EJDB
db EJDB
q EJDB_EXEC_VISITOR
visitor = EJDBExec :: 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 = CIntMax
0
                                , limit :: CIntMax
limit = CIntMax
0
                                , cnt :: CIntMax
cnt = CIntMax
0
                                , log :: EJDB
log = EJDB
forall a. Ptr a
nullPtr
                                , pool :: EJDB
pool = EJDB
forall a. Ptr a
nullPtr }

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