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

module Database.EJDB2.Bindings.Types.EJDBDoc where

import           Foreign
import           Foreign.C.Types

import           Database.EJDB2.Bindings.JBL



data EJDBDoc = EJDBDoc { EJDBDoc -> CIntMax
id :: !CIntMax
                       , EJDBDoc -> JBL
raw :: !JBL
                       , EJDBDoc -> JBL
node :: !JBLNode
                       , EJDBDoc -> Ptr EJDBDoc
next :: !(Ptr EJDBDoc)
                       , EJDBDoc -> Ptr EJDBDoc
prev :: !(Ptr EJDBDoc) }

instance Storable EJDBDoc where
        sizeOf :: EJDBDoc -> Int
sizeOf EJDBDoc
_ = (Int
40)
{-# LINE 20 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
        alignment :: EJDBDoc -> Int
alignment EJDBDoc
_ = Int
8
{-# LINE 21 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
        peek :: Ptr EJDBDoc -> IO EJDBDoc
peek Ptr EJDBDoc
ptr = do
           CIntMax
id <- (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO CIntMax
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr Int
0) Ptr EJDBDoc
ptr
{-# LINE 23 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           JBL
raw <- (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO JBL
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr Int
8) Ptr EJDBDoc
ptr
{-# LINE 24 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           JBL
node <- (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO JBL
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr Int
16) Ptr EJDBDoc
ptr
{-# LINE 25 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           Ptr EJDBDoc
next <- (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO (Ptr EJDBDoc)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr Int
24) Ptr EJDBDoc
ptr
{-# LINE 26 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           Ptr EJDBDoc
prev <- (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO (Ptr EJDBDoc)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr Int
32) Ptr EJDBDoc
ptr
{-# LINE 27 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           EJDBDoc -> IO EJDBDoc
forall (m :: * -> *) a. Monad m => a -> m a
return (EJDBDoc -> IO EJDBDoc) -> EJDBDoc -> IO EJDBDoc
forall a b. (a -> b) -> a -> b
$ CIntMax -> JBL -> JBL -> Ptr EJDBDoc -> Ptr EJDBDoc -> EJDBDoc
EJDBDoc CIntMax
id JBL
raw JBL
node Ptr EJDBDoc
next Ptr EJDBDoc
prev
        poke :: Ptr EJDBDoc -> EJDBDoc -> IO ()
poke Ptr EJDBDoc
ptr (EJDBDoc CIntMax
id JBL
raw JBL
node Ptr EJDBDoc
next Ptr EJDBDoc
prev) = do
           (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> CIntMax -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr Int
0) Ptr EJDBDoc
ptr CIntMax
id
{-# LINE 30 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> JBL -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr Int
8) Ptr EJDBDoc
ptr JBL
raw
{-# LINE 31 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> JBL -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr Int
16) Ptr EJDBDoc
ptr JBL
node
{-# LINE 32 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> Ptr EJDBDoc -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr Int
24) Ptr EJDBDoc
ptr Ptr EJDBDoc
next
{-# LINE 33 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> Ptr EJDBDoc -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr Int
32) Ptr EJDBDoc
ptr Ptr EJDBDoc
prev
{-# LINE 34 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}