úÎĺÜÚgŸ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ Ą˘Ł¤ĽŚ§¨Ÿ¤ĽŚ§¨Ÿ¤ĽŚ§¨ portable  experimental tamar@zhox.com A simple stack implementation ŠŞŤŹ*Pretty print a stack back out to a string Creating an empty stack #Create a new stack from a template *Adding an element to the top of the stack ,Remove an element from the top of the stack ALook at the item at the top of the stack, but does not remove it ;The size of the stack e.g the amount of elements inside it GShrinks and Compress the stack, reducing the stack to the bare minimum  of steps/)calls needed to represent the same stack       portable  experimental tamar@zhox.com  The allocation structure/1record that is used to keep track of allocations DIdentifier which shows which function was invoked to do allocations ­ŽŻ0The directory in which to write the results to. )The file to write the results too °*Synchronization variable between threads. 5Write out a single allocation structure out to file.        portable  experimental tamar@zhox.com PRe-export of the Foreign.Marshal.Alloc.alloca function taking an explicit stack PRe-export of the Foreign.Marshal.Alloc.malloc function taking an explicit stack cRe-export of the Foreign.Marshal.Alloc.realloc function taking an explicit stack EThis function record the allocation information about a Ptr we couldn' t override it's allocation function for. !This function mirrors record* in its function. Except that the value it'!s given might not be a ptr value "AFree a ptr that is not a normal Ptr type, (e.g. ForeignPtr etc) #BFree a ptr that is not a normal Ptr type, (e.g. ForeignPtr etc), I however it does not record the size of the value held by the pointer. 8 as such, it has no need for the Storable requirement $PRe-export of the Foreign.Marshal.Alloc.free function taking an explicit stack  !"#$ !"#$ !"#$ portable  experimental tamar@zhox.com %&%&%&%&portable experimentaltamar@zhox.com'()*+,'()*+,)*,+(''()*+, portable  experimental tamar@zhox.com -.List containing mapping to C/ C++ Types /#Contains a list of mapping types. 8 This is the first list to be extended by the pragmas 7 We need to preserve the Haskell type name for later  transformations and for FFI 0List of type conversion from C/C++ to C# types 1List containing mapping to C# Types 2#List containing mapping to CSizes -./012-./012-./012portable experimentaltamar@zhox.com3\Annotated type, basically a 4-tuple that holds all possible information on a datatype field 45FThe field name, if this is a record the name will be the record name. 6#The preprocessed type of the field 7%The type annotations for the antType 8!The original unpreprocessed type 9,The module that originally defined the type :HAnnotation on functions, This allows more complex types to be expressed ;<KOffsets into the type list to indicate which fields are counters for lists =-Indicates if the field type is a List type. >Indices/COffsets to indicate whether this function has any StablePtr values ?BCopy of the definition list for the Haskell translation functions @<Copy of the definition list for the C translation functions ABCopy of the definition list for the C sizes translation functions B%Copy of the definition list for the C# translation functions C9Indicates is debugging has been enabled for this session DEFGHIJKLMNOGeneric empty annotation P8Find any Names embedded within any arbitraty structures 3456789:;<=>?@ABCDEFGHIJKLMNOPNMLKJIHGFE:;<=>?@ABCD3456789OP3456789456789: ;<=>?@ABCD;<=>?@ABCDEFGHIJKLMNOPportable experimentaltamar@zhox.com*Q0A class that manages the conversion between the normal and type supported by ffi. C Minimal implementation requires atleast one of the pair toNativetoFFI and fromNative fromFFI. f The implementation will almost always call fromNative and toNative because all exported functions m are in IO since they all might have side-effects. The only exception to this is for the defaults provided  in this module. RSTUVWX`Typeclase to allow Left LoaD transform. It is basically to allow a transformation to take place  at the last argument/Nreturn type of the function. This is because most of the functions are in IO. YZ(Tuples are not FFI compatible, As such i'/ll translate them to a build in tuple datatype  . W This function translates the embedded types of a Ty to the correct forms using the  function translate' (see below) [GTranslate everything but applied types. e.g. Foo Token -> FooPtr Token : And lists, since lists are implicitly an applied type:  e.g [Token] -->> [] Token -->> Ptr Token \FCheck to see if the next type is a Simple type. e.g. A TyVar or TyCon ]IContrary to translate translatePrimitive will only transform the defined  primitive types in the convList +below. This is because while a transformed X signature should only be partially transformed till the first application (Since that'll be e the main pointer) we should pre-transform the primitive types into their well known static forms. ^OHelper function to define translatePrimitive. It attemps to lookup the type in convList but  in the case where it'*s not found the search query is returned. _PTranslate Partial Form, This is basically translatePrimitive . translatePartial `[Look up the FFI type representation of the given type. Moreover when the type is not found N it is assumed to be a new structure and it is assumed to be a pointer value. a"Remove all spaces from a sentence b>A function to split a list of elements by the given seperator ąInstance for Functor classes ˛=Convertion instance for Integer types to CLLongs (long long) ł*Simplistic instance of Storable for list. " untested but (new [(1::Int)..10]. >>=return.castPtr >>= peekArray 10 :: IO [Int] ) works ´GOne way instance for returning lists as the result of a function call. K We assume to have an int* as an argument and then fill that in with the  length ľ@Cover lists to array convertion IF the type is also an FFI type śRAny class implementing Storable has implemented enough to be considered a FFIType ˇCInstance for unboxed integers, which are first boxed then returned % instance FFIType FastInt CInt where  toFFI = toFFI . iBox  fromFFI = iUnbox . fromFFI Fix float instances ¸EFix integers from the machine dependend values to fixed 32bit values š(Convert between FastString and CWString şRAnother simple identity instance, I really need to get that overlapping instances  looked at. ťRAnother simple identity instance, I really need to get that overlapping instances  looked at. źRAnother simple identity instance, I really need to get that overlapping instances  looked at. ˝RAnother simple identity instance, I really need to get that overlapping instances  looked at. žRAnother simple identity instance, I really need to get that overlapping instances  looked at. ż>Intermediate conversion instance for storing values of arrays ŔQI decided to use a CAString because on windows this gives me a constant 16 value Á1Tranform functions to and from the correct types Q TODO: Update this variant to use the impure variants, This will be an issue.. ÂA FunPtr instance ĂA StorablePtr instance Ä[Convert booleans to Int8 to save space for use when using the ccall or stdcall conventions Ĺ\Convert booleans to Word8 to save space for use when using the ccall or stdcall conventions ĆNConvert booleans to Cints for use when using the ccall or stdcall conventions Ç4Numeral values are all also already FFI values, If I'%ve read the documentation correctly @ Due to GHC matching only the instance heads this instance can'(t unfortunately be used. (Booo bad GHC) % instance Num a => FFIType a a where  toFFI = const id  fromFFI = const id -Booleans are by default already an FFI value ČPDefault values needed to satisfy .NET marshaller when having unused structures. 2 class FFIType phi ix => FFIDefaults phi ix where  class Default phi where  nDefault :: phi +Wrapper functions for dealing with FunPtrs R wrapFn :: (FFIType (IO a) ca, FFIType b (IO cb)) => (a -> IO b) -> (ca -> IO cb) & wrapFn fn = fromFFI >=> fn >=> toFFI Dedicated instance for () QRSTUVWXYZ[\]^_`abXYQRSTUVWZ[\]^_`abQRSTUVWRSTUVWXYYZ[\]^_`ab portable experimentaltamar@zhox.comcdefghijklmnopqrstuvwcdefghijklmnopqrstuvwvwturspqnolmjkihgfedccdefghijkklmmnoopqqrsstuuvww portable experimentaltamar@zhox.com*x0A class that manages the conversion between the normal and type supported by ffi. C Minimal implementation requires atleast one of the pair toNativetoFFI and fromNative fromFFI. f The implementation will almost always call fromNative and toNative because all exported functions m are in IO since they all might have side-effects. The only exception to this is for the defaults provided  in this module. yz{|}~`Typeclase to allow Left LoaD transform. It is basically to allow a transformation to take place  at the last argument/Nreturn type of the function. This is because most of the functions are in IO. €(Tuples are not FFI compatible, As such i'/ll translate them to a build in tuple datatype  . W This function translates the embedded types of a Ty to the correct forms using the  function translate' (see below) ‚GTranslate everything but applied types. e.g. Foo Token -> FooPtr Token : And lists, since lists are implicitly an applied type:  e.g [Token] -->> [] Token -->> Ptr Token ƒFCheck to see if the next type is a Simple type. e.g. A TyVar or TyCon „IContrary to translate translatePrimitive will only transform the defined  primitive types in the convList +below. This is because while a transformed X signature should only be partially transformed till the first application (Since that'll be e the main pointer) we should pre-transform the primitive types into their well known static forms. …OHelper function to define translatePrimitive. It attemps to lookup the type in convList but  in the case where it'*s not found the search query is returned. †PTranslate Partial Form, This is basically translatePrimitive . translatePartial ‡[Look up the FFI type representation of the given type. Moreover when the type is not found N it is assumed to be a new structure and it is assumed to be a pointer value. ˆ"Remove all spaces from a sentence ‰>A function to split a list of elements by the given seperator ÉInstance for Functor classes Ę=Convertion instance for Integer types to CLLongs (long long) Ë*Simplistic instance of Storable for list. " untested but (new [(1::Int)..10]. >>=return.castPtr >>= peekArray 10 :: IO [Int] ) works ĚGOne way instance for returning lists as the result of a function call. K We assume to have an int* as an argument and then fill that in with the  length Í@Cover lists to array convertion IF the type is also an FFI type ÎRAny class implementing Storable has implemented enough to be considered a FFIType ĎCInstance for unboxed integers, which are first boxed then returned % instance FFIType FastInt CInt where  toFFI = toFFI . iBox  fromFFI = iUnbox . fromFFI Fix float instances ĐEFix integers from the machine dependend values to fixed 32bit values Ń(Convert between FastString and CWString ŇRAnother simple identity instance, I really need to get that overlapping instances  looked at. ÓRAnother simple identity instance, I really need to get that overlapping instances  looked at. ÔRAnother simple identity instance, I really need to get that overlapping instances  looked at. ŐRAnother simple identity instance, I really need to get that overlapping instances  looked at. ÖRAnother simple identity instance, I really need to get that overlapping instances  looked at. ×>Intermediate conversion instance for storing values of arrays ŘQI decided to use a CAString because on windows this gives me a constant 16 value Ů1Tranform functions to and from the correct types Q TODO: Update this variant to use the impure variants, This will be an issue.. ÚA FunPtr instance ŰA StorablePtr instance Ü[Convert booleans to Int8 to save space for use when using the ccall or stdcall conventions Ý\Convert booleans to Word8 to save space for use when using the ccall or stdcall conventions ŢNConvert booleans to Cints for use when using the ccall or stdcall conventions ß4Numeral values are all also already FFI values, If I'%ve read the documentation correctly @ Due to GHC matching only the instance heads this instance can'(t unfortunately be used. (Booo bad GHC) % instance Num a => FFIType a a where  toFFI = id  fromFFI = id -Booleans are by default already an FFI value ŕPDefault values needed to satisfy .NET marshaller when having unused structures. 2 class FFIType phi ix => FFIDefaults phi ix where  class Default phi where  nDefault :: phi +Wrapper functions for dealing with FunPtrs R wrapFn :: (FFIType (IO a) ca, FFIType b (IO cb)) => (a -> IO b) -> (ca -> IO cb) & wrapFn fn = fromFFI >=> fn >=> toFFI Dedicated instance for () xyz{|}~€‚ƒ„…†‡ˆ‰€xyz{|}~‚ƒ„…†‡ˆ‰xyz{|}~yz{|}~€€‚ƒ„…†‡ˆ‰ portable experimentaltamar@zhox.comŠ‹ŒŽ‘’“”•–—˜™š›œžŠ‹ŒŽ‘’“”•–—˜™š›œžž›œ™š—˜•–“”‘’ŽŒ‹ŠŠ‹ŒŽ‘’’“””•––—˜˜™šš›œœžž portable experimentaltamar@zhox.comá !"#$%&'()*+,-./0123456789:;<=>?@@ABCDEFFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm n o p q r s t u u v v w w x x y y z z { { \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u u v v w w x x y y z z { { | } ~  €  ‚ ƒ „ …†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤Ľ Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   Ą ˘ Ł ¤ ĽŚ Hs2lib-0.5.0WinDll.Debug.StackWinDll.Debug.RecordsWinDll.Debug.AllocWinDll.Debug.ExportsWinDll.Lib.InstancesTypesWinDll.Lib.NativeWinDll.Structs.TypesWinDll.Lib.NativeMapping_DebugWinDll.Lib.Tuples_DebugWinDll.Lib.NativeMappingWinDll.Lib.Tuples Paths_Hs2libWinDll.Lib.Converter StackabletoStackStack FunctionName printStack emptyStacknewStack pushStackpopStacktopStack sizeStack shrinkStackMemAllocMemFreememFunmemStackmemStartmemStopmemSizememTimeCallerRecordOtherReAllocAllocMallocfileName writeMemAllocallocamallocreallocrecordrecordM freeDefault freeUnknownfreefreeSfreeC EitherPtrMaybePtr maybenothing maybejust eitherleft eitherrightDefsnativeLisths2cnativeConvListnativeC2cslist nativeCslist nativeC_sizesAnnTypeantNameantTypeantAnn antOrigType antModuleAnnannArrayIndicesannArrayIsListannStableIndices annWorkingSetannWorkingSetCannWorkingSetCSizeannWorkingSetCsannDebug annModuleTypes AnnNamedTypes NamedTypes TypeNamesTypeNameType ExportNameImport ModuleNameNamenoAnn findStrings'FFITypetoFFIfromFFIfromList fromNativetoNativefreeFFILLDlld translatetranslatePartial isSimpleTypetranslatePrimitive translatePtranslatePForm translate'trimsplit Tuple8Ptr Tuple7Ptr Tuple6Ptr Tuple5Ptr Tuple4Ptr Tuple3Ptr Tuple2PtrTuple8Tuple7Tuple6Tuple5Tuple4Tuple3Tuple2versionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileNameRecursedCombinedThenEmptyMemSize PtrLocation directoryfileLock $fFFITypeff$fFFITypeIntegera $fStorable[]$fFFIType[](->)$fFFIType[]Ptr $fFFITypeaPtr$fFFITypeFloatCFloat$fFFITypeIntCInt$fFFITypeFastStringPtr$fFFITypeCLLongCLLong$fFFITypeCDoubleCDouble$fFFITypeCIntCInt$fFFITypePtrPtr$fFFITypeCWcharCWchar$fFFIType[]Ptr0$fFFIType[]Ptr1$fFFIType(->)(->)$fFFITypeFunPtrFunPtr$fFFITypeStablePtrStablePtr$fFFITypeBoolInt8$fFFITypeBoolWord8$fFFITypeBoolCInt$fFFITypeBoolBool $fFFIType()()