{-# 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 _ = (40)
{-# LINE 20 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
        alignment :: EJDBDoc -> Int
alignment _ = 8
{-# LINE 21 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
        peek :: Ptr EJDBDoc -> IO EJDBDoc
peek ptr :: Ptr EJDBDoc
ptr = do
           CIntMax
id <- (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO CIntMax
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr 0) Ptr EJDBDoc
ptr
{-# LINE 23 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           JBL
raw <- (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO JBL
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr 8) Ptr EJDBDoc
ptr
{-# LINE 24 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           JBL
node <- (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> IO JBL
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr EJDBDoc
hsc_ptr 16) Ptr EJDBDoc
ptr
{-# LINE 25 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           Ptr EJDBDoc
next <- (\hsc_ptr :: 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 24) Ptr EJDBDoc
ptr
{-# LINE 26 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           Ptr EJDBDoc
prev <- (\hsc_ptr :: 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 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 :: Ptr EJDBDoc
ptr (EJDBDoc id :: CIntMax
id raw :: JBL
raw node :: JBL
node next :: Ptr EJDBDoc
next prev :: Ptr EJDBDoc
prev) = do
           (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> CIntMax -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr 0) Ptr EJDBDoc
ptr CIntMax
id
{-# LINE 30 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> JBL -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr 8) Ptr EJDBDoc
ptr JBL
raw
{-# LINE 31 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\hsc_ptr :: Ptr EJDBDoc
hsc_ptr -> Ptr EJDBDoc -> Int -> JBL -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr EJDBDoc
hsc_ptr 16) Ptr EJDBDoc
ptr JBL
node
{-# LINE 32 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\hsc_ptr :: 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 24) Ptr EJDBDoc
ptr Ptr EJDBDoc
next
{-# LINE 33 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}
           (\hsc_ptr :: 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 32) Ptr EJDBDoc
ptr Ptr EJDBDoc
prev
{-# LINE 34 "src/Database/EJDB2/Bindings/Types/EJDBDoc.hsc" #-}