Commit fcf9b591 authored by Simon Marlow's avatar Simon Marlow
Browse files

add IntPtr/WordPtr

parent b29ec9fc
......@@ -226,6 +226,6 @@ An instance can define either this and \haddockid{rotateL} or the unified
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
instance\ Bits\ Int\\instance\ Bits\ Int8\\instance\ Bits\ Int16\\instance\ Bits\ Int32\\instance\ Bits\ Int64\\instance\ Bits\ Integer\\instance\ Bits\ Word\\instance\ Bits\ Word8\\instance\ Bits\ Word16\\instance\ Bits\ Word32\\instance\ Bits\ Word64\\instance\ Bits\ CChar\\instance\ Bits\ CSChar\\instance\ Bits\ CUChar\\instance\ Bits\ CShort\\instance\ Bits\ CUShort\\instance\ Bits\ CInt\\instance\ Bits\ CUInt\\instance\ Bits\ CLong\\instance\ Bits\ CULong\\instance\ Bits\ CLLong\\instance\ Bits\ CULLong\\instance\ Bits\ CPtrdiff\\instance\ Bits\ CSize\\instance\ Bits\ CWchar\\instance\ Bits\ CSigAtomic\\instance\ Bits\ CIntPtr\\instance\ Bits\ CUIntPtr\\instance\ Bits\ CIntMax\\instance\ Bits\ CUIntMax
instance\ Bits\ Int\\instance\ Bits\ Int8\\instance\ Bits\ Int16\\instance\ Bits\ Int32\\instance\ Bits\ Int64\\instance\ Bits\ Integer\\instance\ Bits\ Word\\instance\ Bits\ Word8\\instance\ Bits\ Word16\\instance\ Bits\ Word32\\instance\ Bits\ Word64\\instance\ Bits\ WordPtr\\instance\ Bits\ IntPtr\\instance\ Bits\ CChar\\instance\ Bits\ CSChar\\instance\ Bits\ CUChar\\instance\ Bits\ CShort\\instance\ Bits\ CUShort\\instance\ Bits\ CInt\\instance\ Bits\ CUInt\\instance\ Bits\ CLong\\instance\ Bits\ CULong\\instance\ Bits\ CLLong\\instance\ Bits\ CULLong\\instance\ Bits\ CPtrdiff\\instance\ Bits\ CSize\\instance\ Bits\ CWchar\\instance\ Bits\ CSigAtomic\\instance\ Bits\ CIntPtr\\instance\ Bits\ CUIntPtr\\instance\ Bits\ CIntMax\\instance\ Bits\ CUIntMax
\end{tabular}]
\end{haddockdesc}
\ No newline at end of file
......@@ -5,7 +5,8 @@
module Foreign.Ptr (
Ptr, nullPtr, castPtr, plusPtr, alignPtr, minusPtr, FunPtr,
nullFunPtr, castFunPtr, castFunPtrToPtr, castPtrToFunPtr,
freeHaskellFunPtr
freeHaskellFunPtr, IntPtr, ptrToIntPtr, intPtrToPtr, WordPtr,
ptrToWordPtr, wordPtrToPtr
) where\end{verbatim}}
\haddockendheader
......@@ -211,4 +212,68 @@ Release the storage associated with the given \haddockid{FunPtr}, which
no longer required; otherwise, the storage it uses will leak.
\par
\end{haddockdesc}
\section{Integral types with lossless conversion to and from pointers
}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
data\ IntPtr
\end{tabular}]\haddockbegindoc
A signed integral type that can be losslessly converted to and from
\haddocktt{Ptr}. This type is also compatible with the C99 type \haddocktt{intptr{\char '137}t}, and
can be marshalled to and from that type safely.
\par
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
instance\ Bounded\ IntPtr\\instance\ Enum\ IntPtr\\instance\ Eq\ IntPtr\\instance\ Integral\ IntPtr\\instance\ Num\ IntPtr\\instance\ Ord\ IntPtr\\instance\ Read\ IntPtr\\instance\ Real\ IntPtr\\instance\ Show\ IntPtr\\instance\ Storable\ IntPtr\\instance\ Bits\ IntPtr
\end{tabular}]
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
ptrToIntPtr\ ::\ Ptr\ a\ ->\ IntPtr
\end{tabular}]\haddockbegindoc
casts a \haddocktt{Ptr} to an \haddocktt{IntPtr}
\par
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
intPtrToPtr\ ::\ IntPtr\ ->\ Ptr\ a
\end{tabular}]\haddockbegindoc
casts an \haddocktt{IntPtr} to a \haddocktt{Ptr}
\par
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
data\ WordPtr
\end{tabular}]\haddockbegindoc
An unsigned integral type that can be losslessly converted to and from
\haddocktt{Ptr}. This type is also compatible with the C99 type \haddocktt{uintptr{\char '137}t}, and
can be marshalled to and from that type safely.
\par
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
instance\ Bounded\ WordPtr\\instance\ Enum\ WordPtr\\instance\ Eq\ WordPtr\\instance\ Integral\ WordPtr\\instance\ Num\ WordPtr\\instance\ Ord\ WordPtr\\instance\ Read\ WordPtr\\instance\ Real\ WordPtr\\instance\ Show\ WordPtr\\instance\ Storable\ WordPtr\\instance\ Bits\ WordPtr
\end{tabular}]
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
ptrToWordPtr\ ::\ Ptr\ a\ ->\ WordPtr
\end{tabular}]\haddockbegindoc
casts a \haddocktt{Ptr} to a \haddocktt{WordPtr}
\par
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
wordPtrToPtr\ ::\ WordPtr\ ->\ Ptr\ a
\end{tabular}]\haddockbegindoc
casts a \haddocktt{WordPtr} to a \haddocktt{Ptr}
\par
\end{haddockdesc}
\ No newline at end of file
......@@ -160,6 +160,6 @@ Write the given value to the given memory location. Alignment
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
instance\ Storable\ Bool\\instance\ Storable\ Char\\instance\ Storable\ Double\\instance\ Storable\ Float\\instance\ Storable\ Int\\instance\ Storable\ Int8\\instance\ Storable\ Int16\\instance\ Storable\ Int32\\instance\ Storable\ Int64\\instance\ Storable\ Word\\instance\ Storable\ Word8\\instance\ Storable\ Word16\\instance\ Storable\ Word32\\instance\ Storable\ Word64\\instance\ Storable\ CChar\\instance\ Storable\ CSChar\\instance\ Storable\ CUChar\\instance\ Storable\ CShort\\instance\ Storable\ CUShort\\instance\ Storable\ CInt\\instance\ Storable\ CUInt\\instance\ Storable\ CLong\\instance\ Storable\ CULong\\instance\ Storable\ CLLong\\instance\ Storable\ CULLong\\instance\ Storable\ CFloat\\instance\ Storable\ CDouble\\instance\ Storable\ CPtrdiff\\instance\ Storable\ CSize\\instance\ Storable\ CWchar\\instance\ Storable\ CSigAtomic\\instance\ Storable\ CClock\\instance\ Storable\ CTime\\instance\ Storable\ CIntPtr\\instance\ Storable\ CUIntPtr\\instance\ Storable\ CIntMax\\instance\ Storable\ CUIntMax\\instance\ Storable\ (StablePtr\ a)\\instance\ Storable\ (Ptr\ a)\\instance\ Storable\ (FunPtr\ a)
instance\ Storable\ Bool\\instance\ Storable\ Char\\instance\ Storable\ Double\\instance\ Storable\ Float\\instance\ Storable\ Int\\instance\ Storable\ Int8\\instance\ Storable\ Int16\\instance\ Storable\ Int32\\instance\ Storable\ Int64\\instance\ Storable\ Word\\instance\ Storable\ Word8\\instance\ Storable\ Word16\\instance\ Storable\ Word32\\instance\ Storable\ Word64\\instance\ Storable\ WordPtr\\instance\ Storable\ IntPtr\\instance\ Storable\ CChar\\instance\ Storable\ CSChar\\instance\ Storable\ CUChar\\instance\ Storable\ CShort\\instance\ Storable\ CUShort\\instance\ Storable\ CInt\\instance\ Storable\ CUInt\\instance\ Storable\ CLong\\instance\ Storable\ CULong\\instance\ Storable\ CLLong\\instance\ Storable\ CULLong\\instance\ Storable\ CFloat\\instance\ Storable\ CDouble\\instance\ Storable\ CPtrdiff\\instance\ Storable\ CSize\\instance\ Storable\ CWchar\\instance\ Storable\ CSigAtomic\\instance\ Storable\ CClock\\instance\ Storable\ CTime\\instance\ Storable\ CIntPtr\\instance\ Storable\ CUIntPtr\\instance\ Storable\ CIntMax\\instance\ Storable\ CUIntMax\\instance\ Storable\ (StablePtr\ a)\\instance\ Storable\ (Ptr\ a)\\instance\ Storable\ (FunPtr\ a)
\end{tabular}]
\end{haddockdesc}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment