-- AddressWidth.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.AddressWidth
  ( AddressWidth(..)
  )
where

import           Zydis.Util

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