    {-# LINE 1 "src/Bindings/HDF5/ErrorCodes.hsc" #-}

    {-# LANGUAGE DeriveDataTypeable, FlexibleInstances #-}
    {-# LANGUAGE CPP #-}
    module Bindings.HDF5.ErrorCodes
        ( MajorErrCode(..), majorErrorCode, majorErrorFromCode
        , MinorErrCode(..), minorErrorCode, minorErrorFromCode

        ) where
    import Data.Maybe

    import Bindings.HDF5.Raw.H5E
    import Bindings.HDF5.Raw.H5I
    import Data.Typeable (Typeable)
    import Foreign

    data MajorErrCode
        -- |Dataset
        = Dataset
        -- |Function entry/exit
        | Func
        -- |Data storage
        | Storage
        -- |File accessability
        | File
        -- |Shared Object Header Messages
        | SOHM
        -- |Symbol table
        | Sym
        -- |Virtual File Layer
        | VFL
        -- |Internal error (too specific to document in detail)
        | Internal
        -- |B-Tree node
        | BTree
        -- |References
        | Reference
        -- |Dataspace
        | Dataspace
        -- |Resource unavailable
        | Resource
        -- |Property lists
        | PList
        -- |Links
        | Link
        -- |Datatype
        | Datatype
        -- |Reference Counted Strings
        | RS
        -- |Heap
        | Heap
        -- |Object header
        | OHDR
        -- |Object atom
        | Atom
        -- |Attribute
        | Attr
        -- |Low-level I/O
        | IO
        -- |Skip Lists
        | SList
        -- |External file list
        | EFL
        -- |Ternary Search Trees
        | TST
        -- |Invalid arguments to routine
        | Args
        -- |Error API
        | Error
        -- |Data filters
        | PLine
        -- |Free Space Manager
        | FSpace
        -- |Object cache
        | Cache

        -- |Unrecognized major error code
        | UnknownMajor HId_t
        deriving (MajorErrCode -> MajorErrCode -> Bool
    (MajorErrCode -> MajorErrCode -> Bool)
    -> (MajorErrCode -> MajorErrCode -> Bool) -> Eq MajorErrCode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: MajorErrCode -> MajorErrCode -> Bool
    == :: MajorErrCode -> MajorErrCode -> Bool
    $c/= :: MajorErrCode -> MajorErrCode -> Bool
    /= :: MajorErrCode -> MajorErrCode -> Bool
    Eq, Eq MajorErrCode
    Eq MajorErrCode =>
    (MajorErrCode -> MajorErrCode -> Ordering)
    -> (MajorErrCode -> MajorErrCode -> Bool)
    -> (MajorErrCode -> MajorErrCode -> Bool)
    -> (MajorErrCode -> MajorErrCode -> Bool)
    -> (MajorErrCode -> MajorErrCode -> Bool)
    -> (MajorErrCode -> MajorErrCode -> MajorErrCode)
    -> (MajorErrCode -> MajorErrCode -> MajorErrCode)
    -> Ord MajorErrCode
    MajorErrCode -> MajorErrCode -> Bool
    MajorErrCode -> MajorErrCode -> Ordering
    MajorErrCode -> MajorErrCode -> MajorErrCode
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: MajorErrCode -> MajorErrCode -> Ordering
    compare :: MajorErrCode -> MajorErrCode -> Ordering
    $c< :: MajorErrCode -> MajorErrCode -> Bool
    < :: MajorErrCode -> MajorErrCode -> Bool
    $c<= :: MajorErrCode -> MajorErrCode -> Bool
    <= :: MajorErrCode -> MajorErrCode -> Bool
    $c> :: MajorErrCode -> MajorErrCode -> Bool
    > :: MajorErrCode -> MajorErrCode -> Bool
    $c>= :: MajorErrCode -> MajorErrCode -> Bool
    >= :: MajorErrCode -> MajorErrCode -> Bool
    $cmax :: MajorErrCode -> MajorErrCode -> MajorErrCode
    max :: MajorErrCode -> MajorErrCode -> MajorErrCode
    $cmin :: MajorErrCode -> MajorErrCode -> MajorErrCode
    min :: MajorErrCode -> MajorErrCode -> MajorErrCode
    Ord, Int -> MajorErrCode -> ShowS
    [MajorErrCode] -> ShowS
    MajorErrCode -> String
    (Int -> MajorErrCode -> ShowS)
    -> (MajorErrCode -> String)
    -> ([MajorErrCode] -> ShowS)
    -> Show MajorErrCode
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MajorErrCode -> ShowS
    showsPrec :: Int -> MajorErrCode -> ShowS
    $cshow :: MajorErrCode -> String
    show :: MajorErrCode -> String
    $cshowList :: [MajorErrCode] -> ShowS
    showList :: [MajorErrCode] -> ShowS
    Show, Typeable)

    rawMajorErrCodesInv :: [(HId_t, Maybe MajorErrCode)]
    rawMajorErrCodesInv :: [(HId_t, Maybe MajorErrCode)]
    rawMajorErrCodesInv = [(HId_t
    a,Maybe MajorErrCode
    b) | (Maybe MajorErrCode
    b,HId_t
    a) <- [(Maybe MajorErrCode, HId_t)]
    rawMajorErrCodes]

    rawMajorErrCodes :: [(Maybe MajorErrCode, HId_t)]
    rawMajorErrCodes :: [(Maybe MajorErrCode, HId_t)]
    rawMajorErrCodes =
        [ (Maybe MajorErrCode
    forall a. Maybe a
    Nothing,         HId_t
    h5e_NONE_MAJOR)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Dataset,    HId_t
    h5e_DATASET)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Func,       HId_t
    h5e_FUNC)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Storage,    HId_t
    h5e_STORAGE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    File,       HId_t
    h5e_FILE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    SOHM,       HId_t
    h5e_SOHM)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Sym,        HId_t
    h5e_SYM)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    VFL,        HId_t
    h5e_VFL)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Internal,   HId_t
    h5e_INTERNAL)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    BTree,      HId_t
    h5e_BTREE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Reference,  HId_t
    h5e_REFERENCE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Dataspace,  HId_t
    h5e_DATASPACE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Resource,   HId_t
    h5e_RESOURCE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    PList,      HId_t
    h5e_PLIST)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Link,       HId_t
    h5e_LINK)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Datatype,   HId_t
    h5e_DATATYPE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    RS,         HId_t
    h5e_RS)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Heap,       HId_t
    h5e_HEAP)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    OHDR,       HId_t
    h5e_OHDR)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Attr,       HId_t
    h5e_ATTR)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    IO,         HId_t
    h5e_IO)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    SList,      HId_t
    h5e_SLIST)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    EFL,        HId_t
    h5e_EFL)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    TST,        HId_t
    h5e_TST)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Args,       HId_t
    h5e_ARGS)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Error,      HId_t
    h5e_ERROR)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    PLine,      HId_t
    h5e_PLINE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    FSpace,     HId_t
    h5e_FSPACE)
        , (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just MajorErrCode
    Cache,      HId_t
    h5e_CACHE)
        ]

    majorErrorCode :: Maybe MajorErrCode -> Maybe HId_t
    majorErrorCode :: Maybe MajorErrCode -> Maybe HId_t
    majorErrorCode (Just (UnknownMajor HId_t
    code)) = HId_t -> Maybe HId_t
    forall a. a -> Maybe a
    Just HId_t
    code
    majorErrorCode Maybe MajorErrCode
    err = Maybe MajorErrCode -> [(Maybe MajorErrCode, HId_t)] -> Maybe HId_t
    forall a b. Eq a => a -> [(a, b)] -> Maybe b
    lookup Maybe MajorErrCode
    err [(Maybe MajorErrCode, HId_t)]
    rawMajorErrCodes

    majorErrorFromCode :: HId_t -> Maybe MajorErrCode
    majorErrorFromCode :: HId_t -> Maybe MajorErrCode
    majorErrorFromCode HId_t
    code =
        Maybe MajorErrCode
    -> Maybe (Maybe MajorErrCode) -> Maybe MajorErrCode
    forall a. a -> Maybe a -> a
    fromMaybe (MajorErrCode -> Maybe MajorErrCode
    forall a. a -> Maybe a
    Just (HId_t -> MajorErrCode
    UnknownMajor HId_t
    code))
                      (HId_t
    -> [(HId_t, Maybe MajorErrCode)] -> Maybe (Maybe MajorErrCode)
    forall a b. Eq a => a -> [(a, b)] -> Maybe b
    lookup HId_t
    code [(HId_t, Maybe MajorErrCode)]
    rawMajorErrCodesInv)

    instance Storable (Maybe MajorErrCode) where
        sizeOf :: Maybe MajorErrCode -> Int
    sizeOf    Maybe MajorErrCode
    _ = HId_t -> Int
    forall a. Storable a => a -> Int
    sizeOf    (HId_t
    forall a. HasCallStack => a
    undefined :: HId_t)
        alignment :: Maybe MajorErrCode -> Int
    alignment Maybe MajorErrCode
    _ = HId_t -> Int
    forall a. Storable a => a -> Int
    alignment (HId_t
    forall a. HasCallStack => a
    undefined :: HId_t)

        peek :: Ptr (Maybe MajorErrCode) -> IO (Maybe MajorErrCode)
    peek = (HId_t -> Maybe MajorErrCode)
    -> IO HId_t -> IO (Maybe MajorErrCode)
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap HId_t -> Maybe MajorErrCode
    majorErrorFromCode (IO HId_t -> IO (Maybe MajorErrCode))
    -> (Ptr (Maybe MajorErrCode) -> IO HId_t)
    -> Ptr (Maybe MajorErrCode)
    -> IO (Maybe MajorErrCode)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr HId_t -> IO HId_t
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr HId_t -> IO HId_t)
    -> (Ptr (Maybe MajorErrCode) -> Ptr HId_t)
    -> Ptr (Maybe MajorErrCode)
    -> IO HId_t
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (Maybe MajorErrCode) -> Ptr HId_t
    forall a b. Ptr a -> Ptr b
    castPtr
        poke :: Ptr (Maybe MajorErrCode) -> Maybe MajorErrCode -> IO ()
    poke Ptr (Maybe MajorErrCode)
    p Maybe MajorErrCode
    err = case Maybe MajorErrCode -> Maybe HId_t
    majorErrorCode Maybe MajorErrCode
    err of
            Maybe HId_t
    Nothing -> String -> IO ()
    forall a. String -> IO a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail (String
    "Unknown major error code: " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Maybe MajorErrCode -> String
    forall a. Show a => a -> String
    show Maybe MajorErrCode
    err)
            Just HId_t
    code -> Ptr HId_t -> HId_t -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr (Maybe MajorErrCode) -> Ptr HId_t
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Maybe MajorErrCode)
    p) HId_t
    code

    data MinorErrCode
        = SeekError
        -- |Read failed
        | ReadError
        -- |Write failed
        | WriteError
        -- |Close failed
        | CloseError
        -- |Address overflowed
        | Overflow
        -- |File control (fcntl) failed
        | FCNTL
        -- |No space available for allocation
        | NoSpace
        -- |Can't allocate space
        | CantAlloc
        -- |Unable to copy object
        | CantCopy
        -- |Unable to free object
        | CantFree
        -- |Object already exists
        | AlreadyExists
        -- |Unable to lock object
        | CantLock
        -- |Unable to unlock object
        | CantUnlock
        -- |Unable to garbage collect
        | CantGC
        -- |Unable to compute size
        | CantGetSize
        -- |Object is already open
        | ObjOpen
        -- |Can't restore condition
        | CantRestore
        -- |Can't compute value
        | CantCompute
        -- |Can't extend heap's space
        | CantExtend
        -- |Can't attach object
        | CantAttach
        -- |Can't update object
        | CantUpdate
        -- |Can't operate on object
        | CantOperate
        -- |Unable to initialize object
        | CantInit
        -- |Object already initialized
        | AlreadyInit
        -- |Unable to release object
        | CantRelease
        -- |Can't get value
        | CantGet
        -- |Can't set value
        | CantSet
        -- |Duplicate class name in parent class
        | DupClass
        -- |Can't merge objects
        | CantMerge
        -- |Can't revive object
        | CantRevive
        -- |Can't shrink container
        | CantShrink
        -- |Bad object header link count
        | LinkCount
        -- |Wrong version number
        | Version
        -- |Alignment error
        | Alignment
        -- |Unrecognized message
        | BadMesg
        -- |Can't delete message
        | CantDelete
        -- |Iteration failed
        | BadIter
        -- |Can't pack messages
        | CantPack
        -- |Can't reset object
        | CantReset
        -- |Unable to rename object
        | CantRename
        -- |System error message
        | SysErrStr
        -- |Requested filter is not available
        | NoFilter
        -- |Callback failed
        | Callback
        -- |Error from filter 'can apply' callback
        | CanApply
        -- |Error from filter 'set local' callback
        | SetLocal
        -- |Filter present but encoding disabled
        | NoEncoder
        -- |Filter operation failed
        | CantFilter
        -- |Can't open object
        | CantOpenObj
        -- |Can't close object
        | CantCloseObj
        -- |Name component is too long
        | CompLen
        -- |Problem with path to object
        | Path
        -- |File already exists
        | FileExists
        -- |File already open
        | FileOpen
        -- |Unable to create file
        | CantCreate
        -- |Unable to open file
        | CantOpenFile
        -- |Unable to close file
        | CantCloseFile
        -- |Not an HDF5 file
        | NotHDF5
        -- |Bad file ID accessed
        | BadFile
        -- |File has been truncated
        | Truncated
        -- |File mount error
        | Mount
        -- |Unable to find atom information (already closed?)
        | BadAtom
        -- |Unable to find ID group information
        | BadGroup
        -- |Unable to register new atom
        | CantRegister
        -- |Unable to increment reference count
        | CantInc
        -- |Unable to decrement reference count
        | CantDec
        -- |Out of IDs for group
        | NoIds
        -- |Unable to flush data from cache
        | CantFlush
        -- |Unable to serialize data from cache
        | CantSerialize
        -- |Unable to load metadata into cache
        | CantLoad
        -- |Protected metadata error
        | Protect
        -- |Metadata not currently cached
        | NotCached
        -- |Internal error detected
        | System
        -- |Unable to insert metadata into cache
        | CantIns
        -- |Unable to protect metadata
        | CantProtect
        -- |Unable to unprotect metadata
        | CanTUnprotect
        -- |Unable to pin cache entry
        | CantPin
        -- |Unable to un-pin cache entry
        | CantUnpin
        -- |Unable to mark a pinned entry as dirty
        | CantMarkDirty
        -- |Unable to mark metadata as dirty
        | CantDirty
        -- |Unable to expunge a metadata cache entry
        | CantExpunge
        -- |Unable to resize a metadata cache entry
        | CantResize
        -- |Link traversal failure
        | Traverse
        -- |Too many soft links in path
        | NLinks
        -- |Link class not registered
        | NotRegistered
        -- |Can't move object
        | CantMove
        -- |Can't sort objects
        | CantSort
        -- |Some MPI function failed
        | MPI
        -- |MPI Error String
        | MPIErrStr
        -- |Can't receive data
        | CantRecv
        -- |Can't clip hyperslab region
        | CantClip
        -- |Can't count elements
        | CantCount
        -- |Can't select hyperslab
        | CantSelect
        -- |Can't move to next iterator location
        | CantNext
        -- |Invalid selection
        | BadSelect
        -- |Can't compare objects
        | CantCompare
        -- |Information is uinitialized
        | Uninitialized
        -- |Feature is unsupported
        | Unsupported
        -- |Inappropriate type
        | BadType
        -- |Out of range
        | BadRange
        -- |Bad value
        | BadValue
        -- |Object not found
        | NotFound
        -- |Object already exists
        | Exists
        -- |Unable to encode value
        | CantEncode
        -- |Unable to decode value
        | CantDecode
        -- |Unable to split node
        | CantSplit
        -- |Unable to redistribute records
        | CantRedistribute
        -- |Unable to swap records
        | CantSwap
        -- |Unable to insert object
        | CantInsert
        -- |Unable to list node
        | CantList
        -- |Unable to modify record
        | CantModify
        -- |Unable to remove object
        | CantRemove
        -- |Can't convert datatypes
        | CantConvert
        -- |Bad size for object
        | BadSize

        -- |Unrecognized minor error code
        | UnknownMinor HId_t
        deriving (MinorErrCode -> MinorErrCode -> Bool
    (MinorErrCode -> MinorErrCode -> Bool)
    -> (MinorErrCode -> MinorErrCode -> Bool) -> Eq MinorErrCode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: MinorErrCode -> MinorErrCode -> Bool
    == :: MinorErrCode -> MinorErrCode -> Bool
    $c/= :: MinorErrCode -> MinorErrCode -> Bool
    /= :: MinorErrCode -> MinorErrCode -> Bool
    Eq, Eq MinorErrCode
    Eq MinorErrCode =>
    (MinorErrCode -> MinorErrCode -> Ordering)
    -> (MinorErrCode -> MinorErrCode -> Bool)
    -> (MinorErrCode -> MinorErrCode -> Bool)
    -> (MinorErrCode -> MinorErrCode -> Bool)
    -> (MinorErrCode -> MinorErrCode -> Bool)
    -> (MinorErrCode -> MinorErrCode -> MinorErrCode)
    -> (MinorErrCode -> MinorErrCode -> MinorErrCode)
    -> Ord MinorErrCode
    MinorErrCode -> MinorErrCode -> Bool
    MinorErrCode -> MinorErrCode -> Ordering
    MinorErrCode -> MinorErrCode -> MinorErrCode
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: MinorErrCode -> MinorErrCode -> Ordering
    compare :: MinorErrCode -> MinorErrCode -> Ordering
    $c< :: MinorErrCode -> MinorErrCode -> Bool
    < :: MinorErrCode -> MinorErrCode -> Bool
    $c<= :: MinorErrCode -> MinorErrCode -> Bool
    <= :: MinorErrCode -> MinorErrCode -> Bool
    $c> :: MinorErrCode -> MinorErrCode -> Bool
    > :: MinorErrCode -> MinorErrCode -> Bool
    $c>= :: MinorErrCode -> MinorErrCode -> Bool
    >= :: MinorErrCode -> MinorErrCode -> Bool
    $cmax :: MinorErrCode -> MinorErrCode -> MinorErrCode
    max :: MinorErrCode -> MinorErrCode -> MinorErrCode
    $cmin :: MinorErrCode -> MinorErrCode -> MinorErrCode
    min :: MinorErrCode -> MinorErrCode -> MinorErrCode
    Ord, Int -> MinorErrCode -> ShowS
    [MinorErrCode] -> ShowS
    MinorErrCode -> String
    (Int -> MinorErrCode -> ShowS)
    -> (MinorErrCode -> String)
    -> ([MinorErrCode] -> ShowS)
    -> Show MinorErrCode
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MinorErrCode -> ShowS
    showsPrec :: Int -> MinorErrCode -> ShowS
    $cshow :: MinorErrCode -> String
    show :: MinorErrCode -> String
    $cshowList :: [MinorErrCode] -> ShowS
    showList :: [MinorErrCode] -> ShowS
    Show, Typeable)

    rawMinorErrCodesInv :: [(HId_t, Maybe MinorErrCode)]
    rawMinorErrCodesInv :: [(HId_t, Maybe MinorErrCode)]
    rawMinorErrCodesInv = [(HId_t
    a,Maybe MinorErrCode
    b) | (Maybe MinorErrCode
    b,HId_t
    a) <- [(Maybe MinorErrCode, HId_t)]
    rawMinorErrCodes]
    rawMinorErrCodes :: [(Maybe MinorErrCode, HId_t)]
    rawMinorErrCodes :: [(Maybe MinorErrCode, HId_t)]
    rawMinorErrCodes =
        [ (Maybe MinorErrCode
    forall a. Maybe a
    Nothing,                 HId_t
    h5e_NONE_MINOR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    SeekError,          HId_t
    h5e_SEEKERROR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    ReadError,          HId_t
    h5e_READERROR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    WriteError,         HId_t
    h5e_WRITEERROR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CloseError,         HId_t
    h5e_CLOSEERROR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Overflow,           HId_t
    h5e_OVERFLOW)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    FCNTL,              HId_t
    h5e_FCNTL)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NoSpace,            HId_t
    h5e_NOSPACE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantAlloc,          HId_t
    h5e_CANTALLOC)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCopy,           HId_t
    h5e_CANTCOPY)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantFree,           HId_t
    h5e_CANTFREE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    AlreadyExists,      HId_t
    h5e_ALREADYEXISTS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantLock,           HId_t
    h5e_CANTLOCK)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantUnlock,         HId_t
    h5e_CANTUNLOCK)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantGC,             HId_t
    h5e_CANTGC)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantGetSize,        HId_t
    h5e_CANTGETSIZE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    ObjOpen,            HId_t
    h5e_OBJOPEN)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRestore,        HId_t
    h5e_CANTRESTORE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCompute,        HId_t
    h5e_CANTCOMPUTE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantExtend,         HId_t
    h5e_CANTEXTEND)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantAttach,         HId_t
    h5e_CANTATTACH)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantUpdate,         HId_t
    h5e_CANTUPDATE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantOperate,        HId_t
    h5e_CANTOPERATE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantInit,           HId_t
    h5e_CANTINIT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    AlreadyInit,        HId_t
    h5e_ALREADYINIT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRelease,        HId_t
    h5e_CANTRELEASE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantGet,            HId_t
    h5e_CANTGET)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSet,            HId_t
    h5e_CANTSET)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    DupClass,           HId_t
    h5e_DUPCLASS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantMerge,          HId_t
    h5e_CANTMERGE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRevive,         HId_t
    h5e_CANTREVIVE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantShrink,         HId_t
    h5e_CANTSHRINK)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    LinkCount,          HId_t
    h5e_LINKCOUNT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Version,            HId_t
    h5e_VERSION)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Alignment,          HId_t
    h5e_ALIGNMENT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadMesg,            HId_t
    h5e_BADMESG)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantDelete,         HId_t
    h5e_CANTDELETE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadIter,            HId_t
    h5e_BADITER)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantPack,           HId_t
    h5e_CANTPACK)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantReset,          HId_t
    h5e_CANTRESET)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRename,         HId_t
    h5e_CANTRENAME)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    SysErrStr,          HId_t
    h5e_SYSERRSTR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NoFilter,           HId_t
    h5e_NOFILTER)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Callback,           HId_t
    h5e_CALLBACK)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CanApply,           HId_t
    h5e_CANAPPLY)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    SetLocal,           HId_t
    h5e_SETLOCAL)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NoEncoder,          HId_t
    h5e_NOENCODER)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantFilter,         HId_t
    h5e_CANTFILTER)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantOpenObj,        HId_t
    h5e_CANTOPENOBJ)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCloseObj,       HId_t
    h5e_CANTCLOSEOBJ)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CompLen,            HId_t
    h5e_COMPLEN)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Path,               HId_t
    h5e_PATH)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    FileExists,         HId_t
    h5e_FILEEXISTS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    FileOpen,           HId_t
    h5e_FILEOPEN)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCreate,         HId_t
    h5e_CANTCREATE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantOpenFile,       HId_t
    h5e_CANTOPENFILE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCloseFile,      HId_t
    h5e_CANTCLOSEFILE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NotHDF5,            HId_t
    h5e_NOTHDF5)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadFile,            HId_t
    h5e_BADFILE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Truncated,          HId_t
    h5e_TRUNCATED)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Mount,              HId_t
    h5e_MOUNT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadGroup,           HId_t
    h5e_BADGROUP)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRegister,       HId_t
    h5e_CANTREGISTER)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantInc,            HId_t
    h5e_CANTINC)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantDec,            HId_t
    h5e_CANTDEC)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NoIds,              HId_t
    h5e_NOIDS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantFlush,          HId_t
    h5e_CANTFLUSH)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSerialize,      HId_t
    h5e_CANTSERIALIZE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantLoad,           HId_t
    h5e_CANTLOAD)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Protect,            HId_t
    h5e_PROTECT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NotCached,          HId_t
    h5e_NOTCACHED)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    System,             HId_t
    h5e_SYSTEM)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantIns,            HId_t
    h5e_CANTINS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantProtect,        HId_t
    h5e_CANTPROTECT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CanTUnprotect,      HId_t
    h5e_CANTUNPROTECT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantPin,            HId_t
    h5e_CANTPIN)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantUnpin,          HId_t
    h5e_CANTUNPIN)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantMarkDirty,      HId_t
    h5e_CANTMARKDIRTY)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantDirty,          HId_t
    h5e_CANTDIRTY)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantExpunge,        HId_t
    h5e_CANTEXPUNGE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantResize,         HId_t
    h5e_CANTRESIZE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Traverse,           HId_t
    h5e_TRAVERSE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NLinks,             HId_t
    h5e_NLINKS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NotRegistered,      HId_t
    h5e_NOTREGISTERED)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantMove,           HId_t
    h5e_CANTMOVE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSort,           HId_t
    h5e_CANTSORT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    MPI,                HId_t
    h5e_MPI)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    MPIErrStr,          HId_t
    h5e_MPIERRSTR)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRecv,           HId_t
    h5e_CANTRECV)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantClip,           HId_t
    h5e_CANTCLIP)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCount,          HId_t
    h5e_CANTCOUNT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSelect,         HId_t
    h5e_CANTSELECT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantNext,           HId_t
    h5e_CANTNEXT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadSelect,          HId_t
    h5e_BADSELECT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantCompare,        HId_t
    h5e_CANTCOMPARE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Uninitialized,      HId_t
    h5e_UNINITIALIZED)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Unsupported,        HId_t
    h5e_UNSUPPORTED)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadType,            HId_t
    h5e_BADTYPE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadRange,           HId_t
    h5e_BADRANGE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadValue,           HId_t
    h5e_BADVALUE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    NotFound,           HId_t
    h5e_NOTFOUND)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    Exists,             HId_t
    h5e_EXISTS)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantEncode,         HId_t
    h5e_CANTENCODE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantDecode,         HId_t
    h5e_CANTDECODE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSplit,          HId_t
    h5e_CANTSPLIT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRedistribute,   HId_t
    h5e_CANTREDISTRIBUTE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantSwap,           HId_t
    h5e_CANTSWAP)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantInsert,         HId_t
    h5e_CANTINSERT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantList,           HId_t
    h5e_CANTLIST)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantModify,         HId_t
    h5e_CANTMODIFY)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantRemove,         HId_t
    h5e_CANTREMOVE)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    CantConvert,        HId_t
    h5e_CANTCONVERT)
        , (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just MinorErrCode
    BadSize,            HId_t
    h5e_BADSIZE)
        ]

    minorErrorCode :: Maybe MinorErrCode -> Maybe HId_t
    minorErrorCode :: Maybe MinorErrCode -> Maybe HId_t
    minorErrorCode (Just (UnknownMinor HId_t
    code)) = HId_t -> Maybe HId_t
    forall a. a -> Maybe a
    Just HId_t
    code
    minorErrorCode Maybe MinorErrCode
    err = Maybe MinorErrCode -> [(Maybe MinorErrCode, HId_t)] -> Maybe HId_t
    forall a b. Eq a => a -> [(a, b)] -> Maybe b
    lookup Maybe MinorErrCode
    err [(Maybe MinorErrCode, HId_t)]
    rawMinorErrCodes

    minorErrorFromCode :: HId_t -> Maybe MinorErrCode
    minorErrorFromCode :: HId_t -> Maybe MinorErrCode
    minorErrorFromCode HId_t
    code =
        Maybe MinorErrCode
    -> Maybe (Maybe MinorErrCode) -> Maybe MinorErrCode
    forall a. a -> Maybe a -> a
    fromMaybe (MinorErrCode -> Maybe MinorErrCode
    forall a. a -> Maybe a
    Just (HId_t -> MinorErrCode
    UnknownMinor HId_t
    code))
                      (HId_t
    -> [(HId_t, Maybe MinorErrCode)] -> Maybe (Maybe MinorErrCode)
    forall a b. Eq a => a -> [(a, b)] -> Maybe b
    lookup HId_t
    code [(HId_t, Maybe MinorErrCode)]
    rawMinorErrCodesInv)

    instance Storable (Maybe MinorErrCode) where
        sizeOf :: Maybe MinorErrCode -> Int
    sizeOf    Maybe MinorErrCode
    _ = HId_t -> Int
    forall a. Storable a => a -> Int
    sizeOf    (HId_t
    forall a. HasCallStack => a
    undefined :: HId_t)
        alignment :: Maybe MinorErrCode -> Int
    alignment Maybe MinorErrCode
    _ = HId_t -> Int
    forall a. Storable a => a -> Int
    alignment (HId_t
    forall a. HasCallStack => a
    undefined :: HId_t)

        peek :: Ptr (Maybe MinorErrCode) -> IO (Maybe MinorErrCode)
    peek = (HId_t -> Maybe MinorErrCode)
    -> IO HId_t -> IO (Maybe MinorErrCode)
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap HId_t -> Maybe MinorErrCode
    minorErrorFromCode (IO HId_t -> IO (Maybe MinorErrCode))
    -> (Ptr (Maybe MinorErrCode) -> IO HId_t)
    -> Ptr (Maybe MinorErrCode)
    -> IO (Maybe MinorErrCode)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr HId_t -> IO HId_t
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr HId_t -> IO HId_t)
    -> (Ptr (Maybe MinorErrCode) -> Ptr HId_t)
    -> Ptr (Maybe MinorErrCode)
    -> IO HId_t
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (Maybe MinorErrCode) -> Ptr HId_t
    forall a b. Ptr a -> Ptr b
    castPtr
        poke :: Ptr (Maybe MinorErrCode) -> Maybe MinorErrCode -> IO ()
    poke Ptr (Maybe MinorErrCode)
    p Maybe MinorErrCode
    err = case Maybe MinorErrCode -> Maybe HId_t
    minorErrorCode Maybe MinorErrCode
    err of
            Maybe HId_t
    Nothing -> String -> IO ()
    forall a. String -> IO a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail (String
    "Unknown minor error code: " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Maybe MinorErrCode -> String
    forall a. Show a => a -> String
    show Maybe MinorErrCode
    err)
            Just HId_t
    code -> Ptr HId_t -> HId_t -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr (Maybe MinorErrCode) -> Ptr HId_t
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (Maybe MinorErrCode)
    p) HId_t
    code