hapstone-0.2.0.1: Capstone bindings for Haskell

Copyright(c) Inokentiy Babushkin, 2016
LicenseBSD3
MaintainerInokentiy Babushkin <inokentiy.babushkin@googlemail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Hapstone.Internal.Util

Description

This module contains various utility functions used to perform common actions when sanitizing data passed to and from the C functions exposed by capstone.

Synopsis

Documentation

peekNum :: (Integral a, Num b, Storable a) => Ptr a -> IO b Source #

peeking with number conversion

getCULongFromEnum :: Enum e => e -> CULong Source #

number conversion and enum casting

withCast :: Storable a => a -> (Ptr b -> IO c) -> IO c Source #

cast a pointer before using with

combine :: (Enum e, Num n, Bits n) => [e] -> n Source #

bitwise OR a list of symbolic constants from an enumeration

stringLookup :: CString -> Maybe String Source #

lookup a possibly NULL-valued char *

fromZero :: (Eq a, Num a) => a -> Maybe a Source #

convert between Maybe and zero/nonzero Num

peekFunMaybe :: Storable a => (Ptr a -> IO a) -> Ptr a -> IO (Maybe a) Source #

peek if given pointer is not NULL