diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,3 +1,6 @@
+WARNING - this is a work in progress.  Do not use it yet.  I am checking the
+types, which will take time.
+
 Bindings to the mpdecimal library by Stefan Krah, which is available at
 
 http://www.bytereef.org/mpdecimal
diff --git a/bindings-mpdecimal.cabal b/bindings-mpdecimal.cabal
--- a/bindings-mpdecimal.cabal
+++ b/bindings-mpdecimal.cabal
@@ -10,7 +10,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.4.0.0
+version:             0.6.0.0
 
 -- A short (one-line) description of the package.
 synopsis:  bindings to mpdecimal library
diff --git a/lib/Bindings/Mpdecimal.hsc b/lib/Bindings/Mpdecimal.hsc
--- a/lib/Bindings/Mpdecimal.hsc
+++ b/lib/Bindings/Mpdecimal.hsc
@@ -1,18 +1,24 @@
 {-# OPTIONS_GHC -fno-warn-unused-imports #-}
-{-# LANGUAGE Safe #-}
 #include <bindings.dsl.h>
 #include <mpdecimal.h>
 module Bindings.Mpdecimal where
 import Foreign.Ptr
 #strict_import
 
--- * Version
+-- -- Sizes and integral types
+#integral_t mpd_uint_t
+#integral_t mpd_size_t
+#integral_t mpd_ssize_t
+#integral_t uint32_t
+#integral_t size_t
+#integral_t uint8_t
+#integral_t int32_t
+#integral_t uint64_t
+#integral_t int64_t
+#integral_t uint16_t
+
+-- - Version
 #ccall mpd_version , IO CString
-{- typedef uint64_t mpd_uint_t; -}
-#synonym_t mpd_uint_t , CULong
-{- typedef size_t mpd_size_t; -}
-#synonym_t mpd_size_t , CSize
-{- typedef int64_t mpd_ssize_t; -}
 
 #num MPD_MAJOR_VERSION
 #num MPD_MINOR_VERSION
@@ -20,18 +26,18 @@
 
 #num MPD_VERSION
 
--- * Configuration
+--  Configuration
 
--- ** Modular and base arithmetic
+--  Modular and base arithmetic
 #num MPD_UINT_MAX
 #num MPD_BITS_PER_UINT
 #num MPD_SIZE_MAX
 
--- ** Type for exp, digits, len, prec
+--  Type for exp, digits, len, prec
 #num MPD_SSIZE_MAX
 #num MPD_SSIZE_MIN
 
--- ** Decimal arithmetic
+--  Decimal arithmetic
 #num MPD_RADIX
 #num MPD_RDIGITS
 #num MPD_MAX_POW10
@@ -48,14 +54,13 @@
 #num MPD_EXP_CLAMP
 #num MPD_MAXIMPORT
 
--- ** Conversion specifiers
+--  Conversion specifiers
 #num PRI_mpd_uint_t
 #num PRI_mpd_ssize_t
 
 
--- * Context
+--  Context
 
-#synonym_t mpd_ssize_t , CInt
 {- enum {
     MPD_ROUND_UP,
     MPD_ROUND_DOWN,
@@ -84,8 +89,7 @@
 #num MPD_CLAMP_DEFAULT
 #num MPD_CLAMP_IEEE_754
 #num MPD_CLAMP_GUARD
-#globalvar mpd_round_string , CChar
-#globalvar mpd_clamp_string , CChar
+
 {- typedef struct mpd_context_t {
             mpd_ssize_t prec;
             mpd_ssize_t emax;
@@ -97,19 +101,20 @@
             int clamp;
             int allcr;
         } mpd_context_t; -}
+
 #starttype mpd_context_t
-#field prec , CInt
-#field emax , CInt
-#field emin , CInt
-#field traps , CUInt
-#field status , CUInt
-#field newtrap , CUInt
+#field prec , <mpd_ssize_t>
+#field emax , <mpd_ssize_t>
+#field emin , <mpd_ssize_t>
+#field traps , <uint32_t>
+#field status , <uint32_t>
+#field newtrap , <uint32_t>
 #field round , CInt
 #field clamp , CInt
 #field allcr , CInt
 #stoptype
 
--- ** Status flags
+--  Status flags
 
 #num MPD_Clamped
 #num MPD_Conversion_syntax
@@ -127,64 +132,64 @@
 #num MPD_Subnormal
 #num MPD_Underflow
 
--- ** Conditions that result in an IEEE 754 exception
+--  Conditions that result in an IEEE 754 exception
 #num MPD_IEEE_Invalid_operation
 
--- ** Errors that require the result of an operation to be set to NaN
+--  Errors that require the result of an operation to be set to NaN
 #num MPD_Errors
 
--- ** Default traps
+--  Default traps
 #num MPD_Traps
 
--- ** Official name
+--  Official name
 #num MPD_Insufficient_storage
 
--- ** IEEE 754 interchange format contexts
+--  IEEE 754 interchange format contexts
 #num MPD_IEEE_CONTEXT_MAX_BITS
 #num MPD_DECIMAL32
 #num MPD_DECIMAL64
 #num MPD_DECIMAL128
 
--- ** minalloc
+--  minalloc
 
 #num MPD_MINALLOC_MIN
 #num MPD_MINALLOC_MAX
-#globalvar MPD_MINALLOC , CInt
+#globalvar MPD_MINALLOC , <mpd_ssize_t>
 
--- ** Traphandler
+--  Traphandler
 
-#globalvar mpd_traphandler , Ptr <mpd_context_t> -> IO ()
-#callback funptr_mpd_traphandler , Ptr <mpd_context_t> -> IO ()
+#callback_t funptr_mpd_traphandler , Ptr <mpd_context_t> -> IO ()
 #ccall mpd_dflt_traphandler , Ptr <mpd_context_t> -> IO ()
+#globalvar mpd_traphandler , <funptr_mpd_traphandler>
 
--- ** Context functions
-#ccall mpd_setminalloc , CInt -> IO ()
-#ccall mpd_init , Ptr <mpd_context_t> -> CInt -> IO ()
+--  Context functions
+#ccall mpd_setminalloc , <mpd_ssize_t> -> IO ()
+#ccall mpd_init , Ptr <mpd_context_t> -> <mpd_ssize_t> -> IO ()
 #ccall mpd_maxcontext , Ptr <mpd_context_t> -> IO ()
 #ccall mpd_defaultcontext , Ptr <mpd_context_t> -> IO ()
 #ccall mpd_basiccontext , Ptr <mpd_context_t> -> IO ()
 #ccall mpd_ieee_context , Ptr <mpd_context_t> -> CInt -> IO CInt
-#ccall mpd_getprec , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_getemax , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_getemin , Ptr <mpd_context_t> -> IO CInt
+#ccall mpd_getprec , Ptr <mpd_context_t> -> IO <mpd_ssize_t>
+#ccall mpd_getemax , Ptr <mpd_context_t> -> IO <mpd_ssize_t>
+#ccall mpd_getemin , Ptr <mpd_context_t> -> IO <mpd_ssize_t>
 #ccall mpd_getround , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_gettraps , Ptr <mpd_context_t> -> IO CUInt
-#ccall mpd_getstatus , Ptr <mpd_context_t> -> IO CUInt
+#ccall mpd_gettraps , Ptr <mpd_context_t> -> IO <uint32_t>
+#ccall mpd_getstatus , Ptr <mpd_context_t> -> IO <uint32_t>
 #ccall mpd_getclamp , Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_getcr , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_qsetprec , Ptr <mpd_context_t> -> CInt -> IO CInt
-#ccall mpd_qsetemax , Ptr <mpd_context_t> -> CInt -> IO CInt
-#ccall mpd_qsetemin , Ptr <mpd_context_t> -> CInt -> IO CInt
+#ccall mpd_qsetprec , Ptr <mpd_context_t> -> <mpd_ssize_t> -> IO CInt
+#ccall mpd_qsetemax , Ptr <mpd_context_t> -> <mpd_ssize_t> -> IO CInt
+#ccall mpd_qsetemin , Ptr <mpd_context_t> -> <mpd_ssize_t> -> IO CInt
 #ccall mpd_qsetround , Ptr <mpd_context_t> -> CInt -> IO CInt
-#ccall mpd_qsettraps , Ptr <mpd_context_t> -> CUInt -> IO CInt
-#ccall mpd_qsetstatus , Ptr <mpd_context_t> -> CUInt -> IO CInt
+#ccall mpd_qsettraps , Ptr <mpd_context_t> -> <uint32_t> -> IO CInt
+#ccall mpd_qsetstatus , Ptr <mpd_context_t> -> <uint32_t> -> IO CInt
 #ccall mpd_qsetclamp , Ptr <mpd_context_t> -> CInt -> IO CInt
 #ccall mpd_qsetcr , Ptr <mpd_context_t> -> CInt -> IO CInt
-#ccall mpd_addstatus_raise , Ptr <mpd_context_t> -> CUInt -> IO ()
+#ccall mpd_addstatus_raise , Ptr <mpd_context_t> -> <uint32_t> -> IO ()
 
--- * Decimal arithmetic
+--  Decimal arithmetic
 
--- ** mpd_t flags
+--  mpd_t flags
 #num MPD_POS
 #num MPD_NEG
 #num MPD_INF
@@ -198,7 +203,7 @@
 #num MPD_DATAFLAGS
 
 
--- ** mpd_t
+--  mpd_t
 
 {- typedef struct mpd_t {
             uint8_t flags;
@@ -209,19 +214,19 @@
             mpd_uint_t * data;
         } mpd_t; -}
 #starttype mpd_t
-#field flags , CUChar
-#field exp , CInt
-#field digits , CInt
-#field len , CInt
-#field alloc , CInt
-#field data , Ptr CULong
+#field flags , <uint8_t>
+#field exp , <mpd_ssize_t>
+#field digits , <mpd_ssize_t>
+#field len , <mpd_ssize_t>
+#field alloc , <mpd_ssize_t>
+#field data , Ptr <mpd_uint_t>
 #stoptype
 {- typedef unsigned char uchar; -}
-#synonym_t uchar , CUChar
+#integral_t uchar
 
--- * Quiet, thread-safe functions
+--  Quiet, thread-safe functions
 
--- ** Format specification
+--  Format specification
 {- typedef struct mpd_spec_t {
             mpd_ssize_t min_width;
             mpd_ssize_t prec;
@@ -234,8 +239,8 @@
             const char * grouping;
         } mpd_spec_t; -}
 #starttype mpd_spec_t
-#field min_width , CInt
-#field prec , CInt
+#field min_width , <mpd_ssize_t>
+#field prec , <mpd_ssize_t>
 #field type , CChar
 #field align , CChar
 #field sign , CChar
@@ -245,15 +250,15 @@
 #field grouping , CString
 #stoptype
 
--- ** Output to a string
+--  Output to a string
 #ccall mpd_to_sci , Ptr <mpd_t> -> CInt -> IO CString
 #ccall mpd_to_eng , Ptr <mpd_t> -> CInt -> IO CString
-#ccall mpd_to_sci_size , Ptr CString -> Ptr <mpd_t> -> CInt -> IO CInt
-#ccall mpd_to_eng_size , Ptr CString -> Ptr <mpd_t> -> CInt -> IO CInt
+#ccall mpd_to_sci_size , Ptr CString -> Ptr <mpd_t> -> CInt -> IO <mpd_ssize_t>
+#ccall mpd_to_eng_size , Ptr CString -> Ptr <mpd_t> -> CInt -> IO <mpd_ssize_t>
 #ccall mpd_validate_lconv , Ptr <mpd_spec_t> -> IO CInt
 #ccall mpd_parse_fmt_str , Ptr <mpd_spec_t> -> CString -> CInt -> IO CInt
-#ccall mpd_qformat_spec , Ptr <mpd_t> -> Ptr <mpd_spec_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CString
-#ccall mpd_qformat , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CString
+#ccall mpd_qformat_spec , Ptr <mpd_t> -> Ptr <mpd_spec_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CString
+#ccall mpd_qformat , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CString
 
 #num MPD_NUM_FLAGS
 #num MPD_MAX_FLAG_STRING
@@ -261,186 +266,185 @@
 #num MPD_MAX_SIGNAL_LIST
 
 
-#ccall mpd_snprint_flags , CString -> CInt -> CUInt -> IO CInt
-#ccall mpd_lsnprint_flags , CString -> CInt -> CUInt -> Ptr CString -> IO CInt
-#ccall mpd_lsnprint_signals , CString -> CInt -> CUInt -> Ptr CString -> IO CInt
-
--- ** Output to a file
+#ccall mpd_snprint_flags , CString -> CInt -> <uint32_t> -> IO CInt
+#ccall mpd_lsnprint_flags , CString -> CInt -> <uint32_t> -> Ptr CString -> IO CInt
+#ccall mpd_lsnprint_signals , CString -> CInt -> <uint32_t> -> Ptr CString -> IO CInt
 
--- next line is removed - prints to a C file object
--- #ccall mpd_fprint , Ptr <_IO_FILE> -> Ptr <mpd_t> -> IO ()
+--  Output to a file
 
+#ccall mpd_fprint , Ptr CFile -> Ptr <mpd_t> -> IO ()
 #ccall mpd_print , Ptr <mpd_t> -> IO ()
 
 
--- ** Assignment from a string
+--  Assignment from a string
 
-#ccall mpd_qset_string , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qset_string , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 
--- ** Set to NaN with error flags
+--  Set to NaN with error flags
 
-#ccall mpd_seterror , Ptr <mpd_t> -> CUInt -> Ptr CUInt -> IO ()
+#ccall mpd_seterror , Ptr <mpd_t> -> <uint32_t> -> Ptr <uint32_t> -> IO ()
 
--- ** Set a special with sign and type
+--  Set a special with sign and type
 
-#ccall mpd_setspecial , Ptr <mpd_t> -> CUChar -> CUChar -> IO ()
+#ccall mpd_setspecial , Ptr <mpd_t> -> <uint8_t> -> <uint8_t> -> IO ()
 
--- ** Set a coefficient to zero or all nines
+--  Set a coefficient to zero or all nines
+
 #ccall mpd_zerocoeff , Ptr <mpd_t> -> IO ()
-#ccall mpd_qmaxcoeff , Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qmaxcoeff , Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 
--- ** Quietly assign a C integer type to an mpd_t
+--  Quietly assign a C integer type to an mpd_t
 
-#ccall mpd_qset_ssize , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qset_i32 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qset_uint , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qset_u32 , Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qset_i64 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qset_u64 , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qset_ssize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qset_i32 , Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qset_uint , Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qset_u32 , Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qset_i64 , Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qset_u64 , Ptr <mpd_t> -> <uint64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 
--- ** Quietly assign a C integer type to an mpd_t with a static coefficient
+--  Quietly assign a C integer type to an mpd_t with a static coefficient
 
-#ccall mpd_qsset_ssize , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsset_i32 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsset_uint , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsset_u32 , Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qsset_ssize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsset_i32 , Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsset_uint , Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsset_u32 , Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 
--- ** Quietly get a C integer type from an mpd_t
+--  Quietly get a C integer type from an mpd_t
 
-#ccall mpd_qget_ssize , Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qget_uint , Ptr <mpd_t> -> Ptr CUInt -> IO CULong
-#ccall mpd_qabs_uint , Ptr <mpd_t> -> Ptr CUInt -> IO CULong
-#ccall mpd_qget_i32 , Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qget_u32 , Ptr <mpd_t> -> Ptr CUInt -> IO CUInt
-#ccall mpd_qget_i64 , Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qget_u64 , Ptr <mpd_t> -> Ptr CUInt -> IO CULong
+#ccall mpd_qget_ssize , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <mpd_ssize_t>
+#ccall mpd_qget_uint , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <mpd_uint_t>
+#ccall mpd_qabs_uint , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <mpd_uint_t>
+#ccall mpd_qget_i32 , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <int32_t>
+#ccall mpd_qget_u32 , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <uint32_t>
+#ccall mpd_qget_i64 , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <int64_t>
+#ccall mpd_qget_u64 , Ptr <mpd_t> -> Ptr <uint32_t> -> IO <uint64_t>
 
--- ** Quiet functions
+--  Quiet functions
 
-#ccall mpd_qcheck_nan , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qcheck_nans , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qfinalize , Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qcheck_nan , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qcheck_nans , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qfinalize , Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 #ccall mpd_class , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CString
-#ccall mpd_qcopy , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr CUInt -> IO CInt
+#ccall mpd_qcopy , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO CInt
 #ccall mpd_qncopy , Ptr <mpd_t> -> IO (Ptr <mpd_t>)
-#ccall mpd_qcopy_abs , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qcopy_negate , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qcopy_sign , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qand , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qinvert , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qlogb , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qscaleb , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qxor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
+#ccall mpd_qcopy_abs , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qcopy_negate , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qcopy_sign , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qand , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qinvert , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qlogb , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qscaleb , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qxor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
 #ccall mpd_same_quantum , Ptr <mpd_t> -> Ptr <mpd_t> -> IO CInt
-#ccall mpd_qrotate , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qshiftl , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr CUInt -> IO CInt
-#ccall mpd_qshiftr , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr CUInt -> IO CULong
-#ccall mpd_qshiftr_inplace , Ptr <mpd_t> -> CInt -> IO CULong
-#ccall mpd_qshift , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qshiftn , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qcmp , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qcompare , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CInt
-#ccall mpd_qcompare_signal , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO CInt
+#ccall mpd_qrotate , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qshiftl , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qshiftr , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <uint32_t> -> IO CULong
+#ccall mpd_qshiftr_inplace , Ptr <mpd_t> -> <mpd_ssize_t> -> IO <mpd_uint_t>
+#ccall mpd_qshift , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qshiftn , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qcmp , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qcompare , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qcompare_signal , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO CInt
 #ccall mpd_cmp_total , Ptr <mpd_t> -> Ptr <mpd_t> -> IO CInt
 #ccall mpd_cmp_total_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> IO CInt
 #ccall mpd_compare_total , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> IO CInt
 #ccall mpd_compare_total_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> IO CInt
-#ccall mpd_qround_to_intx , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qround_to_int , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qtrunc , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qfloor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qceil , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qabs , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmax , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmax_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmin , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmin_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qminus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qplus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qnext_minus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qnext_plus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qnext_toward , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qquantize , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qrescale , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qrescale_fmt , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qreduce , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qfma , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdivint , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qrem , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qrem_near , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdivmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qpow , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qpowmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qexp , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qln10 , Ptr <mpd_t> -> CInt -> Ptr CUInt -> IO ()
-#ccall mpd_qln , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qlog10 , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsqrt , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qinvroot , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qadd_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsub_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qmul_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qdiv_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_sizeinbase , Ptr <mpd_t> -> CUInt -> IO CSize
-#ccall mpd_qimport_u16 , Ptr <mpd_t> -> Ptr CUShort -> CSize -> CUChar -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qimport_u32 , Ptr <mpd_t> -> Ptr CUInt -> CSize -> CUChar -> CUInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qexport_u16 , Ptr (Ptr CUShort) -> CSize -> CUInt -> Ptr <mpd_t> -> Ptr CUInt -> IO CSize
-#ccall mpd_qexport_u32 , Ptr (Ptr CUInt) -> CSize -> CUInt -> Ptr <mpd_t> -> Ptr CUInt -> IO CSize
-
--- * Signalling functions
+#ccall mpd_qround_to_intx , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qround_to_int , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qtrunc , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qfloor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qceil , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qabs , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmax , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmax_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmin , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmin_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qminus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qplus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qnext_minus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qnext_plus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qnext_toward , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qquantize , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qrescale , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qrescale_fmt , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qreduce , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qfma , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdivint , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qrem , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qrem_near , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdivmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qpow , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qpowmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qexp , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qln10 , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qln , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qlog10 , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsqrt , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qinvroot , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qadd_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qsub_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qmul_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qdiv_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint64_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_sizeinbase , Ptr <mpd_t> -> <uint32_t> -> IO CSize
+#ccall mpd_qimport_u16 , Ptr <mpd_t> -> Ptr <uint16_t> -> <size_t> -> <uint8_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qimport_u32 , Ptr <mpd_t> -> Ptr <uint32_t> -> <size_t> -> <uint8_t> -> <uint32_t> -> Ptr <mpd_context_t> -> Ptr <uint32_t> -> IO ()
+#ccall mpd_qexport_u16 , Ptr (Ptr <uint16_t>) -> <size_t> -> <uint32_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO <size_t>
+#ccall mpd_qexport_u32 , Ptr (Ptr <uint32_t>) -> CSize -> <uint32_t> -> Ptr <mpd_t> -> Ptr <uint32_t> -> IO <size_t>
 
+--  Signalling functions
+-- START HERE
 #ccall mpd_format , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> IO CString
-#ccall mpd_import_u16 , Ptr <mpd_t> -> Ptr CUShort -> CSize -> CUChar -> CUInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_import_u32 , Ptr <mpd_t> -> Ptr CUInt -> CSize -> CUChar -> CUInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_export_u16 , Ptr (Ptr CUShort) -> CSize -> CUInt -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CSize
-#ccall mpd_export_u32 , Ptr (Ptr CUInt) -> CSize -> CUInt -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CSize
+#ccall mpd_import_u16 , Ptr <mpd_t> -> Ptr <uint16_t> -> <size_t> -> <uint8_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_import_u32 , Ptr <mpd_t> -> Ptr <uint32_t> -> <size_t> -> <uint8_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_export_u16 , Ptr (Ptr <uint16_t>) -> <size_t> -> <uint32_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <size_t>
+#ccall mpd_export_u32 , Ptr (Ptr <uint32_t>) -> <size_t> -> <uint32_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <size_t>
 #ccall mpd_finalize , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_check_nan , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_check_nans , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_set_string , Ptr <mpd_t> -> CString -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_maxcoeff , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sset_ssize , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sset_i32 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sset_uint , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sset_u32 , Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_ssize , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_i32 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_uint , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_u32 , Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_i64 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_set_u64 , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_get_ssize , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_get_uint , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CULong
-#ccall mpd_abs_uint , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CULong
-#ccall mpd_get_i32 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_get_u32 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CUInt
-#ccall mpd_get_i64 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_get_u64 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CULong
+#ccall mpd_sset_ssize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sset_i32 , Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sset_uint , Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sset_u32 , Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_ssize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_i32 , Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_uint , Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_u32 , Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_i64 , Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_set_u64 , Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_get_ssize , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <mpd_ssize_t>
+#ccall mpd_get_uint , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <mpd_uint_t>
+#ccall mpd_abs_uint , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <mpd_uint_t>
+#ccall mpd_get_i32 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <int32_t>
+#ccall mpd_get_u32 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <uint32_t>
+#ccall mpd_get_i64 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <int64_t>
+#ccall mpd_get_u64 , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO <mpd_uint_t>
 #ccall mpd_and , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_copy , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_canonical , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
@@ -452,9 +456,9 @@
 #ccall mpd_or , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_rotate , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_scaleb , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_shiftl , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_shiftr , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO CULong
-#ccall mpd_shiftn , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_shiftl , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_shiftr , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO <mpd_uint_t>
+#ccall mpd_shiftn , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_shift , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_xor , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_abs , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
@@ -462,20 +466,20 @@
 #ccall mpd_compare , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_compare_signal , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_add , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_sub , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_div , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_divmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_divint , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_exp , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
@@ -488,10 +492,10 @@
 #ccall mpd_min_mag , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_minus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_mul , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> CUInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_ssize , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_i32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int32_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_uint , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_u32 , Ptr <mpd_t> -> Ptr <mpd_t> -> <uint32_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_next_minus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_next_plus , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_next_toward , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
@@ -499,7 +503,7 @@
 #ccall mpd_pow , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_powmod , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_quantize , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_rescale , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_rescale , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_reduce , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_rem , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_rem_near , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
@@ -510,43 +514,30 @@
 #ccall mpd_ceil , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_sqrt , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
 #ccall mpd_invroot , Ptr <mpd_t> -> Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_add_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sub_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_div_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_mul_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
-
--- * Configuration specific
-
--- FIXME might need to remove these - 64 bits only?
-
-#ccall mpd_qsset_i64 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_qsset_u64 , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> Ptr CUInt -> IO ()
-#ccall mpd_sset_i64 , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO ()
-#ccall mpd_sset_u64 , Ptr <mpd_t> -> CULong -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_add_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_sub_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_div_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_i64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <int64_t> -> Ptr <mpd_context_t> -> IO ()
+#ccall mpd_mul_u64 , Ptr <mpd_t> -> Ptr <mpd_t> -> <mpd_uint_t> -> Ptr <mpd_context_t> -> IO ()
 
--- * Get attributes of a decimal
+--  Get attributes of a decimal
 
 #ccall mpd_adjexp , Ptr <mpd_t> -> IO CInt
-#ccall mpd_etiny , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_etop , Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_msword , Ptr <mpd_t> -> IO CULong
-#ccall mpd_word_digits , CULong -> IO CInt
+#ccall mpd_etiny , Ptr <mpd_context_t> -> IO <mpd_ssize_t>
+#ccall mpd_etop , Ptr <mpd_context_t> -> IO <mpd_ssize_t>
+#ccall mpd_msword , Ptr <mpd_t> -> IO <mpd_uint_t>
+#ccall mpd_word_digits , <mpd_uint_t> -> IO CInt
 
--- | most significant digit of a word
-#ccall mpd_msd , CULong -> IO CULong
+#ccall mpd_msd , <mpd_uint_t> -> IO <mpd_uint_t>
 
--- | least significant digit of a word
-#ccall mpd_lsd , CULong -> IO CULong
+#ccall mpd_lsd , <mpd_uint_t> -> IO <mpd_uint_t>
 
--- | coefficient size needed to store digits
-#ccall mpd_digits_to_size , CInt -> IO CInt
+#ccall mpd_digits_to_size , <mpd_ssize_t> -> IO <mpd_ssize_t>
 
--- | number of digits in the exponent, undefined for MPD_SSIZE_MIN
-#ccall mpd_exp_digits , CInt -> IO CInt
+#ccall mpd_exp_digits , <mpd_ssize_t> -> IO CInt
 #ccall mpd_iscanonical , Ptr <mpd_t> -> IO CInt
 #ccall mpd_isfinite , Ptr <mpd_t> -> IO CInt
 #ccall mpd_isinfinite , Ptr <mpd_t> -> IO CInt
@@ -560,27 +551,20 @@
 #ccall mpd_isspecial , Ptr <mpd_t> -> IO CInt
 #ccall mpd_iszero , Ptr <mpd_t> -> IO CInt
 
--- | undefined for special numbers
 #ccall mpd_iszerocoeff , Ptr <mpd_t> -> IO CInt
 #ccall mpd_isnormal , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 #ccall mpd_issubnormal , Ptr <mpd_t> -> Ptr <mpd_context_t> -> IO CInt
 
--- | odd word
-#ccall mpd_isoddword , CULong -> IO CInt
+#ccall mpd_isoddword , <mpd_uint_t> -> IO CInt
 
--- | odd coefficient
 #ccall mpd_isoddcoeff , Ptr <mpd_t> -> IO CInt
 
--- | odd decimal, only defined for integers
 #ccall mpd_isodd , Ptr <mpd_t> -> IO CInt
 
--- | even decimal, only defined for integers
 #ccall mpd_iseven , Ptr <mpd_t> -> IO CInt
 
--- | 0 if dec is positive, 1 if dec is negative
-#ccall mpd_sign , Ptr <mpd_t> -> IO CUChar
+#ccall mpd_sign , Ptr <mpd_t> -> IO <uint8_t>
 
--- | 1 if dec is positive, -1 if dec is negative
 #ccall mpd_arith_sign , Ptr <mpd_t> -> IO CInt
 #ccall mpd_radix , IO CLong
 #ccall mpd_isdynamic , Ptr <mpd_t> -> IO CInt
@@ -589,15 +573,13 @@
 #ccall mpd_isstatic_data , Ptr <mpd_t> -> IO CInt
 #ccall mpd_isshared_data , Ptr <mpd_t> -> IO CInt
 #ccall mpd_isconst_data , Ptr <mpd_t> -> IO CInt
-#ccall mpd_trail_zeros , Ptr <mpd_t> -> IO CInt
+#ccall mpd_trail_zeros , Ptr <mpd_t> -> IO <mpd_ssize_t>
 
--- * Set attributes of a decimal
+--  Set attributes of a decimal
 
--- | set number of decimal digits in the coefficient
 #ccall mpd_setdigits , Ptr <mpd_t> -> IO ()
-#ccall mpd_set_sign , Ptr <mpd_t> -> CUChar -> IO ()
+#ccall mpd_set_sign , Ptr <mpd_t> -> <uint8_t> -> IO ()
 
--- | copy sign from another decimal
 #ccall mpd_signcpy , Ptr <mpd_t> -> Ptr <mpd_t> -> IO ()
 #ccall mpd_set_infinity , Ptr <mpd_t> -> IO ()
 #ccall mpd_set_qnan , Ptr <mpd_t> -> IO ()
@@ -611,35 +593,35 @@
 #ccall mpd_set_shared_data , Ptr <mpd_t> -> IO ()
 #ccall mpd_set_const_data , Ptr <mpd_t> -> IO ()
 #ccall mpd_clear_flags , Ptr <mpd_t> -> IO ()
-#ccall mpd_set_flags , Ptr <mpd_t> -> CUChar -> IO ()
+#ccall mpd_set_flags , Ptr <mpd_t> -> <uint8_t> -> IO ()
 #ccall mpd_copy_flags , Ptr <mpd_t> -> Ptr <mpd_t> -> IO ()
 
--- * Memory handling
+--  Memory handling
 
-#globalvar mpd_mallocfunc , CSize -> IO (Ptr ())
-#callback funptr_mpd_mallocfunc , CSize -> IO (Ptr ())
+#globalvar mpd_mallocfunc , <size_t> -> IO (Ptr ())
+#callback funptr_mpd_mallocfunc , <size_t> -> IO (Ptr ())
 
-#globalvar mpd_callocfunc , CSize -> CSize -> IO (Ptr ())
-#callback funptr_mpd_callocfunc , CSize -> CSize -> IO (Ptr ())
+#globalvar mpd_callocfunc , <size_t> -> <size_t> -> IO (Ptr ())
+#callback funptr_mpd_callocfunc , <size_t> -> <size_t> -> IO (Ptr ())
 
-#globalvar mpd_reallocfunc , Ptr () -> CSize -> IO (Ptr ())
-#callback funptr_mpd_reallocfunc , Ptr () -> CSize -> IO (Ptr ())
+#globalvar mpd_reallocfunc , Ptr () -> <size_t> -> IO (Ptr ())
+#callback funptr_mpd_reallocfunc , Ptr () -> <size_t> -> IO (Ptr ())
 
 #globalvar mpd_free , Ptr () -> IO ()
 #callback funptr_mpd_free , Ptr () -> IO ()
 
-#ccall mpd_callocfunc_em , CSize -> CSize -> IO (Ptr ())
-#ccall mpd_alloc , CSize -> CSize -> IO (Ptr ())
-#ccall mpd_calloc , CSize -> CSize -> IO (Ptr ())
-#ccall mpd_realloc , Ptr () -> CSize -> CSize -> Ptr CUChar -> IO (Ptr ())
-#ccall mpd_sh_alloc , CSize -> CSize -> CSize -> IO (Ptr ())
+#ccall mpd_callocfunc_em , <size_t> -> <size_t> -> IO (Ptr ())
+#ccall mpd_alloc , <size_t> -> <size_t> -> IO (Ptr ())
+#ccall mpd_calloc , <size_t> -> <size_t> -> IO (Ptr ())
+#ccall mpd_realloc , Ptr () -> <size_t> -> <size_t> -> Ptr <uint8_t> -> IO (Ptr ())
+#ccall mpd_sh_alloc , <size_t> -> <size_t> -> <size_t> -> IO (Ptr ())
 #ccall mpd_qnew , IO (Ptr <mpd_t>)
 #ccall mpd_new , Ptr <mpd_context_t> -> IO (Ptr <mpd_t>)
-#ccall mpd_qnew_size , CInt -> IO (Ptr <mpd_t>)
+#ccall mpd_qnew_size , <mpd_ssize_t> -> IO (Ptr <mpd_t>)
 #ccall mpd_del , Ptr <mpd_t> -> IO ()
-#ccall mpd_uint_zero , Ptr CULong -> CSize -> IO ()
-#ccall mpd_qresize , Ptr <mpd_t> -> CInt -> Ptr CUInt -> IO CInt
-#ccall mpd_qresize_zero , Ptr <mpd_t> -> CInt -> Ptr CUInt -> IO CInt
+#ccall mpd_uint_zero , Ptr <mpd_uint_t> -> <size_t> -> IO ()
+#ccall mpd_qresize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <uint32_t> -> IO CInt
+#ccall mpd_qresize_zero , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <uint32_t> -> IO CInt
 #ccall mpd_minalloc , Ptr <mpd_t> -> IO ()
-#ccall mpd_resize , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO CInt
-#ccall mpd_resize_zero , Ptr <mpd_t> -> CInt -> Ptr <mpd_context_t> -> IO CInt
+#ccall mpd_resize , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO CInt
+#ccall mpd_resize_zero , Ptr <mpd_t> -> <mpd_ssize_t> -> Ptr <mpd_context_t> -> IO CInt
