    {-# LINE 1 "Debian/Dpkg/Types.hsc" #-}
    {-
    {-# LINE 2 "Debian/Dpkg/Types.hsc" #-}
     Types.hsc: Haskell bindings to libdpkg
       Copyright (C) 2011-2012 Clint Adams

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
    -}

    {-# LANGUAGE CPP, ForeignFunctionInterface #-}

    {-# LINE 23 "Debian/Dpkg/Types.hsc" #-}

    module Debian.Dpkg.Types where
    import Foreign.Ptr (Ptr,FunPtr,plusPtr)
    import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
    import Foreign.Storable
    import Foreign.C.Types
    import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
    import Foreign.Marshal.Alloc (alloca)
    import Foreign.Marshal.Array (peekArray,pokeArray)
    import Data.Int
    import Data.Word

    {-# LINE 26 "Debian/Dpkg/Types.hsc" #-}

    import Data.ByteString as BS

    {-# LINE 30 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 31 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 33 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 34 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 35 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 36 "Debian/Dpkg/Types.hsc" #-}
    data C'dpkg_version = C'dpkg_version{
      c'dpkg_version'epoch :: CInt,
      c'dpkg_version'version :: CString,
      c'dpkg_version'revision :: CString
    } deriving (Eq,Show)
    p'dpkg_version'epoch p = plusPtr p 0
    p'dpkg_version'epoch :: Ptr (C'dpkg_version) -> Ptr (CInt)
    p'dpkg_version'version p = plusPtr p 8
    p'dpkg_version'version :: Ptr (C'dpkg_version) -> Ptr (CString)
    p'dpkg_version'revision p = plusPtr p 16
    p'dpkg_version'revision :: Ptr (C'dpkg_version) -> Ptr (CString)
    instance Storable C'dpkg_version where
      sizeOf _ = 24
      alignment _ = 8
      peek _p = do
        v0 <- peekByteOff _p 0
        v1 <- peekByteOff _p 8
        v2 <- peekByteOff _p 16
        return $ C'dpkg_version v0 v1 v2
      poke _p (C'dpkg_version v0 v1 v2) = do
        pokeByteOff _p 0 v0
        pokeByteOff _p 8 v1
        pokeByteOff _p 16 v2
        return ()

    {-# LINE 37 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 39 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 40 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 41 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 42 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 43 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 44 "Debian/Dpkg/Types.hsc" #-}
    data C'filedetails = C'filedetails{
      c'filedetails'next :: Ptr C'filedetails,
      c'filedetails'name :: CString,
      c'filedetails'msdosname :: CString,
      c'filedetails'size :: CString,
      c'filedetails'md5sum :: CString
    } deriving (Eq,Show)
    p'filedetails'next p = plusPtr p 0
    p'filedetails'next :: Ptr (C'filedetails) -> Ptr (Ptr C'filedetails)
    p'filedetails'name p = plusPtr p 8
    p'filedetails'name :: Ptr (C'filedetails) -> Ptr (CString)
    p'filedetails'msdosname p = plusPtr p 16
    p'filedetails'msdosname :: Ptr (C'filedetails) -> Ptr (CString)
    p'filedetails'size p = plusPtr p 24
    p'filedetails'size :: Ptr (C'filedetails) -> Ptr (CString)
    p'filedetails'md5sum p = plusPtr p 32
    p'filedetails'md5sum :: Ptr (C'filedetails) -> Ptr (CString)
    instance Storable C'filedetails where
      sizeOf _ = 40
      alignment _ = 8
      peek _p = do
        v0 <- peekByteOff _p 0
        v1 <- peekByteOff _p 8
        v2 <- peekByteOff _p 16
        v3 <- peekByteOff _p 24
        v4 <- peekByteOff _p 32
        return $ C'filedetails v0 v1 v2 v3 v4
      poke _p (C'filedetails v0 v1 v2 v3 v4) = do
        pokeByteOff _p 0 v0
        pokeByteOff _p 8 v1
        pokeByteOff _p 16 v2
        pokeByteOff _p 24 v3
        pokeByteOff _p 32 v4
        return ()

    {-# LINE 45 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 47 "Debian/Dpkg/Types.hsc" #-}
    data C'pkgbin = C'pkgbin{
    } deriving (Eq,Show)
    instance Storable C'pkgbin where
      sizeOf _ = 120
      alignment _ = 8
      peek _p = do
        return $ C'pkgbin
      poke _p (C'pkgbin) = do
        return ()

    {-# LINE 48 "Debian/Dpkg/Types.hsc" #-}

    data C'perpackagestate = C'perpackagestate

    {-# LINE 50 "Debian/Dpkg/Types.hsc" #-}

    type C'pkgwant = CUInt

    {-# LINE 52 "Debian/Dpkg/Types.hsc" #-}
    type C'pkgeflag = CUInt

    {-# LINE 53 "Debian/Dpkg/Types.hsc" #-}
    type C'pkgstatus = CUInt

    {-# LINE 54 "Debian/Dpkg/Types.hsc" #-}
    type C'pkgpriority = CInt

    {-# LINE 55 "Debian/Dpkg/Types.hsc" #-}

    data C'pkgiterator = C'pkgiterator

    {-# LINE 57 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 59 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 60 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 61 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 62 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 63 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 64 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 65 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 66 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 67 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 68 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 69 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 70 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 71 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 72 "Debian/Dpkg/Types.hsc" #-}
    data C'pkginfo = C'pkginfo{
      c'pkginfo'set :: Ptr C'pkgset,
      c'pkginfo'arch_next :: Ptr C'pkginfo,
      c'pkginfo'want :: C'pkgwant,
      c'pkginfo'eflag :: C'pkgeflag,
      c'pkginfo'status :: C'pkgstatus,
      c'pkginfo'priority :: C'pkgpriority,
      c'pkginfo'otherpriority :: CString,
      c'pkginfo'section :: CString,
      c'pkginfo'configversion :: C'dpkg_version,
      c'pkginfo'files :: Ptr C'filedetails,
      c'pkginfo'installed :: C'pkgbin,
      c'pkginfo'available :: C'pkgbin,
      c'pkginfo'clientdata :: Ptr C'perpackagestate
    } deriving (Eq,Show)
    p'pkginfo'set p = plusPtr p 0
    p'pkginfo'set :: Ptr (C'pkginfo) -> Ptr (Ptr C'pkgset)
    p'pkginfo'arch_next p = plusPtr p 8
    p'pkginfo'arch_next :: Ptr (C'pkginfo) -> Ptr (Ptr C'pkginfo)
    p'pkginfo'want p = plusPtr p 16
    p'pkginfo'want :: Ptr (C'pkginfo) -> Ptr (C'pkgwant)
    p'pkginfo'eflag p = plusPtr p 20
    p'pkginfo'eflag :: Ptr (C'pkginfo) -> Ptr (C'pkgeflag)
    p'pkginfo'status p = plusPtr p 24
    p'pkginfo'status :: Ptr (C'pkginfo) -> Ptr (C'pkgstatus)
    p'pkginfo'priority p = plusPtr p 28
    p'pkginfo'priority :: Ptr (C'pkginfo) -> Ptr (C'pkgpriority)
    p'pkginfo'otherpriority p = plusPtr p 32
    p'pkginfo'otherpriority :: Ptr (C'pkginfo) -> Ptr (CString)
    p'pkginfo'section p = plusPtr p 40
    p'pkginfo'section :: Ptr (C'pkginfo) -> Ptr (CString)
    p'pkginfo'configversion p = plusPtr p 48
    p'pkginfo'configversion :: Ptr (C'pkginfo) -> Ptr (C'dpkg_version)
    p'pkginfo'files p = plusPtr p 72
    p'pkginfo'files :: Ptr (C'pkginfo) -> Ptr (Ptr C'filedetails)
    p'pkginfo'installed p = plusPtr p 80
    p'pkginfo'installed :: Ptr (C'pkginfo) -> Ptr (C'pkgbin)
    p'pkginfo'available p = plusPtr p 200
    p'pkginfo'available :: Ptr (C'pkginfo) -> Ptr (C'pkgbin)
    p'pkginfo'clientdata p = plusPtr p 320
    p'pkginfo'clientdata :: Ptr (C'pkginfo) -> Ptr (Ptr C'perpackagestate)
    instance Storable C'pkginfo where
      sizeOf _ = 360
      alignment _ = 8
      peek _p = do
        v0 <- peekByteOff _p 0
        v1 <- peekByteOff _p 8
        v2 <- peekByteOff _p 16
        v3 <- peekByteOff _p 20
        v4 <- peekByteOff _p 24
        v5 <- peekByteOff _p 28
        v6 <- peekByteOff _p 32
        v7 <- peekByteOff _p 40
        v8 <- peekByteOff _p 48
        v9 <- peekByteOff _p 72
        v10 <- peekByteOff _p 80
        v11 <- peekByteOff _p 200
        v12 <- peekByteOff _p 320
        return $ C'pkginfo v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12
      poke _p (C'pkginfo v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12) = do
        pokeByteOff _p 0 v0
        pokeByteOff _p 8 v1
        pokeByteOff _p 16 v2
        pokeByteOff _p 20 v3
        pokeByteOff _p 24 v4
        pokeByteOff _p 28 v5
        pokeByteOff _p 32 v6
        pokeByteOff _p 40 v7
        pokeByteOff _p 48 v8
        pokeByteOff _p 72 v9
        pokeByteOff _p 80 v10
        pokeByteOff _p 200 v11
        pokeByteOff _p 320 v12
        return ()

    {-# LINE 73 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 75 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 76 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 77 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 78 "Debian/Dpkg/Types.hsc" #-}
    data C'pkgset = C'pkgset{
      c'pkgset'next :: Ptr C'pkgset,
      c'pkgset'name :: CString,
      c'pkgset'pkg :: C'pkginfo
    } deriving (Eq,Show)
    p'pkgset'next p = plusPtr p 0
    p'pkgset'next :: Ptr (C'pkgset) -> Ptr (Ptr C'pkgset)
    p'pkgset'name p = plusPtr p 8
    p'pkgset'name :: Ptr (C'pkgset) -> Ptr (CString)
    p'pkgset'pkg p = plusPtr p 16
    p'pkgset'pkg :: Ptr (C'pkgset) -> Ptr (C'pkginfo)
    instance Storable C'pkgset where
      sizeOf _ = 400
      alignment _ = 8
      peek _p = do
        v0 <- peekByteOff _p 0
        v1 <- peekByteOff _p 8
        v2 <- peekByteOff _p 16
        return $ C'pkgset v0 v1 v2
      poke _p (C'pkgset v0 v1 v2) = do
        pokeByteOff _p 0 v0
        pokeByteOff _p 8 v1
        pokeByteOff _p 16 v2
        return ()

    {-# LINE 79 "Debian/Dpkg/Types.hsc" #-}

    type C'dpkg_msg_type = CUInt

    {-# LINE 81 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 83 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 84 "Debian/Dpkg/Types.hsc" #-}

    {-# LINE 85 "Debian/Dpkg/Types.hsc" #-}
    data C'dpkg_error = C'dpkg_error{
      c'dpkg_error'type :: C'dpkg_msg_type,
      c'dpkg_error'str :: CString
    } deriving (Eq,Show)
    p'dpkg_error'type p = plusPtr p 0
    p'dpkg_error'type :: Ptr (C'dpkg_error) -> Ptr (C'dpkg_msg_type)
    p'dpkg_error'str p = plusPtr p 8
    p'dpkg_error'str :: Ptr (C'dpkg_error) -> Ptr (CString)
    instance Storable C'dpkg_error where
      sizeOf _ = 16
      alignment _ = 8
      peek _p = do
        v0 <- peekByteOff _p 0
        v1 <- peekByteOff _p 8
        return $ C'dpkg_error v0 v1
      poke _p (C'dpkg_error v0 v1) = do
        pokeByteOff _p 0 v0
        pokeByteOff _p 8 v1
        return ()

    {-# LINE 86 "Debian/Dpkg/Types.hsc" #-}