-- BranchType.hs ---

-- Copyright (C) 2020 Nerd Ed

-- Author: Nerd Ed <nerded.nerded@gmail.com>

-- 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, see <http://www.gnu.org/licenses/>.

{-# LANGUAGE DerivingVia #-}

module Zydis.BranchType
  ( BranchType(..)
  )
where

import           Zydis.Util

data BranchType
  = BranchTypeNone
  | BranchTypeShort
  | BranchTypeNear
  | BranchTypeFar
  deriving stock (Int -> BranchType -> ShowS
[BranchType] -> ShowS
BranchType -> String
(Int -> BranchType -> ShowS)
-> (BranchType -> String)
-> ([BranchType] -> ShowS)
-> Show BranchType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BranchType] -> ShowS
$cshowList :: [BranchType] -> ShowS
show :: BranchType -> String
$cshow :: BranchType -> String
showsPrec :: Int -> BranchType -> ShowS
$cshowsPrec :: Int -> BranchType -> ShowS
Show, BranchType -> BranchType -> Bool
(BranchType -> BranchType -> Bool)
-> (BranchType -> BranchType -> Bool) -> Eq BranchType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BranchType -> BranchType -> Bool
$c/= :: BranchType -> BranchType -> Bool
== :: BranchType -> BranchType -> Bool
$c== :: BranchType -> BranchType -> Bool
Eq, BranchType
BranchType -> BranchType -> Bounded BranchType
forall a. a -> a -> Bounded a
maxBound :: BranchType
$cmaxBound :: BranchType
minBound :: BranchType
$cminBound :: BranchType
Bounded, Int -> BranchType
BranchType -> Int
BranchType -> [BranchType]
BranchType -> BranchType
BranchType -> BranchType -> [BranchType]
BranchType -> BranchType -> BranchType -> [BranchType]
(BranchType -> BranchType)
-> (BranchType -> BranchType)
-> (Int -> BranchType)
-> (BranchType -> Int)
-> (BranchType -> [BranchType])
-> (BranchType -> BranchType -> [BranchType])
-> (BranchType -> BranchType -> [BranchType])
-> (BranchType -> BranchType -> BranchType -> [BranchType])
-> Enum BranchType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: BranchType -> BranchType -> BranchType -> [BranchType]
$cenumFromThenTo :: BranchType -> BranchType -> BranchType -> [BranchType]
enumFromTo :: BranchType -> BranchType -> [BranchType]
$cenumFromTo :: BranchType -> BranchType -> [BranchType]
enumFromThen :: BranchType -> BranchType -> [BranchType]
$cenumFromThen :: BranchType -> BranchType -> [BranchType]
enumFrom :: BranchType -> [BranchType]
$cenumFrom :: BranchType -> [BranchType]
fromEnum :: BranchType -> Int
$cfromEnum :: BranchType -> Int
toEnum :: Int -> BranchType
$ctoEnum :: Int -> BranchType
pred :: BranchType -> BranchType
$cpred :: BranchType -> BranchType
succ :: BranchType -> BranchType
$csucc :: BranchType -> BranchType
Enum)
  deriving Ptr b -> Int -> IO BranchType
Ptr b -> Int -> BranchType -> IO ()
Ptr BranchType -> IO BranchType
Ptr BranchType -> Int -> IO BranchType
Ptr BranchType -> Int -> BranchType -> IO ()
Ptr BranchType -> BranchType -> IO ()
BranchType -> Int
(BranchType -> Int)
-> (BranchType -> Int)
-> (Ptr BranchType -> Int -> IO BranchType)
-> (Ptr BranchType -> Int -> BranchType -> IO ())
-> (forall b. Ptr b -> Int -> IO BranchType)
-> (forall b. Ptr b -> Int -> BranchType -> IO ())
-> (Ptr BranchType -> IO BranchType)
-> (Ptr BranchType -> BranchType -> IO ())
-> Storable BranchType
forall b. Ptr b -> Int -> IO BranchType
forall b. Ptr b -> Int -> BranchType -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr BranchType -> BranchType -> IO ()
$cpoke :: Ptr BranchType -> BranchType -> IO ()
peek :: Ptr BranchType -> IO BranchType
$cpeek :: Ptr BranchType -> IO BranchType
pokeByteOff :: Ptr b -> Int -> BranchType -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> BranchType -> IO ()
peekByteOff :: Ptr b -> Int -> IO BranchType
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BranchType
pokeElemOff :: Ptr BranchType -> Int -> BranchType -> IO ()
$cpokeElemOff :: Ptr BranchType -> Int -> BranchType -> IO ()
peekElemOff :: Ptr BranchType -> Int -> IO BranchType
$cpeekElemOff :: Ptr BranchType -> Int -> IO BranchType
alignment :: BranchType -> Int
$calignment :: BranchType -> Int
sizeOf :: BranchType -> Int
$csizeOf :: BranchType -> Int
Storable via StorableExt BranchType